/* Editorial dark — forest green + burnt orange / copper accents */

:root {
  --ink: #e4eae6;
  --ink-muted: #8a9d91;
  --paper: #080c0a;
  --paper-lift: #0f1612;
  /* Forest — primary actions & open sections */
  --accent: #6b9e7d;
  --accent-hover: #7eb490;
  /* Burnt orange / copper — decorative + secondary links */
  --copper: #c86b35;
  --copper-bright: #e0854a;
  --copper-muted: #b8927a;
  --copper-dim: rgba(200, 107, 53, 0.22);
}

[data-theme="dark"] {
  --pico-background-color: var(--paper);
  --pico-color: var(--ink);
  --pico-primary: var(--accent);
  --pico-primary-hover: var(--accent-hover);
  --pico-card-background-color: transparent;
  --pico-card-sectioning-background-color: rgba(107, 158, 125, 0.06);
  --pico-muted-border-color: rgba(107, 158, 125, 0.14);
  --pico-secondary: var(--copper-muted);
  --pico-secondary-hover: var(--copper-bright);
  --pico-font-family: "Cormorant Garamond", Georgia, serif;
  --pico-font-size: 1.125rem;
  --pico-line-height: 1.65;
}

body {
  min-height: 100vh;
  /* Even vertical wash — no top-anchored radial (avoids a “band” stuck to the viewport edge) */
  background: linear-gradient(
    180deg,
    #040604 0%,
    var(--paper) 42%,
    #050907 100%
  );
}

main.container {
  padding-block: clamp(2.5rem, 8vw, 5rem);
}

.wedding-box {
  text-align: center;
  border: none;
  max-width: 38rem;
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 3.25rem) clamp(1.5rem, 4vw, 2.5rem);
  background: linear-gradient(160deg, #121c16 0%, var(--paper-lift) 50%, #0d1410 100%);
  /* box-shadow:
    0 1px 0 rgba(180, 210, 195, 0.05) inset,
    0 1px 0 var(--copper-dim) inset,
    0 28px 56px -16px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(107, 158, 125, 0.1); */
  border-radius: 2px;
}

.wedding-hero {
  position: relative;
  text-align: left;
  padding-left: 1rem;
  margin-bottom: 0.25rem;
}

/* Green → copper stripe: both wedding colors in one element */
.wedding-hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 1px;
  background: linear-gradient(180deg,#121c16 0%, var(--accent) 20%, #121c16 100%);
}

.wedding-hero hgroup {
  margin-bottom: 0;
}

.wedding-date {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.95rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--copper-muted);
  margin-top: 0.35rem;
  font-weight: 500;
}

.wedding-rule {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(107, 158, 125, 0.2),
    var(--copper-dim),
    rgba(107, 158, 125, 0.2),
    transparent
  );
  margin: 1.25rem 0;
}

h1 {
  --pico-font-family: "Fleur De Leah", cursive;
  --pico-font-weight: 400;
  font-size: clamp(2.75rem, 8vw, 3.75rem);
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 0;
  text-shadow: 0 0 48px rgba(107, 158, 125, 0.12), 0 1px 0 rgba(200, 107, 53, 0.08);
}

.wedding-box article {
  text-align: left;
}

.wedding-box article footer span {
  display: inline-block;
  margin-right: 1rem;
}

.wedding-box details {
  text-align: left;
  border: none;
}

.wedding-box summary {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0.5rem 0;
}

.wedding-box details[open] summary {
  color: var(--accent);
  text-shadow: 0 0 24px rgba(200, 107, 53, 0.15);
}

.wedding-box iframe {
  max-width: 100%;
  border-radius: 2px;
  /* Forest + copper (~50/50) */
  border: 1px solid rgba(150, 130, 98, 0.55);
}

.wedding-box .rsvp-submit {
  width: 60%;
  max-width: 100%;
  margin-inline: auto;
  display: block;
}

