/*
Theme Name: CNCPedia
Theme URI: https://cncpedia.com
Author: CNCPedia
Author URI: https://cncpedia.com
Description: A clean, editorial WordPress theme for the CNC industry encyclopedia. Lightweight, no plugin dependencies, built for easy content maintenance.
Version: 1.5
License: GNU General Public License v2 or later
Text Domain: cncpedia
Tags: blog, two-columns, right-sidebar, responsive-layout, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  --ink: #0f1b2a;
  --ink-soft: #58697c;
  --ink-faint: #8fa0b0;
  --blue: #1d5fbf;
  --blue-dark: #13468f;
  --blue-soft: #eaf2ff;
  --blue-tint: #f3f8ff;
  --accent: #e8753c;
  --accent-dark: #cf5f2a;
  --accent-soft: #fff2e9;
  --teal: #0e9384;
  --teal-soft: #e7f7f4;
  --bg: #ffffff;
  --bg-soft: #f6f9fc;
  --bg-softer: #fbfcfe;
  --line: #e4ebf3;
  --line-strong: #cbd7e4;
  --green: #23855f;
  --shadow-sm: 0 1px 2px rgba(15, 27, 42, .05);
  --shadow: 0 2px 8px rgba(15, 27, 42, .05), 0 12px 32px rgba(15, 27, 42, .06);
  --shadow-lg: 0 4px 12px rgba(15, 27, 42, .07), 0 24px 56px rgba(15, 27, 42, .10);
  --radius: 14px;
  --radius-sm: 8px;
  --max: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ==========================================================================
   2. Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--blue-dark); }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 750; line-height: 1.28; margin: 0 0 .6em; letter-spacing: -.025em; }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1.2em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.4em; }
li { margin-bottom: .35em; }
blockquote { margin: 1.6em 0; padding: 1em 1.4em; border-left: 3px solid var(--blue); background: var(--bg-soft); color: var(--ink-soft); }
code { background: var(--bg-soft); padding: .1em .4em; border-radius: 4px; font-size: .9em; }
pre { background: var(--ink); color: #e8eef5; padding: 1.2em 1.4em; border-radius: var(--radius-sm); overflow-x: auto; }
pre code { background: none; padding: 0; color: inherit; }
table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .95em; }
th, td { border: 1px solid var(--line); padding: .7em .9em; text-align: left; }
th { background: var(--bg-soft); font-weight: 650; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin: 1.5em auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: .85rem; color: var(--ink-faint); text-align: center; margin-top: .4em; }

/* ==========================================================================
   3. Layout helpers
   ========================================================================== */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section { padding: 76px 0; }
