/* ==========================================================================
   Hannah & Abdullah — shared stylesheet for the interior guest pages.
   Matches the production save-the-date: the oil-painted Golden Horn as a
   full-bleed backdrop, bougainvillea framing the top corners, and warm ivory
   "paper" cards (the same pill treatment as the home buttons) holding content.
   Home (index.html) is self-contained and does not use this file.
   ========================================================================== */

:root {
  --ivory: #fff8e8;
  --ink: #5a2618;
  --coral: #ec6f4f;
  --turquoise: #177b9d;
  --gold: #c58a3a;

  --button-shadow: rgb(72 43 28 / 18%);
  --paper: rgb(255 248 232 / 95%);
  --paper-soft: rgb(255 253 248 / 92%);
  --hairline: rgb(126 72 42 / 26%);

  --nav-h: 3.6rem;
  --maxw: 48rem;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

/* The document itself scrolls (not <body>): phones scroll the page on their fast path,
   Safari's toolbars collapse as usual, and overscroll-behavior stops the rubber-band. */
html {
  scroll-behavior: smooth;
  overscroll-behavior: none;
  background: var(--ivory);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior: none;
  color: var(--ink);
  font-family: "Cormorant Garamond", "Cormorant", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; }
a { color: var(--turquoise); }

/* ==========================================================================
   Backdrop — oil painting + bougainvillea framing the top corners
   ========================================================================== */

/* One fixed, static layer behind the page: the painting with the bougainvillea
   multiplied over its top corners. Nothing here is filtered or blended live, so
   phones draw it once and scroll the page over it.

   The painting is the home tab's art at the same crop (full width, 108% of the
   viewport tall, nudged up 1.5%, `cover` from the centre) with its soft focus and
   ivory wash baked in by scripts/soften-backdrop.mjs. The height uses the large
   viewport so the layer does not resize when a phone's toolbar hides.

   The flowers are the same art, size and offsets as the home tab. They have no
   alpha channel, so background-blend-mode knocks out their white ground; the
   blend happens inside this one element instead of against the scrolling page.
   --flower-y cancels the layer's upward nudge.

   Each background-image is declared twice: WebP for every browser, then AVIF
   where image-set() with type() is understood. */
html::before {
  content: "";
  position: fixed;
  z-index: -2;
  top: 0;
  left: 0;
  width: 100%;
  height: 108vh;
  height: 108lvh;
  transform: translateY(-1.5%);
  pointer-events: none;
  --flower-y: calc(1.62vh - .5rem);
  background-color: var(--ivory);
  background-repeat: no-repeat;
  background-blend-mode: multiply, multiply, normal;
  background-position: left -1.5rem top var(--flower-y), right -2.75rem top var(--flower-y), 50% 50%;
  background-size: clamp(20rem, 31vw, 34rem) auto, clamp(17rem, 25vw, 28rem) auto, cover;
  background-image:
    url("assets/bougainvillea-left-768.webp"),
    url("assets/bougainvillea-right-768.webp"),
    url("assets/istanbul-golden-horn-soft-desktop-v1-1920.webp");
  background-image:
    image-set(url("assets/bougainvillea-left-768.avif") type("image/avif"), url("assets/bougainvillea-left-768.webp") type("image/webp")),
    image-set(url("assets/bougainvillea-right-768.avif") type("image/avif"), url("assets/bougainvillea-right-768.webp") type("image/webp")),
    image-set(url("assets/istanbul-golden-horn-soft-desktop-v1-1920.avif") type("image/avif"), url("assets/istanbul-golden-horn-soft-desktop-v1-1920.webp") type("image/webp"));
}

/* ==========================================================================
   Nav — frosted ivory strip (the paper aesthetic), ink links
   ========================================================================== */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--nav-h);
  padding: .5rem clamp(1rem, 4vw, 2.5rem);
  background: rgb(255 248 232 / 88%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.nav-brand {
  flex: none;
  color: var(--ink);
  font-family: "Cormorant", Georgia, serif;
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: .16em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(.5rem, 1.4vw, 1.15rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-links a {
  color: var(--ink);
  font-size: 1.02rem;
  letter-spacing: .015em;
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.nav-links a:hover { color: var(--coral); }
.nav-links a[aria-current="page"] { color: var(--coral); border-bottom-color: var(--coral); }

.nav-links a.nav-rsvp {
  padding: .28rem .95rem;
  color: var(--ivory);
  background: var(--coral);
  border-radius: 999px;
  letter-spacing: .05em;
}
.nav-links a.nav-rsvp:hover { color: var(--ivory); background: #d85e3f; }

.nav-toggle {
  display: none;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: .5rem;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

/* ==========================================================================
   The ivory "paper" sheet holding page content
   ========================================================================== */

.sheet {
  position: relative;
  z-index: 1;
  width: min(100% - 1.75rem, var(--maxw));
  margin: clamp(3.5rem, 11vh, 7.5rem) auto clamp(3rem, 8vh, 5rem);
  padding: clamp(2.5rem, 6vw, 3.75rem) clamp(1.75rem, 5vw, 3.25rem) clamp(2.75rem, 6vw, 3.75rem);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 1.75rem;
  box-shadow: 0 1.1rem 3rem var(--button-shadow), inset 0 0 0 3px rgb(255 255 255 / 55%);
}

.emblem-lg {
  display: block;
  width: clamp(8.5rem, 13vw, 11.5rem);
  height: auto;
  margin: 0 auto clamp(.5rem, 1.4vh, 1rem);
  filter: saturate(1.8) brightness(.76) contrast(1.22);
}

.sheet-head { margin-bottom: clamp(1.75rem, 4vw, 2.6rem); text-align: center; }
.sheet-head h1 {
  margin: 0;
  color: var(--ink);
  font-weight: 400;
  font-size: clamp(2.7rem, 5.6vw, 4.2rem);
  line-height: .9;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.sheet-head .subtitle {
  margin: .95rem 0 0;
  color: var(--turquoise);
  font-style: italic;
  font-size: clamp(1.15rem, 2.3vw, 1.55rem);
}

/* ==========================================================================
   Content rhythm inside the sheet (left-aligned for readability)
   ========================================================================== */

.section { margin-top: clamp(2.25rem, 6vw, 3.25rem); }
.section:first-child { margin-top: 0; }

.section-title {
  margin: 0 0 1.1rem;
  color: var(--coral);
  font-weight: 500;
  font-size: clamp(1.6rem, 3.4vw, 2.15rem);
  letter-spacing: -.01em;
}

.eyebrow {
  margin: 0 0 .4rem;
  color: var(--gold);
  font-family: "Cormorant", Georgia, serif;
  font-weight: 500;
  font-size: .84rem;
  letter-spacing: .3em;
  text-transform: uppercase;
}

.lede { font-size: clamp(1.22rem, 2.4vw, 1.5rem); line-height: 1.5; }
.prose { font-size: 1.18rem; line-height: 1.65; }
.prose p { margin: 0 0 1rem; }

.pull-quote {
  margin: clamp(2rem, 6vw, 2.75rem) 0;
  color: var(--coral);
  font-style: italic;
  font-size: clamp(1.55rem, 3.4vw, 2.1rem);
  line-height: 1.35;
  text-align: center;
}

.placeholder { color: color-mix(in srgb, var(--ink) 52%, transparent); font-style: italic; }

/* ==========================================================================
   Buttons — the production pill treatment
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .58rem 1.3rem;
  color: var(--ink);
  background: rgb(255 248 232 / 94%);
  border: 1px solid rgb(126 72 42 / 55%);
  border-radius: 999px;
  box-shadow: 0 .35rem 1.2rem var(--button-shadow), inset 0 0 0 3px rgb(255 255 255 / 55%);
  font-weight: 500;
  text-decoration: none;
  transition: background-color .15s ease, transform .15s ease;
}
.btn:hover { background: #fffdf8; color: var(--ink); transform: translateY(-1px); }

.btn-primary { color: var(--ivory); background: var(--coral); border-color: transparent; }
.btn-primary:hover { color: var(--ivory); background: #d85e3f; }

.btn-outline { color: var(--turquoise); border-color: color-mix(in srgb, var(--turquoise) 55%, transparent); }

/* ==========================================================================
   Cards, grids, tiles, portraits
   ========================================================================== */

.card {
  padding: 1.4rem 1.5rem;
  background: var(--paper-soft);
  border: 1px solid rgb(126 72 42 / 16%);
  border-radius: 1.1rem;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 55%), 0 .5rem 1.3rem rgb(72 43 28 / 7%);
}

.grid { display: grid; gap: clamp(1rem, 3vw, 1.5rem); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(2, 1fr); }

.portrait { text-align: center; }
.portrait img,
.portrait .img-ph {
  width: clamp(7rem, 15vw, 9rem);
  height: clamp(7rem, 15vw, 9rem);
  margin: 0 auto;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--gold) 45%, transparent);
}
.portrait .name { margin: .7rem 0 .1rem; color: var(--coral); font-size: 1.3rem; }
.portrait .role { margin: 0 0 .4rem; color: var(--turquoise); font-style: italic; }
.portrait .blurb { margin: 0; font-size: 1.02rem; line-height: 1.45; }

.story-block {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 3vw, 1.5rem);
  margin-top: clamp(1.75rem, 5vw, 2.5rem);
}
.story-media img, .story-media .img-ph { width: 100%; min-height: 12rem; object-fit: cover; border-radius: 1rem; }
.story-block h3 { margin: 0 0 .6rem; color: var(--coral); font-size: 1.5rem; font-weight: 500; }

.img-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 12rem;
  color: color-mix(in srgb, var(--ink) 48%, transparent);
  background: color-mix(in srgb, var(--gold) 10%, #fffdf8);
  border: 1px dashed color-mix(in srgb, var(--gold) 45%, transparent);
  border-radius: 1rem;
  font-style: italic;
  text-align: center;
}

.tile h4 { margin: 0 0 .5rem; color: var(--coral); font-size: 1.2rem; font-weight: 500; }
.tile p { margin: 0 0 .5rem; line-height: 1.45; }

/* ==========================================================================
   Schedule timeline
   ========================================================================== */

.day-nav { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 2rem; }
.day-nav a {
  padding: .3rem .9rem;
  color: var(--turquoise);
  border: 1px solid color-mix(in srgb, var(--turquoise) 40%, transparent);
  border-radius: 999px;
  text-decoration: none;
  font-size: .95rem;
}
.day-nav a:hover { color: var(--ivory); background: var(--turquoise); }

.day-heading {
  margin: clamp(2rem, 5vw, 3rem) 0 1rem;
  padding-bottom: .4rem;
  color: var(--gold);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
}

.event {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  margin-top: 1rem;
  background: var(--paper-soft);
  border-left: 4px solid color-mix(in srgb, var(--turquoise) 55%, transparent);
  border-radius: 0 1rem 1rem 0;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 50%), 0 .5rem 1.3rem rgb(72 43 28 / 7%);
}
.event.event-main { border-left-color: var(--coral); background: color-mix(in srgb, var(--coral) 7%, #fffdf8); }
.event .event-time { color: var(--turquoise); font-size: 1.12rem; }
.event .event-time small { display: block; color: color-mix(in srgb, var(--ink) 55%, transparent); font-size: .8rem; }
.event .event-name { margin: 0 0 .3rem; color: var(--coral); font-size: 1.3rem; font-weight: 500; }
.event .event-meta { margin: 0 0 .3rem; color: var(--ink); }
.event .event-desc { margin: 0; line-height: 1.45; }

/* ==========================================================================
   FAQ accordion + gallery
   ========================================================================== */

.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  padding: 1rem .25rem;
  color: var(--coral);
  font-size: 1.28rem;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "＋"; float: right; color: var(--gold); }
.faq details[open] summary::after { content: "－"; }
.faq details p { margin: 0 0 1rem; padding: 0 .25rem; line-height: 1.55; }

.gallery-grid { columns: 2; column-gap: 1rem; }
.gallery-grid > * { break-inside: avoid; margin-bottom: 1rem; border-radius: .8rem; overflow: hidden; }
.gallery-grid img { width: 100%; display: block; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 48rem) {
  /* Same art direction as the home tab: the portrait crop and smaller flowers below 48rem. */
  html::before {
    --flower-y: 1.62vh;
    background-position: left -2.5rem top var(--flower-y), right -3.25rem top var(--flower-y), 50% 50%;
    background-size: clamp(11.5rem, 56vw, 14.5rem) auto, clamp(10rem, 48vw, 12.5rem) auto, cover;
    background-image:
      url("assets/bougainvillea-left-768.webp"),
      url("assets/bougainvillea-right-768.webp"),
      url("assets/istanbul-golden-horn-soft-mobile-v1-900.webp");
    background-image:
      image-set(url("assets/bougainvillea-left-768.avif") type("image/avif"), url("assets/bougainvillea-left-768.webp") type("image/webp")),
      image-set(url("assets/bougainvillea-right-768.avif") type("image/avif"), url("assets/bougainvillea-right-768.webp") type("image/webp")),
      image-set(url("assets/istanbul-golden-horn-soft-mobile-v1-900.avif") type("image/avif"), url("assets/istanbul-golden-horn-soft-mobile-v1-900.webp") type("image/webp"));
  }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem 0 1rem;
    background: var(--ivory);
    border-bottom: 1px solid var(--hairline);
    box-shadow: 0 .6rem 1.2rem rgb(72 43 28 / 12%);
  }
  .site-nav[data-open="false"] .nav-links { display: none; }
  .nav-links a { padding: .7rem clamp(1rem, 4vw, 2.5rem); border-bottom: 0; }
  .nav-links a.nav-rsvp { margin: .5rem clamp(1rem, 4vw, 2.5rem); text-align: center; }

  .sheet { margin-top: clamp(3rem, 9vh, 5rem); border-radius: 1.4rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .gallery-grid { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
