/* ============================================================
   MAPIM — app.css
   Colour palette: pine #0f4a3c | deep #0a2f27 | amber #f2a516
   All directional properties use logical equivalents for RTL.
   ============================================================ */

/* ---- CSS custom properties ---- */
:root {
  color-scheme: light;
  --ink:    #10201b;
  --pine:   #0f4a3c;
  --deep:   #0a2f27;
  --paper:  #ffffff;
  --wash:   #eef4f1;
  --line:   #d3dfda;
  --slate:  #51625c;
  --amber:  #f2a516;
  --shadow: 0 2px 12px rgba(10,47,39,.10);
  --display: "Bricolage Grotesque", "Trebuchet MS", Arial, sans-serif;
  --body:    "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --wrap: 1120px;
  --gut: clamp(20px, 5vw, 48px);
  --radius: 8px;
  --radius-sm: 4px;
  --radius-pill: 999px;
}

[lang="zh"] { --display: "Noto Sans SC", sans-serif; --body: "Noto Sans SC", sans-serif; }
[lang="ar"] { --display: "IBM Plex Sans Arabic", sans-serif; --body: "IBM Plex Sans Arabic", sans-serif; line-height: 1.8; }

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; }
a { color: inherit; }
h1, h2, h3, h4, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.1; letter-spacing: -.01em; text-wrap: balance; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }

/* ---- Layout ---- */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
.label { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--pine); }
section { scroll-margin-top: 70px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 50px; padding-block: 0; padding-inline: 24px;
  font-size: 15px; font-weight: 700; text-decoration: none;
  border: 2px solid var(--amber); border-radius: var(--radius);
  cursor: pointer; white-space: nowrap;
}
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color .15s, color .15s, border-color .15s, transform .12s; }
  .btn:hover { transform: translateY(-1px); }
  .btn:active { transform: translateY(0); }
}
.btn-go  { background: var(--amber); color: #1c1400; }
.btn-go:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.btn-line { background: transparent; color: var(--paper); border-color: #4d7a6d; }
.btn-line:hover { border-color: var(--amber); }
.btn-ghost { background: transparent; color: var(--pine); border-color: var(--line); }
.btn-ghost:hover { background: var(--pine); color: var(--paper); border-color: var(--pine); }
.btn-icon { min-height: 40px; min-width: 40px; padding-inline: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: var(--radius-sm); }
.btn-icon:hover { background: var(--wash); }
.btn-sm { min-height: 38px; padding-inline: 16px; font-size: 14px; }

/* ---- Sticky header ---- */
.head { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
@media (prefers-reduced-motion: no-preference) { .head { transition: box-shadow .2s; } }
.head.scrolled { box-shadow: 0 2px 16px rgba(10,47,39,.12); }
.head .wrap { display: flex; align-items: center; gap: 20px; min-height: 68px; }

.brand { display: grid; text-decoration: none; margin-inline-end: auto; line-height: 1.1; }
.brand b { font-family: var(--display); font-size: 26px; letter-spacing: .02em; color: var(--pine); }
.brand small { font-size: 10px; font-weight: 600; letter-spacing: .06em; color: var(--slate); }
.brand img { height: 40px; width: auto; }

.nav { display: flex; gap: 24px; }
.nav a { font-size: 15px; font-weight: 600; text-decoration: none; padding-block: 6px; border-bottom: 2px solid transparent; }
@media (prefers-reduced-motion: no-preference) { .nav a { transition: border-color .15s; } }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--amber); }

.lang-wrap { position: relative; }
.lang {
  min-width: 46px; height: 40px; border: 2px solid var(--pine);
  background: var(--paper); color: var(--pine); font: 700 13px var(--body);
  letter-spacing: .08em; cursor: pointer; border-radius: var(--radius-sm);
}
@media (prefers-reduced-motion: no-preference) { .lang { transition: background-color .15s, color .15s; } }
.lang:hover { background: var(--pine); color: var(--paper); }

.lang-menu {
  position: absolute; inset-block-start: calc(100% + 6px); inset-inline-end: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 140px; overflow: hidden; display: none; z-index: 30;
}
.lang-menu.open { display: block; }
.lang-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 14px; font-weight: 600; text-decoration: none; }
@media (prefers-reduced-motion: no-preference) { .lang-menu a { transition: background-color .12s; } }
.lang-menu a:hover { background: var(--wash); }
.lang-menu a[aria-current="true"] { color: var(--pine); background: var(--wash); }

