/* ================================
   MODERN MOSAIC GALLERY
================================ */

.mosaic-gallery-section {
    position: relative;
    width: 100%;
    padding: 90px 18px;
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.8), transparent 32%),
        linear-gradient(135deg, #f3eee6 0%, #e8dfd4 100%);
}

.mosaic-gallery-section *,
.mosaic-gallery-section *::before,
.mosaic-gallery-section *::after {
    box-sizing: border-box;
}

.mosaic-gallery-section .mosaic-gallery-container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
}

/* Header */

.mosaic-gallery-section .mosaic-gallery-head {
    max-width: 720px;
    margin: 0 auto 34px;
    text-align: center;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.75s ease, transform 0.75s ease;
}

.mosaic-gallery-section.in-view .mosaic-gallery-head {
    opacity: 1;
    transform: translateY(0);
}

.mosaic-gallery-section .mosaic-gallery-head span {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    color: #7c654d;
    background: #ffffff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    box-shadow: 0 12px 28px rgba(50, 38, 25, 0.08);
}

.mosaic-gallery-section .mosaic-gallery-head h2 {
    margin: 0;
    color: #17130f;
    font-size: clamp(34px, 5vw, 60px);
    line-height: 1;
    letter-spacing: -0.06em;
}

.mosaic-gallery-section .mosaic-gallery-head p {
    max-width: 600px;
    margin: 16px auto 0;
    color: #70665d;
    font-size: 16px;
    line-height: 1.7;
}

/* Grid */

.mosaic-gallery-section .mosaic-gallery-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.35fr 1fr;
    grid-template-rows: 250px 250px;
    gap: 12px;
}

.mosaic-gallery-section .mosaic-card {
    position: relative;
    display: none;
    margin: 0;
    overflow: hidden;
    background: #d8d0c7;
    box-shadow: 0 18px 45px rgba(50, 38, 25, 0.18);
    opacity: 0;
    transform: translateY(28px) scale(0.98);
    transition:
        opacity 0.65s ease,
        transform 0.65s ease,
        box-shadow 0.35s ease;
}

.mosaic-gallery-section .mosaic-card.is-visible {
    display: block;
}

.mosaic-gallery-section .mosaic-card.animate-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.mosaic-gallery-section .mosaic-card:nth-child(6n + 1) {
    grid-column: 1;
    grid-row: 1;
}

.mosaic-gallery-section .mosaic-card:nth-child(6n + 2) {
    grid-column: 2;
    grid-row: 1;
}

.mosaic-gallery-section .mosaic-card:nth-child(6n + 3) {
    grid-column: 3;
    grid-row: 1;
}

.mosaic-gallery-section .mosaic-card:nth-child(6n + 4) {
    grid-column: 1 / span 2;
    grid-row: 2;
}

.mosaic-gallery-section .mosaic-card:nth-child(6n + 5) {
    grid-column: 2;
    grid-row: 2;
}

.mosaic-gallery-section .mosaic-card:nth-child(6n + 6) {
    grid-column: 3;
    grid-row: 2;
}

/* Button/Image */

.mosaic-gallery-section .mosaic-open {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    background: transparent;
}

.mosaic-gallery-section .mosaic-open img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transform: scale(1.03);
    transition:
        transform 0.8s ease,
        filter 0.35s ease;
}

.mosaic-gallery-section .mosaic-open::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    background:
        linear-gradient(
            115deg,
            transparent,
            rgba(255, 255, 255, 0.35),
            transparent
        );
    transform: translateX(-130%);
    transition: transform 0.75s ease;
    pointer-events: none;
}

/* Overlay */

.mosaic-gallery-section .mosaic-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: left;
    background:
        linear-gradient(
            180deg,
            transparent 35%,
            rgba(0, 0, 0, 0.55)
        );
    color: #ffffff;
    transition:
        background 0.35s ease,
        opacity 0.35s ease;
}

.mosaic-gallery-section .mosaic-overlay strong {
    color: #ffffff;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.25;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
}

