/**
 * CriollosUY — Home Page Styles
 * Paleta del home desacoplada: repintar el bloque de TOKENS de abajo.
 */

/* ============================================================
   TOKENS DEL HOME (repintable) — light por defecto
   ============================================================ */
:root {
  --h-bg: #f4f3f1;
  --h-card: #ffffff;
  --h-text: #1a1a1e;
  --h-muted: #77777f;
  --h-dim: #b3b3bb;
  --h-amber: #c49520;
  --h-amber-soft: rgba(196, 149, 32, 0.10);
  --h-live: #c0392b;
  --h-live-2: #e2685b;
  --h-c-vivo: #c0392b;
  --h-c-res: #b78a1e;
  --h-c-cal: #5f7488;
  --h-c-inst: #7a6a52;
  --h-c-gen: #8a8a92;
  --h-line: rgba(0, 0, 0, 0.07);
  --h-scrim: rgba(0, 0, 0, 0.5);
  --h-ph1: #c9a06a;
  --h-ph2: #8a6a3a;
  --h-shadow: 0 6px 22px rgba(0, 0, 0, 0.06);
  --h-shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.18);
  --h-radius: 18px;
  --h-radius-sm: 12px;
}

[data-theme="dark"] {
  --h-bg: #0e1014;
  --h-card: rgba(255, 255, 255, 0.04);
  --h-text: #e2dedc;
  --h-muted: #9a9aa4;
  --h-dim: #52525e;
  --h-amber: #e8b950;
  --h-amber-soft: rgba(232, 185, 80, 0.10);
  --h-live: #e05a4d;
  --h-live-2: #f0938a;
  --h-c-vivo: #e05a4d;
  --h-c-res: #f5c842;
  --h-c-cal: #8fa6bb;
  --h-c-inst: #c8a978;
  --h-c-gen: #a8a8b2;
  --h-line: rgba(255, 255, 255, 0.07);
  --h-scrim: rgba(0, 0, 0, 0.6);
  --h-ph1: #4a3c28;
  --h-ph2: #2a2118;
  --h-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
  --h-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --h-bg: #0e1014;
    --h-card: rgba(255, 255, 255, 0.04);
    --h-text: #e2dedc;
    --h-muted: #9a9aa4;
    --h-dim: #52525e;
    --h-amber: #e8b950;
    --h-amber-soft: rgba(232, 185, 80, 0.10);
    --h-live: #e05a4d;
    --h-live-2: #f0938a;
    --h-c-vivo: #e05a4d;
    --h-c-res: #f5c842;
    --h-c-cal: #8fa6bb;
    --h-c-inst: #c8a978;
    --h-c-gen: #a8a8b2;
    --h-line: rgba(255, 255, 255, 0.07);
    --h-scrim: rgba(0, 0, 0, 0.6);
    --h-ph1: #4a3c28;
    --h-ph2: #2a2118;
    --h-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
    --h-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  }
}

/* ============================================================
   SHELL
   ============================================================ */
.home-shell {
  background: var(--h-bg);
  color: var(--h-text);
  overflow-x: clip;
}

.home-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--h-bg);
}

.home-burger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.55rem;
  display: grid;
  gap: 4px;
  width: 44px;
  height: 44px;
  align-content: center;
  border-radius: var(--h-radius-sm);
}
.home-burger span {
  height: 2.5px;
  width: 22px;
  background: var(--h-text);
  border-radius: 2px;
  display: block;
}

.home-brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--h-text);
  text-decoration: none;
}
.home-brand .logo {
  height: 30px;
  width: auto;
  filter: var(--logo-filter);
}

.home-theme {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.55rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--h-radius-sm);
  color: var(--h-text);
}
.home-theme svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

.home-wrap {
  padding: 0.5rem 1rem 3rem;
}

/* ============================================================
   EN VIVO — única "tarjeta" real
   ============================================================ */
