:root {
  --fg-red: #ef4444;
  --fg-red-dark: #b91c1c;
  --fg-ink: #111827;
  --fg-muted: #64748b;
  --fg-line: #e2e8f0;
  --fg-paper: #ffffff;
  --fg-wash: #f6f7f9;
}

body.blog-body {
  margin: 0;
  background: var(--fg-wash);
  color: var(--fg-ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.fg-shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }

.fg-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid rgba(226, 232, 240, .9);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
}

.fg-header-row { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.fg-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg-ink); font-size: 1.18rem; font-weight: 850; text-decoration: none; letter-spacing: -.03em; }
.fg-brand-mark { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 11px; background: #ef4444; color: #fff; box-shadow: 0 9px 24px rgba(239, 68, 68, .23); font-size: 1.2rem; }
.fg-nav { display: none; align-items: center; gap: 26px; }
.fg-nav > a, .fg-nav summary { color: #172033; font-size: .96rem; font-weight: 650; text-decoration: none; }
.fg-nav > a:hover, .fg-nav > a[aria-current="page"], .fg-nav summary:hover { color: var(--fg-red-dark); }
.fg-nav details { position: relative; }
.fg-nav summary { cursor: pointer; list-style: none; }
.fg-nav summary::-webkit-details-marker { display: none; }
.fg-nav summary::after { content: "⌄"; margin-left: 6px; }
.fg-nav-menu { position: absolute; top: calc(100% + 15px); left: -18px; width: 230px; padding: 10px; border: 1px solid var(--fg-line); border-radius: 14px; background: #fff; box-shadow: 0 18px 44px rgba(15, 23, 42, .14); }
.fg-nav-menu a { display: block; border-radius: 9px; padding: 10px; color: #334155; font-size: .9rem; font-weight: 600; text-decoration: none; }
.fg-nav-menu a:hover { background: #fff1f2; color: var(--fg-red-dark); }

.fg-menu-button { display: inline-grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--fg-line); border-radius: 10px; background: #fff; color: var(--fg-ink); cursor: pointer; }
.fg-mobile-nav { border-top: 1px solid var(--fg-line); background: #fff; }
.fg-mobile-nav[hidden] { display: none; }
.fg-mobile-nav-inner { display: grid; gap: 4px; padding-block: 12px 20px; }
.fg-mobile-nav a, .fg-mobile-nav summary { display: block; border-radius: 9px; padding: 11px 12px; color: #1e293b; font-weight: 700; text-decoration: none; }
.fg-mobile-nav a:hover, .fg-mobile-nav a[aria-current="page"] { background: #fff1f2; color: var(--fg-red-dark); }
.fg-mobile-nav details { border-radius: 10px; background: #f8fafc; }
.fg-mobile-nav summary { cursor: pointer; }
.fg-mobile-subnav { display: grid; padding: 0 8px 8px 20px; }

.blog-main { overflow: clip; }
.blog-hero { position: relative; isolation: isolate; padding: 76px 0 68px; background: #fff; }
.blog-hero::before { content: ""; position: absolute; z-index: -1; inset: 0; background: radial-gradient(circle at 12% 10%, rgba(239,68,68,.15), transparent 28%), radial-gradient(circle at 88% 72%, rgba(15,23,42,.07), transparent 25%), linear-gradient(120deg, transparent 0 48%, rgba(239,68,68,.035) 48% 50%, transparent 50% 100%); }
.blog-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; color: var(--fg-muted); font-size: .88rem; }
.blog-breadcrumb a { color: var(--fg-red-dark); font-weight: 700; text-decoration: none; }
.blog-hero-copy { max-width: 780px; margin: 36px auto 0; text-align: center; }
.blog-kicker { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #fecdd3; border-radius: 999px; background: #fff1f2; color: var(--fg-red-dark); padding: 7px 12px; font-size: .78rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.blog-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--fg-red); box-shadow: 0 0 0 4px rgba(239,68,68,.12); }
.blog-hero h1 { margin: 20px 0 0; color: #0f172a; font-size: clamp(2.35rem, 7vw, 4.6rem); line-height: .99; letter-spacing: -.055em; }
.blog-hero p { max-width: 680px; margin: 22px auto 0; color: #526076; font-size: clamp(1rem, 2vw, 1.15rem); line-height: 1.75; }

.blog-search { display: flex; max-width: 720px; margin: 34px auto 0; padding: 7px; border: 1px solid var(--fg-line); border-radius: 15px; background: #fff; box-shadow: 0 14px 36px rgba(15,23,42,.08); }
.blog-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.blog-search input { min-width: 0; flex: 1; border: 0; background: transparent; padding: 12px 14px; color: var(--fg-ink); font: inherit; }
.blog-search input:focus { outline: 0 !important; }
.blog-search button { border: 0; border-radius: 10px; background: var(--fg-red); color: #fff; padding: 12px 18px; font-weight: 800; cursor: pointer; }
.blog-search button:hover { background: var(--fg-red-dark); }
.search-status { min-height: 24px; margin: 10px auto 0; color: var(--fg-muted); font-size: .9rem; text-align: center; }

.blog-directory { padding: 62px 0 88px; }
.blog-layout { display: grid; gap: 36px; }
.blog-section-heading { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.blog-section-heading h2 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.35rem); letter-spacing: -.035em; }
.blog-section-heading::after { content: ""; height: 1px; flex: 1; background: var(--fg-line); }
.blog-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }

.blog-card { min-height: 470px; }
.blog-card[hidden] { display: none; }
.blog-card-link { position: relative; display: flex; min-height: 100%; overflow: hidden; border-radius: 22px; background: #0f172a; color: #fff; text-decoration: none; box-shadow: 0 15px 38px rgba(15,23,42,.16); transform: translateY(0); transition: transform .25s ease, box-shadow .25s ease; }
.blog-card-link:hover { transform: translateY(-5px); box-shadow: 0 24px 48px rgba(15,23,42,.22); }
.blog-card-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .55s ease; }
.blog-card-link:hover .blog-card-media { transform: scale(1.045); }
.blog-card-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(2,6,23,.96) 0, rgba(2,6,23,.72) 43%, rgba(2,6,23,.12) 78%); }
.blog-card-content { position: relative; z-index: 1; align-self: end; padding: 26px; }
.blog-tag { display: inline-flex; border-radius: 999px; background: rgba(255,255,255,.94); color: #991b1b; padding: 7px 10px; font-size: .73rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.blog-card h3 { margin: 15px 0 0; font-size: 1.65rem; line-height: 1.12; letter-spacing: -.035em; }
.blog-card-description { margin: 12px 0 0; color: #e2e8f0; line-height: 1.6; }
.blog-card-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 18px; color: #cbd5e1; font-size: .82rem; }
.blog-card-read { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; color: #fff; font-weight: 850; }
.blog-card-read::after { content: "→"; transition: transform .2s ease; }
.blog-card-link:hover .blog-card-read::after { transform: translateX(4px); }

.blog-sidebar { align-self: start; }
.sidebar-panel { border: 1px solid var(--fg-line); border-radius: 20px; background: #fff; padding: 22px; box-shadow: 0 12px 32px rgba(15,23,42,.07); }
.sidebar-title { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 1.2rem; }
.sidebar-title::after { content: ""; height: 1px; flex: 1; background: var(--fg-line); }
.mini-card { display: grid; grid-template-columns: 92px 1fr; gap: 14px; margin-top: 20px; color: var(--fg-ink); text-decoration: none; }
.mini-card img { width: 92px; height: 88px; border-radius: 12px; object-fit: cover; }
.mini-card time { color: var(--fg-muted); font-size: .76rem; }
.mini-card strong { display: block; margin-top: 5px; line-height: 1.35; }
.sidebar-note { margin: 24px 0 0; border-radius: 16px; background: #0f172a; color: #e2e8f0; padding: 20px; line-height: 1.6; }
.sidebar-note a { color: #fecaca; font-weight: 800; }
.no-results { margin-top: 22px; border: 1px dashed #fda4af; border-radius: 16px; background: #fff1f2; color: #881337; padding: 22px; text-align: center; }
.no-results[hidden] { display: none; }

.article-hero { background: #0f172a; color: #fff; }
.article-hero-grid { display: grid; min-height: 560px; }
.article-hero-copy { align-self: center; padding-block: 60px; }
.article-hero .blog-breadcrumb { color: #cbd5e1; }
.article-hero .blog-breadcrumb a { color: #fecaca; }
.article-hero h1 { max-width: 850px; margin: 24px 0 0; font-size: clamp(2.35rem, 7vw, 4.8rem); line-height: 1; letter-spacing: -.055em; }
.article-dek { max-width: 720px; margin: 22px 0 0; color: #cbd5e1; font-size: 1.12rem; line-height: 1.7; }
.article-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 28px; color: #e2e8f0; font-size: .9rem; }
.article-image { min-height: 320px; background: #111827; }
.article-image img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; }
.article-layout { display: grid; gap: 38px; padding-block: 62px 90px; }
.article-copy { min-width: 0; }
.article-copy > p, .article-copy li { color: #475569; font-size: 1.03rem; line-height: 1.8; }
.article-copy h2 { margin: 2.25em 0 .65em; color: #0f172a; font-size: clamp(1.7rem, 4vw, 2.35rem); letter-spacing: -.035em; }
.article-copy h3 { margin: 1.7em 0 .5em; color: #1e293b; font-size: 1.25rem; }
.article-copy ul, .article-copy ol { padding-left: 1.4rem; }
.article-copy a { color: var(--fg-red-dark); font-weight: 700; }
.article-aside { align-self: start; }
.article-toc { border: 1px solid var(--fg-line); border-radius: 18px; background: #fff; padding: 22px; }
.article-toc h2 { margin: 0; font-size: 1.1rem; }
.article-toc ol { display: grid; gap: 9px; margin: 16px 0 0; padding-left: 1.2rem; }
.article-toc a { color: #475569; font-size: .92rem; font-weight: 650; text-decoration: none; }
.article-toc a:hover { color: var(--fg-red-dark); }
.article-callout { margin: 28px 0; border-left: 4px solid var(--fg-red); border-radius: 0 14px 14px 0; background: #fff1f2; color: #881337; padding: 20px; line-height: 1.7; }
.progression-table { width: 100%; border-collapse: collapse; margin: 24px 0; background: #fff; }
.progression-table caption { padding: 0 0 10px; color: #334155; font-weight: 800; text-align: left; }
.progression-table th, .progression-table td { border: 1px solid var(--fg-line); padding: 12px; text-align: left; vertical-align: top; }
.progression-table th { background: #f8fafc; }
.article-faq details { margin-top: 10px; border: 1px solid var(--fg-line); border-radius: 12px; background: #fff; padding: 14px 16px; }
.article-faq summary { cursor: pointer; font-weight: 800; }
.related-grid { display: grid; gap: 14px; }
.related-link { display: block; border: 1px solid var(--fg-line); border-radius: 14px; background: #fff; color: #0f172a !important; padding: 18px; text-decoration: none; }
.related-link:hover { border-color: #fda4af; transform: translateY(-2px); }

.fg-footer { background: #151a21; color: #cbd5e1; padding: 48px 0 22px; }
.fg-footer-grid { display: grid; gap: 34px; }
.fg-footer h2, .fg-footer h3 { margin: 0 0 12px; color: #fff; }
.fg-footer p { color: #94a3b8; line-height: 1.7; }
.fg-footer a { color: #e2e8f0; }
.fg-footer-links { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.fg-footer-bottom { margin-top: 30px; border-top: 1px solid #303846; padding-top: 20px; color: #94a3b8; font-size: .9rem; }

@media (min-width: 760px) {
  .fg-footer-grid { grid-template-columns: 1.3fr 1fr; }
  .article-hero-grid { grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr); }
  .article-hero-copy { padding-right: 42px; }
  .article-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .article-aside { position: sticky; top: 96px; }
  .related-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .fg-nav { display: flex; }
  .fg-menu-button, .fg-mobile-nav { display: none !important; }
  .blog-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 560px) {
  .fg-shell { width: min(100% - 24px, 1180px); }
  .blog-hero { padding-block: 50px; }
  .blog-search { display: grid; }
  .blog-search button { width: 100%; }
  .blog-card { min-height: 430px; }
  .blog-card-content { padding: 21px; }
  .article-hero h1 { font-size: 2.5rem; }
  .progression-table { display: block; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card-link, .blog-card-media, .blog-card-read::after, .related-link { transition: none; }
}
