:root {
    --kc-gallery-bg: #050505;
    --kc-gallery-surface: #0b0b0b;
    --kc-gallery-surface-2: #111111;
    --kc-gallery-gold: #c99a4e;
    --kc-gallery-gold-light: #e0b96f;
    --kc-gallery-line: rgba(201, 154, 78, .22);
    --kc-gallery-text: #f5f3ef;
    --kc-gallery-muted: #929292;
}

.kc-gallery-page,
.kc-gallery-page * { box-sizing: border-box; }

.kc-gallery-page {
    min-height: 100vh;
    overflow: hidden;
    color: var(--kc-gallery-text);
    background:
        radial-gradient(circle at 50% -5%, rgba(201, 154, 78, .12), transparent 34%),
        linear-gradient(180deg, #070707 0%, var(--kc-gallery-bg) 35%, #040404 100%);
    font-family: "Montserrat", sans-serif;
}

.kc-gallery-page button,
.kc-gallery-page input { font: inherit; }

.kc-gallery-shell {
    width: min(1240px, calc(100% - 44px));
    margin: 0 auto;
}

.kc-gallery-hero {
    position: relative;
    padding: 165px 0 72px;
    border-bottom: 1px solid rgba(255,255,255,.055);
}

.kc-gallery-hero::before,
.kc-gallery-hero::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.kc-gallery-hero::before {
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.kc-gallery-hero::after {
    width: 430px;
    height: 430px;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid rgba(201,154,78,.08);
    border-radius: 50%;
    box-shadow: 0 0 90px rgba(201,154,78,.035) inset;
}

.kc-gallery-hero-copy {
    position: relative;
    z-index: 2;
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
}

.kc-gallery-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: var(--kc-gallery-gold);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2.6px;
    text-transform: uppercase;
}

.kc-gallery-eyebrow::before,
.kc-gallery-eyebrow::after {
    content: "";
    width: 30px;
    height: 1px;
    background: var(--kc-gallery-gold);
}

.kc-gallery-hero h1 {
    margin: 0;
    color: #fff;
    font-family: "Cinzel", serif;
    font-size: clamp(38px, 6vw, 68px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -.02em;
}

.kc-gallery-hero h1 span { color: var(--kc-gallery-gold); }

.kc-gallery-hero p {
    max-width: 760px;
    margin: 22px auto 0;
    color: #9c9c9c;
    font-size: 14px;
    line-height: 1.9;
}

.kc-gallery-hero-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
    padding: 10px 15px;
    border: 1px solid rgba(201,154,78,.18);
    border-radius: 999px;
    background: rgba(8,8,8,.72);
    backdrop-filter: blur(8px);
}

.kc-gallery-hero-meta strong {
    color: var(--kc-gallery-gold-light);
    font-size: 13px;
}

.kc-gallery-hero-meta span,
.kc-gallery-hero-meta small {
    color: #858585;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: .08em;
}

.kc-gallery-hero-meta span { text-transform: uppercase; }
.kc-gallery-hero-meta i { width: 1px; height: 16px; background: rgba(255,255,255,.13); }

html[dir="rtl"] .kc-gallery-page,
html[dir="rtl"] .kc-gallery-page h1,
html[dir="rtl"] .kc-gallery-page h2,
html[dir="rtl"] .kc-gallery-page button {
    font-family: "Tajawal", sans-serif;
}

.kc-gallery-content { padding: 42px 0 110px; }

.kc-gallery-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    margin-bottom: 34px;
}

.kc-gallery-filter {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 999px;
    background: #0a0a0a;
    color: #aaa;
    cursor: pointer;
    transition: border-color .25s ease, color .25s ease, background .25s ease, transform .25s ease;
}

.kc-gallery-filter span {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.kc-gallery-filter small {
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255,255,255,.055);
    color: #777;
    font-size: 8px;
}

