/* ============================================================
   US Wildlife Dispatch — Static Site Stylesheet
   Mobile-first, responsive, informational/research design
   ============================================================ */

:root {
  --color-primary: #1a472a;
  --color-primary-light: #2d6a3f;
  --color-accent: #d97706;
  --color-link: #2563eb;
  --color-link-hover: #1d4ed8;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-border: #e2e8f0;
  --max-width-article: 800px;
  --max-width-wide: 1080px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --radius: 10px;
}

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

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

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a { color: var(--color-link); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-link-hover); }

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 100; width: 100%;
}

.nav-inner {
  max-width: var(--max-width-wide); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.1rem; color: var(--color-primary);
  text-decoration: none; white-space: nowrap; letter-spacing: -0.3px;
}
.nav-brand:hover { text-decoration: none; color: var(--color-primary-light); }

.nav-toggle { display: none; }

.nav-toggle-label {
  display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px;
}
.nav-toggle-label span {
  display: block; width: 24px; height: 2.5px; background: var(--color-text);
  border-radius: 2px; transition: all 0.3s;
}
.nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) { opacity: 0; }
.nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.nav-links {
  display: flex; align-items: center; gap: 24px; list-style: none;
}
.nav-links a {
  color: var(--color-text); font-size: 0.9rem; font-weight: 500;
  padding: 6px 0; border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--color-primary); border-bottom-color: var(--color-primary); text-decoration: none;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: linear-gradient(160deg, #0f2e1b 0%, #1a472a 40%, #2d6a3f 100%);
  color: #fff; padding: 64px 24px; text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -40%; right: -20%;
  width: 350px; height: 350px; background: rgba(255,255,255,0.03);
  border-radius: 50%;
}
.hero-inner { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }
.hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: 14px; line-height: 1.25; letter-spacing: -0.5px; }
.hero p { font-size: 1.08rem; opacity: 0.85; max-width: 540px; margin: 0 auto; line-height: 1.6; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  background: linear-gradient(160deg, #f0fdf4 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--color-border);
  padding: 44px 24px; text-align: center;
}
.page-header h1 { font-size: 1.8rem; font-weight: 800; color: var(--color-primary); margin-bottom: 10px; }
.page-header p { font-size: 1.02rem; color: var(--color-text-light); max-width: 600px; margin: 0 auto; line-height: 1.6; }

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs {
  max-width: var(--max-width-article); margin: 0 auto; padding: 16px 24px 0;
  font-size: 0.84rem; color: var(--color-text-light);
}
.breadcrumbs a { color: var(--color-text-light); }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs span { margin: 0 6px; }

/* ============================================================
   HOME SECTIONS
   ============================================================ */
.home-content { max-width: var(--max-width-wide); margin: 0 auto; padding: 40px 24px; }

.section-header {
  display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px;
}
.section-title {
  font-size: 1.45rem; font-weight: 800; color: var(--color-primary);
  padding-bottom: 10px; border-bottom: 3px solid var(--color-primary);
}
.section-link {
  font-size: 0.88rem; font-weight: 500; color: var(--color-primary); white-space: nowrap;
}
.section-link:hover { text-decoration: underline; }

/* ============================================================
   PILLAR CARDS (Homepage)
   ============================================================ */
.pillar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 0;
}

.pillar-card {
  display: block;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-decoration: none;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
  color: inherit;
}
.pillar-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-primary);
  text-decoration: none;
  color: inherit;
}

.pillar-icon { display: block; font-size: 2rem; margin-bottom: 12px; }
.pillar-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--color-primary); margin-bottom: 8px; }
.pillar-card p { font-size: 0.88rem; color: var(--color-text-light); line-height: 1.55; margin: 0; }

/* ============================================================
   HOME INFO SECTIONS
   ============================================================ */
.home-info {
  max-width: var(--max-width-article);
  margin: 0 auto;
}
.home-info h2 {
  font-size: 1.35rem; font-weight: 700;
  color: var(--color-primary); margin-bottom: 14px;
}
.home-info > p {
  font-size: 1rem; color: var(--color-text-light);
  line-height: 1.7; margin-bottom: 14px;
}

/* ============================================================
   AUTHORITY BAR
   ============================================================ */
.authority-bar {
  margin-top: 48px; padding: 26px;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: var(--radius); text-align: center;
}
.authority-bar h3 {
  font-size: 0.82rem; font-weight: 600; color: #166534;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px;
}
.authority-sources {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.authority-sources span {
  display: inline-block; background: #fff; color: #166534;
  padding: 5px 14px; border-radius: 20px; font-size: 0.8rem;
  font-weight: 600; border: 1px solid #bbf7d0;
}

/* ============================================================
   ARTICLE CARDS — entire card is clickable
   ============================================================ */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.article-card {
  display: block;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
}
.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--color-primary);
  text-decoration: none;
  color: inherit;
}
.article-card-image {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--color-bg-alt);
}
.article-card-body { padding: 18px 20px 20px; }
.article-card-category {
  display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--color-primary); margin-bottom: 8px;
  background: #f0fdf4; padding: 3px 10px; border-radius: 4px;
}
.article-card-title {
  font-size: 1.1rem; font-weight: 700; line-height: 1.4; margin-bottom: 8px;
  color: var(--color-text);
}
.article-card-excerpt {
  font-size: 0.88rem; color: var(--color-text-light); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 10px;
}
.article-card-meta { font-size: 0.78rem; color: var(--color-text-light); display: flex; gap: 10px; }

/* ============================================================
   CATEGORY PAGE
   ============================================================ */
