/* ============================================================
   Surgescope Articles — shared styles
   Used by: articles/index.html and articles/*/index.html
   ============================================================ */

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

:root {
  --bg:       #06080d;
  --bg-deep:  #030508;
  --bg-card:  rgba(255,255,255,0.04);
  --border:   rgba(255,255,255,0.08);
  --text:     #edf3fb;
  --muted:    #96a8bc;
  --accent:   #3af0c7;
  --accent-glow: rgba(58, 240, 199, 0.35);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font: 'Manrope', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; background: var(--bg); }

body {
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.06), transparent 20%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 15%, var(--accent-glow), transparent 28%),
    radial-gradient(circle at 85% 75%, rgba(90,166,255,0.16), transparent 25%);
  opacity: 0.9;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Topbar (matches main site exactly) ────────────────── */

main, footer { position: relative; z-index: 1; }

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height, 88px);
  padding: 0 clamp(18px, 5vw, 80px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(7, 10, 15, 0.72);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.logo-slot {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  padding: 4px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 18px 40px rgba(0,0,0,0.25);
  overflow: hidden;
  flex-shrink: 0;
}

.logo-slot img { width: 100%; height: 100%; object-fit: contain; }

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title  { font-weight: 800; letter-spacing: 0.4px; }
.brand-subtitle { font-size: 12px; color: var(--muted); }

.topnav {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: var(--muted);
}

.topnav a {
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.topnav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.topnav a:hover { color: var(--text); }
.topnav a:hover::after { transform: scaleX(1); }

.top-cta { display: flex; gap: 12px; flex-shrink: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  white-space: nowrap;
  text-decoration: none;
  border: none;
  background: var(--accent);
  color: #080d12;
}

.btn:hover { opacity: 0.88; transform: translateY(-1px); }

.btn.ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
}

.btn.ghost:hover { background: rgba(255,255,255,0.1); }

.topbar-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.topbar-toggle span {
  width: 18px; height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.25s ease;
  display: block;
}

/* ── Container ─────────────────────────────────────────── */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* header-height offset is baked into each component's padding-top below */

/* ── Eyebrow ───────────────────────────────────────────── */

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   LISTING PAGE  (articles/index.html)
   ══════════════════════════════════════════════════════════ */

.listing-hero {
  padding: calc(var(--header-height, 88px) + clamp(32px, 5vw, 56px)) 0 clamp(32px, 5vw, 56px);
}

.listing-hero__eyebrow {
  margin-bottom: 12px;
}

.listing-hero__title {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.listing-hero__lead {
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding-bottom: clamp(48px, 8vw, 96px);
}

/* Article card */

.article-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  opacity: 0;
  transform: translateY(20px);
}

.article-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.2s, box-shadow 0.2s;
}

.article-card:hover {
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}

.article-card__cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

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

.article-card:hover .article-card__cover img {
  transform: scale(1.04);
}

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

.article-card__series {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.article-card__title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.article-card__excerpt {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.article-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.article-card__date {
  font-size: 12px;
  color: var(--muted);
}

.article-card__arrow {
  font-size: 13px;
  color: var(--accent);
  transition: transform 0.15s;
}

.article-card:hover .article-card__arrow {
  transform: translateX(4px);
}

/* ══════════════════════════════════════════════════════════
   ARTICLE PAGE  (articles/*/index.html)
   ══════════════════════════════════════════════════════════ */

.article-page {
  padding: calc(var(--header-height, 88px) + clamp(16px, 3vw, 32px)) 0 clamp(48px, 8vw, 96px);
}

/* White reading card */

.article-card-wrap {
  max-width: 740px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.2);
  color: #1a1e2a;
}

.article-hero-img {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  display: block;
}

.article-header {
  padding: 32px 40px 0;
}

.article-header .eyebrow {
  color: #3bbfb8;
  margin-bottom: 12px;
}

.article-header__series-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #8a9ab0;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.article-header__series-nav a {
  color: #3bbfb8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-header__title {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: #0d1117;
  margin-bottom: 12px;
}

.article-header__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: #8a9ab0;
  padding-bottom: 24px;
  border-bottom: 1px solid #e8edf3;
}

/* Article body typography */

.article-body {
  padding: 32px 40px 40px;
  font-size: 16px;
  line-height: 1.8;
  color: #1a1e2a;
}

.article-body p {
  margin-bottom: 1.2em;
}

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