.kc-gallery-filter:hover,
.kc-gallery-filter:focus-visible,
.kc-gallery-filter.is-active {
    border-color: rgba(201,154,78,.48);
    background: rgba(201,154,78,.08);
    color: var(--kc-gallery-gold-light);
    outline: none;
}

.kc-gallery-filter:hover { transform: translateY(-2px); }

.kc-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.kc-gallery-card {
    min-width: 0;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 15px;
    background: linear-gradient(180deg, #0d0d0d, #080808);
    box-shadow: 0 14px 40px rgba(0,0,0,.23);
    transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
}

.kc-gallery-card:hover {
    transform: translateY(-5px);
    border-color: rgba(201,154,78,.25);
    box-shadow: 0 20px 52px rgba(0,0,0,.42);
}

.kc-gallery-card.is-filtered-out { display: none; }

.kc-gallery-open {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 15px 15px 0 0;
    background: transparent;
    cursor: zoom-in;
    text-align: inherit;
}

.kc-gallery-image-stage {
    position: relative;
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    padding: 8px;
    border-radius: 15px 15px 0 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 45%, rgba(201,154,78,.08), transparent 60%),
        #070707;
}

.kc-gallery-image-stage img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 9px;
    filter: saturate(.96) contrast(1.01);
    transition: filter .3s ease, opacity .3s ease;
}

.kc-gallery-card:hover .kc-gallery-image-stage img {
    filter: saturate(1.05) contrast(1.025) brightness(1.035);
}

.kc-gallery-card-overlay {
    position: absolute;
    inset: 8px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 11px;
    border-radius: 9px;
    background: linear-gradient(180deg, rgba(0,0,0,.2), transparent 35%);
    pointer-events: none;
}

.kc-gallery-view-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 50%;
    background: rgba(5,5,5,.74);
    color: var(--kc-gallery-gold-light);
    font-size: 15px;
    opacity: .78;
    transform: translateY(2px);
    transition: opacity .25s ease, transform .25s ease, background .25s ease;
}

.kc-gallery-card:hover .kc-gallery-view-icon {
    opacity: 1;
    transform: translateY(0);
    background: rgba(201,154,78,.13);
}

.kc-gallery-card-copy {
    min-height: 98px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 17px 17px;
}

.kc-gallery-category {
    display: block;
    margin-bottom: 5px;
    color: var(--kc-gallery-gold);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.kc-gallery-card h2 {
    margin: 0;
    color: #f4f2ee;
    font-family: "Cinzel", serif;
    font-size: 14px;
    line-height: 1.4;
}

.kc-gallery-card-copy p {
    max-width: 45%;
    margin: 0;
    color: #747474;
    font-size: 9px;
    line-height: 1.6;
    text-align: right;
}

html[dir="rtl"] .kc-gallery-card-copy p { text-align: left; }

.kc-gallery-empty {
    min-height: 390px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    text-align: center;
    border: 1px dashed rgba(201,154,78,.22);
    border-radius: 16px;
    background: #080808;
}

.kc-gallery-empty span { color: var(--kc-gallery-gold); font-size: 28px; }
.kc-gallery-empty h2 { margin: 0; color: #999; font-size: 15px; font-weight: 500; }

.kc-gallery-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .65s ease var(--kc-gallery-delay, 0ms), transform .65s ease var(--kc-gallery-delay, 0ms);
}

.kc-gallery-reveal.is-visible { opacity: 1; transform: translateY(0); }

.kc-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    align-items: center;
    gap: 12px;
    padding: 32px;
    background: rgba(0,0,0,.94);
    backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, visibility .25s ease;
}

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

.kc-gallery-lightbox-figure {
    width: min(1180px, 100%);
    max-height: calc(100vh - 64px);
    margin: 0 auto;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(201,154,78,.25);
    border-radius: 16px;
    background: #070707;
    box-shadow: 0 34px 90px rgba(0,0,0,.7);
}

