/* ===========================
   BHC Redesign Stylesheet
   Bishopstown Hillwalking Club
   =========================== */

/* --- 1. RESET --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; -moz-text-size-adjust: 100%; }
body { line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
iframe { border: 0; }

/* --- 2. CUSTOM PROPERTIES --- */
:root {
  /* Palette — earthy, drawn from Irish mountain landscapes */
  --color-moss:        oklch(0.45 0.08 145);
  --color-moss-light:  oklch(0.55 0.07 145);
  --color-fern:        oklch(0.62 0.12 145);
  --color-slate:       oklch(0.30 0.02 250);
  --color-stone:       oklch(0.78 0.015 80);
  --color-fog:         oklch(0.97 0.005 90);
  --color-cloud:       oklch(0.94 0.005 90);
  --color-ink:         oklch(0.22 0.02 250);
  --color-text-muted:  oklch(0.50 0.01 250);

  /* Semantic */
  --color-bg:          var(--color-fog);
  --color-bg-alt:      var(--color-cloud);
  --color-text:        var(--color-ink);
  --color-heading:     var(--color-slate);
  --color-link:        var(--color-moss);
  --color-link-hover:  var(--color-moss-light);
  --color-accent:      var(--color-fern);

  /* Walk grades */
  --grade-a: oklch(0.55 0.20 25);
  --grade-b: oklch(0.50 0.16 320);
  --grade-c: oklch(0.52 0.16 255);
  --grade-d: oklch(0.52 0.18 145);

  /* Typography scale — fluid */
  --fs-xs:   clamp(0.75rem,  0.7rem + 0.25vw,  0.875rem);
  --fs-sm:   clamp(0.875rem, 0.8rem + 0.35vw,  1rem);
  --fs-base: clamp(1rem,     0.925rem + 0.4vw,  1.125rem);
  --fs-lg:   clamp(1.15rem,  1rem + 0.75vw,     1.35rem);
  --fs-xl:   clamp(1.35rem,  1.1rem + 1.25vw,   1.75rem);
  --fs-2xl:  clamp(1.75rem,  1.3rem + 2.25vw,   2.75rem);
  --fs-3xl:  clamp(2.25rem,  1.5rem + 3.5vw,    4rem);
  --fs-hero: clamp(2.75rem,  1.75rem + 5vw,     5.5rem);

  /* Spacing — 4px base */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Widths */
  --max-width-prose: 65ch;
  --max-width-page:  1100px;
  --max-width-wide:  1300px;

  /* Misc */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px oklch(0.20 0.02 250 / 0.08);
  --shadow-md: 0 4px 14px oklch(0.20 0.02 250 / 0.10);
  --shadow-lg: 0 10px 35px oklch(0.20 0.02 250 / 0.12);
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- 3. BASE / TYPOGRAPHY --- */
html {
  font-size: 100%;
}

body {
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-size: var(--fs-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--color-heading);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-3xl); font-weight: 700; }
h2 { font-size: var(--fs-2xl); font-weight: 700; }
h3 { font-size: var(--fs-xl);  font-weight: 600; }
h4 { font-size: var(--fs-lg);  font-weight: 600; }

p {
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--color-text);
}

