/*
 * nn-base — editorial broadsheet stylesheet.
 * Brand: Symbol Consulting (indigo + teal + muted gold). Zero web fonts (CWV):
 * a system serif carries the editorial masthead/headlines, a system sans the body.
 * Structure is RTL-ready (logical properties) for future Arabic brands.
 * Brand tokens (--sy-*) come from brands/symbol-consulting/brand-palette.md.
 */

/* ---------- Design tokens ---------- */
:root {
  --sy-indigo: #1B3A5B;
  --sy-ink:    #090909;
  --sy-teal:   #0E9488;
  --sy-gold:   #B8924A;
  --sy-bg:     #F4F6F8;
  --sy-gray:   #6E7A88;
  --sy-mist:   #DDE3E9;

  --sy-indigo-deep: #12283F;
  --sy-teal-deep:   #0B7269;
  --sy-paper:       #FFFFFF;

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1180px;
  --wrap-narrow: 720px;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  --step--1: clamp(0.78rem, 0.75rem + 0.15vw, 0.86rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --step-4:  clamp(2.6rem, 2rem + 3vw, 4.4rem);

  --radius: 3px;
  --line: 1px solid var(--sy-mist);
  --shadow: 0 1px 2px rgba(18, 40, 63, 0.06), 0 10px 30px -12px rgba(18, 40, 63, 0.14);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--sy-bg);
  color: var(--sy-ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, picture, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--sy-teal-deep); text-decoration: none; }
a:hover { color: var(--sy-indigo); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--sy-indigo); line-height: 1.12; font-weight: 700; margin: 0 0 0.5em; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; }
strong { color: var(--sy-ink); }

:focus-visible { outline: 3px solid var(--sy-teal); outline-offset: 2px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: var(--wrap-narrow); }

.skip-link {
  position: absolute; inset-inline-start: -9999px; top: 0; z-index: 999;
  background: var(--sy-indigo); color: #fff; padding: 0.7em 1.2em; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { inset-inline-start: 0; }

/* Kicker / eyebrow label */
.kicker {
  font-family: var(--font-sans);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--sy-teal-deep);
  margin: 0 0 0.5rem;
  display: inline-block;
}
.kicker::before { content: ""; }

/* ---------- Header / masthead ---------- */
.site-header { background: var(--sy-paper); border-bottom: 3px solid var(--sy-indigo); }
.topbar {
  background: var(--sy-indigo-deep); color: #cdd8e3;
  font-size: var(--step--1); letter-spacing: 0.02em;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 40px; }
.topbar time { color: #9fb2c4; }
.topbar .topbar__tag { text-transform: uppercase; letter-spacing: 0.16em; color: var(--sy-gold); font-weight: 700; }

.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: clamp(1rem, 3vw, 1.9rem); }
.brand { display: inline-flex; align-items: center; gap: 0.9rem; color: var(--sy-indigo); }
.brand:hover { text-decoration: none; }
.brand__logo { width: clamp(120px, 22vw, 168px); height: auto; color: var(--sy-indigo); }
.brand__tag {
  font-family: var(--font-sans); font-size: var(--step--1); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--sy-gray); font-weight: 600; border-inline-start: 2px solid var(--sy-gold);
  padding-inline-start: 0.9rem; max-width: 15ch;
}
@media (max-width: 640px) { .brand__tag { display: none; } }

/* Primary nav — CSS-only, no JS */
.primary-nav { border-top: var(--line); border-bottom: var(--line); background: var(--sy-paper); }
.primary-nav .wrap { display: flex; align-items: center; gap: 0.5rem; }
.nav-toggle, .nav-toggle-label { display: none; }
.menu {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem;
  font-family: var(--font-sans);
}
.menu a {
  display: block; padding: 0.9rem 0.95rem; color: var(--sy-indigo); font-weight: 600;
  font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 3px solid transparent;
}
.menu a:hover, .menu .current-menu-item > a { color: var(--sy-teal-deep); border-bottom-color: var(--sy-teal); text-decoration: none; }

