/* Southern Kentucky Wedding Expo
   Tokens follow DESIGN.md. Sections step from daylight (white, sky) to dusk (indigo footer). */

:root {
  --sky: #82C2E3;
  --sky-deep: #256B94;
  --sky-wash: #DDF0F9;
  --dusk: #1D1B47;
  --mist: #EEEDF8;
  --white: #FFFFFF;
  --goldenrod: #E5B044;
  --ink-soft: #4A4870;
  --line: #D9D7EC;

  --font-display: "Young Serif", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step-display: clamp(2.75rem, 1.6rem + 5.2vw, 5.5rem);
  --step-h1: clamp(2.25rem, 1.6rem + 2.8vw, 3.5rem);
  --step-h2: clamp(1.75rem, 1.35rem + 1.7vw, 2.5rem);
  --step-h3: clamp(1.3125rem, 1.2rem + 0.4vw, 1.625rem);
  --step-body: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);

  --radius-img: 10px;
  --wrap: 1200px;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --section-pad: clamp(4rem, 2.5rem + 6vw, 7.5rem);
  --header-h: 120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 6rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--white);
  color: var(--dusk);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img, video, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: var(--step-h1); }
h2 { font-size: var(--step-h2); }
h3 { font-size: var(--step-h3); line-height: 1.2; }
p { margin: 0 0 1em; max-width: 68ch; text-wrap: pretty; }

a { color: var(--sky-deep); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 3px; border-radius: 4px; }
.on-dark :focus-visible, .site-header :focus-visible, .hero :focus-visible { outline-color: var(--goldenrod); }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--goldenrod); color: var(--dusk); padding: 0.6rem 1rem; border-radius: 6px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 48px; padding: 0.7em 1.5em;
  border-radius: 999px; border: 2px solid transparent;
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none; cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn-primary { background: var(--dusk); color: var(--white); }
.btn-primary:hover { background: #2E2B66; }
.btn-secondary { background: transparent; color: var(--sky-deep); border-color: var(--sky-deep); }
.btn-secondary:hover { background: var(--sky-deep); color: var(--white); }
.on-dark .btn-primary { background: var(--white); color: var(--dusk); }
.on-dark .btn-primary:hover { background: var(--sky-wash); }
.on-dark .btn-secondary { color: var(--white); border-color: rgba(255,255,255,0.85); }
.on-dark .btn-secondary:hover { background: var(--white); color: var(--dusk); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Header ---------- */

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  color: var(--white);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
.site-header.is-solid { background: var(--dusk); box-shadow: 0 2px 18px rgba(29,27,71,0.25); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--header-h);
}
.brand { display: block; flex: none; padding-block: 0.5rem; }
.brand img { height: 104px; width: auto; transition: height 0.25s ease; }
.site-header.is-solid .brand img { height: 64px; }
.site-header.is-solid .wrap { min-height: 80px; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.25rem; }
.site-nav a:not(.btn) {
  display: inline-flex; align-items: center; gap: 0.45em;
  color: var(--white); text-decoration: none; font-weight: 500;
  padding: 0.6rem 0.85rem; border-radius: 999px;
}
.site-nav a:not(.btn):hover { background: rgba(255,255,255,0.12); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.35em; }
.site-nav .ig svg { width: 1.2em; height: 1.2em; }
.site-nav .btn { margin-left: 0.5rem; min-height: 44px; padding-inline: 1.2em; background: var(--white); color: var(--dusk); }
.site-nav .btn:hover { background: var(--sky-wash); }

.nav-toggle {
  display: none; align-items: center; gap: 0.5rem;
  background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.7);
  border-radius: 999px; padding: 0.5rem 1rem; font: 600 1rem var(--font-body); cursor: pointer;
}
.nav-toggle-bars { width: 18px; height: 12px; position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after, .nav-toggle-bars span {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 2px;
}
.nav-toggle-bars::before { top: 0; } .nav-toggle-bars span { top: 5px; } .nav-toggle-bars::after { bottom: 0; }

@media (max-width: 860px) {
  :root { --header-h: 84px; }
  .brand img { height: 64px; }
  .site-header.is-solid .brand img { height: 52px; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--dusk); padding: 0.5rem var(--gutter) 1.5rem;
    box-shadow: 0 16px 24px rgba(29,27,71,0.3);
  }
  .site-nav[hidden] { display: none; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0.25rem; }
  .site-nav a:not(.btn) { padding: 0.85rem 0.5rem; border-radius: 6px; font-size: 1.125rem; }
  .site-nav .btn { margin: 0.75rem 0 0; width: 100%; }
  .site-header.menu-open { background: var(--dusk); }
}
@media (min-width: 861px) { .site-nav[hidden] { display: block; } }

