/* فيبالك — static stylesheet
   Design: cool paper + ink, one accent (#3d9ae2), Tajawal throughout.
   Structure: hairline rules divide lists; no decorative cards. */

:root {
  --paper: #f6f4ef;
  --surface: #ffffff;
  --ink: #14202c;
  --ink-2: #3c4b5b;
  --muted: #6f7f8f;
  --line: #e2ded4;
  --accent: #f0a432;
  --accent-deep: #9a5b00;
  --accent-soft: #faedd2;
  --measure: 41rem;
  --wrap: 1200px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

/* Light by default. Dark only when the visitor picks it with the toggle. */
:root[data-theme="dark"] {
  --paper: #0e1721;
  --surface: #15212e;
  --ink: #eef2f6;
  --ink-2: #b9c4cf;
  --muted: #8593a1;
  --line: #22313f;
  --accent: #f0a432;
  --accent-deep: #f5c26b;
  --accent-soft: #2a2415;
  color-scheme: dark;
}

*, *::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: "Tajawal", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.9;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-deep); }
p { margin: 0 0 1.1em; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 100; }
.skip:focus { inset-inline-start: 8px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; }

.portrait { object-position: center 18%; }
.brand span { color: var(--ink); }
.slogan { margin: 40px 0 0; padding: 4px 0 4px 22px; padding-inline: 0 22px; border-inline-start: 3px solid var(--accent); font-size: 1.22rem; line-height: 1.9; color: var(--ink-2); max-width: 46rem; }
.main-nav { flex: 1; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; white-space: nowrap; }
.main-nav a { display: block; padding: 6px 12px; font-weight: 500; color: var(--ink-2); border-radius: 999px; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--accent-deep); background: var(--accent-soft); }
.tools { display: flex; gap: 6px; }
.icon-btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  width: 40px; height: 40px; border-radius: 999px; cursor: pointer; display: grid; place-items: center;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-deep); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Search dialog ---------- */
.search-dialog {
  width: min(640px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--ink); padding: 0; margin-top: 12vh;
}
.search-dialog::backdrop { background: rgb(5 12 18 / .55); }
.search-dialog form { padding: 20px; }
.search-dialog input {
  width: 100%; font: inherit; font-size: 1.15rem; padding: 12px 14px;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 4px;
}
.search-results { list-style: none; margin: 14px 0 0; padding: 0; max-height: 52vh; overflow: auto; }
.search-results li { border-top: 1px solid var(--line); }
.search-results a { display: block; padding: 12px 4px; }
.search-results small { color: var(--muted); display: block; }
.search-empty { color: var(--muted); padding: 12px 4px; margin: 0; }

/* ---------- Shared bits ---------- */
.kicker { color: var(--accent-deep); font-weight: 700; font-size: .95rem; }
.meta { color: var(--muted); font-size: .95rem; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.meta a { color: var(--ink-2); font-weight: 500; }
.meta a:hover { color: var(--accent-deep); }
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: inline-grid; place-items: center; font-weight: 800; font-size: 1rem;
  background: var(--accent-soft); color: var(--accent-deep);
}
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar.lg { width: 84px; height: 84px; font-size: 2rem; }
.byline { display: inline-flex; align-items: center; gap: 10px; }
.byline a { font-weight: 700; color: var(--ink); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 4px; }
.section-head h2 { font-size: 1.5rem; font-weight: 800; }
.section-head a { color: var(--accent-deep); font-weight: 500; font-size: .98rem; }

/* ---------- Home lead ---------- */
.lead { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; padding: 56px 0 48px; }
.lead h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); font-weight: 800; line-height: 1.3; margin: 14px 0 18px; letter-spacing: -.01em; }
.lead h1 a:hover { color: var(--accent-deep); }
.lead p.dek { font-size: 1.2rem; color: var(--ink-2); line-height: 1.9; max-width: 34rem; }
.lead .meta { margin-top: 22px; }
.lead-media { position: relative; }
.lead-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- Home layout ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; padding-bottom: 72px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { border-bottom: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 26px; padding: 26px 0; align-items: center; }
.row .thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.row .thumb.empty { aspect-ratio: 16 / 10; background: var(--accent-soft); }
.row h3 { font-size: 1.32rem; font-weight: 700; margin: 6px 0 10px; line-height: 1.5; }
.row h3 a:hover { color: var(--accent-deep); }
.row p.ex { color: var(--ink-2); margin: 0 0 12px; font-size: 1rem; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Sidebar ---------- */
.side section { padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.side h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 12px; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; color: var(--ink-2); font-weight: 500; }
.side li a:hover { color: var(--accent-deep); }
.side .count { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.side .author-li a { justify-content: flex-start; }
.side .author-li .avatar { width: 30px; height: 30px; font-size: .85rem; }

/* ---------- Archive / category / author headers ---------- */
.page-head { padding: 56px 0 30px; border-bottom: 2px solid var(--ink); margin-bottom: 8px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; margin-bottom: 10px; }
.page-head p { color: var(--ink-2); margin: 0; max-width: 40rem; }
.page-head.author { display: flex; gap: 24px; align-items: center; }
.list-wrap { padding-bottom: 72px; }
.more { display: flex; justify-content: center; margin-top: 28px; }
.btn {
  appearance: none; font: inherit; font-weight: 700; padding: 12px 26px; cursor: pointer;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink); border-radius: 999px;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }

/* ---------- Article ---------- */
.progress { position: fixed; top: 0; inset-inline-start: 0; height: 3px; width: 0; background: var(--accent); z-index: 60; }
.back { display: inline-block; margin: 36px 0 0; color: var(--muted); font-weight: 500; }
.back:hover { color: var(--accent-deep); }
.article-head { max-width: var(--measure); margin: 26px auto 0; }
.article-head h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 800; line-height: 1.4; margin: 14px 0 20px; }
.article-head .dek { font-size: 1.2rem; color: var(--ink-2); margin-bottom: 22px; }
.article-head .meta { padding-block: 16px; border-block: 1px solid var(--line); }
.hero { margin: 36px auto 40px; width: min(1040px, 100%); }
.hero img { width: 100%; max-height: 620px; object-fit: cover; }
.hero figcaption, .prose figcaption { color: var(--muted); font-size: .9rem; padding-top: 8px; }

