/* === SELF-HOSTED FONTS === */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/assets/fonts/lato-300.woff2') format('woff2');
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/lato-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/lato-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/lora-var.woff2') format('woff2');
}

/* === CUSTOM PROPERTIES === */
:root {
  --color-primary:   #2C1810;
  --color-accent:    #5B7B3A;
  --color-accent-dk: #3d5526;
  --color-bg:        #F7F3EC;
  --color-text:      #2A2A2A;
  --color-muted:     #6B6B6B;
  --color-highlight: #C8891A;
  --color-card-bg:   #FFFFFF;
  --color-border:    #E0D9CF;
  --color-overlay:   rgba(44, 24, 16, 0.58);

  --font-heading: 'Lora', Georgia, 'Times New Roman', serif;
  --font-body:    'Lato', Arial, Helvetica, sans-serif;

  --max-w-site:    1200px;
  --max-w-article: 740px;
  --gap:           1.5rem;
  --radius:        6px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.75;
  position: relative;
  overflow-x: clip;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('/assets/images/bg-roots.webp');
  background-size: 600px 600px;
  background-repeat: repeat;
  opacity: .10;
  filter: none;
  pointer-events: none;
  z-index: 0;
}

/* Ensure all page content sits above the background */
.site-header, main, .site-footer {
  position: relative;
  z-index: 1;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--color-accent-dk); }

ul, ol { padding-left: 1.5rem; }
li { margin-bottom: .35rem; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.25;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); margin-top: 2.5rem; margin-bottom: .85rem; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.35rem); margin-top: 1.75rem; margin-bottom: .6rem; }
h4 { font-size: 1.05rem; margin-top: 1.25rem; margin-bottom: .5rem; }

p { margin-bottom: 1.1rem; }

strong { font-weight: 700; }
em     { font-style: italic; }

/* === SITE HEADER / NAVBAR === */
.site-header {
  background: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.nav-inner {
  max-width: var(--max-w-site);
  margin: 0 auto;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo svg { width: 36px; height: 36px; }
.site-logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: #FFFFFF;
  letter-spacing: .01em;
}
.site-logo-text span { color: var(--color-highlight); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .5rem;
  list-style: none;
  padding: 0;
}
.site-nav a {
  color: rgba(255,255,255,.82);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 400;
  padding: .3rem .55rem;
  border-radius: var(--radius);
  transition: background .15s, color .15s;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(255,255,255,.12);
  color: #fff;
}

/* === HERO === */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-w-site);
  margin: 0 auto;
  padding: 3rem 1.5rem 2.5rem;
  width: 100%;
}
.hero-content h1 {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
  max-width: 680px;
}
.hero-content .hero-sub {
  color: rgba(255,255,255,.88);
  font-size: 1.1rem;
  margin-top: .6rem;
  max-width: 580px;
  text-shadow: 0 1px 6px rgba(0,0,0,.35);
}
.hero-meta {
  margin-top: 1rem;
  font-size: .82rem;
  color: rgba(255,255,255,.65);
}

