/**
 * Officer Directos v1.3.0
 * CSS para notas inyectadas en the_content + badge en listados.
 *
 * El single del directo usa el single.php del tema (Newsreader).
 * Aquí solo estilamos el bloque de notas inyectado dentro del cuerpo.
 */

/* =============================================================
   1. Bloque de notas dentro del cuerpo del post
   ============================================================= */

.od-inline {
    margin: 28px 0 24px;
    padding: 0;
}

/* Barra superior del bloque: badge EN DIRECTO + última actualización + refresh */
.od-inline__bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    margin-bottom: 18px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
}

.od-inline__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-radius: 3px;
    text-transform: uppercase;
    line-height: 1;
}

.od-inline__badge--live {
    background: #d72638;
    color: #fff;
}

.od-inline__badge--closed {
    background: #6b6b6b;
    color: #fff;
}

.od-inline__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    display: inline-block;
    animation: od-pulse 1.6s ease-in-out infinite;
}

@keyframes od-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

.od-inline__updated {
    color: #687380;
    font-size: 12px;
    margin-right: auto; /* empuja el botón refresh a la derecha */
}

.od-inline__updated-time {
    color: #45505b;
    font-weight: 500;
}

.od-inline__refresh {
    background: transparent;
    border: 1px solid #d8d8d8;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #687380;
    transition: color 0.15s ease, border-color 0.15s ease;
    padding: 0;
}

.od-inline__refresh:hover {
    color: #45505b;
    border-color: #45505b;
}

.od-inline__refresh.is-loading svg {
    animation: od-spin 0.8s linear infinite;
}

@keyframes od-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.od-inline__empty {
    padding: 24px 14px;
    text-align: center;
    color: #687380;
    font-style: italic;
    margin: 0;
}

/* =============================================================
   2. Items individuales (cada nota del directo)
   ============================================================= */

.od-inline__list .od-item {
    border-left: 3px solid #d72638;
    padding: 0 0 0 18px;
    margin: 0 0 28px;
    position: relative;
}

.od-inline__list .od-item:last-child {
    margin-bottom: 0;
}

.od-item__time {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #687380;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
    font-weight: 600;
}

.od-item__breaking {
    display: inline-block;
    background: #d72638;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
    padding: 2px 7px;
    border-radius: 2px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.od-item__title {
    font-size: 20px;
    line-height: 1.3;
    margin: 0 0 10px;
    color: #45505b;
    font-weight: 700;
}

.od-item__title a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.od-item__title a:hover {
    border-bottom-color: #45505b;
}

.od-item__image {
    margin: 12px 0;
}

.od-item__image img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
}

.od-item__comment {
    color: #2a2a2a;
    line-height: 1.6;
    margin: 0 0 12px;
    font-size: 16px;
}

.od-item__view-news {
    display: inline-block;
    color: #687380;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid #d0d4d9;
    padding-bottom: 1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.od-item__view-news:hover {
    color: #d72638;
    border-bottom-color: #d72638;
}

/* Embeds (oEmbed YouTube/Twitter/etc.) */
.od-inline__list .od-item iframe,
.od-inline__list .od-item .twitter-tweet,
.od-inline__list .od-item blockquote {
    max-width: 100%;
    margin: 12px 0;
}

.od-item--breaking {
    border-left-color: #d72638;
    background: linear-gradient(to right, rgba(215, 38, 56, 0.04), transparent 60%);
}

/* =============================================================
   3. Pastilla "EN DIRECTO" en LISTADOS — pegada a la CATEGORÍA
   ============================================================= */

/* WordPress añade automáticamente la clase "type-officer_directo" al
   <article> mediante post_class(). El template de Newsreader muestra
   la categoría arriba del título con clases del framework Code Supply
   ("cs-meta-category", "cs-entry__category", etc.). Pegamos una pastilla
   pequeña roja con punto parpadeando a la derecha de esa categoría.

   Cubrimos los selectores más probables. Los selectores [class*=...]
   son defensivos: capturan variaciones aunque cambie el sufijo. */

article.type-officer_directo .cs-meta-category,
article.type-officer_directo .cs-entry__category,
article.type-officer_directo [class*="cs-meta-category"],
article.type-officer_directo [class*="cs-entry__category"] {
    /* Permite alinear la pastilla justo después */
    display: inline-flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

article.type-officer_directo .cs-meta-category::after,
article.type-officer_directo .cs-entry__category::after,
article.type-officer_directo [class*="cs-meta-category"]::after,
article.type-officer_directo [class*="cs-entry__category"]::after {
    content: "● EN DIRECTO";
    display: inline-block;
    background: #d72638;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px 2px 6px;
    border-radius: 2px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.4;
    vertical-align: middle;
    /* No queremos que se herede ningún estilo del enlace de categoría */
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    /* Animación sutil de parpadeo */
    animation: od-list-pulse 1.6s ease-in-out infinite;
}

@keyframes od-list-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

/* =============================================================
   4. Headbar (barra superior global "EN DIRECTO" — opcional)
   ============================================================= */

.od-headbar {
    background: #d72638;
    color: #fff;
    padding: 10px 18px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    position: relative;
    z-index: 999;
}

.od-headbar a {
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.od-headbar a:hover {
    border-bottom-color: #fff;
}

.od-headbar__label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-right: 8px;
}

.od-headbar__label::before {
    content: "● ";
    animation: od-pulse 1.6s ease-in-out infinite;
}

/* =============================================================
   5. Responsive
   ============================================================= */

@media (max-width: 600px) {
    .od-inline__bar {
        gap: 8px;
    }
    .od-inline__updated {
        flex-basis: 100%;
        order: 3;
    }
    .od-item__title {
        font-size: 18px;
    }
    /* En móvil, la pastilla puede caer en una segunda línea —
       los selectores con flex-wrap ya lo permiten naturalmente. */
}