/* Dress code: Yes / No blocks with two-column lists */
.wedding-box .dress-code-sections {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.wedding-box .dress-code-block h3 {
  margin: 0 0 0.4rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.wedding-box .dress-code-block--no h3 {
  color: var(--copper-muted);
}

.wedding-box .dress-code-block ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.25rem;
  row-gap: 0.35rem;
  margin: 0;
  padding-left: 1.15rem;
  list-style-position: outside;
}

/* Wedding party: layout + featured roles + two-column name list */
.wedding-box .wedding-party-layout {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.wedding-box .wedding-party-featured {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wedding-box .wedding-party-person {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-start;
}

.wedding-box .wedding-party-person__name {
  font-size: 1em;
  line-height: 1.35;
}

.wedding-box .wedding-party-person__role {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.wedding-box .wedding-party-list ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.25rem;
  row-gap: 0.35rem;
  margin: 0;
  padding-left: 1.15rem;
  list-style-position: outside;
}

/* Schedule: three venue columns, time-positioned events */
.wedding-box .schedule {
  --schedule-start: 17; /* 5:00pm */
  --schedule-end: 24; /* midnight */
  --schedule-hours: 7;
  --schedule-px-per-hour: 4.25rem;
  --schedule-track-height: calc(var(--schedule-hours) * var(--schedule-px-per-hour));
  --schedule-header-height: 2.15rem;
  --schedule-header-gap: 0.45rem;

  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0.35rem 0.4rem;
  margin-top: 0.85rem;
  width: 100%;
  min-width: 0;
  text-align: left;
}

.wedding-box .schedule__rail {
  position: relative;
  height: var(--schedule-track-height);
  /* Match column title + gap so ticks share the track's time origin */
  margin-top: calc(var(--schedule-header-height) + var(--schedule-header-gap));
}

.wedding-box .schedule__tick {
  position: absolute;
  right: 0;
  top: calc((var(--t) - var(--schedule-start)) * var(--schedule-px-per-hour));
  transform: translateY(-50%);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  line-height: 1;
  white-space: nowrap;
}

.wedding-box .schedule__tick::after {
  content: "";
  position: absolute;
  left: calc(100% + 0.35rem);
  top: 50%;
  width: 0.35rem;
  height: 1px;
  background: rgba(107, 158, 125, 0.28);
}

.wedding-box .schedule__columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  min-width: 0;
}

.wedding-box .schedule__column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--schedule-header-gap);
}

.wedding-box .schedule__column-title {
  margin: 0;
  min-height: var(--schedule-header-height);
  display: flex;
  align-items: flex-end;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--accent);
}

.wedding-box .schedule__track {
  position: relative;
  height: var(--schedule-track-height);
  border-left: 1px solid rgba(107, 158, 125, 0.18);
}

/* Time-positioned events: labels at start (and optional end) */
.wedding-box .schedule__event {
  position: absolute;
  left: 0.35rem;
  right: 0.15rem;
  top: calc((var(--start) - var(--schedule-start)) * var(--schedule-px-per-hour));
  height: calc((var(--end) - var(--start)) * var(--schedule-px-per-hour));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  overflow: visible;
  pointer-events: none;
}

.wedding-box .schedule__event-start,
.wedding-box .schedule__event-end {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.35rem;
  row-gap: 0.05rem;
  line-height: 1;
}

.wedding-box .schedule__event-start {
  transform: translateY(-50%);
}

.wedding-box .schedule__event-end {
  transform: translateY(50%);
}

.wedding-box .schedule__event time {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--copper-muted);
  line-height: 1;
}

.wedding-box .schedule__event-start span,
.wedding-box .schedule__event-end span {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.8rem;
  line-height: 1.15;
  color: var(--ink);
}

/* Instant events: single label at --start */
.wedding-box .schedule__event--point {
  height: 0;
}

/* Timed spans: copper stem from --start to --end */
.wedding-box .schedule__event--span {
  padding-left: 0.55rem;
}

.wedding-box .schedule__event--span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--copper);
}

.wedding-box .schedule-note {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

@media print {
  /* Omit these sections from the printout. Each rule also drops the
     divider next to it so we don't leave a doubled/trailing rule:
       - registry: hide it + the rule after it (keeps rule before it)
       - rsvp (last section): hide it + the rule before it */
  .wedding-box details[name="registry"],
  .wedding-box details[name="registry"] + hr,
  .wedding-box details[name="rsvp"],
  .wedding-box hr:has(+ details[name="rsvp"]) {
    display: none;
  }

  /* Keep whole sections, individual articles, and the schedule from
     splitting across page boundaries */
  .wedding-box details,
  .wedding-box article,
  .wedding-box .schedule,
  .wedding-box .dress-code-block,
  .wedding-box .wedding-party-layout {
    break-inside: avoid;
    page-break-inside: avoid; /* legacy alias for older engines */
  }

  /* Don't strand a section heading at the bottom of a page */
  .wedding-box summary,
  .wedding-box .schedule__column-title {
    break-after: avoid;
    page-break-after: avoid;
  }

  /* Images shouldn't be sliced mid-figure */
  .wedding-box img {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

@media (max-width: 40rem) {
  .wedding-box .schedule {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .wedding-box .schedule__rail {
    display: none;
  }

  .wedding-box .schedule__columns {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .wedding-box .schedule__column-title {
    min-height: 0;
  }

  /* Drop time-scaled layout: stack events with even gaps */
  .wedding-box .schedule__track {
    height: auto;
    border-left: none;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
  }

  .wedding-box .schedule__event,
  .wedding-box .schedule__event--point,
  .wedding-box .schedule__event--span {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    height: auto;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
  }

  .wedding-box .schedule__event-start,
  .wedding-box .schedule__event-end {
    transform: none;
  }

  .wedding-box .schedule__event--span::before {
    content: none;
  }
}
