/* =========================================================
   CanDogsEat.co.za — Design System
   Concept: "The Field Guide" — a veterinary reference journal,
   not a listicle. Warm South African veld tones, ink-stamp
   verdicts, index-card grid.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Public+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* --- Palette: named after the source of each colour --- */
  --rooibos:      #A8461E;  /* burnt rust — rooibos tea, dried earth */
  --rooibos-dark:  #7C3316;
  --veld-gold:    #C08A2E;  /* dry winter grass */
  --fynbos:       #435339;  /* deep olive-green shrubland */
  --fynbos-dark:  #303E28;
  --karoo-sand:   #EFE7D6;  /* warm sand background */
  --karoo-sand-2: #E7DBC2;  /* slightly deeper sand for cards */
  --charcoal:     #2A241C;  /* ink / soil, near-black warm */
  --paper:        #FBF8F1;  /* card surface, warmer than white */
  --safe:         #3F6B4A;
  --moderate:     #B8842A;
  --danger:       #8C2F1B;
  --line:         rgba(42,36,28,0.14);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Public Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--karoo-sand);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--rooibos-dark); text-decoration-thickness: 1px; }
a:hover { color: var(--rooibos); }

:focus-visible {
  outline: 2px solid var(--rooibos);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 500; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fynbos);
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- Header ---------------- */
.site-header {
  background: var(--charcoal);
  color: var(--karoo-sand);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 3px solid var(--rooibos);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--paper);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo .mark { color: var(--veld-gold); font-size: 1.4rem; }
.site-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-nav a {
  color: var(--karoo-sand-2);
  font-size: 0.92rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--paper); border-color: var(--veld-gold); }

/* ---------------- Hero ---------------- */
.hero {
  background: linear-gradient(180deg, var(--karoo-sand) 0%, var(--karoo-sand-2) 100%);
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: 720px; }
.hero p.lede {
  font-size: 1.1rem;
  color: #4B4436;
  max-width: 56ch;
}

.search-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px;
  display: flex;
  gap: 8px;
  max-width: 560px;
  box-shadow: 0 2px 0 var(--line);
}
.search-panel input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 14px;
  color: var(--charcoal);
}
.search-panel input:focus { outline: none; }
.search-panel button {
  background: var(--rooibos);
  color: var(--paper);
  border: none;
  border-radius: 2px;
  padding: 0 20px;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
}
.search-panel button:hover { background: var(--rooibos-dark); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fynbos-dark);
  background: var(--paper);
}
.search-wrap { position: relative; max-width: 560px; }
 
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(42,36,28,0.15);
  z-index: 50;
  max-height: 340px;
  overflow-y: auto;
}
.search-suggestions[hidden] { display: none; }
 
.suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  text-decoration: none;
  color: var(--charcoal);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-body);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover,
.suggestion-item.is-active {
  background: var(--karoo-sand-2);
}
 
.suggestion-name { font-size: 0.96rem; }
 
.suggestion-verdict {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 3px;
  flex-shrink: 0;
}
.suggestion-verdict.v-safe { background: rgba(63,107,74,0.12); color: var(--safe); }
.suggestion-verdict.v-moderate { background: rgba(184,132,42,0.14); color: var(--moderate); }
.suggestion-verdict.v-danger { background: rgba(140,47,27,0.12); color: var(--danger); }
 
.suggestion-empty {
  padding: 18px 16px;
  font-size: 0.92rem;
  color: #5C5544;
  line-height: 1.5;
}
.suggestion-empty a {
  color: var(--rooibos-dark);
  font-weight: 600;
}
/* ---------------- Trust strip ---------------- */
.trust-strip {
  background: var(--fynbos);
  color: var(--karoo-sand);
  font-size: 0.85rem;
  padding: 10px 0;
}
.trust-strip .wrap { display: flex; gap: 28px; flex-wrap: wrap; }
.trust-strip strong { color: var(--paper); }

/* ---------------- Card grid ---------------- */
.section { padding: 56px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; flex-wrap: wrap; gap: 10px;}

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

.food-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px;
  text-decoration: none;
  color: var(--charcoal);
  display: block;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.food-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(42,36,28,0.12);
}
.food-card .fc-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.food-card .fc-verdict {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  display: inline-block;
}
.v-safe   { background: rgba(63,107,74,0.12); color: var(--safe); }
.v-moderate { background: rgba(184,132,42,0.14); color: var(--moderate); }
.v-danger { background: rgba(140,47,27,0.12); color: var(--danger); }

/* ---------------- Verdict stamp (signature element) ---------------- */
.stamp {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 148px;
  height: 148px;
  border: 3px solid currentColor;
  border-radius: 50%;
  transform: rotate(-6deg);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: center;
  padding: 10px;
  margin: 8px 0 28px;
}
.stamp .stamp-verdict { font-size: 0.82rem; font-weight: 700; line-height: 1.25; }
.stamp .stamp-sub { font-size: 0.55rem; opacity: 0.75; margin-top: 4px; }
.stamp.stamp-danger { color: var(--danger); }
.stamp.stamp-safe { color: var(--safe); }
.stamp.stamp-moderate { color: var(--moderate); }

/* ---------------- Article body ---------------- */
.article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 40px clamp(20px, 5vw, 56px);
  margin: 32px 0;
}
.article .updated {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fynbos);
  margin-bottom: 4px;
}
.voice-answer {
  background: var(--karoo-sand-2);
  border-left: 4px solid var(--rooibos);
  padding: 18px 22px;
  border-radius: 0 4px 4px 0;
  margin: 20px 0 32px;
}
.voice-answer p { margin: 0; font-size: 1.05rem; }

.article section { margin-bottom: 32px; }
.article section:last-child { margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.94rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fynbos); }

ul, ol { padding-left: 22px; }
li { margin-bottom: 6px; }

.emergency-box {
  background: rgba(140,47,27,0.06);
  border: 1px solid rgba(140,47,27,0.3);
  border-radius: 4px;
  padding: 20px 24px;
}
.emergency-box h2 { color: var(--danger); }

.sources {
  border-top: 1px dashed var(--line);
  padding-top: 20px;
  font-size: 0.9rem;
}
.sources ul { padding-left: 18px; color: #5C5544; }
.disclaimer { font-size: 0.85rem; color: #6B6455; font-style: italic; }

.honest-note {
  background: rgba(184,132,42,0.08);
  border-left: 4px solid var(--veld-gold);
  padding: 14px 18px;
  border-radius: 0 4px 4px 0;
  font-size: 0.94rem;
}

.back-link {
  display: inline-block;
  margin: 24px 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ---------------- About / people ---------------- */
.people-strip {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px;
}
.people-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--fynbos); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.3rem;
  flex-shrink: 0;
}

/* ---------------- Footer ---------------- */
.site-footer {
  background: var(--charcoal);
  color: var(--karoo-sand-2);
  padding: 48px 0 28px;
  margin-top: 40px;
}
.site-footer h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--veld-gold);
  margin-bottom: 12px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-grid a { color: var(--karoo-sand-2); display: block; margin-bottom: 8px; font-size: 0.92rem; text-decoration: none; }
.footer-grid a:hover { color: var(--paper); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  font-size: 0.82rem;
  color: #A79E8B;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .site-nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
