@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Lato:ital,wght@0,300;0,400;0,700;1,400&display=swap');

/*
  ================================================================
  Story Atlas Online — "CARTOGRAPHIC JOURNAL" Design System
  ================================================================
  Fonts   : Libre Baskerville (headings/display) + Lato (body) — unique pair
  Palette :
    --navy    #1E3A5F  deep atlas navy   ← dominant structural color
    --teal    #4E8098  map teal          ← links, borders, accents
    --brass   #D4A373  antique brass     ← CTA, highlights, badges
    --ivory   #F7F5F0  aged paper bg
    --dark    #2A2D34  near-black text
    --muted   #A3B1C6  secondary text
    --border  #E2DFD6  soft divider

  Unique differentiators vs all other domains:
  • Libre Baskerville + Lato — NOT used anywhere else
  • Dot-grid pattern on hero (cartographic paper feel)
  • Atlas-entry numbered article cards
  • Horizontal feature-block layout (icon-left, text-right)
  • Rectangular CTA with brass gradient (no pill, no shadow blur)
  • Navy solid header (not transparent/blur)
  • Ivory footer (not dark) with classic map-legend layout
  • "Chapter path" breadcrumb on article pages
  • Serif headings with brass underline accent rule
  • Cards: growing left-border on hover (navy → teal)
  ================================================================
*/

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

:root {
  --navy:       #1E3A5F;
  --navy-dk:    #152a44;
  --navy-lt:    #2e5280;
  --teal:       #4E8098;
  --teal-dk:    #3a6175;
  --teal-lt:    #e4eff4;
  --brass:      #D4A373;
  --brass-dk:   #b8845a;
  --brass-lt:   #fdf5ec;
  --ivory:      #F7F5F0;
  --ivory-dk:   #EDE9E1;
  --dark:       #2A2D34;
  --dark-soft:  #484e5c;
  --muted:      #A3B1C6;
  --border:     #E2DFD6;
  --white:      #ffffff;

  --max-w:      1200px;
  --text-w:     780px;
  --header-h:   68px;
  --r:          4px;
  --r-md:       8px;
  --t:          0.22s ease;
  --shadow:     0 2px 16px rgba(30,58,95,0.09);
  --shadow-md:  0 6px 28px rgba(30,58,95,0.14);
}

html { scroll-behavior: smooth; }

body {
  background: var(--ivory);
  color: var(--dark);
  font-family: 'Lato', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.78;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main { flex: 1; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

h1, h2, h3, h4 {
  font-family: 'Libre Baskerville', Georgia, serif;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p { margin-bottom: 1.1em; }
p:last-child { margin-bottom: 0; }

/* ═══════════════════════════════════
   READING PROGRESS BAR
═══════════════════════════════════ */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--brass));
  z-index: 9999;
  transition: width 0.1s linear;
  display: none;
}
body.is-article #reading-progress { display: block; }

/* ═══════════════════════════════════
   WRAPPER
═══════════════════════════════════ */
.wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}

/* ═══════════════════════════════════
   HEADER
═══════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  height: var(--header-h);
  background: var(--navy);
  border-bottom: 3px solid var(--brass);
  transition: box-shadow var(--t);
}

.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(30,58,95,0.35);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo img {
  height: 42px;
  width: auto;
  display: block;
  filter: invert(1) brightness(2);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  padding: 6px 14px;
  position: relative;
  transition: color var(--t);
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 14px; right: 14px;
  height: 2px;
  background: var(--brass);
  transform: scaleX(0);
  transition: transform var(--t);
}

.site-nav a:hover,
.site-nav a.active { color: var(--white); }

.site-nav a:hover::after,
.site-nav a.active::after { transform: scaleX(1); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t), width var(--t);
}

.hamburger span:nth-child(2) { width: 18px; }

.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile overlay */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--navy);
  z-index: 490;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity var(--t), transform var(--t);
  pointer-events: none;
}

.mobile-menu.is-open {
  opacity: 1;
  transform: none;
  pointer-events: all;
}

.mobile-menu a {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  color: var(--white);
  padding: 8px 0;
  transition: color var(--t);
}

.mobile-menu a:hover { color: var(--brass); }

/* ═══════════════════════════════════
   HERO — HOME (dot-grid bg)
═══════════════════════════════════ */
.hero {
  background: var(--navy);
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 8vw, 100px) 0 clamp(48px, 7vw, 88px);
}

