/* Forums Earl Haig – Main stylesheet (academic-modern, trust-based) */
:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #4a5568;
  --color-accent: #1e3a5f;
  --color-accent-light: #2c5282;
  --color-accent-soft: #ebf4f8;
  --color-border: #e2e8f0;
  --color-hero-overlay: rgba(30, 58, 95, 0.55);
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --max-width: 72rem;
  --shadow-soft: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-card: 0 4px 12px rgba(0,0,0,0.06);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: var(--space-sm);
  z-index: 100;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0.25rem;
  transition: top 0.2s;
}
.skip-link:focus { top: var(--space-sm); }

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

h1, h2, h3 {
  font-family: var(--font-serif);
  line-height: 1.25;
  margin-top: 0;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: var(--space-md); }
h3 { font-size: 1.25rem; margin-bottom: var(--space-xs); }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo img { height: 2.5rem; width: auto; }
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
}
.main-nav a { color: var(--color-text); font-weight: 500; }
.main-nav a:hover { color: var(--color-accent); }
.nav-toggle {
  display: none;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231a1a1a'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E") center/1.5rem no-repeat;
  cursor: pointer;
}
@media (max-width: 992px) {
  .main-nav ul { gap: var(--space-xs) var(--space-sm); }
}
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .main-nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-sm);
    box-shadow: var(--shadow-card);
  }
  .main-nav ul.open { display: flex; }
  .main-nav a { display: block; padding: var(--space-sm); }
}

/* Hero */
.hero {
  position: relative;
  min-height: 28rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-hero-overlay);
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: var(--space-xl) var(--space-md);
  max-width: 42rem;
}
.hero-content h1 { color: #fff; margin-bottom: var(--space-sm); }
.hero-lead {
  color: rgba(255,255,255,0.95);
  font-size: 1.125rem;
  margin-bottom: var(--space-lg);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: 0.375rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
}
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-light); text-decoration: none; }
.btn-secondary {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.85);
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); text-decoration: none; }

/* Content sections */
.content-section { padding: var(--space-xl) 0; }
.content-section .lead {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}
.feature-grid, .category-grid, .subfolder-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-lg);
}
.feature-grid article,
.category-card,
.subfolder-card {
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: var(--color-bg);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.feature-grid article:hover,
.category-card:hover,
.subfolder-card:hover {
  box-shadow: var(--shadow-card);
  border-color: var(--color-accent);
}
.feature-grid h3 a,
.category-card h3 a,
.subfolder-card h3 a { color: var(--color-text); }
.feature-grid h3 a:hover,
.category-card h3 a:hover,
.subfolder-card h3 a:hover { color: var(--color-accent); }
.article-block {
  background: var(--color-accent-soft);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

/* Page banner (subpages) */
.page-banner {
  position: relative;
  min-height: 16rem;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.page-banner .banner-bg { position: absolute; inset: 0; }
.page-banner .banner-bg img { width: 100%; height: 100%; object-fit: cover; }
.page-banner .banner-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-hero-overlay);
}
.page-banner .banner-content {
  position: relative;
  z-index: 1;
  padding: var(--space-xl) var(--space-md);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}
.page-banner h1 { color: #fff; margin-bottom: var(--space-xs); }
.page-banner .breadcrumb { margin: 0; font-size: 0.9rem; }
.page-banner .breadcrumb a { color: rgba(255,255,255,0.9); }
.page-banner .breadcrumb span { color: rgba(255,255,255,0.7); }

/* Guidelines list */
.guidelines-list { margin: 0; padding-left: 1.25rem; }
.guidelines-list li { margin-bottom: var(--space-xs); }

/* FAQ */
.faq-list { margin: 0; }
.faq-list > div {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}
.faq-list dt { font-weight: 600; margin-bottom: var(--space-xs); }
.faq-list dd { margin: 0; color: var(--color-text-muted); }

/* CTA section */
.cta {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  background: var(--color-accent-soft);
  border-top: 1px solid var(--color-border);
}

/* Footer */
.site-footer {
  margin-top: 0;
  padding: var(--space-xl) var(--space-md);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}
.footer-inner { max-width: var(--max-width); margin: 0 auto; }
.footer-nav ul {
  list-style: none;
  margin: 0 0 var(--space-md);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.footer-nav a { color: var(--color-text-muted); }
.footer-meta { margin: 0; font-size: 0.875rem; color: var(--color-text-muted); }
