/* Castle Cary Guide - Stylesheet */

/* Page load fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body {
  animation: fadeIn 0.6s ease-out;
}

:root {
  /* Primary Greens - Rich orchard greens */
  --color-primary: #1e3a0f;
  --color-primary-light: #2d5016;
  --color-primary-lighter: #4a7c23;

  /* Warm Accent Colors - Somerset honey/cider tones */
  --color-accent: #6b3d12;
  --color-accent-warm: #8b5a2b;
  --color-gold: #c9a227;
  --color-gold-light: #e8d48b;
  --color-amber: #d4a84b;

  /* Warm Backgrounds */
  --color-bg: #fdfcf8;
  --color-bg-alt: #f5f1e8;
  --color-bg-warm: #f9f5eb;

  /* Card & Surface Colors */
  --color-card: #ffffff;
  --color-card-hover: #fffdf8;

  /* Text Colors - Warmer undertones */
  --color-text: #2a2520;
  --color-text-light: #4a4540;
  --color-text-muted: #6b6560;

  /* Border Colors */
  --color-border: #e5dfd5;
  --color-border-light: #f0ebe0;

  /* Warm-tinted shadows */
  --shadow-xs: 0 1px 2px rgba(45, 35, 25, 0.04);
  --shadow-sm: 0 1px 3px rgba(45, 35, 25, 0.06),
               0 1px 2px rgba(45, 35, 25, 0.04);
  --shadow-md: 0 4px 6px rgba(45, 35, 25, 0.05),
               0 2px 4px rgba(45, 35, 25, 0.04),
               0 1px 2px rgba(45, 35, 25, 0.03);
  --shadow-lg: 0 10px 20px rgba(45, 35, 25, 0.08),
               0 6px 10px rgba(45, 35, 25, 0.05),
               0 2px 4px rgba(45, 35, 25, 0.03);
  --shadow-xl: 0 20px 40px rgba(45, 35, 25, 0.1),
               0 10px 20px rgba(45, 35, 25, 0.06);
  --shadow-primary: 0 4px 14px rgba(30, 58, 15, 0.15);
  --shadow-gold: 0 4px 14px rgba(201, 162, 39, 0.2);

  /* Border Radius */
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Category colors */
  --color-walks: #2e7d32;
  --color-food: #e65100;
  --color-drink: #6d4c41;
  --color-wellness: #00838f;
  --color-creative: #7b1fa2;
  --color-events: #1565c0;
  --color-free: #388e3c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Header */
header {
  background:
    linear-gradient(
      to bottom,
      rgba(30, 58, 15, 0.75) 0%,
      rgba(30, 58, 15, 0.65) 50%,
      rgba(30, 58, 15, 0.8) 100%
    ),
    url('https://images.unsplash.com/photo-1708278173014-48cdec5451a1?auto=format&fit=crop&w=1920&q=80') center center / cover no-repeat;
  color: white;
  padding: 5rem 1.5rem 5.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 40%);
  pointer-events: none;
}

/* Decorative bottom curve */
header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 30px;
  background: var(--color-bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}

header .header-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

header .header-logo {
  width: 100%;
  max-width: 400px;
  height: auto;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25),
              0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  background: white;
  padding: 0.25rem;
}

header .header-logo:hover {
  transform: scale(1.03);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3),
              0 6px 16px rgba(0, 0, 0, 0.2);
}

header h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  letter-spacing: -0.02em;
}

/* Gold accent underline for title */
header h1::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-gold);
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

