/* ==========================================================================
   WORLD TV — layout: header, page frame, hero, rails
   ========================================================================== */

/* Header ----------------------------------------------------------------- */
.app-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-header);
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: linear-gradient(to bottom, rgba(9, 10, 14, 0.96), rgba(9, 10, 14, 0.72));
  border-bottom: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

[data-theme="light"] .app-header {
  background: linear-gradient(to bottom, rgba(246, 247, 250, 0.97), rgba(246, 247, 250, 0.82));
}

.app-header.is-scrolled {
  background: rgba(9, 10, 14, 0.92);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--border);
}

[data-theme="light"] .app-header.is-scrolled {
  background: rgba(246, 247, 250, 0.94);
}

.app-header__inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 34px);
}

/* Brand ------------------------------------------------------------------ */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.brand__mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  transition: transform var(--dur) var(--ease);
}

.brand:hover .brand__mark {
  transform: rotate(-6deg) scale(1.04);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 3px;
}

.brand__word {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--text);
}

.brand__sub {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--text-mute);
}

/* Desktop nav ------------------------------------------------------------ */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.nav__link {
  position: relative;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-sub);
  white-space: nowrap;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.nav__link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav__link.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateX(-50%);
}

/* Header actions --------------------------------------------------------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  color: var(--text-sub);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn__count {
  position: absolute;
  top: 5px;
  right: 4px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
}

.icon-btn__label {
  display: none;
  font-size: 12px;
  font-weight: 600;
}

html.no-icons .icon-btn {
  width: auto;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.06);
}

html.no-icons .icon-btn svg {
  display: none;
}

html.no-icons .icon-btn__label {
  display: inline;
}

.header-search {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-mute);
  font-size: 13px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.header-search:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.09);
}

.header-search svg {
  width: 16px;
  height: 16px;
}

.header-search kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  color: var(--text-mute);
}

.header-toggle {
  display: none;
}

/* Mobile drawer ---------------------------------------------------------- */
.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 auto;
  z-index: calc(var(--z-header) - 1);
  display: none;
  padding: 12px var(--gutter) 22px;
  background: rgba(9, 10, 14, 0.98);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

[data-theme="light"] .mobile-nav {
  background: rgba(246, 247, 250, 0.99);
}

.mobile-nav.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.mobile-nav__list {
  display: grid;
  gap: 2px;
}

.mobile-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 12px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-sub);
}

.mobile-nav__link:hover,
.mobile-nav__link.is-active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.mobile-nav__link svg {
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

/* Page frame ------------------------------------------------------------- */
.page {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(48px, 7vw, 96px);
}

.page--narrow {
  max-width: 1080px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(28px, 4vw, 48px) 0 22px;
}

.page-head__eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.page-head__title {
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.14;
}

.page-head__lead {
  margin-top: 10px;
  max-width: 68ch;
  color: var(--text-sub);
  font-size: 14.5px;
}

.page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Hero ------------------------------------------------------------------- */
.hero {
  position: relative;
  margin: 0 calc(var(--gutter) * -1);
  padding: clamp(28px, 5vw, 72px) var(--gutter) clamp(28px, 5vw, 64px);
  min-height: min(72vh, 620px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 90% at 78% 12%, rgba(229, 9, 20, 0.18), transparent 58%),
    radial-gradient(80% 70% at 12% 92%, rgba(90, 169, 255, 0.1), transparent 62%),
    linear-gradient(180deg, #0c0d13 0%, #090a0e 100%);
}

.hero__glow {
  position: absolute;
  right: -8%;
  top: -14%;
  width: min(620px, 62vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 9, 20, 0.24), transparent 66%);
  filter: blur(28px);
  opacity: 0.9;
}

.hero__logo-ghost {
  position: absolute;
  right: clamp(-40px, 2vw, 40px);
  top: 50%;
  transform: translateY(-52%);
  width: clamp(220px, 26vw, 380px);
  max-height: 62%;
  object-fit: contain;
  opacity: 0.16;
  filter: blur(0.4px) saturate(0.7);
  z-index: 0;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  gap: clamp(24px, 4vw, 56px);
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: end;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-bottom: 20px;
}

.hero__eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.16);
  animation: pulse-soft 2.6s infinite;
}

