/* The preview switches projects; only the separate link downloads the PDF. */
html[data-style] .portfolio-download.portfolio-carousel {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
  grid-template-rows: none;
  gap: 14px;
  align-items: stretch;
  align-content: normal;
  align-self: start;
  justify-content: flex-start;
  min-height: 0;
  height: auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  padding: 20px;
}
html[data-style] .portfolio-carousel:before,
html[data-style] .portfolio-carousel:after { display: none; }
html[data-style=engineering] .portfolio-download.portfolio-carousel {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 16px;
}
html[data-style] .portfolio-header { display: grid; gap: 5px; min-width: 0; }
html[data-style] .portfolio-header h2 {
  font-family: var(--sans);
  font-size: clamp(19px, 1.8vw, 26px);
  line-height: 1.5;
  letter-spacing: 0;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
html[data-style=editorial] .portfolio-header h2 { font-family: var(--editorial-heading); }
html[data-style=cartoon] .portfolio-header h2 {
  font-family: var(--comic-font);
  font-size: 28px;
  font-weight: 400;
  rotate: -2deg;
  transform-origin: left center;
}
html[data-style] .portfolio-header > span { font-family: var(--mono); font-size: 8px; line-height: 1.6; color: var(--muted); }
html[data-style] .portfolio-stage {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  flex: 0 0 auto;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: #f5f6f8;
  cursor: pointer;
}
html[data-style] .portfolio-stage > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
}
html[data-style=cartoon] .portfolio-stage { border: 1.5px solid var(--comic-ink); box-shadow: 2px 3px 0 #30332b20; }
html[data-style] .portfolio-caption { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 10px; }
html[data-style] .portfolio-caption h3 { font-family: var(--sans); font-size: 13px; font-weight: 550; line-height: 1.6; margin: 0; overflow-wrap: anywhere; }
html[data-style=cartoon] .portfolio-caption h3 { font-family: var(--comic-font); font-weight: 400; font-size: 16px; }
html[data-style] #portfolio-position { font-family: var(--mono); font-size: 10px; color: var(--secondary); white-space: nowrap; }
html[data-style] .portfolio-help { font-size: 11px; line-height: 1.6; }
@media (min-width: 681px) and (max-width: 1200px) {
  html[data-style=editorial] .portfolio-download.portfolio-carousel,
  html[data-style=cartoon] .portfolio-download.portfolio-carousel {
    grid-column: 1 / -1;
    width: min(100% - 12px, 540px);
    max-width: 540px;
    justify-self: center;
    margin-inline: 6px;
  }
}
@media (max-width: 680px) {
  html[data-style] .portfolio-download.portfolio-carousel {
    padding: 20px;
    gap: 14px;
    max-width: 440px;
    width: calc(100% - 12px);
    align-self: center;
    margin-inline: 6px;
  }
  html[data-style] .portfolio-stage { aspect-ratio: 8 / 5; }
  html[data-style] .portfolio-header h2 { font-size: 25px; }
}
@media (max-width: 380px) {
  html[data-style] .portfolio-download.portfolio-carousel { padding: 16px; }
  html[data-style] .portfolio-caption h3 { font-size: 12px; }
  html[data-style=cartoon] .portfolio-caption h3 { font-size: 15px; }
}
@media print {
    html[data-style] .portfolio-download.portfolio-carousel { box-shadow: none; rotate: none; }
}