header .subtitle {
  font-size: 1.15rem;
  opacity: 0.95;
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Navigation */
nav {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(253, 252, 248, 0.98) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(30, 58, 15, 0.1);
}

.nav-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  padding: 0.75rem 0;
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand img {
  height: 28px;
  width: 28px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  background: var(--color-primary);
  border: none;
  font-size: 1.25rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: white;
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.nav-toggle:hover {
  background: var(--color-primary-light);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  padding: 0.5rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-links li a {
  display: block;
  padding: 0.625rem 1.125rem;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: all var(--transition-base);
  position: relative;
}

/* Underline animation on hover */
.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: all var(--transition-base);
  transform: translateX(-50%);
  border-radius: 1px;
}

.nav-links li a:hover::after {
  width: calc(100% - 1.5rem);
}

.nav-links li a:hover {
  color: var(--color-primary);
  background: var(--color-bg-warm);
}

.nav-links li a.active {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-primary);
}

.nav-links li a.active::after {
  display: none;
}

.nav-links li a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Main content */
main {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section {
  padding: 4rem 2rem;
}

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

/* Rolling hills divider between sections */
.section.alt-bg::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 24px;
  background: var(--color-bg);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 24' preserveAspectRatio='none'%3E%3Cpath d='M0,24 C150,24 200,8 400,8 C550,8 600,18 800,18 C950,18 1050,6 1200,6 L1200,0 L0,0 Z' fill='%23000'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 24' preserveAspectRatio='none'%3E%3Cpath d='M0,24 C150,24 200,8 400,8 C550,8 600,18 800,18 C950,18 1050,6 1200,6 L1200,0 L0,0 Z' fill='%23000'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

/* Hills divider going back to light bg */
.section.alt-bg + .section:not(.alt-bg)::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 24px;
  background: var(--color-bg-alt);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 24' preserveAspectRatio='none'%3E%3Cpath d='M0,24 C200,24 300,10 500,10 C700,10 750,20 900,20 C1050,20 1100,8 1200,8 L1200,0 L0,0 Z' fill='%23000'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 24' preserveAspectRatio='none'%3E%3Cpath d='M0,24 C200,24 300,10 500,10 C700,10 750,20 900,20 C1050,20 1100,8 1200,8 L1200,0 L0,0 Z' fill='%23000'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.section.alt-bg + .section:not(.alt-bg) {
  position: relative;
}

.section h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  display: inline-block;
  position: relative;
}

/* Gradient underline for h2 */
.section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-gold));
  border-radius: 2px;
}

.section h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--color-accent);
  margin: 2.5rem 0 1.25rem;
  position: relative;
  padding-left: 0.75rem;
}

/* Decorative left accent for h3 */
.section h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 3px;
  background: var(--color-gold);
  border-radius: 2px;
}

.section-intro {
  color: var(--color-text-light);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 700px;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

/* Subtle top gradient accent - appears on hover */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--color-border);
}

.card:hover::before {
  opacity: 1;
}

.card.highlight {
  border-left: 4px solid var(--color-gold);
  background: linear-gradient(135deg, var(--color-card) 0%, var(--color-bg-warm) 100%);
}

.card.highlight::before {
  background: linear-gradient(90deg, var(--color-gold), var(--color-amber));
}

/* Category-colored cards */
.card.walks { border-left: 4px solid var(--color-walks); }
.card.walks:hover::before { background: var(--color-walks); }

.card.food { border-left: 4px solid var(--color-food); }
.card.food:hover::before { background: var(--color-food); }

.card.drink { border-left: 4px solid var(--color-drink); }
.card.drink:hover::before { background: var(--color-drink); }

.card.wellness { border-left: 4px solid var(--color-wellness); }
.card.wellness:hover::before { background: var(--color-wellness); }

.card.creative { border-left: 4px solid var(--color-creative); }
.card.creative:hover::before { background: var(--color-creative); }

.card.events { border-left: 4px solid var(--color-events); }
.card.events:hover::before { background: var(--color-events); }

