/* Ultra Processed Holdings: shared styles for the portfolio hub pages. */

:root {
  --bg: #f4f2ed;
  --surface: #ffffff;
  --surface-2: #f9f8f5;
  --ink: #15181f;
  --ink-2: #3d4250;
  --muted: #6c7180;
  --line: #e2ded5;
  --line-2: #ece9e2;
  --brand: #0f2a44;
  --brand-ink: #ffffff;
  --accent: #e2531b;
  --accent-ink: #ffffff;
  --link: #124f8c;
  --up: #12805c;
  --down: #c2362b;
  --chip: #ebe7de;
  --shadow: 0 1px 2px rgba(20, 24, 31, 0.06), 0 2px 8px rgba(20, 24, 31, 0.05);
  --radius: 10px;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1200px;
  --rail: 300px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101318;
    --surface: #171b22;
    --surface-2: #1c212a;
    --ink: #eceef2;
    --ink-2: #c3c8d2;
    --muted: #8d94a3;
    --line: #2a303b;
    --line-2: #232832;
    --brand: #0b1d30;
    --link: #7db6f0;
    --up: #3fbf8f;
    --down: #ef6b5f;
    --chip: #252b35;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Top bar + masthead ---------- */

.topbar {
  background: #0a1d31;
  color: #b8c4d3;
  font-size: 0.78rem;
}
.topbar .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 6px;
  padding-bottom: 6px;
}
.topbar .index-quote strong { color: #fff; font-weight: 600; }

.masthead {
  background: var(--brand);
  color: var(--brand-ink);
}
.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.5px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}
.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 4px;
}
.nav a {
  color: #d6dfea;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 6px;
}
.nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; text-decoration: none; }
.nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--accent); border-radius: 0; }

/* ---------- Quote colors ---------- */

.up { color: var(--up); }
.down { color: var(--down); }

/* ---------- Layout ---------- */

.page {
  padding-top: 20px;
  padding-bottom: 56px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  gap: 32px;
  align-items: start;
}
.rail {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.rail .sticky {
  position: sticky;
  top: 16px;
}

.section { margin-bottom: 40px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-top: 3px solid var(--ink);
  padding-top: 10px;
  margin-bottom: 16px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.section-head a {
  font-size: 0.85rem;
  font-weight: 600;
}

.page-title {
  font-family: var(--serif);
  font-size: 2.1rem;
  line-height: 1.15;
  margin: 4px 0 6px;
}
.page-intro {
  color: var(--ink-2);
  margin: 0 0 20px;
  max-width: 62ch;
}

.kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
}
.meta {
  font-size: 0.8rem;
  color: var(--muted);
}
.meta a { color: inherit; font-weight: 600; }

/* ---------- Home: lead story ---------- */

.lead {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}
.lead-main a.lead-link { color: inherit; display: block; }
.lead-main a.lead-link:hover { text-decoration: none; }
.lead-main a.lead-link:hover h2 { text-decoration: underline; }
.lead-main img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--chip);
}
.lead-main h2 {
  font-family: var(--serif);
  font-size: 1.9rem;
  line-height: 1.15;
  margin: 10px 0 8px;
}
.lead-main p.dek { color: var(--ink-2); margin: 0 0 8px; font-size: 1.05rem; }

.lead-side {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.lead-side .mini {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.lead-side .mini:first-child { padding-top: 0; }
.mini h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.25;
  margin: 4px 0 6px;
}
.mini h3 a { color: var(--ink); }

/* ---------- Company cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}
.co-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.co-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20, 24, 31, 0.12); }
.co-card .shot {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  background: var(--chip);
}
.co-card .shot img { width: 100%; height: 100%; object-fit: cover; }
.co-card .new-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}
.co-card .body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}
.co-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.co-logo {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--chip);
  border: 1px solid var(--line);
}
.co-head h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.25;
}
.co-head h3 a { color: var(--ink); }
.co-head .meta { margin-top: 2px; }
.co-card p.short {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.92rem;
  flex: 1 1 auto;
}
.co-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn.big { font-size: 0.95rem; padding: 11px 18px; }

.ticker-chip {
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- News list ---------- */

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.news-item {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.news-item:first-child { padding-top: 0; }
.news-item .thumb {
  display: block;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  overflow: hidden;
  background: var(--chip);
}
.news-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-item .thumb.corp {
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.6rem;
}
.news-item h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.25;
  margin: 4px 0 6px;
}
.news-item h3 a { color: var(--ink); }
.news-item p.dek {
  margin: 0 0 6px;
  color: var(--ink-2);
  font-size: 0.95rem;
}
.news-item.sponsored .kicker { color: var(--muted); }
.news-item.sponsored h3 a { color: var(--ink); }

/* ---------- Most read / stats ---------- */

.box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.box h2 {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
ol.most-read {
  list-style: none;
  counter-reset: mr;
  margin: 0;
  padding: 0;
}
ol.most-read li {
  counter-increment: mr;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid var(--line-2);
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.3;
}
ol.most-read li:first-child { border-top: 0; padding-top: 0; }
ol.most-read li::before {
  content: counter(mr);
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--accent);
}
ol.most-read a { color: var(--ink); }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat b {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.stat span { font-size: 0.78rem; color: var(--muted); }

.sector-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Filters ---------- */

.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.search {
  flex: 1 1 240px;
  font: inherit;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}
.select {
  font: inherit;
  font-size: 0.9rem;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  max-width: 100%;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--chip);
  color: var(--ink-2);
  cursor: pointer;
}
a.chip:hover { text-decoration: none; border-color: var(--line); }
.chip:hover { border-color: var(--muted); }
.chip.active, .chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}
.chip .n { opacity: 0.6; margin-left: 4px; font-weight: 500; }
.count { font-size: 0.85rem; color: var(--muted); margin: 0; }
.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.load-more { margin: 20px auto 0; display: flex; }

