/* css/educacion.css - Rediseño Enciclopedia del Clima */
:root {
    --edu-primary: #0d9488;
    /* Teal */
    --edu-secondary: #0f172a;
    --edu-accent: #2dd4bf;
    --edu-card-bg: #1e293b;
    --edu-text: #f1f5f9;
    --edu-text-dim: #94a3b8;
    --edu-border: rgba(255, 255, 255, 0.1);
    --edu-bg-soft: rgba(13, 148, 136, 0.05);
}

body.dark-mode {
    background-color: #0f172a;
    background-image:
        radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.02) 1px, transparent 0);
    background-size: 32px 32px;
}

/* RESTORED: Gallery Grid Layout (Site Default Horizontal Cards) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 30px;
    padding: 30px 0;
}

@media (max-width: 991px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

.photo-card {
    background: #262936;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .photo-card {
        flex-direction: row;
        min-height: 200px;
    }
}

.photo-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #009ad8;
}

.photo-img-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .photo-img-wrapper {
        width: 180px;
        height: auto;
    }
}

.photo-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.photo-card:hover .photo-img-wrapper img {
    transform: scale(1.1);
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.photo-card:hover .photo-overlay {
    opacity: 1;
}

.view-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: bold;
    transform: translateY(10px);
    transition: transform 0.3s;
    font-size: 0.85rem;
}

.photo-card:hover .view-btn {
    transform: translateY(0);
}

.photo-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.photo-title {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: white;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-desc {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.photo-date {
    font-size: 0.8em;
    color: #009ad8;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}

/* Detail View Styles */
.edu-detail-container {
    animation: fadeInEdu 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.edu-detail-hero {
    position: relative;
    height: 500px;
    border-radius: 30px;
    overflow: hidden;
    margin-bottom: 50px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--edu-border);
}

.edu-detail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edu-detail-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 100px 50px 50px;
    background: linear-gradient(to top, #0f172a 20%, transparent);
}

.edu-article-content {
    font-size: 1.25rem;
    line-height: 1.9;
    color: #e2e8f0;
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Outfit', sans-serif;
}

.edu-article-content p {
    margin-bottom: 30px;
}

/* EDUCATIONAL COMPONENTS */

/* 1. Info Box (Sabías que) */
.edu-info-box {
    background: rgba(13, 148, 136, 0.1);
    border-left: 5px solid var(--edu-primary);
    border-radius: 15px;
    padding: 30px;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
}

.edu-info-box::before {
    content: '\f0eb';
    /* FontAwesome Lightbulb */
    font-family: 'FontAwesome';
    position: absolute;
    top: -10px;
    right: 10px;
    font-size: 5rem;
    color: var(--edu-primary);
    opacity: 0.1;
}

.edu-info-box-title {
    color: var(--edu-accent);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 2. Pull Quote (Destacado) */
.edu-pull-quote {
    font-size: 1.8rem;
    font-style: italic;
    color: white;
    text-align: center;
    padding: 60px 40px;
    margin: 50px 0;
    border-top: 1px solid var(--edu-border);
    border-bottom: 1px solid var(--edu-border);
    position: relative;
    font-weight: 300;
    line-height: 1.4;
}

.edu-pull-quote::before,
.edu-pull-quote::after {
    content: '"';
    font-size: 5rem;
    color: var(--edu-primary);
    position: absolute;
    opacity: 0.3;
}

.edu-pull-quote::before {
    top: 10px;
    left: 20px;
}

.edu-pull-quote::after {
    bottom: -30px;
    right: 20px;
}

/* 3. Glossary Item */
.edu-glossary-item {
    border-bottom: 2px dashed var(--edu-primary);
    color: var(--edu-accent);
    cursor: help;
    position: relative;
    font-weight: 600;
}

.edu-glossary-tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #1e293b;
    color: white;
    padding: 15px;
    border-radius: 12px;
    width: 250px;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--edu-accent);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s;
    font-style: normal;
    text-align: left;
}

.edu-glossary-item:hover .edu-glossary-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-20px);
}

/* Header Improvements within articles */
.edu-article-content h3 {
    font-size: 2rem;
    color: white;
    margin: 60px 0 30px;
    border-bottom: 2px solid var(--edu-bg-soft);
    padding-bottom: 15px;
}

.edu-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    margin-bottom: 40px;
    font-weight: 700;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.edu-back-btn:hover {
    background: var(--edu-primary);
    transform: translateX(-5px);
}

@keyframes fadeInEdu {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- MEDIA CONTENT (MINIMAL & GENERAL) --- */
.edu-video-container {
    margin: 30px 0;
    width: 100%;
}

.edu-video-inner {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

.edu-video-inner iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.edu-image-block {
    margin: 30px 0;
    text-align: center;
}

/* --- STACKED GALLERY SYSTEM (Restored for Educational Visual Consistency) --- */
.stacked-gallery-container {
    width: 100%;
    position: relative;
    z-index: 10;
}

.stacked-gallery {
    position: relative;
    height: 600px;
    width: 100%;
    max-width: 1100px;
    margin: 20px auto;
    perspective: 3000px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stacked-card {
    position: absolute;
    width: 550px;
    height: 550px;
    background: #1e293b;
    border-radius: 40px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transform-origin: center center;
    left: 50%;
    margin-left: -275px;
    opacity: 1;
}

.stacked-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #0f172a;
}

/* Straight Distributed Layout (Default State) */
.stacked-card:nth-child(1) {
    transform: translateX(-420px) scale(0.9);
    z-index: 10;
}

.stacked-card:nth-child(2) {
    transform: translateX(-210px) scale(0.95);
    z-index: 20;
}

.stacked-card:nth-child(3) {
    transform: translateX(0) scale(1);
    z-index: 30;
}

.stacked-card:nth-child(4) {
    transform: translateX(210px) scale(0.95);
    z-index: 20;
}

.stacked-card:nth-child(5) {
    transform: translateX(420px) scale(0.9);
    z-index: 10;
}

/* Active State (Zoom & Center Focus) */
.stacked-card.active {
    transform: translateX(0) scale(1.18) translateY(-60px) !important;
    z-index: 5000 !important;
    border-color: var(--edu-accent);
    box-shadow: 0 50px 100px rgba(45, 212, 191, 0.4);
    filter: brightness(1.2) !important;
    opacity: 1 !important;
}

/* Base Hover Feedback */
.stacked-gallery .stacked-card:hover {
    filter: brightness(1.1) !important;
    border-color: rgba(255, 255, 255, 0.4);
}

.stacked-gallery:hover .stacked-card {
    opacity: 1 !important;
}

.stack-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
    position: relative;
    z-index: 50;
}

.stack-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.stack-dot.active {
    background: var(--edu-accent);
    transform: scale(1.4);
    border-color: rgba(255, 255, 255, 0.5);
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .edu-detail-hero {
        height: 300px;
    }

    .edu-detail-overlay {
        padding: 40px 20px 20px;
    }

    .detail-edu-title {
        font-size: 1.8rem !important;
    }

    .edu-article-content {
        font-size: 1.1rem;
    }

    .edu-pull-quote {
        font-size: 1.4rem;
    }
}

/* Fullscreen Lightbox (Fixed) */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(15px);
    animation: fadeInEdu 0.3s ease-out;
}

#lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 20px;
    box-shadow: 0 0 100px rgba(45, 212, 191, 0.3);
    /* edu-accent glow */
    object-fit: contain;
    transition: transform 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    transition: 0.3s;
    background: none;
    border: none;
}

.lightbox-close:hover {
    transform: rotate(90deg);
    color: var(--edu-accent);
}