/* ===================================================================
   Sri Lankan Wildlife Guide — Polished Nature / Wildlife Design
   Mobile-first: base @ 375px → 768px → 1024px+
   =================================================================== */

/* Fonts loaded via <link> in base.html */

:root {
  /* Nature palette */
  --forest-deep: #1B4332;
  --forest-mid: #2D6A4F;
  --forest-light: #52B788;
  --earth: #D4A373;
  --earth-dark: #C08A55;
  --cream: #FEFAE0;
  --cream-dark: #F0E9C5;
  --amber: #D4A017;

  /* UI colors */
  --text: #1A2B20;
  --text-muted: #5C7260;
  --white: #FFFFFF;
  --border: #C8DDD0;
  --shadow-sm: 0 2px 8px rgba(27, 67, 50, 0.10);
  --shadow-md: 0 4px 16px rgba(27, 67, 50, 0.15);
  --shadow-lg: 0 8px 32px rgba(27, 67, 50, 0.20);

  --radius: 8px;
  --radius-lg: 14px;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --transition: 0.2s ease;

  /* Spacing scale */
  --sp-1: 0.25rem;   /* 4px */
  --sp-2: 0.5rem;    /* 8px */
  --sp-3: 0.75rem;   /* 12px */
  --sp-4: 1rem;      /* 16px */
  --sp-6: 1.5rem;    /* 24px */
  --sp-8: 2rem;      /* 32px */
  --sp-10: 2.5rem;   /* 40px */
  --sp-12: 3rem;     /* 48px */
  --sp-16: 4rem;     /* 64px */
  --sp-20: 5rem;     /* 80px */
  --sp-24: 6rem;     /* 96px */

  /* 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: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.7;
}

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

a {
  color: var(--forest-mid);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--forest-deep); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
}

h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); }

/* ========================
   Layout
   ======================== */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
  width: 100%;
}

main {
  flex: 1;
  padding: 1.5rem 0 3rem;
}

/* ========================
   Sticky Nav / Header
   ======================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(27, 67, 50, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background var(--transition), box-shadow var(--transition);
}

.site-header.scrolled {
  background: rgba(27, 67, 50, 0.99);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-3);
  padding-bottom: var(--sp-3);
  gap: 1rem;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-title:hover { color: var(--earth); text-decoration: none; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.80);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.main-nav a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.10);
  text-decoration: none;
}

/* ========================
   Buttons
   ======================== */
.btn {
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  gap: 0.375rem;
  font-family: var(--font-body);
  border: 2px solid transparent;
  text-decoration: none;
  line-height: 1;
}

.btn-primary { background: var(--forest-mid); color: var(--white); border: 2px solid var(--forest-mid); }
.btn-primary:hover { background: var(--forest-deep); border-color: var(--forest-deep); transform: translateY(-1px); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--white); }

.btn-outline { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.75); }
.btn-outline:hover { background: rgba(255,255,255,0.15); border-color: var(--white); text-decoration: none; }

.btn-secondary {
  background: var(--cream);
  color: var(--forest-deep);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--cream-dark);
  border-color: var(--forest-light);
  color: var(--forest-deep);
  text-decoration: none;
}

.btn-danger {
  background: #C0392B;
  color: var(--white);
  border-color: #C0392B;
}
.btn-danger:hover {
  background: #A93226;
  border-color: #A93226;
  color: var(--white);
  text-decoration: none;
}

.btn-full {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-lg { padding: var(--sp-4) var(--sp-8); font-size: var(--text-base); }

/* ========================
   Hero Slider
   ======================== */
.hero-slider {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: var(--sp-6);
  margin-bottom: 2.5rem;
  outline: none;
  background: var(--forest-deep);
  min-height: 420px;
}

/* Per-slide gradient backgrounds keyed to data-bg */
.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  z-index: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
  padding: var(--sp-20) var(--sp-4);
  text-align: center;
}

