
/* =============================================================
   EDITORIAL SERVICES GRID – Desktop Premium Architecture
   ============================================================= */

/* --- Container: default (mobile-first, single column) --- */
.editorial-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
    margin-top: 2rem;
}

/* --- Each block --- */
.editorial-item {
    position: relative;
    background-color: #F3EDE0;
    height: 220px;
    display: block;
    border-radius: 1.25rem;
    overflow: hidden;
    text-decoration: none;
    cursor: pointer;
}

/* --- Title: bottom-left, corporate typography --- */
.editorial-title {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    right: 4rem;
    color: #101010;
    font-family: 'Noto Serif', serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.3;
    z-index: 4;
    transition: color 450ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

/* --- Watermark "O": bottom-right, subtle --- */
.editorial-watermark {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    font-family: 'Noto Serif', serif;
    font-size: 2rem;
    color: #101010;
    opacity: 0.18;
    z-index: 1;
    pointer-events: none;
    user-select: none;
    line-height: 1;
}

/* --- Hover card (image + overlay): hidden by default --- */
.editorial-hover-card {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 450ms cubic-bezier(0.22, 1, 0.36, 1),
                visibility 450ms cubic-bezier(0.22, 1, 0.36, 1),
                border-radius 450ms cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 2;
    border-radius: 1.25rem;
    overflow: hidden;
}

.editorial-hover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.05);
    transition: transform 450ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Gradient overlay for text legibility --- */
.editorial-hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 55%);
    z-index: 3;
}

/* -------------------------------------------------------
   DESKTOP (>=1025px): The full architectural grid
   ------------------------------------------------------- */
@media (min-width: 1025px) {

    /* 3-col x 4-row grid; gap=1px via background-color trick */
    .editorial-gallery {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
        gap: 1px;
        background-color: #B5A897;
        border: 1px solid #B5A897;
        min-height: 88vh;
        margin-top: 0;
        border-radius: 0;
    }

    /* Each block fills its cell, sharp corners at rest */
    .editorial-item {
        height: auto;
        border-radius: 0;
    }

    /* Title slightly larger on desktop */
    .editorial-title {
        font-size: clamp(0.95rem, 1.3vw, 1.3rem);
        bottom: 1.75rem;
        left: 1.75rem;
    }

    .editorial-watermark {
        font-size: 2.5rem;
        bottom: 1.25rem;
        right: 1.75rem;
    }

    /* Hover: reveal card with rounded corners */
    .editorial-item:hover .editorial-hover-card {
        opacity: 1;
        visibility: visible;
        border-radius: 24px;
    }

    .editorial-item:hover .editorial-hover-img {
        transform: scale(1);
    }

    /* Title turns white on hover */
    .editorial-item:hover .editorial-title {
        color: #ffffff;
        z-index: 5;
    }

    /* ---- Exact cell placements (matches wireframe) ---- */
    /* Row 1: 3 equal columns */
    .editorial-item:nth-child(1) { grid-column: 1; grid-row: 1; }
    .editorial-item:nth-child(2) { grid-column: 2; grid-row: 1; }
    .editorial-item:nth-child(3) { grid-column: 3; grid-row: 1; }

    /* Row 2: col-1 normal, col-2 & col-3 each span rows 2-3 */
    .editorial-item:nth-child(4) { grid-column: 1; grid-row: 2; }
    .editorial-item:nth-child(5) { grid-column: 2; grid-row: 2 / span 2; } /* Matrona - tall */
    .editorial-item:nth-child(6) { grid-column: 3; grid-row: 2 / span 2; } /* Medicina Estetica - tall */

    /* Row 3: only col-1 (2+3 occupied above) */
    .editorial-item:nth-child(7) { grid-column: 1; grid-row: 3; }

    /* Row 4: 3 equal columns */
    .editorial-item:nth-child(8)  { grid-column: 1; grid-row: 4; }
    .editorial-item:nth-child(9)  { grid-column: 2; grid-row: 4; }
    .editorial-item:nth-child(10) { grid-column: 3; grid-row: 4; }
}

/* -------------------------------------------------------
   MOBILE (<=768px): single-column card list
   Override the generic md-hidden display:block so the
   mobile editorial gallery shows as a grid, not block.
   ------------------------------------------------------- */
@media (max-width: 768px) {
    .editorial-gallery.md-hidden {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }
    .editorial-gallery.md-hidden .editorial-item {
        height: 220px;
        border-radius: 1.25rem;
    }
}

