/* ============================================================================
   Portland Postcard Company (006) — per-post styles
   Sections:  hero/CTA · flip cards · pricing table
   ============================================================================ */

/* ---- Full-bleed parallax hero -------------------------------------------- */
/* The default Quarto title block is hidden; the hero (below) carries the title,
   and the byline is re-rendered as .pc-postmeta just above "The story". */
#title-block-header {
  display: none;
}

.pc-hero {
  position: relative;
  z-index: 3; /* sits above the sticky TOC while it's on screen */
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 1.2rem;
  /* dark gradient over the photo for text legibility + the photo itself.
     background-attachment:fixed gives the parallax (photo stays put on scroll) */
  background-image: linear-gradient(rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.28)),
    url(images/hero-big.jpeg);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
}

/* the mostly-transparent text box */
.pc-hero__card {
  max-width: 640px;
  text-align: center;
  color: #fff;
  background: rgba(14, 17, 22, 0.5);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: clamp(1.6rem, 4vw, 3rem);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  will-change: transform, opacity;
}
.pc-hero__title {
  font-family: 'Futura', 'Futura PT', 'Open Sans', Arial, sans-serif; 
  font-weight: 700;
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin: 0 0 0.6rem;
  color: #fff;
  border: none;
  padding: 0;
}
.pc-hero__subtitle {
  font-family: var(--serif, Georgia, serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 1rem;
}
.pc-hero__desc {
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.86);
  margin: 0 0 1.6rem;
}

/* on smaller phones the fixed background is janky (esp. iOS) — use scroll */
@media (max-width: 700px) {
  .pc-hero {
    background-attachment: scroll, scroll;
    min-height: 88vh;
  }
}

/* CTA button row (shared by hero + contact). Centered. */
.pc-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin: 0;
}
/* ghost buttons need light styling over the dark hero */
.pc-hero .home-btn.ghost {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.55);
}
.pc-hero .home-btn.ghost:hover {
  border-color: #fff;
  color: #fff !important;
}

/* Relocated byline (author · date · category), just under the hero. */
.pc-postmeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1.6rem 0 0.5rem;
  font-family: var(--display, sans-serif);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.pc-postmeta__sep {
  opacity: 0.5;
}
.pc-postmeta__cat {
  border: 1px solid var(--tag-border, var(--border));
  color: var(--tag-fg, var(--muted));
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.68rem;
}

/* ---- Postcard flip cards -------------------------------------------------- */
.pc-card {
  margin: 1rem 0 2.6rem;
}

/* Separator between postcards, so one card's image doesn't read as attached to
   the next postcard's title. */
.pc-sep {
  border: none;
  border-top: 6px solid color-mix(in srgb, var(--border), #000 15%);
  margin: 3.2rem 0 2.6rem;
}

.pc-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}
.pc-pill {
  font-family: var(--display, sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.pc-pill:hover {
  color: var(--teal);
  border-color: var(--teal);
}
.pc-pill.is-active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* The stage gives the flip some depth; .pc-flip is what actually rotates. */
.pc-stage {
  perspective: 1600px;
}
.pc-flip {
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  transition: transform 0.2s ease;
  will-change: transform;
}
.pc-card.is-flipping .pc-flip {
  transform: rotateY(90deg); /* edge-on; the JS swaps the face here */
}

/* Only the active face is shown. */
.pc-face {
  display: none;
}
.pc-face.is-active {
  display: block;
}
.pc-face img {
  height: auto;
  display: block;
  margin: 0 auto;
  max-width: min(560px, 100%); /* every view shown at the same full size */
  border-radius: 6px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.16), 0 1px 5px rgba(0, 0, 0, 0.09);
  cursor: zoom-in;
}
/* Multi-image face (several originals/photos): stack them vertically, each at
   the same full size as a single view. Gated on .is-active so a hidden gallery
   face stays hidden (its display:flex would otherwise beat .pc-face{display:none}). */
.pc-face--gallery.is-active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Caption under a view (only "photo" has one). */
.pc-face-caption {
  max-width: min(560px, 100%);
  margin: 0.7rem auto 0;
  text-align: center;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--muted);
}