.kc-gallery-lightbox-stage {
    min-height: 240px;
    height: min(76vh, 820px);
    display: grid;
    place-items: center;
    padding: 18px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 45%, rgba(201,154,78,.075), transparent 64%),
        #050505;
}

.kc-gallery-lightbox-stage img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    opacity: 0;
    transform: scale(.985);
    transition: opacity .2s ease, transform .25s ease;
}

.kc-gallery-lightbox.is-open .kc-gallery-lightbox-stage img.is-ready {
    opacity: 1;
    transform: scale(1);
}

.kc-gallery-lightbox figcaption {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    padding: 15px 18px 17px;
    border-top: 1px solid rgba(255,255,255,.07);
}

.kc-gallery-lightbox figcaption span {
    display: block;
    color: var(--kc-gallery-gold);
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.kc-gallery-lightbox figcaption strong {
    display: block;
    margin-top: 4px;
    color: #f5f3ef;
    font-family: "Cinzel", serif;
    font-size: 15px;
}

.kc-gallery-lightbox figcaption p {
    max-width: 760px;
    margin: 5px 0 0;
    color: #808080;
    font-size: 9px;
    line-height: 1.55;
}

.kc-gallery-lightbox figcaption small {
    color: #666;
    font-size: 9px;
    white-space: nowrap;
}

.kc-gallery-lightbox-close,
.kc-gallery-lightbox-nav {
    border: 1px solid rgba(201,154,78,.28);
    background: rgba(10,10,10,.78);
    color: #ddd;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.kc-gallery-lightbox-close:hover,
.kc-gallery-lightbox-nav:hover,
.kc-gallery-lightbox-close:focus-visible,
.kc-gallery-lightbox-nav:focus-visible {
    background: rgba(201,154,78,.14);
    color: var(--kc-gallery-gold-light);
    outline: none;
}

.kc-gallery-lightbox-close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 46px;
    height: 46px;
    z-index: 2;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
}

html[dir="rtl"] .kc-gallery-lightbox-close { right: auto; left: 20px; }

.kc-gallery-lightbox-nav {
    width: 54px;
    height: 54px;
    justify-self: center;
    border-radius: 50%;
    font-size: 34px;
    line-height: 1;
}

.kc-gallery-lightbox-nav:hover { transform: scale(1.05); }

body.kc-gallery-lightbox-open { overflow: hidden !important; }

@media (max-width: 1024px) {
    .kc-gallery-hero { padding-top: 130px; }
    .kc-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .kc-gallery-lightbox { grid-template-columns: 52px minmax(0,1fr) 52px; padding: 22px 12px; }
    .kc-gallery-lightbox-nav { width: 46px; height: 46px; }
}

@media (max-width: 680px) {
    .kc-gallery-shell { width: min(100% - 28px, 1240px); }
    .kc-gallery-hero { padding: 122px 0 55px; }
    .kc-gallery-eyebrow { font-size: 8px; letter-spacing: 1.8px; }
    .kc-gallery-eyebrow::before,
    .kc-gallery-eyebrow::after { width: 20px; }
    .kc-gallery-hero p { font-size: 12px; line-height: 1.75; }
    .kc-gallery-hero-meta { max-width: 100%; flex-wrap: wrap; border-radius: 13px; }
    .kc-gallery-hero-meta i { display: none; }
    .kc-gallery-hero-meta small { width: 100%; }
    .kc-gallery-content { padding: 30px 0 78px; }
    .kc-gallery-toolbar { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
    .kc-gallery-toolbar::-webkit-scrollbar { display: none; }
    .kc-gallery-filter { flex: 0 0 auto; }
    .kc-gallery-grid { grid-template-columns: 1fr; gap: 16px; }
    .kc-gallery-card-copy { min-height: 86px; }
    .kc-gallery-lightbox { grid-template-columns: 1fr; padding: 60px 10px 14px; }
    .kc-gallery-lightbox-figure { grid-column: 1; width: 100%; max-height: calc(100vh - 78px); }
    .kc-gallery-lightbox-stage { height: min(68vh, 650px); padding: 8px; }
    .kc-gallery-lightbox-nav { position: absolute; bottom: 20px; z-index: 3; width: 42px; height: 42px; font-size: 28px; }
    .kc-gallery-lightbox-nav.is-prev { left: 20px; }
    .kc-gallery-lightbox-nav.is-next { right: 20px; }
    html[dir="rtl"] .kc-gallery-lightbox-nav.is-prev { left: auto; right: 20px; }
    html[dir="rtl"] .kc-gallery-lightbox-nav.is-next { right: auto; left: 20px; }
    .kc-gallery-lightbox figcaption { padding-bottom: 66px; }
    .kc-gallery-lightbox figcaption p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .kc-gallery-page *,
    .kc-gallery-page *::before,
    .kc-gallery-page *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }

    .kc-gallery-reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Gallery revision R2: full-canvas page, original-ratio lightbox, footer logo
   ========================================================================== */

/* The Gallery page is the only page that loads this stylesheet, so these
   document-level resets remove the browser's white gutter without touching
   the approved styling of other frontend pages. */
html {
    margin: 0;
    padding: 0;
    background: #050505;
}

body.page-gallery {
    width: 100%;
    min-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
    background: #050505 !important;
}

body.page-gallery > #main-header,
body.page-gallery > .kc-gallery-page,
body.page-gallery > footer {
    width: 100%;
    margin-inline: 0;
}

/* Show the real image ratio in the viewer. The image is never forced to fill
   a fixed rectangle and is never upscaled beyond its intrinsic dimensions. */
.kc-gallery-lightbox {
    grid-template-columns: 64px minmax(0, 1fr) 64px;
    padding: 24px;
}

.kc-gallery-lightbox-figure {
    width: fit-content;
    max-width: min(1320px, calc(100vw - 176px));
    max-height: calc(100vh - 48px);
    justify-self: center;
}

.kc-gallery-lightbox-stage {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: calc(100vh - 138px);
    padding: 12px;
    overflow: auto;
}

.kc-gallery-lightbox-stage img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 162px);
    object-fit: contain;
    object-position: center;
    margin: auto;
}