/* Language switcher */
.lang-switch { display: inline-flex; gap: 0.15rem; align-items: center; margin-inline-start: auto; font-size: var(--step--1); }
.lang-switch a, .lang-switch span {
  padding: 0.25rem 0.55rem; border-radius: var(--radius); font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #b9c6d3;
}
.topbar .lang-switch a:hover { color: #fff; text-decoration: none; }
.topbar .lang-switch [aria-current="true"] { background: var(--sy-teal); color: #fff; }

@media (max-width: 760px) {
  .nav-toggle-label {
    display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
    padding: 0.85rem 0; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    font-size: var(--step--1); color: var(--sy-indigo);
  }
  .nav-toggle-label::before { content: ""; width: 20px; height: 2px; background: currentColor; box-shadow: 0 6px 0 currentColor, 0 -6px 0 currentColor; }
  .menu { flex-direction: column; gap: 0; width: 100%; max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
  .nav-toggle:checked ~ .menu { max-height: 32rem; }
  .menu a { padding-inline: 0; border-bottom: var(--line); }
}

/* ---------- Layout scaffolding ---------- */
.section { padding-block: clamp(2rem, 5vw, 3.4rem); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--sy-indigo); padding-bottom: 0.5rem; margin-bottom: 1.6rem; }
.section-head h2 { font-size: var(--step-1); margin: 0; }
.section-head .more { font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }

/* ---------- Hero (front page lead) ---------- */
.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(1.2rem, 3vw, 2.6rem); align-items: center; padding-block: clamp(1.8rem, 4vw, 3rem); }
.hero__media { position: relative; }
.hero__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.hero__media::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(18,40,63,0.08); border-radius: var(--radius); pointer-events: none; }
.hero__body { }
.hero__title { font-size: var(--step-4); margin-bottom: 0.4em; }
.hero__title a { color: inherit; }
.hero__title a:hover { color: var(--sy-teal-deep); text-decoration: none; }
.hero__excerpt { font-size: var(--step-1); color: #33414f; font-family: var(--font-serif); line-height: 1.4; }
.hero__meta { margin-top: 1rem; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .hero__media { order: -1; } }

/* ---------- Article cards / grids ---------- */
.grid { display: grid; gap: clamp(1.2rem, 3vw, 2rem); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

.card { background: var(--sy-paper); border: var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow 0.2s ease, transform 0.2s ease; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card__media { display: block; background: var(--sy-mist); }
.card__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.card__body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.card__title { font-size: var(--step-1); margin: 0; }
.card__title a { color: var(--sy-indigo); }
.card__title a:hover { color: var(--sy-teal-deep); text-decoration: none; }
.card__excerpt { color: var(--sy-gray); font-size: var(--step--1); margin: 0; }
.card__meta { margin-top: auto; }

/* Compact list row (sidebars, latest) */
.list-reset { list-style: none; margin: 0; padding: 0; }
.story-row { display: grid; grid-template-columns: 84px 1fr; gap: 0.9rem; padding-block: 1rem; border-bottom: var(--line); align-items: start; }
.story-row:first-child { padding-top: 0; }
.story-row img { aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
.story-row h3 { font-size: var(--step-0); margin: 0 0 0.25rem; }
.story-row .card__meta { font-size: var(--step--1); }

/* Meta line */
.meta { font-family: var(--font-sans); font-size: var(--step--1); color: var(--sy-gray); display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.meta a { color: var(--sy-indigo); font-weight: 600; }
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--sy-gold); display: inline-block; }

/* ---------- Single article ---------- */
.article-head { padding-block: clamp(1.4rem, 4vw, 2.6rem) 1rem; }
.breadcrumbs { font-size: var(--step--1); color: var(--sy-gray); margin-bottom: 1rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.breadcrumbs li::after { content: "›"; color: var(--sy-gold); margin-inline-start: 0.4rem; }
.breadcrumbs li:last-child::after { content: ""; }
.article-title { font-size: var(--step-3); max-width: 22ch; }
.article-dek { font-family: var(--font-serif); font-size: var(--step-1); color: #33414f; line-height: 1.4; max-width: 60ch; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; margin-top: 1.2rem; padding-top: 1.1rem; border-top: var(--line); }
.byline__avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--sy-indigo); color: #fff; display: grid; place-items: center; font-family: var(--font-serif); font-weight: 700; font-size: 1.1rem; }
.byline__name { font-weight: 700; color: var(--sy-indigo); }
.byline .meta { margin: 0; }

.article-hero { margin-block: 1.5rem; }
.article-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.article-hero figcaption { font-size: var(--step--1); color: var(--sy-gray); margin-top: 0.5rem; }

.article-body { font-size: var(--step-0); }
.article-body > * { max-width: var(--wrap-narrow); }
.article-body p { margin-block: 0 1.25em; }
.article-body h2 { font-size: var(--step-2); margin-top: 1.6em; }
.article-body h3 { font-size: var(--step-1); margin-top: 1.4em; }
.article-body a { border-bottom: 1px solid var(--sy-mist); }
.article-body blockquote {
  margin: 1.6em 0; padding: 0.4em 0 0.4em 1.4rem; border-inline-start: 4px solid var(--sy-teal);
  font-family: var(--font-serif); font-size: var(--step-1); color: var(--sy-indigo); font-style: italic;
}
.article-body img { border-radius: var(--radius); }
.article-body figure { margin-inline: 0; }
.article-body ul, .article-body ol { padding-inline-start: 1.3rem; }
.article-body li { margin-bottom: 0.4em; }
/* Wide data tables scroll inside their own box instead of forcing page overflow on mobile */
.article-body table { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-collapse: collapse; margin: 1.5em 0; font-size: var(--step--1); }
.article-body th, .article-body td { border: var(--line); padding: 0.6rem 0.8rem; text-align: start; }
.article-body th { background: var(--sy-bg); color: var(--sy-indigo); }

/* Author box */
.author-box { display: flex; gap: 1.1rem; align-items: flex-start; background: var(--sy-paper); border: var(--line); border-inline-start: 4px solid var(--sy-teal); border-radius: var(--radius); padding: 1.3rem; margin-block: 2.2rem; max-width: var(--wrap-narrow); }
.author-box .byline__avatar { width: 56px; height: 56px; }
.author-box h2 { font-size: var(--step-1); margin: 0 0 0.3rem; }

/* Related / cross-links */
.related { border-top: 2px solid var(--sy-indigo); margin-top: 2.5rem; padding-top: 1.5rem; }
.translation-note { background: var(--sy-bg); border: var(--line); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin-block: 1.5rem; font-size: var(--step--1); max-width: var(--wrap-narrow); }
.translation-note a { font-weight: 700; }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-block: 2.5rem 0; }
.pagination .page-numbers { display: inline-grid; place-items: center; min-width: 2.75rem; height: 2.75rem; padding-inline: 0.6rem; border: var(--line); border-radius: var(--radius); background: var(--sy-paper); font-weight: 700; color: var(--sy-indigo); }
.pagination .page-numbers.current { background: var(--sy-indigo); color: #fff; border-color: var(--sy-indigo); }
.pagination a.page-numbers:hover { border-color: var(--sy-teal); color: var(--sy-teal-deep); text-decoration: none; }

/* ---------- Buttons / forms ---------- */
.btn { display: inline-block; background: var(--sy-indigo); color: #fff; padding: 0.75rem 1.4rem; border-radius: var(--radius); font-weight: 700; letter-spacing: 0.03em; border: 0; cursor: pointer; }
.btn:hover { background: var(--sy-teal-deep); color: #fff; text-decoration: none; }
.btn--ghost { background: transparent; color: var(--sy-indigo); box-shadow: inset 0 0 0 2px var(--sy-indigo); }
.search-form { display: flex; gap: 0.5rem; max-width: 30rem; }
.search-form input[type="search"] { flex: 1; padding: 0.7rem 0.9rem; border: var(--line); border-radius: var(--radius); font-size: var(--step-0); font-family: inherit; background: var(--sy-paper); }
.search-form input[type="search"]:focus { border-color: var(--sy-teal); outline: none; }

/* ---------- Page (static) ---------- */
.page-header { padding-block: clamp(1.6rem, 4vw, 2.6rem) 0.5rem; border-bottom: 2px solid var(--sy-indigo); margin-bottom: 1.8rem; }
.page-title { font-size: var(--step-3); margin: 0; }
.entry-content { font-size: var(--step-0); }
.entry-content > * { max-width: var(--wrap-narrow); }
.entry-content h2 { font-size: var(--step-2); margin-top: 1.5em; }

/* ---------- 404 / search states ---------- */
.state { text-align: center; padding-block: clamp(3rem, 8vw, 6rem); }
.state h1 { font-size: var(--step-4); }
.state .search-form { margin-inline: auto; }

/* ---------- Footer ---------- */
.site-footer { background: var(--sy-indigo-deep); color: #c4d0dc; margin-top: clamp(3rem, 8vw, 5rem); }
.site-footer a { color: #dfe7ef; }
.site-footer a:hover { color: #fff; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; padding-block: clamp(2.2rem, 5vw, 3.4rem); }
@media (max-width: 760px) { .footer-top { grid-template-columns: 1fr; gap: 1.6rem; } }
.footer-brand__logo { width: 150px; color: #fff; margin-bottom: 0.9rem; }
.footer-brand p { color: #a7b7c7; font-size: var(--step--1); max-width: 40ch; }
.footer-col h3 { color: #fff; font-family: var(--font-sans); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.9rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; font-size: var(--step--1); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-block: 1.2rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; font-size: var(--step--1); color: #92a4b6; }
.site-footer .lang-switch a, .site-footer .lang-switch span { color: #a7b7c7; }
.site-footer .lang-switch [aria-current="true"] { background: var(--sy-teal); color: #fff; }

/* ---------- Utilities ---------- */
.stack > * + * { margin-top: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.text-teal { color: var(--sy-teal-deep); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