/* === PAGE WRAPPER === */
.page-wrap {
  max-width: var(--max-w-site);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* === ARTICLE LAYOUT === */
.article-body {
  max-width: var(--max-w-article);
  margin: 0 auto;
}
.article-body h2 { border-bottom: 2px solid var(--color-border); padding-bottom: .4rem; }

/* section images inside article */
.section-img-wrap {
  margin: 1.75rem 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.section-img-wrap img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}
.section-img-wrap figcaption {
  font-size: .82rem;
  color: var(--color-muted);
  padding: .4rem .5rem 0;
}

/* === HOMEPAGE CARD GRID === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
  margin-top: 2rem;
}
.card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: clip;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, transform .15s;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.card:hover {
  box-shadow: 0 4px 18px rgba(44,24,16,.12);
  transform: translateY(-2px);
}
.card:hover .card-link { color: var(--color-accent-dk); }
.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.card-img-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.4);
  font-size: 2.5rem;
}
.card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-body h3 {
  font-size: 1.05rem;
  margin: 0 0 .5rem;
}
.card-body p {
  font-size: .9rem;
  color: var(--color-muted);
  flex: 1;
  margin: 0 0 1rem;
}
.card-link {
  font-size: .88rem;
  font-weight: 700;
  color: var(--color-accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.card-link:hover { color: var(--color-accent-dk); }
.card-link::after { content: "→"; }

/* === INTRO BAND (homepage) === */
.intro-band {
  background: var(--color-card-bg);
  border-left: 4px solid var(--color-accent);
  padding: 1.5rem 1.75rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 2.5rem auto;
  max-width: var(--max-w-article);
}
.intro-band p { margin: 0; font-size: 1.05rem; }

/* === FAQ ACCORDION === */
.faq-section { margin-top: 2.5rem; }
.faq-item {
  border-bottom: 1px solid var(--color-border);
}
.faq-item:first-of-type { border-top: 1px solid var(--color-border); }

.faq-item summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: .95rem;
  color: var(--color-primary);
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 300;
  flex-shrink: 0;
  color: var(--color-accent);
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item[open] summary { color: var(--color-accent); }
.faq-answer {
  padding: 0 0 1.1rem;
  color: var(--color-text);
  font-size: .95rem;
}
.faq-answer p:last-child { margin-bottom: 0; }

/* === SVG INFOGRAPHIC CONTAINER === */
.infographic-wrap {
  margin: 2rem 0;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.infographic-wrap figcaption {
  font-size: .85rem;
  color: var(--color-muted);
  margin-top: .75rem;
}
.infographic-wrap svg { max-width: 100%; height: auto; }

/* === TABLE === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  margin: 1.25rem 0;
}
.data-table th {
  background: var(--color-primary);
  color: #fff;
  padding: .6rem .85rem;
  text-align: left;
  font-weight: 700;
  font-family: var(--font-heading);
}
.data-table td {
  padding: .55rem .85rem;
  border-bottom: 1px solid var(--color-border);
}
.data-table tr:nth-child(even) td { background: rgba(247,243,236,.6); }
.data-table tr:last-child td { border-bottom: none; }

/* === BADGE === */
.badge {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* === JUMP NAV (on-page section links) === */
.jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0 0 2.5rem;
  padding: 1rem 1.25rem;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.jump-nav-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  width: 100%;
  margin-bottom: .25rem;
}
.jump-nav a {
  display: inline-block;
  font-size: .84rem;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  text-decoration: none;
  padding: .3rem .75rem;
  border-radius: 99px;
  transition: background .15s, color .15s, border-color .15s;
}
.jump-nav a:hover {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* section-level color bands (alternating) */
.section-band {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}

/* === BREADCRUMB === */
.breadcrumb {
  font-size: .82rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  align-items: center;
}
.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb span { color: var(--color-border); }

/* === RELATED LINKS === */
.related-links {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--color-border);
}
.related-links h2 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 1rem;
  border: none;
}
.related-links ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.related-links a {
  display: inline-block;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  padding: .45rem .9rem;
  border-radius: var(--radius);
  font-size: .88rem;
  text-decoration: none;
  color: var(--color-primary);
  font-weight: 700;
}
.related-links a:hover {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* === FOOTER === */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,.72);
  padding: 2.5rem 1.5rem;
  font-size: .88rem;
}
.footer-inner {
  max-width: var(--max-w-site);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-brand { max-width: 420px; flex: 1; }
.footer-brand strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: .4rem;
}
.footer-nav,
.footer-nav-legal {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.footer-nav-legal {
  border-left: 1px solid rgba(255,255,255,.15);
  padding-left: 2rem;
  flex-shrink: 0;
}
.footer-nav a,
.footer-nav-legal a {
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: .85rem;
}
.footer-nav a:hover,
.footer-nav-legal a:hover { color: #fff; }
.footer-nav-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.35);
  display: block;
  margin-bottom: .1rem;
}
.footer-copy {
  width: 100%;
  border-top: 1px solid rgba(255,255,255,.12);
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  text-align: center;
  font-size: .8rem;
  color: rgba(255,255,255,.45);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .nav-inner { flex-direction: column; align-items: flex-start; }
  .site-nav  { gap: .1rem .35rem; }
  .site-nav a { font-size: .82rem; padding: .55rem .7rem; min-height: 44px; display: inline-flex; align-items: center; }
  .hero { min-height: 320px; }
  .hero-content { padding: 2rem 1rem 1.75rem; }
  .page-wrap { padding: 1.75rem 1rem 3rem; }
  .cards-grid { grid-template-columns: 1fr; }
  .data-table { font-size: .82rem; }
  .footer-inner { flex-direction: column; }
}

@media (max-width: 480px) {
  .site-logo-text { font-size: 1rem; }
  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.25rem; }
}
