/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --green-900: #0f2419;
  --green-800: #163a26;
  --green-700: #1a4a30;
  --green-600: #22663f;
  --green-500: #2d8a54;
  --green-400: #3fb06e;
  --green-100: #d4f5e2;
  --neutral-50: #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #e5e5e5;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.1), 0 2px 4px rgba(0,0,0,.06);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--neutral-800);
  background: var(--neutral-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ===== NAV ===== */
.main-nav {
  background: var(--green-900);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 56px;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links > li > a {
  color: rgba(255,255,255,.85);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background .2s, color .2s;
}

.nav-links > li > a:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.has-dropdown { position: relative; }

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 180px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 10px 6px 6px;
  z-index: 200;
}

.has-dropdown:hover .dropdown { display: block; }

.dropdown a {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--neutral-700);
  border-radius: 4px;
  transition: background .15s;
}

.dropdown a:hover {
  background: var(--green-100);
  color: var(--green-800);
}

.nav-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.1);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
  transition: border-color .2s;
}

.nav-search:focus-within {
  border-color: var(--green-400);
  background: rgba(255,255,255,.15);
}

.nav-search input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  padding: 7px 12px;
  width: 200px;
}

.nav-search input::placeholder { color: rgba(255,255,255,.45); }

.nav-search button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.6);
  padding: 7px 10px;
  cursor: pointer;
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-toggle span {
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  padding: 48px 32px 40px;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.3) 50%, rgba(0,0,0,.15) 100%);
}

.hero-content {
  position: relative;
  max-width: 800px;
  z-index: 1;
}

.category-tag {
  display: inline-block;
  background: var(--green-600);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.hero h1 {
  font-family: 'Merriweather', serif;
  font-weight: 900;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.2;
  color: #fff;
  margin-bottom: 20px;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.75);
  font-size: 14px;
  flex-wrap: wrap;
}

.hero-meta a {
  color: var(--green-400);
  font-weight: 500;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3);
}

.meta-dot::before {
  content: '·';
  font-weight: 700;
}

.hero-credit {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 11px;
  color: rgba(255,255,255,.4);
  z-index: 1;
}

/* ===== ARTICLE NAV (Pills) ===== */
.article-nav {
  background: var(--green-800);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-nav-label {
  color: rgba(255,255,255,.6);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-nav-label::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-radius: 3px;
}

.article-nav-pills {
  display: flex;
  gap: 8px;
}

.pill {
  white-space: nowrap;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.2);
  transition: all .2s;
}

.pill:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.pill.active {
  background: var(--green-500);
  color: #fff;
  border-color: var(--green-500);
}

/* ===== CONTENT LAYOUT ===== */
.content-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  padding: 48px 32px;
}

/* ===== ARTICLE BODY ===== */
.article-body { min-width: 0; }

.article-section { margin-bottom: 40px; }

.article-section h2 {
  font-family: 'Merriweather', serif;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--neutral-900);
}

.article-section p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--neutral-700);
  margin-bottom: 16px;
}

.article-section ul,
.article-section ol {
  margin: 16px 0;
  padding-left: 24px;
}

.article-section li {
  list-style: disc;
  font-size: 17px;
  line-height: 1.75;
  color: var(--neutral-700);
  margin-bottom: 8px;
}

.quick-take-list {
  background: var(--green-100);
  border-left: 4px solid var(--green-500);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px 20px 28px;
}

.quick-take-list li {
  list-style: none;
  position: relative;
  padding-left: 20px;
  margin-bottom: 12px;
}

.quick-take-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--green-600);
  font-weight: 700;
}

.quick-take-list li:last-child { margin-bottom: 0; }

.article-figure {
  margin: 28px 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.article-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-figure figcaption {
  background: var(--neutral-100);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--neutral-500);
}

/* ===== SIDEBAR ===== */
.sidebar { display: flex; flex-direction: column; gap: 32px; }

.sidebar-section {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.sidebar-heading {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--neutral-900);
}

.sidebar-heading::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--green-500);
  border-radius: 2px;
}

.related-list { counter-reset: related; }

.related-list li { margin-bottom: 16px; }
.related-list li:last-child { margin-bottom: 0; }

.related-list a {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: color .15s;
}

.related-list a:hover .related-title { color: var(--green-600); }

.related-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--neutral-200);
  line-height: 1;
  flex-shrink: 0;
  width: 30px;
}

.related-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--neutral-800);
  display: block;
  transition: color .15s;
}

.related-cat {
  font-size: 12px;
  color: var(--green-600);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-top: 4px;
  display: block;
}

/* Newsletter */
.newsletter-box {
  background: var(--green-900);
  color: #fff;
}

