/* =============================================
   Rioja News PRO V4.1 — Styles
   ============================================= */

/* --- Cabecera "Está pasando" --- */
.rioja-header {
    display: flex !important;
    visibility: visible !important;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    font-family: inherit;
}

.rioja-live-dot {
    display: inline-block !important;
    visibility: visible !important;
    width: 14px !important;
    height: 14px !important;
    min-width: 14px;
    background: #dd0000 !important;
    border-radius: 50% !important;
    flex-shrink: 0;
    animation: rioja-pulse 2s ease-in-out infinite !important;
    box-shadow: 0 0 0 0 rgba(220,0,0,0.5);
}

@keyframes rioja-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(220,0,0,0.6); }
    50%  { box-shadow: 0 0 0 10px rgba(220,0,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(220,0,0,0); }
}

.rioja-live-text {
    display: inline !important;
    visibility: visible !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #dd0000 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* --- Grid de cards --- */
.rioja-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* --- Card --- */
.rioja-card {
    cursor: pointer;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    /* Importante para que el tap funcione en iOS */
    -webkit-tap-highlight-color: rgba(0,0,0,0.08);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.rioja-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
}

.rioja-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    pointer-events: none; /* evita que la img capture el tap en lugar del card */
}

/* Overlay oscuro con gradiente — texto BLANCO bien legible */
.rioja-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.45) 65%, transparent 100%);
    color: #fff;
    padding: 32px 14px 14px;
    pointer-events: none; /* el tap pasa al card contenedor */
}

.rioja-overlay h3 {
    margin: 0 0 5px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: #ffffff !important;
    text-shadow: 0 1px 5px rgba(0,0,0,0.7);
}

.rioja-date {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    display: block;
}

/* --- Modal --- */
#rioja-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.82);
    z-index: 999999; /* alto para no quedar tapado por el tema */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* scroll suave en iOS */
    padding: 20px 0 40px;
    box-sizing: border-box;
}

.rioja-modal-content {
    background: #fff;
    margin: 0 auto;
    padding: 28px 24px 24px;
    width: 92%;
    max-width: 720px;
    border-radius: 12px;
    position: relative;
    box-sizing: border-box;
}

.rioja-modal-content img#mimg {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 18px;
    display: block;
}

.rioja-modal-content h2#mtitle {
    font-size: 21px;
    line-height: 1.3;
    margin: 0 0 8px;
    color: #111;
}

#mdate {
    font-size: 13px;
    color: #777;
    margin: 0 0 16px;
}

#mtext {
    font-size: 15px;
    line-height: 1.78;
    color: #222;
    white-space: pre-line;
    margin-bottom: 22px;
}

.rioja-readmore {
    display: inline-block;
    background: #dd0000;
    color: #fff !important;
    text-decoration: none !important;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.18s;
}
.rioja-readmore:hover,
.rioja-readmore:active { background: #aa0000; color: #fff !important; }

/* Botón cerrar */
#rioja-close {
    position: absolute;
    top: 10px; right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    padding: 4px 8px;
    transition: color 0.15s;
    touch-action: manipulation;
    z-index: 10;
}
#rioja-close:hover,
#rioja-close:active { color: #dd0000; }

/* Error */
.rioja-error { color: #c00; font-style: italic; }

/* --- Móvil --- */
@media (max-width: 768px) {
    .rioja-grid {
        grid-template-columns: 1fr;
    }
    .rioja-card img { height: 200px; }
    .rioja-modal-content {
        padding: 20px 16px 20px;
        width: 96%;
        margin-top: 10px;
    }
    .rioja-modal-content h2#mtitle { font-size: 18px; }
    #mtext { font-size: 14px; line-height: 1.7; }
    .rioja-live-text { font-size: 14px !important; }
}