/* ---------- Company profile ---------- */

.profile-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--chip);
  margin-bottom: 20px;
}
.profile-hero > img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  cursor: zoom-in;
}
.profile-id {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.profile-id .co-logo { width: 72px; height: 72px; border-radius: 12px; }
.profile-id h1 {
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 6px;
}
.profile-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.85rem;
  color: var(--muted);
}
.profile-facts strong { color: var(--ink); }
.profile-short {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.35;
  margin: 0 0 16px;
}
.profile-about { color: var(--ink-2); margin: 0 0 20px; }
.profile-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }

.gallery {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 12px;
  align-items: start;
}
.gallery button {
  padding: 0;
  border: 0;
  background: var(--chip);
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
}
.gallery img { width: 100%; height: auto; }

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

.crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); font-weight: 600; }
.article h1 {
  font-family: var(--serif);
  font-size: 2.3rem;
  line-height: 1.12;
  margin: 6px 0 10px;
}
.article .dek {
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--ink-2);
  margin: 0 0 14px;
}
.byline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--muted);
}
.byline .brand-mark { width: 32px; height: 32px; font-size: 0.75rem; border-radius: 6px; }
.byline strong { color: var(--ink); }
.article figure { margin: 0 0 22px; }
.article figure img {
  width: 100%;
  border-radius: var(--radius);
  cursor: zoom-in;
  background: var(--chip);
}
.article figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }
.article .body p {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.65;
  margin: 0 0 1.1em;
}
.about-box {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: start;
  margin: 28px 0 36px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}
.about-box .co-logo { width: 56px; height: 56px; }
.about-box h2 { margin: 0 0 4px; font-size: 1rem; }
.about-box p { margin: 0 0 8px; font-size: 0.92rem; color: var(--ink-2); }
.about-box .links { display: flex; gap: 14px; font-size: 0.88rem; font-weight: 600; flex-wrap: wrap; }

/* ---------- Ads ---------- */

