/*
Theme Name: War of 1812
Theme URI: https://warof1812.org
Author: War of 1812 Historical Project
Author URI: https://warof1812.org
Description: A comprehensive, museum-quality historical resource on the War of 1812.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: war-of-1812
*/

/* ═══════════════════════════════════════════
   DESIGN TOKENS v2
   ═══════════════════════════════════════════ */

:root {
  --midnight: #0b1526;
  --deep: #0f1d30;
  --slate: #1c2e47;
  --charcoal: #2a3b52;
  --ivory: #f8f3ea;
  --cream: #eee6d6;
  --warm: #d8cab2;
  --sand: #c4b49a;
  --gold: #b8963e;
  --gold-light: #d4b35a;
  --gold-dim: #8a7030;
  --ink: #1a1a28;
  --text: #2e2e3a;
  --text-light: #555566;
  --caption: #6a6a7a;
  --british: #9e2b2b;
  --american: #3a5a8a;
  --indigenous: #7a6520;
  --accent: #c45c3c;
  --success: #3a7a4a;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-caption: 'Lora', Georgia, serif;
  --font-label: 'DM Mono', 'Courier New', monospace;
}

/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  font-size: 18px;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--ivory);
  line-height: 1.85;
  overflow-x: hidden;
}

::selection { background: rgba(184, 150, 62, 0.3); color: var(--midnight); }
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--deep); }
::-webkit-scrollbar-thumb { background: rgba(184, 150, 62, 0.3); border-radius: 4px; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }
figure, blockquote { margin: 0; }

/* ═══════════════════════════════════════════
   TYPOGRAPHY — bigger, bolder, more readable
   ═══════════════════════════════════════════ */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  color: var(--ink);
  line-height: 1.2;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); margin-bottom: 0.4rem; }
h3 { font-size: 1.4rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.15rem; }

p {
  margin-bottom: 1.3rem;
  font-size: 1rem;
  line-height: 1.85;
}

p + p { text-indent: 0; }

.label {
  font-family: var(--font-label);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.5;
}

.caption-text {
  font-family: var(--font-caption);
  font-size: 0.9rem;
  color: var(--text-light);
}

strong, b { font-weight: 600; color: var(--ink); }

/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */

.wrap { max-width: 820px; margin: 0 auto; padding: 0 1.75rem; }
.wrap--wide { max-width: 1040px; }
.wrap--narrow { max-width: 700px; }

.section { padding: 4.5rem 0; }
.section--dark { background: var(--midnight); color: var(--ivory); }
.section--deep { background: linear-gradient(175deg, var(--deep) 0%, var(--midnight) 100%); color: var(--ivory); }
.section--cream { background: var(--ivory); }
.section--white { background: white; }

/* ═══════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(11, 21, 38, 0.95);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(184, 150, 62, 0.1);
}

.site-nav__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 1.5rem;
  gap: 0.3rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav__inner::-webkit-scrollbar { display: none; }

.site-nav__logo {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.15rem;
  font-weight: 500;
  font-style: italic;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 1rem;
}

.site-nav__link {
  font-family: var(--font-label);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--sand);
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  white-space: nowrap;
  flex-shrink: 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.site-nav__link:hover,
.site-nav__link--active {
  color: var(--gold);
  opacity: 1;
}

.site-nav__link--active { border-bottom-color: var(--gold); }

/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */

.hero {
  background: linear-gradient(175deg, var(--deep) 0%, var(--midnight) 50%, var(--slate) 100%);
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1.75rem;
  position: relative;
  overflow: hidden;
}

.hero__lines {
  position: absolute;
  inset: 0;
  opacity: 0.02;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 3px, var(--ivory) 3px, var(--ivory) 4px);
  background-size: 100% 24px;
}

.hero__label {
  font-family: var(--font-label);
  font-size: 0.72rem;
  color: var(--gold);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  opacity: 0.85;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 8vw, 5.5rem);
  font-weight: 400;
  font-style: italic;
  color: var(--ivory);
}

.hero__rule {
  width: 100px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 2rem auto;
  border: none;
}

.hero__subtitle {
  font-family: var(--font-caption);
  font-size: clamp(0.95rem, 2vw, 1.12rem);
  color: var(--warm);
  line-height: 1.8;
  max-width: 580px;
  margin: 0 auto;
}

