/* =====================================================
   Birds of Castlederg — Shared Stylesheet
   Nature palette: forest green + warm cream + sky blue
   Mobile-first, accessible, no external dependencies
   ===================================================== */

/* ── Custom Properties ── */
:root {
  /* Palette */
  --forest:        #2D5A1B;
  --forest-dark:   #1A3A10;
  --forest-mid:    #4A7A2A;
  --forest-light:  #A8C890;
  --meadow:        #E8F2DC;
  --sky:           #4A90B8;
  --sky-light:     #D4EAF7;
  --amber:         #C87A1A;
  --amber-light:   #FFF3DC;
  --cream:         #F7F5EF;
  --warm-white:    #FEFCF8;
  --charcoal:      #1C1C1A;
  --mid-grey:      #6B6960;
  --light-grey:    #E5E3DB;
  --border:        #D0CCBF;

  /* Conservation status */
  --status-green:      #2A7A2A;
  --status-green-bg:   #EAF5EA;
  --status-amber:      #A85800;
  --status-amber-bg:   #FFF4E0;
  --status-red:        #CC2020;
  --status-red-bg:     #FFECEC;

  /* Type scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  2rem;
  --text-4xl:  2.75rem;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 64px;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow:    0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.14);

  /* Transitions */
  --transition: 0.18s ease;
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Helvetica, Arial, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--charcoal);
  background: var(--cream);
  min-height: 100vh;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

a:hover { text-decoration: underline; }

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--forest-dark);
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--warm-white);
  white-space: nowrap;
}

.nav-brand:hover { text-decoration: none; opacity: 0.9; }

.nav-brand .bird-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.78);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
  color: var(--warm-white);
  background: rgba(255,255,255,0.10);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--warm-white);
  background: rgba(255,255,255,0.12);
}

/* Mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--warm-white);
  font-size: var(--text-xl);
}

/* ── Page body offset ── */
.page-body {
  padding-top: var(--nav-height);
}

/* ── Hero ── */
.hero {
  background: var(--forest-dark);
  color: var(--warm-white);
  padding: var(--space-16) var(--space-6) var(--space-12);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.hero-eyebrow {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--forest-light);
  margin-bottom: var(--space-3);
}

.hero h1 {
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.hero p {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.72);
  max-width: 520px;
  margin: 0 auto;
}

/* ── Container ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ── Search & Filters ── */
.filter-bar {
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  padding: var(--space-5) var(--space-6);
  position: sticky;
  top: var(--nav-height);
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.filter-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.search-wrap {
  position: relative;
}

.search-wrap svg {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--mid-grey);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-3) var(--space-3) 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-base);
  background: var(--cream);
  color: var(--charcoal);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(45, 90, 27, 0.15);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.filter-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--mid-grey);
  white-space: nowrap;
  min-width: 60px;
}

.filter-pills {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.filter-pill {
  padding: var(--space-1) var(--space-3);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--mid-grey);
  font-family: inherit;
  transition: all var(--transition);
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--forest);
  color: var(--forest);
  background: var(--meadow);
}

.filter-pill.active {
  background: var(--forest);
  border-color: var(--forest);
  color: white;
}

/* ── Bird Grid ── */
.grid-section {
  padding: var(--space-8) var(--space-6);
  max-width: var(--max-width);
  margin: 0 auto;
}

.grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
}

.grid-count {
  font-size: var(--text-sm);
  color: var(--mid-grey);
  font-weight: 500;
}

.bird-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.bird-card {
  display: flex;
  flex-direction: column;
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.bird-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.card-image {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--meadow);
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.bird-card:hover .card-image img {
  transform: scale(1.04);
}

.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--forest-light);
  background: var(--meadow);
}

.card-body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.card-name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.2;
}

.card-latin {
  font-size: var(--text-xs);
  color: var(--mid-grey);
  font-style: italic;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: auto;
  padding-top: var(--space-2);
}

/* ── Status Badges ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge.green {
  background: var(--status-green-bg);
  color: var(--status-green);
}
.status-badge.green::before { background: var(--status-green); }

.status-badge.amber {
  background: var(--status-amber-bg);
  color: var(--status-amber);
}
.status-badge.amber::before { background: var(--status-amber); }

.status-badge.red {
  background: var(--status-red-bg);
  color: var(--status-red);
}
.status-badge.red::before { background: var(--status-red); }

/* ── Habitat Tags ── */
.habitat-tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--sky-light);
  color: var(--sky);
  border: 1px solid #c0ddef;
}

/* ── No Results ── */
.no-results {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--mid-grey);
  grid-column: 1 / -1;
}

.no-results .icon {
  font-size: 3rem;
  margin-bottom: var(--space-3);
}

.no-results h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
  color: var(--charcoal);
}

/* ── Species Detail Page ── */
.species-hero {
  position: relative;
  height: 380px;
  overflow: hidden;
  background: var(--forest-dark);
}

.species-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
}

.species-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,58,16,0.92) 0%, rgba(26,58,16,0.4) 50%, transparent 100%);
}

