/* ==========================================================
   MANUALA & NOLAN WEDDING SITE - styles.css
   Palette is inspired by Idaho: spruce forest + huckleberry.
   Sections: 1 Tokens | 2 Base | 3 Layout | 4 Header | 5 Hero
             6 Buttons | 7 Forms | 8 Dialogs | 9 Gallery | 10 Footer
   ========================================================== */

/* ---------- 1. TOKENS (change colors/fonts here) ---------- */
:root {
  --mist: #eef2ef;        /* page background */
  --paper: #ffffff;       /* cards */
  --spruce: #1e3b34;      /* dark green: header, hero */
  --spruce-soft: #2c5248; /* hover on dark */
  --berry: #7a2e4d;       /* huckleberry: buttons, links */
  --berry-dark: #5e2039;
  --blush: #f6e9ec;       /* invitation arch */
  --brass: #b08d4a;       /* thin decorative lines only */
  --ink: #1b2623;         /* body text */
  --muted: #55645f;       /* secondary text */
  --line: #cad4cf;        /* soft borders */
  --field: #7f8f89;       /* input borders (3:1 contrast) */

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  --wrap: 1080px;
}

.warning {
  color: rgb(255, 0, 0);
  font-weight: bold;
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--berry); }
a:hover { color: var(--berry-dark); }
img { max-width: 100%; display: block; }
a, button, input, select, textarea, label { touch-action: manipulation; } /* no double-tap zoom delay */
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---------- 3. LAYOUT HELPERS ---------- */
/* env(safe-area-inset-*) keeps content out from under iPhone notches in landscape */
.container { width: min(100% - 2.5rem - env(safe-area-inset-left) - env(safe-area-inset-right), var(--wrap)); margin-inline: auto; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2.25rem);
}
.page-title { padding-block: clamp(2rem, 5vw, 3.5rem) 0; }
.page-title p { color: var(--muted); font-size: 1.15rem; }

.demo-banner {
  background: #fff4d6;
  color: #4a3b00;
  padding: .6rem 1.25rem;
  text-align: center;
  font-size: .95rem;
  border-bottom: 1px solid #e6cf84;
}

/* ---------- 4. HEADER / NAV ---------- */
.site-header { background: var(--spruce); color: #f3f6f4; position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand { font-family: var(--display); font-size: 1.4rem; color: #f3f6f4; text-decoration: none; font-weight: 600; }
.brand:hover { color: #fff; }
.nav-toggle {
  display: none; background: none; border: 1px solid #5f7f75; color: #f3f6f4;
  padding: .45rem .8rem; min-height: 44px; border-radius: 8px; font: inherit; cursor: pointer;
}
.site-nav ul { list-style: none; display: flex; gap: .4rem; margin: 0; padding: 0; }
.site-nav a {
  display: flex; align-items: center; min-height: 44px; padding: .5rem .9rem; color: #dbe6e1; text-decoration: none;
  border-radius: 8px; border-bottom: 2px solid transparent;
}
.site-nav a:hover { background: var(--spruce-soft); color: #fff; }
.site-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--brass); border-radius: 8px 8px 0 0; }

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--spruce); padding: .5rem 1.25rem 1rem; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
}

/* ---------- 5. HOME HERO ---------- */
.hero { background: var(--spruce); color: #f3f6f4; padding-block: clamp(2.5rem, 7vw, 5rem); }
.hero-inner { display: grid; gap: 2.5rem; align-items: center; }
.hero h1 { color: #fff; }
.hero-details { display: grid; gap: .25rem; color: #c9d8d2; font-size: 1.15rem; border-left: 2px solid var(--brass); padding-left: 1rem; }

/* The arch: the one bold shape on the site. It is the "doorway" to the invitation. */
.arch {
  background: var(--blush);
  color: var(--ink);
  border-radius: 999px 999px 14px 14px;
  padding: clamp(3.5rem, 9vw, 5rem) clamp(1.5rem, 4vw, 2.5rem) 2.25rem;
  text-align: center;
  border: 6px solid var(--spruce-soft);
  outline: 1px solid var(--brass);
  outline-offset: 6px;
}
.arch h2 { color: var(--berry-dark); }
.arch p { margin-inline: auto; }
@media (min-width: 860px) {
  .hero-inner { grid-template-columns: 1.25fr 1fr; }
}

.photo-teaser { display: grid; gap: 1rem; }

/* ---------- 6. BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  padding: .85rem 1.6rem; border-radius: 999px; text-decoration: none;
  background: var(--berry); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--berry-dark); color: #fff; }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--berry); border: 2px solid var(--berry); }
.btn-ghost:hover { background: var(--blush); color: var(--berry-dark); }
.btn-small { padding: .4rem 1rem; font-size: .95rem; min-height: 44px; }

/* ---------- 7. FORMS ---------- */
.form-grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: 1 / -1; }
}
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label, .field legend { font-weight: 600; }
.hint { color: var(--muted); font-size: .92rem; font-weight: 400; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
select, textarea {
  font: inherit; color: inherit; background: #fff;
  border: 1.5px solid var(--field); border-radius: 8px; padding: .65rem .8rem; width: 100%; min-height: 48px;
}
textarea { min-height: 110px; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; }
.choice { display: flex; align-items: center; gap: .6rem; min-height: 44px; }
.choice label { flex: 1; padding: .5rem 0; font-weight: 500; }
.choice input { width: 1.15rem; height: 1.15rem; accent-color: var(--berry); }
.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; }
.status { min-height: 1.5em; margin: 0; font-weight: 500; }
.status.error { color: #a1260f; }
.status.ok { color: #1f6b3a; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.thanks h2 { color: var(--berry-dark); }

/* ---------- 8. DIALOGS (comment popup + photo viewer) ---------- */
dialog {
  border: 0; border-radius: 16px; padding: 0; width: min(92vw, 560px);
  max-height: 90vh; max-height: 90dvh; overflow: auto; /* stays usable when the phone keyboard is open */
  background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
dialog::backdrop { background: rgba(20, 35, 31, .65); }
.dialog-body { padding: clamp(1.25rem, 4vw, 2rem); }
.dialog-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
#lightbox { width: min(94vw, 900px); }
#lightbox img { width: 100%; max-height: 70vh; object-fit: contain; background: #111; border-radius: 16px 16px 0 0; }

/* ---------- 9. PHOTO GALLERY ---------- */
.dropzone {
  display: block; border: 2px dashed var(--field); border-radius: var(--radius);
  padding: 1.5rem; text-align: center; background: #f8faf9; cursor: pointer;
}
.dropzone:hover, .dropzone.dragging { background: var(--blush); border-color: var(--berry); }
.dropzone input { position: absolute; left: -9999px; }
.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 1.5rem; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tile-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.tile-open img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.tile-bar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .6rem .8rem; font-size: .92rem; }
.tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }

/* ---------- 10. FOOTER ---------- */
.site-footer { background: var(--spruce); color: #c9d8d2; padding: 2rem 0 calc(2rem + env(safe-area-inset-bottom)); margin-top: 3rem; text-align: center; }
.site-footer p { margin-inline: auto; }

/* ---------- 11. SMALL UTILITIES (replace inline styles so the CSP can stay strict) ---------- */
.mt { margin-top: 1rem; }
.flush { margin-top: 0; }
.code-wrap { margin-bottom: 1rem; max-width: 320px; }
.privacy { margin: 1.25rem 0 0; }
.i1 { margin-left: 1.5rem; }
.i2 { margin-left: 1.25rem; }
.i3 { margin-left: 1.30rem; }