a:not(.btn) {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-color: oklch(0.45 0.08 145 / 0.3);
  text-underline-offset: 3px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:not(.btn):hover {
  color: var(--color-link-hover);
  text-decoration-color: var(--color-link-hover);
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

ul.styled, ol.styled {
  padding-left: var(--space-6);
}

ul.styled { list-style-type: disc; }
ol.styled { list-style-type: decimal; }

ul.styled li, ol.styled li {
  margin-bottom: var(--space-3);
  font-size: var(--fs-base);
  line-height: 1.7;
}

strong { font-weight: 600; }

/* --- 4. LAYOUT UTILITIES --- */
.page-wrap {
  width: 100%;
  max-width: var(--max-width-page);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.page-wrap--wide {
  max-width: var(--max-width-wide);
}

.prose {
  max-width: var(--max-width-prose);
}

.prose-center {
  max-width: var(--max-width-prose);
  margin-inline: auto;
}

.flow > * + * {
  margin-top: var(--space-6);
}

.flow-sm > * + * {
  margin-top: var(--space-4);
}

.flow-lg > * + * {
  margin-top: var(--space-12);
}

.section {
  padding-block: var(--space-16);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }

.section-intro {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-intro p {
  max-width: var(--max-width-prose);
  margin-inline: auto;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 1000;
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-2);
}

/* --- 5. COMPONENTS --- */

/* === Site Header === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-block: var(--space-4);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.site-header .page-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header--scrolled {
  background: oklch(0.97 0.005 90 / 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

/* On non-home pages, always show header background */
.page-interior .site-header {
  background: oklch(0.97 0.005 90 / 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.page-interior .site-header.header--scrolled {
  box-shadow: var(--shadow-sm);
}

.site-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--color-heading);
  text-decoration: none;
  letter-spacing: -0.02em;
}

/* On homepage, logo starts white until scrolled */
.page-home .site-logo {
  color: white;
  text-shadow: 0 1px 4px oklch(0 0 0 / 0.3);
}

.page-home .header--scrolled .site-logo {
  color: var(--color-heading);
  text-shadow: none;
}

.nav-links {
  display: flex;
  gap: var(--space-8);
  align-items: center;
}

.nav-links a {
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--color-heading);
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--color-accent);
}

.nav-links a.is-active {
  color: var(--color-accent);
}

.page-home .nav-links a.is-active {
  color: oklch(1 0 0 / 0.7);
}

.page-home .header--scrolled .nav-links a.is-active {
  color: var(--color-accent);
}

.nav-links .external-icon {
  font-size: 0.7em;
  opacity: 0.5;
  margin-left: 2px;
}

/* Homepage nav starts white */
.page-home .nav-links a {
  color: white;
  text-shadow: 0 1px 4px oklch(0 0 0 / 0.3);
}

.page-home .header--scrolled .nav-links a {
  color: var(--color-heading);
  text-shadow: none;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: oklch(0.30 0.02 250 / 0.08);
  border: 1.5px solid oklch(0.30 0.02 250 / 0.25);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: var(--space-2);
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 101;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.nav-toggle:hover {
  background: oklch(0.30 0.02 250 / 0.14);
  border-color: oklch(0.30 0.02 250 / 0.4);
}

.nav-toggle:active {
  background: oklch(0.30 0.02 250 / 0.18);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-heading);
  margin: 4px 0;
  transition: transform var(--transition-base), opacity var(--transition-fast);
  transform-origin: center;
}

.page-home .nav-toggle {
  background: oklch(1 0 0 / 0.12);
  border-color: oklch(1 0 0 / 0.3);
}

.page-home .nav-toggle:hover {
  background: oklch(1 0 0 / 0.2);
  border-color: oklch(1 0 0 / 0.5);
}

.page-home .nav-toggle span {
  background: white;
}

.page-home .header--scrolled .nav-toggle {
  background: oklch(0.30 0.02 250 / 0.08);
  border-color: oklch(0.30 0.02 250 / 0.25);
}

.page-home .header--scrolled .nav-toggle:hover {
  background: oklch(0.30 0.02 250 / 0.14);
  border-color: oklch(0.30 0.02 250 / 0.4);
}

.page-home .header--scrolled .nav-toggle span {
  background: var(--color-heading);
}

/* Hamburger to X animation */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-bg);
    padding: var(--space-24) var(--space-6) var(--space-8);
    gap: var(--space-4);
    transform: translateY(-100%);
    transition: transform var(--transition-slow);
    box-shadow: var(--shadow-lg);
    z-index: 99;
  }

  .nav-links.is-open {
    transform: translateY(0);
  }

  .nav-links a {
    font-size: var(--fs-lg);
    color: var(--color-heading);
    text-shadow: none;
  }

  /* Override homepage white text in mobile menu */
  .page-home .nav-links a {
    color: var(--color-heading);
    text-shadow: none;
  }
}

/* === Hero === */
.hero {
  position: relative;
  min-height: 70svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero--short {
  min-height: 45svh;
}

.hero__image {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    oklch(0.15 0.02 250 / 0.25) 0%,
    oklch(0.15 0.02 250 / 0.65) 100%
  );
}