.species-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-6) var(--space-6) var(--space-8);
  max-width: var(--max-width);
  margin: 0 auto;
}

.species-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255,255,255,0.65);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}

.species-breadcrumb a {
  color: rgba(255,255,255,0.65);
}

.species-breadcrumb a:hover {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}

.species-name {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: 800;
  color: white;
  line-height: 1.1;
  margin-bottom: var(--space-1);
}

.species-latin {
  font-size: var(--text-base);
  color: rgba(255,255,255,0.65);
  font-style: italic;
  margin-bottom: var(--space-3);
}

.species-badges {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ── Quick Facts ── */
.quick-facts {
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-6);
}

.quick-facts-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 0;
}

.fact-item {
  flex: 1;
  padding: var(--space-4) var(--space-4) var(--space-4) 0;
  border-right: 1px solid var(--border);
  min-width: 0;
}

.fact-item:last-child {
  border-right: none;
  padding-right: 0;
}

.fact-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mid-grey);
  display: block;
  margin-bottom: 2px;
}

.fact-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--charcoal);
}

/* ── Species Content ── */
.species-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.species-description {
  font-size: var(--text-lg);
  color: var(--charcoal);
  line-height: 1.7;
}

/* Info Sections */
.info-section {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.info-section-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--cream);
}

.info-section-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.info-section-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--charcoal);
}

.info-section-body {
  padding: var(--space-5);
  color: var(--charcoal);
  line-height: 1.7;
}

.info-section-body p { margin: 0; }

/* Nesting grid */
.nesting-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.nesting-item { }

.nesting-item-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mid-grey);
  margin-bottom: var(--space-1);
}

.nesting-item-value {
  font-size: var(--text-sm);
  color: var(--charcoal);
  line-height: 1.5;
}

/* ── Month Bar ── */
.month-bar {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.month-cell {
  flex: 1;
  min-width: 28px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.month-cell.present {
  background: var(--forest);
  color: white;
}

.month-cell.absent {
  background: var(--light-grey);
  color: var(--mid-grey);
}

/* ── Fun Fact ── */
.fun-fact {
  background: var(--forest-dark);
  color: var(--warm-white);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5) var(--space-5) var(--space-8);
  position: relative;
  overflow: hidden;
  font-style: italic;
  line-height: 1.65;
  font-size: var(--text-base);
}

.fun-fact::before {
  content: '"';
  position: absolute;
  left: var(--space-3);
  top: var(--space-2);
  font-size: 3.5rem;
  line-height: 1;
  color: var(--forest-light);
  font-style: normal;
  font-weight: 900;
}

/* ── Conservation Note ── */
.conservation-note {
  background: var(--status-red-bg);
  border: 1.5px solid #e8b4b4;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.conservation-note.amber {
  background: var(--status-amber-bg);
  border-color: #e8d0a0;
}

.conservation-note-title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--status-red);
  margin-bottom: var(--space-2);
}

.conservation-note.amber .conservation-note-title {
  color: var(--status-amber);
}

.conservation-note-body {
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--charcoal);
}

/* ── Audio / xeno-canto ── */
.xeno-canto-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--sky);
  color: white;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: background var(--transition);
  text-decoration: none;
}

.xeno-canto-link:hover {
  background: #3a7aa0;
  text-decoration: none;
  color: white;
}

.xeno-canto-note {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--mid-grey);
}

/* ── Hotspots Page ── */
.hotspots-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.hotspot-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}

.hotspot-head {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}

.hotspot-number {
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--forest-mid);
  margin-bottom: var(--space-1);
}

.hotspot-name {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--charcoal);
  margin-bottom: var(--space-1);
}

.hotspot-distance {
  font-size: var(--text-sm);
  color: var(--mid-grey);
}

.hotspot-body {
  padding: var(--space-5);
}

.hotspot-description {
  font-size: var(--text-sm);
  color: var(--charcoal);
  line-height: 1.65;
  margin-bottom: var(--space-4);
}

.hotspot-birds-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mid-grey);
  margin-bottom: var(--space-2);
}

.hotspot-birds {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.bird-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--meadow);
  color: var(--forest);
  font-size: var(--text-xs);
  font-weight: 600;
  border: 1px solid #c0d8a0;
}

.hotspot-meta {
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hotspot-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--mid-grey);
}

/* ── Seasonal Guide ── */
.seasonal-intro {
  max-width: 660px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-4);
  text-align: center;
}

.seasonal-intro p {
  color: var(--mid-grey);
  font-size: var(--text-lg);
}

.month-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-4);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
}

.month-nav-btn {
  padding: var(--space-1) var(--space-3);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--mid-grey);
  transition: all var(--transition);
}

.month-nav-btn:hover,
.month-nav-btn.active {
  background: var(--forest);
  border-color: var(--forest);
  color: white;
}

.seasonal-months {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-12);
}

.month-section {
  border-top: 2px solid var(--border);
  padding: var(--space-8) 0;
  scroll-margin-top: calc(var(--nav-height) + 20px);
}