.burger { display: none; width: 44px; height: 40px; border: 0; border-radius: var(--radius-sm); background: var(--pine); padding: 0; cursor: pointer; align-items: center; justify-content: center; flex-direction: column; gap: 5px; }
.burger i { display: block; width: 20px; height: 2px; background: var(--paper); }

/* Mobile slide panel */
.mobile-nav {
  position: fixed; inset-block: 0; inset-inline-end: -100%;
  width: min(320px, 90vw); background: var(--paper);
  box-shadow: -4px 0 24px rgba(10,47,39,.15); z-index: 50;
  overflow-y: auto; padding-block-start: 68px; padding-inline: var(--gut); padding-block-end: 32px;
}
@media (prefers-reduced-motion: no-preference) { .mobile-nav { transition: inset-inline-end .28s cubic-bezier(.4,0,.2,1); } }
[dir="rtl"] .mobile-nav { inset-inline-end: auto; inset-inline-start: -100%; box-shadow: 4px 0 24px rgba(10,47,39,.15); }
@media (prefers-reduced-motion: no-preference) { [dir="rtl"] .mobile-nav { transition: inset-inline-start .28s cubic-bezier(.4,0,.2,1); } }
.mobile-nav.open { inset-inline-end: 0; }
[dir="rtl"] .mobile-nav.open { inset-inline-start: 0; inset-inline-end: auto; }

.mobile-nav-overlay { display: none; position: fixed; inset: 0; background: rgba(10,47,39,.35); z-index: 40; }
.mobile-nav-overlay.open { display: block; }

.mobile-nav .nav-link { display: block; padding-block: 14px; font-size: 17px; font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); }
.mobile-nav .nav-link:last-child { border-bottom: 0; }
.mobile-nav .nav-link:hover { color: var(--pine); }