.newsletter-box .sidebar-heading { color: #fff; }

.newsletter-box p {
  font-size: 14px;
  color: rgba(255,255,255,.7);
  margin-bottom: 14px;
}

.newsletter-form {
  display: flex;
  gap: 8px;
}

.newsletter-form input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 14px;
  outline: none;
}

.newsletter-form input::placeholder { color: rgba(255,255,255,.4); }

.newsletter-form input:focus { border-color: var(--green-400); }

.newsletter-form button {
  padding: 9px 18px;
  background: var(--green-500);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.newsletter-form button:hover { background: var(--green-400); }

/* ===== MORE ARTICLES GRID ===== */
.more-articles {
  background: var(--neutral-100);
  padding: 56px 32px;
}

.more-articles-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.section-title {
  font-family: 'Merriweather', serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}

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

.card-img {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
}

.card-body { padding: 16px; }

.card-cat {
  font-size: 12px;
  font-weight: 600;
  color: var(--green-600);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.card-body h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin: 8px 0;
  color: var(--neutral-900);
}

.card-meta {
  font-size: 13px;
  color: var(--neutral-400);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--green-900);
  color: rgba(255,255,255,.7);
  padding: 56px 32px 0;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer-logo .logo-img { height: 36px; }

.footer-tagline {
  margin-top: 12px;
  font-size: 14px;
  max-width: 280px;
  line-height: 1.6;
}

.footer-col h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 16px;
}

.footer-col ul li { margin-bottom: 10px; }

.footer-col ul a {
  font-size: 14px;
  transition: color .15s;
}

.footer-col ul a:hover { color: var(--green-400); }

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,.35);
}

/* ===== CATEGORY / SUB PAGES ===== */
.page-hero {
  position: relative;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  padding: 48px 32px 40px;
}

.page-hero-content {
  position: relative;
  max-width: 700px;
  z-index: 1;
}

.page-hero-content h1 {
  font-family: 'Merriweather', serif;
  font-weight: 900;
  font-size: clamp(32px, 5vw, 52px);
  color: #fff;
  margin-bottom: 12px;
}

.page-hero-desc {
  color: rgba(255,255,255,.8);
  font-size: 18px;
  line-height: 1.6;
}

.category-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 32px 64px;
}

.category-intro {
  max-width: 800px;
  margin-bottom: 48px;
}

.category-intro h2 {
  font-family: 'Merriweather', serif;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--neutral-900);
}

.category-intro p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--neutral-700);
  margin-bottom: 16px;
}

.featured-animals {
  margin-bottom: 56px;
}

.featured-animals h2 {
  font-family: 'Merriweather', serif;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--neutral-900);
}

.card-excerpt {
  font-size: 14px;
  line-height: 1.5;
  color: var(--neutral-500);
  margin-bottom: 8px;
  display: block;
}

/* A-Z Directory */
.animal-list-section {
  margin-bottom: 56px;
}

.animal-list-section h2 {
  font-family: 'Merriweather', serif;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--neutral-900);
}

.animal-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}

.animal-list-item { }

.animal-letter {
  display: inline-block;
  font-size: 28px;
  font-weight: 800;
  color: var(--green-600);
  margin-bottom: 8px;
}

.animal-list-item ul li {
  margin-bottom: 6px;
}

.animal-list-item ul li a {
  font-size: 15px;
  color: var(--neutral-700);
  transition: color .15s;
}

.animal-list-item ul li a:hover {
  color: var(--green-600);
}

/* About page extras */
.about-stats {
  margin-bottom: 56px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--green-500);
}

.stat-number {
  display: block;
  font-size: 32px;
  font-weight: 800;
  color: var(--green-700);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: var(--neutral-500);
  font-weight: 500;
}

.about-list {
  padding-left: 0;
  margin-top: 16px;
}

.about-list li {
  list-style: none;
  font-size: 17px;
  line-height: 1.75;
  color: var(--neutral-700);
  margin-bottom: 12px;
  padding-left: 24px;
  position: relative;
}

.about-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--green-600);
  font-weight: 700;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-links, .nav-search { display: none; }
  .mobile-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--green-900);
    padding: 16px 24px;
    gap: 4px;
    border-top: 1px solid rgba(255,255,255,.1);
  }

  .nav-links.open .dropdown {
    position: static;
    display: none;
    background: rgba(255,255,255,.05);
    box-shadow: none;
    margin-top: 4px;
  }

  .nav-links.open .has-dropdown.open .dropdown { display: block; }

  .content-wrapper {
    grid-template-columns: 1fr;
    padding: 32px 20px;
    gap: 32px;
  }

  .hero { min-height: 400px; padding: 32px 20px 28px; }
  .article-nav { padding: 12px 20px; }
  .more-articles { padding: 40px 20px; }
  .articles-grid { grid-template-columns: 1fr; }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .page-hero { min-height: 280px; padding: 32px 20px 28px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