.ad-slot { display: flex; flex-direction: column; align-items: center; }
.ad-slot[hidden] { display: none; }
.ad-label {
  font-size: 0.62rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  font-family: Arial, Helvetica, sans-serif;
}
.ad {
  position: relative;
  display: block;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  color: #111;
  text-decoration: none;
  background: #fff;
  border: 1px solid #d9d9d9;
}
.ad:hover { text-decoration: none; }
.ad-controls {
  position: absolute;
  top: 0; right: 0;
  display: flex;
  z-index: 3;
}
.ad-controls button {
  width: 16px;
  height: 16px;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  color: #1a73e8;
  cursor: pointer;
  font: 700 10px/1 Arial, Helvetica, sans-serif;
}
.ad-controls button.x { color: #555; }
.ad-controls svg { width: 10px; height: 10px; }

/* 300x250 medium rectangle */
.ad-rect { width: 300px; height: 250px; }
.ad-rect .ad-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.ad-rect .ad-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #e5e5e5;
}
.ad-rect .ad-bar .who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ad-rect .ad-bar img { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; }
.ad-rect .ad-bar span {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-cta {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 3px;
  background: #1a73e8;
  color: #fff;
  white-space: nowrap;
}

/* text-style rectangle (used when no poster image) */
.ad-rect.text-ad { display: flex; flex-direction: column; }
.ad-rect.text-ad .ad-img { position: static; height: 130px; flex: 0 0 auto; }
.ad-rect.text-ad .ad-copy { padding: 10px 12px 0; flex: 1 1 auto; }
.ad-rect.text-ad .ad-copy b { display: block; font-size: 16px; line-height: 1.2; margin-bottom: 4px; }
.ad-rect.text-ad .ad-copy small { font-size: 12px; color: #444; line-height: 1.3; display: block; }

/* 300x600 half page */
.ad-half { width: 300px; height: 600px; background: #111; }
.ad-half .ad-img { width: 100%; height: 100%; object-fit: cover; }
.ad-half .ad-cta {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* 728x90 leaderboard */
.ad-leader {
  width: 728px;
  max-width: 100%;
  height: 90px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px 0 0;
  color: #fff;
}
.ad-leader .ad-img {
  width: 160px;
  height: 100%;
  object-fit: cover;
  flex: 0 0 auto;
}
.ad-leader .ad-copy { flex: 1 1 auto; min-width: 0; }
.ad-leader .ad-copy b {
  display: block;
  font-size: 20px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-leader .ad-copy small {
  display: block;
  font-size: 13px;
  opacity: 0.9;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-leader .ad-logo {
  width: 52px; height: 52px;
  border-radius: 6px;
  object-fit: cover;
  flex: 0 0 auto;
  background: #fff;
}
.ad-leader .ad-cta { background: #fff; color: #111; font-size: 13px; padding: 9px 14px; }

/* 320x50 mobile banner */
.ad-mobile {
  width: 320px;
  max-width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 0;
  color: #fff;
}
.ad-mobile .ad-logo { width: 50px; height: 50px; object-fit: cover; flex: 0 0 auto; }
.ad-mobile b {
  flex: 1 1 auto;
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ad-mobile .ad-cta { padding: 5px 8px; font-size: 11px; background: #fff; color: #111; }

.leader-slot { padding: 14px 0 0; }
.leader-slot .ad-mobile { display: none; }
@media (max-width: 760px) {
  .leader-slot .ad-leader { display: none; }
  .leader-slot .ad-mobile { display: flex; }
}

/* Native "Around the web" */
.native {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.native-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.native-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}
.native-head small { font-size: 0.7rem; color: var(--muted); }
.native-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 16px;
}
.native-item { color: var(--ink); display: block; }
.native-item:hover { text-decoration: none; }
.native-item:hover b { text-decoration: underline; }
.native-item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 4px;
  background: var(--chip);
  margin-bottom: 8px;
}
.native-item b {
  display: block;
  font-size: 0.98rem;
  line-height: 1.3;
  margin-bottom: 4px;
}
.native-item small { font-size: 0.75rem; color: var(--muted); }

/* Closed ad state */
.ad-closed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: #f1f3f4;
  color: #3c4043;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  border: 1px solid #dadce0;
  padding: 10px;
}
.ad-closed strong { font-size: 14px; }
.ad-closed .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ad-closed button {
  font: inherit;
  font-size: 12px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #1a73e8;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
}
.ad-closed p { margin: 0; font-size: 12px; max-width: 260px; }

/* Mobile anchor ad */
.anchor-ad {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: none;
  justify-content: center;
  background: rgba(250, 250, 250, 0.98);
  border-top: 1px solid #d0d0d0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
  padding: 4px 0;
}
.anchor-ad .anchor-close {
  position: absolute;
  top: -22px;
  right: 8px;
  height: 22px;
  padding: 0 10px;
  border: 1px solid #d0d0d0;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: #fafafa;
  color: #444;
  font: 700 12px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}
@media (max-width: 760px) {
  .anchor-ad.on { display: flex; }
  body.has-anchor { padding-bottom: 62px; }
}

/* ---------- Modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 10, 14, 0.86);
}
.modal.open { display: flex; }
.modal img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.modal button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--brand);
  color: #b8c4d3;
  font-size: 0.85rem;
  padding: 32px 0;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}
.site-footer a { color: #e3eaf2; font-weight: 600; }
.site-footer .links { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer p { margin: 0; max-width: 60ch; }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .rail > * { flex: 1 1 300px; max-width: 420px; }
  .rail .ad-slot { flex: 0 0 auto; }
  .rail .sticky { position: static; }
  .rail .hide-narrow { display: none; }
}

@media (max-width: 760px) {
  .topbar .hide-sm { display: none; }
  .masthead .wrap { min-height: 56px; }
  .brand-mark { width: 34px; height: 34px; font-size: 0.82rem; }
  .brand-name { font-size: 1.05rem; }
  .nav a { padding: 8px 8px; font-size: 0.85rem; }
  .lead { grid-template-columns: minmax(0, 1fr); }
  .lead-main h2 { font-size: 1.5rem; }
  .news-item { grid-template-columns: 104px minmax(0, 1fr); gap: 12px; }
  .news-item h3 { font-size: 1.05rem; }
  .news-item p.dek { display: none; }
  .native-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-title { font-size: 1.7rem; }
  .article h1 { font-size: 1.7rem; }
  .article .dek { font-size: 1.1rem; }
  .article .body p { font-size: 1.06rem; }
  .profile-hero > img { aspect-ratio: 3 / 2; }
  .profile-id h1 { font-size: 1.55rem; }
  .profile-id .co-logo { width: 56px; height: 56px; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery button.wide { grid-column: 1 / -1; order: -1; }
}

@media (max-width: 420px) {
  .brand-name { font-size: 0.95rem; white-space: normal; line-height: 1.1; max-width: 9.5em; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
}