/* Card with image */
.card-img {
  width: calc(100% + 3rem);
  height: 160px;
  margin: -1.5rem -1.5rem 1rem -1.5rem;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card h3, .card h4 {
  color: var(--color-text);
  margin-bottom: 0.625rem;
  transition: color var(--transition-fast);
}

.card:hover h4 {
  color: var(--color-primary);
}

.card h4 {
  font-size: 1.15rem;
  font-weight: 600;
}

.card p {
  margin-bottom: 0.625rem;
  color: var(--color-text);
  line-height: 1.7;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: all var(--transition-fast);
}

.badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.badge-free {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  color: #1b5e20;
  border: 1px solid #a5d6a7;
}

.badge-free:hover {
  background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
}

.badge-dog {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  color: #e65100;
  border: 1px solid #ffcc80;
}

.badge-book {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  color: #1565c0;
  border: 1px solid #90caf9;
}

.badge-top {
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  color: #b8860b;
  border: 1px solid #ffe082;
  box-shadow: 0 2px 4px rgba(201, 162, 39, 0.15);
}

.card ul {
  margin-left: 1.25rem;
  color: var(--color-text);
}

.card ul li {
  margin-bottom: 0.25rem;
}

.card .meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.375rem;
}

.card a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}

/* Animated underline for card links */
.card a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-primary);
  transition: width var(--transition-fast);
}

.card a:hover::after {
  width: 100%;
}

.card a:hover {
  color: var(--color-primary-lighter);
}

/* Link list */
.link-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.link-list a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.link-list a:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  background: linear-gradient(145deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
  color: white;
  text-align: center;
  padding: 0 1.5rem 2.5rem;
  position: relative;
}

/* Trees and hills silhouette illustration */
.footer-illustration {
  height: 80px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 80' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='sky' x1='0%25' y1='0%25' x2='0%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:%23fdfcf8'/%3E%3Cstop offset='100%25' style='stop-color:%232d5a1e'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect fill='url(%23sky)' width='1200' height='80'/%3E%3Cpath d='M0,80 L0,50 Q100,35 150,45 Q200,55 250,40 Q350,20 450,35 Q500,42 550,30 Q650,15 750,25 Q850,35 900,28 Q1000,18 1100,30 Q1150,36 1200,25 L1200,80 Z' fill='%232d5a1e'/%3E%3Ccircle cx='180' cy='38' r='18' fill='%231e4a12'/%3E%3Cellipse cx='180' cy='50' rx='4' ry='12' fill='%23382a1a'/%3E%3Ccircle cx='220' cy='42' r='14' fill='%23234f15'/%3E%3Cellipse cx='220' cy='52' rx='3' ry='10' fill='%23382a1a'/%3E%3Ccircle cx='420' cy='32' r='16' fill='%231e4a12'/%3E%3Cellipse cx='420' cy='44' rx='3' ry='11' fill='%23382a1a'/%3E%3Ccircle cx='780' cy='28' r='12' fill='%23234f15'/%3E%3Cellipse cx='780' cy='38' rx='2' ry='9' fill='%23382a1a'/%3E%3Ccircle cx='820' cy='32' r='15' fill='%231e4a12'/%3E%3Cellipse cx='820' cy='44' rx='3' ry='10' fill='%23382a1a'/%3E%3Ccircle cx='1050' cy='30' r='14' fill='%23234f15'/%3E%3Cellipse cx='1050' cy='41' rx='3' ry='10' fill='%23382a1a'/%3E%3Cpath d='M590,50 L600,25 L610,50 Z' fill='%23463a2a'/%3E%3Crect x='597' y='50' width='6' height='8' fill='%23463a2a'/%3E%3Crect x='585' y='42' width='12' height='10' fill='%23594d3d'/%3E%3Crect x='603' y='42' width='12' height='10' fill='%23594d3d'/%3E%3Crect x='589' y='45' width='4' height='4' fill='%23c9a227'/%3E%3Crect x='607' y='45' width='4' height='4' fill='%23c9a227'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: bottom;
}

.footer-content {
  padding-top: 2rem;
}

.footer-logo {
  width: 80px;
  height: auto;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.footer-tagline {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  opacity: 0.95;
}

.footer-address {
  margin-bottom: 1.5rem;
}

.footer-address p {
  font-size: 0.95rem;
  opacity: 0.85;
  margin: 0;
}

footer p {
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  position: relative;
  transition: all var(--transition-fast);
}

/* Gold underline animation on hover */
.footer-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-gold);
  transition: width var(--transition-base);
}

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

