/* =============================================================================
   BLOG.CSS — La Providencia Patagonia
   Hero de listado · Tabs de categoría · Grid de notas · Single de nota
   Breakpoints: 1024px · 768px
   ============================================================================= */


/* ── Hero — listado de blog ───────────────────────────────────────────────── */

.blog-hero {
    position: relative;
    width: 100%;
    height: 65vh;
    min-height: 480px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.blog-hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 55%;
    z-index: 0;
}

.blog-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(10, 71, 79, 0.55) 0%, rgba(10, 71, 79, 0.15) 55%, rgba(10, 71, 79, 0.35) 100%);
}

.blog-hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 80px var(--padding-h) 64px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

.blog-hero__copete {
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.1em;
}

.blog-hero__title {
    font-style: italic;
    font-weight: 400;
    color: var(--white);
    font-size: clamp(40px, 5vw, var(--fs-h2));
    max-width: 16ch;
    margin: 0;
}

.blog-hero__sub {
    font-family: var(--font-body);
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.82);
    max-width: 52ch;
}


/* ── Tabs de categoría ─────────────────────────────────────────────────────── */

.blog-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-block: 56px 48px;
}

.blog-tabs__item {
    font-family: var(--font-body);
    font-size: 14px;
    letter-spacing: 0.03em;
    font-weight: 500;
    color: var(--text-dark);
    padding: 10px 20px;
    border: 1px solid rgba(10, 71, 79, 0.2);
    border-radius: 999px;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.blog-tabs__item:hover {
    opacity: 1;
    border-color: var(--text-dark);
}

.blog-tabs__item.is-active {
    background: var(--text-dark);
    border-color: var(--text-dark);
    color: var(--white);
}


/* ── Grid de notas ─────────────────────────────────────────────────────────── */

.blog-archive {
    padding-bottom: var(--section-v);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 32px;
}

.blog-card__link {
    display: block;
    height: 100%;
}

.blog-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bg-green);
}

.blog-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.blog-card:hover .blog-card__img {
    transform: scale(1.05);
}

.blog-card__body {
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blog-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-body);
    font-size: 13px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--green-dark);
}

.blog-card__cat {
    font-weight: 600;
}

.blog-card__date {
    color: var(--text-light);
    text-transform: none;
    letter-spacing: 0;
}

.blog-card__title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--text-dark);
}

.blog-card__excerpt {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    font-weight: 400;
    color: var(--text-light);
}

.blog-card__more {
    color: var(--text-dark);
    margin-top: 4px;
}

.blog-empty {
    padding-block: 40px;
    font-size: 18px;
    color: var(--text-light);
}


/* ── Paginación ────────────────────────────────────────────────────────────── */

.pagination {
    margin-top: 72px;
}

.pagination .nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding-inline: 12px;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    transition: background 0.2s ease;
}

.pagination .page-numbers:hover {
    opacity: 1;
    background: var(--bg-green);
}

.pagination .page-numbers.current {
    background: var(--text-dark);
    color: var(--white);
}

.pagination .page-numbers.dots {
    background: none;
}


/* ── Single — hero + credit ───────────────────────────────────────────────── */

.novedad-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 85vh;
    overflow: hidden;
}

.novedad-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.novedad-credit {
    font-family: var(--font-body);
    font-size: 12px;
    letter-spacing: 0.03em;
    color: var(--text-light);
    text-align: right;
    padding: 16px var(--padding-h) 0;
}


/* ── Single — header ───────────────────────────────────────────────────────── */

.novedad-content {
    padding-top: 64px;
    padding-bottom: var(--section-v);
}

/* Contenedor del artículo: más ancho que la columna de texto para que las
   imágenes del contenido puedan respirar (ver regla de anchos más abajo). */
.novedad-container {
    max-width: 1040px;
}

.novedad-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 56px;
    max-width: 780px;
    margin-inline: auto;
}

.novedad-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-body);
}

.novedad-cat {
    color: var(--green-dark);
    letter-spacing: 0.1em;
}

