/* Global Styles for RSS Feed Plugin Frontend */
.rss-feed-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.rss-feed-card {
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.rss-feed-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.15);
}

.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.rss-feed-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.card-excerpt {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #666;
    margin-bottom: 1rem;
}

.card-source {
    font-size: 0.6rem;
    color: #999;
    font-style: italic;
    margin-bottom: 0.5rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.read-more {
    color: #2271b1;
    font-weight: 500;
    font-size: 0.9rem;
}

/* ================================
   TV Experience - Imagen Escalada al Alto de la Tarjeta (Ajuste Corregido)
   ================================ */
.rss-tv-container {
    position: relative;
    height: 80vh;
    overflow: hidden;
    margin: 1rem;
    padding: 2rem;
    background: #fffffc;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    visibility: visible !important;
}

.tv-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    pointer-events: auto;
    align-items: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    opacity: 0;
    /* Se elimina transition en favor de animaciones definidas en keyframes */
    z-index: 2;
}

/* Animación de entrada para la tarjeta */
@keyframes cardEntrance {
  0% {
    opacity: 0;
    transform: translateY(-50px) scale(1.1) rotate(-2deg);
    filter: blur(4px);
  }
  50% {
    opacity: 0.5;
    transform: translateY(10px) scale(1.05) rotate(2deg);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
    filter: blur(0);
  }
}

/* Animación de salida para la tarjeta */
@keyframes cardExit {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateY(30px) scale(0.95) rotate(-0.5deg);
    filter: blur(3px);
  }
}

/* Al activar la tarjeta se reproduce la animación de entrada */
.tv-card.active {
    animation: cardEntrance 0.6s ease-out forwards;
}

/* Clase para animar la salida */
.tv-card.exit {
    animation: cardExit 0.6s ease-out forwards;
}

