/* BacaKripto — warm ivory magazine. Light by default; [data-theme="dark"] overrides variables. */
:root {
  --bg: #f8f3ea;
  --surface: #fffcf6;
  --surface-2: #f0e8d9;
  --text: #2a3040;
  --heading: #14203a;
  --muted: #666b78;
  --border: #ddd2bd;
  --rule: #14203a;
  --copper: #a8531f;
  --copper-hover: #8f4416;
  --on-copper: #ffffff;
  --accent-text: #a0491a;
  --accent-soft: #f3e2d2;
  --img-bg: #e6dcc9;
  --focus: #a0491a;
  --gutter: 28px;
  --wrap: 1180px;
  --edge: max(var(--gutter), calc((100% - var(--wrap)) / 2));
  --nav-h: 48px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Source Serif Pro", Charter, Georgia, "Times New Roman", serif;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #10141d;
  --surface: #171c28;
  --surface-2: #1d2330;
  --text: #d6dae3;
  --heading: #f6f0e4;
  --muted: #9aa1b0;
  --border: #2d3547;
  --rule: #e9e1d0;
  --copper: #d8844a;
  --copper-hover: #e69a64;
  --on-copper: #1a0f07;
  --accent-text: #e8975c;
  --accent-soft: rgba(216, 132, 74, 0.16);
  --img-bg: #232a38;
  --focus: #e8975c;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { color: var(--heading); font-family: var(--serif); letter-spacing: -0.01em; }

.dv-custom-content { display: block; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 300;
  padding: 10px 16px; border-radius: 4px;
  background: var(--copper); color: var(--on-copper); font-weight: 700;
}
.skip:focus { top: 10px; }

/* ---------- Top utility line ---------- */
.news-topline {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 9px var(--edge); border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 12.5px; letter-spacing: 0.01em;
}
.news-topline p { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-topline a { flex: none; color: var(--accent-text); font-weight: 600; white-space: nowrap; }
.news-topline a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Masthead ---------- */
.site-header { background: var(--bg); }
.header-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "search brand actions";
  align-items: center; gap: 12px 24px;
  padding: 30px var(--edge) 26px;
}

.brand {
  grid-area: brand; display: inline-flex; align-items: baseline; justify-content: center; flex: none;
  color: var(--heading); font-family: var(--serif); font-size: clamp(40px, 5.2vw, 62px);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1;
}
.brand > span:not(.brand-dot) { font-style: italic; font-weight: 400; }
.brand-dot { margin-left: 1px; color: var(--copper); }

.icon-button {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid transparent; border-radius: 4px; background: transparent;
  color: var(--heading); font-size: 22px; transition: background-color 0.15s;
}
.icon-button:hover { background: var(--surface-2); }
.menu-toggle { grid-area: menu; display: none; }
.menu-close { display: none; }

.header-search { grid-area: search; position: relative; width: 100%; max-width: 300px; min-width: 0; }
.header-search > .bi-search {
  position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 14px; pointer-events: none;
}
.header-search input {
  width: 100%; height: 40px; padding: 0 40px 0 28px;
  border: 0; border-bottom: 1px solid var(--heading); border-radius: 0;
  background: transparent; color: var(--heading); font-size: 14.5px;
  appearance: none; -webkit-appearance: none;
}
.header-search input::placeholder { color: var(--muted); }
.header-search input:focus { outline: none; border-bottom-color: var(--copper); box-shadow: 0 1px 0 var(--copper); }
.header-search input::-webkit-search-cancel-button { display: none; }
.header-search button {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--heading); font-size: 15px;
  transition: background-color 0.15s, color 0.15s;
}
.header-search button:hover { background: var(--copper); color: var(--on-copper); }

.header-actions { grid-area: actions; justify-self: end; }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 999px; background: transparent;
  color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: border-color 0.15s, background-color 0.15s;
}
.theme-toggle:hover { border-color: var(--copper); background: var(--surface); }
.theme-toggle .bi { color: var(--accent-text); font-size: 15px; }