.hero-slide.active {
  opacity: 1;
  z-index: 1;
  pointer-events: auto;
}

.hero-slide[data-bg="leopard"] {
  background: linear-gradient(155deg, #1B2A1B 0%, #2D6A4F 55%, #4A7C59 100%);
}
.hero-slide[data-bg="elephant"] {
  background: linear-gradient(155deg, #1A2E3C 0%, #2B5A7A 55%, #3A7A9A 100%);
}
.hero-slide[data-bg="ocean"] {
  background: linear-gradient(155deg, var(--forest-deep) 0%, var(--forest-mid) 58%, #3a8a62 100%);
}

/* Real-photo slides */
.hero-slide--image {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.hero-slide--image .hero-slide-overlay {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.28) 55%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 85%, rgba(82, 183, 136, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 85% 15%, rgba(212, 163, 115, 0.12) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  color: var(--white);
  max-width: 680px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--earth);
  margin-bottom: var(--sp-3);
  padding: 0.375rem 0.875rem;
  background: rgba(212, 163, 115, 0.15);
  border: 1px solid rgba(212, 163, 115, 0.30);
  border-radius: 2rem;
}

.hero-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  color: var(--white);
}

.hero-content p {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.7;
  color: var(--white);
}

.hero-cta {
  display: flex;
  gap: 0.875rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Slider navigation arrows */
.slider-prev,
.slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.35);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  line-height: 1;
}
.slider-prev { left: 0.75rem; }
.slider-next { right: 0.75rem; }
.slider-prev:hover,
.slider-next:hover { background: rgba(0, 0, 0, 0.60); }

/* Dot indicators */
.slider-dots {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 0.5rem;          /* 8px gap between dots */
  align-items: center;
  min-height: 2.75rem;  /* 44px touch-target row height */
  padding: 0 0.5rem;
}

.slider-dot {
  width: 0.625rem;      /* 10px minimum diameter */
  height: 0.625rem;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.50);  /* 50% opacity inactive */
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  padding: 0;
  flex-shrink: 0;
}
.slider-dot.active {
  background: #ffffff;  /* full white active */
  transform: scale(1.3);
}

/* ========================
   Section Header
   ======================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-10);
  flex-wrap: wrap;
  gap: 1rem;
}

.section-header h2 {
  font-size: var(--text-3xl);
  color: var(--forest-deep);
  font-weight: 700;
  margin-bottom: var(--sp-2);
}

.species-grid-section {
  padding: var(--sp-16) 0 var(--sp-20);
}

/* ========================
   Species Grid (mobile-first: 1 col)
   ======================== */
.species-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--sp-8);
  margin-top: var(--sp-2);
}

.species-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.species-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.species-thumb-wrap { aspect-ratio: 16/10; overflow: hidden; background: #e8f2ec; flex-shrink: 0; }

.species-thumb { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; display: block; }

.species-card:hover .species-thumb { transform: scale(1.04); }

.species-thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f5ee, #cde8d8);
  font-size: 2.75rem;
  width: 100%;
  height: 100%;
}

.species-card-body {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  flex: 1;
}

.species-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest-mid);
  display: block;
}

.species-card-body h3 {
  font-size: var(--text-lg);
  line-height: 1.35;
}

.species-card-body h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}
.species-card-body h3 a:hover { color: var(--forest-mid); }

.species-card-footer {
  margin-top: auto;
  padding-top: var(--sp-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
}

.species-meta { font-size: 0.78rem; color: var(--text-muted); }

.card-read-more {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--forest-mid);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.card-read-more:hover { color: var(--forest-deep); }

/* ========================
   Empty State
   ======================== */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { margin-bottom: 1.25rem; font-size: 1rem; }

/* ========================
   Auth Pages
   ======================== */
.auth-page {
  min-height: 68vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.75rem;
  border: 1px solid var(--border);
}

.auth-container h1 {
  font-size: 1.75rem;
  color: var(--forest-deep);
  margin-bottom: 0.375rem;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.auth-footer {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ========================
   Form Elements
   ======================== */
.form-group { margin-bottom: 1.125rem; }

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--forest-light);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.18);
}