.category-content {
  max-width: var(--max-width-wide);
  margin: 0 auto; padding: 36px 24px;
}

/* ============================================================
   ARTICLE PAGE
   ============================================================ */
.article-container { max-width: var(--max-width-article); margin: 0 auto; padding: 28px 24px; }
.article-header { margin-bottom: 26px; }
.article-category-label {
  display: inline-block; font-size: 0.76rem; font-weight: 700;
  color: var(--color-primary); text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 10px; background: #f0fdf4; padding: 3px 12px; border-radius: 4px;
}
.article-header h1 { font-size: 1.8rem; font-weight: 800; line-height: 1.3; margin-bottom: 12px; letter-spacing: -0.3px; }
.article-meta { font-size: 0.88rem; color: var(--color-text-light); display: flex; flex-wrap: wrap; gap: 8px 16px; }
.article-featured-image {
  width: 100%; aspect-ratio: 1200/630; object-fit: cover;
  border-radius: var(--radius); margin-bottom: 26px; background: var(--color-bg-alt);
}

.article-body { font-size: 1.05rem; line-height: 1.78; color: var(--color-text); }
.article-body h2 { font-size: 1.5rem; font-weight: 700; color: var(--color-primary); margin: 34px 0 12px; }
.article-body h3 { font-size: 1.18rem; font-weight: 600; margin: 26px 0 10px; }
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol { margin: 0 0 16px 26px; }
.article-body li { margin-bottom: 6px; }
.article-body table { width: 100%; border-collapse: collapse; margin-bottom: 22px; font-size: 0.9rem; overflow-x: auto; display: block; }
.article-body th { background: var(--color-bg-alt); padding: 10px 14px; text-align: left; font-weight: 600; border-bottom: 2px solid var(--color-border); }
.article-body td { padding: 10px 14px; border-bottom: 1px solid var(--color-border); }
.article-body blockquote {
  border-left: 4px solid var(--color-primary); padding: 12px 18px; margin: 22px 0;
  background: #f0fdf4; border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--color-text-light);
}

/* ============================================================
   AUTHOR BOX
   ============================================================ */
.author-box {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius);
  padding: 22px; margin: 34px 0;
}

/* ============================================================
   RELATED ARTICLES
   ============================================================ */
.related-articles { max-width: var(--max-width-article); margin: 44px auto; padding: 0 24px; }
.related-articles h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 16px; color: var(--color-primary); }

/* ============================================================
   CITY PAGE CONTENT
   ============================================================ */
.city-content { max-width: var(--max-width-article); margin: 0 auto; padding: 28px 24px; }
.city-content h2 { font-size: 1.45rem; font-weight: 700; color: var(--color-primary); margin: 30px 0 12px; }
.city-content h3 { font-size: 1.12rem; font-weight: 600; margin: 22px 0 10px; }
.city-content ul { margin: 0 0 16px 26px; }
.city-content li { margin-bottom: 6px; }
.city-content p { margin-bottom: 16px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #0f2e1b; color: rgba(255,255,255,0.85);
  margin-top: 60px; padding: 52px 24px 24px;
}
.footer-inner {
  max-width: var(--max-width-wide); margin: 0 auto;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 36px;
}
.footer-col h3 { color: #fff; font-size: 1rem; margin-bottom: 14px; font-weight: 700; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 7px; }
.footer-col a { color: rgba(255,255,255,0.7); font-size: 0.88rem; transition: color 0.2s; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  max-width: var(--max-width-wide); margin: 32px auto 0; padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.15); text-align: center;
  font-size: 0.8rem; color: rgba(255,255,255,0.5); line-height: 1.6;
}

/* ============================================================
   404 PAGE
   ============================================================ */
.error-page { text-align: center; padding: 72px 24px; max-width: 500px; margin: 0 auto; }
.error-page h1 { font-size: 4rem; font-weight: 800; color: var(--color-primary); margin-bottom: 10px; }
.error-page p { color: var(--color-text-light); margin-bottom: 26px; font-size: 1.02rem; }
.error-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error-links a {
  display: block; padding: 15px; background: var(--color-bg-alt);
  border: 1px solid var(--color-border); border-radius: var(--radius);
  font-weight: 600; color: var(--color-text); transition: all 0.2s; text-align: center;
}
.error-links a:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); text-decoration: none; }

/* ============================================================
   RESPONSIVE — Tablet
   ============================================================ */
@media (min-width: 768px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 2.4rem; }
  .article-header h1 { font-size: 2rem; }
  .page-header h1 { font-size: 1.9rem; }
}

@media (min-width: 1024px) {
  .article-grid { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 2.8rem; }
}

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */
@media (max-width: 767px) {
  .nav-toggle-label { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--color-bg); border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md); flex-direction: column; padding: 8px 0; gap: 0;
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-links a { display: block; padding: 13px 24px; border-bottom: none; font-size: 1rem; }
  .nav-links a:hover { background: var(--color-bg-alt); }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .pillar-grid { grid-template-columns: 1fr; }
  .article-body table { font-size: 0.82rem; }
  .article-body th, .article-body td { padding: 8px 10px; }
  .hero { padding: 44px 20px 36px; }
  .hero h1 { font-size: 1.6rem; }
}

@media print {
  .site-nav, .site-footer, .related-articles { display: none; }
  body { font-size: 12pt; line-height: 1.5; }
  .article-body { max-width: 100%; }
}

/* Category page grid — always multi-column */
.category-content .article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (min-width: 1024px) {
  .category-content .article-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .category-content .article-grid {
    grid-template-columns: 1fr;
  }
}