.novedad-cat:hover {
    opacity: 0.7;
}

.novedad-date {
    font-size: 14px;
    color: var(--text-light);
}

.novedad-title {
    font-style: italic;
    font-weight: 400;
    font-size: clamp(34px, 4.5vw, var(--fs-h2));
    line-height: 1.15;
    max-width: 18ch;
}

/* Párrafo destacado — toma el campo "Extracto" del editor, opcional */
.novedad-lead {
    font-family: var(--font-body);
    font-size: 21px;
    line-height: 1.6;
    font-weight: 500;
    color: var(--text-dark);
    max-width: 56ch;
}


/* ── Single — contenido (bloques de Gutenberg) ───────────────────────────── */
/*
   El artículo vive en .novedad-container (1040px). El texto se limita a una
   columna de lectura de 780px centrada; las imágenes, galerías y videos usan
   el ancho completo del contenedor para que respiren más que el texto.
*/

.entry-content {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    font-weight: 400;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 27px;
}

.entry-content > * + * {
    margin-top: 0;
}

.entry-content > p,
.entry-content > h2,
.entry-content > h3,
.entry-content > h4,
.entry-content > ul,
.entry-content > ol,
.entry-content > blockquote,
.entry-content > .wp-block-buttons {
    width: 100%;
    max-width: 780px;
}

.entry-content > .wp-block-image,
.entry-content > .wp-block-gallery,
.entry-content > .wp-block-embed,
.entry-content > .wp-block-video {
    width: 100%;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-style: italic;
    margin-top: 12px;
}

.entry-content h2 { font-size: var(--fs-h4); }
.entry-content h3 { font-size: var(--fs-h5); }
.entry-content h4 { font-size: var(--fs-h6); }

.entry-content strong { font-weight: 600; }

.entry-content a {
    color: var(--green-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.entry-content blockquote {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 28px;
    line-height: 1.35;
    color: var(--text-dark);
    border-left: 3px solid var(--green-light);
    padding-left: 28px;
    margin-block: 8px;
}

.entry-content ul,
.entry-content ol {
    padding-left: 24px;
    list-style: revert;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Imágenes inline con caption — reproduce el patrón "Foto: Autor" del hero.
   !important porque Gutenberg agrega width/height inline en cada <img>
   (para evitar layout shift) que si no pisa el ancho completo del bloque. */
.entry-content .wp-block-image img {
    width: 100% !important;
    height: auto !important;
    border-radius: 12px;
}

.entry-content .wp-block-image img.lp-lightbox-trigger {
    cursor: zoom-in;
}

.entry-content .wp-block-image figcaption {
    font-size: 12px;
    letter-spacing: 0.03em;
    color: var(--text-light);
    text-align: center;
    margin-top: 10px;
}

/* Galería */
.entry-content .wp-block-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    list-style: none;
    padding: 0;
}

/* !important porque el CSS core de Gutenberg usa un selector con :not(#id) —
   un truco que le da especificidad de ID y pisa cualquier clase normal. */
.entry-content .wp-block-gallery .wp-block-image {
    margin: 0 !important;
    width: 100% !important;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
}

.entry-content .wp-block-gallery img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 8px;
}

/* Video / embed responsive */
.entry-content .wp-block-embed__wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
}

.entry-content .wp-block-embed__wrapper iframe,
.entry-content .wp-block-embed__wrapper video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.entry-content video {
    width: 100%;
    border-radius: 12px;
}

/* Botón — ej. "Descargar PDF" */
.entry-content .wp-block-buttons {
    justify-content: center;
    display: flex;
}

.entry-content .wp-block-button__link {
    font-family: var(--font-body);
    font-size: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    background: transparent;
    border: 1px solid var(--text-dark);
    border-radius: 999px;
    padding: 16px 32px;
    display: inline-block;
    transition: background 0.25s ease, color 0.25s ease;
}