.section--soft { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section--tight { padding: 40px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.section-head h2 { margin: 0; font-size: 1.85rem; letter-spacing: -.035em; }
.section-head p { margin: 8px 0 0; color: var(--ink-soft); font-size: .96rem; }
.section-head .more { font-size: .9rem; font-weight: 700; white-space: nowrap; color: var(--blue); }
.section-head .more:hover { color: var(--blue-dark); }
.eyebrow { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--blue); margin-bottom: 14px; }
.eyebrow--accent { color: var(--accent); }
.eyebrow--teal { color: var(--teal); }

/* ==========================================================================
   4. Header
   ========================================================================== */
.site-header { background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header__inner { display: flex; align-items: center; gap: 28px; height: 74px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.32rem; letter-spacing: -.045em; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand__mark { width: 40px; height: 40px; display: block; flex: 0 0 auto; }
.brand__mark img { width: 100%; height: 100%; display: block; }
.brand__name { display: block; white-space: nowrap; line-height: 1.06; }
.brand__sub { font-size: .6rem; font-weight: 700; letter-spacing: .1em; color: var(--ink-faint); text-transform: uppercase; display: block; margin-top: 3px; white-space: nowrap; }
.primary-nav { display: flex; align-items: center; gap: 2px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.primary-nav a { position: relative; color: var(--ink-soft); font-size: .93rem; font-weight: 650; padding: 9px 13px; border-radius: var(--radius-sm); }
.primary-nav a::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 5px; height: 2px; background: var(--blue); transform: scaleX(0); transition: transform .2s ease; border-radius: 2px; }
.primary-nav a:hover { color: var(--blue); background: var(--blue-tint); }
.primary-nav a:hover::after { transform: scaleX(.6); }
.primary-nav a.current-menu-item { color: var(--blue); background: var(--blue-soft); }
.primary-nav a.current-menu-item::after { transform: scaleX(1); }
.header-search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px 6px 12px; background: var(--bg-soft); transition: border-color .2s ease, box-shadow .2s ease; }
.header-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.header-search input { border: 0; background: transparent; outline: none; font: inherit; font-size: .88rem; width: 132px; color: var(--ink); }
.header-search button { border: 0; background: var(--blue); color: #fff; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; line-height: 1; font-size: 1rem; display: grid; place-items: center; }
.menu-toggle { display: none; border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius-sm); padding: 8px 11px; cursor: pointer; color: var(--ink); font: inherit; font-size: .88rem; font-weight: 600; }

/* Language switcher — a compact secondary menu in the header. */
.lang-switch { position: relative; flex: 0 0 auto; }
.lang-switch__toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-soft); border-radius: 9px; padding: 8px 10px; cursor: pointer; font: inherit; font-size: .84rem; font-weight: 700; line-height: 1; transition: border-color .2s ease, color .2s ease, background .2s ease; }
.lang-switch__toggle:hover, .lang-switch.is-open .lang-switch__toggle { color: var(--blue); border-color: var(--blue); background: var(--blue-tint); }
.lang-switch__globe { font-size: 1rem; color: var(--blue); line-height: 1; }
.lang-switch__caret { font-size: .7rem; color: var(--ink-faint); line-height: 1; }
.lang-switch__menu { position: absolute; z-index: 60; top: calc(100% + 8px); right: 0; min-width: 168px; margin: 0; padding: 6px; list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(15,27,42,.12); display: none; }
.lang-switch.is-open .lang-switch__menu { display: block; }
.lang-switch__menu a { display: flex; align-items: center; justify-content: space-between; padding: 9px 11px; border-radius: 7px; color: var(--ink-soft); font-size: .88rem; font-weight: 600; text-decoration: none; }
.lang-switch__menu a:hover { background: var(--blue-tint); color: var(--blue); }
.lang-switch__menu a.is-current { background: var(--blue-soft); color: var(--blue); }
.lang-switch__menu a.is-current::after { content: "✓"; font-size: .8rem; }

/* ==========================================================================
   5. Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 360px at 12% -10%, rgba(29,95,191,.10), transparent 65%),
    radial-gradient(700px 320px at 88% 0%, rgba(232,117,60,.08), transparent 62%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
  padding: 92px 0 82px;
  text-align: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(29,95,191,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(29,95,191,.045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000 25%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000 25%, transparent 100%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); letter-spacing: -.05em; margin-bottom: 20px; line-height: 1.14; font-weight: 800; }
.hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--blue), #4d8fe8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero__lead { max-width: 660px; margin: 0 auto 34px; color: var(--ink-soft); font-size: 1.12rem; line-height: 1.75; }
.hero-search { max-width: 660px; margin: 0 auto; display: flex; gap: 8px; background: #fff; border: 1px solid var(--line-strong); border-radius: 14px; padding: 8px; box-shadow: var(--shadow-lg); transition: box-shadow .2s ease; }
.hero-search:focus-within { box-shadow: 0 0 0 4px var(--blue-soft), var(--shadow-lg); }
.hero-search input { flex: 1; border: 0; outline: none; font: inherit; font-size: 1rem; padding: 12px 14px; color: var(--ink); background: transparent; }
.hero-search button { border: 0; background: linear-gradient(135deg, #2a6fd6, var(--blue-dark)); color: #fff; font: inherit; font-weight: 700; padding: 12px 26px; border-radius: 9px; cursor: pointer; box-shadow: 0 3px 10px rgba(29,95,191,.28); transition: transform .15s ease, box-shadow .15s ease; }
.hero-search button:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(29,95,191,.34); }
.hero__topics { margin-top: 22px; font-size: .88rem; color: var(--ink-faint); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; align-items: center; }
.hero__topics a { color: var(--ink-soft); border: 1px solid var(--line); background: rgba(255,255,255,.8); padding: 4px 11px; border-radius: 999px; font-size: .82rem; transition: all .18s ease; }
.hero__topics a:hover { color: var(--blue); border-color: var(--blue); background: var(--blue-soft); }

/* Stat strip */
.stat-strip { border-bottom: 1px solid var(--line); background: #fff; }
.stat-strip__inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 26px 10px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -.04em; color: var(--ink); line-height: 1.2; }
.stat span { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); font-weight: 700; margin-top: 4px; }
.stat:nth-child(1) b { color: var(--blue); }
.stat:nth-child(2) b { color: var(--accent); }
.stat:nth-child(3) b { color: var(--teal); }

