/* Media coverage pages (media/{year}/, en/media/{year}/), rendered by
   shared/media.js from data/media.js. Page chrome (nav, footer, tokens)
   comes from the host page, like gallery.html.

   Same font rule as the Program section (client feedback 2026-09-03): the
   display font stays on real headings only, list text uses a plain one.

   Layout: cover with key numbers -> heading + featured video -> heading ->
   one white board holding the tabs (one section at a time) and a table-like
   list: outlet | title | date | external icon. Rows are not cards: hairlines
   between them, a teal bar + tint on hover. Outlet names are muted, not bold
   (client 2026-10-20: the media are not the focus here). On phones each row
   stacks: outlet + date on top, title below. */
.cx-media-page {
  --m-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --m-line: rgba(11, 57, 84, 0.1);
  --m-nav: 72px;
  background: var(--light-gray)
}

/* ---- Cover ---- */
.cx-media-hero {
  position: relative;
  margin-top: var(--m-nav);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 24px 52px;
  overflow: hidden;
  background: var(--navy)
}

.cx-media-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(4px) saturate(0.8);
  transform: scale(1.05)
}

.cx-media-hero::before,
.cx-media-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none
}

.cx-media-hero::before {
  z-index: 1;
  background:
    radial-gradient(ellipse 60% 70% at 85% 0%, rgba(0, 205, 255, 0.28), transparent 70%),
    linear-gradient(180deg, rgba(11, 57, 84, 0.72) 0%, rgba(8, 40, 60, 0.92) 100%)
}

.cx-media-hero::after {
  z-index: 1;
  background-image: var(--dot-grid);
  background-size: 22px 22px
}

.cx-media-hero > *:not(img) {
  position: relative;
  z-index: 2
}

.cx-media-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 1px solid rgba(0, 205, 255, 0.45);
  border-radius: 999px;
  background: rgba(0, 205, 255, 0.1);
  color: var(--teal);
  font-family: var(--m-font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase
}

.cx-media-eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(0, 205, 255, 0.2)
}

.cx-media-hero h1 {
  margin-top: 20px;
  color: var(--white);
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.3)
}

/* Year switch: rendered only once data/media.js holds more than one edition */
.cx-media-years {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 26px
}

.cx-media-years a {
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  color: var(--white);
  font-family: var(--m-font);
  font-size: 0.85rem;
  font-weight: 600
}

.cx-media-years a.active,
.cx-media-years a:hover {
  background: var(--white);
  color: var(--navy)
}

/* ---- Content column ---- */
.cx-media-main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 56px 24px 104px;
  font-family: var(--m-font)
}

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

/* ---- Featured video ---- */
.cx-media-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--navy);
  box-shadow: 0 24px 60px rgba(11, 57, 84, 0.22)
}

.cx-media-featured video {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000
}

.cx-media-featured-body {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px 32px 30px;
  background:
    radial-gradient(ellipse 90% 60% at 100% 0%, rgba(0, 205, 255, 0.18), transparent 70%),
    linear-gradient(160deg, var(--navy-deep), var(--navy));
  color: var(--white)
}

.cx-media-featured-body::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--dot-grid);
  background-size: 22px 22px;
  pointer-events: none
}

.cx-media-featured-body > * {
  position: relative;
  z-index: 1
}

.cx-media-featured-tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 205, 255, 0.16);
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase
}

.cx-media-featured-tag svg {
  width: 11px;
  height: 11px
}

.cx-media-featured-outlet {
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
  font-weight: 600
}

.cx-media-featured-title {
  margin-top: 6px;
  color: var(--white);
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.32;
  text-wrap: balance
}

.cx-media-featured-meta {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.86rem
}

.cx-media-featured-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: auto;
  padding-top: 28px
}

.cx-media-featured-links .cx-media-site {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: underline;
  text-decoration-color: rgba(0, 205, 255, 0.6);
  text-underline-offset: 4px
}

.cx-media-featured-links .cx-media-site:hover {
  color: var(--teal)
}

.cx-media-featured-links .btn {
  gap: 8px;
  font-family: var(--m-font);
  text-align: left
}

.cx-media-featured-links svg {
  width: 15px;
  height: 15px;
  flex: none
}