.hero--short .hero__overlay {
  background: linear-gradient(
    to bottom,
    oklch(0.15 0.02 250 / 0.35) 0%,
    oklch(0.15 0.02 250 / 0.6) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  color: white;
  padding: var(--space-8) var(--space-6);
  max-width: 800px;
}

.hero__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: var(--fs-hero);
  font-weight: 700;
  color: white;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.hero--short .hero__title {
  font-size: var(--fs-3xl);
}

.hero__subtitle {
  font-size: var(--fs-lg);
  font-weight: 400;
  color: oklch(0.92 0.005 90);
  margin-bottom: var(--space-8);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 6px oklch(0 0 0 / 0.5);
}

.hero__scroll {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  opacity: 0.6;
  animation: scroll-hint 2s ease-in-out infinite;
}

.hero__scroll svg {
  width: 28px;
  height: 28px;
  stroke: white;
  stroke-width: 2;
  fill: none;
}

@keyframes scroll-hint {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
  50%      { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* === Page Header (non-hero) === */
.page-header {
  background: var(--color-slate);
  color: white;
  padding: var(--space-32) var(--space-6) var(--space-16);
  text-align: center;
}

.page-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: var(--fs-3xl);
  font-weight: 700;
  color: white;
  margin-bottom: var(--space-3);
}

.page-header p {
  font-size: var(--fs-lg);
  color: oklch(0.85 0.005 250);
  font-weight: 300;
}

/* === Statement Banner === */
.statement-banner {
  background: var(--color-moss);
  color: white;
  padding: var(--space-32) var(--space-6) var(--space-16);
  text-align: center;
}

.statement-banner h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: var(--fs-hero);
  font-weight: 700;
  color: white;
  line-height: 1.1;
  max-width: 14ch;
  margin-inline: auto;
  margin-bottom: var(--space-4);
}

.statement-banner p {
  font-size: var(--fs-lg);
  color: oklch(1 0 0 / 0.8);
  max-width: 45ch;
  margin-inline: auto;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: 'Source Sans 3', sans-serif;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  padding: var(--space-3) var(--space-8);
  border-radius: 100px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.btn--primary:hover {
  background: var(--color-moss-light);
  border-color: var(--color-moss-light);
}

.btn--outline {
  background: transparent;
  color: white;
  border-color: oklch(1 0 0 / 0.5);
}

.btn--outline:hover {
  background: oklch(1 0 0 / 0.15);
  border-color: white;
}

.btn--outline-dark {
  background: transparent;
  color: var(--color-moss);
  border-color: var(--color-moss);
}

.btn--outline-dark:hover {
  background: var(--color-moss);
  color: white;
}

.btn--lg {
  font-size: var(--fs-base);
  padding: var(--space-4) var(--space-12);
}

/* === Key Highlights (top 3 benefits) === */
.highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

.highlight-item {
  text-align: center;
}

.highlight-item h3 {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-2);
}

.highlight-item p {
  font-size: var(--fs-base);
  color: var(--color-text-muted);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .highlights {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .highlight-item {
    text-align: left;
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-stone);
  }

  .highlight-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
}

/* === Perks List (secondary benefits) === */
.perks-list {
  padding-left: var(--space-6);
  list-style: disc;
  column-count: 2;
  column-gap: var(--space-12);
}

.perks-list li {
  margin-bottom: var(--space-3);
  line-height: 1.6;
  font-size: var(--fs-base);
  break-inside: avoid;
}

@media (max-width: 640px) {
  .perks-list {
    column-count: 1;
  }
}

/* === Grade Cards === */
.grade-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-6);
}

