/* =========================================================
   Wenatchee Visitor Guide: shared stylesheet
   Palette: apple red, river blue, sagebrush/hill tones.
   Change the colors here and they update everywhere.
   ========================================================= */
:root {
  --apple: #c8102e;        /* Red Delicious */
  --apple-dark: #8e0b20;
  --leaf: #6a8f3c;         /* orchard green */
  --river: #1f5f8b;        /* Columbia River blue */
  --river-light: #4fa3c7;
  --hill: #c9a66b;         /* golden foothills */
  --sage: #9aab89;         /* sagebrush */
  --cream: #fdf8f1;        /* page background */
  --ink: #23303a;          /* body text */
  --radius: 14px;
  --shadow: 0 6px 20px rgba(35, 48, 58, .12);
  --max: 1100px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
}
a { color: var(--river); }
h1, h2, h3 { line-height: 1.2; font-family: Georgia, "Times New Roman", serif; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 1px 8px rgba(0, 0, 0, .08);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding-top: .8rem; padding-bottom: .8rem; }
.brand { font-weight: 700; font-size: 1.2rem; color: var(--apple); text-decoration: none; line-height: 0; }
.brand img { height: 52px; width: auto; display: block; }
.nav-links { list-style: none; display: flex; gap: 1.5rem; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--ink); font-weight: 500; padding: .3rem 0; border-bottom: 2px solid transparent; }
.nav-links a:hover, .nav-links a.active { color: var(--apple); border-color: var(--apple); }
.nav-toggle { display: none; background: var(--apple); color: #fff; border: 0; border-radius: 8px; padding: .45rem .9rem; font: inherit; cursor: pointer; }

/* ---------- Hero (gradient sky -> river; SVG hills at bottom) ---------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--river) 0%, var(--river-light) 55%, var(--hill) 100%);
  color: #fff;
  padding: 5rem 0 7rem;
  overflow: hidden;
}
.hero-text { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 .6rem; text-shadow: 0 2px 8px rgba(0,0,0,.25); }
.hero p { font-size: 1.15rem; max-width: 640px; margin: 0; }
.hills { position: absolute; bottom: 0; left: 0; width: 100%; height: 120px; }

/* Home page photo banner */
.feature-banner { margin: 0; }
.feature-banner img { display: block; width: 100%; max-width: 100%; height: auto; }
.feature-banner figcaption {
  max-width: var(--max);
  margin: 0 auto;
  padding: .75rem 1.25rem 0;
  color: #5b6770;
  font-weight: 600;
  font-size: .95rem;
}
.feature-banner + .hero { padding-top: 2.4rem; }
.item .feature-banner { margin: 1rem 0 .85rem; }
.item .feature-banner img { border-radius: 10px; }
.item .feature-banner figcaption { max-width: none; padding: .6rem 0 0; }
.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0 0 .85rem; }
.item .feature-row .feature-banner { margin: 0; }

/* ---------- Content blocks ---------- */
main { padding: 2rem 1.25rem 3rem; }
.intro { max-width: 760px; margin: 0 auto 2.5rem; text-align: center; }
.intro h2, .section-title { color: var(--apple-dark); }
.section-title { margin-top: 2.5rem; }

