/*
 * Design system do tema youplay: tokens.
 *
 * Única fonte de cores, tipografia, espaçamento, raios, sombras e camadas.
 * Nenhum outro arquivo deve usar cor literal; use as variáveis abaixo.
 *
 * Modo escuro: classe "dark" no <html> (aplicada pelo servidor e pelo toggle
 * em container.html). A cor da marca fica em --brand; --primary é neutro
 * (preto no claro, branco no escuro), no estilo shadcn/ui. Para botões
 * primários azuis, troque --primary por var(--brand) e --primary-foreground
 * por #fff.
 */

:root {
  color-scheme: light;

  /* Marca */
  --brand: #04abf2;
  --brand-foreground: #ffffff;
  --brand-text: #0369a1;          /* azul legível sobre fundo claro (links, ativo): >= 5:1 em branco, cinza e brand-subtle */
  --brand-subtle: color-mix(in oklch, var(--brand) 12%, transparent);

  /* Superfícies (zinc) */
  --background: #ffffff;
  --surface: #ffffff;              /* fundo da página */
  --foreground: #09090b;
  --card: #ffffff;
  --card-foreground: #09090b;
  --popover: #ffffff;
  --popover-foreground: #09090b;
  --primary: #18181b;
  --primary-foreground: #fafafa;
  --secondary: #f4f4f5;
  --secondary-foreground: #18181b;
  --muted: #f4f4f5;
  --muted-foreground: #63636d;   /* >= 4.5:1 também sobre --muted e --secondary */
  --accent: #f4f4f5;
  --accent-foreground: #18181b;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --ring: var(--brand-text);       /* foco: contraste >= 3:1 (WCAG 1.4.11) no claro e no escuro */
  --header: rgb(255 255 255 / 85%);
  --overlay: rgb(0 0 0 / 50%);
  --media-overlay: rgb(0 0 0 / 78%);  /* badges sobre thumbnails */

  /* Estados */
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --success: #16a34a;
  --success-foreground: #ffffff;
  --warning: #d97706;
  --warning-foreground: #ffffff;
  --info: var(--brand-text);
  --live: #e11d48;

  /* Tipografia */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-2xs: 11px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 20px;
  --text-3xl: 24px;
  --text-4xl: 30px;
  --leading-tight: 1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;
  --tracking-tight: -0.015em;

  /* Espaçamento (grade de 4px) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Raios */
  --radius: 10px; /* px de propósito: o Bootstrap 3 fixa html{font-size:10px}, então rem sai menor que o esperado */
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-full: 9999px;

  /* Sombras */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.08);
  --shadow-md: 0 4px 12px -2px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 12px 32px -8px rgb(0 0 0 / 0.16), 0 4px 8px -4px rgb(0 0 0 / 0.08);
  --focus-ring: 0 0 0 2px var(--background), 0 0 0 4px color-mix(in oklch, var(--ring) 70%, transparent);

  /* Movimento */
  --ease: cubic-bezier(.2, 0, 0, 1);
  --duration: .15s;

  /* Camadas */
  --z-base: 1;
  --z-raised: 10;
  --z-sticky: 100;
  --z-dropdown: 1000;
  --z-header: 1030;
  --z-drawer: 1040;
  --z-modal: 1050;
  --z-toast: 1100;

  /* Layout */
  --header-h: 56px;
  --bottom-nav-h: 60px;
  --content-max: 1680px;
  --card-min: 260px;  /* largura mínima de um card na grade de vídeos */

  /* Mídia (texto/ícones sobre capas e hero: sempre claro sobre scrim escuro) */
  --on-media: #ffffff;
  --on-media-muted: rgb(255 255 255 / 80%);
  --on-media-subtle: rgb(255 255 255 / 18%);
  --on-media-inverse: #09090b;
  --scrim-strong: rgb(0 0 0 / 82%);
  --scrim-soft: rgb(0 0 0 / 0%);
  --placeholder: var(--muted);     /* fundo da capa enquanto carrega / quebrada */

  /* Catálogo */
  --aspect-cover: 16 / 9;
  --rail-gap: var(--space-3);
  --rail-cols: 2.3;                /* cards visíveis por faixa (fração = "espiada" do próximo) */
  --page-gutter: var(--space-4);
  --text-hero: clamp(26px, 4.2vw, 44px);
  --target-min: 44px;              /* alvo de toque mínimo (WCAG 2.2) */
  --focus-outline: 2px solid var(--ring);
  --focus-offset: 2px;

  /* Durações */
  --duration-fast: .1s;
  --duration-slow: .3s;

  /* Breakpoints (referência; media queries não aceitam var):
     sm 480 · md 768 · lg 1024 · xl 1280 · 2xl 1536 */
}

html.dark {
  color-scheme: dark;

  --brand-text: #38bdf8;
  --background: #09090b;
  --surface: #09090b;
  --foreground: #fafafa;
  --card: #131316;
  --card-foreground: #fafafa;
  --popover: #18181b;
  --popover-foreground: #fafafa;
  --primary: #fafafa;
  --primary-foreground: #18181b;
  --secondary: #27272a;
  --secondary-foreground: #fafafa;
  --muted: #1c1c1f;
  --muted-foreground: #a1a1aa;
  --accent: #27272a;
  --accent-foreground: #fafafa;
  --border: rgb(255 255 255 / 9%);
  --input: rgb(255 255 255 / 14%);
  --header: rgb(9 9 11 / 82%);
  --overlay: rgb(0 0 0 / 70%);

  --destructive: #f87171;
  --destructive-foreground: #18181b;
  --success: #4ade80;
  --success-foreground: #052e16;
  --warning: #fbbf24;
  --warning-foreground: #1c1917;

  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 8px 24px -6px rgb(0 0 0 / 0.6);
  --shadow-lg: 0 16px 40px -8px rgb(0 0 0 / 0.7);
}

@media (min-width: 480px) { :root { --rail-cols: 2.6; } }
@media (min-width: 768px) { :root { --rail-cols: 3.4; --rail-gap: var(--space-4); --page-gutter: var(--space-6); } }
@media (min-width: 1024px) { :root { --rail-cols: 4.4; } }
@media (min-width: 1280px) { :root { --rail-cols: 5.4; --page-gutter: var(--space-8); } }

@media (prefers-reduced-motion: reduce) {
  :root { --duration: 0s; --duration-fast: 0s; --duration-slow: 0s; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Fontes locais (Geist variável, só latim e latim estendido): sem requisição a terceiros */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../../fonts/geist/geist-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../../fonts/geist/geist-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("../../fonts/geist/geist-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("../../fonts/geist/geist-mono-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
