/* ============================================================
   Alternativ Media — layered on top of the inherited v5 style.css.
   The v5 dark newsroom aesthetic and red accent are kept; this file
   adds the pieces the static demo never had: overflow-safe
   navigation, mega menus, a real ticker, brand SVG social icons and
   the discreet footer credit.
   ============================================================ */

:root {
  --am-red: #ca151d;
  --am-red-dark: #a81016;
  --am-radius: 14px;
  --am-gap: 22px;
}

body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
[dir="rtl"] body { direction: rtl; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--am-red); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

/* ---------- top bar ---------------------------------------- */
.topbar .inner { gap: 12px; }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }

.top-search { display: flex; align-items: center; gap: 0; }
.top-search input {
  height: 34px; border: 1px solid var(--line); border-right: 0;
  border-radius: 999px 0 0 999px; background: var(--surface-soft);
  color: var(--text); padding: 0 14px; width: 190px; font-size: 13px;
}
.top-search button {
  height: 34px; width: 40px; border: 1px solid var(--line); border-left: 0;
  border-radius: 0 999px 999px 0; background: var(--surface-soft);
  color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.top-search button svg { width: 16px; height: 16px; fill: currentColor; }
.top-search button:hover { color: var(--am-red); }
[dir="rtl"] .top-search input { border-radius: 0 999px 999px 0; border-right: 1px solid var(--line); border-left: 0; }
[dir="rtl"] .top-search button { border-radius: 999px 0 0 999px; }

/* ---------- social icons (§45) ------------------------------ */
.social-row { display: flex; align-items: center; gap: 6px; }
.social-btn {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface-soft); color: var(--muted);
  transition: transform .16s ease, color .16s ease, border-color .16s ease;
  position: relative;
}
.social-btn svg { width: 16px; height: 16px; fill: currentColor; }
.social-btn:hover { color: #fff; background: var(--am-red); border-color: var(--am-red); transform: translateY(-2px); }
.social-btn::after {
  content: attr(data-tooltip); position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%); background: var(--text); color: var(--surface);
  font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 6px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s ease; z-index: 90;
}
.social-btn:hover::after, .social-btn:focus-visible::after { opacity: 1; }

/* ---------- language selector (§10) ------------------------- */
.lang-dropdown { position: relative; }
.lang-toggle { gap: 7px; min-width: 0; padding: 0 10px; height: 34px; font-size: 13px; }
.lang-toggle .lang-code { font-weight: 800; letter-spacing: .3px; color: var(--text); }
.flag { border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); object-fit: cover; }