.grade-card {
  border-top: 4px solid var(--grade-color, var(--color-stone));
  padding: var(--space-6) var(--space-6) var(--space-8);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.section--alt .grade-card {
  background: oklch(0.995 0.003 90);
}

.grade-card__letter {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: var(--fs-2xl);
  font-weight: 900;
  color: var(--grade-color, var(--color-heading));
  margin-bottom: var(--space-1);
}

.grade-card__name {
  font-weight: 600;
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.grade-card__desc {
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--color-text);
}

/* === CTA Banner === */
.cta-banner {
  background: var(--color-moss);
  color: white;
  text-align: center;
  padding-block: var(--space-16);
}

.cta-banner h2 {
  color: white;
  margin-bottom: var(--space-6);
}

.cta-banner p {
  opacity: 0.85;
  font-size: var(--fs-lg);
  margin-bottom: var(--space-8);
}

.cta-banner .btn {
  background: white;
  color: var(--color-moss);
  border-color: white;
}

.cta-banner .btn:hover {
  background: oklch(1 0 0 / 0.85);
}

/* === Callout Box === */
.callout {
  background: var(--color-bg-alt);
  border-left: 4px solid var(--color-accent);
  padding: var(--space-6);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.callout--center {
  border-left: none;
  border-radius: var(--radius-md);
  text-align: center;
}

/* === Membership Cost Highlight === */
.cost-highlight {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.cost-highlight__symbol {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--color-accent);
}

.cost-highlight__amount {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: var(--fs-hero);
  font-weight: 900;
  color: var(--color-heading);
  line-height: 1;
}

/* === Contact Card === */
.contact-card {
  background: var(--color-bg-alt);
  padding: var(--space-8);
  border-radius: var(--radius-md);
}

.contact-card h3 {
  margin-bottom: var(--space-4);
}

.contact-card p {
  margin-bottom: var(--space-2);
}

.contact-card p:last-child {
  margin-bottom: 0;
  margin-top: var(--space-4);
}

/* === Gear Item (Beginners) === */
.gear-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space-8);
  align-items: start;
  padding-block: var(--space-8);
}

.gear-item + .gear-item {
  border-top: 1px solid var(--color-stone);
}

.gear-item__image {
  background: var(--color-cloud);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gear-item__image img {
  width: 100%;
  height: auto;
}

.gear-item__content h3 {
  margin-bottom: var(--space-3);
}

.gear-item__content ul {
  padding-left: var(--space-6);
  list-style-type: disc;
  margin-top: var(--space-3);
  margin-bottom: var(--space-3);
}

.gear-item__content li {
  margin-bottom: var(--space-2);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .gear-item {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .gear-item__image {
    max-width: 140px;
  }
}

/* === Misc Gear Grid === */
.misc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-6);
}

.misc-item h4 {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.misc-item h4 .fa {
  color: var(--color-accent);
  margin-right: var(--space-1);
}

.misc-item p {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

/* === Map Embed === */
.map-embed {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* === Rules TOC === */
.rules-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-12);
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(80px + var(--space-6));
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.toc h3 {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Source Sans 3', sans-serif;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.toc ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toc a {
  font-size: var(--fs-sm);
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.toc a:hover {
  color: var(--color-accent);
}

@media (max-width: 900px) {
  .rules-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    padding: var(--space-4);
  }

  .toc h3 {
    width: 100%;
    margin-bottom: var(--space-2);
  }

  .toc ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
  }
}

/* Rules sections scroll offset for sticky header */
.rules-section {
  scroll-margin-top: 100px;
}

.rules-section + .rules-section {
  margin-top: var(--space-12);
  padding-top: var(--space-12);
  border-top: 1px solid var(--color-stone);
}

/* Numbered rules with breathing room */
.rules-list {
  padding-left: var(--space-6);
  list-style-type: decimal;
  counter-reset: none;
}

.rules-list li {
  margin-bottom: var(--space-6);
  line-height: 1.7;
  padding-left: var(--space-2);
}

/* Highlighted rule */
.rules-list li.rule-highlight {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-4);
  margin-left: calc(-1 * var(--space-6) - 3px);
}

/* === Walk example callout === */
.walk-example {
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  font-family: 'Source Sans 3', sans-serif;
}

.walk-example code {
  display: block;
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--fs-sm);
  line-height: 1.8;
  font-weight: 600;
  color: var(--color-heading);
  background: oklch(0.995 0.003 90);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-stone);
  margin-bottom: var(--space-4);
}

/* === Walk Example Label === */
.walk-example__label {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  font-weight: 600;
}

