/* assets/css/main.css — CoffeeTradeJustice.org */

/* ── Tokens ─────────────────────────────────────────── */
:root {
  --navy:       #0D1B2A;
  --navy-mid:   #162336;
  --navy-light: #1E3250;
  --gold:       #B8960C;
  --gold-light: #D4AC0D;
  --gold-pale:  #F5E9B0;
  --cream:      #F7F4EE;
  --ink:        #1A1A1A;
  --muted:      #5A6270;
  --border:     #D6CCBA;
  --white:      #FFFFFF;

  --ff-display: 'Playfair Display', Georgia, serif;
  --ff-body:    'Source Sans 3', system-ui, sans-serif;
  --ff-mono:    'Source Code Pro', monospace;

  --max-w: 1140px;
  --radius: 3px;
  --transition: 200ms ease;
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--ff-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
}
img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); text-decoration: underline; }

/* ── Utility ─────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.skip-link {
  position: absolute; top: -999px; left: 0;
  background: var(--gold); color: var(--navy);
  padding: .5rem 1rem; font-weight: 600; z-index: 9999;
}
.skip-link:focus { top: 0; }

/* ── Wordmark ─────────────────────────────────────────── */
.wordmark { display: flex; align-items: baseline; gap: 0; text-decoration: none; line-height: 1; }
.wm-coffee  { font-family: var(--ff-display); font-weight: 700; font-size: 1.5rem; color: var(--white); letter-spacing: -.01em; }
.wm-trade   { font-family: var(--ff-display); font-weight: 700; font-size: 1.5rem; color: var(--gold); }
.wm-justice { font-family: var(--ff-display); font-weight: 700; font-size: 1.5rem; color: var(--white); }
.wm-dot     { font-family: var(--ff-display); font-weight: 700; font-size: 1.5rem; color: var(--gold); }
.wm-org     { font-family: var(--ff-mono); font-size: .85rem; color: var(--gold-pale); letter-spacing: .05em; margin-left: 1px; align-self: flex-end; padding-bottom: 2px; }

/* ── Header ──────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  padding-top: .85rem; padding-bottom: .85rem;
}
.site-nav { display: flex; gap: 1.75rem; align-items: center; }
.site-nav a {
  font-family: var(--ff-body); font-weight: 600;
  font-size: .875rem; text-transform: uppercase;
  letter-spacing: .08em; color: rgba(255,255,255,.82);
  transition: color var(--transition);
  text-decoration: none;
}
.site-nav a:hover { color: var(--gold-light); }
.nav-toggle { display: none; background: none; border: none; color: var(--white); font-size: 1.4rem; cursor: pointer; }

/* ── Hero ────────────────────────────────────────────── */
.hero {
  background: var(--navy);
  background-image: linear-gradient(160deg, var(--navy) 55%, var(--navy-light) 100%);
  color: var(--white);
  padding: 5rem 0 4rem;
  border-bottom: 1px solid rgba(184,150,12,.25);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23B8960C' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero-eyebrow {
  font-family: var(--ff-mono); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .15em;
  color: var(--gold); margin-bottom: 1.25rem;
}
.hero-headline {
  font-family: var(--ff-display); font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700; line-height: 1.15; max-width: 760px;
  margin-bottom: 1.25rem;
}
.hero-headline em { font-style: italic; color: var(--gold-light); }
.hero-sub {
  font-size: 1.1rem; color: rgba(255,255,255,.75);
  max-width: 580px; margin-bottom: 2rem;
}
.btn {
  display: inline-block; padding: .7rem 1.6rem;
  font-family: var(--ff-body); font-weight: 600;
  font-size: .9rem; text-transform: uppercase;
  letter-spacing: .07em; border-radius: var(--radius);
  transition: all var(--transition); text-decoration: none;
  cursor: pointer; border: 2px solid transparent;
}
.btn-gold   { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-light); border-color: var(--gold-light); color: var(--navy); text-decoration: none; }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,.4); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); text-decoration: none; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── Section titles ──────────────────────────────────── */
.section { padding: 4rem 0; }
.section-title {
  font-family: var(--ff-display); font-size: 1.85rem;
  font-weight: 700; color: var(--navy);
  margin-bottom: .4rem;
}
.section-rule {
  width: 48px; height: 3px;
  background: var(--gold); margin-bottom: 2rem;
}

/* ── Story Cards ─────────────────────────────────────── */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 2rem;
}
.story-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex; flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}
.story-card:hover { box-shadow: 0 6px 24px rgba(13,27,42,.12); transform: translateY(-2px); }
.story-card-cat {
  font-family: var(--ff-mono); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--gold); margin-bottom: .6rem;
}
.story-card-title {
  font-family: var(--ff-display); font-size: 1.2rem;
  font-weight: 700; color: var(--navy);
  line-height: 1.3; margin-bottom: .6rem;
}
.story-card-title a { color: inherit; text-decoration: none; }
.story-card-title a:hover { color: var(--gold); }
.story-card-excerpt { font-size: .9rem; color: var(--muted); flex: 1; margin-bottom: 1rem; }
.story-card-meta {
  font-size: .78rem; color: var(--muted);
  font-family: var(--ff-mono); border-top: 1px solid var(--border);
  padding-top: .75rem; margin-top: auto;
  display: flex; gap: 1rem;
}