.mosaic-gallery-section .mosaic-overlay em {
    width: fit-content;
    margin-top: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #17130f;
    background: #ffffff;
    font-size: 12px;
    font-weight: 850;
    font-style: normal;
    opacity: 0;
    transform: translateY(8px);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

/* Hover */

.mosaic-gallery-section .mosaic-card:hover {
    z-index: 4;
    transform: translateY(-8px) scale(1.015);
    box-shadow: 0 28px 70px rgba(50, 38, 25, 0.28);
}

.mosaic-gallery-section .mosaic-card:hover img {
    transform: scale(1.13);
    filter: brightness(1.06) saturate(1.1);
}

.mosaic-gallery-section .mosaic-card:hover .mosaic-open::after {
    transform: translateX(130%);
}

.mosaic-gallery-section .mosaic-card:hover .mosaic-overlay {
    background:
        linear-gradient(
            180deg,
            transparent 22%,
            rgba(0, 0, 0, 0.68)
        );
}

.mosaic-gallery-section .mosaic-card:hover .mosaic-overlay em {
    opacity: 1;
    transform: translateY(0);
}

/* Pagination */

.mosaic-gallery-section .mosaic-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 34px;
}

.mosaic-gallery-section .mosaic-page-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mosaic-gallery-section .mosaic-page-btn,
.mosaic-gallery-section .mosaic-page-number {
    min-width: 42px;
    height: 42px;
    padding: 0 15px;
    border: 0;
    border-radius: 999px;
    background: #ffffff;
    color: #4f463e;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(50, 38, 25, 0.1);
    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.mosaic-gallery-section .mosaic-page-btn:hover,
.mosaic-gallery-section .mosaic-page-number:hover,
.mosaic-gallery-section .mosaic-page-number.active {
    background: #17130f;
    color: #ffffff;
    transform: translateY(-2px);
}

.mosaic-gallery-section .mosaic-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Lightbox */

.mosaic-gallery-section .mosaic-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    padding: 24px;
    display: none;
    place-items: center;
    background: rgba(20, 17, 14, 0.88);
    backdrop-filter: blur(16px);
}

.mosaic-gallery-section .mosaic-lightbox.is-open {
    display: grid;
}

.mosaic-gallery-section .mosaic-lightbox img {
    max-width: min(1100px, 92vw);
    max-height: 78vh;
    object-fit: contain;
    box-shadow: 0 34px 120px rgba(0, 0, 0, 0.55);
}

.mosaic-gallery-section .mosaic-lightbox p {
    margin: 16px 0 0;
    color: #ffffff;
    font-weight: 850;
    text-align: center;
}

.mosaic-gallery-section .mosaic-lightbox-close {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 10000;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    color: #181512;
    background: #ffffff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    transition:
        transform 0.25s ease,
        background 0.25s ease;
}

.mosaic-gallery-section .mosaic-lightbox-close:hover {
    transform: rotate(90deg);
    background: #efe7de;
}

/* Responsive */

@media (max-width: 900px) {
    .mosaic-gallery-section {
        padding: 74px 14px;
    }

    .mosaic-gallery-section .mosaic-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: none;
        grid-auto-rows: 230px;
    }

    .mosaic-gallery-section .mosaic-card:nth-child(n) {
        grid-column: auto;
        grid-row: auto;
    }

    .mosaic-gallery-section .mosaic-card:nth-child(3n + 1) {
        grid-column: span 2;
    }
}

@media (max-width: 560px) {
    .mosaic-gallery-section {
        padding: 64px 12px;
    }

    .mosaic-gallery-section .mosaic-gallery-head {
        margin-bottom: 26px;
    }

    .mosaic-gallery-section .mosaic-gallery-head h2 {
        font-size: 32px;
    }

    .mosaic-gallery-section .mosaic-gallery-head p {
        font-size: 14px;
        line-height: 1.6;
    }

    .mosaic-gallery-section .mosaic-gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 240px;
        gap: 10px;
    }

    .mosaic-gallery-section .mosaic-card:nth-child(n),
    .mosaic-gallery-section .mosaic-card:nth-child(3n + 1) {
        grid-column: auto;
    }

    .mosaic-gallery-section .mosaic-overlay em {
        opacity: 1;
        transform: none;
    }

    .mosaic-gallery-section .mosaic-pagination {
        flex-wrap: wrap;
    }
}