/* ==========================================================================
   Galerie — grilă de categorii + pagina categoriei
   Tema deschisă implicit; .winter-mode (tema întunecată de iarnă) suprascrie tokenii.
   ========================================================================== */

.gx {
    --gx-accent: #e6502d;
    --gx-accent-hover: #ff6b45;
    --gx-bg: #f5f4f1;
    --gx-hero-veil: linear-gradient(180deg, rgba(245, 244, 241, 0.7) 0%, rgba(245, 244, 241, 0.92) 55%, #f5f4f1 92%);
    --gx-title: #141414;
    --gx-text: #4b4b4b;
    --gx-muted: #6f6f6f;
    --gx-card-ring: rgba(0, 0, 0, 0.06);
    --gx-card-shadow: 0 10px 30px -14px rgba(20, 20, 20, 0.35);
    --gx-card-shadow-hover: 0 22px 44px -18px rgba(20, 20, 20, 0.5);
    --gx-chip-bg: #ffffff;
    --gx-chip-border: #e2e0da;
    --gx-chip-text: #222;
    --gx-panel: #ffffff;
    --gx-panel-border: #e8e6e0;
    --gx-tile-bg: #e7e4de;
    --gx-radius: 12px;
    --gx-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

    position: relative;
    isolation: isolate;
    background: var(--gx-bg);
    padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(3rem, 6vw, 5rem);
    overflow: hidden;
}

.winter-mode .gx {
    --gx-bg: #0d0d0d;
    --gx-hero-veil: linear-gradient(180deg, rgba(13, 13, 13, 0.5) 0%, rgba(13, 13, 13, 0.82) 55%, #0d0d0d 92%);
    --gx-title: #ffffff;
    --gx-text: #d9d9d9;
    --gx-muted: #a3a3a3;
    --gx-card-ring: rgba(255, 255, 255, 0.07);
    --gx-card-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.8);
    --gx-card-shadow-hover: 0 24px 50px -18px rgba(0, 0, 0, 0.95);
    --gx-chip-bg: #1b1b1b;
    --gx-chip-border: #2e2e2e;
    --gx-chip-text: #e6e6e6;
    --gx-panel: #161616;
    --gx-panel-border: #262626;
    --gx-tile-bg: #1c1c1c;
}

/* ---------- Hero background ---------- */
.gx .gx-hero {
    position: absolute;
    inset: 0 0 auto 0;
    height: min(560px, 75vh);
    z-index: -1;
    overflow: hidden;
}

.gx .gx-hero--compact {
    height: min(420px, 60vh);
}

.gx .gx-hero__bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.06);
    filter: blur(3px) saturate(0.9);
}

.gx .gx-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gx-hero-veil);
}

.gx .gx-container {
    position: relative;
}

/* ---------- Heading ---------- */
.gx .gx-head {
    text-align: center;
    margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem);
}

.gx .gx-head--left {
    text-align: left;
    margin-bottom: 1.25rem;
}

.gx .gx-title {
    margin: 0 0 0.6rem;
    font-weight: 900;
    font-size: clamp(2.1rem, 5.2vw, 3.6rem);
    line-height: 1.02;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--gx-title);
}

.gx .gx-title__main {
    color: var(--gx-title);
}

.gx .gx-title__accent {
    color: var(--gx-accent);
}

.gx .gx-title--category {
    font-size: clamp(1.9rem, 4.4vw, 3rem);
}

.gx .gx-subtitle {
    margin: 0;
    color: var(--gx-text);
    font-size: clamp(0.95rem, 1.4vw, 1.08rem);
    font-weight: 500;
}

/* ---------- Category grid ---------- */
.gx .gx-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(12px, 1.6vw, 20px);
}

.gx .gx-card {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3.05;
    border-radius: var(--gx-radius);
    overflow: hidden;
    background: #1c1c1c;
    box-shadow: var(--gx-card-shadow), 0 0 0 1px var(--gx-card-ring);
    text-decoration: none;
    transform: translateZ(0);
    transition: transform 0.35s var(--gx-ease), box-shadow 0.35s var(--gx-ease);
}

.gx .gx-card__media,
.gx .gx-card__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.gx .gx-card__media img {
    object-fit: cover;
    transition: transform 0.7s var(--gx-ease);
}

.gx .gx-card__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, 0.35) 62%, rgba(0, 0, 0, 0.86) 100%);
    transition: opacity 0.35s var(--gx-ease);
}

.gx .gx-card__body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: clamp(14px, 1.4vw, 18px) clamp(14px, 1.5vw, 20px);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gx .gx-card .gx-card__title {
    color: #ffffff;
    font-weight: 800;
    font-size: clamp(1rem, 1.35vw, 1.22rem);
    line-height: 1.15;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.gx .gx-card .gx-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 500;
}

.gx .gx-card .gx-card__cta-text {
    color: rgba(255, 255, 255, 0.92);
}

.gx .gx-arrow {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--gx-accent);
    color: #ffffff;
    box-shadow: 0 6px 16px -4px rgba(230, 80, 45, 0.7);
    transition: transform 0.35s var(--gx-ease), background-color 0.25s ease;
}

.gx .gx-arrow svg {
    stroke: #ffffff;
}

.gx .gx-card:hover,
.gx .gx-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: var(--gx-card-shadow-hover), 0 0 0 1px var(--gx-card-ring);
}

.gx .gx-card:hover .gx-card__media img,
.gx .gx-card:focus-visible .gx-card__media img {
    transform: scale(1.06);
}

