/* NadlaNation – site styles (RTL, logical properties) */
:root {
  --brand: #1374b3;        /* logo blue, darkened for AA text contrast */
  --brand-bright: #2a9fd8; /* logo blue as-is, for fills */
  --brand-ink: #0c4a73;
  --accent: #9e1b22;       /* logo red */
  --ink: #14202b;
  --ink-2: #334150;
  --muted: #5e6b78;
  --line: #e4e0d8;
  --paper: #faf8f4;
  --surface: #ffffff;
  --navy: #0e2233;
  --navy-2: #163249;
  --ok: #1d7a46;
  --warn-bg: #fff6e5;
  --warn-line: #f0d39a;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 32, 43, .06), 0 8px 24px rgba(20, 32, 43, .06);
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --font-sans: "Assistant", "Segoe UI", Arial, sans-serif;
  --font-serif: "Frank Ruhl Libre", "David", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-sans); font-size: 17px; line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-ink); }
:focus-visible { outline: 3px solid var(--brand-bright); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.25; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 4.2vw, 46px); font-weight: 900; letter-spacing: -.01em; }
h2 { font-size: clamp(24px, 2.8vw, 32px); font-weight: 700; }
h3 { font-size: 21px; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font: 700 16px/1 var(--font-sans); padding: 13px 22px; border-radius: 999px;
  border: 2px solid transparent; text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #7d141a; color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: #e9f3fa; color: var(--navy); }
.btn-outline-light { border-color: rgba(255,255,255,.45); color: #fff; }
.btn-outline-light:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.08); }
.btn-sm { padding: 9px 16px; font-size: 15px; }
.chip {
  display: inline-block; padding: 4px 12px; border-radius: 999px; background: #eaf3f9; color: var(--brand-ink);
  font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.chip:hover { background: #d7e9f5; color: var(--brand-ink); }
.chip.is-active { background: var(--brand); color: #fff; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.kicker { font-size: 14px; font-weight: 800; letter-spacing: .02em; color: var(--accent); text-transform: uppercase; }

/* ---------- header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-bar { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand img { width: 46px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: "Assistant", sans-serif; font-weight: 800; font-size: 24px; color: var(--brand); letter-spacing: -.01em; direction: ltr; }
.brand-sub { font-size: 13px; color: var(--muted); font-weight: 600; }
.main-nav { margin-inline-start: auto; }
.main-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.main-nav a, .nav-topics-btn {
  display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2);
  font-weight: 700; font-size: 16px; background: none; border: 0; font-family: inherit; cursor: pointer;
}
.main-nav a:hover, .nav-topics-btn:hover, .main-nav a[aria-current="page"] { background: #f1eee8; color: var(--ink); }
.main-nav .nav-cta { background: var(--accent); color: #fff; margin-inline-start: 6px; }
.main-nav .nav-cta:hover { background: #7d141a; color: #fff; }
.has-dropdown { position: relative; }
.dropdown {
  position: absolute; inset-inline-start: 0; top: calc(100% + 6px); min-width: 260px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; list-style: none; margin: 0;
  display: none;
}
.has-dropdown.is-open .dropdown { display: block; }
.dropdown a { font-weight: 600; }
.dropdown small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.header-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.menu-toggle { display: none; }
.topic-bar { border-top: 1px solid var(--line); background: var(--surface); }
.topic-bar ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.topic-bar a { display: block; padding: 9px 14px; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.topic-bar a:hover, .topic-bar a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.search-panel { display: none; border-top: 1px solid var(--line); background: var(--surface); padding: 14px 0; }
.search-panel.is-open { display: block; }
.search-form { display: flex; gap: 8px; }
.search-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper);
}

@media (max-width: 980px) {
  .menu-toggle { display: inline-grid; }
  .main-nav {
    display: none; position: absolute; inset-inline: 0; top: 100%; background: var(--surface);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: 8px var(--gutter) 16px;
  }
  .main-nav.is-open { display: block; }
  .main-nav > ul { flex-direction: column; align-items: stretch; }
  .main-nav a, .nav-topics-btn { padding: 12px; width: 100%; text-align: start; }
  .main-nav .nav-cta { margin: 6px 0 0; text-align: center; }
  .dropdown { position: static; box-shadow: none; border: 0; padding: 0 12px 0 0; display: block; }
  .dropdown small { display: none; }
  .header-tools { margin-inline-start: auto; }
  .brand-sub { display: none; }
}

/* ---------- hero (home) ---------- */
.hero { background: radial-gradient(1200px 500px at 85% -10%, #1d4c70 0%, transparent 60%), linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 48px; align-items: center; padding-block: clamp(40px, 7vw, 84px); }
.hero h1 { color: #fff; font-size: clamp(34px, 5vw, 58px); margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: #8fd0f2; }
.hero-lead { font-size: clamp(18px, 1.6vw, 21px); color: #cfdbe6; max-width: 46ch; margin-bottom: 26px; }
.hero .search-form input { background: #fff; border-color: transparent; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero-stats { display: flex; gap: 28px; margin-top: 30px; flex-wrap: wrap; }
.hero-stats div { font-size: 14px; color: #a9bccd; }
.hero-stats strong { display: block; font-family: var(--font-serif); font-size: 30px; color: #fff; line-height: 1.1; }
.expert-card {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 20px; padding: 28px;
  backdrop-filter: blur(4px);
}
.expert-card .kicker { color: #f1a3a7; }
.expert-head { display: flex; gap: 16px; align-items: center; margin: 10px 0 14px; }
.avatar {
  width: 76px; height: 76px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, var(--brand-bright), var(--accent)); color: #fff; font: 800 26px/1 var(--font-serif);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 132px; height: 132px; font-size: 44px; }
.expert-card h2 { color: #fff; font-size: 24px; margin: 0; }
.expert-card .role { color: #a9bccd; font-size: 15px; }
.expert-card p { color: #dbe5ee; }
.expert-card a.more { color: #8fd0f2; font-weight: 700; }

/* ---------- sections ---------- */
.section { padding-block: clamp(40px, 6vw, 72px); }
.section-tight { padding-block: 32px; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.link-more { font-weight: 700; text-decoration: none; white-space: nowrap; }
.link-more::after { content: " ←"; }

/* topic tiles */
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.topic-tile {
  display: flex; gap: 16px; align-items: flex-start; padding: 22px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.topic-tile:hover { border-color: var(--brand); color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); }
.topic-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: #eaf3f9; color: var(--brand); flex-shrink: 0; }
.topic-icon svg { width: 26px; height: 26px; }
.topic-tile h3 { margin: 0 0 4px; font-size: 20px; }
.topic-tile p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.topic-tile .count { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--accent); }

/* article cards */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: box-shadow .15s, transform .15s; position: relative;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-media { aspect-ratio: 16 / 9; background: #e9eef2; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-meta { font-size: 14px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card-meta .cat { color: var(--accent); font-weight: 800; text-decoration: none; position: relative; z-index: 2; }
.card h3 { font-size: 20px; margin: 0; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card h3 a:hover { color: var(--brand-ink); }
.card p { color: var(--ink-2); font-size: 15.5px; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.feature { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-bottom: 24px; }
.card-lead .card-media { aspect-ratio: 16 / 8.5; }
.card-lead h3 { font-size: clamp(24px, 2.6vw, 32px); }
.card-lead p { -webkit-line-clamp: 4; font-size: 17px; }
.feature-side { display: grid; gap: 16px; align-content: start; }
.mini { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.mini:hover { border-color: var(--brand); color: var(--ink); }
.mini img { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; display: block; }
.mini strong { font-family: var(--font-serif); font-size: 17px; line-height: 1.35; display: block; }
.mini span { font-size: 13px; color: var(--muted); }

/* start-here path */
.path { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 28px; }
.path li { counter-increment: step; }
.path a { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line); text-decoration: none; color: var(--ink); }
.path a::before {
  content: counter(step); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font: 700 16px/1 var(--font-serif);
}
.path a:hover strong { color: var(--brand-ink); text-decoration: underline; }
.path strong { font-weight: 700; font-size: 17px; }
.path small { display: block; color: var(--muted); font-size: 14px; }

/* expert band */
.expert-band { display: grid; grid-template-columns: auto 1fr auto; gap: 32px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(22px, 4vw, 40px); }
.expert-band h2 { margin-bottom: 6px; }
.expert-band p { color: var(--ink-2); margin: 0; max-width: 62ch; }

/* sponsored projects */
.projects-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.project-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; position: relative; }
.project-card .card-media { aspect-ratio: 16 / 10; }
.project-card .pc-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.project-card h3 { font-size: 19px; margin: 0; }
.project-card .pc-loc { color: var(--muted); font-size: 14px; }
.project-card .pc-facts { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.project-card .pc-facts b { color: var(--ink); }
.project-card p { font-size: 15px; color: var(--ink-2); margin: 0; }
.project-card .btn { margin-top: auto; align-self: flex-start; }
.sponsored-tag { position: absolute; top: 10px; inset-inline-start: 10px; background: rgba(14,34,51,.85); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.projects-compact .project-card { flex-direction: row; }
.projects-compact .card-media { width: 110px; aspect-ratio: auto; flex-shrink: 0; }
.projects-compact .pc-body { padding: 10px 12px; }
.projects-compact h3 { font-size: 16px; }
.projects-compact p, .projects-compact .pc-facts { display: none; }
.projects-compact .btn { padding: 6px 12px; font-size: 14px; }
.projects-compact .sponsored-tag { display: none; }
.projects-compact { display: grid; gap: 10px; }
.widget-label { font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 8px; display: flex; justify-content: space-between; }
.advertise-cta {
  border: 2px dashed #c9d7e2; border-radius: var(--radius); padding: 22px; text-align: center; background: #f6fafc;
}
.advertise-cta h3 { font-size: 19px; margin-bottom: 6px; }
.advertise-cta p { color: var(--muted); font-size: 15px; margin-bottom: 12px; }

/* ads */
.ad { margin: 28px 0; text-align: center; }
.ad-label { display: block; font-size: 11px; letter-spacing: .08em; color: #8a949d; margin-bottom: 4px; }
.ad-placeholder { border: 1px dashed #c8c3b9; border-radius: 10px; min-height: 120px; display: grid; place-items: center; color: #8a949d; font-size: 14px; background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(0,0,0,.015) 10px 20px); }
.ad-sidebar .ad-placeholder { min-height: 250px; }

/* newsletter */
.newsletter { background: linear-gradient(150deg, var(--navy), var(--navy-2)); color: #fff; border-radius: 20px; padding: clamp(24px, 4vw, 44px); display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; }
.newsletter h2 { color: #fff; margin-bottom: 6px; }
.newsletter p { color: #c6d3df; margin: 0; }
.newsletter form { display: flex; gap: 8px; flex-wrap: wrap; }
.newsletter input[type=text], .newsletter input[type=email] { flex: 1 1 180px; font: inherit; padding: 12px 16px; border-radius: 999px; border: 0; min-width: 0; }
.newsletter .form-note { color: #a9bccd; font-size: 13px; flex-basis: 100%; margin: 4px 0 0; }
.newsletter .form-note a { color: #cfe8f6; }
.newsletter-sm { grid-template-columns: 1fr; padding: 22px; gap: 14px; }
.newsletter-sm h2 { font-size: 21px; }

/* ---------- page header / breadcrumbs ---------- */
.page-head { padding-block: clamp(28px, 5vw, 56px) 24px; }
.page-head p.lead { font-size: 19px; color: var(--ink-2); max-width: 70ch; }
.breadcrumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li:not(:last-child)::after { content: "›"; margin-inline-start: 6px; color: #b0b7be; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- article ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; padding-bottom: 56px; }
.article-head { padding-top: clamp(24px, 4vw, 44px); }
.article-head h1 { margin-bottom: 14px; }
.dek { font-size: clamp(19px, 1.8vw, 22px); line-height: 1.55; color: var(--ink-2); margin-bottom: 20px; font-family: var(--font-serif); }
.byline { display: flex; align-items: center; gap: 12px; padding-block: 14px; border-block: 1px solid var(--line); font-size: 15px; color: var(--muted); flex-wrap: wrap; }
.byline .avatar { width: 44px; height: 44px; font-size: 16px; }
.byline a { font-weight: 700; color: var(--ink); text-decoration: none; }
.byline a:hover { text-decoration: underline; }
.byline .sep { color: #c3c9cf; }
.article-hero { margin: 24px 0 8px; border-radius: var(--radius); overflow: hidden; }
.article-hero img { width: 100%; height: auto; display: block; }
.article-hero.is-contained { background: #f1eee8; text-align: center; }
.article-hero.is-contained img { display: inline-block; width: auto; max-width: 100%; max-height: 560px; vertical-align: middle; }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 12px 16px; font-size: 15px; color: #6b4a0b; margin: 20px 0; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 24px 0; }
.toc summary { font-weight: 800; cursor: pointer; }
.toc ol { margin: 10px 0 0; padding-inline-start: 22px; }
.toc li { margin: 4px 0; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--brand); text-decoration: underline; }

.prose { font-size: 19px; line-height: 1.85; color: #1d2a36; }
.prose > * { max-width: 72ch; }
.prose h2 { margin-top: 1.8em; font-size: clamp(24px, 2.4vw, 29px); }
.prose h3 { margin-top: 1.5em; font-size: 22px; }
.prose h4 { margin-top: 1.4em; font-size: 19px; font-family: var(--font-sans); font-weight: 800; }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .45em; }
.prose blockquote { margin: 1.4em 0; padding: 4px 22px; border-inline-start: 4px solid var(--accent); color: var(--ink-2); font-family: var(--font-serif); font-size: 21px; }
.prose img { border-radius: 10px; }
.prose img.alignleft { float: left; margin: 6px 24px 14px 0; max-width: 45%; }
.prose img.alignright { float: right; margin: 6px 0 14px 24px; max-width: 45%; }
.prose img.aligncenter, .prose img.alignnone { display: block; margin: 1.2em auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: 16px; margin: 1.4em 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: start; }
.prose th { background: #f1eee8; }
.prose iframe { width: 100%; max-width: 100%; aspect-ratio: 16/10; height: auto; border: 0; border-radius: 10px; }
.prose a { word-break: break-word; }
.prose::after { content: ""; display: block; clear: both; }
@media (max-width: 640px) {
  .prose { font-size: 18px; }
  .prose img.alignleft, .prose img.alignright { float: none; margin: 1em auto; max-width: 100%; display: block; }
}
.article-foot { margin-top: 32px; display: grid; gap: 22px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); }
.tags span.tag { background: #f1eee8; color: var(--ink-2); padding: 3px 10px; border-radius: 999px; font-size: 14px; }
.share { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.share-label { font-weight: 700; margin-inline-end: 4px; }
.share a, .share button { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--ink-2); color: var(--ink); }
.share svg { width: 18px; height: 18px; }
.disclaimer { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
.author-box { display: grid; grid-template-columns: auto 1fr; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; align-items: center; }
.author-box h2 { font-size: 21px; margin: 0 0 2px; }
.author-box p { margin: 0 0 6px; color: var(--ink-2); font-size: 16px; }
.sidebar { position: sticky; top: 140px; display: grid; gap: 22px; padding-top: clamp(24px, 4vw, 44px); }
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.side-box h2 { font-size: 18px; margin-bottom: 10px; font-family: var(--font-sans); font-weight: 800; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { border-bottom: 1px solid var(--line); }
.side-list li:last-child { border: 0; }
.side-list a { display: block; padding: 9px 0; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15.5px; line-height: 1.4; }
.side-list a:hover { color: var(--brand); }
.related { padding-block: 48px; border-top: 1px solid var(--line); background: var(--surface); }

/* ---------- articles index ---------- */
.filter-bar { display: grid; gap: 14px; margin-bottom: 28px; }
.list-empty { padding: 40px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.sub-cats { margin-top: 8px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.field input, .field textarea, .field select {
  font: inherit; font-size: 16px; padding: 11px 14px; border-radius: 10px; border: 1px solid #cfc9bf; background: #fff; color: var(--ink); width: 100%;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); outline: 2px solid #bfe0f3; outline-offset: 0; }
.hp { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.checkbox input { margin-top: 5px; width: 18px; height: 18px; }
.form-status { padding: 12px 16px; border-radius: 10px; font-weight: 600; display: none; }
.form-status.is-ok { display: block; background: #e6f4ec; color: var(--ok); }
.form-status.is-err { display: block; background: #fdecec; color: #a12a2a; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 4vw, 36px); }

/* ---------- about ---------- */
.about-hero { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; }
.about-hero .role { color: var(--accent); font-weight: 800; }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.principle { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.principle h3 { font-size: 19px; }
.principle p { margin: 0; color: var(--ink-2); font-size: 16px; }
.expertise { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.expertise-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.expertise-item header { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.expertise-item h3 { margin: 0; font-size: 20px; }
.expertise-item h3 a { color: var(--ink); text-decoration: none; }
.expertise-item ul { margin: 0; padding-inline-start: 18px; font-size: 15.5px; }
.expertise-item li { margin: 4px 0; }
.expertise-item .count { margin-inline-start: auto; font-size: 13px; color: var(--accent); font-weight: 800; white-space: nowrap; }
.timeline { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 40px; }
.timeline li { break-inside: avoid; padding: 8px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 90px 1fr; gap: 12px; font-size: 16px; }
.timeline time { color: var(--muted); font-size: 14px; }
.timeline a { color: var(--ink); text-decoration: none; font-weight: 600; }
.timeline a:hover { color: var(--brand); text-decoration: underline; }

/* ---------- advertise ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; counter-increment: s; }
.step::before { content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; margin-bottom: 10px; }
.step h3 { font-size: 18px; }
.step p { margin: 0; font-size: 15.5px; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fact { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 22px; }
.fact strong { display: block; font: 900 34px/1.1 var(--font-serif); color: #8fd0f2; }
.fact span { color: #c6d3df; font-size: 15px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy); color: #c6d3df; padding-block: 56px 28px; margin-top: 0; font-size: 15.5px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h2 { color: #fff; font: 800 16px/1.3 var(--font-sans); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: #dbe5ee; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-brand .brand-name { color: #fff; }
.footer-brand .brand { margin-bottom: 12px; }
.footer-brand .brand img { background: #fff; border-radius: 10px; padding: 4px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: #93a6b8; }

/* ---------- consent ---------- */
.consent {
  position: fixed; inset-inline: 16px; bottom: 16px; z-index: 80; max-width: 720px; margin-inline: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.18);
  padding: 18px 20px; display: none; gap: 14px; align-items: center; font-size: 15px;
}
.consent.is-open { display: flex; }
.consent p { margin: 0; flex: 1; }
.consent .btns { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding-block: 80px; }
.notfound .big { font: 900 96px/1 var(--font-serif); color: var(--brand); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; padding-top: 0; }
}
@media (max-width: 900px) {
  .hero-grid, .feature, .newsletter, .two-col { grid-template-columns: 1fr; }
  .topic-grid, .card-grid, .projects-strip, .principles { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .expert-band { grid-template-columns: auto 1fr; }
  .expert-band .btn { grid-column: 1 / -1; justify-self: start; }
  .timeline { columns: 1; }
}
@media (max-width: 640px) {
  .topic-grid, .card-grid, .projects-strip, .principles, .expertise, .facts, .steps, .path, .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .about-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .expert-band { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .author-box { grid-template-columns: 1fr; }
  .consent { flex-direction: column; align-items: stretch; }
  .mini { grid-template-columns: 96px 1fr; }
  .mini img { width: 96px; height: 70px; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .sidebar, .ad, .share, .consent, .related, .newsletter { display: none !important; }
  .article-layout { display: block; }
}

/* articles without an image */
.card-media.no-img { display: grid; place-items: center; background: linear-gradient(150deg, #eef5fa, #f7eded); }
.card-media.no-img img { width: 30%; height: auto; object-fit: contain; opacity: .9; }
.mini img.no-img { object-fit: contain; background: linear-gradient(150deg, #eef5fa, #f7eded); padding: 12px; }

/* hero without side card */
.hero-single { grid-template-columns: 1fr; }
.hero-single > div { max-width: 820px; }
.hero-single .search-form { max-width: 680px; }

/* invitation for writers & developers */
.invite-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.invite-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.invite-card h3 { margin: 4px 0 0; font-size: 22px; }
.invite-card p { margin: 0; color: var(--ink-2); }
.invite-card ul { margin: 0; padding-inline-start: 20px; color: var(--ink-2); font-size: 16px; }
.invite-card li { margin: 4px 0; }
.invite-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.invite-note { margin: 16px 0 0; color: var(--muted); font-size: 15px; }
@media (max-width: 760px) { .invite-grid { grid-template-columns: 1fr; } }

/* label on compact project cards (sponsored / private listing) */
.projects-compact .project-card { position: relative; }
.projects-compact .sponsored-tag { display: inline-block; top: 6px; inset-inline-start: 6px; font-size: 10px; padding: 2px 7px; }
.widget-label a { font-weight: 700; text-decoration: none; }

/* project posts: galleries, plans, notes */
/* galleries: justified rows – each image keeps its proportions, rows fill the width at equal height, nothing is cropped */
.prose .gallery { --h: 250px; display: flex; flex-wrap: wrap; gap: 8px; margin: 1.2em 0; max-width: none; }
.prose .gallery::after { content: ""; flex-grow: 999; }
.prose .gallery img { --ar: 1; flex: var(--ar) 1 calc(var(--ar) * var(--h)); aspect-ratio: var(--ar); width: 100%; height: auto; min-width: 0; object-fit: contain; border-radius: 8px; display: block; background: #f1eee8; }
.prose .gallery-wide { --h: 190px; }
@media (max-width: 640px) { .prose .gallery { --h: 170px; } .prose .gallery-wide { --h: 140px; } }
/* floor plans: always whole, side by side when there is room */
.prose .plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 1.4em 0; max-width: none; align-items: start; }
.prose .plans figure { margin: 0; }
.prose figure { margin: 1.4em 0; }
.prose figure img { display: block; width: 100%; }
.prose figcaption, .prose .note { font-size: 15px; color: var(--muted); }
.prose figure.plan img, .prose .plans img { background: #fff; border: 1px solid var(--line); width: 100%; height: auto; max-height: 1000px; object-fit: contain; }
.prose img[data-zoom] { cursor: zoom-in; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(10, 18, 26, .94); display: none; align-items: center; justify-content: center; padding: 56px 64px 72px; }
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; }
.lightbox .lb-caption { position: absolute; bottom: 20px; inset-inline: 64px; text-align: center; color: #dbe5ee; font-size: 15px; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 26px; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.25); }
.lightbox .lb-close { top: 14px; inset-inline-end: 14px; }
.lightbox .lb-prev { inset-inline-start: 10px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { inset-inline-end: 10px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) { .lightbox { padding: 56px 8px 64px; } .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 10px; transform: none; } }
.prose .note { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.prose .cta-line { margin: 1.2em 0; }
.prose .cta-line .btn { text-decoration: none; }
.invite-single { grid-template-columns: 1fr; max-width: 760px; }

/* about: kids' financial education */
.kids-band { background: linear-gradient(150deg, #fff8ec, #eef6fb); border: 1px solid var(--line); border-radius: 20px; padding: clamp(22px, 4vw, 40px); }
.kids-band h2 { margin-bottom: 10px; }
.kids-band p, .kids-band li { color: var(--ink-2); max-width: 75ch; }
.kids-band ul { padding-inline-start: 20px; margin: 0 0 16px; }
.kids-band .btn { margin: 4px 0 4px 6px; }

/* whole-image cards (square, tall or text-heavy pictures are never cropped) */
.card-media.is-contained { background: #f1eee8; }
.card-media.is-contained img { object-fit: contain; }
.mini img.is-contained { object-fit: contain; background: #f1eee8; }