/* ---- Hero ---- */
.hero { background: var(--deep); color: var(--paper); }
.hero .wrap { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(28px,5vw,64px); align-items: end; padding-block: clamp(48px,8vw,104px); }
.hero .label { color: var(--amber); }
.hero h1 { font-size: clamp(40px,7vw,80px); margin-block-start: 16px; }
.hero h1 span { color: var(--amber); }
.hero .intro { color: #cfe0da; font-size: 19px; max-width: 33em; margin-block-start: 22px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 30px; }

.campaign { background: var(--pine); border-inline-start: 5px solid var(--amber); padding: 26px 24px; display: grid; gap: 12px; border-radius: var(--radius); }
.campaign .label { color: var(--amber); }
.campaign h2 { font-size: clamp(22px,2.6vw,28px); line-height: 1.2; }
.campaign p { color: #cfe0da; font-size: 15px; }
.campaign a { font-weight: 700; font-size: 15px; color: var(--amber); }

/* ---- Ticker ---- */
.ticker { background: var(--pine); color: var(--paper); font-size: 15px; }
.ticker .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding-block: 10px; }
.ticker .badge { background: var(--amber); color: #1c1400; font-size: 11px; font-weight: 700; letter-spacing: .14em; padding: 3px 8px; border-radius: 3px; text-transform: uppercase; }
.ticker a { font-weight: 600; text-underline-offset: 3px; }
.ticker time { color: #b8d2c9; font-size: 13px; }

/* ---- Facts ---- */
.facts { background: var(--wash); border-bottom: 1px solid var(--line); }
.facts dl { display: grid; grid-template-columns: repeat(4,1fr); }
.facts dl div { padding: 22px 16px 22px 0; }
.facts dl div + div { padding-inline-start: 20px; border-inline-start: 1px solid var(--line); }
.facts dt { font-family: var(--display); font-size: clamp(28px,3.6vw,40px); font-weight: 700; color: var(--pine); line-height: 1; font-variant-numeric: tabular-nums; }
.facts dd { font-size: 14px; color: var(--slate); margin-block-start: 6px; line-height: 1.35; }
.count-up { opacity: 0; transform: translateY(8px); }
@media (prefers-reduced-motion: no-preference) { .count-up { transition: opacity .4s, transform .4s; } }
.count-up.revealed { opacity: 1; transform: none; }

/* ---- Sections ---- */
.sec { padding-block: clamp(56px,8vw,100px); }
.wash { background: var(--wash); }
.split { display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px clamp(32px,6vw,80px); align-items: start; }
.split h2 { font-size: clamp(30px,4.2vw,46px); margin-block-start: 14px; }
.split .side p { color: var(--slate); margin-block-start: 16px; max-width: 30em; }
.lede { font-size: 19px; }
.stack { display: grid; gap: 18px; }
.stack p { color: var(--slate); }
.stack p.lede { color: var(--ink); }

/* ---- Vision / Mission ---- */
.vm { display: grid; gap: 20px; margin-block-start: 28px; }
.vision { background: var(--pine); color: var(--paper); padding: 24px; border-radius: var(--radius); }
.vision .label { color: var(--amber); }
.vision p { font-family: var(--display); font-weight: 500; font-size: clamp(20px,2.4vw,25px); line-height: 1.3; color: var(--paper); margin-block-start: 10px; }
.mission { border-block-start: 2px solid var(--pine); }
.mission li { padding: 14px 0 14px 28px; border-bottom: 1px solid var(--line); position: relative; }
[dir="rtl"] .mission li { padding-inline-start: 28px; padding-inline-end: 0; }
.mission li::before { content: ""; position: absolute; inset-inline-start: 0; top: 23px; width: 12px; height: 3px; background: var(--amber); }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-block-start: 8px; }
.people div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.people span { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--pine); }
.people b { display: block; font-size: 18px; margin-block-start: 4px; line-height: 1.3; }

/* ---- Newsroom ---- */
.news-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 28px clamp(28px,5vw,64px); align-items: start; }
.pres { background: var(--deep); color: var(--paper); border-radius: var(--radius); padding: clamp(24px,3.4vw,36px); display: grid; gap: 14px; border-block-start: 5px solid var(--amber); }
.pres .label { color: var(--amber); }
.pres h3 { font-size: clamp(24px,3vw,32px); line-height: 1.15; }
.pres p { color: #cfe0da; font-size: 16px; }
.pres .by { display: grid; gap: 2px; border-block-start: 1px solid #2c5a4d; padding-block-start: 14px; font-size: 14px; color: #b8d2c9; }
.pres .by b { color: var(--paper); font-size: 17px; }
.pres .btn { justify-self: start; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.filters button { min-height: 40px; padding-inline: 16px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--paper); color: var(--ink); font: 600 14px var(--body); cursor: pointer; }
@media (prefers-reduced-motion: no-preference) { .filters button { transition: background-color .12s, border-color .12s, color .12s; } }
.filters button:hover { background: var(--wash); }
.filters button[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: var(--paper); }
.feed li { display: grid; grid-template-columns: 104px 1fr; gap: 4px 18px; padding-block: 20px; border-bottom: 1px solid var(--line); }
.feed li[hidden] { display: none; }
.feed time { font-size: 13px; font-weight: 600; color: var(--slate); font-variant-numeric: tabular-nums; padding-block-start: 3px; }
.feed .tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--pine); margin-bottom: 4px; }
.feed h3 { font-family: var(--body); font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: 0; }
.feed h3 a { text-decoration: none; }
.feed h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.feed p { color: var(--slate); font-size: 15px; margin-block-start: 4px; }
.more { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-block-start: 20px; font-weight: 700; font-size: 15px; color: var(--pine); }

