/* Al-Baraka channel: holding page. Stop-gap until channel_web (see README). */

/* Tokens: names and values from the Figma variables (file stLaqLv6hXzXU5YDhE7WHP, collection "Color" / "Spacing & Radius"). */
:root {
  --color-bg-page: #f4f5ef;
  --color-bg-inverse: #122c3b;
  --color-bg-inverse-deep: #0a1e28;
  --color-bg-live: #c8102e;
  --color-brand-primary: #006746;
  --color-accent-gold: #d4ab59;
  --color-text-on-dark: #ffffff;
  --color-text-on-dark-muted: #b7c4cb;
  --color-text-accent-on-dark: #d4ab59;
  --color-text-on-brand: #ffffff;
  --color-border-on-dark: #24495b;
  --color-border-accent: #d4ab59;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;
  --space-4xl: 64px;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-full: 999px;
  --grid-margin-mobile: 16px;
  --grid-margin-desktop: 72px;

  --font-head: "Readex Pro", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  --font-body: "Noto Sans Arabic", Tahoma, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-inverse);
  color: var(--color-text-on-dark);
  font: 400 1rem/1.7 var(--font-body);
}
h1, h2, p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: var(--grid-margin-mobile);
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Focus: gold ring on navy (6.8:1) */
:focus-visible { outline: 3px solid var(--color-accent-gold); outline-offset: 3px; border-radius: var(--radius-sm); }
.skip-link {
  position: absolute; inset-inline-start: var(--space-lg); top: -100px; z-index: 10;
  background: var(--color-text-on-dark); color: var(--color-bg-inverse-deep);
  padding: var(--space-sm) var(--space-lg); border-radius: var(--radius-md); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--space-lg); }

/* Header */
.site-header {
  background: var(--color-bg-inverse-deep);
  border-block-end: 2px solid var(--color-border-accent);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); min-height: 80px; padding-block: var(--space-md); }