.walk-example__annotation {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

/* === Inline CTA (contextual next-step) === */
.cta-inline {
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  text-align: center;
  margin-top: var(--space-12);
}

.cta-inline p {
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
}

.cta-inline p:last-child {
  margin-bottom: 0;
}

/* === Location Links === */
.location-links {
  column-count: 2;
  column-gap: var(--space-8);
}

.location-links li {
  margin-bottom: var(--space-3);
  break-inside: avoid;
}

@media (max-width: 640px) {
  .location-links {
    column-count: 1;
  }
}

/* === Info Box === */
.info-box {
  background: var(--color-bg-alt);
  padding: var(--space-6);
  border-radius: var(--radius-md);
  margin-block: var(--space-6);
}

.info-box h4 {
  margin-bottom: var(--space-3);
}

.info-box .text-muted {
  font-size: var(--fs-sm);
  margin-top: var(--space-2);
}

/* === Calendar Link Card === */
.calendar-card {
  display: block;
  background: oklch(0.995 0.003 90);
  border: 2px solid var(--color-stone);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  text-align: center;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.calendar-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}

.calendar-card h3 {
  margin-bottom: var(--space-4);
}

.calendar-card .btn {
  margin-top: var(--space-4);
}

.calendar-card .fa-external-link {
  font-size: 0.8em;
}

/* === Discount List === */
.discount-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.discount-item {
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-stone);
}

.discount-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.discount-item__name {
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--color-heading);
}