.month-section:first-child {
  border-top: none;
}

.month-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--forest-dark);
  margin-bottom: var(--space-2);
}

.month-tagline {
  font-size: var(--text-base);
  color: var(--mid-grey);
  margin-bottom: var(--space-6);
}

.month-species {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.month-species-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  align-items: start;
}

.month-species-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--meadow);
  flex-shrink: 0;
}

.month-species-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.month-species-name {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--charcoal);
  margin-bottom: var(--space-1);
}

.month-species-name a {
  color: inherit;
}

.month-species-name a:hover {
  color: var(--forest);
  text-decoration: none;
}

.month-species-note {
  font-size: var(--text-sm);
  color: var(--mid-grey);
  line-height: 1.5;
}

/* ── Footer ── */
.footer {
  background: var(--forest-dark);
  color: rgba(255,255,255,0.55);
  text-align: center;
  padding: var(--space-8) var(--space-6);
  font-size: var(--text-sm);
}

.footer a {
  color: rgba(255,255,255,0.7);
}

.footer a:hover {
  color: white;
}

.footer-title {
  color: rgba(255,255,255,0.85);
  font-weight: 700;
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
}

.footer-note {
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  opacity: 0.6;
}

/* ── Utility ── */
.text-center { text-align: center; }
.text-sm { font-size: var(--text-sm); }
.text-muted { color: var(--mid-grey); }

.section-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--charcoal);
  margin-bottom: var(--space-2);
}

.section-lead {
  font-size: var(--text-lg);
  color: var(--mid-grey);
  margin-bottom: var(--space-6);
}

/* ── Loading / Error states ── */
.loading-state,
.error-state {
  text-align: center;
  padding: var(--space-16);
  color: var(--mid-grey);
}

.loading-state .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--light-grey);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto var(--space-4);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (min-width: 640px) {
  .filter-inner {
    flex-direction: row;
    align-items: center;
  }

  .search-wrap {
    flex: 1;
    min-width: 240px;
  }

  .hotspot-card {
    grid-template-columns: 280px 1fr;
  }

  .hotspot-head {
    border-bottom: none;
    border-right: 1px solid var(--border);
  }

  .month-species {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .species-content {
    grid-template-columns: 1fr 1fr;
  }

  .species-description {
    grid-column: 1 / -1;
  }

  .nesting-section {
    grid-column: 1 / -1;
  }

  .month-species {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .species-hero {
    height: 460px;
  }

  .bird-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

/* Mobile nav toggle */
@media (max-width: 600px) {
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--forest-dark);
    flex-direction: column;
    padding: var(--space-4);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    gap: var(--space-1);
  }

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

  .nav-links a {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    display: block;
  }

  .filter-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .quick-facts-inner {
    flex-wrap: wrap;
  }

  .fact-item {
    flex: 1 1 30%;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .nesting-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Accessibility ── */
:focus-visible {
  outline: 3px solid var(--forest);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Sound Player ── */
.listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1.5px solid var(--sky);
  color: var(--sky);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: var(--space-2);
  white-space: nowrap;
}
.listen-btn:hover,
.listen-btn.active {
  background: var(--sky);
  color: white;
}
.sound-panel {
  border-top: 1px solid var(--border);
  padding: var(--space-3) var(--space-4);
  background: var(--sky-light);
}
.sound-info {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: var(--space-2);
}
.sound-type {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: capitalize;
  color: var(--charcoal);
  background: white;
  border-radius: 4px;
  padding: 1px 6px;
  border: 1px solid var(--border);
}
.sound-quality {
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}
.q-a { background: #d4edda; color: #1a5c2a; }
.q-b { background: #d1ecf1; color: #0c5460; }
.q-c { background: #fff3cd; color: #856404; }
.q-d, .q-e { background: var(--light-grey); color: var(--mid-grey); }
.sound-loc {
  font-size: var(--text-xs);
  color: var(--mid-grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.sound-panel audio {
  width: 100%;
  height: 32px;
  margin: var(--space-2) 0;
  accent-color: var(--forest);
  display: block;
}
.sound-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.sound-nav button {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: var(--charcoal);
  transition: all var(--transition);
  white-space: nowrap;
}
.sound-nav button:hover:not(:disabled) {
  border-color: var(--sky);
  color: var(--sky);
}
.sound-nav button:disabled { opacity: 0.35; cursor: default; }
.sound-counter {
  font-size: var(--text-xs);
  color: var(--mid-grey);
  flex: 1;
  text-align: center;
}
.sound-credit {
  font-size: var(--text-xs);
  color: var(--mid-grey);
  margin-top: var(--space-2);
  line-height: 1.5;
}
.sound-credit a { color: var(--sky); }
.sound-loading, .sound-error {
  font-size: var(--text-xs);
  color: var(--mid-grey);
  text-align: center;
  padding: var(--space-2) 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--forest);
  color: white;
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 700;
  z-index: 999;
  text-decoration: none;
  transition: top 0.1s;
}

.skip-link:focus {
  top: 0;
}