/* Channel frequency (تردد القناة): sits at the inline end (left in RTL) */
.freq { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: end; min-width: 0; }
.freq-label { font: 500 0.75rem/1.4 var(--font-body); color: var(--color-text-accent-on-dark); }
.freq-value { font: 600 0.875rem/1.4 var(--font-head); color: var(--color-text-on-dark); }
.freq-value .sep { color: var(--color-text-accent-on-dark); margin-inline: 0.35em; }
/* Phones: the frequency drops to its own row under the logo, label and value side by side */
@media (max-width: 599px) {
  .site-header .wrap { flex-wrap: wrap; row-gap: var(--space-sm, 8px); }
  .freq {
    flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: baseline;
    justify-content: flex-start; column-gap: 0.6em; text-align: start;
    padding-block-start: var(--space-sm, 8px); border-block-start: 1px solid rgba(213, 172, 89, 0.25);
  }
}
.brand { display: inline-flex; align-items: center; gap: var(--space-md); text-decoration: none; }
.brand-mark { display: block; width: 38px; height: 60px; flex: none; }
.logo { display: block; width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-ar { font: 600 1.375rem/1.3 var(--font-head); color: var(--color-text-on-dark); }
.brand-en { font: 500 0.8125rem/1.4 var(--font-head); letter-spacing: 0.22em; color: var(--color-text-accent-on-dark); }

/* Intro */
main { flex: 1; }
.intro { padding-block: var(--space-xl) var(--space-lg); }
.tagline { font: 700 1.75rem/1.4 var(--font-head); color: var(--color-text-on-dark); }
.tagline-sub { display: block; font: 500 1rem/1.6 var(--font-head); color: var(--color-text-accent-on-dark); }
.mission { margin-block-start: var(--space-md); font: 400 1rem/1.9 var(--font-body); color: var(--color-text-on-dark-muted); }

/* Live section */
.live { padding-block-end: var(--space-3xl); }
.live:focus { outline: none; }
.section-title {
  display: inline-block;
  font: 600 1.125rem/1.6 var(--font-head);
  color: var(--color-text-on-dark);
  padding-block-end: var(--space-xs);
  margin-block-end: var(--space-md);
  border-block-end: 2px solid var(--color-border-accent);
}

/* Player: the 16:9 box is reserved in every state (no layout shift). */
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(36, 73, 91, 0.55), transparent 70%),
    var(--color-bg-inverse-deep);
  border: 1px solid var(--color-border-on-dark);
  container-type: inline-size;
}
@supports not (aspect-ratio: 1) {
  .player { height: 0; padding-top: 56.25%; }
}
.stage, .stage > video, .stage > iframe, .poster { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage > video, .stage > iframe { display: block; border: 0; background: #000; }
.poster {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(8px, 3.5cqi, 24px);
  padding: var(--space-md);
  text-align: center;
}
/* Logo animation on the poster: the approved «outline then fill, v4 sheen» (2026-11-23), 5 s, plays once.
   Markup is generated by tools/make-logo-anim.py from the client's paths. Every rule's default is the FINAL
   frame, so reduced motion (animations off, see the end of this file) shows the finished logo straight away.
   0.2-2.7 s every outline draws in one pass (right side first) with a soft gold bloom; 1.7-3.5 s the gold
   fill pours up from the bottom; 3.1-3.8 s the lines fade; 0.4-3.2 s a warm halo opens; 0-3.4 s a slight
   rise; 3.35-4.55 s one slow gleam crosses the mark; a slow push-in over the whole 5 s. */
.poster-logo { height: clamp(72px, 28cqi, 230px); flex: none; }
.logo-anim { display: block; height: 100%; width: auto; overflow: visible; }
.la-halo { opacity: 1; animation: la-halo 5s linear both; }
.la-rise { transform-box: view-box; transform-origin: 141px 224px; animation: la-rise 5s linear both; }
/* line widths are screen pixels (vector-effect: non-scaling-stroke on the paths), so the drawing reads at any size */
.la-lines, .la-bloom-lines { fill: none; stroke: url(#la-gold); stroke-linecap: round; stroke-linejoin: round; }
.la-lines { stroke-width: 1.4px; opacity: 0; animation: la-lines 5s linear both; }
.la-bloom-lines { stroke-width: 4px; opacity: 0; animation: la-bloom-lines 5s linear both; }
.la-lines use, .la-bloom-lines use { stroke-dasharray: 1; stroke-dashoffset: 0; animation: la-draw var(--d) cubic-bezier(.45, .05, .35, 1) var(--t) both; }
.la-fill, .la-bloom-fill { fill: url(#la-gold); }
.la-fill { opacity: 1; animation: la-fill 5s linear both; }
.la-bloom-fill { opacity: .18; animation: la-bloom-fill 5s linear both; }
.la-pour-rect { transform: translateY(-550px); animation: la-pour 5s linear both; }
.la-sheen { opacity: 0; mix-blend-mode: screen; transform-box: fill-box; transform-origin: center; transform: translateX(-10px) skewX(-18deg); animation: la-sheen 5s linear both; }
@keyframes la-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes la-halo { 0%, 8% { opacity: 0; } 64%, 100% { opacity: 1; } }
@keyframes la-rise {
  0% { transform: translateY(17px) scale(.965); animation-timing-function: cubic-bezier(.3, .1, .3, 1); }
  68% { transform: translateY(0) scale(.989); animation-timing-function: cubic-bezier(.3, 0, .5, 1); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes la-lines { 0%, 62% { opacity: 1; } 76%, 100% { opacity: 0; } }
@keyframes la-bloom-lines { 0%, 4% { opacity: 0; } 24%, 54% { opacity: .85; } 76%, 100% { opacity: 0; } }
@keyframes la-bloom-fill { 0%, 54% { opacity: 0; } 76%, 100% { opacity: .18; } }
@keyframes la-fill { 0%, 34% { opacity: .6; } 62%, 100% { opacity: 1; } }
@keyframes la-pour {
  0%, 34% { transform: translateY(60px); animation-timing-function: cubic-bezier(.45, .05, .45, 1); }
  70%, 100% { transform: translateY(-550px); }
}
@keyframes la-sheen {
  0%, 67% { opacity: 0; transform: translateX(390px) skewX(-18deg); animation-timing-function: cubic-bezier(.45, .05, .55, .95); }
  74% { opacity: .55; }
  84% { opacity: .55; }
  91%, 100% { opacity: 0; transform: translateX(-10px) skewX(-18deg); }
}
.player[data-state="playing"] .poster { display: none; }

.poster-title { font: 600 clamp(1.0625rem, 5cqi, 2rem)/1.4 var(--font-head); color: var(--color-text-on-dark); }
.poster-note { font-size: clamp(0.75rem, 2.2cqi, 0.875rem); color: var(--color-text-on-dark-muted); }

.countdown { display: flex; gap: clamp(6px, 2cqi, 16px); direction: rtl; }
.cd-cell {
  display: flex; flex-direction: column; align-items: center;
  min-width: clamp(54px, 15cqi, 104px);
  padding: clamp(4px, 1.4cqi, 12px) clamp(4px, 1.4cqi, 12px);
  background: rgba(16, 45, 59, 0.85);
  border: 1px solid var(--color-border-on-dark);
  border-block-start: 2px solid var(--color-border-accent);
  border-radius: var(--radius-md);
}
.cd-num {
  font: 600 clamp(1.25rem, 6cqi, 2.75rem)/1.15 var(--font-head);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-on-dark);
}
.cd-label { font-size: clamp(0.6875rem, 2cqi, 0.875rem); line-height: 1.5; color: var(--color-text-on-dark-muted); }

/* Play button: green fill, white icon, gold ring (Figma Live Video Block) */
.play-btn {
  display: grid; place-items: center;
  width: clamp(56px, 13cqi, 88px); height: clamp(56px, 13cqi, 88px);
  padding: 0; border: 3px solid var(--color-accent-gold); border-radius: var(--radius-full);
  background: var(--color-brand-primary); color: var(--color-text-on-brand);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.play-btn svg { width: 46%; height: 46%; fill: currentColor; transform: translateX(6%); } /* play icons never flip in RTL */
.play-btn:hover { background: #00543a; transform: scale(1.05); }
.play-btn:focus-visible { outline-color: var(--color-text-on-dark); outline-offset: 4px; border-radius: var(--radius-full); }

/* «مباشر» badge: white on live red (5.9:1), always with the dot. Only shown while actually playing. */
.live-head { display: flex; align-items: center; gap: var(--space-md); margin-block-end: var(--space-md); }
.live-head .section-title { margin-block-end: 0; }
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px;
  background: var(--color-bg-live); color: var(--color-text-on-dark);
  font: 600 0.8125rem/1.6 var(--font-body);
  border-radius: var(--radius-sm);
}
.live-dot {
  width: 8px; height: 8px; border-radius: var(--radius-full); background: currentColor;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse { 50% { opacity: 0.35; } }

/* Connect */
.connect { padding-block-end: var(--space-3xl); }
.socials, .contacts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-md); }
.contacts { margin-block-start: var(--space-lg); }
.social-link {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--color-border-on-dark); border-radius: var(--radius-full);
  color: var(--color-text-on-dark); background: var(--color-bg-inverse-deep);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.social-link:hover { border-color: var(--color-accent-gold); color: var(--color-text-accent-on-dark); }
.social-link svg, .contact-link svg { width: 20px; height: 20px; fill: currentColor; }
.contact-link {
  display: inline-flex; align-items: center; gap: var(--space-sm); min-height: 44px;
  color: var(--color-text-on-dark); text-decoration-color: var(--color-accent-gold); text-underline-offset: 4px;
}
.contact-link .label { color: var(--color-text-on-dark-muted); }

/* Footer */
.site-footer {
  background: var(--color-bg-inverse-deep);
  border-block-start: 1px solid var(--color-border-on-dark);
  color: var(--color-text-on-dark-muted);
  font-size: 0.875rem;
}
.site-footer .wrap { padding-block: var(--space-xl); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

@media (min-width: 768px) {
  .wrap { padding-inline: var(--space-2xl); }
  .site-header .wrap { min-height: 96px; }
  .freq-label { font-size: 0.8125rem; }
  .freq-value { font-size: 1rem; }
  .brand-mark { width: 44px; height: 70px; }
  .brand-ar { font-size: 1.625rem; }
  .intro { padding-block: var(--space-3xl) var(--space-xl); }
  .tagline { font-size: 1.75rem; }
  .section-title { font-size: 1.375rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