/* Footer styling is global from resources/views/partials/footer.blade.php.
   Gallery no longer has a special footer-only logo treatment. */


@media (max-width: 1024px) {
    .kc-gallery-lightbox {
        grid-template-columns: 50px minmax(0, 1fr) 50px;
        padding: 18px 10px;
    }

    .kc-gallery-lightbox-figure {
        max-width: calc(100vw - 124px);
        max-height: calc(100vh - 36px);
    }

    .kc-gallery-lightbox-stage img {
        max-height: calc(100vh - 154px);
    }
}

@media (max-width: 680px) {
    .kc-gallery-lightbox {
        grid-template-columns: 1fr;
        padding: 58px 8px 12px;
    }

    .kc-gallery-lightbox-figure {
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 70px);
    }

    .kc-gallery-lightbox-stage {
        max-height: calc(100vh - 188px);
        padding: 6px;
    }

    .kc-gallery-lightbox-stage img {
        max-width: 100%;
        max-height: calc(100vh - 202px);
    }

}


/* ==========================================================================
   Gallery Mobile Compact v1
   Two-column mobile gallery + compact card copy + progressive reveal button.
   Desktop/tablet layout remains unchanged.
   ========================================================================== */

.kc-gallery-mobile-more-wrap {
    display: none;
}