.discount-item__detail {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

/* === Site Footer === */
.site-footer {
  background: var(--color-slate);
  color: oklch(0.85 0.005 250);
  padding-block: var(--space-16) var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: white;
  margin-bottom: var(--space-3);
}

.footer-tagline {
  font-size: var(--fs-sm);
  color: oklch(0.78 0.005 250);
  margin-bottom: var(--space-6);
}

.footer-social {
  display: flex;
  gap: var(--space-4);
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: oklch(1 0 0 / 0.1);
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
  transition: background var(--transition-fast);
}

.footer-social a:hover {
  background: oklch(1 0 0 / 0.2);
}

.footer-info h4 {
  font-family: 'Source Sans 3', sans-serif;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: oklch(0.65 0.005 250);
  margin-bottom: var(--space-4);
}

.footer-info p {
  font-size: var(--fs-sm);
  color: oklch(0.80 0.005 250);
  line-height: 1.7;
  margin-bottom: var(--space-2);
}

.footer-info a {
  color: oklch(0.80 0.005 250);
  text-decoration: underline;
  text-decoration-color: oklch(1 0 0 / 0.2);
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.footer-info a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid oklch(1 0 0 / 0.1);
  padding-top: var(--space-6);
  font-size: var(--fs-xs);
  opacity: 0.5;
  text-align: center;
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

/* --- 6. MOBILE RESPONSIVE --- */

/* Tighten page-wrap padding on small screens */
@media (max-width: 480px) {
  .page-wrap {
    padding-inline: var(--space-4);
  }
}

/* Mobile nav: safe areas and touch targets */
@media (max-width: 768px) {
  /* Safe area for notched phones */
  .nav-links {
    padding-top: calc(var(--space-24) + env(safe-area-inset-top, 0px));
    padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom, 0px));
  }

  /* Bigger touch targets for mobile nav links */
  .nav-links a {
    padding: var(--space-2) 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Hero adjustments on mobile */
@media (max-width: 640px) {
  .hero {
    min-height: 55svh;
  }

  .hero--short {
    min-height: 35svh;
  }

  .hero__content {
    padding: var(--space-6) var(--space-4);
  }

  .hero__subtitle {
    margin-bottom: var(--space-6);
  }
}

/* Page header / statement banner: reduce top padding on mobile (fixed header is shorter) */
@media (max-width: 640px) {
  .page-header {
    padding: var(--space-24) var(--space-4) var(--space-12);
  }

  .statement-banner {
    padding: var(--space-24) var(--space-4) var(--space-12);
  }

  .statement-banner h1 {
    max-width: none;
  }
}

/* Section padding on mobile */
@media (max-width: 640px) {
  .section {
    padding-block: var(--space-12);
  }

  .section-intro {
    margin-bottom: var(--space-8);
  }

  .cta-banner {
    padding-block: var(--space-12);
  }
}

/* Grade cards: prevent overflow on very narrow screens */
@media (max-width: 480px) {
  .grade-cards {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }

  .grade-card {
    padding: var(--space-4) var(--space-4) var(--space-6);
  }

  .grade-card__letter {
    font-size: var(--fs-xl);
  }
}

@media (max-width: 360px) {
  .grade-cards {
    grid-template-columns: 1fr;
  }
}

/* Buttons: tighter horizontal padding on mobile */
@media (max-width: 480px) {
  .btn--lg {
    padding: var(--space-3) var(--space-8);
    font-size: var(--fs-sm);
  }

  .btn {
    padding: var(--space-3) var(--space-6);
  }
}

/* Map embed: taller aspect ratio on mobile */
@media (max-width: 640px) {
  .map-embed {
    aspect-ratio: 4 / 3;
  }
}

/* Walk example code: allow wrapping on mobile */
.walk-example code {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Rules highlight: fix negative margin on mobile */
@media (max-width: 640px) {
  .rules-list li.rule-highlight {
    margin-left: 0;
    padding-left: var(--space-4);
    border-left-width: 3px;
  }

  .rules-section + .rules-section {
    margin-top: var(--space-8);
    padding-top: var(--space-8);
  }
}

/* TOC: make links touch-friendly on mobile */
@media (max-width: 900px) {
  .toc a {
    padding: var(--space-1) var(--space-3);
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    background: oklch(0.90 0.005 90);
    border-radius: var(--radius-sm);
  }
}

/* Calendar card: active state for touch */
.calendar-card:active {
  border-color: var(--color-accent);
  transform: scale(0.99);
}

/* Footer social: slightly larger on touch devices */
@media (pointer: coarse) {
  .footer-social a {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
}

/* Footer: tighten on mobile */
@media (max-width: 640px) {
  .site-footer {
    padding-block: var(--space-12) var(--space-6);
  }

  .footer-grid {
    margin-bottom: var(--space-8);
  }

  .footer-brand {
    font-size: var(--fs-lg);
  }
}

/* Contact card: slightly less padding on mobile */
@media (max-width: 480px) {
  .contact-card {
    padding: var(--space-6);
  }

  .callout {
    padding: var(--space-4);
  }

  .info-box {
    padding: var(--space-4);
  }

  .calendar-card {
    padding: var(--space-6);
  }
}

/* Misc grid: ensure single column on very small screens */
@media (max-width: 480px) {
  .misc-grid {
    grid-template-columns: 1fr;
  }
}

/* Ensure touch-friendly link spacing throughout */
@media (pointer: coarse) {
  .location-links li {
    margin-bottom: var(--space-4);
  }

  .location-links a {
    display: inline-block;
    padding: var(--space-1) 0;
    min-height: 44px;
    line-height: 44px;
  }

  .rules-list li {
    margin-bottom: var(--space-8);
  }
}

/* Discount items: ensure readable on narrow screens */
@media (max-width: 480px) {
  .discount-item__name {
    font-size: var(--fs-sm);
  }
}

/* Prevent horizontal overflow globally */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

/* --- 7. ANIMATIONS --- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fade-up {
    from {
      opacity: 0;
      transform: translateY(24px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .animate-on-scroll {
    opacity: 0;
  }

  .animate-on-scroll.is-visible {
    animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  /* Staggered children */
  .stagger-children.is-visible > * {
    opacity: 0;
    animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .stagger-children.is-visible > *:nth-child(1) { animation-delay: 0ms; }
  .stagger-children.is-visible > *:nth-child(2) { animation-delay: 80ms; }
  .stagger-children.is-visible > *:nth-child(3) { animation-delay: 160ms; }
  .stagger-children.is-visible > *:nth-child(4) { animation-delay: 240ms; }
  .stagger-children.is-visible > *:nth-child(5) { animation-delay: 320ms; }
  .stagger-children.is-visible > *:nth-child(6) { animation-delay: 400ms; }
  .stagger-children.is-visible > *:nth-child(7) { animation-delay: 480ms; }
  .stagger-children.is-visible > *:nth-child(8) { animation-delay: 560ms; }
}

/* Reduced motion: show everything immediately */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1;
  }
}

/* --- 8. PRINT STYLES --- */
@media print {
  .site-header, .site-footer, .hero__overlay, .hero__scroll, .nav-toggle, .cta-banner { display: none; }
  .hero { min-height: auto; padding: var(--space-8) 0; }
  .hero__content { color: black; }
  .hero__title { color: black; font-size: 2rem; }
  body { color: black; background: white; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: gray; }
  .section { padding-block: var(--space-6); }
}
