/* css/style.css */

/* ---- Reset & Box Model ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---- Design Tokens ---- */
:root {
  --bg:         #f5f0e8;
  --surface:    #ffffff;
  --text:       #3d2e0e;
  --muted:      #8b7355;
  --accent:     #c9b98a;
  --accent-dark:#5c4a1e;
  --radius:     6px;
  --max-w:      960px;
  --gap:        1.5rem;
}

/* ---- Base ---- */
body {
  background-color: #f5f0e8;
  background-image:
    repeating-radial-gradient(ellipse at 65% 35%, transparent 0px, transparent 28px, rgba(139,115,85,0.13) 28px, rgba(139,115,85,0.13) 29px),
    repeating-radial-gradient(ellipse at 25% 75%, transparent 0px, transparent 34px, rgba(139,115,85,0.11) 34px, rgba(139,115,85,0.11) 35px),
    repeating-radial-gradient(ellipse at 80% 80%, transparent 0px, transparent 22px, rgba(139,115,85,0.09) 22px, rgba(139,115,85,0.09) 23px);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Typography ---- */
h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  line-height: 1.2;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
p  { margin-bottom: 0.75rem; }
p:last-child { margin-bottom: 0; }

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

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

/* ---- Site Header ---- */
.site-header {
  background: linear-gradient(180deg, #2a1f0a 0%, #3d2e0e 100%);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.30);
  padding: 1.5rem 0 1.25rem;
  text-align: center;
}
.site-header .callsign {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.85rem;
  font-weight: normal;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.site-header h1 {
  font-size: 2.2rem;
  color: #f5f0e8;
  letter-spacing: -0.01em;
}
/* ---- Site name (non-h1 version for category pages) ---- */
.site-header .site-name {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 2.2rem;
  color: #f5f0e8;
  letter-spacing: -0.01em;
  line-height: 1.2;
  font-weight: bold;
}
.site-header .site-name a {
  color: #f5f0e8;
}
.site-header .site-name a:hover {
  text-decoration: underline;
}
.site-header .tagline {
  margin-top: 0.35rem;
  color: var(--accent);
  font-size: 0.95rem;
}
.site-header a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---- Back nav (category pages) ---- */
.back-nav {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--accent);
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.back-nav a {
  color: var(--accent-dark);
  font-weight: 600;
}
.back-nav a:hover { text-decoration: underline; }

/* ---- About Section ---- */
.about {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2.5rem;
  color: var(--muted);
  font-size: 0.975rem;
}

/* ---- Screen-reader only ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---- Category Card Grid ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--gap);
}

.card {
  background: #fffcf5;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1rem 1rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: 0 3px 10px rgba(92, 74, 30, 0.15);
}
.card:hover {
  border-color: var(--accent-dark);
  box-shadow: 0 4px 14px rgba(92, 74, 30, 0.12);
  transform: translateY(-2px);
}
.card:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
}
.card-icon {
  line-height: 1;
  margin-bottom: 0.2rem;
  color: var(--accent-dark);
}
.card h2 {
  font-size: 1rem;
  color: var(--accent-dark);
  margin: 0;
}
.card p {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

/* ---- Featured card (Medicine) ---- */
.card--featured {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  border-left-width: 3px;
  border-left-color: var(--accent-dark);
}
.card--featured .card-body { display: flex; flex-direction: column; gap: 0.3rem; }
.card--featured h2 { font-size: 1.2rem; }
.card--featured p  { font-size: 0.88rem; margin: 0; }

/* ---- Secondary card (Antique Tractors) ---- */
.card--secondary {
  grid-column: span 2;
}

@media (max-width: 480px) {
  .card--featured { flex-direction: column; align-items: flex-start; }
}

/* ---- Category Page Header ---- */
.category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--accent);
}
.category-header .icon { font-size: 2rem; }
.category-header h1 { color: var(--accent-dark); font-size: 1.75rem; }
.category-header .subtitle { color: var(--muted); font-size: 0.9rem; }

/* ---- Link List ---- */
.link-section { margin-bottom: 2rem; }
.link-section h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--accent);
}
.link-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.link-list li a {
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.95rem;
}
.link-list li a:hover { text-decoration: underline; }
.link-list li .desc {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---- Bio quote ---- */
blockquote {
  border-left: 3px solid var(--accent-dark);
  padding: 0.4rem 0 0.4rem 1.25rem;
  margin: 1rem 0 1.25rem;
  color: var(--accent-dark);
  font-style: italic;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.55;
}

/* ---- Coming Soon placeholder ---- */
.coming-soon {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-style: italic;
}

/* ---- Footer ---- */
.site-footer {
  background: linear-gradient(180deg, #3d2e0e 0%, #2a1f0a 100%);
  border-top: 2px solid var(--accent);
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--accent);
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .site-header h1 { font-size: 1.7rem; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