@media (max-width: 680px) {
    .kc-gallery-shell {
        width: min(100% - 20px, 1240px);
    }

    .kc-gallery-hero {
        padding: 104px 0 34px;
    }

    .kc-gallery-hero::after {
        width: 270px;
        height: 270px;
        top: 46px;
    }

    .kc-gallery-eyebrow {
        margin-bottom: 11px;
    }

    .kc-gallery-hero h1 {
        font-size: clamp(29px, 9vw, 38px);
        line-height: 1.06;
    }

    .kc-gallery-hero p {
        max-width: 94%;
        margin-top: 14px;
        font-size: 10px;
        line-height: 1.65;
    }

    .kc-gallery-hero-meta {
        gap: 7px;
        margin-top: 17px;
        padding: 8px 11px;
        border-radius: 10px;
    }

    .kc-gallery-hero-meta strong {
        font-size: 11px;
    }

    .kc-gallery-hero-meta span,
    .kc-gallery-hero-meta small {
        font-size: 7px;
    }

    .kc-gallery-content {
        padding: 18px 0 58px;
    }

    .kc-gallery-toolbar {
        position: sticky;
        top: 58px;
        z-index: 12;
        gap: 6px;
        margin: 0 -10px 14px;
        padding: 8px 10px 9px;
        background: rgba(5, 5, 5, .9);
        border-bottom: 1px solid rgba(255,255,255,.05);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .kc-gallery-filter {
        min-height: 31px;
        gap: 6px;
        padding: 0 9px;
    }

    .kc-gallery-filter span {
        font-size: 7px;
    }

    .kc-gallery-filter small {
        min-width: 17px;
        width: auto;
        height: 17px;
        padding: 0 4px;
        font-size: 7px;
    }

    .kc-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .kc-gallery-card {
        border-radius: 10px;
        box-shadow: 0 8px 22px rgba(0,0,0,.2);
    }

    .kc-gallery-card:hover {
        transform: none;
    }

    .kc-gallery-card.is-mobile-paged-out {
        display: none;
    }

    .kc-gallery-open {
        border-radius: 10px 10px 0 0;
    }

    .kc-gallery-image-stage {
        aspect-ratio: 4 / 3;
        padding: 4px;
        border-radius: 10px 10px 0 0;
    }

    .kc-gallery-image-stage img {
        border-radius: 7px;
    }

    .kc-gallery-card-overlay {
        inset: 4px;
        padding: 6px;
        border-radius: 7px;
    }

    .kc-gallery-view-icon {
        width: 24px;
        height: 24px;
        font-size: 10px;
        border-color: rgba(255,255,255,.13);
    }

    .kc-gallery-card-copy {
        min-height: 50px;
        display: block;
        padding: 8px 9px 9px;
    }

    .kc-gallery-category {
        margin-bottom: 3px;
        font-size: 6px;
        letter-spacing: .09em;
    }

    .kc-gallery-card h2 {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        font-size: 9px;
        line-height: 1.35;
        white-space: normal;
    }

    .kc-gallery-card-copy p {
        display: none;
    }

    .kc-gallery-mobile-more-wrap {
        display: flex;
        justify-content: center;
        padding-top: 17px;
    }

    .kc-gallery-mobile-more-wrap[hidden] {
        display: none !important;
    }

    .kc-gallery-mobile-more {
        min-height: 39px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 0 15px;
        border: 1px solid rgba(201,154,78,.34);
        border-radius: 999px;
        background: linear-gradient(180deg, rgba(201,154,78,.09), rgba(201,154,78,.035));
        color: var(--kc-gallery-gold-light);
        cursor: pointer;
        box-shadow: 0 8px 24px rgba(0,0,0,.24);
    }

    .kc-gallery-mobile-more > span {
        font-size: 15px;
        line-height: 1;
    }

    .kc-gallery-mobile-more strong,
    .kc-gallery-mobile-more small {
        font-size: 8px;
        font-weight: 750;
        letter-spacing: .08em;
    }

    .kc-gallery-mobile-more small {
        color: #b4a17e;
    }

    .kc-gallery-mobile-more:focus-visible {
        outline: 2px solid rgba(224,185,111,.55);
        outline-offset: 3px;
    }
}
