/* --- Hero: min full viewport, grows with content --- */
.materials-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5.5rem 2rem 4rem;
    overflow: hidden;
}

.materials-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.materials-hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.materials-hero-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: min(100%, 52rem);
}

.materials-hero .materials-hero-banner {
    max-width: 100%;
}

.materials-hero-banner .hero-banner-text {
    padding: 2rem 2rem 0.35rem;
}

.materials-hero-lead {
    margin: 0;
    padding: 0 2rem 2rem;
    font-family: "Saira Stencil One", sans-serif;
    /* önceki ~1rem gövdeye göre en az 2× */
    font-size: clamp(2rem, 2.5vw, 2.85rem);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #fff;
    text-align: center;
}

@media (max-width: 640px) {
    .materials-hero-lead {
        font-size: clamp(1.85rem, 5.2vw, 2.35rem);
    }
}

/* --- Gallery: ~3 rows of thumbnails --- */
.materials-gallery {
    background: #fff;
    padding: 4rem 2rem 5rem;
    margin-top: 0px;
}

.materials-gallery-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.materials-gallery-title {
    font-family: "Saira Stencil One", sans-serif;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 400;
    color: #bcff00;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.materials-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(120px, auto);
    gap: 0.75rem;
}

.materials-thumb {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0.35rem;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #1a1a1a;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.materials-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}

.materials-thumb:hover img {
    transform: scale(1.06);
}

@media (max-width: 1200px) {
    .materials-gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: minmax(110px, auto);
    }
}

@media (max-width: 768px) {
    .materials-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        grid-auto-rows: minmax(110px, auto);
    }
}

/* --- Lightbox --- */
.materials-lightbox {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.materials-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.materials-lightbox[hidden] {
    display: none !important;
}

.materials-lightbox-backdrop {
    position: absolute;
    inset: 0;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

.materials-lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2;
    width: 3rem;
    height: 3rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.materials-lightbox-close:hover {
    background: #bcff00;
    color: #000;
}

.materials-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 3.25rem;
    height: 3.25rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.materials-lightbox-nav:hover {
    background: #bcff00;
    color: #000;
}

.materials-lightbox-prev {
    left: 1rem;
}

.materials-lightbox-next {
    right: 1rem;
}

.materials-lightbox-content {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 1400px);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.materials-lightbox-img {
    max-width: 100%;
    max-height: calc(85vh - 3rem);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.25rem;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.materials-lightbox-counter {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.65);
}

@media (max-width: 640px) {
    .materials-lightbox {
        padding: 3.5rem 0.5rem;
    }

    .materials-lightbox-prev {
        left: 0.35rem;
    }

    .materials-lightbox-next {
        right: 0.35rem;
    }

    .materials-lightbox-nav {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.5rem;
    }
}
