/* ClimbingIdaho.com — modern responsive redesign
   Design system: alpine dusk palette, card-based layout, mobile-first */

:root {
  --navy-950: #0b1220;
  --navy-900: #101a2c;
  --navy-800: #16233a;
  --navy-700: #1e2f4c;
  --navy-600: #2a4266;
  --slate-400: #8fa1bd;
  --slate-300: #b7c3d6;
  --slate-100: #eef1f6;
  --white: #ffffff;
  --rust-500: #d97a3f;
  --rust-400: #e6924f;
  --gold-400: #d9a441;
  --green-500: #4f8a5b;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.08), 0 1px 1px rgba(11, 18, 32, 0.06);
  --shadow-md: 0 6px 20px rgba(11, 18, 32, 0.16);
  --shadow-lg: 0 16px 40px rgba(11, 18, 32, 0.28);

  --container: 1180px;

  color-scheme: light;
  --bg: var(--slate-100);
  --surface: var(--white);
  --text: var(--navy-950);
  --text-muted: #52607a;
  --border: #dbe2ec;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Site header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy-900);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(155deg, var(--rust-500), var(--gold-400));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.brand-mark svg { width: 18px; height: 18px; }

.brand-sub {
  display: none;
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--slate-300);
  margin-left: 4px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  text-decoration: none;
  color: var(--slate-300);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--navy-700);
  color: var(--white);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--navy-600);
  background: transparent;
  color: var(--white);
  cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 760px) {
  .main-nav {
    position: fixed;
    inset: 64px 0 auto 0;
    background: var(--navy-900);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 16px;
    gap: 2px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    border-bottom: 1px solid var(--navy-700);
    box-shadow: var(--shadow-md);
  }
  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .main-nav a { padding: 12px 10px; font-size: 1.02rem; }
  .nav-toggle { display: inline-flex; }
}

@media (min-width: 761px) {
  .nav-toggle { display: none; }
  .brand-sub { display: inline; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  color: var(--white);
  background: linear-gradient(180deg, rgba(11,18,32,0.35), rgba(11,18,32,0.78)), var(--navy-900) center/cover;
  padding: 76px 0 64px;
  text-align: center;
}

.hero-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero p {
  max-width: 620px;
  margin: 0 auto 28px;
  color: var(--slate-300);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--rust-500), var(--gold-400));
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { box-shadow: var(--shadow-md); }

.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: var(--white);
  border-color: rgba(255,255,255,0.35);
}
.btn-ghost:hover { background: rgba(255,255,255,0.16); }

/* ---------- Sections ---------- */

.section { padding: 56px 0; }
.section-tight { padding: 32px 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 1.55rem;
  margin: 0;
  letter-spacing: -0.01em;
}

.section-head p {
  color: var(--text-muted);
  margin: 4px 0 0;
}

.eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust-500);
}

/* ---------- Stat strip ---------- */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: -34px;
  position: relative;
  z-index: 2;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 18px 16px;
  text-align: center;
}
.stat-card strong {
  display: block;
  font-size: 1.5rem;
  color: var(--navy-900);
}
.stat-card span {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 700px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Cards / grids ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.card-media {
  aspect-ratio: 4 / 3;
  background: var(--navy-800) center/cover no-repeat;
  position: relative;
}
.card-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(11,18,32,0.55));
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: 14px 16px 16px; }
.card-body h3 { margin: 0 0 4px; font-size: 1.02rem; }
.card-body p { margin: 0; font-size: 0.86rem; color: var(--text-muted); }

.range-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--white);
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 3px 8px;
  border-radius: 999px;
  position: absolute;
  top: 10px;
  left: 10px;
  backdrop-filter: blur(2px);
}

/* ---------- Range index (peaks/hikes listing) ---------- */

.range-search {
  position: relative;
  margin-bottom: 28px;
}
.range-search input {
  width: 100%;
  padding: 13px 16px 13px 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.98rem;
  box-shadow: var(--shadow-sm);
}
.range-search input:focus { outline: 2px solid var(--rust-400); outline-offset: 1px; }
.range-search svg {
  position: absolute;
  left: 15px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-muted);
}

.range-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 30px;
}
.range-jump a {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-muted);
}
.range-jump a:hover { border-color: var(--rust-400); color: var(--rust-500); }

.range-block { margin-bottom: 38px; scroll-margin-top: 84px; }
.range-block h2 {
  font-size: 1.25rem;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.range-block .range-count {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--slate-100);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 999px;
}

.peak-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.peak-list a {
  display: block;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.peak-list a:hover { border-color: var(--rust-400); background: #fff8f2; }

.peak-list[data-empty="true"] { display: none; }
.no-results { display: none; color: var(--text-muted); padding: 40px 0; text-align: center; }

/* ---------- Peak detail page ---------- */

.detail-hero {
  background: var(--navy-900);
  color: var(--white);
  padding: 34px 0 30px;
}
.breadcrumb {
  font-size: 0.82rem;
  color: var(--slate-400);
  margin-bottom: 10px;
}
.breadcrumb a { color: var(--slate-300); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.detail-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
}
.detail-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--slate-300);
  font-size: 0.92rem;
}
.detail-meta .pill {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.22);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.detail-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 34px;
  padding: 36px 0 64px;
  align-items: start;
}

@media (max-width: 860px) {
  .detail-body { grid-template-columns: 1fr; padding: 26px 0 48px; gap: 26px; }
}

.detail-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  order: 2;
}
.detail-text p { margin: 0 0 14px; color: var(--text); }
.detail-text p:last-child { margin-bottom: 0; }
.detail-text .topo-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--rust-500);
  text-decoration: none;
  border: 1px solid #f0d3bd;
  background: #fff6ee;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.detail-text .topo-link:hover { background: #ffece0; }

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  order: 1;
}
.photo-gallery.single { grid-template-columns: 1fr; }
.photo-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--navy-800);
  text-decoration: none;
}
.photo-item img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.photo-item:hover img { transform: scale(1.045); }
.photo-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 20px 10px 8px;
  font-size: 0.74rem;
  color: var(--white);
  background: linear-gradient(180deg, transparent, rgba(11,18,32,0.85));
}

@media (max-width: 520px) {
  .photo-gallery { grid-template-columns: 1fr; }
}

/* lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(11,18,32,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}
.lightbox-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-caption {
  position: absolute;
  bottom: 22px; left: 0; right: 0;
  text-align: center;
  color: var(--slate-300);
  font-size: 0.88rem;
  padding: 0 16px;
}

/* ---------- Links / submit pages ---------- */

.prose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
}
.prose h2 { margin-top: 0; }
.link-list { display: grid; gap: 8px; margin-top: 10px; }
.link-list a {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--navy-800);
  font-weight: 500;
}
.link-list a:hover { border-color: var(--rust-400); color: var(--rust-500); }

/* ---------- Submit callout ---------- */

.callout {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-950));
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.callout h2 { margin: 0 0 6px; font-size: 1.3rem; }
.callout p { margin: 0; color: var(--slate-300); max-width: 46ch; }

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

.site-footer {
  background: var(--navy-950);
  color: var(--slate-400);
  padding: 40px 0 26px;
  margin-top: 40px;
  font-size: 0.88rem;
}
.site-footer a { color: var(--slate-300); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--navy-700);
  margin-bottom: 18px;
}
.footer-cols { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col h4 {
  color: var(--slate-300);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}
.footer-col a { display: block; padding: 3px 0; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Utility ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--rust-500); color: white; padding: 10px 16px; z-index: 300;
}
.skip-link:focus { left: 10px; top: 10px; }
