/* ============================================
   AUTHORITY THEME — Reusable across 25 sites
   Variant system: magazine | editorial | minimal
   Font system: inter | merriweather | source
   ============================================ */

/* --- CSS Custom Properties (override in hugo.toml per site) --- */
:root {
  --primary: #1a365d;
  --accent: #2b6cb0;
  --text: #1a202c;
  --text-light: #4a5568;
  --bg: #ffffff;
  --bg-alt: #f7fafc;
  --border: #e2e8f0;
  --radius: 8px;
  --max-width: 1200px;
  --content-width: 760px;
}

/* --- Font Pairings --- */
.font-inter {
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Newsreader', Georgia, serif;
}
.font-merriweather {
  --font-heading: 'Source Sans 3', -apple-system, sans-serif;
  --font-body: 'Merriweather', Georgia, serif;
}
.font-source {
  --font-heading: 'DM Sans', -apple-system, sans-serif;
  --font-body: 'Source Serif 4', Georgia, serif;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Base Typography --- */
body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--primary);
}
h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.35rem; margin: 2rem 0 0.75rem; }
p { margin-bottom: 1.25rem; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Header --- */
.site-header {
  border-bottom: 3px solid var(--primary);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.site-logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
.site-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.site-tagline {
  font-size: 0.75rem;
  color: var(--text-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nav-list {
  list-style: none;
  display: flex;
  gap: 1.75rem;
}
.nav-list a {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}
.nav-list a:hover,
.nav-list a.active {
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.3s;
}

/* --- Hero (Homepage) --- */
.hero {
  background: var(--primary);
  color: white;
  padding: 4rem 0;
  text-align: center;
}
.hero h1 {
  color: white;
  font-size: 3rem;
  margin-bottom: 0.5rem;
}
.hero-tagline {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Section Headers --- */
.section-header {
  background: var(--bg-alt);
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
}
.section-header h1 {
  text-transform: capitalize;
}
.section-desc {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
}

/* --- Article Grid --- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
  padding: 2.5rem 0;
}
.article-grid.compact {
  grid-template-columns: repeat(3, 1fr);
}

/* --- Article Card --- */
.article-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.article-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.card-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.card-content {
  padding: 1.25rem;
}
.card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.card-category {
  color: var(--accent);
  font-weight: 600;
}
.card-content h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}
.card-content h3 a {
  color: var(--primary);
}
.card-content h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}
.card-content p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.read-more {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --- Category Preview (Homepage) --- */
.category-preview {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}
.category-preview h2 a {
  color: var(--primary);
  font-size: 1.5rem;
}
.category-preview h2 a:hover {
  color: var(--accent);
}
.latest-articles {
  padding: 2.5rem 0;
  background: var(--bg-alt);
}

/* --- Single Article --- */
.article-single {
  padding: 2rem 0 4rem;
}
.article-single .container {
  max-width: var(--content-width);
}

/* Breadcrumbs */
.breadcrumbs {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.breadcrumbs a { color: var(--text-light); }
.breadcrumbs a:hover { color: var(--accent); }

.article-header {
  margin-bottom: 2rem;
}
.article-meta {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 1rem;
}
.article-category { color: var(--accent); font-weight: 600; }
.article-subtitle {
  font-size: 1.25rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

.article-hero {
  margin: 2rem 0;
  border-radius: var(--radius);
  overflow: hidden;
}

/* Table of Contents */
.toc {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}
.toc h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.toc nav ul {
  list-style: none;
  padding-left: 0;
}
.toc nav ul ul {
  padding-left: 1.25rem;
}
.toc li {
  margin: 0.35rem 0;
}
.toc a {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text);
}
.toc a:hover { color: var(--accent); }

/* Article body */
.article-body {
  margin: 2.5rem 0;
}
.article-body h2 { border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.article-body ul, .article-body ol {
  margin: 1rem 0 1.5rem 1.5rem;
}
.article-body li { margin-bottom: 0.4rem; }
.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--bg-alt);
  font-style: italic;
  color: var(--text-light);
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
.article-body th, .article-body td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 0.9rem;
}
.article-body th {
  background: var(--bg-alt);
  font-family: var(--font-heading);
  font-weight: 600;
}
.article-body img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

/* Author box */
.author-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 3rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Related articles */
.related-articles {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.related-articles h2 {
  font-size: 1.25rem;
  border: none;
  padding: 0;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

/* --- Footer --- */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
}
.footer-inner h3, .footer-inner h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
.footer-inner p {
  font-size: 0.85rem;
  line-height: 1.6;
}
.footer-nav ul {
  list-style: none;
}
.footer-nav li { margin-bottom: 0.4rem; }
.footer-nav a {
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
}
.footer-nav a:hover { color: white; }
.footer-legal {
  font-size: 0.8rem;
  opacity: 0.7;
}
.footer-legal a { color: rgba(255,255,255,0.75); }

/* --- Responsive --- */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  .hero h1 { font-size: 2rem; }
  body { font-size: 16px; }

  .nav-toggle { display: block; }
  .nav-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 3px solid var(--primary);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.75rem;
  }
  .nav-list.open { display: flex; }

  .article-grid,
  .article-grid.compact {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* --- Variant: Editorial --- */
.variant-editorial .site-header {
  border-bottom: 1px solid var(--border);
  background: var(--primary);
}
.variant-editorial .site-title { color: white; }
.variant-editorial .site-tagline { color: rgba(255,255,255,0.7); }
.variant-editorial .nav-list a { color: rgba(255,255,255,0.9); }
.variant-editorial .nav-list a:hover,
.variant-editorial .nav-list a.active { border-bottom-color: white; }
.variant-editorial .hero { background: var(--bg-alt); color: var(--text); }
.variant-editorial .hero h1 { color: var(--primary); }
.variant-editorial .hero-tagline { color: var(--text-light); opacity: 1; }
.variant-editorial .nav-toggle span { background: white; }
.variant-editorial .article-grid { gap: 2.5rem; }
.variant-editorial .article-card { border: none; border-bottom: 2px solid var(--border); border-radius: 0; }
.variant-editorial .article-card:hover { box-shadow: none; transform: none; border-bottom-color: var(--accent); }

/* --- Variant: Minimal --- */
.variant-minimal .site-header { border-bottom: 1px solid var(--border); }
.variant-minimal .site-title { font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; font-size: 1.1rem; }
.variant-minimal .site-tagline { display: none; }
.variant-minimal .hero { background: var(--bg); color: var(--text); padding: 6rem 0 3rem; }
.variant-minimal .hero h1 { color: var(--primary); font-size: 2.5rem; font-weight: 400; }
.variant-minimal .hero-tagline { font-size: 1rem; }
.variant-minimal .article-card { border: none; background: transparent; }
.variant-minimal .article-card:hover { box-shadow: none; transform: none; }
.variant-minimal .card-content { padding: 1rem 0; }
.variant-minimal .card-content h3 { font-weight: 500; }
.variant-minimal .article-grid { gap: 3rem; }
.variant-minimal h1, .variant-minimal h2, .variant-minimal h3 { font-weight: 500; }
.variant-minimal .footer-inner { grid-template-columns: 1fr; text-align: center; }

/* --- Print --- */
@media print {
  .site-header, .site-footer, .toc, .related-articles, .nav-toggle { display: none; }
  .article-body { font-size: 12pt; }
}
