/* ============================================================
   Programación Semanal — estilos del bloque público
   Todo el CSS vive bajo el scope .pgm para no afectar al theme.
   El color acento llega por la variable --pgm-accent (inline).
   ============================================================ */

.pgm {
    --pgm-accent: #111827;
    --pgm-line: #e5e7eb;
    --pgm-soft: #f3f4f6;
    --pgm-muted: #6b7280;
    --pgm-surface: #ffffff;
    margin: 24px 0;
    font-family: inherit;
}

.pgm-title {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: inherit;
}

/* ── Pestañas de días ──
   Sin JS quedan ocultas y se ven todos los días apilados con su encabezado;
   con JS (clase .pgm--enhanced) se muestran y solo se ve el día activo.
   Envolven (wrap) en varias filas: en pantallas pequeñas los días bajan a la
   línea siguiente en lugar de quedar cortados por scroll horizontal. */
.pgm-tabs {
    display: none;
    gap: 8px;
    margin: 0 0 18px;
}
.pgm--enhanced .pgm-tabs { display: flex; flex-wrap: wrap; }

.pgm-tab {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    margin: 0;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--pgm-soft);
    color: #111827;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.pgm-tab:hover { background: #e5e7eb; }
.pgm-tab.is-active { background: var(--pgm-accent); color: #ffffff; }
.pgm-tab:focus-visible { outline: 2px solid var(--pgm-accent); outline-offset: 2px; }

/* ── Paneles por día ── */
.pgm-panel { display: block; }
.pgm--enhanced .pgm-panel { display: none; }
.pgm--enhanced .pgm-panel.is-active { display: block; }

.pgm-panel-day {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--pgm-muted);
}
.pgm--enhanced .pgm-panel-day { display: none; }

/* ── Fila de programa ── */
.pgm-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
    padding: 14px 18px;
    background: var(--pgm-surface);
    border: 1px solid var(--pgm-line);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.pgm-row:last-child { margin-bottom: 0; }

.pgm-row-time {
    flex: 0 0 auto;
    min-width: 54px;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.pgm-row-name {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 16px;
    border-left: 1px solid var(--pgm-line);
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.pgm-row-host {
    flex: 0 0 auto;
    font-size: 13.5px;
    color: var(--pgm-muted);
    text-align: right;
}

.pgm-empty {
    padding: 18px;
    border: 1px dashed var(--pgm-line);
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
    color: var(--pgm-muted);
}

/* Aviso de configuración (solo se pinta en el panel). */
.pgm-notice {
    margin: 18px 0;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 13.5px;
    line-height: 1.5;
}

/* ── Caja «Estás viendo» (modo="ahora") ── */
.pgm-now {
    --pgm-accent: #111827;
    padding: 15px 17px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--pgm-accent);
    border-radius: 10px;
    font-family: inherit;
}
.pgm-now-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #6b7280;
}
.pgm-now-title {
    margin-top: 6px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
}
.pgm-now-host {
    margin-top: 3px;
    font-size: 13.5px;
    color: #4b5563;
}
.pgm-now-host[hidden] { display: none; }

/* ── Responsive: pestañas en varias filas + hora/conductor arriba y programa debajo ── */
@media (max-width: 640px) {
    .pgm-title { font-size: 18px; }
    .pgm-tabs { gap: 6px; margin-bottom: 16px; }
    .pgm-tab { padding: 9px 14px; font-size: 13px; }
    .pgm-row {
        flex-wrap: wrap;
        gap: 4px 14px;
        padding: 13px 15px;
    }
    .pgm-row-time { min-width: 0; }
    .pgm-row-host { margin-left: auto; }
    .pgm-row-name {
        flex: 1 1 100%;
        order: 3;
        padding-left: 0;
        border-left: none;
    }
}

/* Móviles: píldoras más compactas para que entren más días por fila. */
@media (max-width: 460px) {
    .pgm-tab { padding: 8px 11px; font-size: 12.5px; }
    .pgm-row { padding: 12px 13px; }
}