/* Dot-grid cartographic pattern */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(78,128,152,0.25) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Brass accent line top */
.hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brass) 0%, var(--teal) 60%, transparent 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Lato', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 20px;
}

.hero-label::before {
  content: '';
  display: inline-block;
  width: 32px; height: 1px;
  background: var(--brass);
}

.hero-title {
  font-family: 'Libre Baskerville', serif;
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 22px;
}

.hero-title em {
  font-style: italic;
  color: var(--brass);
}

.hero-desc {
  font-size: 1.05rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.65);
  margin-bottom: 36px;
  max-width: 480px;
}

/* CTA Button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 13px 28px;
  border-radius: var(--r);
  transition: all var(--t);
  cursor: pointer;
}

.btn-brass {
  background: var(--brass);
  color: var(--navy);
  border: 2px solid var(--brass);
}

.btn-brass:hover {
  background: var(--brass-dk);
  border-color: var(--brass-dk);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212,163,115,0.35);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.35);
}

.btn-outline:hover {
  border-color: var(--brass);
  color: var(--brass);
}

.hero-image-wrap {
  position: relative;
}

.hero-image-wrap::before {
  content: '';
  position: absolute;
  inset: -10px;
  border: 2px solid rgba(212,163,115,0.45);
  border-radius: calc(var(--r-md) + 4px);
  pointer-events: none;
  z-index: 0;
}

.hero-image-wrap img {
  width: 100%;
  border-radius: var(--r-md);
  object-fit: cover;
  aspect-ratio: 4/3;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════
   SECTION DIVIDER / HEADING
═══════════════════════════════════ */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Lato', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}

.section-tag::before {
  content: '';
  display: inline-block;
  width: 24px; height: 1px;
  background: var(--teal);
}

.section-heading {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.view-all-link {
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  border-bottom: 1px solid var(--teal);
  padding-bottom: 2px;
  white-space: nowrap;
  transition: color var(--t), border-color var(--t);
}

.view-all-link:hover { color: var(--brass-dk); border-color: var(--brass-dk); }

/* ═══════════════════════════════════
   ARTICLES SECTION — HOME
═══════════════════════════════════ */
.articles-section {
  padding: clamp(48px, 6vw, 80px) 0;
}

/* Featured Article */
.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--white);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
  border-left: 5px solid var(--navy);
  transition: box-shadow var(--t), transform var(--t);
}

.featured-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.featured-card__image {
  overflow: hidden;
}

.featured-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.featured-card:hover .featured-card__image img { transform: scale(1.04); }

.featured-card__body {
  padding: clamp(24px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.entry-num {
  font-family: 'Lato', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.featured-card__body h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  color: var(--navy);
  line-height: 1.25;
}

.featured-card__body p {
  font-size: 0.97rem;
  color: var(--dark-soft);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0;
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  transition: gap var(--t), color var(--t);
  margin-top: auto;
}

.read-link::after { content: '→'; }
.read-link:hover { gap: 10px; color: var(--brass-dk); }

/* Article Grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.article-card {
  background: var(--white);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--t), transform var(--t);
  position: relative;
  border-left: 3px solid transparent;
  text-decoration: none;
  color: inherit;
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-left-color: var(--teal);
}

.article-card__image {
  overflow: hidden;
  aspect-ratio: 4/3;
}

.article-card__image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover .article-card__image img { transform: scale(1.05); }

.article-card__body {
  padding: 18px 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article-card__body .entry-num { margin-top: 0; }

.article-card__body h3 {
  font-size: 1rem;
  color: var(--navy);
  line-height: 1.35;
  flex: 1;
}

.article-card__body .read-link { font-size: 0.75rem; margin-top: 6px; }

/* ═══════════════════════════════════
   FEATURE BLOCKS (adding-blocks)
═══════════════════════════════════ */
.feature-blocks-section {
  background: var(--ivory-dk);
  padding: clamp(48px, 6vw, 80px) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.feature-blocks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 36px;
}

.feature-block {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 28px 20px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.feature-block__icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: var(--r);
}

.feature-block__title {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

/* ═══════════════════════════════════
   ARTICLES PAGE
═══════════════════════════════════ */
.page-header {
  background: var(--navy);
  padding: clamp(48px, 6vw, 72px) 0 clamp(32px, 4vw, 56px);
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(78,128,152,0.2) 1px, transparent 1px);
  background-size: 28px 28px;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brass), var(--teal) 60%, transparent);
}

.page-header__inner {
  position: relative;
  z-index: 1;
}