/* ---------- Horizontal navigation ---------- */
.site-rail {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: stretch; gap: 20px;
  padding: 0 var(--edge);
  background: var(--bg); border-top: 2px solid var(--heading); border-bottom: 1px solid var(--border);
}
.rail-heading, .rail-label { display: none; }
.rail-scroll { display: flex; align-items: stretch; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.rail-scroll::-webkit-scrollbar { display: none; }
.rail-categories { display: flex; flex: none; }
.rail-categories li { flex: none; }

.rail-home, .rail-link, .rail-categories a {
  position: relative; display: inline-flex; align-items: center; flex: none;
  height: var(--nav-h); padding: 0 14px;
  color: var(--text); font-size: 13.5px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
  transition: color 0.15s;
}
.rail-home { margin-right: 6px; padding-left: 0; padding-right: 20px; border-right: 1px solid var(--border); color: var(--heading); font-weight: 700; }
.rail-home:hover, .rail-categories a:hover, .rail-link:hover { color: var(--accent-text); }
.rail-home[aria-current="page"]::after,
.rail-categories a[aria-current], .rail-categories a.is-active, .rail-categories a.active, .rail-categories a.current,
.rail-categories li.is-active > a, .rail-categories li.active > a, .rail-categories li.current > a { color: var(--heading); }
.rail-home[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 20px; bottom: -1px; height: 3px; background: var(--copper); }
.rail-categories a[aria-current]::after, .rail-categories a.is-active::after, .rail-categories a.active::after, .rail-categories a.current::after,
.rail-categories li.is-active > a::after, .rail-categories li.active > a::after, .rail-categories li.current > a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; background: var(--copper);
}

.rail-extra { display: flex; align-items: stretch; flex: none; padding-left: 12px; border-left: 1px solid var(--border); }
.rail-extra .rail-link { padding: 0 10px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.rail-extra .rail-link:last-child { padding-right: 0; }
.rail-rss { display: none; }

/* ---------- Main ---------- */
.news-main { width: 100%; min-width: 0; padding: 44px var(--edge) 72px; }

.eyebrow { margin-bottom: 8px; color: var(--accent-text); font-size: 11.5px; font-weight: 800; letter-spacing: 0.12em; }

.category {
  display: inline-block; color: var(--accent-text);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
a.category:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Listing heading */
.listing-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.listing-heading h1 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; }
.listing-description { max-width: 56ch; margin-top: 10px; color: var(--muted); font-size: 16px; }
.sort-control { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--muted); font-size: 13px; }
.sort-control select {
  height: 38px; padding: 0 30px 0 12px; border: 1px solid var(--border); border-radius: 4px;
  background-color: var(--surface); color: var(--text); font-size: 13.5px;
  appearance: auto; -webkit-appearance: auto;
}
.sort-control select:hover { border-color: var(--copper); }

.search-status { margin-bottom: 20px; color: var(--muted); font-size: 13.5px; }

/* ---------- News grid ---------- */
.post-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 44px 36px; align-items: start; }
.news-card {
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
  padding-top: 20px; border-top: 1px solid var(--border);
}
.card-art { display: block; overflow: hidden; border-radius: 3px; background: var(--img-bg); }
.card-art img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform 0.4s ease; }
.news-card:hover .card-art img { transform: scale(1.025); }
.card-text { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.news-card h3 { font-size: 21px; font-weight: 700; line-height: 1.22; overflow-wrap: break-word; }
.news-card h3 a { background: linear-gradient(var(--copper), var(--copper)) 0 100% / 0 2px no-repeat; transition: background-size 0.25s ease; }
.news-card h3 a:hover { background-size: 100% 2px; }
.news-card .card-text > p {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--muted); font-size: 15px; line-height: 1.6;
}
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; color: var(--muted); font-size: 12.5px; }
.read-link { display: none; }

/* Lead story: heavier rule, image above headline */
.news-card:first-child { border-top: 3px solid var(--rule); }
.news-card:first-child .card-art img { aspect-ratio: 16 / 9; }
.news-card:first-child h3 { font-size: clamp(27px, 3.6vw, 44px); line-height: 1.1; letter-spacing: -0.02em; }
.news-card:first-child .card-text { gap: 12px; }
.news-card:first-child .card-text > p { -webkit-line-clamp: 4; font-size: 17.5px; line-height: 1.6; }
.news-card:first-child .read-link {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 4px;
  padding-bottom: 2px; border-bottom: 2px solid var(--copper);
  color: var(--heading); font-size: 14px; font-weight: 700;
}
.news-card:first-child .read-link:hover { color: var(--accent-text); }

/* Second story */
.news-card:nth-child(2) .card-art img { aspect-ratio: 4 / 3; }
.news-card:nth-child(2) h3 { font-size: 25px; }

