/* PlaylisTube - base : couleurs des themes clair et sombre, remise a zero, typographie, utilitaires. */

:root {
  color-scheme: light;

  --brand: #B30000;

  /* Trois niveaux : fond de page teinte, barres (haut et bas) et cartes plus claires par-dessus. */
  --bg: #eef0f3;               /* fond de page */
  --chrome: #ffffff;           /* barre du haut, pied de page */
  --chrome-border: #e2e4e8;
  --shadow-chrome: 0 1px 3px rgba(16, 24, 40, .06);
  --card: #ffffff;             /* en-tete de chaine, playlists, blocs de comparaison */
  --card-border: #e2e4e8;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --subtle: #f7f8fa;           /* en-tetes de tableau, libelles */
  --field-bg: #ffffff;         /* champs de saisie */
  --bg-raised: #ffffff;        /* menus, fenetres */
  --surface-1: #e5e7eb;        /* boutons, puces, champs */
  --surface-2: #dadde2;        /* survol */
  --surface-3: #cdd1d7;        /* appui */
  --menu-hover: #f2f3f5;
  --control-active: #ffffff;   /* bouton actif d'un groupe */
  --border: #e6e7ea;
  --border-strong: #c9ccd1;

  /* Accent : le rouge de l'icone */
  --accent: #B30000;
  --accent-hover: #970000;
  --on-accent: #ffffff;
  --accent-soft: #fdeeee;
  --accent-soft-fg: #a30000;
  --accent-border: #f2c7c7;

  --text: #0f0f0f;
  --text-2: #606060;
  --text-3: #909090;
  --inverse-bg: #0f0f0f;
  --inverse-text: #ffffff;
  --link: #065fd4;
  --focus: #1c62b9;

  --backdrop: rgba(0, 0, 0, .5);
  --shadow-menu: 0 4px 32px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .08);
  --shadow-control: 0 1px 2px rgba(0, 0, 0, .12);

  --ok-fg: #1e7e34;
  --ok-bg: #e6f4ea;
  --warn-fg: #8a5300;
  --warn-bg: #fdf0d5;
  --danger-fg: #b3261e;
  --danger-bg: #fce8e6;
  --info-fg: #0b57d0;
  --info-bg: #e8f0fe;
  --muted-fg: #606060;
  --muted-bg: #f2f2f2;

  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 12px;
  --radius-pill: 999px;

  --font: Roboto, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "Roboto Mono", ui-monospace, monospace;
  --topbar-h: 60px; /* meme hauteur de barre que les autres outils Barbatools */
  --gutter: 24px;
}

/* Theme sombre, d'apres l'interface sombre de YouTube. Meme contenu dans les deux blocs :
   le premier suit le systeme (sauf theme clair force), le second s'applique quand il est choisi. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f0f0f;
    --chrome: #1b1b1b;
    --chrome-border: #2c2c2c;
    --shadow-chrome: 0 1px 3px rgba(0, 0, 0, .4);
    --card: #1b1b1b;
    --card-border: #2c2c2c;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, .35);
    --subtle: #222222;
    --field-bg: #121212;
    --accent: #d42a2a;
    --accent-hover: #e43b3b;
    --on-accent: #ffffff;
    --accent-soft: rgba(255, 92, 92, .15);
    --accent-soft-fg: #ff8f8a;
    --accent-border: rgba(255, 92, 92, .35);
    --bg-raised: #282828;
    --surface-1: #2a2a2a;
    --surface-2: #3f3f3f;
    --surface-3: #535353;
    --menu-hover: #3e3e3e;
    --control-active: #4d4d4d;
    --border: #303030;
    --border-strong: #3f3f3f;
    --text: #f1f1f1;
    --text-2: #aaaaaa;
    --text-3: #717171;
    --inverse-bg: #f1f1f1;
    --inverse-text: #0f0f0f;
    --link: #3ea6ff;
    --focus: #3ea6ff;
    --backdrop: rgba(0, 0, 0, .7);
    --shadow-menu: 0 4px 32px rgba(0, 0, 0, .5);
    --shadow-control: none;
    --ok-fg: #81c995;
    --ok-bg: rgba(129, 201, 149, .14);
    --warn-fg: #fdd663;
    --warn-bg: rgba(253, 214, 99, .14);
    --danger-fg: #f28b82;
    --danger-bg: rgba(242, 139, 130, .14);
    --info-fg: #8ab4f8;
    --info-bg: rgba(138, 180, 248, .14);
    --muted-fg: #aaaaaa;
    --muted-bg: rgba(255, 255, 255, .1);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f0f;
  --chrome: #1b1b1b;
  --chrome-border: #2c2c2c;
  --shadow-chrome: 0 1px 3px rgba(0, 0, 0, .4);
  --card: #1b1b1b;
  --card-border: #2c2c2c;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, .35);
  --subtle: #222222;
  --field-bg: #121212;
  --accent: #d42a2a;
  --accent-hover: #e43b3b;
  --on-accent: #ffffff;
  --accent-soft: rgba(255, 92, 92, .15);
  --accent-soft-fg: #ff8f8a;
  --accent-border: rgba(255, 92, 92, .35);
  --bg-raised: #282828;
  --surface-1: #2a2a2a;
  --surface-2: #3f3f3f;
  --surface-3: #535353;
  --menu-hover: #3e3e3e;
  --control-active: #4d4d4d;
  --border: #303030;
  --border-strong: #3f3f3f;
  --text: #f1f1f1;
  --text-2: #aaaaaa;
  --text-3: #717171;
  --inverse-bg: #f1f1f1;
  --inverse-text: #0f0f0f;
  --link: #3ea6ff;
  --focus: #3ea6ff;
  --backdrop: rgba(0, 0, 0, .7);
  --shadow-menu: 0 4px 32px rgba(0, 0, 0, .5);
  --shadow-control: none;
  --ok-fg: #81c995;
  --ok-bg: rgba(129, 201, 149, .14);
  --warn-fg: #fdd663;
  --warn-bg: rgba(253, 214, 99, .14);
  --danger-fg: #f28b82;
  --danger-bg: rgba(242, 139, 130, .14);
  --info-fg: #8ab4f8;
  --info-bg: rgba(138, 180, 248, .14);
  --muted-fg: #aaaaaa;
  --muted-bg: rgba(255, 255, 255, .1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
  scrollbar-color: var(--surface-3) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.43 var(--font);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

h1, h2, h3, h4, p, dl, dd {
  margin: 0;
}

code,
kbd {
  font-family: var(--font-mono);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

::selection {
  background: rgba(62, 166, 255, .3);
}

/* ---------- Utilitaires ---------- */
[hidden] {
  display: none !important;
}

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

.icon {
  display: block;
  flex: none;
}

.muted {
  color: var(--text-2);
}

.link {
  color: var(--link);
}

.link:hover {
  text-decoration: underline;
}

.clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.clamp.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
}

/* Elements separes par un petit point : "Publique . 42 videos . Creee le ..." */
.meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 4px;
  color: var(--text-2);
  font-size: 13px;
}

.meta-line > :not(:first-child)::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 8px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  transform: translateY(-2px);
}

.meta-line > .badge:not(:first-child) {
  margin-left: 8px;
}

.meta-line > .badge::before {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
