/* ==========================================
   COMPONENTS.CSS - Cards y Componentes
   ========================================== */

/* ==========================================
   HERO SECTION
   ========================================== */

.hero.hero-static {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: calc(24px + 20px + 46px + 2.5rem + 100px); /* Agregado 100px para bajar el banner y evitar que se meta en el header */
}

.hero-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   SERVICES TICKER
   ========================================== */

.services-ticker {
    width: 100%;
    background: var(--secondary);
    color: var(--white);
    overflow: hidden;
    padding: 0.5rem 0;
}

.ticker-wrapper {
    display: flex;
    align-items: center;
}

.ticker-title {
    flex: 0 0 auto;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--primary);
    color: var(--white);
    white-space: nowrap;
    z-index: 2;
}

.ticker-list {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    animation: ticker-scroll 40s linear infinite;
}

.ticker-list li {
    margin: 0 2rem;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
}

.ticker-list li a {
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color var(--transition);
}

.ticker-list li a:hover {
    color: var(--off-white);
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ==========================================
   CONTENT SECTIONS
   ========================================== */

.points-view {
    padding: 3rem 0;
    background: var(--gray-100);
    width: 100%;
    overflow-x: hidden;
}

.content-slider-section {
    margin-bottom: 3.5rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: transform var(--transition);
}

.content-slider-section:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* ==========================================
   BLOCK TITLES
   ========================================== */

.block-title {
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.8rem;
    padding-bottom: 0.75rem;
    text-transform: uppercase;
    border-bottom: 3px solid var(--accent);
}

.block-title--article { 
    color: #1a5276; 
    border-bottom-color: #3498db; 
}

.block-title--video { 
    color: #c0392b; 
    border-bottom-color: #e74c3c; 
}

.block-title--podcast { 
    color: #7d3c98; 
    border-bottom-color: #9b59b6; 
}

.block-title--media { 
    color: #d35400; 
    border-bottom-color: #e67e22; 
}

/* ==========================================
   CARDS - Featured
   ========================================== */

.featured-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

@media (min-width: 768px) {
    .featured-content-grid {
        grid-template-columns: 40% 60%;
        grid-template-areas: "featured grid";
        align-items: start;
    }
    .featured-card { 
        grid-area: featured;
        height: 100%;
    }
    .featured-videos-column {
        grid-area: featured;
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
    .featured-videos-column .featured-card {
        height: auto;
        flex: 0 0 auto;
    }
    .featured-videos-column .featured-img {
        max-height: 180px;
        object-fit: cover;
    }
    .featured-videos-column .featured-content {
        padding: 1rem;
    }
    .featured-videos-column .featured-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    .featured-videos-column .featured-excerpt {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }
    .featured-videos-column .featured-meta {
        font-size: 0.85rem;
    }
    .content-slider { 
        grid-area: grid;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
        height: 100%;
        align-content: start;
    }
    .videos-grid {
        grid-area: grid;
    }
    .podcasts-grid {
        grid-area: grid;
    }
}

.featured-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--white);
    transition: transform var(--transition);
    height: 100%;
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

/* Video thumbnail container */
.video-thumb {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.video-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    z-index: 1;
}

.video-thumb:hover::before {
    background: rgba(0, 0, 0, 0.5);
}

.featured-img,
.update-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}

.video-thumb:hover .featured-img,
.video-thumb:hover .update-img { 
    transform: scale(1.05);
}

/* Play icon */
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.video-thumb:hover .play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.play-icon i {
    color: var(--primary);
    font-size: 1.8rem;
    margin-left: 4px; /* Ajuste visual para centrar el ícono */
}

.featured-content {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
}

.update-body {
    flex-grow: 1;
    min-height: 0;
}

.featured-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1.3;
    margin-bottom: 0.6rem;
}

.featured-excerpt {
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.5;
    margin-bottom: 1.2rem;
    flex-grow: 1;
}

/* ==========================================
   CARDS - Regular
   ========================================== */

.content-slider {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

/* Cuando está dentro de featured-content-grid, usar 2 columnas */
.featured-content-grid .content-slider {
    grid-template-columns: repeat(2, 1fr);
    overflow-x: visible;
}

/* Grid de podcasts: 3 columnas x 2 filas */
.podcasts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 1.2rem;
    overflow-x: visible;
}

/* Ajustes para cards de podcasts en el grid: más espacio para miniatura, menos para texto */
.podcasts-grid .update-card {
    display: flex;
    flex-direction: column;
}

.podcasts-grid .video-thumb {
    flex: 0 0 auto;
    height: 180px;
    overflow: hidden;
    position: relative;
}

.podcasts-grid .video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--gray-100);
}

.podcasts-grid .update-content {
    flex: 0 0 auto;
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    min-height: auto;
}

.podcasts-grid .update-title {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podcasts-grid .update-meta {
    margin-top: 0.3rem;
}

.podcasts-grid .update-meta .read-more {
    font-size: 0.85rem;
}

/* Grid de videos: 3 columnas x 2 filas */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 1.2rem;
    overflow-x: visible;
}

.content-slider::-webkit-scrollbar { 
    display: none; 
}

.update-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    background: var(--white);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--transition);
    height: 100%;
}

.update-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

.update-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}

.update-card:hover .update-img { 
    transform: scale(1.02); 
}

.update-content {
    padding: 1.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.update-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.6rem;
}

.update-excerpt {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 0.8rem;
    flex-grow: 1;
}

/* ==========================================
   CATEGORIES
   ========================================== */

.update-category {
    display: inline-block;
    background: var(--secondary);
    color: var(--white);
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   META & DATES
   ========================================== */

.title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.meta-date {
    background: var(--accent);
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 1rem;
    white-space: nowrap;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.meta-date::before {
    content: "\f133";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.75rem;
}

.update-meta,
.featured-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.update-meta span,
.featured-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

/* Date button style (red button with calendar icon) */
.update-meta span:first-child,
.featured-meta span:first-child {
    background: var(--primary);
    color: var(--white);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    transition: background 0.3s ease;
}

.update-meta span:first-child:hover,
.featured-meta span:first-child:hover {
    background: var(--accent);
}

.update-meta span:first-child i,
.featured-meta span:first-child i {
    color: var(--white);
    font-size: 0.85rem;
}

/* ==========================================
   READ MORE LINKS
   ========================================== */

.read-more {
    color: var(--primary);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all var(--transition);
    font-size: 0.9rem;
}

.read-more:hover {
    color: var(--accent);
    gap: 0.6rem;
}

/* ==========================================
   OFFICES SECTION
   ========================================== */

.offices-section {
    width: 100%;
    padding: 0 var(--section-padding) var(--section-padding);
    background: var(--white);
}

.offices-section h2 {
    text-align: center;
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.offices-section p {
    text-align: center;
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.offices-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.office-link {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    background: var(--off-white);
}

.office-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.offices-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

/* ==========================================
   MODALS
   ========================================== */

.media-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    padding: 20px;
    align-items: center;
    justify-content: center;
    animation: mediaFadeIn 0.3s ease;
}

.media-modal-content {
    position: relative;
    width: min(900px, 100%);
    margin: 0;
    animation: mediaSlideIn 0.3s ease;
}

.media-close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
    transition: color 0.3s ease;
}

.media-close-modal:hover { 
    color: var(--primary); 
}

.media-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
}

.media-video-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

@keyframes mediaFadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}

@keyframes mediaSlideIn { 
    from { transform: translateY(-50px); opacity: 0; } 
    to { transform: translateY(0); opacity: 1; } 
}