/* ============================================
   Occupy Maine — Citizen Journal Design System
   Grassroots civic media. Bold, readable, authentic.
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #fafaf9;
  --text: #1a1a1a;
  --accent: #c0392b;
  --accent-dark: #992d22;
  --secondary: #2c3e50;
  --secondary-light: #3d566e;
  --muted: #6b7280;
  --border: #e5e5e4;
  --card-bg: #f5f5f4;
  --era1-bg: #f0ebe3;
  --era3-bg: #eef2f7;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-head: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-mono: 'SFMono-Regular', Menlo, Monaco, 'Courier New', monospace;
  --max-w: 1100px;
  --content-w: 780px;
  --gutter: 1.5rem;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-dark); }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); margin-bottom: .75rem; }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); margin-bottom: .5rem; }
h4 { font-size: 1.1rem; margin-bottom: .5rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

.section-rule {
  width: 3rem;
  height: 3px;
  background: var(--accent);
  border: none;
  margin-bottom: 1.5rem;
}

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

.content-wrapper {
  max-width: var(--content-w);
  margin: 0 auto;
}

main { flex: 1; }

/* --- Archive Banner --- */
.archive-banner {
  background: var(--card-bg);
  color: var(--secondary);
  text-align: center;
  padding: .6rem 1rem;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .03em;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-head);
  text-transform: uppercase;
}

/* --- Site Header --- */
.site-header {
  background: var(--secondary);
  color: #fff;
  padding: 2rem 0;
}

.site-header .wrapper {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: .08em;
  margin: 0;
}

.site-title a { color: #fff; }
.site-title a:hover { color: rgba(255,255,255,.85); }

.site-tagline {
  font-family: var(--font-body);
  font-size: .95rem;
  font-style: italic;
  color: rgba(255,255,255,.6);
  margin: 0;
  text-transform: none;
}

/* --- Navigation --- */
.site-nav {
  background: var(--text);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--accent);
}

.site-nav .wrapper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.nav-link {
  font-family: var(--font-head);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
  padding: .75rem 1rem;
  transition: background .15s, color .15s;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}

.nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.12);
}

/* --- Hero Section --- */
.hero {
  background: var(--secondary);
  color: #fff;
  padding: 3.5rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: .1em;
  margin-bottom: .5rem;
}

.hero .hero-tagline {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-style: italic;
  color: rgba(255,255,255,.65);
  margin-bottom: .25rem;
}

.hero .hero-dates {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: rgba(255,255,255,.4);
  letter-spacing: .1em;
}

/* --- Era Sections (Homepage) --- */
.era-section {
  padding: 3rem 0;
}

.era-section.era1 { background: var(--era1-bg); }
.era-section.era3 { background: var(--era3-bg); }

.era-label {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}

/* --- Card Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 1.5rem;
  transition: box-shadow .2s, border-color .2s;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  border-color: var(--accent);
}

.card-date {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: .35rem;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: .5rem;
}

.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); }

.card p {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.6;
}

/* --- Article Pages --- */
.article-header {
  padding: 3rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.article-header .wrapper { max-width: var(--content-w); }

.article-meta {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: .75rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.article-section-label {
  font-family: var(--font-head);
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: .5rem;
}

.article-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  text-transform: none;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.article-body {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 var(--gutter) 3rem;
  font-size: 1.05rem;
  line-height: 1.85;
}

.article-body h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: .75rem;
  text-transform: none;
}

.article-body h3 {
  font-size: 1.2rem;
  margin-top: 2rem;
  margin-bottom: .5rem;
  text-transform: none;
}

.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--card-bg);
  font-style: italic;
  color: var(--secondary);
}

.article-body ul, .article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.article-body li { margin-bottom: .35rem; }

.article-body img {
  border-radius: 2px;
  margin: 1.5rem 0;
}

.article-body .caption {
  font-size: .8rem;
  color: var(--muted);
  font-style: italic;
  margin-top: -.75rem;
  margin-bottom: 1.5rem;
}