.prose { max-width: var(--measure); margin-inline: auto; font-size: 1.18rem; line-height: 2.05; color: var(--ink); }
.prose > * + * { margin-top: 0; }
.prose p { margin-bottom: 1.35em; }
.prose h2 { font-size: 1.65rem; font-weight: 800; margin: 2em 0 .6em; }
.prose h3 { font-size: 1.36rem; font-weight: 700; margin: 1.8em 0 .5em; }
.prose a { color: var(--accent-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.prose a:hover { color: var(--ink); }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin-bottom: 1.35em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.8em 0; padding: 4px 22px; border-inline-start: 3px solid var(--accent); color: var(--ink-2); font-size: 1.1em; }
.prose img { margin-block: 1.6em; width: auto; max-width: 100%; height: auto; }
.prose img.aligncenter, .prose .aligncenter { margin-inline: auto; }
.prose .alignright, .prose img.alignright { float: right; margin-inline: 0 1.6em; margin-block: .4em 1em; max-width: 46%; }
.prose .alignleft, .prose img.alignleft { float: left; margin-inline: 1.6em 0; margin-block: .4em 1em; max-width: 46%; }
.prose .alignnone { margin-block: 1.6em; }
.prose figure { margin: 1.8em 0; }
.prose figure img { margin: 0; }
.prose::after { content: ""; display: block; clear: both; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 1.6em 0; font-size: .95em; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em auto; width: 40%; }
.embed { position: relative; aspect-ratio: 16 / 9; margin: 1.8em 0; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.article-end { max-width: var(--measure); margin: 56px auto 0; padding: 26px 0; border-block: 1px solid var(--line); display: flex; gap: 18px; align-items: center; }
.article-end p { margin: 0; color: var(--ink-2); }
.article-end strong { display: block; font-size: 1.1rem; color: var(--ink); margin-bottom: 2px; }
.related { max-width: var(--measure); margin: 0 auto; padding: 56px 0 72px; }
.related .rows > li:first-child { border-top: 1px solid var(--line); }
.related .row { grid-template-columns: 150px minmax(0, 1fr); padding: 20px 0; }

/* ---------- Static pages ---------- */
.static { max-width: var(--measure); margin: 56px auto 80px; }
.static h1 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 800; margin-bottom: 28px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 44px 0 36px; color: var(--ink-2); font-size: .98rem; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px 40px; align-items: flex-start; }
.foot .brand { color: var(--ink); }
.foot nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; }
.foot nav a:hover { color: var(--accent-deep); }
.foot small { display: block; color: var(--muted); margin-top: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .lead { grid-template-columns: 1fr; gap: 32px; padding-top: 36px; }
  .lead-media { order: -1; }
  .home-grid { grid-template-columns: 1fr; gap: 40px; }
  .side { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
  .side section:last-child { border-bottom: 0; }
}

@media (max-width: 600px) {
  body { font-size: 1.02rem; }
  .wrap { padding-inline: 16px; }
  .row { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 20px 0; }
  .row h3 { font-size: 1.1rem; }
  .row p.ex { display: none; }
  .related .row { grid-template-columns: 96px minmax(0, 1fr); }
  .side { grid-template-columns: 1fr; }
  .bar { min-height: 60px; gap: 10px; }
  .brand span { display: none; }
  .prose { font-size: 1.08rem; line-height: 2; }
  .prose .alignright, .prose .alignleft { float: none; max-width: 100%; margin-inline: 0; }
  .article-end { flex-direction: column; align-items: flex-start; }
  .page-head.author { flex-direction: column; align-items: flex-start; }
}

/* ---------- Dark-mode polish ---------- */
:root[data-theme="dark"] .site-header { background: color-mix(in srgb, var(--paper) 86%, transparent); }
:root[data-theme="dark"] img { opacity: .94; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Team ---------- */
.team { list-style: none; margin: 0; padding: 8px 0 80px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 36px; }
.member { text-align: center; display: flex; flex-direction: column; align-items: center; }
.portrait { width: 152px; height: 152px; border-radius: 50%; object-fit: cover; margin-bottom: 22px; box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--line); }
.member h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 6px; }
.member .role { color: var(--accent-deep); font-weight: 500; font-size: .96rem; margin: 0 0 12px; }
.member .bio { color: var(--ink-2); font-size: .98rem; line-height: 1.8; margin: 0 0 14px; max-width: 22rem; }
.member .links { display: flex; gap: 14px; }
.member .links a { color: var(--muted); font-size: .92rem; font-weight: 500; border-bottom: 1px solid var(--line); }
.member .links a:hover { color: var(--accent-deep); border-color: var(--accent); }
@media (max-width: 920px) { .team { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 24px; } }
@media (max-width: 520px) { .team { grid-template-columns: 1fr; } .portrait { width: 128px; height: 128px; } }

/* ---------- Header v2: quote band, centered logo, icon category nav ---------- */
.site-header { position: relative; background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; }
.topline { background: #111d2b; color: #f6f4ef; }
.topline-inner { display: flex; align-items: center; justify-content: center; gap: 14px; padding-block: 13px; }
.topline .quote { margin: 0; font-size: 1.08rem; font-weight: 500; line-height: 1.7; text-align: center; }
.qicon { width: 20px; height: 20px; flex: none; color: var(--accent); }
.masthead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding-block: 22px 18px; }
.masthead .brand { grid-column: 2; justify-self: center; }