.lang-menu {
  display: none; grid-template-columns: 1fr; gap: 2px; width: 200px; padding: 6px;
  list-style: none; margin: 0;
}
.lang-menu.open { display: grid; }
.lang-menu .lang-option {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px;
  border: 0; background: transparent; border-radius: 9px; font-size: 13.5px;
  color: var(--text); width: 100%;
}
.lang-menu .lang-option:hover { background: var(--surface-soft); transform: none; }
.lang-menu .lang-option.is-current { background: var(--am-red); color: #fff; }

/* ---------- brand ------------------------------------------- */
.brand { text-decoration: none; }
.brand .main { color: var(--text); }
.brand .sub { color: var(--am-red); }
.brand-meta .domain { color: var(--am-red); font-weight: 700; }

/* ---------- navigation: never scrolls sideways (§7) --------- */
.nav { position: sticky; top: 46px; z-index: 70; }
.nav-row {
  display: flex; align-items: stretch; gap: 26px; list-style: none; margin: 0; padding: 0;
  /* deliberately NOT overflow:auto — surplus goes to "Mehr" */
  overflow: visible; flex-wrap: nowrap;
}
.nav-item { position: relative; display: flex; align-items: center; }
.nav-item > a {
  display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 800;
  padding: 14px 0; border-bottom: 3px solid transparent; color: var(--text);
  white-space: nowrap; transition: color .16s ease, border-color .16s ease;
}
.nav-item > a:hover, .nav-item.is-open > a, .nav-item.is-active > a {
  color: var(--am-red); border-bottom-color: var(--am-red);
}
.nav-item .chev { font-size: 10px; color: var(--muted); }

/* mega menu (§8) */
.mega {
  position: absolute; top: 100%; inset-inline-start: -14px; min-width: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--am-radius);
  box-shadow: var(--shadow-strong); padding: 10px; z-index: 95;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.mega-right { inset-inline-start: auto; inset-inline-end: -14px; }
.nav-item.is-open > .mega { opacity: 1; visibility: visible; transform: translateY(0); }
.mega-inner { display: grid; grid-template-columns: 1fr; gap: 2px; }
.mega-inner a {
  padding: 9px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
  color: var(--text); white-space: nowrap;
}
.mega-inner a:hover { background: var(--surface-soft); color: var(--am-red); }
.mega-inner a.is-active { background: var(--surface-soft); color: var(--am-red); }
.mega-inner a.mega-sub { font-weight: 500; color: var(--muted); padding-inline-start: 22px; }

.nav-toggle { display: none; }

/* ---------- breaking ticker (§18) --------------------------- */
.breaking {
  background: var(--am-red); color: #fff; overflow: hidden;
  border-bottom: 1px solid rgba(0,0,0,.15);
}
.breaking-inner { display: flex; align-items: center; gap: 14px; height: 42px; }
.breaking-label {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 900; letter-spacing: 1.1px;
  text-transform: uppercase; background: rgba(0,0,0,.22); padding: 5px 11px; border-radius: 999px;
}
.breaking-viewport { flex: 1 1 auto; overflow: hidden; position: relative; min-width: 0; }
.breaking-track {
  display: flex; align-items: center; gap: 0; list-style: none; margin: 0; padding: 0;
  white-space: nowrap; will-change: transform;
}
/* Each headline is its own element with a clear separator — never
   merged into one unreadable sentence. */
.breaking-item { display: inline-flex; align-items: center; flex: 0 0 auto; }
.breaking-item::after {
  content: "•"; opacity: .55; margin: 0 22px; font-weight: 700;
}
.breaking-item a, .breaking-item span {
  color: #fff; font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.breaking-item a:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) {
  .breaking-track { animation: none !important; transform: none !important; }
  .breaking-viewport { overflow-x: auto; }
}

.site-alert { padding: 10px 0; font-weight: 700; font-size: 14px; text-align: center; }
.site-alert--info { background: #123; color: #cfe8ff; }
.site-alert--warn { background: #4a3a10; color: #ffe6a8; }
.site-alert--danger { background: var(--am-red-dark); color: #fff; }

/* ---------- layout ------------------------------------------ */
.page-grid {
  display: block; width: min(1220px, calc(100% - 28px)); max-width: none;
  align-items: start; padding: 28px 0 50px;
}
.page-main { min-width: 0; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 32px; font-weight: 900; letter-spacing: -.8px; margin: 0 0 6px; }
.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.subnav a {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-soft); font-size: 13px; font-weight: 600;
}
.subnav a:hover { border-color: var(--am-red); color: var(--am-red); }

/* ---------- hero -------------------------------------------- */
.hero {
  display: grid; grid-template-columns: 1fr; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--am-radius);
  overflow: hidden; box-shadow: var(--shadow); margin-bottom: 30px;
}
.hero-media {
  display: block; position: relative; overflow: hidden;
  aspect-ratio: 16/8; background: var(--surface-soft);
}
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-body { padding: 22px 24px 26px; }
.lead-label {
  display: inline-flex; width: max-content; padding: 5px 10px; border-radius: 999px;
  background: var(--am-red); color: #fff; font-size: 10px; font-weight: 900;
  letter-spacing: .08em; text-transform: uppercase;
}
.hero-body h1 { font-size: 30px; line-height: 1.2; font-weight: 900; letter-spacing: -.7px; margin: 8px 0 10px; }
.lead-excerpt { font-size: 16px; color: var(--muted); margin: 0 0 12px; }

.kicker {
  display: inline-block; font-size: 11.5px; font-weight: 900; letter-spacing: .9px;
  text-transform: uppercase; color: var(--am-red);
}
.meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); }

/* ---------- cards ------------------------------------------- */
.block { margin-bottom: 36px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.block-title {
  font-size: 19px; font-weight: 900; letter-spacing: -.3px; margin: 0 0 16px;
  padding-inline-start: 12px; border-inline-start: 4px solid var(--am-red);
}
.block-more { font-size: 13px; font-weight: 700; color: var(--am-red); }

.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--am-gap); }
.card-grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--am-radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-strong); }
.card-media {
  display: block; position: relative; overflow: hidden;
  aspect-ratio: 16/9; background: var(--surface-soft);
}
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 15px 16px 17px; display: flex; flex-direction: column; gap: 7px; }
.card-body h3 { font-size: 16px; line-height: 1.32; font-weight: 800; margin: 0; }
.card-body p { font-size: 13.5px; margin: 0; line-height: 1.5; }
.card--compact .card-body h3 { font-size: 14.5px; }