/* Search results use a plain uniform grid, no lead layout */
.post-list.is-filtered > .news-card:nth-child(n) { display: flex; border-top: 1px solid var(--border); }
.post-list.is-filtered > .news-card:nth-child(n) .card-art img { aspect-ratio: 3 / 2; }
.post-list.is-filtered > .news-card:nth-child(n) h3 { font-size: 21px; line-height: 1.22; letter-spacing: -0.01em; }
.post-list.is-filtered > .news-card:nth-child(n) .card-text > p { -webkit-line-clamp: 3; font-size: 15px; }
.post-list.is-filtered > .news-card:nth-child(n) .read-link { display: none; }

/* Tablet: two columns, lead spans both; an unpaired last card becomes a full-width feature */
@media (min-width: 601px) and (max-width: 960px) {
  .post-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 28px; }
  .post-list:not(.is-filtered) > .news-card:first-child { grid-column: 1 / -1; }
  .post-list:not(.is-filtered) > .news-card:nth-child(2) .card-art img { aspect-ratio: 3 / 2; }
  .post-list:not(.is-filtered) > .news-card:nth-child(2) h3 { font-size: 21px; }
  .post-list:not(.is-filtered) > .news-card:nth-child(n+2):last-child:nth-child(even) {
    grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: center;
  }
}

/* Desktop: 12-column magazine grid. Lead 8, second 4, the rest 4 each. */
@media (min-width: 961px) {
  .post-list { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 52px 40px; }
  .news-card { grid-column: span 4; }
  .post-list:not(.is-filtered) > .news-card:first-child { grid-column: span 8; }
  .post-list:not(.is-filtered) > .news-card:first-child:last-child { grid-column: 1 / -1; }

  /* One orphan in the last row: promote it to a full-width feature. */
  .post-list:not(.is-filtered) > .news-card:nth-child(n+3):last-child:nth-child(3n) {
    grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: center;
  }
  .post-list:not(.is-filtered) > .news-card:nth-child(n+3):last-child:nth-child(3n) h3 { font-size: 30px; line-height: 1.15; }
  /* Two orphans: split the last row in half. */
  .post-list:not(.is-filtered) > .news-card:nth-child(n+4):last-child:nth-child(3n+1),
  .post-list:not(.is-filtered) > .news-card:nth-child(n+3):nth-child(3n):nth-last-child(2) { grid-column: span 6; }
}

/* States + pagination */
.search-empty, .empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin: 12px 0; padding: 48px 20px; text-align: center;
  border: 1px solid var(--border); border-top: 3px solid var(--rule); background: var(--surface);
}
.search-empty .bi { color: var(--muted); font-size: 26px; }
.search-empty h2, .empty-state h2 { font-size: 22px; }
.search-empty p { color: var(--muted); }
.search-empty button, .empty-state a {
  margin-top: 8px; padding: 10px 20px; border: 0; border-radius: 3px;
  background: var(--copper); color: var(--on-copper); font-size: 14px; font-weight: 700;
}
.search-empty button:hover, .empty-state a:hover { background: var(--copper-hover); }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border); }
.pagination a, .pagination span, .pagination button {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 3px; background: transparent;
  color: var(--text); font-size: 14px; font-weight: 600;
}
.pagination a:hover, .pagination button:hover { border-color: var(--copper); color: var(--accent-text); }
.pagination [aria-current], .pagination .active, .pagination .is-active, .pagination .current {
  border-color: var(--heading); background: var(--heading); color: var(--bg); font-weight: 700;
}
.pagination [aria-disabled="true"], .pagination :disabled { opacity: 0.45; pointer-events: none; }