.article-body h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #0d1117;
  margin: 2em 0 0.6em;
  padding-top: 0.5em;
  border-top: 2px solid #e8edf3;
}

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

.article-body h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0d1117;
  margin: 1.6em 0 0.5em;
}

.article-body strong {
  font-weight: 700;
  color: #0d1117;
}

.article-body em {
  font-style: italic;
  color: #3a4a60;
}

.article-body blockquote {
  margin: 1.5em 0;
  padding: 16px 20px;
  border-left: 3px solid #3bbfb8;
  background: #f4f8fb;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #3a4a60;
  font-style: italic;
}

.article-body ul,
.article-body ol {
  padding-left: 1.4em;
  margin-bottom: 1.2em;
}

.article-body li {
  margin-bottom: 0.4em;
}

.article-body a {
  color: #3bbfb8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body a:hover {
  color: #2aa39b;
}

/* DB entry block */

.db-entry {
  margin: 1.4em 0;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: #f4f8fb;
  border: 1px solid #e0e8ef;
}

.db-entry__name {
  font-size: 16px;
  font-weight: 800;
  color: #0d1117;
  margin-bottom: 6px;
}

.db-entry__meta {
  font-size: 13px;
  color: #8a9ab0;
  margin-bottom: 10px;
  line-height: 1.5;
}

.db-entry__meta a {
  color: #3bbfb8;
}

.db-entry__desc {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 0;
}

.db-entry__pros,
.db-entry__cons {
  margin-top: 10px;
}

.db-entry__pros-title,
.db-entry__cons-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.db-entry__pros-title { color: #27a880; }
.db-entry__cons-title { color: #e05a5a; }

.db-entry__pros ul,
.db-entry__cons ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.db-entry__pros li::before { content: "+  "; color: #27a880; font-weight: 700; }
.db-entry__cons li::before { content: "−  "; color: #e05a5a; font-weight: 700; }

/* Warning / tip callout */

.callout {
  margin: 1.5em 0;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 1.65;
}

.callout--tip {
  background: #edfaf8;
  border-left: 3px solid #3bbfb8;
  color: #1a4a45;
}

.callout--warn {
  background: #fff8ec;
  border-left: 3px solid #f0a040;
  color: #4a3010;
}

/* Article footer — series navigation */

.article-footer {
  padding: 24px 40px 32px;
  border-top: 1px solid #e8edf3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.article-footer__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #8a9ab0;
  transition: color 0.15s;
}

.article-footer__back:hover { color: #3bbfb8; }

.article-footer__next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #3bbfb8;
  transition: gap 0.15s;
}

.article-footer__next:hover { gap: 10px; }

/* ── Site footer ───────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ── Responsive ────────────────────────────────────────── */

/* ── Topbar mobile ─────────────────────────────────────── */

@media (max-width: 860px) {
  .topnav { display: none; }
}

@media (max-width: 640px) {
  .topbar {
    top: 12px;
    left: 12px;
    right: 12px;
    height: auto;
    padding: 10px 12px;
    border-radius: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .brand { min-width: 0; }
  .brand-subtitle { display: none; }

  .top-cta { display: none; grid-column: 1 / -1; }

  .topbar-toggle { display: inline-flex; }

  .topbar.is-open .topnav {
    display: grid;
    gap: 10px;
    padding-top: 8px;
    grid-column: 1 / -1;
  }

  .topbar.is-open .topnav a {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .topbar.is-open .top-cta {
    display: grid;
    gap: 10px;
    width: 100%;
    padding-top: 8px;
    grid-column: 1 / -1;
  }

  .topbar.is-open .topbar-toggle span:first-child {
    transform: translateY(3.5px) rotate(45deg);
  }
  .topbar.is-open .topbar-toggle span:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
  }

  .logo-slot { width: 42px; height: 42px; border-radius: 14px; }

  .article-page { padding-top: 86px !important; }
  .listing-hero { padding-top: 86px !important; }
}

@media (max-width: 600px) {
  .container {
    padding: 0 8px;
  }

  .article-page {
    padding-bottom: 40px;
  }

  .article-card-wrap {
    border-radius: 16px;
  }

  .article-header,
  .article-body,
  .article-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .article-header {
    padding-top: 20px;
  }

  .article-header__title {
    font-size: 20px;
  }

  .article-body {
    font-size: 15px;
    padding-top: 20px;
    padding-bottom: 24px;
  }

  .article-footer {
    padding-bottom: 20px;
  }

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

  .listing-hero {
    padding-bottom: 32px;
  }
}
