
/* =====================================
   KW — MEDIA GALLERY SYSTEM
===================================== */

.kw-gallery {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #ffffff15;
}

.kw-gallery-title {
    font-family: Georgia, serif;
    font-size: 28px;
    font-weight: 400;
    color: #ffffff;
    margin-bottom: 20px;
}


/* MEDIA FILTER */

.kw-media-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.kw-media-filter {
    background: #141416;
    color: #a1a1aa;
    border: 1px solid #ffffff15;
    border-radius: 30px;
    padding: 10px 18px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.3s ease;
}

.kw-media-filter:hover,
.kw-media-filter.active {
    background: #df1238;
    border-color: #df1238;
    color: white;
    box-shadow: 0 0 20px #df123825;
}


/* GALLERY GRID */

.kw-media-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
}

.kw-media-card {
    position: relative;
    width: 100%;
    padding: 0;
    color: white;
    text-align: left;
    background: #111113;
    border: 1px solid #ffffff15;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.35s ease;

    animation: kwMediaEnter 0.6s both;
    animation-delay: var(--media-delay, 0ms);
}

.kw-media-card:hover {
    transform: translateY(-5px);
    border-color: #df1238;
    box-shadow: 0 10px 35px #df123820;
}

.kw-media-card:focus-visible {
    outline: 2px solid #df1238;
    outline-offset: 4px;
}


/* MEDIA THUMBNAIL */

.kw-media-thumbnail {
    position: relative;
    height: 170px;
    overflow: hidden;

    display: grid;
    place-items: center;

    background: radial-gradient(
        ellipse at center,
        #421020,
        #111113 80%
    );
}

.kw-media-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.kw-media-card:hover img {
    transform: scale(1.08);
}

.kw-media-icon {
    width: 44px;
    height: 44px;
    color: #df1238;
}

.kw-media-type {
    position: absolute;
    top: 12px;
    left: 12px;

    color: white;
    background: #00000099;
    backdrop-filter: blur(10px);

    padding: 6px 10px;
    border-radius: 6px;

    font-size: 10px;
    letter-spacing: 1.2px;
}


/* MEDIA INFORMATION */

.kw-media-info {
    padding: 15px;
}

.kw-media-info h4 {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 8px;
    color: white;
}

.kw-media-info p {
    font-size: 11px;
    color: #a1a1aa;
    margin: 0;
}


/* FULLSCREEN LIGHTBOX */

.kw-lightbox {
    position: fixed;
    inset: 0;

    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;

    padding: 25px;
    margin: 0;
    border: none;

    background: #080809f5;
    color: white;

    box-sizing: border-box;
}

.kw-lightbox[open] {
    display: flex;
    flex-direction: column;
    animation: kwLightboxEnter 0.4s ease;
}

.kw-lightbox::backdrop {
    background: #000000cc;
    backdrop-filter: blur(15px);
}


/* LIGHTBOX HEADER */

.kw-lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding-bottom: 20px;
}

.kw-lightbox-brand {
    color: #df1238;
    font-size: 12px;
    letter-spacing: 3px;
}

.kw-lightbox-close {
    background: #18181b;
    color: white;
    border: 1px solid #ffffff20;

    width: 42px;
    height: 42px;

    border-radius: 50%;
    font-size: 25px;
    cursor: pointer;
    transition: 0.3s;
}

.kw-lightbox-close:hover {
    background: #df1238;
}


/* MEDIA VIEWER */

.kw-lightbox-viewer {
    flex: 1;
    min-height: 0;
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}

.kw-lightbox-viewer img,
.kw-lightbox-viewer video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.kw-lightbox-viewer iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #18181b;
    border-radius: 10px;
}


/* PLACEHOLDER */

.kw-media-placeholder {
    width: 100%;
    min-height: 180px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 15px;
    color: #a1a1aa;
    text-align: center;

    background: radial-gradient(
        ellipse at center,
        #34101c,
        #111113 75%
    );

    border: 1px solid #ffffff10;
    border-radius: 12px;
}

.kw-media-placeholder .kw-media-icon {
    width: 65px;
    height: 65px;
}

.kw-media-empty {
    padding: 35px 15px;
    color: #a1a1aa;
    text-align: center;
}


/* LIGHTBOX CONTROLS */

.kw-lightbox-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    padding: 20px 0;
}

.kw-lightbox-arrow {
    width: 45px;
    height: 45px;

    background: #18181b;
    color: white;

    border: 1px solid #ffffff20;
    border-radius: 50%;

    font-size: 20px;
    cursor: pointer;
    transition: 0.3s;
}

.kw-lightbox-arrow:hover {
    background: #df1238;
    border-color: #df1238;
}

.kw-lightbox-arrow:disabled {
    opacity: 0.25;
    cursor: default;
}

.kw-lightbox-counter {
    font-size: 12px;
    letter-spacing: 2px;
    color: #a1a1aa;
}

.kw-lightbox-caption {
    text-align: center;
    padding-bottom: 10px;
}

.kw-lightbox-caption h3 {
    color: white;
    font-size: 20px;
    font-weight: 400;
}

.kw-lightbox-caption p {
    color: #a1a1aa;
    font-size: 13px;
    margin-top: 10px;
}


/* ANIMATIONS */

@keyframes kwMediaEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes kwLightboxEnter {
    from {
        opacity: 0;
        scale: 0.97;
    }

    to {
        opacity: 1;
        scale: 1;
    }
}


/* RESPONSIVE */

@media (max-width: 600px) {

    .kw-media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .kw-media-thumbnail {
        height: 130px;
    }

    .kw-lightbox {
        padding: 15px;
    }

    .kw-lightbox-caption h3 {
        font-size: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .kw-lightbox,
    .kw-media-card {
        animation: none !important;
    }

    .kw-gallery *,
    .kw-lightbox * {
        transition: none !important;
    }
}

/* =====================================
   MEDIA DESCRIPTION & IMAGE IMPROVEMENT
===================================== */

.kw-media-thumbnail {
    height: 200px;
    padding: 10px;
    box-sizing: border-box;
}

.kw-media-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    min-height: 0;
}

.kw-media-card:hover img {
    transform: scale(1.02);
}

.kw-media-info h4 {
    font-size: 14px;
    overflow-wrap: anywhere;
    line-height: 1.6;
}

.kw-media-description {
    color: #b4b4bd;
    font-size: 12px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.kw-media-info .kw-media-view-label {
    color: #df1238;
    font-size: 11px;
    margin-top: 12px;
}

.kw-lightbox-caption {
    max-width: 850px;
    width: 100%;
    margin: 0 auto;
    max-height: 25vh;
    overflow-y: auto;
}

.kw-lightbox-caption h3 {
    font-size: 22px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.kw-lightbox-caption p {
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.kw-gallery [hidden],
.kw-lightbox [hidden] {
    display: none !important;
}

@media (max-width: 600px) {

    .kw-media-thumbnail {
        height: 140px;
    }

    .kw-lightbox-caption h3 {
        font-size: 17px;
    }

    .kw-lightbox-caption p {
        font-size: 12px;
    }

}