.hero__buttons {
  margin-top: 3rem;
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero__btn {
  background: transparent;
  border: 1px solid rgba(184, 150, 62, 0.45);
  color: var(--ivory);
  font-family: var(--font-caption);
  font-size: 0.88rem;
  padding: 0.7rem 1.6rem;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.hero__btn:hover {
  background: rgba(184, 150, 62, 0.12);
  border-color: var(--gold);
  color: var(--ivory);
  opacity: 1;
}

/* ═══════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════ */

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 { margin-bottom: 0.5rem; }
.section-header--light h2 { color: var(--ivory); }
.section-header .caption-text { margin-top: 0.5rem; }
.section-header--light .caption-text { color: var(--warm); }

/* Diamond divider */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.divider__line { flex: 1; max-width: 120px; height: 1px; }
.divider__line--left { background: linear-gradient(90deg, transparent, rgba(184, 150, 62, 0.4)); }
.divider__line--right { background: linear-gradient(90deg, rgba(184, 150, 62, 0.4), transparent); }

/* ═══════════════════════════════════════════
   BADGE — bigger, more readable
   ═══════════════════════════════════════════ */

.badge {
  font-family: var(--font-label);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border: 1px solid currentColor;
  display: inline-block;
  line-height: 1.5;
  opacity: 0.8;
}

.badge--british { color: var(--british); }
.badge--american { color: var(--american); }
.badge--indigenous { color: var(--indigenous); }
.badge--gold { color: var(--gold); }
.badge--accent { color: var(--accent); }

/* ═══════════════════════════════════════════
   CAMPAIGN CARDS
   ═══════════════════════════════════════════ */

.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

.campaign-card {
  background: white;
  border: 1px solid var(--cream);
  padding: 1.75rem;
  border-top: 3px solid var(--gold);
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.campaign-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.06);
  opacity: 1;
}

.campaign-card--british { border-top-color: var(--british); }
.campaign-card--american { border-top-color: var(--american); }
.campaign-card--gold { border-top-color: var(--gold); }
.campaign-card--accent { border-top-color: var(--accent); }
.campaign-card--charcoal { border-top-color: var(--charcoal); }

.campaign-card h3 { font-size: 1.2rem; margin: 0.6rem 0 0.25rem; }
.campaign-card .caption-text { font-style: italic; margin-bottom: 0.6rem; }

.campaign-card__count {
  font-family: var(--font-label);
  font-size: 0.62rem;
  color: var(--gold-dim);
  letter-spacing: 0.04em;
  margin-top: 0.4rem;
}

/* ═══════════════════════════════════════════
   BATTLE LIST
   ═══════════════════════════════════════════ */

.battle-list__item {
  background: white;
  border: 1px solid var(--cream);
  border-left: 4px solid var(--gold);
  padding: 1.3rem 1.5rem;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}

.battle-list__item:hover {
  background: #fcfaf5;
  transform: translateX(3px);
  box-shadow: 3px 0 12px rgba(0,0,0,0.04);
  opacity: 1;
}

.battle-list__item--british { border-left-color: var(--british); }
.battle-list__item--american { border-left-color: var(--american); }

.battle-list__date {
  font-family: var(--font-label);
  font-size: 0.68rem;
  color: var(--sand);
  flex-shrink: 0;
  min-width: 110px;
}

.battle-list__name {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
  flex: 1;
}

.battle-list__arrow {
  font-family: var(--font-label);
  font-size: 0.6rem;
  color: var(--sand);
}

/* ═══════════════════════════════════════════
   SINGLE BATTLE PAGE
   ═══════════════════════════════════════════ */

.battle-hero {
  background: linear-gradient(175deg, var(--midnight), var(--deep));
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.battle-hero h1 {
  color: var(--ivory);
  margin: 0.3rem 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.battle-hero .label { color: var(--sand); font-size: 0.7rem; }

/* Forces panel */
.battle-forces {
  background: white;
  border-bottom: 1px solid var(--cream);
  padding: 3rem 0;
}

.battle-forces__title {
  font-family: var(--font-label);
  font-size: 0.68rem;
  color: var(--text-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 1.75rem;
}

.battle-forces__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

@media (max-width: 640px) {
  .battle-forces__grid { grid-template-columns: 1fr; }
}

.battle-forces__side-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.battle-forces__dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.battle-forces__dot--british { background: var(--british); }
.battle-forces__dot--american { background: var(--american); }

.battle-forces__commander {
  font-family: var(--font-caption);
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.2rem;
  font-weight: 500;
}

.battle-forces__detail {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.6;
}

.battle-forces__casualties {
  font-family: var(--font-label);
  font-size: 0.68rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

.battle-forces__casualties--british { color: var(--british); }
.battle-forces__casualties--american { color: var(--american); }

/* Force bars — taller, bolder */
.force-bar { margin-bottom: 0.75rem; }

.force-bar__header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.force-bar__label {
  font-family: var(--font-label);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.force-bar__troops {
  font-family: var(--font-label);
  font-size: 0.65rem;
  color: var(--text-light);
}

.force-bar__track {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.force-bar__track--british { background: rgba(158, 43, 43, 0.1); }
.force-bar__track--american { background: rgba(58, 90, 138, 0.1); }

.force-bar__fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.force-bar__fill--british { background: linear-gradient(90deg, rgba(158, 43, 43, 0.4), var(--british)); }
.force-bar__fill--american { background: linear-gradient(90deg, rgba(58, 90, 138, 0.4), var(--american)); }

/* Significance box — bigger, more prominent */
.significance {
  margin-top: 3rem;
  padding: 2rem 2rem;
  background: rgba(11, 21, 38, 0.04);
  border-left: 3px solid var(--gold);
}

.significance__label {
  font-family: var(--font-label);
  font-size: 0.68rem;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.significance p {
  font-family: var(--font-caption);
  font-size: 1rem;
  color: var(--text);
  line-height: 1.75;
  font-style: italic;
  text-indent: 0;
}

/* Battle navigation */
.battle-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--cream);
}

.battle-nav a { text-decoration: none; color: inherit; }

.battle-nav__direction {
  font-family: var(--font-label);
  font-size: 0.62rem;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.battle-nav__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink);
}

/* ═══════════════════════════════════════════
   BREADCRUMBS
   ═══════════════════════════════════════════ */

.breadcrumbs {
  font-family: var(--font-label);
  font-size: 0.65rem;
  color: var(--sand);
  margin-bottom: 1rem;
}

.breadcrumbs a { color: var(--gold); }
.breadcrumbs a:hover { opacity: 0.7; }
.breadcrumbs__sep { margin: 0 0.35rem; opacity: 0.5; }

/* ═══════════════════════════════════════════
   QUOTE CARDS — bigger text, warmer feel
   ═══════════════════════════════════════════ */

.quote-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(184, 150, 62, 0.12);
  padding: 1.75rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.quote-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.quote-card blockquote {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-style: italic;
  font-weight: 400;
  color: var(--ivory);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.quote-card__author {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--gold);
  font-weight: 600;
}

.quote-card__source {
  display: block;
  font-family: var(--font-caption);
  font-size: 0.82rem;
  color: var(--warm);
  font-weight: 400;
  font-style: italic;
  margin-top: 0.15rem;
}

.quote-card__note {
  font-family: var(--font-label);
  font-size: 0.62rem;
  color: var(--sand);
  margin-top: 0.4rem;
}

/* Inline quotes (in page content) */
.historian-quote,
blockquote.historian-quote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  background: white;
  border-left: 3px solid var(--gold);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
}

blockquote.historian-quote cite,
.historian-quote cite {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--font-label);
  font-size: 0.68rem;
  font-style: normal;
  letter-spacing: 0.04em;
  color: var(--text-light);
}

blockquote.historian-quote cite em,
.historian-quote cite em {
  font-style: italic;
  color: var(--text);
}

/* ═══════════════════════════════════════════
   AIMS TABLE
   ═══════════════════════════════════════════ */

.aims-table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.88rem;
}

.aims-table th {
  font-family: var(--font-label);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-align: left;
  padding: 0.75rem;
  background: rgba(11, 21, 38, 0.05);
  border-bottom: 2px solid var(--cream);
}

.aims-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--cream);
  vertical-align: top;
}

