/* =====================================================================
   Public theme — light glassmorphism, blue / violet / teal accents.
   Works on top of Bootstrap 5 (local copy).
   ===================================================================== */

/* ---------- Fonts (self-hosted) ---------- */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-700.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("../fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("../fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("../fonts/poppins-700.woff2") format("woff2"); }

/* ---------- Design tokens ---------- */
:root {
  --bg: #f5f8fe;
  --bg-2: #eef4fd;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --border: rgba(255, 255, 255, 0.9);
  --border-soft: rgba(30, 64, 130, 0.09);
  --text: #0b1b3f;
  --text-2: #24365c;
  --muted: #5a6a85;
  --link: #2253d8;
  --brand: #2563eb;
  --brand-2: #5b4cf0;
  --teal: #13b9a3;
  --brand-soft: rgba(37, 99, 235, 0.09);
  --grad: linear-gradient(90deg, #2563eb 0%, #5b4cf0 100%);
  --grad-teal: linear-gradient(90deg, #3157f5 0%, #13c4a3 100%);
  --grad-text: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
  --grad-soft: linear-gradient(120deg, rgba(219, 234, 254, .8) 0%, rgba(236, 253, 245, .7) 100%);
  --shadow-sm: 0 2px 10px rgba(30, 64, 130, 0.05);
  --shadow: 0 10px 30px rgba(30, 64, 130, 0.07);
  --shadow-lg: 0 22px 50px rgba(30, 64, 130, 0.12);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --blur: 16px;
  --focus: #f59e0b;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Poppins", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --header-h: 76px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #070f1f;
  --bg-2: #0a1630;
  --surface: rgba(17, 30, 56, 0.66);
  --surface-strong: rgba(19, 34, 63, 0.92);
  --surface-solid: #101e3a;
  --border: rgba(148, 180, 255, 0.12);
  --border-soft: rgba(148, 180, 255, 0.12);
  --text: #eaf0ff;
  --text-2: #c9d5f0;
  --muted: #9fb0cf;
  --link: #8fb2ff;
  --brand: #5b8cff;
  --brand-soft: rgba(91, 140, 255, 0.14);
  --grad-text: linear-gradient(90deg, #7aa2ff 0%, #38d3f0 100%);
  --grad-soft: linear-gradient(120deg, rgba(37, 99, 235, .14) 0%, rgba(19, 185, 163, .08) 100%);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 22px 50px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

/* Category colour tones */
.tone-teal   { --tone: #0f9f8c; --tone-bg: #dcf7ef; }
.tone-blue   { --tone: #2563eb; --tone-bg: #e1ebff; }
.tone-purple { --tone: #7c3aed; --tone-bg: #efe7ff; }
.tone-orange { --tone: #ea6c12; --tone-bg: #ffeddc; }
.tone-indigo { --tone: #4f46e5; --tone-bg: #e6e6ff; }
.tone-pink   { --tone: #db2777; --tone-bg: #fde4f0; }
[data-theme="dark"] [class*="tone-"] { --tone-bg: rgba(255, 255, 255, .08); }
[data-theme="dark"] .tone-teal { --tone: #34d6bd; } [data-theme="dark"] .tone-blue { --tone: #7aa2ff; }
[data-theme="dark"] .tone-purple { --tone: #b08cff; } [data-theme="dark"] .tone-orange { --tone: #ffa45c; }
[data-theme="dark"] .tone-indigo { --tone: #9b94ff; } [data-theme="dark"] .tone-pink { --tone: #ff7ab6; }

/* ---------- Base ---------- */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.65; color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1000px 520px at 0% -5%, rgba(191, 219, 254, .55), transparent 60%),
    radial-gradient(900px 520px at 100% 10%, rgba(204, 251, 241, .45), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed; min-height: 100vh; -webkit-font-smoothing: antialiased;
}
[data-theme="dark"] body {
  background-image: radial-gradient(1000px 520px at 0% -5%, rgba(37, 99, 235, .18), transparent 60%),
    radial-gradient(900px 520px at 100% 10%, rgba(19, 185, 163, .1), transparent 60%), linear-gradient(180deg, var(--bg), var(--bg-2));
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); color: var(--text); font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-2); }
img { max-width: 100%; height: auto; }
::selection { background: rgba(37, 99, 235, .18); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.text-muted-2 { color: var(--muted) !important; }
.narrow { max-width: 860px; }
.gradient-text, .text-accent { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 2000; background: var(--surface-solid); color: var(--text); padding: .6rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.skip-link:focus { top: 1rem; }
main:focus { outline: none; }
.bg-orbs { display: none; }

/* ---------- Glass surfaces ---------- */
.glass-card {
  background: var(--surface);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%); backdrop-filter: blur(var(--blur)) saturate(160%);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass-card { background: var(--surface-strong); } }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; transition: transform .15s ease, box-shadow .2s ease, background .2s ease; padding: .55rem 1.25rem; }
.btn-lg { padding: .8rem 1.6rem; font-size: 1rem; }
.btn-sm { padding: .42rem 1rem; font-size: .85rem; }
.btn-brand { background: var(--grad); color: #fff; border: 0; box-shadow: 0 8px 20px rgba(59, 76, 240, .28); }
.btn-brand:hover, .btn-brand:focus-visible { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 26px rgba(59, 76, 240, .34); }
.btn-outline-brand { color: var(--brand); border: 1px solid rgba(37, 99, 235, .3); background: var(--surface-strong); }
.btn-outline-brand:hover { color: #fff; background: var(--brand); border-color: var(--brand); }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border-soft); background: var(--surface-solid); color: var(--text-2); transition: all .2s ease; padding: 0; text-decoration: none; box-shadow: var(--shadow-sm); }
.icon-btn:hover { color: var(--brand); border-color: rgba(37, 99, 235, .35); }
.link-arrow { font-weight: 500; font-size: .9rem; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; color: var(--text-2); }
.link-arrow:hover { color: var(--brand); }
.link-arrow .icon { transition: transform .2s; }
.link-arrow:hover .icon { transform: translateX(3px); }

/* Pills */
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: .3rem .8rem; border-radius: 999px; margin-bottom: 1rem; }
.pill-mint { background: linear-gradient(90deg, #d7f7ec, #dff4ff); color: #0b7d6c; border: 1px solid rgba(19, 185, 163, .25); }
[data-theme="dark"] .pill-mint { background: rgba(19, 185, 163, .15); color: #5ee6cf; }
.badge-cat {
  display: inline-block; align-self: flex-start; font-size: .74rem; font-weight: 600; color: var(--tone, var(--brand));
  background: var(--tone-bg, var(--brand-soft)); padding: .26rem .7rem; border-radius: 999px; text-decoration: none; margin-bottom: .7rem;
}
.badge-cat:hover { filter: brightness(.95); color: var(--tone, var(--brand)); }
.tag-pill { display: inline-flex; align-items: center; gap: .25rem; padding: .35rem .85rem; border-radius: 999px; font-size: .86rem; background: var(--surface-solid); border: 1px solid var(--border-soft); color: var(--text-2); text-decoration: none; transition: all .2s; }
.tag-pill:hover { border-color: var(--brand); color: var(--brand); }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin-bottom: .6rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 1030; padding: 12px 0 0; }
.glass-nav {
  margin: 0 auto; max-width: 1296px; width: calc(100% - 24px); background: var(--surface-strong);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-sm); padding: .55rem .4rem;
}
.navbar-brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none; margin-right: 1rem; }
.navbar-brand:hover { color: var(--text); }
.brand-mark {
  font-family: var(--font-head); font-weight: 700; font-style: italic; font-size: 1.85rem; letter-spacing: -.08em; line-height: 1;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #38bdf8 100%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .1em;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text { font-family: var(--font-head); font-weight: 600; font-size: 1.12rem; }
.brand-tag { font-size: .74rem; color: var(--muted); letter-spacing: .01em; }
.brand-logo { height: 72px; width: auto; max-width: 240px; object-fit: contain; }
.navbar-nav { gap: .15rem; }
.navbar-nav .nav-link { color: var(--text-2); font-weight: 500; font-size: .92rem; padding: .5rem .95rem !important; border-radius: 999px; }
.navbar-nav .nav-link:hover { color: var(--brand); }
.navbar-nav .nav-link.active { color: var(--brand); background: linear-gradient(90deg, #e4edff, #e9f3ff); font-weight: 600; }
[data-theme="dark"] .navbar-nav .nav-link.active { background: var(--brand-soft); }
.header-actions { display: flex; gap: .5rem; align-items: center; }
.navbar-toggler { border: 1px solid var(--border-soft); box-shadow: none !important; }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline; }
.header-search { position: relative; margin-left: .5rem; }
.header-search input {
  width: 220px; height: 42px; border-radius: 999px; border: 1px solid var(--border-soft); background: var(--surface-solid);
  color: var(--text); padding: 0 1rem 0 2.5rem; font-size: .88rem; transition: width .25s ease, box-shadow .2s;
}
.header-search input:focus { width: 260px; outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); border-color: var(--brand); }
.header-search-icon { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 280px; z-index: 1050; padding: .35rem; background: var(--surface-strong); }
.search-suggest a { display: block; padding: .55rem .7rem; border-radius: 10px; text-decoration: none; color: var(--text); font-size: .9rem; }
.search-suggest a small { display: block; color: var(--muted); font-size: .75rem; }
.search-suggest a:hover, .search-suggest a.active { background: var(--brand-soft); }
@media (max-width: 991.98px) {
  .navbar-collapse { padding: .75rem .25rem .5rem; }
  .header-search { margin: .75rem 0 0; }
  .header-search input, .header-search input:focus { width: 100%; }
  .brand-mark { font-size: 1.6rem; }
  .brand-text { font-size: 1rem; }
}

/* ---------- Layout helpers ---------- */
.section-pad { padding: 3.25rem 0; }
.section-pad-sm { padding: 1.75rem 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.section-title { font-size: clamp(1.3rem, 2.1vw, 1.6rem); font-weight: 600; margin: 0; display: inline-flex; align-items: center; gap: .9rem; }
.section-title::after, .side-title-line::after { content: ""; width: 34px; height: 3px; border-radius: 3px; background: var(--grad-teal); display: inline-block; }

/* ---------- Hero ---------- */
.hero-card { position: relative; overflow: hidden; border-radius: var(--radius-lg); min-height: 400px; display: flex; align-items: center; background: linear-gradient(110deg, rgba(255,255,255,.95) 0%, rgba(240,247,255,.9) 45%, rgba(230,244,255,.6) 100%); }
[data-theme="dark"] .hero-card { background: linear-gradient(110deg, rgba(16,30,58,.95), rgba(12,26,52,.8)); }
.hero-bg { position: absolute; top: 0; right: 0; bottom: 0; width: 58%; z-index: 0; -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 32%); mask-image: linear-gradient(90deg, transparent 0%, #000 32%); }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-text { position: relative; z-index: 1; padding: 2.75rem 3rem; max-width: 640px; }
.hero-title { font-size: clamp(1.9rem, 3.6vw, 2.9rem); font-weight: 700; line-height: 1.17; margin-bottom: 1rem; }
.hero-lead { color: var(--text-2); font-size: 1.05rem; margin-bottom: 1.25rem; max-width: 34rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; color: var(--muted); font-size: .9rem; margin-bottom: 1.6rem; }
.hero-meta > * { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); text-decoration: none; }
.hero-meta a:hover { color: var(--brand); }
@media (max-width: 991.98px) {
  .hero-card { min-height: 0; }
  .hero-bg { width: 100%; opacity: .14; -webkit-mask-image: linear-gradient(200deg, #000 0%, transparent 70%); mask-image: linear-gradient(200deg, #000 0%, transparent 70%); }
  .hero-text { padding: 1.75rem 1.4rem; }
}

/* ---------- Category cards ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.cat-card { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; text-decoration: none; color: var(--text); transition: transform .2s, box-shadow .2s; position: relative; }
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--text); }
.cat-icon { width: 52px; height: 52px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--tone, var(--brand)); background: var(--tone-bg, var(--brand-soft)); flex-shrink: 0; }
.cat-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.cat-text strong { font-family: var(--font-head); font-weight: 600; font-size: .95rem; }
.cat-text small { color: var(--muted); font-size: .8rem; }
.cat-arrow { margin-left: auto; color: var(--muted); transition: transform .2s; }
.cat-card:hover .cat-arrow { transform: translateX(3px); color: var(--tone); }
@media (max-width: 575.98px) {
  .cat-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .cat-card { flex-direction: row; padding: .8rem; gap: .6rem; }
  .cat-icon { width: 42px; height: 42px; }
  .cat-icon .icon { width: 20px; height: 20px; }
  .cat-arrow { position: absolute; right: .7rem; bottom: .55rem; }
}
.cat-chip-icon { width: 52px; height: 52px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--brand); background: var(--brand-soft); }

/* ---------- Home two-column layout ---------- */
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.75rem; align-items: start; }
.home-side { display: flex; flex-direction: column; gap: 1.25rem; }
@media (max-width: 991.98px) { .home-layout { grid-template-columns: 1fr; } }
.side-card { padding: 1.4rem; }
.side-title { font-size: 1.08rem; font-weight: 600; margin-bottom: .5rem; display: flex; align-items: center; gap: .8rem; }
.round-icon { width: 48px; height: 48px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0; color: var(--tone); background: var(--tone-bg); }
.avatar-navy.avatar-initials { background: #0b1b3f; color: #fff; }
[data-theme="dark"] .avatar-navy.avatar-initials { background: var(--grad); }
.mini-list { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; flex-direction: column; gap: 1rem; }
.mini-list li { display: flex; gap: .85rem; align-items: flex-start; }
.mini-thumb { width: 72px; height: 54px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: var(--grad-soft); display: block; }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-title { display: block; font-size: .88rem; font-weight: 500; color: var(--text); text-decoration: none; line-height: 1.35; }
.mini-title:hover { color: var(--brand); }
.mini-date { display: block; font-size: .78rem; color: var(--muted); margin-top: .2rem; }

/* ---------- Post cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.post-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 991.98px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .post-grid, .post-grid-2 { grid-template-columns: 1fr; } }
.post-card { display: flex; flex-direction: column; overflow: hidden; padding: .55rem; transition: transform .25s ease, box-shadow .25s ease; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post-card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 13px; background: var(--grad-soft); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.post-card:hover .post-card-media img { transform: scale(1.04); }
.media-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: var(--brand); opacity: .6; }
.post-card-body { padding: 1rem .8rem .55rem; display: flex; flex-direction: column; flex: 1; }
.post-card-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 .5rem; line-height: 1.4; }
.post-card-title a { color: var(--text); text-decoration: none; }
.post-card-title a:hover { color: var(--brand); }
.post-card-excerpt { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.post-card-foot { margin-top: auto; display: flex; align-items: center; gap: .4rem 1.1rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.post-card-foot > span { display: inline-flex; align-items: center; gap: .35rem; }
.card-arrow { margin-left: auto; color: var(--brand); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; transition: background .2s, transform .2s; }
.card-arrow:hover { background: var(--brand-soft); transform: translateX(2px); }
.post-card-compact { flex-direction: row; align-items: center; gap: .9rem; box-shadow: none; background: var(--surface-strong); margin-bottom: .75rem; }
.post-card-compact:hover { transform: none; box-shadow: var(--shadow-sm); }
.post-card-compact .post-card-media { width: 110px; flex-shrink: 0; aspect-ratio: 4 / 3; }
.post-card-compact .post-card-body { padding: 0; }

.post-meta { display: flex; flex-wrap: wrap; gap: .45rem 1rem; align-items: center; font-size: .86rem; color: var(--muted); }
.post-meta > span, .post-meta > a { display: inline-flex; align-items: center; gap: .35rem; }
.post-meta-author { color: var(--text-2); text-decoration: none; font-weight: 500; }
.post-meta-author:hover { color: var(--brand); }
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--surface-solid); }
.avatar-initials { display: inline-grid; place-items: center; background: var(--grad); color: #fff; font-weight: 600; font-family: var(--font-head); }

/* ---------- Author box ---------- */
.author-box { display: flex; gap: 1.4rem; padding: 1.6rem; align-items: flex-start; }
.author-box h1 a, .author-box h2 a { color: var(--text); text-decoration: none; }
.author-hero { padding: 2.2rem; }
@media (max-width: 575.98px) { .author-box { flex-direction: column; padding: 1.25rem; } }

/* ---------- Newsletter ---------- */
.newsletter-row { display: flex; gap: .5rem; }
.newsletter-row .form-control { min-width: 0; border-radius: 999px; padding-left: 1rem; }
.nl-stacked .newsletter-row { flex-direction: column; gap: .75rem; }
.nl-stacked .newsletter-row .form-control { height: 44px; }
.nl-stacked .btn-brand, .nl-inline .btn-brand { background: var(--grad-teal); box-shadow: 0 8px 20px rgba(19, 160, 180, .25); }
.nl-stacked .btn-brand { width: 100%; height: 44px; }
@media (max-width: 400px) { .newsletter-row { flex-direction: column; } }
.newsletter-inline { padding: 1.5rem; margin-top: 1.5rem; }
.form-status.is-success { color: #047857; }
.form-status.is-error { color: #b91c1c; }
[data-theme="dark"] .form-status.is-success { color: #6ee7b7; }
[data-theme="dark"] .form-status.is-error { color: #fca5a5; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 12px; border-color: var(--border-soft); background-color: var(--surface-solid); color: var(--text); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); background-color: var(--surface-solid); color: var(--text); }
.form-control::placeholder { color: var(--muted); opacity: .8; }
.form-label { font-weight: 500; color: var(--text-2); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* ---------- Archive pages ---------- */
.archive-hero { padding: 2rem; position: relative; overflow: hidden; }
.archive-hero::before { content: ""; position: absolute; inset: 0; background: var(--grad-soft); z-index: -1; }
.archive-title { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 700; margin-bottom: .6rem; }
.archive-desc { color: var(--text-2); font-size: 1.04rem; max-width: 760px; }
.subcats { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.filter-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: .75rem; margin-top: 1.25rem; }
@media (max-width: 767.98px) { .filter-bar { grid-template-columns: 1fr 1fr; } }
.empty-state .icon { color: var(--brand); }

/* ---------- Breadcrumbs & pagination ---------- */
.breadcrumb-nav .breadcrumb { font-size: .85rem; margin-bottom: 1rem; flex-wrap: wrap; }
.breadcrumb-item a { color: var(--muted); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--brand); }
.breadcrumb-item.active { color: var(--text-2); max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--muted); }
.pagination-nav { margin-top: 2.5rem; }
.pagination { gap: .35rem; flex-wrap: wrap; }
.page-link { border-radius: 999px !important; border: 1px solid var(--border-soft); background: var(--surface-solid); color: var(--text-2); display: inline-flex; align-items: center; min-width: 42px; justify-content: center; }
.page-link:hover { color: var(--brand); background: var(--surface-solid); }
.page-item.active .page-link { background: var(--grad); border-color: transparent; color: #fff; }
.page-item.disabled .page-link { background: transparent; color: var(--muted); }

/* ---------- Article ---------- */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1100; pointer-events: none; }
.reading-progress span { display: block; height: 100%; width: 0; background: var(--grad-teal); transition: width .1s linear; }
.preview-banner { background: #fef3c7; color: #78350f; text-align: center; padding: .6rem 1rem; font-weight: 600; font-size: .9rem; }
.article-header { padding: 2.25rem; overflow: hidden; }
.article-header-text { max-width: 860px; }
.article-title { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 700; line-height: 1.16; margin: .2rem 0 1rem; }
.article-lead { font-size: 1.12rem; color: var(--text-2); margin-bottom: 1.25rem; }
.article-figure { margin: 1.75rem -1.6rem -1.6rem; padding: 0 .55rem .55rem; }
.article-figure img { width: 100%; max-height: 540px; object-fit: cover; display: block; border-radius: 14px; }
.article-figure figcaption { font-size: .84rem; color: var(--muted); padding: .6rem .5rem 0; }
.article-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1.75rem; margin-top: 1.75rem; align-items: start; }
.article-aside { position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 1rem; }
@media (max-width: 991.98px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-aside { position: static; }
  .article-header { padding: 1.4rem; }
  .article-figure { margin: 1.25rem -.85rem -.85rem; }
}
.toc { padding: 1rem 1.1rem; font-size: .9rem; }
.toc-toggle { background: none; border: 0; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: .4rem; padding: 0; margin-bottom: .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li a { display: block; padding: .35rem .6rem; border-left: 2px solid var(--border-soft); color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc li.toc-l3 a { padding-left: 1.4rem; font-size: .85rem; }
.toc li a:hover, .toc li a.active { color: var(--brand); border-left-color: var(--brand); background: var(--brand-soft); }
.share { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; padding: .9rem 1rem; }
.share-label { font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); width: 100%; }
.share .icon-btn { width: 36px; height: 36px; }

/* Prose */
.prose { padding: 2.4rem; font-size: 1.06rem; line-height: 1.8; color: var(--text-2); }
@media (max-width: 575.98px) { .prose { padding: 1.35rem; font-size: 1.02rem; } }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.55rem; font-weight: 600; margin: 2.3rem 0 1rem; }
.prose h3 { font-size: 1.25rem; font-weight: 600; margin: 1.9rem 0 .75rem; }
.prose h4 { font-size: 1.08rem; margin: 1.5rem 0 .6rem; }
.prose p { margin-bottom: 1.2rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin-bottom: 1.4rem; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--brand); }
.prose strong { color: var(--text); }
.prose a { font-weight: 500; }
.prose a.ext-link::after { content: "↗"; font-size: .8em; margin-left: .15em; }
.prose blockquote { margin: 2rem 0; padding: 1.2rem 1.5rem; border-left: 4px solid var(--brand); background: var(--grad-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-family: var(--font-head); font-size: 1.12rem; color: var(--text); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { border-radius: var(--radius-sm); box-shadow: var(--shadow); margin: 1rem 0; }
.prose figure { margin: 2rem 0; }
.prose figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: .5rem; }
.prose hr { margin: 2.5rem 0; border-color: var(--border-soft); opacity: 1; }
.prose code { background: var(--brand-soft); color: var(--text); padding: .12rem .4rem; border-radius: 6px; font-size: .9em; }
.prose pre { background: #0b1b3f; color: #e2e8f0; padding: 1.25rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: .9rem; margin: 1.5rem 0; }
.prose pre code { background: none; color: inherit; padding: 0; }
.table-wrap { overflow-x: auto; margin: 1.75rem 0; border-radius: var(--radius-sm); border: 1px solid var(--border-soft); background: var(--surface-solid); }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 0; }
.prose th, .prose td { padding: .75rem 1rem; border-bottom: 1px solid var(--border-soft); text-align: left; vertical-align: top; }
.prose thead th { background: var(--brand-soft); color: var(--text); font-weight: 600; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose-sm { color: var(--text-2); }
.article-tags { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1.5rem; color: var(--muted); }
.post-adjacent { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.adj-link { padding: 1.1rem 1.25rem; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: .3rem; transition: transform .2s; }
.adj-link:hover { transform: translateY(-2px); color: var(--brand); }
.adj-link small { color: var(--muted); display: inline-flex; align-items: center; gap: .3rem; }
.adj-link.text-end small { justify-content: flex-end; }
.adj-link span { font-weight: 600; line-height: 1.35; font-family: var(--font-head); }
@media (max-width: 575.98px) { .post-adjacent { grid-template-columns: 1fr; } }
.comments { padding: 1.75rem; margin-top: 1.5rem; }
.comment { padding: 1rem 0; border-bottom: 1px solid var(--border-soft); }
.comment-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; }
.contact-points li { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }

/* ---------- Footer ---------- */
.site-footer { padding: 2rem 0 1.5rem; margin-top: 1rem; }
.grow-band { display: flex; align-items: center; gap: 1.1rem; padding: 1.25rem 1.6rem; flex-wrap: wrap; background: var(--grad-soft); }
.grow-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-solid); color: var(--brand); box-shadow: var(--shadow-sm); flex-shrink: 0; }
.grow-copy { flex: 1; min-width: 200px; }
.grow-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 .15rem; }
.grow-copy p { font-size: .86rem; color: var(--muted); }
.social-links { display: flex; gap: .55rem; flex-wrap: wrap; }
.social-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-solid); color: var(--brand); box-shadow: var(--shadow-sm); border: 1px solid var(--border-soft); transition: transform .2s; }
.social-btn:hover { transform: translateY(-2px); color: var(--brand-2); }
.footer-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding: 1.75rem .5rem .75rem; }
.footer-bar .brand-mark { font-size: 1.6rem; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; padding: 0; margin: 0; font-size: .88rem; }
.footer-links a, .footer-legal a { color: var(--text-2); text-decoration: none; }
.footer-links a:hover, .footer-legal a:hover { color: var(--brand); }
.footer-copy { font-size: .82rem; color: var(--muted); }
.footer-legal { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; padding: 0 .5rem; margin: 0; font-size: .8rem; }
.footer-legal a { color: var(--muted); }

/* ---------- Mobile tab bar ---------- */
.tabbar {
  position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 1040; display: flex; justify-content: space-around;
  background: var(--surface-strong); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); padding: .4rem .25rem calc(.4rem + env(safe-area-inset-bottom));
}
.tabbar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .68rem; color: var(--muted); text-decoration: none; background: none; border: 0; padding: .3rem .1rem; border-radius: 14px; min-width: 0; }
.tabbar-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tabbar-item.active, .tabbar-item:hover { color: var(--brand); }
.tabbar-item.active { background: var(--brand-soft); font-weight: 600; }
@media (max-width: 991.98px) {
  body { padding-bottom: 86px; }
  .back-to-top { bottom: 92px !important; }
  .cookie-banner { bottom: 92px !important; }
}

.back-to-top { position: fixed; right: 1rem; bottom: 1rem; z-index: 1035; box-shadow: var(--shadow); }
.cookie-banner { position: fixed; bottom: 1rem; left: 1rem; right: 1rem; max-width: 520px; padding: 1.1rem 1.25rem; z-index: 1090; background: var(--surface-strong); box-shadow: var(--shadow-lg); }

/* ---------- Dark-mode Bootstrap alerts ---------- */
[data-theme="dark"] .alert-success { background: rgba(16, 185, 129, .12); color: #a7f3d0; border-color: rgba(16, 185, 129, .3); }
[data-theme="dark"] .alert-danger { background: rgba(239, 68, 68, .12); color: #fecaca; border-color: rgba(239, 68, 68, .3); }
[data-theme="dark"] .alert-warning { background: rgba(245, 158, 11, .12); color: #fde68a; border-color: rgba(245, 158, 11, .3); }
[data-theme="dark"] .alert-info { background: rgba(14, 165, 233, .12); color: #bae6fd; border-color: rgba(14, 165, 233, .3); }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .post-card:hover, .cat-card:hover, .adj-link:hover, .btn-brand:hover { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .tabbar, .article-aside, .newsletter-inline, .comments, .post-adjacent, .back-to-top, .reading-progress, .cookie-banner { display: none !important; }
  .glass-card { box-shadow: none; border: 0; background: #fff; }
  body { background: #fff; padding: 0; }
  .article-layout { display: block; }
}

/* =====================================================================
   Engagement: likes, comments, home enhancements
   ===================================================================== */

/* Hero stats (floating glass card) */
.hero-stats { position: absolute; right: 1.5rem; bottom: 1.5rem; z-index: 2; list-style: none; margin: 0; padding: .7rem .9rem; display: flex; gap: 1.1rem;
  background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .95); border-radius: 16px; box-shadow: var(--shadow); }
[data-theme="dark"] .hero-stats { background: rgba(16, 30, 58, .85); border-color: var(--border); }
.hero-stats li { display: flex; align-items: center; gap: .55rem; }
.hero-stats strong { display: block; font-family: var(--font-head); font-size: 1.05rem; line-height: 1.1; color: var(--text); }
.hero-stats small { font-size: .72rem; color: var(--muted); }
.hero-stat-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--tone); background: var(--tone-bg); }
@media (max-width: 991.98px) {
  .hero-card { flex-direction: column; align-items: stretch; }
  .hero-stats { position: relative; right: auto; bottom: auto; margin: 0 1.4rem 1.4rem; justify-content: space-around; flex-wrap: wrap; }
}

/* Topic tabs above latest posts */
.post-tabs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .35rem; margin-bottom: 1.1rem; scrollbar-width: none; }
.post-tabs::-webkit-scrollbar { display: none; }
.post-tab { flex-shrink: 0; padding: .42rem 1rem; border-radius: 999px; font-size: .86rem; font-weight: 500; text-decoration: none; color: var(--text-2);
  background: var(--surface-solid); border: 1px solid var(--border-soft); transition: all .2s; }
.post-tab:hover { color: var(--tone, var(--brand)); border-color: var(--tone, var(--brand)); }
.post-tab.active { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 6px 16px rgba(59, 76, 240, .25); }
[data-post-grid] { transition: opacity .2s; }
[data-post-grid].is-loading { opacity: .45; pointer-events: none; }

/* Card stats */
.card-stat { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); text-decoration: none; }
a.card-stat:hover { color: var(--brand); }
.card-stat .icon-heart { color: #e24a7b; }

/* Engagement bar on articles */
.engage-bar { display: flex; align-items: center; gap: .6rem; padding: .75rem; margin-top: 1.25rem; flex-wrap: wrap; }
.engage-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--border-soft);
  background: var(--surface-solid); color: var(--text-2); font-weight: 500; font-size: .92rem; text-decoration: none; cursor: pointer; transition: all .2s; }
.engage-btn:hover { color: var(--brand); border-color: rgba(37, 99, 235, .35); }
.engage-count { min-width: 1.4rem; padding: .05rem .45rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .78rem; font-weight: 600; text-align: center; }
.like-btn .icon { transition: transform .2s, fill .2s; }
.like-btn:hover { color: #e24a7b; border-color: rgba(226, 74, 123, .35); }
.like-btn.is-liked { color: #e24a7b; background: #fff0f5; border-color: rgba(226, 74, 123, .35); }
[data-theme="dark"] .like-btn.is-liked { background: rgba(226, 74, 123, .14); }
.like-btn.is-liked .icon { fill: currentColor; }
.like-btn.is-liked .engage-count { background: rgba(226, 74, 123, .12); color: #d43d6d; }
.like-btn.pop .icon { animation: heart-pop .45s ease; }
@keyframes heart-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@media (max-width: 400px) { .engage-btn { padding: .5rem .75rem; } }

/* Comments */
.comments-title { font-size: 1.2rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.comments-title .icon { color: var(--brand); }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment { display: flex; gap: .85rem; padding: 1rem 0; border-bottom: 1px solid var(--border-soft); }
.comment-replies .comment:last-child, .comment-list > .comment:last-child { border-bottom: 0; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .25rem; flex-wrap: wrap; }
.comment-head time { font-size: .78rem; color: var(--muted); }
.comment-body p { color: var(--text-2); overflow-wrap: anywhere; }
.comment-replies { margin-top: .5rem; padding-left: 1rem; border-left: 2px solid var(--brand-soft); }
.comment-replies .comment { padding: .75rem 0; }
.reply-btn, .btn-link-reset { background: none; border: 0; padding: 0; color: var(--brand); font-size: .82rem; font-weight: 500; display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; }
.reply-btn:hover, .btn-link-reset:hover { text-decoration: underline; }
.comment-form { margin-top: 1.25rem; padding: 1.25rem; border-radius: var(--radius); background: var(--grad-soft); }
.replying-to { font-size: .86rem; color: var(--text-2); background: var(--surface-solid); border-radius: 10px; padding: .45rem .75rem; margin-bottom: .75rem; display: inline-flex; gap: .4rem; align-items: center; }

/* Sidebar tabs, ranking, tag cloud */
.side-tabs { display: flex; gap: .3rem; padding: .25rem; background: var(--brand-soft); border-radius: 999px; margin-bottom: .25rem; }
.side-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 0; background: none; border-radius: 999px; padding: .45rem .6rem; font-size: .85rem; font-weight: 500; color: var(--text-2); }
.side-tab.active { background: var(--surface-solid); color: var(--brand); box-shadow: var(--shadow-sm); font-weight: 600; }
.mini-thumb { position: relative; }
.rank-badge { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--grad); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.mini-list.ranked { list-style: none; }
.mini-date .icon-heart { color: #e24a7b; vertical-align: -1px; }
.mini-note { font-size: .74rem; color: var(--muted); margin: .9rem 0 0; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; }
.tag-cloud .tag-pill { font-size: .8rem; padding: .3rem .7rem; }
.tag-count { font-size: .7rem; color: var(--muted); }

/* Scroll reveal: only applied by JS, so content stays visible without it */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* Mobile fixes */
@media (max-width: 991.98px) {
  .home-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-text { order: 1; }
  .hero-stats { order: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .5rem; padding: .6rem; }
  .hero-stats li { flex-direction: column; text-align: center; gap: .3rem; }
}
@media (max-width: 575.98px) {
  .engage-bar { flex-wrap: nowrap; gap: .4rem; }
  .engage-bar [data-share-url] .engage-label { display: none; }
  .engage-btn { padding: .5rem .8rem; }
}

/* Larger image logo */
@media (max-width: 991.98px) { .brand-logo { height: 54px; max-width: 180px; } }
/* Logo per theme: transparent logo in light mode, light-coloured variant in dark mode */
.brand-logo-dark { display: none; }
[data-theme="dark"] .brand-logo-light { display: none; }
[data-theme="dark"] .brand-logo-dark { display: inline-block; }
