/* Liberia — Land of the Free | history magazine theme */

:root {
  --color-bg: #1c0609;
  --color-primary: #BF0A30;
  --color-primary-dark: #8f0724;
  --color-secondary: #FFFFFF;
  --color-accent: #4a7fcb;
  --color-accent-light: #6a9fd8;
  --color-muted: rgba(255, 255, 255, 0.75);
  --color-card: #2a0a0e;
  --hero-gradient: radial-gradient(ellipse at bottom right, #3d1018, #1c0609);
  --card-glow: 0 0 24px rgba(191, 10, 48, 0.25);
  --radius-card: 6px;
  --font-heading: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-body: 'Open Sans', system-ui, -apple-system, sans-serif;
  --container: 1180px;
  --header-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--color-secondary);
  background: var(--color-bg);
  background-image: var(--hero-gradient);
  background-attachment: fixed;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent-light);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--color-secondary);
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 2, 3, 0.92);
  border-bottom: 1px solid rgba(191, 10, 48, 0.35);
  backdrop-filter: blur(10px);
  transition: box-shadow 0.2s ease;
}

.header.scrolled {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-secondary);
  text-decoration: none;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.logo span {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--color-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  align-items: center;
}

.nav-link {
  color: var(--color-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-secondary);
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-card);
  padding: 0.5rem 0.65rem;
  cursor: pointer;
}

.hamburger {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-secondary);
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--color-secondary);
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

@media (max-width: 900px) {
  .mobile-menu-toggle {
    display: block;
  }

  .main-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: rgba(10, 2, 3, 0.98);
    padding: 1rem;
    border-bottom: 1px solid rgba(191, 10, 48, 0.35);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .main-nav.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: flex-start;
  }
}

body.menu-open {
  overflow: hidden;
}

/* Typography */
h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-secondary);
}

h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  margin-bottom: 1rem;
  border-left: 4px solid var(--color-primary);
  padding-left: 0.85rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.section-lead {
  font-size: 1.1rem;
  color: var(--color-muted);
  max-width: 65ch;
}

.pull-quote {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--color-secondary);
  border-inline-start: 3px solid var(--color-accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(0, 40, 104, 0.15);
  border-radius: var(--radius-card);
}

.prose p {
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.88);
}

.prose p:last-child {
  margin-bottom: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-card);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-secondary);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: var(--color-secondary);
}

.btn-outline {
  background: transparent;
  color: var(--color-secondary);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-outline:hover {
  border-color: var(--color-secondary);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-secondary);
}

/* Hero fullscreen */
.hero-fullscreen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 2, 3, 0.6);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
  padding: calc(var(--header-h) + 2rem) 0 4rem;
  max-width: 640px;
  margin-right: auto;
  margin-left: max(1rem, calc((100% - var(--container)) / 2 + 1rem));
}

@media (max-width: 768px) {
  .hero-content {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    max-width: 100%;
  }

  .hero-actions {
    justify-content: center;
  }
}

.hero-content h1 {
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}

.hero-content .section-lead {
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(191,10,48,0.08) 0%, rgba(0,40,104,0.06) 100%);
  border-block: 1px solid rgba(191, 10, 48, 0.18);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

/* Float image — text wraps around it like a magazine article */
.prose-float {
  width: 100%;
}

.prose-float .float-img {
  float: right;
  width: 44%;
  margin: 0 0 1.5rem 2.5rem;
  border-radius: var(--radius-card);
  box-shadow: var(--card-glow), 0 12px 40px rgba(0,0,0,0.4);
}

.prose-float::after {
  content: '';
  display: table;
  clear: both;
}

@media (max-width: 640px) {
  .prose-float .float-img {
    float: none;
    width: 100%;
    margin: 0 0 1.5rem 0;
  }
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }

  .split.reverse-mobile .split-media {
    order: -1;
  }
}

.figure {
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--card-glow), 0 12px 40px rgba(0, 0, 0, 0.35);
}

.figure figcaption {
  font-size: 0.8rem;
  color: var(--color-muted);
  padding: 0.5rem 0 0;
}

/* Cards grid */
.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .cards-3 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--color-card);
  border: 1px solid rgba(191, 10, 48, 0.2);
  border-radius: var(--radius-card);
  box-shadow: var(--card-glow);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(191, 10, 48, 0.45);
}

.card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.card-body {
  padding: 1.25rem;
}

.card-body p {
  font-size: 0.95rem;
  color: var(--color-muted);
}

/* Wide banner */
.banner-wide {
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--card-glow);
  margin-bottom: 2rem;
}

.banner-wide img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

/* Timeline */
.timeline-wrap {
  max-width: 720px;
  margin-inline: auto;
}

.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 3px solid var(--color-primary);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-2rem - 9px);
  top: 0.35rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--color-secondary);
  box-shadow: 0 0 0 2px var(--color-primary);
}

.timeline-date {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.1rem;
}

.timeline-item p {
  color: var(--color-muted);
  margin-top: 0.35rem;
}

/* Page hero (inner pages) */
.page-hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid rgba(191, 10, 48, 0.2);
}

.page-hero h1 {
  margin-bottom: 0.75rem;
}

/* Footer */
.footer {
  padding: 3rem 0;
  margin-top: 2rem;
  border-top: 1px solid rgba(191, 10, 48, 0.25);
  background: rgba(0, 0, 0, 0.35);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--color-secondary);
}

.footer a {
  color: var(--color-muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--color-secondary);
}

.footer ul {
  list-style: none;
}

.footer li {
  margin-bottom: 0.5rem;
}

.footer-meta {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* Utilities */
.text-center {
  text-align: center;
}

.mb-2 {
  margin-bottom: 2rem;
}

.mt-1 {
  margin-top: 1rem;
}