/* ---- Work areas ---- */
.work-head { display: grid; grid-template-columns: 1fr 1fr; gap: 16px clamp(32px,6vw,80px); align-items: end; }
.work-head h2 { font-size: clamp(30px,4.2vw,46px); margin-block-start: 14px; }
.work-head p { color: var(--slate); }
.work { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-block-start: clamp(30px,4vw,48px); }
.work li { background: var(--paper); border: 1px solid var(--line); border-block-start: 4px solid var(--pine); border-radius: var(--radius); padding: 24px 22px; display: grid; gap: 10px; align-content: start; }
@media (prefers-reduced-motion: no-preference) { .work li { transition: box-shadow .18s, transform .18s, border-block-start-color .18s; } }
.work li:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-block-start-color: var(--amber); }
.work h3 { font-size: 22px; line-height: 1.2; }
.work p { color: var(--slate); font-size: 16px; }

/* ---- Timeline ---- */
.time { border-inline-start: 3px solid var(--line); display: grid; gap: 26px; padding-inline-start: 24px; }
.time li { position: relative; }
.time li::before { content: ""; position: absolute; inset-inline-start: -33px; top: 9px; width: 15px; height: 15px; border-radius: 50%; background: var(--amber); border: 3px solid var(--wash); }
.time b { font-family: var(--display); font-size: 26px; color: var(--pine); font-variant-numeric: tabular-nums; line-height: 1; }
.time p { color: var(--slate); margin-block-start: 4px; max-width: 36em; }

/* ---- Creed ---- */
.creed { background: var(--deep); color: var(--paper); }
.creed .wrap { padding-block: clamp(48px,7vw,84px); }
.creed p { font-family: var(--display); font-weight: 500; font-size: clamp(26px,4.2vw,46px); line-height: 1.2; max-width: 19em; text-wrap: balance; }
.creed span { display: block; margin-block-start: 18px; font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); }

/* ---- Involve cards ---- */
.cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.cards li { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 8px; align-content: start; background: var(--paper); }
@media (prefers-reduced-motion: no-preference) { .cards li { transition: box-shadow .18s, transform .18s, border-color .18s; } }
.cards li:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--amber); }
.cards h3 { font-size: 21px; }
.cards p { color: var(--slate); font-size: 16px; }
.cards a { font-weight: 700; color: var(--pine); font-size: 15px; }
.note { margin-block-start: 20px; padding: 14px 16px; border-inline-start: 4px solid var(--amber); background: var(--wash); font-size: 15px; color: var(--slate); border-radius: 0 var(--radius) var(--radius) 0; }
.wash .note { background: var(--paper); }
.partners { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 22px; }
.partners li { border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 8px 16px; font-weight: 600; font-size: 15px; }

/* ---- Contact ---- */
.contact-card { border-block-start: 2px solid var(--pine); }
.contact-card div { display: grid; grid-template-columns: 150px 1fr; gap: 4px 20px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.contact-card dt { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--slate); text-transform: uppercase; padding-block-start: 3px; }
.contact-card dd { font-weight: 500; overflow-wrap: anywhere; }
.contact-form { display: grid; gap: 16px; margin-block-start: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: grid; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--slate); }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font: 16px var(--body); color: var(--ink); background: var(--paper); }
@media (prefers-reduced-motion: no-preference) { .form-group input, .form-group textarea, .form-group select { transition: border-color .15s; } }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--pine); }
.form-group textarea { min-height: 120px; resize: vertical; }