.hero__title {
  font-size: clamp(34px, 5.4vw, 68px);
  font-weight: 900;
  line-height: 1.03;
  letter-spacing: -0.035em;
  margin-bottom: 18px;
  text-wrap: balance;
}

.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.hero__lead {
  max-width: 56ch;
  color: var(--text-sub);
  font-size: clamp(14px, 1.2vw, 16px);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.hero__fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero__fact strong {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero__fact span {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
}

/* Hero featured card ----------------------------------------------------- */
.hero__feature {
  position: relative;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, rgba(27, 30, 39, 0.96), rgba(18, 20, 27, 0.94));
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
}

.hero__feature-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 14px;
}

.hero__feature-body {
  display: flex;
  gap: 14px;
  align-items: center;
}

.hero__feature-logo {
  width: 74px;
  height: 74px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  object-fit: contain;
  padding: 8px;
}

.hero__feature-placeholder {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  border: 1px solid var(--border);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-mute);
  text-transform: uppercase;
}

.hero__feature-name {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.hero__feature-meta {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-sub);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.hero__feature-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.hero__feature-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-sub);
}

.hero__feature-list li strong {
  color: var(--text);
  font-weight: 700;
}

/* Sections --------------------------------------------------------------- */
.section {
  padding-top: var(--section-gap);
}

.section:first-child {
  padding-top: clamp(24px, 3vw, 40px);
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(17px, 1.6vw, 21px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section__title::before {
  content: "";
  width: 3px;
  height: 17px;
  border-radius: 2px;
  background: var(--accent);
}

.section__sub {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-mute);
}

.section__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-sub);
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}

.section__more:hover {
  color: var(--accent);
}

.section__more svg {
  width: 14px;
  height: 14px;
}

/* Rail ------------------------------------------------------------------- */
.rail {
  position: relative;
}

.rail__track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  padding: 4px 2px 14px;
  margin: -4px -2px 0;
  -webkit-overflow-scrolling: touch;
}

.rail__track > * {
  flex: 0 0 clamp(200px, 20vw, 268px);
  scroll-snap-align: start;
}

.rail__track::-webkit-scrollbar {
  height: 0;
}

.rail__track {
  scrollbar-width: none;
}

.rail__btn {
  position: absolute;
  top: calc(50% - 24px);
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(12, 13, 18, 0.86);
  border: 1px solid var(--border-strong);
  color: var(--text);
  opacity: 0;
  transition: opacity var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
  backdrop-filter: blur(8px);
}

.rail__btn svg {
  width: 18px;
  height: 18px;
}

.rail__btn--prev {
  left: -6px;
}

.rail__btn--next {
  right: -6px;
}

.rail:hover .rail__btn,
.rail__btn:focus-visible {
  opacity: 1;
}

.rail__btn[disabled] {
  opacity: 0 !important;
  pointer-events: none;
}

/* Grid ------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: clamp(12px, 1.5vw, 20px);
}

.grid--channels {
  grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
}

.grid--tiles {
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
}

.grid--countries {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Footer ----------------------------------------------------------------- */
.app-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}

.app-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 36px var(--gutter) 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 26px 48px;
  justify-content: space-between;
  align-items: flex-start;
}

.app-footer__brand {
  max-width: 380px;
  display: grid;
  gap: 12px;
}

.app-footer__note {
  font-size: 12px;
  line-height: 1.75;
  color: var(--text-mute);
}

.app-footer__cols {
  display: flex;
  flex-wrap: wrap;
  gap: 26px 48px;
}

.app-footer__col h3 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 10px;
}

.app-footer__col li + li {
  margin-top: 6px;
}

.app-footer__col a {
  font-size: 12.5px;
  color: var(--text-sub);
}

.app-footer__col a:hover {
  color: var(--text);
}

.app-footer__bottom {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter) 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-mute);
}

/* Not found -------------------------------------------------------------- */
.notfound {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 72vh;
  gap: 14px;
}

.notfound__code {
  font-size: clamp(64px, 14vw, 140px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
  opacity: 0.9;
}

.notfound__title {
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 800;
}

.notfound__text {
  max-width: 56ch;
  color: var(--text-sub);
}

.notfound__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}