.masthead .tools { grid-column: 3; justify-self: end; display: flex; gap: 8px; }
.cat-nav { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); overflow-x: auto; scrollbar-width: none; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav ul { display: flex; justify-content: center; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; list-style: none; }
.cat-nav a { display: inline-flex; align-items: center; gap: 8px; padding: 14px 16px; white-space: nowrap; font-weight: 500; color: var(--ink-2); border-bottom: 2px solid transparent; transition: color .2s var(--ease), border-color .2s var(--ease); }
.cat-nav a:hover { color: var(--accent-deep); border-bottom-color: var(--line); }
.cat-nav a[aria-current="page"] { color: var(--accent-deep); border-bottom-color: var(--accent); background: none; }
.ci { width: 19px; height: 19px; flex: none; color: var(--accent-deep); }
.cat-title { display: flex; align-items: center; gap: 14px; }
.cat-title .ci { width: 34px; height: 34px; }
.side .ci { width: 18px; height: 18px; }
.side li a { justify-content: flex-start; }
.side li a .count { margin-inline-start: auto; }
.slogan { display: none; }
@media (max-width: 600px) {
  .topline-inner { padding-block: 10px; }
  .topline .quote { font-size: .95rem; }
  .masthead { padding-block: 14px 12px; }
  
  .cat-nav a { padding: 12px 12px; }
}

/* ---------- Logo: light/dark pair, no tile ---------- */
.masthead .brand img, .brand img { background: none; padding: 0; border-radius: 0; height: auto; width: auto; }
.brand img.logo-light { height: 48px; }
.foot .brand img.logo-light, .foot .brand img.logo-dark { height: 60px; }
.brand img.logo-dark { display: none; }
:root[data-theme="dark"] .brand img.logo-light { display: none; }
:root[data-theme="dark"] .brand img.logo-dark { display: block; }


/* ---------- Thumbnails: real colours ---------- */
.row .thumb { background: none; }
.row .thumb img { filter: none; mix-blend-mode: normal; opacity: 1; }
.row:hover .thumb img { filter: none; }