/* ---------- Home hero ---------- */

.hero {
  position: relative; isolation: isolate;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  color: var(--white); background: var(--dusk);
  overflow: hidden;
}
.hero-media, .hero-media video, .hero-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, rgba(29,27,71,0.92) 0%, rgba(29,27,71,0.55) 38%, rgba(29,27,71,0.1) 70%),
    linear-gradient(to bottom, rgba(29,27,71,0.55) 0%, rgba(29,27,71,0) 22%);
}
.hero-content { padding-block: calc(var(--header-h) + 3rem) clamp(2.5rem, 1.5rem + 4vw, 5rem); }
.hero-title {
  font-size: var(--step-display);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0 0 0.4em;
  max-width: 11ch;
}
.hero-date {
  font-family: var(--font-display);
  font-size: var(--step-h2);
  line-height: 1.15;
  margin: 0 0 0.2em;
}
.hero-place { font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); margin: 0 0 2rem; opacity: 0.92; }
.hero .btn-row { align-items: center; }
.hero-video-link {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: none; border: 0; padding: 0.5rem 0.25rem; margin-left: 0.5rem;
  color: var(--white); font: 600 1rem var(--font-body); cursor: pointer;
  text-decoration: underline; text-underline-offset: 0.3em; text-decoration-thickness: 1px;
}
.hero-video-link:hover { text-decoration-thickness: 2px; }
.hero-video-link .play {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid currentColor;
  display: grid; place-items: center;
}
.hero-video-link .play svg { width: 14px; height: 14px; margin-left: 2px; }

@media (prefers-reduced-motion: no-preference) {
  .hero-content > * { animation: settle 0.7s cubic-bezier(.2,.7,.2,1) both; }
  .hero-content > :nth-child(2) { animation-delay: 0.12s; }
  .hero-content > :nth-child(3) { animation-delay: 0.2s; }
  .hero-content > :nth-child(4) { animation-delay: 0.3s; }
  @keyframes settle { from { opacity: 0; transform: translateY(12px); } }
}

@media (max-width: 600px) {
  .hero .btn-row .btn { width: 100%; }
  .hero-video-link { margin: 0.5rem 0 0; }
}

/* ---------- Inner page hero ---------- */

.page-hero {
  position: relative; isolation: isolate;
  min-height: clamp(26rem, 60vh, 38rem);
  display: flex; align-items: flex-end;
  color: var(--white); background: var(--dusk); overflow: hidden;
}
.page-hero > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, rgba(29,27,71,0.9) 0%, rgba(29,27,71,0.55) 55%, rgba(29,27,71,0.25) 100%),
    linear-gradient(to bottom, rgba(29,27,71,0.55) 0%, rgba(29,27,71,0) 25%);
}
.page-hero .wrap { padding-block: calc(var(--header-h) + 2rem) clamp(2rem, 1rem + 3vw, 3.5rem); }
.page-hero h1 { max-width: 16ch; margin-bottom: 0.3em; }
.page-hero p { font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); margin: 0; max-width: 46ch; }

/* ---------- Sections (morning to dusk) ---------- */

.section { padding-block: var(--section-pad); }
.bg-white { background: var(--white); }
.bg-sky-wash { background: var(--sky-wash); }
.bg-mist { background: var(--mist); }
.bg-sky { background: var(--sky); }
.bg-dusk { background: var(--dusk); color: var(--white); }