/* ---- Footer ---- */
.foot { background: var(--deep); color: #a9c2ba; font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; padding-block: 28px; }
.foot b { color: var(--paper); }
.foot a { color: #a9c2ba; text-underline-offset: 3px; }
.foot a:hover { color: var(--paper); }

/* ---- Reveal animations ---- */
.reveal { opacity: 0; transform: translateY(12px); }
@media (prefers-reduced-motion: no-preference) { .reveal { transition: opacity .45s, transform .45s; } }
.reveal.revealed { opacity: 1; transform: none; }

/* ---- Back to top ---- */
#back-top {
  position: fixed; inset-block-end: 24px; inset-inline-end: 24px;
  width: 44px; height: 44px; border-radius: var(--radius);
  background: var(--pine); color: var(--paper); border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; z-index: 30;
}
@media (prefers-reduced-motion: no-preference) { #back-top { transition: opacity .2s, transform .2s; } }
#back-top.visible { opacity: 1; pointer-events: auto; }
#back-top:hover { background: var(--deep); transform: translateY(-2px); }

/* ---- Reading progress bar ---- */
#read-progress { position: fixed; inset-block-start: 0; inset-inline-start: 0; height: 3px; background: var(--amber); width: 0%; z-index: 100; }
@media (prefers-reduced-motion: no-preference) { #read-progress { transition: width .1s; } }

/* ---- RTL arrow icon flip ---- */
[dir="rtl"] .icon-arrow { transform: scaleX(-1); }

/* ---- Alert / flash messages ---- */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 500; margin-block-end: 16px; }
.alert-success { background: #d1fae5; color: #065f46; border-inline-start: 4px solid #10b981; }
.alert-danger   { background: #fee2e2; color: #991b1b; border-inline-start: 4px solid #ef4444; }
.alert-warning  { background: #fef3c7; color: #92400e; border-inline-start: 4px solid var(--amber); }
.alert-info     { background: #dbeafe; color: #1e40af; border-inline-start: 4px solid #3b82f6; }

/* ---- Badge ---- */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: var(--radius-pill); font-size: .75rem; font-weight: 600; }
.badge-category { background: rgba(15,74,60,.1); color: var(--pine); }

/* ---- Article body ---- */
.article-body { font-size: 1.0625rem; line-height: 1.8; color: var(--ink); }
.article-body h2, .article-body h3 { color: var(--deep); margin-block: 1.5em .75em; }
.article-body p { margin-block-end: 1rem; }
.article-body img { max-width: 100%; height: auto; border-radius: var(--radius); }
.article-body blockquote { border-inline-start: 4px solid var(--amber); margin-inline: 0; padding: 1rem 1.5rem; background: var(--wash); border-radius: 0 var(--radius) var(--radius) 0; }

/* ---- Utilities ---- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.text-center { text-align: center; }
.mt-auto { margin-block-start: auto; }
.fallback-notice { background: #fff3cd; border: 1px solid #ffc107; border-radius: var(--radius); padding: .75rem 1rem; font-size: .875rem; margin-block-end: 1.5rem; color: #664d03; }

/* ---- Auth layout ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--wash); }
.auth-card { background: var(--paper); border-radius: var(--radius); padding: 40px; width: 100%; max-width: 420px; box-shadow: var(--shadow); }

/* ============================================================
   NEWS & ARTICLE PAGES
   ============================================================ */

/* Layout shells */
.container    { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
.container-sm { max-width: 760px; margin-inline: auto; padding-inline: var(--gut); }
.section      { padding-block: clamp(40px,6vw,72px); }
.section-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--pine); margin-block-end: .5rem; }
.section-title { font-size: clamp(1.375rem,2.6vw,2rem); color: var(--deep); line-height: 1.1; margin-block-end: 1.5rem; }

/* Quick layout utilities */
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-items-start { align-items: flex-start; }
.gap-3 { gap: 1rem; }
.mb-3  { margin-block-end: 1rem; }
.mb-4  { margin-block-end: 1.5rem; }
.py-5  { padding-block: 3rem; }

/* Button additions */
.btn-primary { background: var(--pine); color: var(--paper); border-color: var(--pine); }
.btn-primary:hover { background: var(--deep); border-color: var(--deep); color: var(--paper); }

/* Form select */
.form-select { padding: .5rem .875rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font: 15px var(--body); color: var(--ink); background: var(--paper); cursor: pointer; }
.form-select:focus { outline: none; border-color: var(--pine); }
.form-select-sm { font-size: 14px; padding: .35rem .75rem; }

/* Search form */
.search-form { display: flex; gap: .5rem; align-items: center; }
.search-form input[type="search"] { padding: .5rem .875rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font: 15px var(--body); color: var(--ink); min-width: 200px; }
@media (prefers-reduced-motion: no-preference) { .search-form input[type="search"] { transition: border-color .15s; } }
.search-form input[type="search"]:focus { outline: none; border-color: var(--pine); }

/* Category filter pills */
.filter-pills { display: flex; flex-wrap: wrap; gap: .4rem; margin-block-end: 1.5rem; }
.filter-pill {
  display: inline-flex; align-items: center; padding: .3rem .85rem;
  border: 1.5px solid var(--line); border-radius: var(--radius-pill);
  font-size: .875rem; font-weight: 600; text-decoration: none; color: var(--ink);
}
@media (prefers-reduced-motion: no-preference) { .filter-pill { transition: background-color .14s, border-color .14s, color .14s; } }
.filter-pill:hover { border-color: var(--pine); color: var(--pine); background: var(--wash); }
.filter-pill.active { background: var(--pine); border-color: var(--pine); color: var(--paper); }

/* Post grid — responsive card layout (news listing & related articles) */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }

/* News card */
.news-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
@media (prefers-reduced-motion: no-preference) {
  .news-card { transition: transform .22s cubic-bezier(.4,0,.2,1), box-shadow .22s; }
  .news-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(10,47,39,.12); }
}
.news-card__cover { display: block; overflow: hidden; aspect-ratio: 16/9; background: var(--wash); }
.news-card__cover img { width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: no-preference) {
  .news-card__cover img { transition: transform .38s cubic-bezier(.4,0,.2,1); }
  .news-card:hover .news-card__cover img { transform: scale(1.05); }
}
.news-card__body  { padding: 1rem 1.125rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.news-card__cat   { font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--pine); }
.news-card__title { font-family: var(--body); font-size: .9375rem; font-weight: 700; line-height: 1.4; letter-spacing: 0; }
.news-card__title a { text-decoration: none; color: var(--ink); }
@media (prefers-reduced-motion: no-preference) { .news-card__title a { transition: color .14s; } }
.news-card__title a:hover { color: var(--pine); }
.news-card__excerpt { font-size: .875rem; color: var(--slate); line-height: 1.5; }
.news-card__meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin-block-start: auto; padding-block-start: .5rem; }
.news-card__meta time, .news-card__meta span { font-size: .8125rem; color: var(--slate); }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem; margin-block-start: 2.5rem; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.25rem; height: 2.25rem; padding-inline: .5rem;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 600; text-decoration: none; color: var(--ink);
}
@media (prefers-reduced-motion: no-preference) { .pagination a { transition: background-color .14s, border-color .14s, color .14s; } }
.pagination a:hover { background: var(--wash); border-color: var(--pine); color: var(--pine); }
.pagination span.active { background: var(--pine); border-color: var(--pine); color: var(--paper); }