.empty-state { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- article ----------------------------------------- */
.crumbs { display: flex; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.crumbs a:hover { color: var(--am-red); }
.article-head h1 { font-size: 36px; line-height: 1.15; font-weight: 900; letter-spacing: -1px; margin: 8px 0 12px; }
.article-excerpt { font-size: 17.5px; color: var(--muted); line-height: 1.55; margin: 0 0 14px; }
.article-meta { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.article-cover { margin: 22px 0; }
.article-cover img { width: 100%; border-radius: var(--am-radius); }
.article-body { font-size: 16.5px; line-height: 1.72; }
.article-body p { margin: 0 0 18px; }
.article-body h2 { font-size: 22px; font-weight: 900; margin: 30px 0 12px; }
.article-body blockquote {
  margin: 22px 0; padding: 4px 0 4px 18px; border-inline-start: 4px solid var(--am-red);
  font-size: 18px; font-style: italic; color: var(--text);
}
.article-body a { color: var(--am-red); text-decoration: underline; }
.article-body img { border-radius: 10px; margin: 18px 0; }
.article-body iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; }

.translation-note, .notice {
  padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin: 14px 0;
}
.translation-note { background: rgba(202,21,29,.1); border: 1px solid rgba(202,21,29,.3); }
.notice--ok { background: rgba(35,150,80,.12); border: 1px solid rgba(35,150,80,.35); }
.notice--err { background: rgba(202,21,29,.12); border: 1px solid rgba(202,21,29,.35); }

.correction, .sources {
  margin: 26px 0; padding: 16px 18px; background: var(--surface-soft);
  border: 1px solid var(--line); border-radius: var(--am-radius);
}
.correction h2, .sources h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .8px; margin: 0 0 8px; }

/* ---------- comments ---------------------------------------- */
.comments { margin-top: 40px; }
.comment-form { display: grid; gap: 12px; margin-bottom: 26px; }
.comment-form label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; }
.comment-form input, .comment-form textarea {
  border: 1px solid var(--line); background: var(--surface-soft); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; width: 100%;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.comment-list li {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--am-radius); padding: 14px 16px;
}
.comment-head { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; font-size: 13px; }