.form-group textarea {
  min-height: 240px;
  resize: vertical;
  line-height: 1.65;
}

/* ========================
   Alerts
   ======================== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.alert-error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}
.alert-success {
  background: #F0FDF4;
  color: var(--forest-deep);
  border: 1px solid #BBF7D0;
}

/* ========================
   Dashboard
   ======================== */
.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dashboard-header h1 {
  font-size: 1.75rem;
  color: var(--forest-deep);
}

.dashboard-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.pages-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.pages-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  min-width: 500px;
}

.pages-table thead { background: var(--forest-deep); }

.pages-table th {
  color: var(--white);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-body);
}

.pages-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}

.pages-table tr:last-child td { border-bottom: none; }
.pages-table tbody tr:hover td { background: #F7FCF9; }

.pages-table .actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pages-table a { color: var(--forest-mid); font-weight: 500; }
.pages-table a:hover { color: var(--forest-deep); }

/* ========================
   Species Detail
   ======================== */
.species-hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  background: var(--forest-deep);
  min-height: 300px;
  max-height: 440px;
}

.species-hero-img {
  width: 100%;
  min-height: 300px;
  max-height: 440px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.species-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.10) 50%, rgba(0, 0, 0, 0) 75%);
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
}

.species-hero-text { color: var(--white); }

.species-hero-text h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.80);
}

.species-hero-text .scientific {
  font-style: italic;
  font-size: 0.95rem;
  opacity: 0.88;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.70);
}

.species-detail {
  max-width: 760px;
  margin: 0 auto;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--forest-mid); }
.breadcrumb a:hover { color: var(--forest-deep); }

.species-detail-header { margin-bottom: 1.5rem; }

.species-detail-header h1 {
  font-size: 1.9rem;
  color: var(--forest-deep);
  margin-bottom: 0.25rem;
}

.species-detail-header .scientific {
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
}

.species-detail-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.owner-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Back link (species detail) */
.back-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  transition: color var(--transition);
}
.back-link:hover { color: var(--forest-mid); }

/* ========================
   Markdown Body
   ======================== */
.species-body {
  line-height: 1.8;
  font-size: 1rem;
}

.species-body h1, .species-body h2,
.species-body h3, .species-body h4 {
  font-family: var(--font-heading);
  color: var(--forest-deep);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.species-body h1 { font-size: 1.7rem; }
.species-body h2 { font-size: 1.4rem; }
.species-body h3 { font-size: 1.15rem; }

.species-body p { margin-bottom: 1.1rem; }

.species-body ul, .species-body ol {
  padding-left: 1.75rem;
  margin-bottom: 1.1rem;
}
.species-body li { margin-bottom: 0.35rem; }

.species-body blockquote {
  border-left: 4px solid var(--earth);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  background: rgba(212, 163, 115, 0.08);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}

.species-body pre {
  background: #1A2B20;
  color: #D4EDDA;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.1rem;
  font-size: 0.85rem;
}

.species-body code {
  font-family: 'Fira Mono', 'Consolas', monospace;
  font-size: 0.87em;
}

.species-body :not(pre) > code {
  background: rgba(27, 67, 50, 0.08);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--forest-deep);
}

.species-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1rem 0;
}

.species-body table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1.1rem;
  overflow-x: auto;
  display: block;
}

.species-body th, .species-body td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.875rem;
  text-align: left;
}

.species-body th {
  background: rgba(27, 67, 50, 0.06);
  font-weight: 600;
}

.codehilite pre {
  background: #1A2B20;
  color: #D4EDDA;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.1rem;
}