.footer-links a:hover::after {
  width: 100%;
}

footer .small {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 1rem;
  margin-bottom: 0;
}

/* Mobile styles */
@media (max-width: 768px) {
  header {
    padding: 2.5rem 1rem 3rem;
  }

  header::after {
    height: 20px;
  }

  header .header-logo {
    max-width: 280px;
    padding: 0.2rem;
  }

  header h1 {
    font-size: 1.75rem;
  }

  header h1::after {
    width: 40px;
  }

  header .subtitle {
    font-size: 0.95rem;
  }

  .nav-brand {
    display: flex;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    padding: 1rem 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 2px solid var(--color-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li a {
    padding: 0.875rem 1.5rem;
    border-bottom: 1px solid var(--color-border-light);
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  .nav-links li a:hover {
    background: var(--color-bg-warm);
  }

  .nav-links li a::after {
    display: none;
  }

  nav {
    position: sticky;
  }

  .nav-content {
    position: relative;
  }

  .section {
    padding: 2.5rem 1rem;
  }

  .section h2 {
    font-size: 1.5rem;
  }

  .section h3 {
    font-size: 1.1rem;
    margin: 2rem 0 1rem;
  }

  .section-intro {
    font-size: 1rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card {
    padding: 1.25rem;
  }

  .card-img {
    width: calc(100% + 2.5rem);
    margin: -1.25rem -1.25rem 1rem -1.25rem;
    height: 140px;
  }

  .card:hover {
    transform: translateY(-2px);
  }

  .card h4 {
    font-size: 1.05rem;
  }

  .link-list {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-illustration {
    height: 50px;
  }

  .footer-logo {
    width: 60px;
  }

  /* Collapsible sections on mobile */
  details summary {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }

  details .details-content {
    padding: 0.875rem 1rem;
  }

  details .details-content li {
    padding: 0.625rem 0;
    font-size: 0.9rem;
  }

  details .details-content li:hover {
    padding-left: 0;
    margin: 0;
    background: none;
  }

  /* Event date styling on mobile */
  .event-date {
    display: block;
    margin-bottom: 0.25rem;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }

  .section {
    padding: 2rem 0.875rem;
  }

  .section h2 {
    font-size: 1.35rem;
  }

  .card {
    padding: 1rem;
  }

  .badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
  }

  details summary {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  details .details-content {
    padding: 0.75rem;
  }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
  .nav-links li a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  details summary {
    min-height: 48px;
  }

  .card a {
    display: inline-block;
    padding: 0.25rem 0;
  }

  .link-list a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Prevent text size adjustment on orientation change */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Collapsible sections */
details {
  background: var(--color-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all var(--transition-base);
}

details:hover {
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

details summary {
  padding: 1.125rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  transition: all var(--transition-fast);
  user-select: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary:hover {
  background: var(--color-bg-warm);
  color: var(--color-primary);
}

/* Animated chevron icon */
details summary::after {
  content: '';
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--color-text-light);
  border-bottom: 2px solid var(--color-text-light);
  transform: rotate(-45deg);
  transition: all var(--transition-base);
  margin-left: 1rem;
  flex-shrink: 0;
}

details[open] summary::after {
  transform: rotate(45deg);
  margin-top: 4px;
}

details[open] summary {
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-bg-warm);
}

details .details-content {
  padding: 1.25rem 1.5rem;
}

details .details-content ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

details .details-content li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border-light);
  transition: all var(--transition-fast);
}

details .details-content li:last-child {
  border-bottom: none;
}

details .details-content li:hover {
  padding-left: 0.5rem;
  background: var(--color-bg);
  margin: 0 -0.5rem;
  padding-right: 0.5rem;
  border-radius: var(--radius);
}

details .details-content .event-date {
  font-size: 0.85rem;
  color: var(--color-primary);
  font-weight: 600;
  background: var(--color-bg-alt);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.5rem;
}

details .details-content .event-name {
  display: block;
}

details .details-content a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

details .details-content a:hover {
  color: var(--color-primary);
}

/* Quick Reference card styling */
#quick-reference .card {
  border-top: 3px solid var(--color-primary);
}

#quick-reference .card:nth-child(1) {
  border-top-color: var(--color-free);
}

#quick-reference .card:nth-child(2) {
  border-top-color: #e65100;
}

#quick-reference .card:nth-child(3) {
  border-top-color: #1565c0;
}

#quick-reference .card:nth-child(4) {
  border-top-color: var(--color-gold);
}