.page-header__label {
  font-family: 'Lato', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.page-header__label::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--brass);
  display: block;
}

.page-header h1 {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  color: var(--white);
}

.articles-list-section {
  padding: clamp(40px, 5vw, 64px) 0;
}

/* ═══════════════════════════════════
   ABOUT PAGE
═══════════════════════════════════ */
.about-section {
  padding: clamp(48px, 6vw, 80px) 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.about-aside {
  background: var(--navy);
  border-radius: var(--r-md);
  padding: clamp(28px, 4vw, 44px);
  color: var(--white);
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.about-aside-label {
  font-family: 'Lato', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.about-aside-label::before {
  content: '';
  width: 20px; height: 1px;
  background: var(--brass);
  display: block;
}

.about-aside h2 {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin-bottom: 20px;
  line-height: 1.3;
}

.about-aside p {
  font-size: 0.97rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.75;
}

.about-aside .rule {
  width: 40px; height: 2px;
  background: var(--brass);
  margin: 24px 0;
  border-radius: 1px;
}

.about-main { }

.text-content h2 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.35rem;
  color: var(--navy);
  margin: 2em 0 0.75em;
  padding-left: 14px;
  border-left: 3px solid var(--brass);
  line-height: 1.3;
}

.text-content h2:first-child { margin-top: 0; }

.text-content p {
  font-size: 1rem;
  color: var(--dark);
  line-height: 1.85;
}

/* ═══════════════════════════════════
   ARTICLE SINGLE PAGE
═══════════════════════════════════ */
.article-top {
  padding: clamp(40px, 5vw, 60px) 0 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Lato', sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--teal);
  font-weight: 700;
  transition: color var(--t);
}

.breadcrumb a:hover { color: var(--brass-dk); }

.breadcrumb .sep { color: var(--border); }

.article-kicker {
  font-family: 'Lato', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-kicker::before {
  content: '';
  width: 20px; height: 1px;
  background: var(--teal);
  display: block;
}

.article-top h1 {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(1.75rem, 3.5vw, 2.8rem);
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 0;
}

.article-hero-img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: var(--r-md);
  margin-top: 32px;
}

.article-body-section {
  padding: clamp(36px, 5vw, 56px) 0 clamp(48px, 6vw, 80px);
}

.article-body {
  max-width: var(--text-w);
  margin: 0 auto;
}

.article-body h2 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  margin: 2.2em 0 0.75em;
  padding-left: 14px;
  border-left: 3px solid var(--brass);
  line-height: 1.3;
}

.article-body h2:first-child { margin-top: 0; }

.article-body p {
  font-size: 1.02rem;
  line-height: 1.88;
  color: var(--dark);
  margin-bottom: 1.35em;
}

.article-body p:last-child { margin-bottom: 0; }

.article-body .article-image { display: none; }

.article-footer-nav {
  max-width: var(--text-w);
  margin: 40px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════
   FOOTER
═══════════════════════════════════ */
.site-footer {
  background: var(--ivory-dk);
  border-top: 3px solid var(--navy);
  padding: clamp(40px, 5vw, 64px) 0 28px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
  margin-bottom: 32px;
}

.footer-brand { }

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.footer-logo img { height: 38px; width: auto; }

.footer-tagline {
  font-size: 0.9rem;
  color: var(--dark-soft);
  max-width: 280px;
  line-height: 1.6;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.footer-nav a {
  font-family: 'Lato', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark-soft);
  transition: color var(--t);
}

.footer-nav a:hover { color: var(--teal); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-copyright {
  font-size: 0.82rem;
  color: var(--muted);
}

.footer-badge {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--teal);
}

/* ═══════════════════════════════════
   RESPONSIVE
═══════════════════════════════════ */
@media (max-width: 1024px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-blocks-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --header-h: 58px; }

  .site-nav { display: none; }
  .hamburger { display: flex; }
  .mobile-menu { display: flex; }

  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-image-wrap { order: -1; }
  .hero-image-wrap::before { inset: -8px; }

  .featured-card { grid-template-columns: 1fr; }
  .article-grid { grid-template-columns: 1fr; }
  .feature-blocks-grid { grid-template-columns: repeat(2, 1fr); }

  .about-grid { grid-template-columns: 1fr; }
  .about-aside { position: static; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-nav { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 8px 20px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 480px) {
  .feature-blocks-grid { grid-template-columns: 1fr; }
  .article-footer-nav { flex-direction: column; align-items: flex-start; }
}
