/* ============================================================
   THE TECH DIPLOMAT — Editorial components
   Load AFTER tokens.css and AFTER the existing styles.css
   (these intentionally override legacy rules during migration).
   ============================================================ */

/* ---------- Base type ---------- */
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 500;               /* Newsreader is confident at 500; 700 gets heavy */
  letter-spacing: -0.015em;
  line-height: 1.12;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: var(--step-2); }
h2, .section-title { font-size: var(--step-1); }

/* Italic serif for deks/pull-lines — Newsreader's italic is the brand voice */
.dek {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.35rem);
  color: var(--ink-2);
  max-width: 38ch;
  line-height: 1.5;
}

/* ---------- Kicker (mono metadata line) ----------
   Use above titles: section labels, card metadata, hero eyebrow. */
.kicker {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.kicker .sep { color: var(--seal); }   /* the · separators can carry the red */

/* Bilingual gloss under section titles (optional signature detail) */
.gloss {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-2);
  letter-spacing: 0.06em;
  margin-top: 0.4rem;
}

/* ---------- Links: animated underline ---------- */
.link-ed,
.about-intro-link,
.thought-link,
.footer-links a {
  color: var(--teal);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.35s var(--ease-out);
  padding-bottom: 1px;
}
.link-ed:hover, .link-ed:focus-visible,
.about-intro-link:hover, .about-intro-link:focus-visible,
.thought-link:hover, .thought-link:focus-visible,
.footer-links a:hover, .footer-links a:focus-visible {
  background-size: 100% 1px;
}

.link-quiet {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.25s var(--ease-out);
}
.link-quiet:hover, .link-quiet:focus-visible { border-color: var(--seal); }

/* ---------- Buttons ---------- */
.btn-ink {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 0.95rem 1.9rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.btn-ink:hover, .btn-ink:focus-visible {
  background: transparent;
  color: var(--ink);
}

.btn-ghost {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.95rem 1.9rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.25s var(--ease-out);
}
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--seal); }

/* ---------- Route-line section divider (Meridian echo) ----------
   <div class="route-divider" aria-hidden="true">
     <span class="route-tick"></span>
     <span class="route-coord">33.87°S 151.21°E</span>
   </div>                                                          */
.route-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: var(--space-section) auto 0;
  max-width: 1200px;
  padding: 0 2rem;
}
.route-divider::before,
.route-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.route-tick {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--seal);
  flex: none;
}
.route-coord {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  flex: none;
}

/* ---------- Masthead nav ---------- */
.sidebar-nav {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.sidebar-nav.scrolled {
  background: rgba(245, 241, 232, 0.92);
  backdrop-filter: blur(8px);
  border-bottom-color: var(--line);
  box-shadow: none;
}
.sidebar-menu a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--ink);
}
.sidebar-menu a:hover,
.sidebar-menu a:focus-visible,
.sidebar-menu a.active { color: var(--seal); }
.logo-text {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.sidebar-social a { color: var(--ink-2); }
.sidebar-social a:hover { color: var(--seal); }

/* ---------- Section rhythm ---------- */
.latest-thinking, .about-intro, .connect-section { padding: var(--space-section) 0; }
.linkedin-thoughts { padding: var(--space-section-tight) 0; }  /* ephemera weighted lighter */

.section-title { margin-bottom: 0.35rem; }
.section-title::after { content: none; }   /* remove legacy gradient underline */
.section-head { margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section-head .rule {
  width: 56px; height: 2px;
  background: var(--seal);
  margin-top: 0.9rem;
}

/* ---------- Dark "contrast moment" section (subscribe) ----------
   Add class="section-ink" to the subscribe <section> for the
   ink-on-paper inversion. Optional but recommended.            */
.section-ink {
  background: var(--ink);
  color: var(--paper);
}
.section-ink h2, .section-ink h3 { color: var(--paper); }
.section-ink p { color: rgba(245, 241, 232, 0.78); }
.section-ink .kicker { color: var(--teal-soft); }
.section-ink .connect-box { background: transparent; box-shadow: none; border: 1px solid var(--line-ink); }
.section-ink input {
  background: transparent;
  border: 1px solid var(--line-ink);
  color: var(--paper);
}
.section-ink input::placeholder { color: rgba(245, 241, 232, 0.5); }
.section-ink button[type="submit"] {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
}

/* ---------- Accessibility floor ---------- */
:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 10000;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