.editorial-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  margin-top: 72px; padding: 34px 0; border-top: 3px double var(--rule); border-bottom: 1px solid var(--border);
}
.editorial-banner h2 { margin: 2px 0 8px; font-size: clamp(24px, 2.8vw, 32px); font-weight: 700; line-height: 1.15; }
.editorial-banner p { max-width: 60ch; color: var(--muted); font-size: 15px; }
.editorial-banner > a {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border: 1px solid var(--heading); border-radius: 3px;
  color: var(--heading); font-size: 14px; font-weight: 700; white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.editorial-banner > a:hover { background: var(--heading); color: var(--bg); }

/* ---------- Article ---------- */
.article-page { min-width: 0; }
.article-page > * { max-width: 740px; margin-left: auto; margin-right: auto; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 22px; color: var(--muted); font-size: 13px; }
.breadcrumb a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb .bi { font-size: 10px; }
.article-page > .category { display: block; margin-bottom: 12px; }
.article-page > a.category { width: fit-content; max-width: none; margin-left: max(0px, calc((100% - 740px) / 2)); }
.article-page h1 { font-size: clamp(32px, 4.8vw, 52px); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; overflow-wrap: break-word; }
.article-lead { margin-top: 18px; color: var(--muted); font-family: var(--serif); font-size: clamp(18px, 2vw, 21px); line-height: 1.5; }
.article-meta { margin-top: 22px; margin-bottom: 32px; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.article-page > .article-art { max-width: 1020px; margin-bottom: 40px; }
.article-art img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; background: var(--img-bg); }
.article-art figcaption { margin-top: 10px; color: var(--muted); font-size: 12.5px; }

.toc { margin-bottom: 32px; padding: 18px 22px; border: 1px solid var(--border); border-left: 3px solid var(--copper); background: var(--surface); }
.toc h2 { margin-bottom: 8px; font-family: var(--font); font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.toc ol { padding-left: 20px; list-style: decimal; color: var(--muted); font-size: 14.5px; }
.toc li { padding: 2px 0; }
.toc a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

.article-body { font-size: 18px; line-height: 1.75; overflow-wrap: break-word; }
.article-body > * + * { margin-top: 1.1em; }
.article-body h2 { margin-top: 1.9em; font-size: 28px; line-height: 1.2; font-weight: 700; }
.article-body h3 { margin-top: 1.6em; font-size: 22px; line-height: 1.3; font-weight: 700; }
.article-body a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { text-decoration-thickness: 2px; }
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li + li { margin-top: 0.4em; }
.article-body blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--copper); color: var(--muted); font-family: var(--serif); font-size: 1.08em; font-style: italic; }
.article-body img { border-radius: 3px; }
.article-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; }
.article-body th, .article-body td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; }
.article-body th { background: var(--surface); }
.article-body pre { overflow-x: auto; padding: 14px 16px; border-radius: 3px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; line-height: 1.55; }
.article-body code { font-size: 0.9em; }
.article-body hr { border: 0; border-top: 1px solid var(--border); }

.article-end {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  margin-top: 44px; padding: 18px 0 0; border-top: 3px double var(--rule); color: var(--muted); font-size: 14px;
}
.article-end a { color: var(--heading); font-weight: 700; border-bottom: 2px solid var(--copper); }
.article-end a:hover { color: var(--accent-text); }