#quick-reference .card h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border-light);
}

#quick-reference .card h3::before {
  display: none;
}

/* About page styles */
.header-compact {
  padding: 2rem 1.5rem 3rem;
}

.header-compact .header-logo {
  max-width: 200px;
  margin-bottom: 1rem;
}

.header-compact h1 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.about-intro {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--color-text);
  max-width: 800px;
  margin: 0 auto 2rem;
  text-align: center;
}

.about-grid {
  max-width: 900px;
  margin: 0 auto;
}

.about-card {
  text-align: left;
}

.about-card h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.about-card h3::before {
  display: none;
}

.about-role {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem !important;
}

.about-card p {
  margin-bottom: 1rem;
}

.about-card strong {
  color: var(--color-primary);
}

.about-links {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-light);
}

.about-links a {
  font-weight: 600;
}

@media (max-width: 768px) {
  .header-compact {
    padding: 1.5rem 1rem 2rem;
  }

  .header-compact .header-logo {
    max-width: 150px;
  }

  .header-compact h1 {
    font-size: 1.75rem;
  }

  .about-intro {
    font-size: 1rem;
    text-align: left;
    padding: 0 0.5rem;
  }

  .about-card h3 {
    font-size: 1.3rem;
  }
}

/* ============================================
   Calendar Page Styles
   ============================================ */

.calendar-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

/* Filter toggle button - hidden on desktop */
.filter-toggle {
  display: none;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.filter-toggle:hover {
  background: var(--color-primary-light);
}

.filter-container {
  display: contents;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--color-primary);
}

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

.month-section {
  margin-bottom: 2rem;
}

.month-section h3 {
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  padding-left: 0;
}

.month-section h3::before {
  display: none;
}

.event-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  transition: all 0.2s;
}

.event-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.event-item.hidden {
  display: none;
}

.event-date-box {
  min-width: 60px;
  text-align: center;
  padding: 0.5rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
}

.event-day {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}

.event-month {
  font-size: 0.8rem;
  color: var(--color-text-light);
  text-transform: uppercase;
}

.event-details {
  flex: 1;
}

.event-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.event-title a {
  color: var(--color-text);
  text-decoration: none;
}

.event-title a:hover {
  color: var(--color-primary);
}