.hlive {
  background: var(--h-card);
  border-radius: var(--h-radius);
  overflow: hidden;
  position: relative;
  margin-top: 0.5rem;
  box-shadow: var(--h-shadow);
  display: block;
  text-decoration: none;
  color: inherit;
}
.hlive::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  transform-origin: top center;
  background: linear-gradient(90deg, var(--h-live) 0%, var(--h-live-2) 50%, var(--h-live) 100%);
  background-size: 220% 100%;
  animation: hlatido 1.6s ease-in-out infinite, hsheen 2.4s linear infinite;
}
@keyframes hlatido {
  0%, 100% { transform: scaleY(1); opacity: 0.9; }
  12%      { transform: scaleY(2.4); opacity: 1; }
  24%      { transform: scaleY(1); opacity: 0.9; }
  36%      { transform: scaleY(2); opacity: 1; }
  50%      { transform: scaleY(1); opacity: 0.9; }
}
@keyframes hsheen {
  0%   { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
@keyframes hpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.hlive .in { padding: 1.1rem; }
.hlive .r1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: nowrap;
}
.hlive h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hlive .badge {
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--h-live);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
  white-space: nowrap;
}
.hlive .badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--h-live);
  animation: hpulse 1.3s infinite;
}
.hlive .sede {
  color: var(--h-muted);
  font-size: 0.88rem;
  margin: 0.2rem 0 0.9rem;
}
.hlive .stage {
  display: block;
  background: var(--h-amber-soft);
  border-radius: var(--h-radius-sm);
  padding: 0.85rem 1rem;
}
.hlive .etapa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.hlive .etapa b {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--h-amber);
  letter-spacing: 0.02em;
}
.hlive .etapa .chev { color: var(--h-amber); font-size: 1.1rem; }
.hlive .compite {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--h-line);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hlive .compite .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--h-live);
  animation: hpulse 1.3s infinite;
  flex: none;
}
/* Compitiendo · Nombre — en armonía (tamaños equilibrados) */
.hlive .compite .lbl {
  color: var(--h-muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.hlive .compite .sep { color: var(--h-dim); font-size: 0.82rem; }
.hlive .compite .name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--h-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   SECTION HEAD
   ============================================================ */
.hsec {
  margin: 1.9rem 0 0.7rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.hsec h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.05em;
  color: var(--h-text);
}
.hsec a {
  color: var(--h-amber);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

/* categoría SUTIL: punto de color + texto muted (sin pastilla) */
.hcat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--h-muted);
}
.hcat::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot, var(--h-amber));
  flex: none;
}
.hcat.vivo { --dot: var(--h-c-vivo); color: var(--h-c-vivo); }
.hcat.res  { --dot: var(--h-c-res); }
.hcat.cal  { --dot: var(--h-c-cal); }
.hcat.inst { --dot: var(--h-c-inst); }
.hcat.gen  { --dot: var(--h-c-gen); }

/* ============================================================
   NOTICIAS — estilo D (fondo blanco apenas, sin borde ni sombra)
   ============================================================ */