/* ---- Article detail ---- */

/* Dark gradient header */
.article-header {
  background: linear-gradient(150deg, var(--deep) 0%, var(--pine) 100%);
  color: var(--paper);
  padding-block: clamp(48px,7vw,88px) clamp(32px,4vw,56px);
  position: relative;
}
.article-header::after {
  content: ''; display: block;
  position: absolute; inset-block-end: 0; inset-inline: 0;
  height: 4px; background: var(--amber);
}

/* Meta row */
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-block-end: 1.25rem; }
.article-header .badge-category { background: rgba(242,165,22,.18); color: var(--amber); border: 1px solid rgba(242,165,22,.3); }
.article-header time { font-size: .875rem; color: rgba(255,255,255,.65); }
.article-header span { font-size: .875rem; color: rgba(255,255,255,.5); }

/* H1 & lead text */
.article-header h1  { color: var(--paper); font-size: clamp(1.5rem,3.6vw,2.5rem); line-height: 1.18; margin-block-end: 1rem; }
.article-lead { font-size: 1.125rem; color: rgba(255,255,255,.75); line-height: 1.65; margin-block-end: 1.5rem; }

/* Language switch pills */
.lang-switch { display: flex; flex-wrap: wrap; gap: .4rem; }
.lang-switch a {
  display: inline-flex; align-items: center; padding: .3rem .85rem;
  border: 1.5px solid rgba(255,255,255,.22); border-radius: var(--radius-pill);
  font-size: .8125rem; font-weight: 700; text-decoration: none; color: rgba(255,255,255,.6);
}
@media (prefers-reduced-motion: no-preference) { .lang-switch a { transition: background-color .15s, color .15s, border-color .15s; } }
.lang-switch a:hover { border-color: var(--amber); color: var(--amber); }
.lang-switch a.active { background: var(--amber); border-color: var(--amber); color: #1c1400; }

/* Cover image */
.article-cover {
  width: 100%; border-radius: var(--radius); object-fit: cover; aspect-ratio: 16/9;
  box-shadow: 0 12px 48px rgba(10,47,39,.22); display: block;
}

/* Article body — enhanced typography */
.article-body { font-size: 1.0625rem; line-height: 1.85; color: var(--ink); }
.article-body > * + * { margin-block-start: 1em; }
.article-body h2 { font-size: clamp(1.25rem,2.4vw,1.625rem); color: var(--deep); margin-block: 2em .6em; }
.article-body h3 { font-size: clamp(1.1rem,2vw,1.3125rem); color: var(--deep); margin-block: 1.6em .5em; }
.article-body p  { margin-block-end: 1.1em; }
.article-body a  { color: var(--pine); text-underline-offset: 3px; }
.article-body a:hover { color: var(--amber); }
.article-body ul { padding-inline-start: 1.5rem; list-style: disc; }
.article-body ol { padding-inline-start: 1.5rem; list-style: decimal; }
.article-body li { margin-block-end: .4em; }
.article-body hr { border: 0; border-block-start: 1px solid var(--line); margin-block: 2rem; }
.article-body table { width: 100%; border-collapse: collapse; font-size: .9375rem; margin-block: 1.5rem; }
.article-body th, .article-body td { padding: .6rem 1rem; border: 1px solid var(--line); }
.article-body th { background: var(--wash); font-weight: 700; color: var(--deep); }
.article-body blockquote {
  border-inline-start: 4px solid var(--amber); margin-inline: 0;
  padding: 1rem 1.5rem; background: var(--wash);
  border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; color: var(--slate);
}
.article-body img { border-radius: var(--radius); margin-block: 1.5rem; box-shadow: 0 4px 16px rgba(10,47,39,.1); }

/* Signatory */
.signatory { margin-block-start: 2rem; padding-block-start: 1.5rem; border-block-start: 1px solid var(--line); }
.signatory__name  { font-weight: 700; color: var(--deep); margin: 0; }
.signatory__title { color: var(--slate); margin: .25rem 0 0; }

/* Share buttons */
.share-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.share-btn {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .5rem 1rem; border-radius: var(--radius-pill);
  font-size: .8125rem; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; line-height: 1; white-space: nowrap;
}
@media (prefers-reduced-motion: no-preference) {
  .share-btn { transition: transform .15s, box-shadow .15s; }
  .share-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
  .share-btn:active { transform: none; box-shadow: none; }
}
.share-btn-wa   { background: #25d366; color: #fff; }
.share-btn-fb   { background: #1877f2; color: #fff; }
.share-btn-x    { background: #000;    color: #fff; }
.share-btn-tg   { background: #2ba5e0; color: #fff; }
.share-btn-copy { background: var(--wash); color: var(--ink); border-color: var(--line); }
.share-btn-copy:hover { background: var(--paper); border-color: var(--pine); }

/* Article prev/next nav */
.article-nav { background: var(--wash); }
.article-nav .btn-line { color: var(--pine); border-color: var(--line); background: var(--paper); }
.article-nav .btn-line:hover { border-color: var(--pine); background: var(--paper); color: var(--deep); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 860px) {
  .burger { display: flex; }
  .nav    { display: none; }
  .hero .wrap, .split, .work-head, .news-grid { grid-template-columns: 1fr; }
  .feed li { grid-template-columns: 1fr; }
  .facts dl { grid-template-columns: 1fr 1fr; }
  .facts dl div, .facts dl div + div { padding: 18px 12px 18px 0; border-inline-start: 0; border-bottom: 1px solid var(--line); }
  .work, .cards { grid-template-columns: 1fr; }
  .people { grid-template-columns: 1fr; }
  .contact-card div { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr 1fr; }
  .search-form input[type="search"] { min-width: 140px; }
}
@media (max-width: 540px) {
  .facts dl { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
  .article-nav .container { flex-direction: column; }
  .article-nav .btn-line { text-align: center; }
}

/* ---- Reduced motion (belt & suspenders) ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal, .count-up { opacity: 1; transform: none; }
}
