/* ====================================================================
   EDITORIAL.CSS — Award-grade design system for Untangled Streaming
   Loaded globally via global-nav.js so every page inherits the system.
   Rick 2026-05-30 — Phase 2 of the gold-standard polish roadmap.
   ==================================================================== */

/* ---------- DESIGN TOKENS ---------- */
:root {
  /* Color — restrained, intentional. Dark-first. */
  --ue-bg:           #0a0e1a;
  --ue-bg-elev:     #0f1721;
  --ue-bg-card:     #131c29;
  --ue-border:      rgba(255,255,255,0.08);
  --ue-border-emp:  rgba(0,180,255,0.30);
  --ue-text:        #e8edf7;
  --ue-text-strong: #f8fafc;
  --ue-text-mute:   #94a3b8;
  --ue-text-dim:    #5a6675;
  --ue-blue:        #00b4ff;
  --ue-blue-soft:   rgba(0,180,255,0.10);
  --ue-green:       #4ade80;
  --ue-amber:       #ffb547;
  --ue-rose:        #ff7a7a;

  /* Type scale — modular, 1.25 ratio. Award-grade hierarchy. */
  --ue-fs-eyebrow: 11.5px;
  --ue-fs-meta:    13px;
  --ue-fs-body:    16px;
  --ue-fs-lede:    19px;
  --ue-fs-h4:      18px;
  --ue-fs-h3:      22px;
  --ue-fs-h2:      28px;
  --ue-fs-h1:      clamp(32px, 5vw, 48px);
  --ue-fs-display: clamp(40px, 6vw, 64px);

  /* Spacing — 8-point rhythm. */
  --ue-s-1: 4px;
  --ue-s-2: 8px;
  --ue-s-3: 12px;
  --ue-s-4: 16px;
  --ue-s-5: 20px;
  --ue-s-6: 24px;
  --ue-s-7: 32px;
  --ue-s-8: 40px;
  --ue-s-9: 56px;
  --ue-s-10: 72px;

  /* Radii. */
  --ue-r-sm: 6px;
  --ue-r-md: 10px;
  --ue-r-lg: 14px;
  --ue-r-xl: 20px;
  --ue-r-pill: 999px;

  /* Motion. */
  --ue-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ue-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ue-dur-fast: 150ms;
  --ue-dur-base: 250ms;
  --ue-dur-slow: 450ms;

  /* Shadow scale. */
  --ue-shadow-sm: 0 2px 8px rgba(0,0,0,0.20);
  --ue-shadow-md: 0 8px 24px rgba(0,0,0,0.30);
  --ue-shadow-lg: 0 16px 50px rgba(0,0,0,0.45);
  --ue-shadow-glow: 0 0 60px rgba(0,180,255,0.20);
}

/* ---------- COMPONENTS — universally available via class hooks ---------- */

/* Editorial pull-quote */
.ue-pullquote {
  margin: var(--ue-s-7) 0;
  padding: var(--ue-s-6) var(--ue-s-7);
  border-left: 3px solid var(--ue-blue);
  background: linear-gradient(135deg, var(--ue-blue-soft) 0%, transparent 60%);
  border-radius: 0 var(--ue-r-lg) var(--ue-r-lg) 0;
  font-size: var(--ue-fs-lede);
  font-weight: 600;
  font-style: italic;
  line-height: 1.45;
  color: var(--ue-text-strong);
}
.ue-pullquote cite {
  display: block;
  margin-top: var(--ue-s-3);
  font-style: normal;
  font-size: var(--ue-fs-meta);
  color: var(--ue-text-mute);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ue-pullquote cite::before {
  content: '— ';
  opacity: 0.6;
}

/* Callout system — 4 variants, consistent geometry */
.ue-callout {
  margin: var(--ue-s-6) 0;
  padding: var(--ue-s-5) var(--ue-s-6);
  border-radius: var(--ue-r-lg);
  border-left: 4px solid var(--ue-blue);
  background: var(--ue-blue-soft);
  font-size: var(--ue-fs-body);
  line-height: 1.55;
  color: var(--ue-text);
}
.ue-callout strong { color: var(--ue-blue); font-weight: 800; }
.ue-callout--good   { border-left-color: var(--ue-green); background: rgba(74,222,128,0.08); }
.ue-callout--good strong { color: var(--ue-green); }
.ue-callout--warn   { border-left-color: var(--ue-amber); background: rgba(255,181,71,0.08); }
.ue-callout--warn strong { color: var(--ue-amber); }
.ue-callout--danger { border-left-color: var(--ue-rose); background: rgba(255,122,122,0.08); }
.ue-callout--danger strong { color: var(--ue-rose); }

/* Source citation chip — inline */
.ue-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ue-text-mute);
  padding: 2px 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--ue-border);
  border-radius: var(--ue-r-pill);
  text-decoration: none;
  letter-spacing: 0.03em;
  margin-left: 6px;
  transition: all var(--ue-dur-fast) var(--ue-ease-out);
}
.ue-source:hover {
  color: var(--ue-blue);
  border-color: var(--ue-border-emp);
  background: var(--ue-blue-soft);
}
.ue-source::before { content: '↗'; opacity: 0.7; font-size: 10px; }