/* More stories sit under the article, never beside it */
.article-more { margin-top: 72px; padding-top: 22px; border-top: 3px solid var(--rule); }
.article-more h2 { margin-bottom: 28px; font-size: clamp(24px, 3vw, 32px); font-weight: 700; }
.recent-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 36px; }
.recent-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding-top: 16px; border-top: 1px solid var(--border); }
.recent-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 3px; background: var(--img-bg); }
.recent-card > div { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.recent-card h3 {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 20px; font-weight: 700; line-height: 1.25;
}
.recent-card:hover h3 { color: var(--accent-text); }

/* ---------- Shared info pages ---------- */
.info-main { padding-top: 64px; padding-left: max(var(--gutter), calc((100% - 740px) / 2)); padding-right: max(var(--gutter), calc((100% - 740px) / 2)); }
.info-main h1, .info-page h1 { margin-bottom: 24px; padding-bottom: 22px; border-bottom: 3px double var(--rule); font-size: clamp(34px, 5vw, 54px); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; }
.info-main h2, .info-page h2 { margin: 40px 0 10px; font-size: 26px; font-weight: 700; line-height: 1.2; }
.info-main p, .info-main li, .info-page p, .info-page li { color: var(--text); font-size: 17.5px; line-height: 1.75; }
.info-main p + p, .info-page p + p { margin-top: 14px; }
.info-main h1 + p, .info-page h1 + p { margin-top: 0; }
.info-main ul, .info-page ul { margin: 12px 0; padding-left: 1.3em; list-style: disc; }
.info-main li + li { margin-top: 6px; }
.info-main p a, .info-page p a { color: var(--accent-text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 3px double var(--rule); background: var(--surface-2); }
.footer-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: 32px;
  padding: 40px var(--edge) 32px;
}
.site-footer .brand { justify-content: flex-start; font-size: 32px; }
.site-footer p { margin-top: 10px; color: var(--muted); font-size: 13.5px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 8px; }
.site-footer nav a { color: var(--text); font-size: 13.5px; font-weight: 600; }
.site-footer nav a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.site-footer .footer-note { margin-top: 8px; text-align: right; }
.footer-sponsor { padding: 14px var(--edge) 22px; border-top: 1px solid var(--border); }
.footer-sponsor p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.site-footer .footer-sponsor .sponsor-label { margin-bottom: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; }
.footer-sponsor strong { color: var(--text); font-weight: 700; }
.footer-sponsor a { text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.footer-sponsor a:hover { color: var(--heading); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  :root { --gutter: 24px; }
  .recent-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editorial-banner { gap: 24px; }
}

@media (max-width: 760px) {
  :root { --gutter: 18px; --nav-h: 44px; }
  html { scroll-padding-top: 130px; }

  body.menu-open { overflow: hidden; }
  body.menu-open::before { content: ""; position: fixed; inset: 0; z-index: 90; background: rgba(10, 14, 24, 0.55); }

  .news-topline { padding: 7px var(--gutter); font-size: 12px; }

  .site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--border); }
  .header-inner {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    grid-template-areas: "menu brand actions" "search search search";
    gap: 8px 8px; padding: 10px var(--gutter) 10px;
  }
  .menu-toggle { display: inline-flex; }
  .brand { font-size: 32px; }
  .header-search { max-width: none; }
  .header-search input { height: 38px; }
  .theme-toggle { width: 40px; height: 40px; padding: 0; justify-content: center; border-color: transparent; }
  .theme-toggle .bi { font-size: 19px; color: var(--heading); }
  .theme-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }

  /* Navigation becomes an off-canvas drawer */
  .site-rail {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
    flex-direction: column; gap: 0; align-items: stretch;
    width: min(84vw, 320px); height: 100vh; height: 100dvh; padding: 0 0 24px;
    overflow-y: auto; overscroll-behavior: contain;
    border-top: 0; border-bottom: 0; border-right: 1px solid var(--border); box-shadow: 8px 0 32px rgba(10, 14, 24, 0.35);
    transform: translateX(-102%); visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }
  .menu-open .site-rail { transform: none; visibility: visible; transition: transform 0.25s ease, visibility 0s; }
  .rail-heading {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 8px 8px 20px; border-bottom: 3px double var(--rule);
  }
  .rail-heading p { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; }
  .menu-close { display: inline-flex; }
  .rail-scroll { flex: none; flex-direction: column; overflow: visible; }
  .rail-label { display: block; padding: 18px 20px 4px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; }
  .rail-categories { flex-direction: column; }
  .rail-home, .rail-link, .rail-categories a { width: 100%; height: auto; padding: 12px 20px; font-size: 15px; white-space: normal; }
  .rail-home { margin: 0; padding-right: 20px; border-right: 0; border-bottom: 1px solid var(--border); }
  .rail-home[aria-current="page"]::after { left: 0; right: auto; top: 0; bottom: 0; width: 3px; height: auto; }
  .rail-categories a[aria-current]::after, .rail-categories a.is-active::after, .rail-categories a.active::after, .rail-categories a.current::after,
  .rail-categories li.is-active > a::after, .rail-categories li.active > a::after, .rail-categories li.current > a::after {
    left: 0; right: auto; top: 0; bottom: 0; width: 3px; height: auto;
  }
  .rail-extra { flex-direction: column; margin-top: 12px; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--border); }
  .rail-extra .rail-link { padding: 11px 20px; color: var(--text); font-size: 14.5px; font-weight: 500; }
  .rail-extra .rail-link:last-child { padding-right: 20px; }
  .rail-rss { display: inline-flex; }

  .news-main { padding-top: 30px; padding-bottom: 48px; padding-left: var(--gutter); padding-right: var(--gutter); }
  .listing-heading { flex-direction: column; align-items: stretch; gap: 16px; margin-bottom: 26px; }
  .listing-description { font-size: 15px; }
  .sort-control { justify-content: space-between; }

  .post-list { gap: 32px; }
  .news-card { gap: 14px; }

  .editorial-banner { flex-direction: column; align-items: flex-start; gap: 18px; margin-top: 52px; padding: 26px 0; }

  .article-page h1 { font-size: 32px; }
  .article-body { font-size: 17px; }
  .article-body h2 { font-size: 25px; }
  .article-more { margin-top: 52px; }
  .recent-list { grid-template-columns: minmax(0, 1fr); gap: 26px; }

  .info-main { padding: 36px var(--gutter) 48px; }

  .footer-inner { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 32px; }
  .site-footer .footer-note { margin-top: 0; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .news-card:hover .card-art img { transform: none; }
}
