/*=================================================
    BLOG STYLES
=================================================*/

#blog-posts-section {
    margin-top: 40px;
}

.month-section {
    margin-bottom: 20px;
    border-bottom: none !important;
}

.posts-container {
    padding: 20px;
    background-color: #fff;
    border-top: none;
}

/* FILTER BUTTONS */
.filter-buttons-container {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

#timeline-button-wrapper {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.filter-buttons-container button,
.button-link {
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 25px;
    transition: background-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #333;
    text-align: center;
}

.filter-buttons-container button:hover,
.button-link:hover {
    background-color: #f0f0f0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.filter-buttons-container button.active {
    background-color: #333;
    color: white;
    border-color: #333;
    box-shadow: none;
}

.filter-buttons-container button:disabled,
.filter-buttons-container button:disabled:hover {
    background-color: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
    box-shadow: none;
    border-color: #ddd;
}

/* BLOG POST — DOSSIER STYLE */
#blog-posts-container .blog-post {
    position: relative !important;
    max-width: 820px !important;
    margin: 34px auto 42px !important;
    padding: 30px 42px 34px 64px !important;
    background: #fff !important;
    border: none !important;
    border-image: none !important;
    box-shadow: 0 8px 22px rgba(0,0,0,0.05) !important;
    line-height: 1.62 !important;
    font-size: 16.5px !important;
    color: #2f2f2f !important;
    text-align: justify !important;
    box-sizing: border-box !important;
}

/* Línea dorada interna con fade */
#blog-posts-container .blog-post::before {
    content: "" !important;
    position: absolute !important;
    left: 24px !important;
    top: var(--line-start, 32px) !important;
    bottom: 34px !important;
    width: 5px !important;
    border-radius: 999px !important;

    background: linear-gradient(
        to bottom,
        rgba(217, 164, 66, 0) 0%,
        rgba(217, 164, 66, 0.95) 12%,
        rgba(217, 164, 66, 1) 50%,
        rgba(217, 164, 66, 0.95) 88%,
        rgba(217, 164, 66, 0) 100%
    ) !important;
}

/* Evita separadores horizontales antiguos */
#blog-posts-container .blog-post::after {
    display: none !important;
    content: none !important;
}

/* CONTENT */
.blog-post-content {
    overflow: visible !important;
}

.blog-post-content h3 {
    margin: 0 0 16px !important;
    font-size: 1.55rem !important;
    font-weight: 650 !important;
    color: #2f2f2f !important;
}

.blog-post-content p {
    margin: 0 0 13px !important;
    text-align: justify !important;
    hyphens: auto !important;
    line-height: 1.62 !important;
}

.blog-post-content p:last-child {
    margin-bottom: 0 !important;
}

.publication-date,
.date-highlight {
    display: inline-block !important;
    background-color: #333 !important;
    color: #fff !important;
    padding: 8px 15px !important;
    border-radius: 25px !important;
    font-size: 0.9em !important;
    font-style: normal !important;
    border: none !important;
    line-height: 1.2 !important;
    margin-bottom: 14px !important;
}

/* IMAGE */
.blog-post-image {
    float: left !important;
    width: 290px !important;
    max-width: 40% !important;
    max-height: 460px !important;
    height: auto !important;
    object-fit: contain !important;
    background: #f7f7f7 !important;
    padding: 6px !important;
    margin: 0 34px 20px 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.10) !important;
}

.blog-post {
    overflow: hidden !important;
}

.blog-post::after {
    content: "";
    display: block;
    clear: both;
}

/* LINKS / CASES */
.link-card,
.caso-card {
    max-width: 820px;
    margin: 24px auto;
    padding: 22px 28px;
    background: #fff;
    border-left: 4px solid #d9a442;
    box-shadow: 0 8px 22px rgba(0,0,0,0.05);
    border-radius: 6px;
}

.link-card h3,
.caso-card h3 {
    margin-top: 0;
}

/* CASOS JUDICIALES — BANDERAS POR PAÍS */

.caso-card {
    border-left: 0 !important;
    position: relative;
    overflow: hidden;
}

.caso-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
}

/* Chile: azul, blanco, rojo */
.caso-card.caso-chile::before {
    background: linear-gradient(
        to bottom,
        #0033a0 0%,
        #0033a0 33%,
        #ffffff 33%,
        #ffffff 66%,
        #d52b1e 66%,
        #d52b1e 100%
    );
}

/* España: rojo, amarillo, rojo */
.caso-card.caso-espana::before {
    background: linear-gradient(
        to bottom,
        #c60b1e 0%,
        #c60b1e 25%,
        #ffc400 25%,
        #ffc400 75%,
        #c60b1e 75%,
        #c60b1e 100%
    );
}

/* CARPETA GOOGLE DRIVE EN CASOS JUDICIALES */

.case-folder {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #eeeeee;
}

.case-folder-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: #f7f7f7;
    border: 1px solid #dddddd;
    border-radius: 12px;
    text-decoration: none;
    color: #333333;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.case-folder-button:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.case-folder-button::before {
    content: "📁";
    font-size: 1.05rem;
}

/* =========================================
   VISOR INTEGRADO GOOGLE DRIVE
========================================= */

.case-folder-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 40px;
    box-sizing: border-box;
}

.case-folder-content {
    position: relative;
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

#case-folder-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
}

.close-case-folder {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: rgba(0,0,0,0.65);
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.close-case-folder:hover {
    background: rgba(0,0,0,0.82);
    transform: scale(1.05);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    #blog-posts-container .blog-post {
        padding: 22px 22px 26px 38px !important;
        font-size: 15.5px !important;
        line-height: 1.55 !important;
    }

    #blog-posts-container .blog-post::before {
        left: 18px !important;
        width: 4px !important;
    }

    .blog-post-image {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        margin: 0 0 18px !important;
    }

    .filter-buttons {
        grid-template-columns: 1fr;
    }

    #timeline-button-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .case-folder-modal {
        padding: 14px;
    }

    .case-folder-content {
        width: 100%;
        height: 88vh;
        border-radius: 12px;
    }

    .close-case-folder {
        top: 10px;
        right: 10px;
    }
}