.gx .gx-card:hover .gx-arrow,
.gx .gx-card:focus-visible .gx-arrow {
    transform: translateX(4px);
    background: var(--gx-accent-hover);
}

.gx .gx-card:focus-visible {
    outline: 3px solid var(--gx-accent);
    outline-offset: 3px;
}

/* ---------- Breadcrumbs ---------- */
.gx .gx-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--gx-muted);
}

.gx .gx-crumbs a,
.gx .gx-crumbs span {
    color: var(--gx-muted);
    text-decoration: none;
}

.gx .gx-crumbs a:hover {
    color: var(--gx-accent);
}

.gx .gx-crumbs [aria-current="page"] {
    color: var(--gx-title);
    font-weight: 600;
}

/* ---------- Category chips ---------- */
.gx .gx-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 4px;
    margin-bottom: 1.5rem;
}

.gx .gx-chips .gx-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--gx-chip-border);
    background: var(--gx-chip-bg);
    color: var(--gx-chip-text);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.gx .gx-chips .gx-chip:hover {
    border-color: var(--gx-accent);
    color: var(--gx-accent);
}

.gx .gx-chips .gx-chip.is-active {
    background: var(--gx-accent);
    border-color: var(--gx-accent);
    color: #ffffff;
}

.gx .gx-chips .gx-chip--all {
    background: transparent;
}

/* ---------- Photos grid ---------- */
.gx .gx-photos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(10px, 1.4vw, 16px);
}

.gx .gx-photo {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: var(--gx-tile-bg);
    box-shadow: var(--gx-card-shadow), 0 0 0 1px var(--gx-card-ring);
    cursor: zoom-in;
}

.gx .gx-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--gx-ease), filter 0.3s ease;
}

.gx .gx-photo:hover img {
    transform: scale(1.05);
}

.gx .gx-photo:focus-visible {
    outline: 3px solid var(--gx-accent);
    outline-offset: 3px;
}

.gx .gx-photo .gx-photo__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 28px 14px 10px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75));
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gx .gx-photo:hover .gx-photo__caption {
    opacity: 1;
    transform: none;
}

.gx .gx-empty {
    text-align: center;
    color: var(--gx-muted);
    font-weight: 600;
    padding: 2rem 0;
}

/* ---------- CTA ---------- */
.gx .gx-cta {
    margin-top: clamp(2rem, 4vw, 3rem);
    padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.25rem, 3vw, 2.25rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    flex-wrap: wrap;
    border-radius: var(--gx-radius);
    background: var(--gx-panel);
    border: 1px solid var(--gx-panel-border);
    border-left: 4px solid var(--gx-accent);
}

.gx .gx-cta .gx-cta__title {
    margin: 0 0 4px;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 800;
    color: var(--gx-title);
}

.gx .gx-cta .gx-cta__text {
    margin: 0;
    color: var(--gx-text);
}

.gx .gx-cta a.gx-cta__btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 26px;
    border-radius: 999px;
    background: var(--gx-accent);
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 10px 22px -10px rgba(230, 80, 45, 0.8);
    transition: transform 0.25s var(--gx-ease), background-color 0.2s ease;
}

.gx .gx-cta a.gx-cta__btn:hover {
    background: #d1452a;
    color: #ffffff;
    transform: translateY(-2px);
}

/* ---------- Lightbox ---------- */
.gx-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 56px 72px;
    background: rgba(6, 6, 6, 0.94);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.gx-lightbox.is-open {
    display: flex;
}

.gx-lightbox .gx-lb-figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gx-lightbox .gx-lb-image {
    max-width: min(1400px, 100%);
    max-height: calc(100vh - 140px);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    transition: opacity 0.2s ease;
}

.gx-lightbox .gx-lb-image.is-loading {
    opacity: 0.35;
}

.gx-lightbox .gx-lb-caption {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 12px;
    color: #f2f2f2;
    font-size: 0.92rem;
}

.gx-lightbox .gx-lb-caption span {
    color: #f2f2f2;
}

.gx-lightbox .gx-lb-caption .gx-lb-counter {
    color: #bdbdbd;
    font-variant-numeric: tabular-nums;
}

.gx-lightbox .gx-lb-btn {
    position: absolute;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.gx-lightbox .gx-lb-btn svg {
    stroke: #ffffff;
}

.gx-lightbox .gx-lb-btn:hover {
    background: var(--gx-accent, #e6502d);
}

.gx-lightbox .gx-lb-close {
    top: 16px;
    right: 16px;
}

.gx-lightbox .gx-lb-prev {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.gx-lightbox .gx-lb-next {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .gx .gx-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .gx .gx-grid,
    .gx .gx-photos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .gx .gx-grid {
        grid-template-columns: 1fr;
    }

    /* pe telefon categoriile se derulează orizontal, fără bară vizibilă */
    .gx .gx-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-right: -12px;
        padding-right: 12px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .gx .gx-chips::-webkit-scrollbar {
        display: none;
    }

    .gx .gx-card {
        aspect-ratio: 16 / 10;
    }

    .gx .gx-photos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .gx .gx-photo {
        border-radius: 8px;
    }

    .gx-lightbox {
        padding: 56px 8px 72px;
    }

    .gx-lightbox .gx-lb-prev,
    .gx-lightbox .gx-lb-next {
        top: auto;
        bottom: 14px;
        transform: none;
    }

    .gx-lightbox .gx-lb-prev {
        left: calc(50% - 56px);
    }

    .gx-lightbox .gx-lb-next {
        right: calc(50% - 56px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gx *,
    .gx-lightbox * {
        transition: none !important;
    }
}