/* ---------- Homepage sections ---------- */
.sec { padding: 44px 0 40px; border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.sec-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); flex: none; }
.sec-ico .ci { color: #111d2b; width: 22px; height: 22px; }
.sec-head h2 { font-size: 1.7rem; font-weight: 800; }
.more-link { margin-inline-start: auto; color: var(--accent-deep); font-weight: 500; white-space: nowrap; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.more-link:hover { color: var(--ink); }
.feature { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 30px; align-items: center; }
.feature-media { display: block; overflow: hidden; border-radius: 6px; background: var(--accent-soft); aspect-ratio: 16 / 10; }
.feature-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.feature:hover .feature-media img { transform: scale(1.03); }
.feature-body h3 { font-size: 1.55rem; font-weight: 800; line-height: 1.5; margin: 0 0 12px; }
.feature-body h3 a:hover { color: var(--accent-deep); }
.feature-body .ex { color: var(--ink-2); line-height: 1.85; margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.latest-head { margin-top: 44px; }
.more-wrap { text-align: center; margin: 28px 0 0; }
@media (max-width: 920px) { .feature { grid-template-columns: 1fr; gap: 18px; } }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 44px 0 0; }
.pg, .pg-step { min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-weight: 500; color: var(--ink-2); background: var(--surface); }
a.pg:hover, a.pg-step:hover { border-color: var(--accent); color: var(--accent-deep); }
.pg[aria-current="page"] { background: #111d2b; border-color: #111d2b; color: #f6f4ef; }
.pg-step.disabled { opacity: .4; }

/* ---------- Header: single bar (logo, categories, tools) under the quote band ---------- */
.site-header { position: relative; background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 22px; min-height: 84px; }
.brand { flex: none; display: inline-flex; }
.brand img { height: 48px; width: auto; background: none; padding: 0; border-radius: 0; }
.bar .cat-nav { flex: 1; min-width: 0; border: 0; background: none; overflow-x: auto; scrollbar-width: none; }
.bar .cat-nav ul { justify-content: flex-start; }
.bar .cat-nav a { padding: 10px 12px; }
.bar .tools { flex: none; margin-inline-start: auto; }
.masthead { display: none; }
@media (max-width: 720px) {
  .bar { min-height: 64px; gap: 12px; }
  .brand img.logo-light { height: 40px; }
  .bar .cat-nav a span { display: none; }
}

/* ---------- Home slider ---------- */
.home-top { padding-top: 26px; }
.slider { position: relative; overflow: hidden; border-radius: 10px; background: #111d2b; aspect-ratio: 21 / 9; min-height: 340px; color: #f6f4ef; }
.slides { position: absolute; inset: 0; }
.slide { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity .9s var(--ease), visibility .9s; }
.slide.is-active { opacity: 1; visibility: visible; }
.slide > img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 6s linear; }
.slide.is-active > img { transform: scale(1); }
.slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 18, 28, .94) 0%, rgba(10, 18, 28, .5) 48%, rgba(10, 18, 28, 0) 78%); }
.slide figcaption { position: absolute; inset-inline: 0; bottom: 0; z-index: 1; padding: 40px 64px 72px; max-width: 56rem; }
.slide-cat { display: inline-block; background: var(--accent); color: #111d2b; font-weight: 700; font-size: .92rem; padding: 4px 14px; border-radius: 999px; }
.slide h2 { font-size: clamp(1.45rem, 3vw, 2.35rem); font-weight: 800; line-height: 1.45; margin: 14px 0 10px; }
.slide h2 a { color: #f6f4ef; }
.slide h2 a:hover { color: var(--accent); }
.slide-meta { margin: 0; color: #cfd8e2; }
.s-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 50px; height: 50px; border-radius: 50%; border: 0; background: rgba(246, 244, 239, .92); color: #111d2b; display: grid; place-items: center; cursor: pointer; transition: background .2s, transform .2s; }
.s-btn:hover { background: var(--accent); }
.s-btn svg { width: 22px; height: 22px; }
.s-prev { inset-inline-start: 18px; }
.s-next { inset-inline-end: 18px; }
.dots { position: absolute; bottom: 26px; inset-inline-end: 64px; z-index: 2; display: flex; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 999px; border: 0; padding: 0; background: rgba(246, 244, 239, .45); cursor: pointer; transition: width .3s var(--ease), background .3s; }
.dot.is-active { width: 30px; background: var(--accent); }
.slider:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 720px) {
  .slider { aspect-ratio: 4 / 5; min-height: 460px; border-radius: 8px; }
  .slide figcaption { padding: 24px 22px 60px; }
  .s-btn { display: none; }
  .dots { inset-inline-end: auto; inset-inline-start: 22px; bottom: 22px; }
}
@media (prefers-reduced-motion: reduce) { .slide, .slide > img { transition: none; } }

.bar .cat-nav ul { flex-wrap: nowrap; }
.bar .cat-nav a { padding: 10px 9px; font-size: .97rem; }

.home-grid { padding-top: 56px; }

.s-btn { top: 22px; transform: none; }
.s-prev { inset-inline-start: 22px; }
.s-next { inset-inline-end: 22px; }

/* ---------- Quote band ---------- */
.topline {
  position: relative;
  background-color: #111d2b;
  background-image: radial-gradient(rgba(240, 164, 50, .16) 1px, transparent 1.2px);
  background-size: 16px 16px;
  border-bottom: 2px solid var(--accent);
}
.topline-inner { gap: 18px; padding-block: 16px; }
.topline .quote { font-size: 1.16rem; font-weight: 700; letter-spacing: 0; color: #f6f4ef; }
.topline .qicon { width: 26px; height: 26px; color: var(--accent); }
@media (max-width: 600px) {
  .topline-inner { gap: 10px; padding-block: 12px; }
  .topline .quote { font-size: 1rem; }
  .topline .qicon { width: 20px; height: 20px; }
}
.topline-inner { padding-block: 9px; gap: 14px; }
.topline .quote { font-size: 1rem; }
.topline .qicon { width: 20px; height: 20px; }

/* ---------- Join page ---------- */
.join { max-width: 58rem; margin: 56px auto 84px; }
.join-hero { max-width: 44rem; }
.join-q { color: var(--accent-deep); font-weight: 700; font-size: 1.15rem; margin: 0 0 10px; }
.join h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; margin-bottom: 20px; }
.join-lead { font-size: 1.14rem; line-height: 2; color: var(--ink-2); margin: 0; }
.join-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 48px 0 40px; }
.join-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 26px 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); transition: border-color .2s, transform .2s; }
.join-card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
.join-card.primary { background: #111d2b; border-color: #111d2b; color: #f6f4ef; }
.join-card.primary:hover { border-color: var(--accent); }
.join-ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #111d2b; }
.join-ico svg { width: 26px; height: 26px; }
.join-title { font-size: 1.2rem; font-weight: 700; line-height: 1.5; }
.join-ext { width: 24px; height: 24px; opacity: .7; }
.join-ext svg { width: 24px; height: 24px; }
.join-note { border-inline-start: 3px solid var(--accent); padding: 4px 22px; color: var(--ink-2); font-size: 1.08rem; line-height: 2; margin: 0; max-width: 46rem; }
.join-note strong { color: var(--ink); }
@media (max-width: 720px) { .join-cards { grid-template-columns: 1fr; } .join { margin-top: 36px; } }

/* ---------- Static pages: bold-only paragraphs read as section titles ---------- */
.prose p:has(> strong:only-child) { font-size: 1.32rem; font-weight: 800; color: var(--ink); margin: 1.9em 0 .5em; line-height: 1.5; }
.prose p:empty, .prose p:has(> br:only-child), .prose p:has(> &nbsp;:only-child) { margin: 0; }
.prose hr { margin: 2.2em auto; }

/* ---------- Imported content must never widen the page ---------- */
.prose * { max-width: 100% !important; box-sizing: border-box; }
.prose [style*="width"] { width: auto !important; }
.prose img { height: auto !important; }
.prose, .prose p, .prose div, .prose span { overflow-wrap: anywhere; }

/* ---------- Quote band: logo's pale brown ---------- */
.topline { background: #d2c2b0; background-image: none; color: #14202c; border-bottom: 1px solid #b9a893; }
.topline .quote { color: #14202c; }
.topline .qicon { color: #14202c; }

/* ---------- Quote icons: larger, bolder ---------- */
.topline .qicon { width: 30px; height: 30px; color: #111d2b; opacity: 1; }
@media (max-width: 600px) { .topline .qicon { width: 24px; height: 24px; } }

/* ---------- Quote icons: opening top, closing bottom and turned around ---------- */
.topline-inner { align-items: center; }
.qicon-open { transform: translateY(-7px); }
.qicon-close { transform: translateY(7px) rotate(180deg); }

/* ---------- Quote icons: swap sides ---------- */
.topline-inner { flex-direction: row-reverse; }

/* ---------- Homepage: three articles per category ---------- */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.card-media { display: block; overflow: hidden; border-radius: 6px; background: var(--accent-soft); aspect-ratio: 4 / 3; margin-bottom: 14px; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card-media img { transform: scale(1.04); }
.card h3 { font-size: 1.14rem; font-weight: 700; line-height: 1.6; margin: 0 0 10px; }
.card h3 a:hover { color: var(--accent-deep); }
.card .meta { font-size: .92rem; }
@media (max-width: 920px) { .trio { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .trio { grid-template-columns: 1fr; } }

/* ---------- Authors index ---------- */
.authors-grid { list-style: none; margin: 0; padding: 36px 0 84px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 34px 26px; }
.author-card a { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.avatar.xl { width: 116px; height: 116px; font-size: 2.4rem; box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--line); }
.author-name { font-weight: 800; font-size: 1.08rem; }
.author-count { color: var(--muted); font-size: .94rem; }
.author-card a:hover .author-name { color: var(--accent-deep); }
.bar .cat-nav a.authors-link { color: var(--accent-deep); font-weight: 700; }

/* ---------- Header spans the full width; logo sits at the screen edge ---------- */
.site-header .bar { max-width: none; padding-inline: clamp(16px, 2.6vw, 40px); }

/* ---------- Main menu: categories as a dropdown ---------- */
.bar .cat-nav { overflow: visible; }
.has-sub { position: relative; }
.has-sub details { position: relative; }
.has-sub summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 700; color: var(--accent-deep); border-radius: 8px; }
.has-sub summary::-webkit-details-marker { display: none; }
.has-sub summary:hover, .has-sub details[open] summary { background: var(--accent-soft); }
.has-sub summary .ci { color: var(--accent-deep); }
.has-sub .sub { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 70; list-style: none; margin: 0; padding: 8px; min-width: 260px; max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(17, 29, 43, .14); display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.has-sub .sub a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; white-space: nowrap; font-weight: 500; }
.has-sub .sub a:hover { background: var(--accent-soft); color: var(--accent-deep); }
.has-sub .sub a[aria-current="page"] { color: var(--accent-deep); background: var(--accent-soft); }

/* ---------- Categories dropdown opens on hover (and on click / keyboard) ---------- */
.has-sub .sub { display: none; }
.has-sub:hover .sub, .has-sub:focus-within .sub, .has-sub details[open] .sub { display: grid; }
.has-sub::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; }

/* ---------- Categories label (replaces the disclosure element) ---------- */
.has-sub .sub-label { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 700; color: var(--accent-deep); border-radius: 8px; cursor: default; }
.has-sub:hover .sub-label, .has-sub:focus-within .sub-label { background: var(--accent-soft); }
.has-sub .sub-label .ci { color: var(--accent-deep); }

/* ---------- Menu: one colour system, consistent labels ---------- */
.bar .cat-nav a, .has-sub .sub-label { color: var(--ink); font-weight: 600; font-size: .98rem; }
.bar .cat-nav .ci, .has-sub .sub-label .ci { color: var(--ink-2); }
.bar .cat-nav a:hover, .has-sub .sub-label:hover { color: var(--ink); background: var(--accent-soft); }
.bar .cat-nav a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.has-sub .sub a { color: var(--ink); font-weight: 500; font-size: .96rem; }
.has-sub .sub a .ci { color: var(--ink-2); }
.bar .cat-nav a.authors-link { color: var(--ink); font-weight: 600; }
.has-sub:hover .sub-label, .has-sub:focus-within .sub-label { background: var(--accent-soft); }

/* ---------- Categories index page ---------- */
.cats-grid { list-style: none; margin: 0; padding: 36px 0 84px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.cat-card a { display: flex; align-items: center; gap: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); transition: border-color .2s, transform .2s; }
.cat-card a:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
.cat-card .sec-ico { width: 52px; height: 52px; flex: none; }
.cat-text { display: flex; flex-direction: column; gap: 4px; }
.cat-name { font-weight: 800; font-size: 1.15rem; }
.cat-n { color: var(--muted); font-size: .94rem; }

/* ---------- Menu v3: main links + a full category strip ---------- */
.main-links ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-links a { display: block; padding: 10px 14px; border-radius: 8px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.main-links a:hover { background: var(--accent-soft); }
.main-links a[aria-current="page"] { background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.bar { justify-content: space-between; }
.bar .tools { margin-inline-start: 0; }
.cat-strip { border-top: 1px solid var(--line); background: var(--surface); }
.cat-strip ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 0; padding: 14px 0; }
.cat-strip a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .96rem; color: var(--ink); background: var(--paper); white-space: nowrap; transition: border-color .2s, background .2s; }
.cat-strip a:hover { border-color: var(--accent); background: var(--accent-soft); }
.cat-strip a[aria-current="page"] { background: #111d2b; border-color: #111d2b; color: #f6f4ef; }
.cat-strip a .ci { width: 17px; height: 17px; color: var(--accent-deep); }
.cat-strip a[aria-current="page"] .ci { color: var(--accent); }
@media (max-width: 920px) {
  .cat-strip ul { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .main-links a { padding: 8px 10px; font-size: .95rem; }
}

/* ---------- Inverted order: category strip above the logo bar ---------- */
.cat-strip { border-top: 0; border-bottom: 1px solid var(--line); }

/* ---------- Category row: plain text line under the bar ---------- */
.cat-strip { background: transparent; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cat-strip .wrap { padding-inline: clamp(16px, 2.6vw, 40px); max-width: none; }
.cat-strip ul { display: flex; justify-content: space-between; align-items: stretch; flex-wrap: nowrap; gap: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.cat-strip ul::-webkit-scrollbar { display: none; }
.cat-strip li { display: flex; }
.cat-strip a { display: flex; align-items: center; padding: 12px 8px; border: 0; border-radius: 0; background: none; color: var(--ink-2); font-weight: 600; font-size: .98rem; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s, border-color .2s; }
.cat-strip a .ci { display: none; }
.cat-strip a:hover { color: var(--ink); border-bottom-color: var(--line); }
.cat-strip a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
@media (max-width: 920px) { .cat-strip ul { justify-content: flex-start; } .cat-strip a { padding: 10px 12px; } }

/* ---------- Category row with icons; main links removed from the top bar ---------- */
.cat-strip a { gap: 8px; }
.cat-strip a .ci { display: inline-block; width: 17px; height: 17px; color: var(--accent-deep); flex: none; }
.cat-strip a[aria-current="page"] .ci { color: var(--ink); }

/* ---------- Active category: underline only, no dark fill ---------- */
.cat-strip a[aria-current="page"] { background: none; border-color: transparent; border-bottom: 2px solid var(--ink); color: var(--ink); box-shadow: none; }

/* ---------- Category groups: parent items with dropdowns ---------- */
.cat-strip li { position: relative; }
.cat-strip .sub-label { display: flex; align-items: center; gap: 8px; padding: 12px 8px; color: var(--ink-2); font-weight: 600; font-size: .98rem; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: default; }
.cat-strip .sub-label .ci { width: 17px; height: 17px; color: var(--accent-deep); }
.cat-strip .has-sub:hover .sub-label, .cat-strip .has-sub:focus-within .sub-label { color: var(--ink); border-bottom-color: var(--line); }
.cat-strip .has-sub.is-current .sub-label { color: var(--ink); border-bottom-color: var(--ink); }
.cat-strip .sub { display: none; position: absolute; top: 100%; inset-inline-start: 0; z-index: 80; list-style: none; margin: 0; padding: 8px; min-width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(17, 29, 43, .14); }
.cat-strip .has-sub:hover .sub, .cat-strip .has-sub:focus-within .sub { display: block; }
.cat-strip .sub a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--ink); font-weight: 600; font-size: .96rem; white-space: nowrap; border-bottom: 0; margin: 0; }
.cat-strip .sub a .ci { width: 17px; height: 17px; color: var(--accent-deep); flex: none; }
.cat-strip .sub a em { margin-inline-start: auto; font-style: normal; color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.cat-strip .sub a:hover { background: var(--accent-soft); }
.cat-strip .sub a[aria-current="page"] { background: var(--accent-soft); }

/* ---------- Compact category menu: items packed together, centred ---------- */
.cat-strip ul { justify-content: center; gap: 6px; }
.cat-strip .sub-label, .cat-strip > .wrap > ul > li > a { padding: 12px 12px; }

/* ---------- Category groups sit inside the main bar, between logo and tools ---------- */
.bar .cat-strip { flex: 1; min-width: 0; border: 0; background: none; }
.bar .cat-strip .wrap { padding: 0; max-width: none; }
.bar .cat-strip ul { justify-content: center; overflow: visible; }
.bar .cat-strip > .wrap > ul > li > a, .bar .cat-strip .sub-label { padding: 10px 12px; }

/* ---------- Ad slots (Google AdSense placeholders) ---------- */
.ad-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 140px; margin: 40px auto; padding: 16px; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); text-align: center; overflow: hidden; }
.ad-label { font-size: .78rem; letter-spacing: 0; color: var(--muted); }
.prose + .ad-slot { margin-top: 48px; }

/* ---------- Homepage: full-width column, no sidebar ---------- */
.home-main { padding: 0 0 80px; }

/* ---------- Article pages: reading column + sidebar (ads, categories, authors) ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; align-items: start; }
.article-main { min-width: 0; }
.article-side { position: sticky; top: 24px; }
.article-side .ad-slot { margin: 0 0 28px; min-height: 250px; }
.article-side .side { display: block; }
.article-side .side section { padding-bottom: 24px; margin-bottom: 24px; }
@media (max-width: 920px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .article-side { position: static; }
}
.article-main .hero { width: 100%; margin: 36px 0 40px; }
.article-main .article-head { margin-inline: 0; max-width: none; }
.article-main .prose { max-width: none; margin-inline: 0; }
.article-main .article-end { max-width: none; margin-inline: 0; }
.article-main .related { max-width: none; margin-inline: 0; padding: 40px 0 0; }

/* ---------- Lists: one page each; ads sit inside the list as items ---------- */
.rows > li.ad-li { border-bottom: 0; padding: 0; }
.rows > li.ad-li .ad-slot { margin: 28px auto; }

/* ---------- 404 page ---------- */
.nf { text-align: center; max-width: 52rem; margin: 0 auto; padding: 70px 0 96px; }
.nf-code { font-size: clamp(7rem, 22vw, 13rem); font-weight: 800; line-height: .9; margin: 0; color: var(--accent); letter-spacing: -.03em; }
.nf h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; margin: 18px 0 14px; }
.nf-lead { color: var(--ink-2); font-size: 1.12rem; line-height: 1.9; max-width: 36rem; margin: 0 auto 30px; }
.nf-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.btn-solid, .btn-line { display: inline-flex; align-items: center; padding: 13px 26px; border-radius: 999px; font-weight: 700; border: 1.5px solid var(--ink); }
.btn-solid { background: #111d2b; color: #f6f4ef; border-color: #111d2b; }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: #111d2b; }
.btn-line { color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.nf-h { font-size: 1.15rem; font-weight: 800; margin: 56px 0 18px; color: var(--ink-2); }
.nf-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.nf-cats a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; color: var(--ink); }
.nf-cats a:hover { border-color: var(--accent); }
.nf-cats .ci { width: 17px; height: 17px; color: var(--accent-deep); }

/* ---------- 404 animation: digits rise in, the zero orbits ---------- */
.nf-code { display: flex; justify-content: center; align-items: center; gap: .04em; direction: ltr; }
.nf-d { display: inline-block; opacity: 0; transform: translateY(24px); animation: nf-rise .7s var(--ease) forwards; }
.nf-d:nth-child(1) { animation-delay: .1s; }
.nf-zero { position: relative; animation-delay: .25s; }
.nf-zero:nth-child(2) { animation-delay: .25s; }
.nf-d:nth-child(3) { animation-delay: .4s; }
.nf-orbit { position: absolute; inset: -14% -10%; border: 2px dashed var(--accent); border-radius: 50%; animation: nf-spin 9s linear infinite; }
.nf-orbit b { position: absolute; top: -7px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--paper); }
@keyframes nf-rise { to { opacity: 1; transform: translateY(0); } }
@keyframes nf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .nf-d, .nf-orbit { animation: none; opacity: 1; transform: none; }
}

/* ---------- Homepage pager buttons ---------- */
button.pg, button.pg-step { appearance: none; font: inherit; cursor: pointer; }
button.pg-step:disabled { opacity: .4; cursor: default; }
button.pg:hover, button.pg-step:not(:disabled):hover { border-color: var(--accent); color: var(--accent-deep); }

/* ---------- Articles without an image: category icon on a soft tile ---------- */
.thumb.empty, .feature-media.empty, .card-media.empty { display: grid; place-items: center; background: var(--accent-soft); aspect-ratio: 4 / 3; }
.thumb.empty .ci, .feature-media.empty .ci, .card-media.empty .ci { width: 44px; height: 44px; color: var(--accent-deep); }

/* ---------- Screen-reader-only text (homepage title) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Back-to-top rocket ---------- */
.to-top { position: fixed; inset-inline-end: 22px; bottom: 22px; z-index: 90; width: 54px; height: 54px; border: 0; border-radius: 50%; background: #111d2b; color: var(--accent); display: grid; place-items: center; cursor: pointer; box-shadow: 0 12px 28px rgba(17, 29, 43, .28); opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none; transition: opacity .3s, transform .3s var(--ease), background .2s; }
.to-top svg { width: 26px; height: 26px; transform: rotate(45deg); }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--accent); color: #111d2b; }
.to-top:hover svg { transform: rotate(45deg) translateY(-3px); transition: transform .3s var(--ease); }
.to-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .to-top, .to-top svg { transition: none; } }

/* ---------- Rocket launch: lifts off with a flame, then returns ---------- */
.to-top { position: fixed; }
.to-top::after { content: ""; position: absolute; left: 50%; bottom: -20px; width: 12px; height: 22px; margin-left: -6px; border-radius: 50% 50% 40% 40%; background: linear-gradient(to bottom, #fff3c4, var(--accent) 45%, rgba(240, 164, 50, 0)); opacity: 0; transform: scaleY(.4); transform-origin: top; pointer-events: none; }
.to-top.launch { animation: rocket-lift 1.3s cubic-bezier(.55, 0, .85, .45) both; }
.to-top.launch::after { animation: rocket-flame .18s linear infinite alternate; }
@keyframes rocket-lift {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  12% { transform: translateY(6px) rotate(0); }
  60% { transform: translateY(-40vh) rotate(0); opacity: 1; }
  100% { transform: translateY(-110vh) rotate(0); opacity: 0; }
}
@keyframes rocket-flame {
  from { opacity: .85; transform: scaleY(.85); }
  to { opacity: 1; transform: scaleY(1.25); }
}
.to-top.launch::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .to-top.launch, .to-top.launch::after { animation: none; } }

/* ---------- Phone header: logo + buttons on one row, categories in a scrolling row below ---------- */
@media (max-width: 720px) {
  .topline-inner { gap: 8px; padding-block: 9px; }
  .topline .quote { font-size: .86rem; line-height: 1.55; }
  .topline .qicon { width: 16px; height: 16px; }
  .bar { flex-wrap: wrap; min-height: 0; padding-block: 10px; row-gap: 6px; }
  .bar .brand { order: 1; }
  .bar .brand img.logo-light { height: 38px; }
  .bar .tools { order: 2; margin-inline-start: auto; }
  .bar .cat-strip { order: 3; flex: 0 0 100%; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .bar .cat-strip::-webkit-scrollbar { display: none; }
  .bar .cat-strip ul { flex-wrap: nowrap; justify-content: flex-start; width: max-content; }
  .bar .cat-strip > .wrap { padding-inline: 0; }
  .bar .cat-strip a, .bar .cat-strip .sub-label { padding: 9px 10px; font-size: .92rem; white-space: nowrap; }
  .bar .tools .icon-btn { width: 36px; height: 36px; }
  .search-dialog { margin-top: 6vh; }
}

/* ---------- Phone menu: all categories visible, groups shown inline (no hover on touch screens) ---------- */
@media (max-width: 720px) {
  .bar .cat-strip { overflow: visible; }
  .bar .cat-strip ul { flex-wrap: wrap; width: auto; justify-content: center; gap: 2px 4px; }
  .bar .cat-strip li.has-sub { flex: 0 0 100%; flex-wrap: wrap; justify-content: center; }
  .bar .cat-strip .sub-label { padding: 9px 10px; color: var(--ink); }
  .bar .cat-strip .sub { position: static; display: flex !important; flex-wrap: wrap; justify-content: center; gap: 2px 4px; width: 100%; min-width: 0; margin: 0; padding: 0 0 4px; background: none; border: 0; box-shadow: none; list-style: none; }
  .bar .cat-strip .sub a { padding: 8px 10px; font-size: .9rem; }
}
@media (max-width: 720px) { .bar .cat-strip .sub a em { display: none; } }

/* ---------- Skip link: hidden above the screen (no horizontal overflow on RTL) ---------- */
.skip { inset-inline-start: 8px; top: -120px; }
.skip:focus { top: 8px; inset-inline-start: 8px; }
.sr-only { position: fixed; top: 0; inset-inline-start: 0; }

/* ---------- Hidden helpers stay inside the screen (physical positioning) ---------- */
.skip { left: 8px; right: auto; top: -120px; }
.skip:focus { left: 8px; right: auto; top: 8px; }
.sr-only { position: fixed; left: 0; right: auto; top: 0; }
@media (max-width: 720px) { html, body { overflow-x: hidden; } .slider { contain: paint; } }

/* ---------- fibelk hub: Windows-8 style tiles ---------- */
.bar .cat-strip a.fibelk-link { background: #111d2b; color: #f6f4ef; border-radius: 6px; }
.bar .cat-strip a.fibelk-link .ci, .bar .cat-strip a.fibelk-link svg { color: #f0a432; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 150px; grid-auto-flow: dense; gap: 12px; padding: 8px 0 72px; }
.tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; color: inherit; text-decoration: none; overflow: hidden; transition: transform .2s var(--ease), filter .2s; }
.tile:hover { transform: translateY(-3px); filter: brightness(1.05); }
.tile.wide { grid-column: span 2; }
.tile.tall { grid-row: span 2; }
.tile-ico { display: block; }
.tile-ico svg, .tile-ico .ci { display: block; width: 30px; height: 30px; }
.tile-title { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.3; }
.tile-sub { display: block; font-size: .95rem; opacity: .8; margin-top: 4px; }
.tile .stack { display: flex; margin-top: 12px; }
.tile .stack-av { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #c79b4e; margin-inline-start: -10px; overflow: hidden; display: grid; place-items: center; background: #f6f4ef; color: #111d2b; font-weight: 800; }
.tile .stack-av img { width: 100%; height: 100%; object-fit: cover; }
.t-navy { background: #111d2b; color: #f6f4ef; }
.t-amber { background: #f0a432; color: #111d2b; }
.t-brown { background: #d2c2b0; color: #14202c; }
.t-slate { background: #3c4b5b; color: #f6f4ef; }
.t-cream { background: #faedd2; color: #14202c; }
@media (max-width: 720px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 130px; }
  .tile.wide { grid-column: span 2; }
}
.tile .stack { position: absolute; top: 18px; inset-inline-end: 18px; margin: 0; }
.tile .stack-av { width: 38px; height: 38px; }
/* Tile text stays readable on hover (overrides the global link hover colour) */
.tile.t-navy:hover, .tile.t-slate:hover { color: #f6f4ef; }
.tile.t-amber:hover, .tile.t-brown:hover, .tile.t-cream:hover { color: #111d2b; }
.tile:hover .tile-sub { opacity: .9; }

/* ---------- Footnote on the About page (non-profit note) ---------- */
.fn-mark { color: var(--accent-deep); font-weight: 800; margin-inline-start: 2px; }
.fn-note { margin-top: 36px; padding: 14px 18px; border-inline-start: 3px solid var(--accent); background: var(--accent-soft); color: var(--ink-2); font-size: .98rem; line-height: 1.9; border-radius: 4px; }
.fn-note sup { color: var(--accent-deep); font-weight: 800; }

/* ---------- Underlined phrase jumps to the note, and the note flashes ---------- */
.fn-link { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.fn-link:hover { color: var(--accent-deep); }
.fn-note { scroll-margin-top: 110px; }
.fn-note:target { animation: fn-flash 1.8s ease; }
@keyframes fn-flash { 0% { background: #f0a432; color: #111d2b; } 100% { background: var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) { .fn-note:target { animation: none; } }

/* ---------- Ad slots: the ad must have full width to fill (flex centring made it 0px wide) ---------- */
.ad-slot { display: block; text-align: center; }
.ad-slot ins.adsbygoogle { display: block; width: 100%; min-width: 250px; min-height: 100px; }
.ad-label { display: block; margin-bottom: 6px; }

/* ---------- Mobile menu: button opens the categories full screen ---------- */
.menu-toggle { display: none; }
.menu-close { display: none; }
@media (max-width: 720px) {
  .menu-toggle { display: grid; }
  .bar .cat-strip { position: fixed; inset: 0; z-index: 200; display: none; overflow-y: auto; background: var(--paper); padding: 0; }
  html.menu-open .bar .cat-strip { display: block; }
  html.menu-open .menu-toggle { visibility: hidden; }
  .bar .cat-strip > .wrap { padding: 16px 20px 40px; position: relative; }
  .bar .cat-strip .menu-close { display: grid; place-items: center; position: absolute; top: 14px; inset-inline-end: 16px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; }
  .bar .cat-strip .menu-close svg { width: 22px; height: 22px; }
  .bar .cat-strip ul { flex-direction: column; align-items: stretch; flex-wrap: nowrap; width: 100%; gap: 0; margin-top: 56px; }
  .bar .cat-strip ul > li { flex: none; width: 100%; }
  .bar .cat-strip ul > li > a { display: flex; padding: 16px 12px; font-size: 1.1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .bar .cat-strip .has-sub { flex-wrap: wrap; }
  .bar .cat-strip .sub-label { width: 100%; padding: 16px 12px; font-size: 1.1rem; border-bottom: 1px solid var(--line); }
  .bar .cat-strip .sub { display: flex !important; flex-direction: column; gap: 0; padding: 0 0 8px 0; }
  .bar .cat-strip .sub a { padding: 12px 24px; font-size: 1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .bar .cat-strip li.has-sub { flex-direction: column; }
}