/* ==========================================================================
   6. Cards & lists
   ========================================================================== */
.grid { display: grid; gap: 24px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.card { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--blue), #6aa5ea); opacity: 0; transition: opacity .22s ease; z-index: 2; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card:hover::before { opacity: 1; }
.card__media { aspect-ratio: 16 / 9; background: var(--bg-soft); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.3,1); }
.card:hover .card__media img { transform: scale(1.05); }
.card__body { padding: 22px 24px 24px; }
.card__meta { display: flex; align-items: center; gap: 10px; font-size: .74rem; color: var(--ink-faint); margin-bottom: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.card__meta a { color: var(--blue); }
.card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.card__title { font-size: 1.16rem; margin-bottom: 9px; line-height: 1.42; letter-spacing: -.02em; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--blue); }
.card__excerpt { color: var(--ink-soft); font-size: .93rem; line-height: 1.68; margin: 0; }
.card__link { display: inline-block; margin-top: 16px; font-size: .86rem; font-weight: 750; color: var(--blue); }
.card__link:hover { color: var(--blue-dark); }

/* Feature card */
.feature { display: grid; grid-template-columns: 1.02fr 1fr; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.feature__media { min-height: 340px; background: var(--bg-soft); }
.feature__media img { width: 100%; height: 100%; object-fit: cover; }
.feature__body { padding: 44px 48px; display: flex; flex-direction: column; justify-content: center; }
.feature__body h2 { font-size: 2rem; letter-spacing: -.04em; margin-bottom: 16px; }
.feature__body h2 a { color: var(--ink); }
.feature__body h2 a:hover { color: var(--blue); }
.feature__body p { color: var(--ink-soft); font-size: 1.02rem; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--blue); color: var(--blue); background: transparent; font: inherit; font-weight: 700; font-size: .9rem; padding: 11px 20px; border-radius: 9px; cursor: pointer; transition: all .18s ease; align-self: flex-start; }
.btn:hover { background: var(--blue-soft); color: var(--blue-dark); transform: translateY(-1px); }
.btn--solid { background: linear-gradient(135deg, #2a6fd6, var(--blue-dark)); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(29,95,191,.22); }
.btn--solid:hover { background: linear-gradient(135deg, var(--blue), #0f3d7e); color: #fff; }
.btn--sm { padding: 7px 13px; font-size: .82rem; }

/* List rows */
.list-rows { border-top: 1px solid var(--line); }
.list-row { display: flex; gap: 16px; align-items: flex-start; padding: 19px 4px; border-bottom: 1px solid var(--line); transition: background .18s ease, padding-left .18s ease; }
.list-row:hover { background: var(--bg-softer); padding-left: 10px; }
.list-row__date { flex: 0 0 60px; text-align: center; background: var(--blue-tint); border: 1px solid var(--line); border-radius: 9px; padding: 7px 0; line-height: 1.2; }
.list-row__date b { display: block; font-size: 1.15rem; color: var(--accent); letter-spacing: -.03em; }
.list-row__date span { font-size: .66rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-faint); font-weight: 800; }
.list-row__body h4 { margin: 0 0 4px; font-size: 1.02rem; line-height: 1.45; }
.list-row__body h4 a { color: var(--ink); }
.list-row__body h4 a:hover { color: var(--blue); }
.list-row__body p { margin: 0; font-size: .86rem; color: var(--ink-faint); }
.tag-inline { display: inline-block; font-size: .69rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); background: var(--blue-soft); padding: 3px 9px; border-radius: 5px; margin-bottom: 8px; }

/* Brand chips & cards */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 17px; font-size: .9rem; font-weight: 650; color: var(--ink-soft); background: #fff; transition: all .18s ease; box-shadow: var(--shadow-sm); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); opacity: .5; }
.chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); transform: translateY(-1px); }
.chip--active { background: var(--blue); color: #fff; border-color: var(--blue); }
.chip--active::before { background: #fff; opacity: 1; }
.chip--active:hover { color: #fff; background: var(--blue-dark); }
.brand-card { padding: 24px; display: flex; gap: 16px; align-items: flex-start; }
.brand-card__logo { flex: 0 0 54px; height: 54px; border-radius: 12px; background: linear-gradient(135deg, var(--blue-soft), #d8e8ff); border: 1px solid #d5e5fb; display: grid; place-items: center; overflow: hidden; }
.brand-card__logo .brand-logo__img { width: 100%; height: 100%; object-fit: contain; padding: 5px; box-sizing: border-box; display: block; }
.brand-logo__monogram { font-weight: 800; font-size: .98rem; color: var(--blue); letter-spacing: -.04em; }
.brand-card h4 { margin: 0 0 4px; font-size: 1.08rem; }
.brand-card h4 a { color: var(--ink); }
.brand-card__region { font-size: .78rem; color: var(--ink-faint); font-weight: 600; }
.brand-card p { font-size: .89rem; color: var(--ink-soft); margin: 11px 0 0; }

/* ==========================================================================
   7. Single content
   ========================================================================== */
.entry-header { padding: 58px 0 34px; border-bottom: 1px solid var(--line); margin-bottom: 44px; }
.entry-header h1 { font-size: clamp(2.1rem, 4vw, 3rem); letter-spacing: -.045em; margin-bottom: 18px; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: .86rem; color: var(--ink-faint); }
.entry-meta a { color: var(--ink-soft); }
.entry-content { max-width: 760px; font-size: 1.05rem; line-height: 1.85; }
.entry-content h2 { margin-top: 1.8em; padding-top: .3em; font-size: 1.55rem; }
.entry-content h3 { margin-top: 1.5em; font-size: 1.22rem; }
.entry-content ul, .entry-content ol { padding-left: 1.5em; }
.entry-content li { margin-bottom: .5em; }

/* Embedded video (YouTube, Vimeo, ...) — keep it inside the article column. */
.entry-content iframe,
.entry-content embed,
.entry-content object { max-width: 100%; }
.entry-content iframe[src*="youtube.com/embed"],
.entry-content iframe[src*="youtube-nocookie.com/embed"],
.entry-content iframe[src*="player.vimeo.com/video"] {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  margin: 0 0 24px;
  border: 0;
}

/* Wikipedia-style references for encyclopedia entries */
.cnc-sources { margin-top: 52px; padding-top: 26px; border-top: 1px solid var(--line); }
.cnc-sources h2 { font-size: 1.35rem; margin-bottom: 18px; letter-spacing: -.02em; }
.cnc-sources__list { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.cnc-source { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid #eef2f7; line-height: 1.6; scroll-margin-top: 100px; }
.cnc-source:last-child { border-bottom: 0; }
.cnc-source__num { flex: 0 0 auto; color: var(--blue); font-weight: 700; font-size: .82rem; padding-top: 2px; }
.cnc-source__body { min-width: 0; flex: 1 1 auto; word-break: break-word; }
.cnc-source__body a { color: var(--blue); }
.cnc-source__meta { display: block; color: var(--ink-faint); font-size: .79rem; margin-top: 2px; }
.cnc-source__back { flex: 0 0 auto; color: var(--ink-faint); font-size: .9rem; padding: 0 2px; }
.cnc-source__back:hover { color: var(--blue); }
.cnc-ref { font-size: .68em; line-height: 0; vertical-align: super; margin-left: 1px; }
.cnc-ref a { text-decoration: none; font-weight: 700; color: var(--blue); }
.cnc-ref a:hover { text-decoration: underline; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 60px; align-items: start; }
.sidebar { position: sticky; top: 104px; }
.widget { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.widget h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .11em; color: var(--ink-faint); margin-bottom: 16px; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--ink-soft); }
.widget a:hover { color: var(--blue); }

/* Pros / cons box */
.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0; }
.proscons__box { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.proscons__box--pros { background: linear-gradient(180deg, #f2fbf7, #fff); border-color: #d4ede1; }
.proscons__box--cons { background: linear-gradient(180deg, #fff7f1, #fff); border-color: #f6dfd0; }
.proscons__box h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; font-size: .96rem; }
.proscons__box--pros h4 { color: var(--green); }
.proscons__box--cons h4 { color: var(--accent); }
.proscons__box ul { list-style: none; padding: 0; margin: 0; font-size: .92rem; color: var(--ink-soft); }
.proscons__box li { position: relative; padding-left: 19px; margin-bottom: 8px; }
.proscons__box li::before { content: "•"; position: absolute; left: 2px; color: var(--line-strong); font-weight: 700; }
.proscons__box--pros li::before { content: "+"; color: var(--green); }
.proscons__box--cons li::before { content: "−"; color: var(--accent); }
.fact-table { margin: 24px 0; }
.fact-table th { width: 34%; background: var(--bg-soft); font-weight: 650; color: var(--ink-soft); }
.brand-hero { display: flex; gap: 20px; align-items: center; margin-bottom: 28px; }
.brand-hero__logo { flex: 0 0 78px; height: 78px; border-radius: 16px; background: linear-gradient(135deg, var(--blue-soft), #d8e8ff); border: 1px solid #d5e5fb; display: grid; place-items: center; overflow: hidden; }
.brand-hero__logo .brand-logo__img { width: 100%; height: 100%; object-fit: contain; padding: 8px; box-sizing: border-box; display: block; }
.brand-hero__logo .brand-logo__monogram { font-size: 1.5rem; letter-spacing: -.05em; }
.event-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0; }
.event-meta__item { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 19px 21px; }
.event-meta__item span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-faint); font-weight: 800; margin-bottom: 6px; }
.event-meta__item b { font-size: 1rem; }

/* ==========================================================================
   8. Archive / search
   ========================================================================== */
.archive-header { padding: 56px 0 32px; border-bottom: 1px solid var(--line); margin-bottom: 38px; }
.archive-header h1 { font-size: 2.35rem; margin-bottom: 10px; letter-spacing: -.04em; }
.archive-header p { color: var(--ink-soft); margin: 0; }
.archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-meta-line { font-size: .82rem; color: var(--ink-faint); margin-bottom: 10px; }
.pagination { display: flex; gap: 8px; justify-content: center; margin: 50px 0 8px; }
.pagination a, .pagination span { border: 1px solid var(--line); padding: 9px 15px; border-radius: var(--radius-sm); font-size: .88rem; color: var(--ink-soft); }
.pagination .current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ==========================================================================
   9. Interactive world region map
   ========================================================================== */
.region-map { position: relative; background: linear-gradient(160deg, #f4f9ff 0%, #eaf2fb 100%); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.region-map__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 22px; background: rgba(255,255,255,.72); border-bottom: 1px solid var(--line); }
.region-map__hint { font-size: .88rem; color: var(--ink-soft); display: flex; align-items: center; gap: 9px; }
.region-map__hint svg { width: 17px; height: 17px; color: var(--blue); flex-shrink: 0; }
.region-map__reset { border: 1px solid var(--line); background: #fff; color: var(--ink-soft); font: inherit; font-size: .82rem; font-weight: 650; padding: 7px 13px; border-radius: 8px; cursor: pointer; transition: all .18s ease; opacity: 0; pointer-events: none; }
.region-map__reset.is-visible { opacity: 1; pointer-events: auto; }
.region-map__reset:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.region-map__stage { position: relative; width: 100%; aspect-ratio: 16 / 8.4; min-height: 340px; }
.region-map__stage svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rm-ocean { fill: transparent; }
.rm-land { fill: #dce7f3; stroke: #fff; stroke-width: 1.1; stroke-linejoin: round; transition: fill .25s ease; }
.rm-region { cursor: pointer; }
.rm-region .rm-shape { fill: #b9d2ee; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; transition: fill .2s ease, stroke .2s ease, filter .2s ease; }
.rm-region:hover .rm-shape, .rm-region.is-hover .rm-shape { fill: var(--blue); stroke: #fff; filter: drop-shadow(0 3px 10px rgba(29,95,191,.4)); }
.rm-region.is-active .rm-shape { fill: var(--blue-dark); stroke: #fff; }
.rm-label { font-family: var(--font); font-size: 12px; font-weight: 750; fill: var(--ink-soft); text-anchor: middle; pointer-events: none; transition: fill .2s ease; }
.rm-region:hover .rm-label, .rm-region.is-hover .rm-label, .rm-region.is-active .rm-label { fill: #fff; }
.rm-count { font-family: var(--font); font-size: 10px; font-weight: 700; fill: var(--accent); text-anchor: middle; pointer-events: none; }
.region-map__stage.is-zoomed .rm-land { fill: #e7eef6; }
.region-map__zoom { transition: transform .72s cubic-bezier(.22,.68,.24,1); transform-origin: 0 0; }
.region-map__panel {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -46%) scale(.94);
  width: min(340px, 82%); max-height: 78%; overflow: auto;
  background: rgba(255,255,255,.97); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity .28s ease, transform .28s ease; z-index: 5;
}
.region-map__panel.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.region-map__panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.region-map__panel-head h4 { margin: 0; font-size: 1.2rem; letter-spacing: -.02em; }
.region-map__panel-head span { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 5px; white-space: nowrap; }
.region-map__panel p { font-size: .84rem; color: var(--ink-faint); margin: 0 0 14px; }
.region-map__select { width: 100%; font: inherit; font-size: .92rem; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; color: var(--ink); cursor: pointer; outline: none; }
.region-map__select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.region-map__close { position: absolute; top: 12px; right: 12px; border: 0; background: var(--bg-soft); color: var(--ink-soft); width: 26px; height: 26px; border-radius: 7px; cursor: pointer; font-size: 1rem; line-height: 1; }
.region-map__close:hover { background: var(--line); color: var(--ink); }
.region-map__brands { list-style: none; padding: 0; margin: 14px 0 0; }
.region-map__brands li { border-top: 1px solid var(--line); padding: 10px 0; font-size: .9rem; }
.region-map__brands a { font-weight: 700; color: var(--ink); }
.region-map__brands a:hover { color: var(--blue); }
.region-map__brands span { display: block; font-size: .78rem; color: var(--ink-faint); }
.region-map__legend { display: flex; gap: 18px; flex-wrap: wrap; padding: 13px 22px; background: rgba(255,255,255,.72); border-top: 1px solid var(--line); font-size: .78rem; color: var(--ink-faint); }
.region-map__legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.region-map__legend i.a { background: #b9d2ee; }
.region-map__legend i.b { background: var(--blue); }

/* ==========================================================================
   9b. Homepage about / contact band
   ========================================================================== */
.about-contact { background: linear-gradient(120deg, #f3f8ff, #eaf2ff); border-top: 1px solid var(--line); }
.about-contact__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: center; }
.about-contact h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.035em; margin: 12px 0 12px; }
.about-contact p { color: var(--ink-soft); max-width: 640px; margin: 0; line-height: 1.75; }
.about-contact__card { background: #fff; border: 1px solid #d5e5fb; border-radius: var(--radius); padding: 26px 30px; box-shadow: 0 12px 32px rgba(29,95,191,.08); min-width: 258px; }
.about-contact__label { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 9px; }
.about-contact__mail { display: block; font-size: 1.12rem; font-weight: 800; color: var(--blue); letter-spacing: -.02em; margin-bottom: 18px; word-break: break-all; }
.about-contact__mail:hover { text-decoration: underline; }

/* ==========================================================================
   10. Footer
   ========================================================================== */
.site-footer { background: #0d1826; color: #c5d2df; margin-top: 0; position: relative; overflow: hidden; }
.site-footer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--blue), var(--accent), var(--teal)); }
.site-footer a { color: #c5d2df; }
.site-footer a:hover { color: #fff; }
.site-footer__top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 44px; padding: 66px 0 46px; }
.site-footer .brand { color: #fff; margin-bottom: 16px; }
.site-footer .brand__sub { color: #8496a8; }
.site-footer__about { font-size: .9rem; color: #93a4b5; max-width: 290px; line-height: 1.75; }
.site-footer h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 18px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.site-footer li { margin-bottom: 10px; }
.site-footer__bottom { border-top: 1px solid #233247; padding: 22px 0 28px; display: flex; justify-content: space-between; gap: 16px; font-size: .82rem; color: #7e90a3; flex-wrap: wrap; }

/* ==========================================================================
   11. Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .grid--3, .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .layout { grid-template-columns: 1fr; gap: 38px; }
  .sidebar { position: static; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .site-footer__top { grid-template-columns: repeat(2, 1fr); gap: 34px; }
  .feature { grid-template-columns: 1fr; }
  .feature__media { min-height: 260px; }
  .feature__body { padding: 36px 34px; }
  .stat-strip__inner { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 980px) {
  /* Collapse the header navigation before the menu can overflow the row:
     between 761 and ~960px the full menu no longer fits next to the search box. */
  .site-header__inner { height: auto; min-height: 66px; flex-wrap: wrap; padding: 12px 0; gap: 12px; }
  .lang-switch { order: 1; }
  .lang-switch__menu { right: auto; left: 0; }
  .menu-toggle { display: block; order: 3; margin-left: auto; }
  .primary-nav { order: 4; width: 100%; display: none; flex-direction: column; align-items: stretch; gap: 2px; padding-bottom: 8px; }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { padding: 11px 12px; }
  .primary-nav a::after { display: none; }
  .header-search { order: 2; margin-left: auto; }
  .header-search input { width: 120px; }
}
@media (max-width: 760px) {
  .container { padding: 0 18px; }
  .hero { padding: 64px 0 58px; }
  .hero h1 { font-size: 2.2rem; }
  .hero-search { flex-direction: column; }
  .hero-search button { width: 100%; }
  .section { padding: 52px 0; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .grid--3, .grid--2, .archive-grid { grid-template-columns: 1fr; }
  .feature__body { padding: 28px 24px; }
  .feature__body h2 { font-size: 1.6rem; }
  .proscons, .event-meta { grid-template-columns: 1fr; }
  .site-footer__top { grid-template-columns: 1fr; gap: 30px; }
  .about-contact__inner { grid-template-columns: 1fr; gap: 24px; }
  .about-contact__card { min-width: 0; }
  .entry-content { font-size: 1rem; }
  h1 { font-size: 2.1rem; }
  h2 { font-size: 1.55rem; }
  .stat b { font-size: 1.5rem; }
  .region-map__stage { aspect-ratio: 4 / 3.4; min-height: 300px; }
  .region-map__panel { width: 88%; max-height: 74%; padding: 16px; }
}

/* Breadcrumbs --------------------------------------------------------- */
.crumb { padding: 20px 0 0; }
.crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; font-size: .78rem; color: var(--ink-faint); }
.crumb li { display: flex; align-items: center; gap: 8px; }
.crumb li:not(:last-child)::after { content: '›'; opacity: .55; }
.crumb a { color: var(--ink-soft); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.crumb li[aria-current] { color: var(--ink); font-weight: 600; }

/* Related content ----------------------------------------------------- */
.related { margin: 44px 0 8px; padding-top: 28px; border-top: 1px solid rgba(15, 27, 42, .1); }
.related__title { font-size: 1rem; margin: 0 0 16px; }
.related__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.related__card { display: block; padding: 16px 18px; border: 1px solid rgba(15, 27, 42, .12); border-radius: 12px; text-decoration: none; background: var(--bg-softer); transition: border-color .15s ease, transform .15s ease; }
.related__card:hover { border-color: var(--accent); transform: translateY(-1px); }
.related__name { display: block; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.related__excerpt { display: block; font-size: .84rem; color: var(--ink-soft); line-height: 1.5; }
@media (max-width: 640px) { .related__grid { grid-template-columns: 1fr; } }

/* Reference pages: tables and calculator -------------------------------- */
.entry-content table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: .92rem; }
.entry-content th, .entry-content td { padding: 9px 12px; border-bottom: 1px solid rgba(15,27,42,.1); text-align: left; vertical-align: top; }
.entry-content thead th { background: var(--bg-soft); font-weight: 700; }
.entry-content tbody tr:hover td { background: var(--bg-softer); }
.entry-content ul, .entry-content ol { padding-left: 1.25em; }
.calc { background: var(--bg-soft); border: 1px solid rgba(15,27,42,.1); border-radius: 12px; padding: 18px 20px; margin: 18px 0; }
.calc h3 { margin: 0 0 10px; font-size: 1rem; }
.calc label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0; font-size: .92rem; }
.calc input { width: 120px; padding: 6px 8px; border: 1px solid rgba(15,27,42,.18); border-radius: 8px; font: inherit; }
.calc button { margin-top: 10px; padding: 8px 16px; border: 0; border-radius: 8px; background: var(--blue); color: #fff; font-weight: 600; cursor: pointer; }
.calc-out { margin: 12px 0 0; font-weight: 600; }
@media (max-width: 640px) { .entry-content table { font-size: .84rem; } .calc label { flex-direction: column; align-items: flex-start; gap: 4px; } }

/* Quick-reference callout ------------------------------------------------ */
.see-also { margin: 26px 0 0; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--bg-soft); border-radius: 0 10px 10px 0; font-size: .95rem; }
.see-also a { color: var(--blue); font-weight: 600; text-decoration: none; }
.see-also a:hover { text-decoration: underline; }


/* Map: graticule, richer land, larger hit targets ------------------------ */
.rm-grid line { stroke: rgba(29,95,191,.10); stroke-width: 1; }
.rm-land { fill: #dbe6f2; stroke: #ffffff; stroke-width: 1; stroke-linejoin: round; }
.rm-region { cursor: pointer; }
.rm-region .rm-hit { fill: transparent; pointer-events: all; }
.rm-region .rm-halo { fill: rgba(29,95,191,.08); pointer-events: none; transition: fill .2s ease; }
.rm-region:hover .rm-halo, .rm-region.is-hover .rm-halo { fill: rgba(29,95,191,.18); }
.rm-region.is-active .rm-halo { fill: rgba(19,70,143,.22); }
.rm-region:focus .rm-shape, .rm-region:focus-visible .rm-shape { stroke: var(--accent); stroke-width: 2.4; }
@media (max-width: 640px) { .rm-label { font-size: 13px; } }

.rm-leader { stroke: rgba(29,95,191,.32); stroke-width: 1; stroke-dasharray: 2 3; pointer-events: none; }
.rm-region:hover .rm-leader, .rm-region.is-hover .rm-leader, .rm-region.is-active .rm-leader { stroke: var(--blue); stroke-dasharray: none; }

/* Map depth: soft ocean tint and a shadow under the land shapes. */
.region-map__stage { background: radial-gradient(120% 120% at 50% 0%, #f8fbfe 0%, #eef4fb 55%, #e7eff8 100%); }
.rm-land { filter: drop-shadow(0 8px 12px rgba(29,95,191,.10)); }
/* rm-ocean-tint */


/* Reader poll ------------------------------------------------------------ */
.cnc-poll { margin: 40px 0 8px; padding: 22px 24px; border: 1px solid rgba(15,27,42,.12); border-radius: 14px; background: var(--bg-soft); }
.cnc-poll__kicker { margin: 0 0 6px; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.cnc-poll__q { margin: 0 0 16px; font-size: 1.06rem; line-height: 1.45; }
.cnc-poll__opt { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; font-size: .95rem; cursor: pointer; border-bottom: 1px solid rgba(15,27,42,.07); }
.cnc-poll__opt input { margin-top: 3px; }
.cnc-poll__btn { margin-top: 16px; padding: 9px 22px; border: 0; border-radius: 8px; background: var(--blue); color: #fff; font-weight: 700; cursor: pointer; font: inherit; }
.cnc-poll__meta { margin: 12px 0 0; font-size: .82rem; color: var(--ink-soft); }
.cnc-poll__results { list-style: none; margin: 0; padding: 0; }
.cnc-poll__results li { display: grid; grid-template-columns: 1fr 120px 48px; gap: 10px; align-items: center; padding: 8px 0; font-size: .92rem; }
.cnc-poll__bar { display: block; height: 8px; border-radius: 5px; background: rgba(29,95,191,.14); overflow: hidden; }
.cnc-poll__bar i { display: block; height: 100%; background: var(--blue); border-radius: 5px; }
.cnc-poll__pct { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
@media (max-width: 600px) { .cnc-poll__results li { grid-template-columns: 1fr; gap: 4px; } .cnc-poll__pct { text-align: left; } }


/* Source notes: thin rule, small type, italic body (Wikipedia-style) -------- */
.cnc-sources { margin-top: 46px; padding-top: 20px; border-top: 1px solid var(--line); }
.cnc-sources h2 { font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 12px; }
.cnc-sources__list { font-size: .84rem; font-style: italic; color: var(--ink-soft); }
.cnc-source { padding: 7px 0; border-bottom: 0; line-height: 1.55; }
.cnc-source__num { font-size: .76rem; font-style: normal; }
.cnc-source__meta { font-size: .76rem; font-style: normal; margin-top: 1px; }
.cnc-source__body a { text-decoration: underline; text-decoration-color: rgba(29,95,191,.32); }

.cnc-srcnote { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .84rem; font-style: italic; color: var(--ink-soft); line-height: 1.6; }
.cnc-srcnote__title { font-style: normal; font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 10px; }
.cnc-srcnote p { margin: 0 0 6px; }
.cnc-srcnote a { color: var(--ink-soft); text-decoration: underline; text-decoration-color: rgba(29,95,191,.32); }
.cnc-srcnote a:hover { color: var(--blue); }