/* Verified date stamp */
.ue-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--ue-green);
  padding: 4px 12px;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.28);
  border-radius: var(--ue-r-pill);
  text-transform: uppercase;
}
.ue-verified::before { content: '●'; }

/* Credentials strip — for bylines + author cards */
.ue-creds {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ue-s-2);
  margin: var(--ue-s-3) 0;
}
.ue-creds__pill {
  padding: 5px 11px;
  background: var(--ue-blue-soft);
  border: 1px solid var(--ue-border-emp);
  border-radius: var(--ue-r-pill);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #7fdfff;
  text-transform: uppercase;
  white-space: nowrap;
}
.ue-creds__pill--green {
  background: rgba(74,222,128,0.10);
  border-color: rgba(74,222,128,0.30);
  color: var(--ue-green);
}
.ue-creds__pill--amber {
  background: rgba(255,184,77,0.10);
  border-color: rgba(255,184,77,0.30);
  color: var(--ue-amber);
}

/* Independent trust strip — used under every article byline */
.ue-trust {
  margin: var(--ue-s-4) 0 var(--ue-s-6);
  padding: 10px 14px;
  background: rgba(74,222,128,0.06);
  border: 1px solid rgba(74,222,128,0.20);
  border-radius: var(--ue-r-md);
  font-size: 12.5px;
  color: #bdc6d3;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.ue-trust__badge {
  color: var(--ue-green);
  font-weight: 800;
  white-space: nowrap;
}
.ue-trust__badge::before { content: '● '; }
.ue-trust a {
  color: var(--ue-blue);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.ue-trust a:hover { text-decoration: underline; }

/* Editorial separator — for major section breaks */
.ue-rule {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--ue-border) 30%, var(--ue-border) 70%, transparent 100%);
  margin: var(--ue-s-9) 0;
}
.ue-rule--accent {
  background: linear-gradient(90deg, transparent 0%, var(--ue-blue) 50%, transparent 100%);
  height: 2px;
  opacity: 0.4;
}

/* Statistic display — big numbers for impact */
.ue-stat {
  display: flex;
  flex-direction: column;
  gap: var(--ue-s-1);
}
.ue-stat__num {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ue-text-strong);
  font-feature-settings: 'tnum' 1;
}
.ue-stat__num--blue { color: var(--ue-blue); }
.ue-stat__num--green { color: var(--ue-green); }
.ue-stat__label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ue-text-mute);
}

/* ---------- GLOBAL TYPOGRAPHY REFINEMENTS ----------
   Applied site-wide to elevate baseline editorial feel. Loosely. */

/* Smoother font rendering on macOS Chrome/Safari */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Tighter h1/h2 letter-spacing for editorial polish */
h1 { letter-spacing: -0.02em; line-height: 1.12; }
h2 { letter-spacing: -0.015em; line-height: 1.25; }
h3 { letter-spacing: -0.01em; }

/* Numeric figures (years, prices) feel tabular */
.ue-num, .stat-value, .price, .cost { font-feature-settings: 'tnum' 1, 'lnum' 1; }

/* ---------- MOTION POLISH ---------- */

/* Smooth fade-in on first paint for editorial article bodies */
@media (prefers-reduced-motion: no-preference) {
  article > .cp-body,
  article > .ue-body,
  .ue-fade-in {
    animation: ue-fade-in var(--ue-dur-slow) var(--ue-ease-out) both;
  }
  @keyframes ue-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* Focus rings — accessible AND award-judge friendly */
:focus-visible {
  outline: 2px solid var(--ue-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Smooth scrolling for anchor links — except reduced-motion */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; scroll-padding-top: 80px; }
}

/* ---------- MOBILE UX — Apple HIG + Material Design touch standards ---------- */

/* Apple's 44pt minimum tap target — apply broadly on touch devices */
@media (pointer: coarse), (max-width: 720px) {
  button:not(.iht-btn):not(.un-deals-close):not(.un-drawer-close):not([class*="qty"]):not([class*="dot"]),
  a.cta, a.btn, .ue-cta, .ue-btn,
  input[type="submit"], input[type="button"], button[type="submit"],
  [role="button"]:not([class*="dot"]) {
    min-height: 44px;
    min-width: 44px;
  }
  /* Form inputs sized for thumb-friendly entry */
  input[type="text"], input[type="email"], input[type="search"], input[type="tel"], input[type="number"], select, textarea {
    min-height: 44px;
    font-size: 16px;  /* prevents iOS Safari zoom-on-focus */
  }
}

/* Reduce horizontal scroll surprises */
img, video, table, .iht-room, .iht-tv { max-width: 100%; }

/* Honor user's reduced-motion preference everywhere */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Prevent text inflation on rotation */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Smooth momentum scrolling on iOS */
body { -webkit-overflow-scrolling: touch; }

/* ---------- PRINT — editorial print mode ---------- */
@media print {
  .ue-trust, .ue-source, nav, footer, .un-deals-bar, #global-nav-mount, .iht-remote { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .ue-callout { border-left-color: #333 !important; background: #f3f3f3 !important; color: #000 !important; }
}
