/*
|--------------------------------------------------------------------------
| Hover Gallery
|--------------------------------------------------------------------------
*/

.cew-hg {
    padding-top: 80px;
    padding-bottom: 80px;
    background-color: #ffffff;
}

.cew-hg-container {
    max-width: 1200px;
    margin: auto;
    padding-left: 48px;
    padding-right: 48px;
}

/*
|--------------------------------------------------------------------------
| Header
|--------------------------------------------------------------------------
*/

.cew-hg-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;

    margin-bottom: 48px;
}

.cew-hg-heading {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #1A2F23;
    margin: 0 0 8px 0;
}

.cew-hg-subheading {
    font-size: 18px;
    line-height: 1.7;
    color: #404943;
    max-width: 576px;
    margin: 0;
}

.cew-hg-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    font-weight: 700;
    text-decoration: none;
    color: #0f5238;
    white-space: nowrap;
}

.cew-hg-link:hover {
    text-decoration: underline;
}

.cew-hg-link .material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 22px;
    transition: transform 0.3s ease;
}

.cew-hg-link:hover .material-symbols-outlined {
    transform: translateX(4px);
}

/*
|--------------------------------------------------------------------------
| Grid
|--------------------------------------------------------------------------
*/

.cew-hg-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 288px;
    gap: 24px;
}

/*
|--------------------------------------------------------------------------
| Item
|--------------------------------------------------------------------------
*/

.cew-hg-item {
    position: relative;
    overflow: hidden;

    border-radius: 16px;
    border: 1px solid #bfc9c1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);

    background-color: #e2e2e2;
}

.cew-hg-item--col-2 {
    grid-column: span 2;
}

.cew-hg-item--row-2 {
    grid-row: span 2;
}

.cew-hg-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;

    transition: transform 0.7s ease;
}

.cew-hg-item:hover img {
    transform: scale(1.1);
}

/*
|--------------------------------------------------------------------------
| Caption overlay (hover reveal)
|--------------------------------------------------------------------------
*/

.cew-hg-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: flex-end;

    padding: 16px;

    background-image: linear-gradient(
        to top,
        rgba(0,0,0,0.60) 0%,
        transparent 100%
    );

    opacity: 0;
    transition: opacity 0.3s ease;
}

.cew-hg-item:hover .cew-hg-overlay,
.cew-hg-grid--always .cew-hg-overlay {
    opacity: 1;
}

.cew-hg-item--feature .cew-hg-overlay {
    padding: 24px;
}

.cew-hg-caption {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1.4;
    color: #ffffff;
}

.cew-hg-item--feature .cew-hg-caption {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: normal;
}

/*
|--------------------------------------------------------------------------
| Touch devices: hover never fires, so always reveal
|--------------------------------------------------------------------------
*/

@media (hover: none) {

    .cew-hg-overlay {
        opacity: 1;
    }

}

/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 900px) {

    .cew-hg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cew-hg-heading {
        font-size: 36px;
    }

}

@media (max-width: 768px) {

    .cew-hg {
        padding-top: 56px;
        padding-bottom: 56px;
    }

    .cew-hg-container {
        padding-left: 25px;
        padding-right: 25px;
    }

    .cew-hg-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 32px;
    }

    .cew-hg-heading {
        font-size: 30px;
    }

    .cew-hg-subheading {
        font-size: 16px;
    }

    .cew-hg-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    /* a 2-col item can't exceed a 1-col track */
    .cew-hg-item--col-2 {
        grid-column: span 1;
    }

    .cew-hg-item--feature .cew-hg-caption {
        font-size: 18px;
    }

}