/* ---- Headings (above the video, above the list) ---- */
.cx-media-featured-head {
  margin: 16px 0 36px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--navy)
}

.cx-media-list-head {
  margin-top: 80px
}

.cx-media-heading {
  color: var(--navy);
  font-family: 'Science Gothic', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.2;
  text-wrap: balance
}

/* ---- Board: one white surface for tabs + list ---- */
.cx-media-board {
  --m-cols: 240px minmax(0, 1fr) 110px 36px;
  --m-gap: 28px;
  --m-pad: 28px;
  position: relative;
  margin-top: 28px;
  border: 1px solid var(--m-line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: 0 1px 2px rgba(11, 57, 84, 0.04), 0 22px 56px rgba(11, 57, 84, 0.09);
  overflow: hidden
}

/* brand gradient along the top edge */
.cx-media-board::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--teal-deep) 55%, var(--teal))
}

/* ---- Tabs ---- */
.cx-media-tabs {
  display: flex;
  padding: 3px calc(var(--m-pad) - 14px) 0;
  border-bottom: 1px solid var(--m-line);
  overflow-x: auto;
  scrollbar-width: none
}

.cx-media-tabs::-webkit-scrollbar {
  display: none
}

.cx-media-tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 20px 14px 18px;
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.25s ease
}

.cx-media-tabs a::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--teal-deep), var(--teal));
  transform: scaleX(0);
  transition: transform 0.4s var(--ease-premium)
}

.cx-media-tabs a + a {
  margin-left: 12px
}

.cx-media-badge {
  display: inline-block;
  min-width: 28px;
  margin-left: 10px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--light-gray);
  color: var(--text-light);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: background 0.25s ease, color 0.25s ease
}

.cx-media-tabs a:hover {
  color: var(--navy)
}

.cx-media-tabs a[aria-selected="true"] {
  color: var(--navy)
}

.cx-media-tabs a[aria-selected="true"]::after {
  transform: scaleX(1)
}

.cx-media-tabs a[aria-selected="true"] .cx-media-badge {
  background: var(--navy);
  color: var(--white)
}

.cx-media-tabs a:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: -6px;
  border-radius: 10px
}

/* ---- Column labels ---- */
.cx-media-cols {
  display: grid;
  grid-template-columns: var(--m-cols);
  gap: var(--m-gap);
  padding: 12px var(--m-pad);
  border-bottom: 1px solid var(--m-line);
  background: var(--light-gray);
  color: var(--text-light);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase
}

.cx-media-cols span:nth-child(3) {
  text-align: right
}

/* ---- Rows ---- */
.cx-media-list {
  list-style: none
}

.cx-media-item + .cx-media-item {
  border-top: 1px solid var(--m-line)
}

.cx-media-item > a {
  position: relative;
  display: grid;
  grid-template-columns: var(--m-cols);
  align-items: center;
  gap: var(--m-gap);
  padding: 18px var(--m-pad);
  transition: background 0.3s ease
}

/* teal bar on the left edge, drawn in on hover */
.cx-media-item > a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--teal), var(--teal-deep));
  transform: scaleY(0);
  transition: transform 0.35s var(--ease-premium)
}

.cx-media-outlet {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0
}

.cx-media-mono {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--light-blue);
  color: var(--teal-contrast);
  font-family: 'Science Gothic', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease
}

.cx-media-mono.has-logo {
  overflow: hidden;
  border: 1px solid var(--m-line);
  background: var(--white)
}

.cx-media-mono img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain
}

.cx-media-outlet-name {
  min-width: 0;
  color: var(--text-light);
  font-size: 0.93rem;
  font-weight: 400;
  line-height: 1.3;
  overflow-wrap: anywhere
}

/* "Видео" / "Facebook" under the outlet name */
.cx-media-tag {
  display: block;
  margin-top: 3px;
  color: var(--teal-contrast);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase
}

.cx-media-title {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  text-wrap: pretty;
  transition: color 0.25s ease
}

.cx-media-date {
  color: var(--text-light);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap
}

.cx-media-ext {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--m-line);
  border-radius: 50%;
  color: var(--teal-deep);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.35s var(--ease-premium)
}

.cx-media-ext svg {
  width: 16px;
  height: 16px
}