.tv-image {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animación para entrada de imagen */
@keyframes imageEntrance {
  0% {
    opacity: 0;
    transform: scale(1.1) rotate(3deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.tv-image img {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    object-position: center;
    animation: imageEntrance 1s ease-out forwards, slowZoom 15s ease-in-out infinite;
}

@keyframes slowZoom {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.tv-content {
    position: relative;
    padding: 2rem;
    margin: 2rem; /* Reducido para móviles */
    background: rgba(68, 39, 94, 0.7);
    border-radius: 10px;
    pointer-events: auto;
    z-index: 3;
    color: #fffffc;
    text-align: center;
    max-width: 90%; /* Limita el ancho para móviles */
}

.tv-title {
    font-size: 3rem;
    font-weight: bold;
    line-height: 1.2;
    overflow-wrap: break-word;
    word-break: break-word;
    color: #fffffc;
    margin-bottom: 1rem;
}
/* Efecto durante la animación de máquina de escribir */
.tv-title.typing-container .typing-effect {
    display: inline-block; /* Asegura que el efecto se aplique correctamente */
    transform: scale(1.3); /* Escala inicial */
    filter: blur(0.5); /* Sin blur inicial */
}

/* Aplica el efecto sutil de escala y blur durante la animación */
.tv-title.typing-container .typing-effect.typing-active {
    transform: scale(1.0); /* Escala ligeramente más grande */
    filter: blur(0px); /* Blur muy sutil */
    transition: transform 0.5s ease, filter 0.5s ease; /* Transición suave */
}

.tv-description {
    font-size: 1.4rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.tv-link {
    position: relative;
    z-index: 5; /* Un valor alto para asegurarnos que esté por encima */
    pointer-events: auto;
    display: inline-block;
}

.tv-source {
    font-size: 0.8rem; /* Tamaño de fuente más pequeño */
    color: rgba(255, 255, 255, 0.8); /* Color semi-transparente */
    margin-top: 0.5rem; /* Espacio arriba */
    font-style: italic; /* Estilo cursiva */
    text-align: center; /* Centrado */
    animation: fadeIn 1s ease-in-out; /* Animación de entrada */
}

/* Responsive adjustments for TV mode */
@media (max-width: 768px) {
    .rss-tv-container {
        height: 75vh; /* Altura reducida para móviles */
    }

    .tv-content {
        padding: 1rem; /* Padding reducido */
        margin: 1rem; /* Margen reducido */
    }

    .tv-title {
        font-size: 2rem; /* Tamaño de fuente reducido */
    }

    .tv-description {
        font-size: 1rem; /* Tamaño de fuente reducido */
    }
    .tv-source {
        font-size: 0.8rem; /* Tamaño más pequeño en móviles */
    }
}
@media (min-width: 600px) and (max-width: 1024px) {
    .tv-content {
        padding: 3rem;
    }
}

@media (max-width: 480px) {
    .tv-title {
        font-size: 1.5rem; /* Tamaño de fuente más pequeño para móviles pequeños */
    }

    .tv-description {
        font-size: 0.9rem; /* Tamaño de fuente más pequeño para móviles pequeños */
    }
    .tv-source {
        font-size: 0.5rem; /* Tamaño más pequeño en móviles */
    }
}

.preview-mode .admin-preview-card {
    transform: scale(0.7);
    transform-origin: center;
}

/* Responsive adjustments for blog mode */
@media (max-width: 599px) {
    .rss-feed-container {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 600px) and (max-width: 1024px) {
    .rss-feed-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Stories Experience Styles - REPLACE ALL PREVIOUS STORIES CSS WITH THIS */
.rss-stories-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    overflow: hidden;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    height: 50vh; /* Fixed height instead of max-height */
    display: block !important; /* Ensure it's visible */
    visibility: visible !important;
}

.stories-track {
    display: flex;
    flex-wrap: nowrap !important;
    transition: transform 0.5s ease-out;
    padding: 1rem;
    gap: 1rem;
    width: 100%;
    height: calc(50vh - 2rem);
    position: relative;
}

/* Fix story card */
.story-card {
    flex: 0 0 auto !important;
    width: calc(33.333% - 0.67rem); /* Default 3 per view */
    height: 100% !important;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: relative;
}

/* Force links to fill entire card */
.story-card > a {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    text-decoration: none;
    overflow: hidden;
}

/* Fix image container positioning */
.story-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1;
    overflow: hidden !important;
}

/* Ensure images properly fill and center */
.story-image img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    transition: transform 0.3s ease;
}

.story-card:hover .story-image img {
    transform: scale(1.05);
}

/* Add this after your existing story image styles */

/* Subtle zoom animation for active story images */
@keyframes storyImageZoom {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); } /* Slightly less pronounced than TV mode */
}

/* Apply animation to active story */
.story-card.active .story-image img {
    animation: storyImageZoom 12s ease-in-out infinite;
    transform-origin: center;
}

/* Ensure the animation doesn't conflict with hover effect */
.story-card.active:hover .story-image img {
    animation: storyImageZoom 12s ease-in-out infinite, scale-up 0.3s forwards;
}

@keyframes scale-up {
    to { transform: scale(1.05); }
}

/* Transition when card becomes active */
.story-card .story-image img {
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* Stronger hierarchy through size rather than decoration */
.story-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.2rem;
    /* Extend gradient further up for more text space */
    background: linear-gradient(
        transparent, 
        rgba(0,0,0,0.5) 10%, /* Start gradient higher up */
        rgba(0,0,0,0.9) 100%
    );
    color: #fff !important;
    z-index: 2;
    max-height: 60%; /* Ensure content doesn't take too much space */
    overflow: hidden;
}

/* Clear size-based hierarchy for title */
.story-title {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #fff !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

/* Remove the underline decoration since we're using size for hierarchy */
.story-title:after {
    display: none;
}

/* Make excerpt clearly differentiated by size */
.story-excerpt {
    font-size: 1rem; 
    line-height: 1.2;
    margin-bottom: 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 4; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: rgba(255,255,255,0.9);
}

.story-source {
    font-size: 0.5rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
}

.story-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.3);
    z-index: 3;
}

.progress-bar {
    height: 100%;
    background: #fff;
    width: 0;
    transition: width 6s linear;
}

/* Navigation buttons */
.story-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.397);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.story-nav.prev { left: 1rem; }
.story-nav.next { right: 1rem; }

.rss-stories-container:hover .story-nav {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rss-stories-container[data-stories-per-view] .story-card {
        width: calc(50% - 0.5rem);
    }
    
    .story-content {
        padding: 1rem;
    }
    
    .story-title {
        font-size: 1.56rem; /* 20% larger than previous 1.3rem */
        margin-bottom: 0.4rem;
    }
    
    .story-excerpt {
        font-size: 0.6rem; /* Slightly larger */
        -webkit-line-clamp: 4; /* Show more lines of text */
        margin-bottom: 0.4rem;
    }
    
    .story-source {
        font-size: 0.5rem;
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .story-title {
        font-size: 1.32rem; /* 20% larger than previous 1.1rem */
    }
    
    .story-excerpt {
        font-size: 0.8rem; /* Slightly larger */
        -webkit-line-clamp: 4; /* Show more lines of text */
    }
}
