/* ==========================================================================
   MyAVSolve — Shared Stylesheet
   Design tokens: Navy / Teal editorial system
   ========================================================================== */

:root {
  /* Color tokens */
  --navy-950: #0b1730;
  --navy-900: #0f1f3d;
  --navy-800: #16305c;
  --navy-700: #1f3f74;
  --navy-500: #3d5a8f;
  --slate-600: #4a5a72;
  --slate-400: #7c8aa0;
  --teal-500: #14b8a6;
  --teal-400: #2dd4c7;
  --teal-100: #e2fbf7;
  --paper-0: #ffffff;
  --paper-50: #f7f9fb;
  --paper-100: #eef2f6;
  --line: #e1e7ef;
  --ink: #16213a;
  --ink-soft: #46536a;
  --warn-bg: #fff7ed;
  --warn-border: #f3c98d;
  --warn-ink: #7a4a06;

  /* Type */
  --font-display: "Space Grotesk", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;

  /* Layout */
  --container: 1180px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--navy-800); text-decoration-color: var(--teal-500); }
a:hover { color: var(--teal-500); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy-900);
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 600; margin-top: 2.2em; }
h3 { font-size: 1.2rem; font-weight: 600; margin-top: 1.6em; }

p { margin: 0 0 1.1em; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--navy-900); color: #fff; padding: 10px 16px;
  z-index: 1000; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ---------------- Header ---------------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper-0);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy-900);
  letter-spacing: -0.02em;
}
.brand-name span { color: var(--teal-500); }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}
.main-nav a:hover, .main-nav a[aria-current="page"] {
  color: var(--navy-900);
  background: var(--paper-100);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; display: block; }

@media (max-width: 900px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 76px; left: 0; right: 0;
    background: var(--paper-0);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 8px 24px 20px;
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: inline-flex; align-items:center; justify-content:center; }
}

/* ---------------- Hero ---------------- */
.hero {
  background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 65%, var(--navy-800) 100%);
  color: #fff;
  padding: 72px 0 96px;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 2;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-400);
  font-weight: 600;
  margin-bottom: 18px;
}
.hero h1 { color: #fff; max-width: 15ch; }
.hero p.lede { color: #c7d2e4; font-size: 1.1rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-figure { position: relative; z-index: 2; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { order: -1; max-width: 280px; margin: 0 auto; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--teal-500); color: var(--navy-950); }
.btn-primary:hover { background: var(--teal-400); color: var(--navy-950); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.35); }
.btn-ghost:hover { border-color: var(--teal-400); color: var(--teal-400); }
.btn-outline { background: transparent; border-color: var(--navy-800); color: var(--navy-900); }
.btn-outline:hover { background: var(--navy-900); color: #fff; }

/* ---------------- Sections ---------------- */
.section { padding: 64px 0; }
.section-alt { background: var(--paper-50); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-kicker {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-500);
  display: block;
  margin-bottom: 8px;
}
.view-all {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--navy-800);
  white-space: nowrap;
}

/* Card grid */
.grid {
  display: grid;
  gap: 28px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: 0 12px 28px -18px rgba(15,31,61,0.35); transform: translateY(-2px); }
.card-media {
  aspect-ratio: 16/9;
  background: var(--paper-100);
}
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-cat {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-500);
}
.card-title { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; margin: 0; line-height: 1.35; }
.card-title a { color: var(--navy-900); text-decoration: none; }
.card-title a:hover { color: var(--teal-500); }
.card-excerpt { color: var(--ink-soft); font-size: 0.93rem; margin: 0; flex: 1; }
.card-meta { font-size: 0.8rem; color: var(--slate-400); display: flex; gap: 10px; margin-top: 4px; }

/* Featured big card */
.feature-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
}
.feature-card .card-media { aspect-ratio: auto; height: 100%; min-height: 260px; }
.feature-card .card-body { padding: 36px; justify-content: center; }
.feature-card .card-title { font-size: 1.6rem; }
@media (max-width: 800px) { .feature-card { grid-template-columns: 1fr; } .feature-card .card-media { height: 220px; } }

/* Topic pill grid */
.topic-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.topic-pill {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--navy-900);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}
.topic-pill svg { width: 30px; height: 30px; }
.topic-pill:hover { border-color: var(--teal-500); color: var(--teal-500); }
@media (max-width: 900px) { .topic-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .topic-grid { grid-template-columns: repeat(2, 1fr); } }