.cx-media-item > a:hover,
.cx-media-item > a:focus-visible {
  background: linear-gradient(90deg, rgba(237, 247, 250, 0.95), rgba(237, 247, 250, 0.25) 85%)
}

.cx-media-item > a:hover::before,
.cx-media-item > a:focus-visible::before {
  transform: scaleY(1)
}

.cx-media-item > a:hover .cx-media-title,
.cx-media-item > a:focus-visible .cx-media-title {
  color: var(--navy)
}

.cx-media-item > a:hover .cx-media-mono,
.cx-media-item > a:focus-visible .cx-media-mono {
  background: var(--navy);
  color: var(--white)
}

/* logos keep their own colours; they get a teal ring instead */
.cx-media-item > a:hover .cx-media-mono.has-logo,
.cx-media-item > a:focus-visible .cx-media-mono.has-logo {
  border-color: var(--teal-deep);
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(0, 160, 204, 0.25)
}

.cx-media-item > a:hover .cx-media-ext,
.cx-media-item > a:focus-visible .cx-media-ext {
  border-color: var(--teal-deep);
  background: var(--teal-deep);
  color: var(--white);
  transform: translateX(2px)
}

.cx-media-item > a:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: -3px
}

.cx-media-empty {
  padding: 48px var(--m-pad);
  text-align: center;
  color: var(--text-light)
}

@media (max-width: 900px) {
  .cx-media-featured {
    grid-template-columns: 1fr
  }

  .cx-media-featured video {
    height: auto
  }

  .cx-media-featured-links {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 22px
  }

  .cx-media-board {
    --m-cols: 190px minmax(0, 1fr) 96px 34px;
    --m-gap: 20px;
    --m-pad: 22px
  }
}

@media (max-width: 700px) {
  .cx-media-list-head {
    margin-top: 56px
  }

  .cx-media-board {
    --m-pad: 16px;
    margin-top: 20px;
    border-radius: var(--radius)
  }

  /* two equal tabs that may wrap, so neither gets cut off */
  .cx-media-tabs {
    padding: 3px 4px 0
  }

  .cx-media-tabs a {
    flex: 1 1 0;
    justify-content: center;
    padding: 14px 6px;
    font-size: 0.9rem;
    line-height: 1.3;
    text-align: center;
    white-space: normal
  }

  .cx-media-tabs a + a {
    margin-left: 0
  }

  .cx-media-badge {
    margin-left: 6px
  }

  .cx-media-tabs a::after {
    left: 8px;
    right: 8px
  }

  .cx-media-cols {
    display: none
  }

  /* row stacks: outlet + date on top, title + icon below */
  .cx-media-item > a {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "outlet date" "title ext";
    gap: 10px 14px;
    padding: 16px var(--m-pad)
  }

  .cx-media-outlet {
    grid-area: outlet;
    gap: 10px
  }

  .cx-media-mono {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 0.8rem
  }

  .cx-media-outlet-name {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 10px;
    font-size: 0.9rem
  }

  .cx-media-tag {
    margin-top: 0
  }

  .cx-media-date {
    grid-area: date;
    font-size: 0.8rem
  }

  .cx-media-title {
    grid-area: title;
    font-size: 0.97rem
  }

  .cx-media-ext {
    grid-area: ext;
    align-self: start;
    width: 32px;
    height: 32px
  }

  .cx-media-ext svg {
    width: 15px;
    height: 15px
  }
}

@media (max-width: 600px) {
  .cx-media-hero {
    min-height: 220px;
    padding: 44px 16px 44px
  }

  .cx-media-main {
    padding: 36px 16px 72px
  }

  .cx-media-featured {
    border-radius: var(--radius)
  }

  .cx-media-featured-body {
    padding: 22px 20px 22px
  }

  .cx-media-featured-title {
    font-size: 1.12rem
  }
}

@media (prefers-reduced-motion: reduce) {
  .cx-media-tabs a::after,
  .cx-media-item > a,
  .cx-media-item > a::before,
  .cx-media-title,
  .cx-media-mono,
  .cx-media-ext {
    transition: none
  }

  .cx-media-item > a:hover .cx-media-ext,
  .cx-media-item > a:focus-visible .cx-media-ext {
    transform: none
  }
}