.section-intro { max-width: 40rem; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem); }
.section-intro p { color: var(--ink-soft); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); }
.bg-sky .section-intro p { color: var(--dusk); }

/* Show-day details */
.details {
  display: grid; gap: clamp(2rem, 1rem + 3vw, 4rem);
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.details-when .big {
  font-family: var(--font-display);
  font-size: var(--step-h1);
  line-height: 1.05;
  margin: 0 0 0.35em;
}
.details-when .time { font-size: 1.125rem; margin: 0 0 1.25rem; max-width: 30ch; }
.details h3 { font-family: var(--font-body); font-size: 1.0625rem; font-weight: 600; margin: 0 0 0.4rem; }
.details-item { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.details-item p { margin-bottom: 0.6rem; }
.formerly { color: var(--ink-soft); font-size: var(--step-small); margin: 0; }
@media (max-width: 900px) {
  .details { grid-template-columns: 1fr 1fr; }
  .details-when { grid-column: 1 / -1; }
}
@media (max-width: 560px) { .details { grid-template-columns: 1fr; } }

/* Instagram band */
.ig-band {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.25rem 2.5rem; align-items: center;
}
.ig-band .ig-mark { width: 64px; height: 64px; color: var(--dusk); }
.ig-band h2 { margin: 0 0 0.2em; }
.ig-band p { margin: 0; color: var(--ink-soft); }
@media (max-width: 760px) {
  .ig-band { grid-template-columns: 1fr; }
  .ig-band .ig-mark { width: 48px; height: 48px; }
  .ig-band .btn { justify-self: start; }
}

/* Photo mosaic */
.mosaic {
  display: grid; gap: clamp(0.5rem, 0.3rem + 0.8vw, 1rem);
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: clamp(9rem, 5rem + 12vw, 15rem);
}
.mosaic figure { margin: 0; position: relative; overflow: hidden; border-radius: var(--radius-img); background: var(--mist); }
.mosaic img { width: 100%; height: 100%; object-fit: cover; }
.mosaic .m1 { grid-column: span 4; grid-row: span 2; }
.mosaic .m2 { grid-column: span 2; grid-row: span 1; }
.mosaic .m3 { grid-column: span 2; grid-row: span 1; }
.mosaic .m4 { grid-column: span 2; grid-row: span 1; }
.mosaic .m5 { grid-column: span 2; grid-row: span 1; }
.mosaic .m6 { grid-column: span 2; grid-row: span 1; }
@media (max-width: 700px) {
  .mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 11rem; }
  .mosaic .m1 { grid-column: span 2; grid-row: span 2; }
  .mosaic .m2, .mosaic .m3, .mosaic .m4, .mosaic .m5 { grid-column: span 1; }
  .mosaic .m6 { grid-column: span 2; }
}

/* Exhibit band */
.exhibit-band {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: center;
}
.exhibit-band img { border-radius: var(--radius-img); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.exhibit-band p { font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); }
@media (max-width: 800px) { .exhibit-band { grid-template-columns: 1fr; } }

/* ---------- Exhibit page ---------- */

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.reasons { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.75rem; }
.reasons h3 { margin-bottom: 0.3em; }
.reasons p { margin: 0; color: var(--ink-soft); }

.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.photo-pair img { border-radius: var(--radius-img); width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 4; }
.photo-pair img:first-child { margin-top: 3rem; }


/* ---------- Forms ---------- */

.form-panel {
  background: var(--white); border-radius: var(--radius-img);
  padding: clamp(1.5rem, 1rem + 2.5vw, 3rem);
  box-shadow: 0 1px 0 var(--line);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.field label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.field .optional { font-weight: 400; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px;
  font: inherit; color: var(--dusk);
  background: var(--white);
  border: 1.5px solid #B9B6D6; border-radius: 8px;
  padding: 0.65rem 0.85rem;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231D1B47' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.5rem;
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 1px; border-color: var(--sky-deep); }
.field [aria-invalid="true"] { border-color: #B3261E; }
.field-error { color: #B3261E; font-size: var(--step-small); margin: 0.35rem 0 0; }
.field-error:empty { display: none; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-note { font-size: var(--step-small); color: var(--ink-soft); margin: 1.25rem 0 0; }
.form-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.form-actions .btn[disabled] { opacity: 0.7; cursor: progress; }

.form-status { margin-top: 1.25rem; padding: 1rem 1.25rem; border-radius: 8px; font-weight: 500; }
.form-status:empty { display: none; }
.form-status.is-error { background: #FBE9E7; color: #8C1D18; }
.form-success { display: none; }
.form-success h3 { margin-bottom: 0.3em; }
.form-panel.is-sent form { display: none; }
.form-panel.is-sent .form-success, .form-success:target { display: block; }

/* ---------- About & contact ---------- */

.about-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: start; }
.about-grid img { border-radius: var(--radius-img); width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

.contact-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1rem; }
.contact-list strong { display: block; font-weight: 600; }
.contact-list a { font-size: 1.125rem; }

/* ---------- Video dialog ---------- */

.video-dialog {
  width: min(1100px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem);
  padding: 0; border: 0; border-radius: var(--radius-img);
  background: #000; color: var(--white); overflow: visible;
}
.video-dialog::backdrop { background: rgba(29,27,71,0.88); }
.video-dialog video { width: 100%; height: auto; max-height: calc(100vh - 6rem); border-radius: var(--radius-img); background: #000; }
.video-dialog .close {
  position: absolute; top: -3.25rem; right: 0;
  background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.8);
  border-radius: 999px; padding: 0.45rem 1.1rem; font: 600 1rem var(--font-body); cursor: pointer;
}
.video-dialog .close:focus-visible { outline-color: var(--goldenrod); }
@media (prefers-reduced-motion: no-preference) {
  .video-dialog[open] { animation: dialog-in 0.25s ease-out; }
  @keyframes dialog-in { from { opacity: 0; transform: scale(0.97); } }
}

/* ---------- Footer ---------- */

.site-footer { background: var(--dusk); color: var(--white); padding-block: clamp(3.5rem, 2.5rem + 4vw, 6rem) 2rem; }
.site-footer a { color: var(--white); }
.footer-top { display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 1rem + 3vw, 4rem); align-items: start; }
.footer-top .brand img { height: 120px; }
.site-footer h2 { font-size: var(--step-h3); margin-bottom: 0.6em; }
.site-footer p { color: rgba(255,255,255,0.86); }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.footer-list a { display: inline-flex; align-items: center; gap: 0.5rem; }
.footer-list svg { width: 1.15em; height: 1.15em; }
.footer-sendoff {
  font-family: var(--font-display); font-size: var(--step-h2);
  border-top: 1px solid rgba(255,255,255,0.18);
  margin-top: clamp(3rem, 2rem + 3vw, 5rem); padding-top: 2rem;
  text-align: center; max-width: none;
}
@media (max-width: 960px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-top .brand { grid-column: 1 / -1; }
  .footer-top .brand img { height: 96px; }
}
@media (max-width: 560px) { .footer-top { grid-template-columns: 1fr; } }

/* ---------- 404 ---------- */
.notfound { min-height: 70vh; display: flex; align-items: center; padding-top: var(--header-h); }

/* Pause control for the looping hero video (WCAG 2.2.2) */
.hero-pause {
  position: absolute; right: var(--gutter); bottom: clamp(1.25rem, 1rem + 1vw, 2rem); z-index: 1;
  background: rgba(29,27,71,0.55); color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.6); border-radius: 999px;
  padding: 0.45rem 0.95rem; font: 500 0.875rem var(--font-body); cursor: pointer;
}
.hero-pause:hover { background: rgba(29,27,71,0.8); }
@media (max-width: 600px) { .hero-pause { position: static; margin: 0 var(--gutter) 1.25rem; align-self: flex-start; } .hero { flex-direction: column; justify-content: flex-end; align-items: stretch; } }

.page-hero-actions { margin-top: 1.5rem; }