.aims-table__yes { font-weight: 700; font-size: 1.1rem; color: var(--success); }
.aims-table__no { font-weight: 700; font-size: 1.1rem; color: var(--british); }

/* ═══════════════════════════════════════════
   CAMPAIGN ESSAYS
   ═══════════════════════════════════════════ */

.campaign-essay h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
  margin: 3rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--cream);
}

.campaign-essay h3:first-child { margin-top: 0; }

.campaign-essay p {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 1.3rem;
}

.campaign-essay blockquote {
  margin: 2.5rem 0;
  padding: 1.75rem 2rem;
  background: white;
  border-left: 3px solid var(--gold);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
}

.campaign-essay blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--font-label);
  font-size: 0.68rem;
  font-style: normal;
  letter-spacing: 0.04em;
  color: var(--text-light);
}

.campaign-essay blockquote cite em {
  font-style: italic;
  color: var(--text);
}

/* ═══════════════════════════════════════════
   CAMPAIGN MAP
   ═══════════════════════════════════════════ */

.campaign-map {
  margin: 3rem 0;
  padding: 2rem;
  background: white;
  border: 1px solid var(--cream);
  overflow: hidden;
}

.campaign-map__label {
  font-family: var(--font-label);
  font-size: 0.65rem;
  color: var(--text-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  text-align: center;
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section, .battle-hero, .battle-forces {
  animation: fadeIn 0.4s ease-out;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
  html { font-size: 17px; }
  .section { padding: 3.5rem 0; }
  .hero { min-height: 80vh; padding: 3.5rem 1.25rem; }
  .aims-table { font-size: 0.82rem; }
  .campaign-essay blockquote,
  .historian-quote { padding: 1.25rem 1.5rem; font-size: 1rem; }
  .battle-forces__grid { gap: 1.5rem; }

  /* Timeline: collapse to single column on mobile */
  .timeline-entry {
    display: block !important;
  }
  .timeline-centre {
    display: none !important;
  }
}

@media (max-width: 480px) {
  html { font-size: 16px; }
  .wrap { padding: 0 1.25rem; }
  .hero h1 { font-size: 2.5rem; }
  .battle-hero h1 { font-size: 1.6rem; }
  .campaign-card { padding: 1.25rem; }
}

/* Timeline mobile fallback */
@media (max-width: 700px) {
  .tl-entry {
    display: block !important;
  }
  .tl-centre {
    display: none !important;
  }
  .tl-card {
    margin-bottom: 1rem !important;
  }
}