.toc {
  background: rgba(27, 67, 50, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
}
.toc ul { padding-left: 1.25rem; }

/* ========================
   Page Editor
   ======================== */
.editor-container { max-width: 780px; margin: 0 auto; }

.editor-container h1 {
  font-size: 1.75rem;
  color: var(--forest-deep);
  margin-bottom: 1.75rem;
}

.upload-widget {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.upload-status { font-size: 0.82rem; color: var(--forest-mid); }

.current-thumb { margin-top: 0.5rem; }

.thumb-preview {
  max-height: 120px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.label-hint {
  font-size: 0.77rem;
  color: var(--text-muted);
  font-weight: 400;
}

.markdown-hint {
  background: rgba(27, 67, 50, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  line-height: 1.5;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

/* ========================
   Footer
   ======================== */
.site-footer {
  background: var(--forest-deep);
  color: var(--cream);
  padding: var(--sp-12) 0 var(--sp-8);
  margin-top: var(--sp-20);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-8);
  flex-wrap: wrap;
  padding-bottom: var(--sp-8);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: var(--sp-6);
}

.footer-brand { font-family: var(--font-heading); font-size: var(--text-xl); margin-bottom: var(--sp-2); }

.footer-copy { font-size: var(--text-sm); color: rgba(255,255,255,0.55); }

.footer-links { display: flex; gap: var(--sp-6); align-items: center; }

.footer-links a { color: rgba(255,255,255,0.75); font-size: var(--text-sm); transition: color var(--transition); }
.footer-links a:hover { color: var(--white); }

/* ========================
   Mobile carousel — prevent slide overlap at ≤480px
   ======================== */
@media (max-width: 480px) {
  .hero-slider {
    min-height: 460px;
  }

  /* Ensure only the active slide is ever visible — belt-and-suspenders */
  .hero-slide {
    opacity: 0;
    z-index: 0;
  }

  .hero-slide.active {
    opacity: 1;
    z-index: 1;
  }
}

/* ========================
   Hamburger / Mobile Nav
   ======================== */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 2rem;
  height: 1.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  gap: 0;
  flex-shrink: 0;
}

.burger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.90);
  border-radius: 2px;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.nav-toggle[aria-expanded="true"] .burger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .burger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle[aria-expanded="true"] .burger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

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

  .site-header .container { position: relative; }

  .main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(27, 67, 50, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.75rem 1rem 1rem;
    gap: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 99;
  }

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

  .main-nav a {
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    width: 100%;
    text-align: left;
  }

  .main-nav .btn {
    text-align: center;
    margin-top: 0.25rem;
  }
}

/* ========================
   Responsive — Tablet 768px
   ======================== */
@media (min-width: 768px) {
  .container { padding: 0 var(--sp-8); }

  .site-title { font-size: 1.3rem; }

  main { padding: 2rem 0 4rem; }

  .hero-slider { min-height: 500px; }
  .hero-slide { padding: 5rem 2.5rem; }
  h1 { font-size: var(--text-5xl); }
  .hero-content h1 { font-size: 2.75rem; }
  .hero-content p { font-size: 1.1rem; }

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

  .species-hero-text h1 { font-size: 2.1rem; }
  .species-detail-header h1 { font-size: 2.2rem; }

  .auth-container { padding: 2.5rem 2.25rem; }
}

/* ========================
   Responsive — Desktop 1024px
   ======================== */
@media (min-width: 1024px) {
  .container { padding: 0 2rem; }

  .hero-slider { min-height: 580px; }
  .hero-slide { padding: 6rem 3rem; }
  .hero-content h1 { font-size: 3.25rem; }

  .species-grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-8); }

  .species-hero-text h1 { font-size: 2.5rem; }
}

@media (min-width: 1280px) {
  .species-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ========================
   Print
   ======================== */
@media print {
  .site-header, .site-footer, .owner-actions, .breadcrumb { display: none; }
  body { background: white; color: black; }
  .species-body a::after { content: ' (' attr(href) ')'; font-size: 0.75em; }
}