/* ---------- live -------------------------------------------- */
.live-head { display: flex; align-items: center; gap: 16px; }
.live-state {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800;
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); text-transform: uppercase;
}
.live-state .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.live-state.is-live { background: var(--am-red); border-color: var(--am-red); color: #fff; }
.live-state.is-live .dot { background: #fff; animation: am-pulse 1.4s infinite; }
@keyframes am-pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }
.player-wrap {
  background: #000; border-radius: var(--am-radius); overflow: hidden;
  aspect-ratio: 16/9; display: grid; place-items: center; border: 1px solid var(--line);
}
.player, .player-embed, .player-embed iframe { width: 100%; height: 100%; border: 0; }
.player-offline { color: #9aabba; text-align: center; padding: 30px; }

/* ---------- pagination -------------------------------------- */
.pagination { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 28px; }
.pagination a {
  min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  font-size: 13.5px; font-weight: 700;
}
.pagination a:hover { border-color: var(--am-red); color: var(--am-red); }
.pagination a.is-current { background: var(--am-red); border-color: var(--am-red); color: #fff; }

.search-big { display: flex; gap: 10px; margin: 14px 0; }
.search-big input {
  flex: 1; border: 1px solid var(--line); background: var(--surface-soft); color: var(--text);
  border-radius: 12px; padding: 12px 16px; font-size: 15px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface-soft); color: var(--text); font: inherit; font-size: 14px;
  font-weight: 700; cursor: pointer; transition: all .16s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--primary { background: var(--am-red); border-color: var(--am-red); color: #fff; }
.btn--primary:hover { background: var(--am-red-dark); }

/* ---------- footer ------------------------------------------ */
.site-footer {
  background: #0d1117; border-top: 1px solid var(--line); margin-top: 40px;
  padding: 42px 0 0;
}
.footer-grid {
  display: grid; grid-template-columns: 1.15fr .85fr 1fr 1.25fr;
  gap: clamp(24px,3vw,44px); padding-bottom: 34px; align-items: start;
}
.footer-logo { margin-bottom: 10px; }
.footer-logo .main { font-size: 28px; font-weight: 900; letter-spacing: -1.1px; }
.footer-logo .sub { font-size: 20px; font-weight: 800; }
.footer-links h3, .footer-newsletter h3, .footer-contacts h3 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 12px;
}
.footer-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-links a { font-size: 13.5px; color: var(--muted); }
.footer-links a:hover { color: var(--am-red); }
.footer-intro { max-width: 34ch; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.contact-list { list-style: none; display: grid; gap: 12px; padding: 0; margin: 0; }
.contact-list li { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 10px; align-items: start; }
.contact-icon {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px;
  color: #fff; background: rgba(202,21,29,.18); border: 1px solid rgba(202,21,29,.42);
  font-size: 10px; font-weight: 900;
}
.contact-copy { min-width: 0; display: grid; gap: 2px; font-size: 13px; }
.contact-copy strong { font-size: 11px; color: #fff; text-transform: uppercase; letter-spacing: .05em; }
.contact-copy a,.contact-copy > span { color: var(--muted); overflow-wrap: anywhere; }
.contact-copy a:hover { color: var(--am-red); }
.contact-copy small { color: var(--muted); line-height: 1.4; }
.footer-grid .footer-newsletter .newsletter-form {
  display: flex; gap: 8px; margin-top: 12px;
  min-width: 0; max-width: 100%;
}
.newsletter-form input {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface-soft);
  color: var(--text); border-radius: 10px; padding: 11px 13px; min-height: 44px; font-size: 14px;
  outline: none; transition: border-color .16s ease, box-shadow .16s ease;
}
.newsletter-form input:focus { border-color: var(--am-red); box-shadow: 0 0 0 3px rgba(202,21,29,.16); }
.newsletter-form button {
  border: 0; background: var(--am-red); color: #fff; border-radius: 10px;
  padding: 0 18px; min-height: 44px; font-weight: 800; font-size: 13.5px; cursor: pointer;
  white-space: nowrap;
}
.newsletter-form button:hover { background: var(--am-red-dark); }
.newsletter-msg { font-size: 12.5px; margin-top: 9px; color: var(--muted); }

/* §44/§75 — small, elegant, right-aligned. Never a banner. */
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 0 20px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.footer-bottom .made-by { margin-inline-start: auto; }
.footer-bottom .made-by a { color: var(--muted); font-weight: 700; transition: color .16s ease; }
.footer-bottom .made-by a:hover { color: var(--am-red); }

.error-page { text-align: center; padding: 90px 0; display: grid; gap: 14px; justify-items: center; }
.error-page h1 { font-size: 76px; margin: 0; font-weight: 900; color: var(--am-red); }

/* ---------- responsive (§55) -------------------------------- */
@media (max-width: 1080px) {
  .page-grid { display: block; }
}
@media (max-width: 900px) {
  .card-grid, .card-grid--3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .top-search { display: none; }
}
@media (max-width: 760px) {
  .nav-toggle {
    display: grid; gap: 5px; width: 42px; height: 42px; place-content: center;
    border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft);
    cursor: pointer;
  }
  .nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; }
  .nav { position: static; }
  /* A plain display toggle rather than a max-height transition:
     an animated height that depends on viewport units can collapse
     to zero in some rendering contexts, and a navigation menu that
     silently fails to open is not a trade worth making for a slide. */
  .nav-row { display: none; flex-direction: column; align-items: stretch; gap: 0; }
  .nav-row.is-open { display: flex; max-height: 78dvh; overflow-y: auto; }
  .nav-item { flex-direction: column; align-items: stretch; border-bottom: 1px solid var(--line); }
  .nav-item > a { padding: 13px 2px; border-bottom: 0; }
  /* Mobile: dropdowns expand inline on tap — no hover dependency */
  .mega {
    position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
    border: 0; border-radius: 0; padding: 0 0 8px; display: none; min-width: 0;
  }
  .nav-item.is-open > .mega { display: block; }
  .brand .main { font-size: 32px; }
  .brand .sub { font-size: 23px; }
  .brand-meta { display: none; }
  .hero-body h1 { font-size: 23px; }
  .article-head h1 { font-size: 27px; }
  .card-grid, .card-grid--3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-bottom .made-by { margin-inline-start: 0; }
  .breaking-label { font-size: 10px; padding: 4px 8px; }
}
@media (max-width: 520px) {
  .footer-grid .footer-newsletter .newsletter-form { flex-direction: column; }
  .newsletter-form button { width: 100%; padding: 11px 16px; }
}

.header-live-link {
  display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 10px;
  border: 1px solid rgba(202,21,29,.42); border-radius: 999px;
  color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
}
.header-live-link:hover { color: #fff; border-color: var(--am-red); background: rgba(202,21,29,.14); }
.header-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--am-red); }

.corporate-page { min-height: 55vh; }
.corporate-head { max-width: 850px; padding: clamp(24px,5vw,54px); margin-bottom: 24px;
  border: 1px solid var(--line); border-radius: var(--am-radius); background: var(--surface); }
.corporate-head h1 { margin: 8px 0 14px; font-size: clamp(32px,5vw,52px); line-height: 1.08; }
.corporate-intro { max-width: 68ch; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.6; }
.corporate-body { max-width: 820px; }
@media (max-width: 420px) {
  .lang-toggle .lang-code { display: none; }
  .social-row .social-btn:nth-child(n+5) { display: none; }
}

/* ---------- live player (Phase 4) ---------------------------
   16:9 box so the layout never jumps while the stream loads and
   the player can never push the page sideways on a phone.       */
.player-ratio {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: 10px; overflow: hidden;
  max-width: 100%;
}
.player-ratio > .player,
.player-ratio > iframe.player,
.player-ratio > video.player {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; display: block; background: #000;
}
.player-ratio .player-offline {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; text-align: center; padding: 20px;
  color: var(--muted); background: linear-gradient(180deg, #14151a, #0d0e12);
}
.player-note { margin-top: 8px; }
@supports not (aspect-ratio: 16 / 9) {
  .player-ratio { height: 0; padding-bottom: 56.25%; }
}
/* A stored video is neither live nor offline — neutral, not red. */
.live-state.is-recorded { background: rgba(120,130,150,.18); color: #aab4c4; }
.live-state.is-recorded .dot { background: #aab4c4; }

/* ---------- final mirrored advertisement rails ---------------
   At the top of a 1920px Chromium page the ticker ends at y=262px.
   Pulling only the outer rails 20px into the shell padding starts them
   at y=270px: an 8px safety gap, while news stays at y=290px.

   During scroll the topbar (0–47px) and sticky navigation (46–97px)
   remain visible. A measured 12px breathing space puts the rail-level
   sticky offset at 109px. Both adverts stay in one sticky container;
   the page grid remains their containing block so they release before
   the footer instead of becoming permanent fixed overlays. */
.ad-rail--desktop { display: none; }
.mobile-ad { display: none; }
.ad-slot { min-width: 0; text-align: center; }
.ad-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ad-ratio, 3 / 5);
  border: 1px solid var(--line);
  border-radius: var(--am-radius);
  overflow: hidden;
  background: #0d0e12;
  box-shadow: var(--shadow);
}
.ad-frame > a { position: absolute; inset: 0; display: block; z-index: 1; }
.ad-frame img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  /* Revealed once the image actually loads, so a broken or slow
     creative never leaves a bordered empty card. */
  opacity: 0; transition: opacity .25s ease; z-index: 1;
}
.ad-frame img.is-ready { opacity: 1; }
.ad-marker {
  position: absolute; z-index: 3; inset-inline-start: 10px; top: 10px;
  display: inline-flex; padding: 4px 7px; border-radius: 999px;
  background: rgba(5,8,12,.78); border: 1px solid rgba(255,255,255,.16);
  color: #d9dde5; font-size: 9px; font-weight: 800; letter-spacing: 1.1px;
  text-transform: uppercase; pointer-events: none;
}
.ad-placeholder {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 9px;
  padding: 18px;
  color: #d8dce5;
  background:
    radial-gradient(circle at 30% 20%, rgba(203, 18, 38, .28), transparent 42%),
    linear-gradient(145deg, #181a20, #0d0e12);
  text-align: center;
}
.ad-placeholder strong { font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.ad-placeholder > span:last-child { max-width: 20ch; color: #9aa3b2; font-size: 12px; line-height: 1.45; }
.ad-placeholder__mark {
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
  color: #fff; background: var(--am-red); font-size: 13px; font-weight: 900;
  letter-spacing: .08em;
}

[data-fit="cover"]   { object-fit: cover;   object-position: 50% 50%; }
[data-fit="contain"] { object-fit: contain; object-position: 50% 50%; }
[data-fit="center"]  { object-fit: contain; object-position: 50% 50%; padding: 7%; }
[data-fit="top"]     { object-fit: cover;   object-position: 50% 0%; }

@supports not (aspect-ratio: 1 / 1) {
  .ad-frame { min-height: 420px; }
}

/* 218px makes the 3:8 + 3:5 pair plus its 20px gap 964.7px tall.
   At sticky top 109px its bottom is 1073.7px in a 1080px viewport:
   both slots fit without clipping while news remains 1220px wide. */
@media (min-width: 1750px) {
  .page-grid {
    display: grid; width: min(1684px, calc(100% - 28px));
    grid-template-columns: 218px minmax(0,1220px) 218px; gap: 14px;
  }
  .page-grid > .page-main { grid-column: 2; }
  .page-grid > .ad-rail--left { grid-column: 1; }
  .page-grid > .ad-rail--right { grid-column: 3; }
  .ad-rail--desktop {
    display: grid; gap: 20px; position: sticky; top: 109px;
    align-self: start; margin-top: -20px;
  }
}

/* In the safe transition band, rails give up width before news does. */
@media (min-width: 1550px) and (max-width: 1749px) {
  .page-grid {
    display: grid; width: calc(100% - 28px);
    grid-template-columns: minmax(140px,1fr) minmax(1120px,1220px) minmax(140px,1fr);
    gap: 14px;
  }
  .page-grid > .page-main { grid-column: 2; }
  .page-grid > .ad-rail--left { grid-column: 1; }
  .page-grid > .ad-rail--right { grid-column: 3; }
  .ad-rail--desktop {
    display: grid; gap: 20px; position: sticky; top: 109px;
    align-self: start; margin-top: -20px;
  }
}

/* Phones get independent permanent placements; desktop rail state is never
   inherited and inactive slots emit no DOM from the template. */
@media (max-width: 760px) {
  .ad-rail--desktop { display: none !important; }
  .mobile-ad { display: block; width: 100%; max-width: 620px; margin: 0 auto 24px; }
  .mobile-ad__frame {
    position: relative; width: 100%; aspect-ratio: var(--mobile-ad-ratio,2 / 1);
    min-height: 112px; overflow: hidden; border: 1px solid var(--line);
    border-radius: var(--am-radius); background: #0d0e12; box-shadow: var(--shadow);
  }
  .mobile-ad__frame > a { position: absolute; inset: 0; z-index: 1; display: block; }
  .mobile-ad__frame img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .25s ease; }
  .mobile-ad__frame img.is-ready { opacity: 1; }
  .mobile-ad-grid-break { grid-column: 1 / -1; }
}

/* Canonical public video archive. Cards always represent a playable video;
   the neutral fallback is intentionally not borrowed from article artwork. */
.broadcast-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 18px;
}
.broadcast-grid--archive { grid-template-columns: repeat(2,minmax(0,1fr)); }
.broadcast-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--am-radius);
  background: var(--surface);
}
.broadcast-card > div { padding: 14px; }
.broadcast-card h2,.broadcast-card h3 { margin: 0 0 8px; }
.broadcast-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(145deg,#20242c,#0d0e12);
}
.broadcast-thumb img { width: 100%;height: 100%;object-fit: cover;display: block; }
.broadcast-thumb > span:last-child {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%,-50%);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(202,21,29,.92);
  color: #fff;
}
.video-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #9aa3b2;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.variant-badges { display: flex;flex-wrap: wrap;gap: 8px;align-items: center;margin-top: 14px; }
.pill { display: inline-flex;align-items: center;padding: 4px 9px;border: 1px solid var(--line);border-radius: 999px;font-size: 12px; }
.pill--ok { border-color: var(--am-red);background: rgba(202,21,29,.12); }
@media (max-width: 900px) {
  .broadcast-grid,.broadcast-grid--archive { grid-template-columns: 1fr; }
}