/* ── Featured story strip ────────────────────────────── */
.featured-story {
  background: var(--navy);
  color: var(--white);
  padding: 2.5rem;
  border-radius: var(--radius);
  border-left: 5px solid var(--gold);
  margin-bottom: 3rem;
}
.featured-label {
  font-family: var(--ff-mono); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .15em;
  color: var(--gold); margin-bottom: .75rem;
}
.featured-title {
  font-family: var(--ff-display); font-size: 1.6rem;
  font-weight: 700; line-height: 1.25; margin-bottom: .75rem;
}
.featured-title a { color: var(--white); text-decoration: none; }
.featured-title a:hover { color: var(--gold-light); }
.featured-excerpt { color: rgba(255,255,255,.72); margin-bottom: 1.25rem; }

/* ── Single story ────────────────────────────────────── */
.story-header { background: var(--navy); color: var(--white); padding: 3rem 0 2.5rem; }
.story-meta-bar {
  font-family: var(--ff-mono); font-size: .78rem;
  color: var(--gold); letter-spacing: .1em;
  text-transform: uppercase; margin-bottom: 1rem;
  display: flex; gap: 1.5rem; flex-wrap: wrap;
}
.story-h1 {
  font-family: var(--ff-display); font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700; line-height: 1.2; max-width: 780px;
}
.story-body-wrap { max-width: 740px; margin: 3rem auto; padding: 0 1.5rem; }
.story-body { font-size: 1.05rem; line-height: 1.8; }
.story-body h2 { font-family: var(--ff-display); font-size: 1.5rem; margin: 2.5rem 0 .75rem; color: var(--navy); }
.story-body h3 { font-family: var(--ff-display); font-size: 1.2rem; margin: 2rem 0 .5rem; color: var(--navy); }
.story-body p  { margin-bottom: 1.25rem; }
.story-body blockquote {
  border-left: 4px solid var(--gold); padding: 1rem 1.5rem;
  background: var(--gold-pale); margin: 2rem 0;
  font-style: italic; color: var(--navy-mid);
}
.story-body ul, .story-body ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.story-body li { margin-bottom: .4rem; }

/* ── Breadcrumb ──────────────────────────────────────── */
.breadcrumb {
  font-size: .82rem; font-family: var(--ff-mono);
  color: var(--muted); margin-bottom: 2rem;
  display: flex; gap: .5rem; align-items: center;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb-sep { opacity: .4; }

/* ── Pagination ──────────────────────────────────────── */
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 3rem; }
.pagination a, .pagination span {
  padding: .45rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem; font-family: var(--ff-mono);
}
.pagination .current { background: var(--gold); color: var(--navy); border-color: var(--gold); font-weight: 700; }
.pagination a:hover { background: var(--navy); color: var(--white); border-color: var(--navy); text-decoration: none; }

/* ── Tip form / contact ──────────────────────────────── */
.form-wrap { max-width: 640px; margin: 0 auto; }
.form-group { margin-bottom: 1.4rem; }
.form-group label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: .4rem; color: var(--navy); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: .65rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--ff-body); font-size: .95rem;
  background: var(--white); color: var(--ink);
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-pale); }
.form-group textarea { resize: vertical; min-height: 160px; }
.form-note { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.flash-success { background: #e6f5ec; border: 1px solid #52b788; color: #1b4332; padding: .9rem 1.2rem; border-radius: var(--radius); margin-bottom: 1.5rem; }
.flash-error   { background: #fce8e8; border: 1px solid #d62828; color: #6b1a1a; padding: .9rem 1.2rem; border-radius: var(--radius); margin-bottom: 1.5rem; }

/* ── Footer ──────────────────────────────────────────── */
.site-footer { background: var(--navy); color: rgba(255,255,255,.6); margin-top: 4rem; }
.footer-inner {
  display: flex; gap: 3rem; flex-wrap: wrap;
  padding: 3rem 1.5rem 2rem; align-items: flex-start;
}
.footer-brand .wm-coffee,
.footer-brand .wm-trade,
.footer-brand .wm-justice { font-size: 1.1rem; }
.footer-brand .wm-org { font-size: .7rem; }
.footer-tagline { font-size: .82rem; color: rgba(255,255,255,.45); margin-top: .4rem; }
.footer-nav { display: flex; flex-direction: column; gap: .5rem; }
.footer-nav a { color: rgba(255,255,255,.65); font-size: .875rem; text-decoration: none; }
.footer-nav a:hover { color: var(--gold); }
.footer-partner { font-size: .82rem; }
.footer-partner a { color: var(--gold); }
.footer-base { border-top: 1px solid rgba(255,255,255,.08); padding: 1rem 1.5rem; font-size: .78rem; text-align: center; color: rgba(255,255,255,.35); }

/* ── Admin nav (shared banner style) ────────────────── */
.admin-bar { background: var(--navy-mid); color: var(--white); padding: .6rem 1.5rem; font-size: .82rem; display: flex; justify-content: space-between; align-items: center; }
.admin-bar a { color: var(--gold); margin-left: 1rem; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .site-nav { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--navy); padding: 1rem 1.5rem; gap: 1rem; border-top: 1px solid rgba(255,255,255,.1); }
  .site-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .site-header { position: relative; }
  .footer-inner { flex-direction: column; gap: 1.5rem; }
  .story-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .featured-story { padding: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