/* Respect users who ask for less motion — skip the flip, just swap. */
@media (prefers-reduced-motion: reduce) {
  .pc-flip {
    transition: none;
  }
  .pc-card.is-flipping .pc-flip {
    transform: none;
  }
}

/* ---- Pricing table (reactable) -------------------------------------------- */
/* whole data rows are clickable (onClick = "expand") — show it */
.reactable .rt-tbody .rt-tr {
  cursor: pointer;
}
.pc-price {
  line-height: 1.15;
}
.pc-price strong {
  font-size: 0.98rem;
}
.pc-ppp {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
}
.pc-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* Expandable detail row: description first, then front/back images, then prices. */
.pc-detail {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0.4rem 0.2rem 1rem;
}
.pc-detail-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}
.pc-detail-imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-start;
}
/* cap by width AND height so portrait + landscape cards sit side by side at
   their true aspect ratio (no squishing) */
.pc-detail-imgs img {
  width: auto;
  height: auto;
  max-width: 260px;
  max-height: 210px;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  cursor: zoom-in;
}

/* Price list inside the expandable detail. Hidden on desktop (the table
   columns already show prices); revealed on phones where those columns hide. */
.pc-detail-prices {
  display: none;
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}
.pc-price-item {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.15rem 0;
}
.pc-price-q {
  min-width: 3em;
  color: var(--muted);
  font-size: 0.8rem;
}
.pc-price-item .pc-ppp {
  display: inline;
}

/* ---- Image lightbox ------------------------------------------------------- */
.pc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 3vmin;
  background: rgba(0, 0, 0, 0.86);
  cursor: zoom-out;
}
.pc-lightbox.is-open {
  display: flex;
}
.pc-lightbox__img {
  max-width: 96vw;
  max-height: 94vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.6);
}

/* ---- Dark mode: pricing table -------------------------------------------- */
/* reactable paints itself on a white surface, which clashes with the near-black
   page in dark mode. Repaint it a dark grey — a touch lighter than the page bg
   (#0d1117) so the table still reads as its own surface. */
body.quarto-dark .reactable,
body.quarto-dark .reactable .rt-table,
body.quarto-dark .reactable .rt-thead,
body.quarto-dark .reactable .rt-tbody,
body.quarto-dark .reactable .rt-tfoot,
body.quarto-dark .reactable .rt-tr,
body.quarto-dark .reactable .rt-th,
body.quarto-dark .reactable .rt-td {
  background-color: #1a1f27 !important;
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.1) !important;
}
/* header row a little darker for separation */
body.quarto-dark .reactable .rt-thead .rt-th {
  background-color: #151a21 !important;
}
/* row hover highlight */
body.quarto-dark .reactable .rt-tr:hover .rt-td {
  background-color: #242b34 !important;
}
/* expanded detail row, recessed slightly */
body.quarto-dark .reactable .rt-tr-details,
body.quarto-dark .reactable .rt-td-details {
  background-color: #14181e !important;
}

/* Phones: hide the price columns (their numbers move into the detail), drop the
   now-empty grouped header row, and let the table shrink to the screen. */
@media (max-width: 600px) {
  .pc-hide-sm {
    display: none !important;
  }
  /* the grouped "Price for quantity" header row is empty once the price
     columns are gone — remove it */
  .reactable .rt-thead .rt-tr:first-child {
    display: none;
  }
  /* reactable stamps an inline min-width (sum of ALL columns, hidden included)
     onto the table AND every row/body element, forcing a horizontal scroll.
     Release it everywhere so the Postcard column fills the screen instead. */
  .reactable .rt-table,
  .reactable .rt-thead,
  .reactable .rt-tbody,
  .reactable .rt-tr {
    min-width: 0 !important;
  }
  .pc-detail-prices {
    display: block;
  }
  .pc-detail-imgs img {
    max-width: 44vw;
    max-height: 160px;
  }
  .pc-detail {
    gap: 0.7rem;
  }
}