/* Cards grid (home page + day trips) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.card {
  display: block; text-decoration: none; color: var(--ink);
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.6rem; border-top: 6px solid var(--apple);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(35,48,58,.18); }
.card h3 { margin: .4rem 0; font-size: 1.4rem; }
.card-icon { font-size: 2rem; }
.card-link { font-weight: 600; color: var(--apple); }
.card-river { border-top-color: var(--river); }
.card-river .card-link { color: var(--river); }
.card-hills { border-top-color: var(--leaf); }
.card-hills .card-link { color: var(--leaf); }

/* Listing items (events, trails, restaurants) */
.list { display: grid; gap: 1.25rem; }
.item { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem 1.6rem; border-left: 5px solid var(--sage); }
.item h2 { margin: 0 0 .3rem; font-size: 1.35rem; color: var(--river); }
.meta { margin: 0 0 .6rem; font-size: .92rem; color: #5b6770; font-weight: 600; }
.item a { font-weight: 600; }
.photos { display: grid; gap: 1rem; margin-top: 1rem; }
.photos img { display: block; width: 100%; height: auto; border-radius: 10px; cursor: zoom-in; }
.photos img:focus-visible { outline: 3px solid var(--river); outline-offset: 3px; }

/* Callout box */
.callout { margin-top: 2.5rem; background: linear-gradient(135deg, #fff4f4, #eef6fa); border: 1px solid #e3d6c3; border-radius: var(--radius); padding: 1.5rem 1.75rem; }
.callout h2 { margin-top: 0; color: var(--apple-dark); }

/* ---------- Photo submission ---------- */
.photo-form { display: grid; gap: 1.1rem; }
.photo-form h2 { margin-bottom: .2rem; }
.field label { font-weight: 600; }
.photo-form input[type="text"],
.photo-form input[type="email"],
.photo-form textarea {
  display: block;
  width: 100%;
  margin-top: .35rem;
  padding: .55rem .7rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9cfc2;
  border-radius: 8px;
}
.photo-form textarea { min-height: 6.5rem; resize: vertical; }
.photo-form input[type="file"] { display: block; width: 100%; margin-top: .35rem; font: inherit; }
.hint { margin: .35rem 0 0; color: #5b6770; font-size: .92rem; font-weight: 400; }
.photo-preview { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .75rem; }
.photo-preview li { display: grid; grid-template-columns: 72px 1fr; gap: .75rem; align-items: center; }
.photo-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--cream); }
.size-readout { margin: .4rem 0 0; font-weight: 600; }
.disclaimer { margin: 0; padding-left: 1.2rem; }
.disclaimer li { margin: .45rem 0; }
.photo-terms { margin: 0; color: #5b6770; font-size: 0.8rem; font-weight: 400; line-height: 1.5; }
.photo-terms h3 { margin: 0 0 .35rem; color: #5b6770; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 0.8rem; font-weight: 700; line-height: 1.4; }
.photo-terms ol { margin: 0; padding-left: 1.2rem; }
.photo-terms li { margin: .35rem 0; }
.consent { display: flex; gap: .65rem; align-items: flex-start; font-weight: 600; }
.consent input { flex: none; width: 1.15rem; height: 1.15rem; margin-top: .3rem; }
.submit-btn {
  justify-self: start;
  background: var(--apple);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: .7rem 1.25rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.submit-btn:disabled { opacity: .65; cursor: progress; }
.submit-btn:focus-visible, .photo-form input:focus-visible, .photo-form textarea:focus-visible {
  outline: 3px solid var(--river);
  outline-offset: 2px;
}
.form-error { margin: 0; color: var(--apple-dark); font-weight: 600; }
.form-status { margin: 0; font-weight: 600; }
.hp-field { display: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #d9e1e6; padding: 1.5rem 0; font-size: .9rem; }
.site-footer p { margin: .3rem 0; }
.site-footer a { color: #fff; font-weight: 600; }

/* ---------- Mobile ---------- */
/* Nav collapses before the longer labels wrap onto a second line. */
@media (max-width: 1040px) {
  .nav { flex-wrap: wrap; }
  .nav-toggle { display: block; }
  .nav-links { display: none; width: 100%; flex-direction: column; gap: .5rem; padding-top: .8rem; }
  .nav-links.open { display: flex; }
}
@media (max-width: 860px) {
  .hero { padding: 3.5rem 0 6rem; }
  .feature-banner + .hero { padding-top: 2rem; }
  .feature-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .brand img { height: 44px; }
  .photo-form { padding: 1.1rem 1rem; }
}

/* ---------- Photo lightbox ---------- */
/* Enlarges images inside .photos only. The dialog is created by js/lightbox.js. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  padding: 4.5rem 1rem 1.15rem;
  background: rgba(8, 10, 12, .92);
  opacity: 0;
  transition: opacity .18s ease;
  touch-action: none;
}
.lightbox[hidden] { display: none !important; }
.lightbox.is-open { opacity: 1; }
.lightbox-backdrop { position: absolute; inset: 0; }
.lightbox-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  width: 100%;
  height: 100%;
  min-height: 0;
  pointer-events: none;
}
.lightbox-fit {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  pointer-events: none;
}
.lightbox-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: auto;
}
.lightbox-meta {
  flex: 0 0 auto;
  width: fit-content;
  max-width: min(46rem, 100%);
  margin: 0;
  text-align: center;
  pointer-events: auto;
}
.lightbox-caption {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  line-height: 1.45;
}
.lightbox-count {
  margin: .3rem 0 0;
  color: #f4efe6;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.lightbox-btn {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 20, 24, .88);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
}
.lightbox-btn:hover { background: rgba(16, 20, 24, .96); }
.lightbox-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lightbox-btn:disabled { opacity: .38; cursor: default; }
.lightbox-btn svg { display: block; width: 26px; height: 26px; }
.lightbox-close { top: .75rem; right: .75rem; }
.lightbox-prev { top: 50%; left: .75rem; transform: translateY(-50%); }
.lightbox-next { top: 50%; right: .75rem; transform: translateY(-50%); }
@media (prefers-reduced-motion: reduce) {
  .lightbox { transition: none; }
}