.entry-content .wp-block-button__link:hover {
    opacity: 1;
    background: var(--text-dark);
    color: var(--white);
}


/* ── Single — navegación prev/next ───────────────────────────────────────── */

.novedad-nav {
    border-top: 1px solid rgba(10, 71, 79, 0.12);
    padding-block: 40px;
}

.novedad-nav__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.novedad-nav__item--next {
    text-align: right;
    grid-column: 2;
}

.novedad-nav__item a {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.novedad-nav__item--next a {
    align-items: flex-end;
}

.novedad-nav__label {
    color: var(--text-light);
}

.novedad-nav__title {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--text-dark);
    max-width: 40ch;
}


/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .blog-hero {
        height: 55vh;
        min-height: 380px;
    }

    .blog-hero__content {
        padding: 64px var(--padding-h-mobile) 40px;
    }

    .blog-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-block: 40px 32px;
    }

    .blog-tabs::-webkit-scrollbar { display: none; }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .novedad-title {
        max-width: none;
    }

    .novedad-lead {
        font-size: 18px;
    }

    .novedad-credit {
        text-align: right;
        padding-inline: var(--padding-h-mobile);
    }

    .novedad-nav__inner {
        grid-template-columns: 1fr;
    }

    .novedad-nav__item--next {
        grid-column: 1;
        text-align: left;
    }

    .novedad-nav__item--next a {
        align-items: flex-start;
    }
}


/* ── Lightbox de imágenes ─────────────────────────────────────────────────── */
/* Mismo lenguaje visual que el visor fullscreen de la galería de /proyecto/
   (.proy-fs en proyecto.css): fondo negro, botones circulares translúcidos,
   caption italic abajo a la izquierda, imagen con transición de entrada. */

.lp-lightbox-open {
    overflow: hidden;
}

.lp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.lp-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.lp-lightbox__figure {
    position: relative;
    max-width: min(90vw, 160vh);
    margin: 0;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.28, 0.64, 1), opacity 0.35s ease;
}

.lp-lightbox.is-open .lp-lightbox__figure {
    transform: scale(1);
    opacity: 1;
}

.lp-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.lp-lightbox__img.is-leaving-next { opacity: 0; transform: translateX(-28px); }
.lp-lightbox__img.is-leaving-prev { opacity: 0; transform: translateX(28px); }

@keyframes lp-lightbox-enter-next {
    from { opacity: 0; transform: translateX(28px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes lp-lightbox-enter-prev {
    from { opacity: 0; transform: translateX(-28px); }
    to   { opacity: 1; transform: translateX(0); }
}

.lp-lightbox__img.is-entering-next { animation: lp-lightbox-enter-next 0.3s ease forwards; }
.lp-lightbox__img.is-entering-prev { animation: lp-lightbox-enter-prev 0.3s ease forwards; }

.lp-lightbox__caption {
    position: absolute;
    bottom: 20px;
    left: 24px;
    color: var(--white);
    font-family: var(--font-heading);
    font-style: italic;
    font-weight: 400;
    font-size: 22px;
    line-height: 1.2;
    pointer-events: none;
}

.lp-lightbox__close,
.lp-lightbox__nav {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: var(--white);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 1;
}

.lp-lightbox__close:hover,
.lp-lightbox__nav:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.22);
}

.lp-lightbox__close {
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    font-size: 26px;
    line-height: 1;
}

.lp-lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.1);
}

.lp-lightbox__nav--prev { left: 24px; }
.lp-lightbox__nav--next { right: 24px; }

.lp-lightbox__nav[hidden] { display: none; }

@media (max-width: 768px) {
    .lp-lightbox__close {
        top: 12px;
        right: 12px;
    }

    .lp-lightbox__nav {
        width: 44px;
        height: 44px;
    }

    .lp-lightbox__nav--prev { left: 8px; }
    .lp-lightbox__nav--next { right: 8px; }

    .lp-lightbox__caption {
        font-size: 17px;
        bottom: 14px;
        left: 16px;
    }
}