/* Newsletter */
.newsletter {
  background: var(--navy-900);
  border-radius: var(--radius-lg);
  padding: 44px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.newsletter h2 { color: #fff; margin: 0 0 8px; }
.newsletter p { color: #c7d2e4; margin: 0; }
.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter-form input[type="email"] {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  color: #fff;
  min-width: 240px;
}
.newsletter-form input::placeholder { color: #92a1bd; }
.newsletter-note { color: #92a1bd; font-size: 0.78rem; margin-top: 8px; }

/* ---------------- Article layout ---------------- */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--slate-400);
  padding: 20px 0 0;
}
.breadcrumb a { color: var(--slate-400); text-decoration: none; }
.breadcrumb a:hover { color: var(--teal-500); }

.article-head { padding: 18px 0 32px; border-bottom: 1px solid var(--line); }
.article-cat {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-500);
  background: var(--teal-100);
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.article-deck { font-size: 1.15rem; color: var(--ink-soft); max-width: 68ch; }
.article-byline {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
  font-size: 0.86rem;
  color: var(--slate-400);
}
.author-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--navy-800);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.85rem;
}
.article-byline strong { color: var(--ink); }

.article-hero { margin: 32px 0; border-radius: var(--radius-lg); overflow: hidden; }

.article-body-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  padding: 8px 0 56px;
}
@media (max-width: 900px) { .article-body-wrap { grid-template-columns: 1fr; } }

.toc {
  position: sticky;
  top: 96px;
  align-self: start;
  font-size: 0.86rem;
}
.toc-label { font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; color: var(--slate-400); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 7px 0 7px 16px;
  color: var(--ink-soft);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
}
.toc a:hover { color: var(--teal-500); border-left-color: var(--teal-500); }

.article-content { max-width: 74ch; font-size: 1.04rem; }
.article-content ul, .article-content ol { padding-left: 1.3em; }
.article-content li { margin-bottom: 0.5em; }
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 0.92rem;
}
.article-content th, .article-content td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.article-content th { background: var(--paper-100); font-family: var(--font-display); font-weight: 600; color: var(--navy-900); }
.article-content tr:nth-child(even) td { background: var(--paper-50); }
.article-content blockquote {
  border-left: 3px solid var(--teal-500);
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  color: var(--ink-soft);
  font-style: italic;
}
.callout {
  border: 1px solid var(--line);
  background: var(--paper-50);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin: 1.8em 0;
}
.callout h3 { margin-top: 0; }
.callout-disclosure {
  border-color: var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.callout-disclosure h3 { color: var(--warn-ink); }

.faq-item { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq-item h3 { margin: 0 0 8px; font-size: 1.02rem; }
.faq-item p { margin: 0; color: var(--ink-soft); }

.related-strip { border-top: 1px solid var(--line); padding-top: 40px; margin-top: 20px; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--navy-950); color: #b7c2d9; padding: 56px 0 28px; margin-top: 40px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand p { color: #8a97b3; font-size: 0.9rem; max-width: 32ch; }
.footer-col h4 { color: #fff; font-family: var(--font-display); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: #b7c2d9; text-decoration: none; font-size: 0.9rem; }
.footer-col a:hover { color: var(--teal-400); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 22px;
  font-size: 0.82rem;
  color: #7c88a3;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* Ad slot */
.ad-slot {
  border: 1px dashed var(--line);
  background: var(--paper-50);
  border-radius: var(--radius-md);
  text-align: center;
  padding: 14px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate-400);
  margin: 2em 0;
}

/* Page header (non-hero interior pages) */
.page-head { padding: 48px 0 32px; border-bottom: 1px solid var(--line); }
.page-head p { color: var(--ink-soft); font-size: 1.05rem; max-width: 62ch; }

/* Legal pages */
.legal-content { max-width: 76ch; padding: 8px 0 64px; }
.legal-content h2 { margin-top: 1.8em; }
.legal-content ul { padding-left: 1.3em; }
.legal-updated { color: var(--slate-400); font-size: 0.88rem; margin-bottom: 2em; }

/* 404 */
.error-page { text-align: center; padding: 100px 0; }
.error-page .code { font-family: var(--font-display); font-size: 6rem; color: var(--teal-500); font-weight: 700; margin-bottom: 0; }

/* Utility */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}
.mt-0 { margin-top: 0; }