.hnews { display: grid; gap: 0.55rem; }
.ncard {
  display: flex;
  gap: 0.85rem;
  background: var(--h-card);
  border-radius: var(--h-radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s var(--ease);
}
.ncard:active { transform: scale(0.99); }
.ncard .thumb {
  width: 96px;
  aspect-ratio: 1;
  flex: none;
  position: relative;
  background: linear-gradient(150deg, var(--h-ph1), var(--h-ph2));
}
.ncard .thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ncard .thumb .cam {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0.45;
}
.ncard .thumb .cam svg { width: 24px; height: 24px; stroke: #fff; fill: none; stroke-width: 1.5; }
.ncard .body {
  padding: 0.65rem 0.8rem 0.65rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
/* títulos MÁS LIVIANOS: Outfit 600, no Bebas display */
.ncard h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.22;
  letter-spacing: 0;
  color: var(--h-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ncard .meta {
  color: var(--h-dim);
  font-size: 0.72rem;
  margin-top: auto;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   PRÓXIMOS EVENTOS — estilo D
   ============================================================ */
.hevents { display: grid; gap: 0.5rem; }
.hev {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--h-card);
  border-radius: var(--h-radius);
  padding: 0.7rem 0.9rem;
  text-decoration: none;
  color: inherit;
  min-height: 44px;
}
.hev .dnum {
  font-family: var(--font-display);
  text-align: center;
  line-height: 0.85;
  min-width: 44px;
  font-variant-numeric: tabular-nums;
}
.hev .dnum .d { font-size: 1.45rem; color: var(--h-amber); display: block; }
.hev .dnum .m { font-size: 0.72rem; color: var(--h-muted); display: block; }
.hev .info { flex: 1; min-width: 0; }
.hev .info b {
  font-weight: 600;
  display: block;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hev .info span { color: var(--h-muted); font-size: 0.8rem; }
.hev .st {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex: none;
}
.hev .st.live { color: var(--h-live); display: flex; gap: 0.3rem; align-items: center; }
.hev .st.live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--h-live);
  animation: hpulse 1.3s infinite;
}
.hev .st.soon { color: var(--h-dim); }

/* estados vacíos / carga */
.hempty {
  color: var(--h-dim);
  font-size: 0.85rem;
  padding: 0.9rem 0.2rem;
}
.hskel {
  background: linear-gradient(90deg, var(--h-line) 25%, rgba(0, 0, 0, 0.03) 37%, var(--h-line) 63%);
  background-size: 400% 100%;
  animation: hshimmer 1.3s ease infinite;
  border-radius: var(--h-radius);
}
.hskel.live { height: 150px; margin-top: 0.5rem; }
.hskel.card { height: 96px; }
.hskel.row { height: 62px; }
@keyframes hshimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ============================================================
   DRAWER (menú lateral)
   ============================================================ */
.hscrim {
  position: absolute;
  inset: 0;
  background: var(--h-scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
  z-index: 30;
}
.hscrim.on { opacity: 1; pointer-events: auto; }

.hdrawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 82%;
  max-width: 340px;
  background: var(--h-card);
  z-index: 31;
  transform: translateX(-100%);
  transition: transform 0.28s var(--ease);
  box-shadow: var(--h-shadow-lg);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--h-line);
}
[data-theme="dark"] .hdrawer,
:root:not([data-theme="light"]) .hdrawer { background: #171a20; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hdrawer { background: #171a20; }
}
.hdrawer.on { transform: translateX(0); }

.hdrawer .dhead {
  padding: 1.3rem 1.2rem;
  border-bottom: 1px solid var(--h-line);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.hdrawer .dhead img { height: 30px; width: auto; filter: var(--logo-filter); }
.hdrawer .dhead b { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.04em; color: var(--h-text); }
.hdrawer .dclose {
  margin-left: auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--h-radius-sm);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--h-muted);
}
.hdrawer .dclose svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

.hdrawer nav { padding: 0.6rem; flex: 1; overflow: auto; }
.hdrawer .item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: var(--h-radius-sm);
  text-decoration: none;
  color: var(--h-text);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  min-height: 44px;
  font-family: var(--font-body);
}
.hdrawer .item:hover,
.hdrawer .item.active { background: var(--h-amber-soft); color: var(--h-amber); }
.hdrawer .item[aria-disabled="true"] { color: var(--h-dim); cursor: default; }
.hdrawer .item[aria-disabled="true"]:hover { background: none; }
.hdrawer .item .ic { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; }
.hdrawer .item .chev { margin-left: auto; color: var(--h-dim); font-size: 0.78rem; transition: transform 0.2s var(--ease); }
.hdrawer .item[aria-expanded="true"] .chev { transform: rotate(90deg); }
.hdrawer .item .soon {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--h-dim);
  border: 1px solid var(--h-line);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}
.hdrawer .sub {
  display: grid;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s var(--ease);
  padding-left: 2.6rem;
}
.hdrawer .sub.on { max-height: 460px; }
.hdrawer .sub a {
  padding: 0.6rem 1rem;
  color: var(--h-muted);
  text-decoration: none;
  font-size: 0.92rem;
  border-radius: var(--h-radius-sm);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.hdrawer .sub a:hover { color: var(--h-amber); }
.hdrawer .glabel {
  padding: 0.9rem 1rem 0.3rem;
  color: var(--h-dim);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hdrawer .dfoot {
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--h-line);
  color: var(--h-dim);
  font-size: 0.75rem;
}

/* ============================================================
   ACCESIBILIDAD
   ============================================================ */
.home-shell a:focus-visible,
.home-shell button:focus-visible,
.hdrawer .item:focus-visible,
.hdrawer .sub a:focus-visible {
  outline: 2px solid var(--h-amber);
  outline-offset: 2px;
  border-radius: var(--h-radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  .hlive::before {
    animation: none;
    transform: none;
    opacity: 1;
    background: var(--h-live);
  }
  .hlive .badge::before,
  .hlive .compite .dot,
  .hev .st.live::before { animation: none; }
  .hskel { animation: none; }
  .hscrim, .hdrawer, .ncard, .hdrawer .sub, .hdrawer .item .chev { transition: none; }
}