.event-venue {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.event-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.event-tags {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.event-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: var(--color-bg-alt);
  border-radius: 4px;
  color: var(--color-text-light);
}

.event-tag.fitness { background: #e8f5e9; color: #2e7d32; }
.event-tag.food { background: #fff3e0; color: #e65100; }
.event-tag.gardening { background: #e8f5e9; color: #1b5e20; }
.event-tag.creative { background: #fce4ec; color: #c2185b; }
.event-tag.market { background: #e3f2fd; color: #1565c0; }
.event-tag.festival { background: #f3e5f5; color: #7b1fa2; }
.event-tag.talk { background: #fff8e1; color: #ff8f00; }

.venue-logo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
  margin-left: 16px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.venue-badge {
  flex-shrink: 0;
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.venue-badge.newt {
  background: #2d5016;
  color: #fff;
}

.event-item[data-venue="newt"] .event-details,
.event-item[data-venue="market"] .event-details,
.event-item[data-venue="homeacres"] .event-details,
.event-item[data-venue="bathwest"] .event-details,
.event-item[data-venue="avalon"] .event-details,
.event-item[data-venue="chapel"] .event-details,
.event-item[data-venue="museum"] .event-details,
.event-item[data-venue="shepton"] .event-details,
.event-item[data-venue="sheptonFri"] .event-details {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
}

.event-item[data-venue="newt"] .event-details > .venue-logo,
.event-item[data-venue="market"] .event-details > .venue-logo,
.event-item[data-venue="homeacres"] .event-details > .venue-logo,
.event-item[data-venue="bathwest"] .event-details > .venue-logo,
.event-item[data-venue="avalon"] .event-details > .venue-logo,
.event-item[data-venue="chapel"] .event-details > .venue-logo,
.event-item[data-venue="museum"] .event-details > .venue-logo,
.event-item[data-venue="shepton"] .event-details > .venue-logo,
.event-item[data-venue="sheptonFri"] .event-details > .venue-logo,
.event-item[data-venue="other"] .event-details > .venue-logo {
  align-self: center;
}

.event-item[data-venue="homeacres"] .event-details > .venue-logo {
  background: #1e3a0f;
  padding: 8px;
  border-radius: 6px;
}

.event-content-wrapper {
  flex: 1;
  min-width: 0;
}

.no-events {
  padding: 2rem;
  text-align: center;
  color: var(--color-text-light);
  background: var(--color-bg-alt);
  border-radius: var(--radius);
}

/* Past events styling */
.event-item.past {
  opacity: 0.5;
}

.event-item.past .event-date-box {
  background: #e0e0e0;
}

/* Ongoing workshops (no fixed date) */
.event-item.ongoing {
  border-left: 4px solid var(--color-accent, #8b6914);
}

.event-item.ongoing .event-date-box {
  display: none;
}

.past-events-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.5rem 0;
  user-select: none;
}

.past-events-toggle input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover {
  text-decoration: underline;
}

/* Calendar responsive styles */
@media (max-width: 768px) {
  .calendar-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .filter-toggle {
    display: block;
  }

  .filter-container {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius);
    margin-top: 0.5rem;
  }

  .filter-container.open {
    display: flex;
  }

  .filter-group {
    width: 100%;
    justify-content: flex-start;
  }

  .filter-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .month-section h3 {
    font-size: 1.2rem;
  }

  .event-item {
    padding: 0.875rem;
  }

  .event-title {
    font-size: 0.95rem;
  }

  .event-venue {
    font-size: 0.8rem;
  }

  .event-tag {
    font-size: 0.7rem;
  }
}

@media (max-width: 600px) {
  .event-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .event-date-box {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    min-width: auto;
    padding: 0.25rem 0;
    background: none;
  }

  .event-day {
    font-size: 1.2rem;
  }

  .filter-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 400px) {
  .filter-group {
    gap: 0.35rem;
  }

  .filter-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
  }
}

/* Calendar touch-friendly tap targets */
@media (pointer: coarse) {
  .filter-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .event-item {
    min-height: 60px;
  }

  .event-title a {
    display: block;
    padding: 0.25rem 0;
  }
}

/* Prevent horizontal scroll on calendar */
.calendar-page {
  overflow-x: hidden;
}

/* Print styles */
@media print {
  nav, .nav-toggle, .footer-links {
    display: none !important;
  }

  header {
    background: none !important;
    color: var(--color-text);
    padding: 1rem 0;
  }

  header::before {
    display: none;
  }

  header h1 {
    color: var(--color-primary);
    text-shadow: none;
  }

  .section {
    padding: 1rem 0;
    page-break-inside: avoid;
  }

  .section.alt-bg {
    background: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .card-grid {
    display: block;
  }

  .card-grid .card {
    margin-bottom: 0.75rem;
  }

  details {
    border: 1px solid #ccc;
  }

  details[open] {
    page-break-inside: avoid;
  }

  a {
    color: var(--color-text);
    text-decoration: underline;
  }

  .card a[href^="http"]::after,
  .meta a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    color: #666;
    word-break: break-all;
  }

  .badge {
    border: 1px solid currentColor;
  }

  footer {
    background: none;
    color: var(--color-text);
    border-top: 2px solid var(--color-primary);
  }
}