/* --- Section Index Pages --- */
.section-hero {
  background: var(--secondary);
  color: #fff;
  padding: 2.5rem 0 2rem;
}

.section-hero h1 {
  margin-bottom: .5rem;
}

.section-hero p {
  font-family: var(--font-body);
  font-size: 1rem;
  color: rgba(255,255,255,.65);
  max-width: var(--content-w);
  text-transform: none;
  font-style: italic;
}

.section-content {
  padding: 2.5rem 0 3rem;
}

/* --- Timeline (Era 1 Movement) --- */
.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 1.5rem;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.timeline-entry {
  position: relative;
  padding-left: 4rem;
  margin-bottom: 2rem;
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: .35rem;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .05em;
  margin-bottom: .25rem;
}

.timeline-entry h3 {
  font-size: 1.1rem;
  text-transform: none;
  margin-bottom: .35rem;
}

.timeline-entry p {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.6;
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--muted);
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
}

.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 .4rem; }

/* --- Stub / Coming Soon --- */
.stub-notice {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  margin-top: 1.5rem;
}

.stub-notice h3 {
  text-transform: none;
  color: var(--muted);
  margin-bottom: .5rem;
}

.stub-notice p {
  font-size: .9rem;
  color: var(--muted);
}

/* --- Related Articles --- */
.related-articles {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  margin-top: 2rem;
  max-width: var(--content-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  padding-bottom: 3rem;
}

.related-articles h3 {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.related-articles ul {
  list-style: none;
  padding: 0;
}

.related-articles li {
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}

.related-articles li:last-child { border-bottom: none; }
.related-articles a { color: var(--text); font-weight: 600; }
.related-articles a:hover { color: var(--accent); }

/* --- Network Footer --- */
.network-footer {
  background: linear-gradient(to bottom, var(--secondary), #0d1117);
  color: rgba(255,255,255,.5);
  padding: 2rem 0;
  text-align: center;
}

.network-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.network-links a {
  color: rgba(255,255,255,.55);
  font-family: var(--font-head);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.network-links a:hover { color: #fff; }

.archive-date {
  font-size: .7rem;
  color: rgba(255,255,255,.3);
}

/* --- Metadata Footer --- */
.metadata-footer {
  text-align: center;
  padding: 8px;
  font-size: 11px;
  color: #666;
  background: #f5f5f5;
  border-top: 1px solid #eee;
}

.metadata-footer a {
  color: var(--accent);
  text-decoration: none;
}

.metadata-footer a:hover { text-decoration: underline; }

/* --- Technology Page --- */
.tech-section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

.tech-section:last-of-type { border-bottom: none; }

.tech-section h2 {
  text-transform: none;
  font-size: 1.5rem;
}

.tech-section p {
  max-width: var(--content-w);
  font-size: 1rem;
  line-height: 1.75;
}

.tech-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1rem;
}

.tech-link {
  display: inline-block;
  font-family: var(--font-head);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .03em;
  padding: .5rem 1.25rem;
  border: 2px solid var(--accent);
  color: var(--accent);
  text-transform: uppercase;
  transition: background .15s, color .15s;
}

.tech-link:hover {
  background: var(--accent);
  color: #fff;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .site-header .wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
  }

  .site-nav .wrapper {
    gap: 0;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .nav-link {
    font-size: .8rem;
    padding: .65rem .75rem;
    white-space: nowrap;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2.25rem;
    letter-spacing: .06em;
  }

  .article-meta {
    flex-direction: column;
    gap: .25rem;
  }

  .network-links {
    flex-direction: column;
    gap: .5rem;
  }

  .timeline::before { left: 1rem; }
  .timeline-entry { padding-left: 3rem; }
  .timeline-entry::before { left: .5rem; }
}

@media (max-width: 480px) {
  :root {
    --gutter: 1rem;
  }

  .hero { padding: 2.5rem 0 2rem; }
  .era-section { padding: 2rem 0; }
}
