/* ==========================================================================
   Gallery Widget (gm_gallery)
   Standalone CSS -- no Tailwind dependency
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Filter Tabs
   -------------------------------------------------------------------------- */

.gm-gallery__tabs {
    background-color: #FAFAFA;
    padding: 40px 0;
}

.gm-gallery__tabs-container {
    max-width: 1152px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 24px;
}

.gm-gallery__tabs-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px;
}

.gm-gallery__tab {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #6B6B6B;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0 8px 0;
    position: relative;
    transition: color 0.3s ease;
    line-height: 1.5;
}

.gm-gallery__tab:hover {
    color: #1A1A1A;
}

.gm-gallery__tab--active {
    color: #1A1A1A;
}

.gm-gallery__tab--active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #8C7A5B;
}

/* --------------------------------------------------------------------------
   2. Grid Section
   -------------------------------------------------------------------------- */

.gm-gallery__grid-section {
    padding-bottom: 40px;
}

.gm-gallery__grid-container {
    max-width: 1152px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 24px;
}

.gm-gallery__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 24px;
    row-gap: 40px;
}

@media (max-width: 1024px) {
    .gm-gallery__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .gm-gallery__grid {
        grid-template-columns: 1fr;
    }

    .gm-gallery__tabs-nav {
        gap: 16px 24px;
    }

    .gm-gallery__tab {
        font-size: 12px;
        letter-spacing: 0.15em;
    }
}

/* Empty state */
.gm-gallery__empty {
    display: none;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 300;
    color: #6B6B6B;
    padding: 80px 0;
}

.gm-gallery__empty--visible {
    display: block;
}

/* --------------------------------------------------------------------------
   3. Artwork Cards
   -------------------------------------------------------------------------- */

.gm-gallery__card {
    /* Filter show/hide */
}

.gm-gallery__card--hidden {
    display: none;
}

.gm-gallery__card-inner {
    cursor: pointer;
    /* Fade-up initial state (set by JS when animation enabled) */
}

.gm-gallery__card-inner--animate-init {
    opacity: 0;
    transform: translateY(20px);
}

.gm-gallery__card-inner--animate-visible {
    animation: gmGalleryFadeUp 600ms ease forwards;
}

@keyframes gmGalleryFadeUp {
    from {
        opacity: 0;
        transform: translateY(var(--gm-gallery-fade-distance, 20px));
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gm-gallery__card-image-wrap {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background-color: #F0EEEB;
}

.gm-gallery .gm-gallery__card-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.gm-gallery__card-inner:hover .gm-gallery__card-image {
    transform: scale(1.03);
}

/* Overlay */
.gm-gallery__card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.5s ease;
}

.gm-gallery__card-inner:hover .gm-gallery__card-overlay {
    background-color: rgba(0, 0, 0, 0.2);
}

.gm-gallery__card-overlay-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #FFFFFF;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.gm-gallery__card-inner:hover .gm-gallery__card-overlay-text {
    opacity: 1;
}

/* Card text */
.gm-gallery__card-title {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 400;
    color: #1A1A1A;
    margin: 12px 0 0 0;
    line-height: 1.35;
}

.gm-gallery__card-meta {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #6B6B6B;
    margin: 4px 0 0 0;
    line-height: 1.5;
}

.gm-gallery__card-dimensions {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 300;
    color: rgba(107, 107, 107, 0.7);
    margin: 2px 0 0 0;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   4. Lightbox
   -------------------------------------------------------------------------- */

.gm-gallery__lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.gm-gallery__lightbox--open {
    display: block;
}

.gm-gallery__lightbox-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: gmGalleryFadeIn 0.3s ease;
}

@keyframes gmGalleryFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Close button */
.gm-gallery__lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 10;
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.3s ease;
}

.gm-gallery__lightbox-close:hover {
    color: #8C7A5B;
}

.gm-gallery__lightbox-close svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* Wrapper (centering container) */
.gm-gallery__lightbox-wrapper {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

@media (max-width: 1024px) {
    .gm-gallery__lightbox-wrapper {
        padding: 24px;
    }
}

@media (max-width: 640px) {
    .gm-gallery__lightbox-wrapper {
        padding: 16px;
    }
}

/* Modal */
.gm-gallery__lightbox-modal {
    background-color: #1A1A1A;
    border-radius: 8px;
    max-width: 1024px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
}

/* Modal grid */
.gm-gallery__lightbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 1025px) {
    .gm-gallery__lightbox-grid {
        grid-template-columns: 1.5fr 1fr;
    }
}

/* Image area */
.gm-gallery__lightbox-image-area {
    position: relative;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

@media (min-width: 1025px) {
    .gm-gallery__lightbox-image-area {
        min-height: 500px;
    }
}

.gm-gallery .gm-gallery__lightbox-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Info panel */
.gm-gallery__lightbox-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 1025px) {
    .gm-gallery__lightbox-info {
        padding: 32px;
    }
}

.gm-gallery__lightbox-title {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 500;
    color: #F5F3F0;
    margin: 0 0 8px 0;
    line-height: 1.25;
}

.gm-gallery__lightbox-medium {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 4px 0;
    line-height: 1.5;
}

.gm-gallery__lightbox-year {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.5;
}

.gm-gallery__lightbox-dimensions {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.5);
    margin: 8px 0 0 0;
    line-height: 1.5;
}

/* Divider */
.gm-gallery__lightbox-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 24px 0;
}

/* CTA button */
.gm-gallery__lightbox-cta {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    text-align: center;
    text-decoration: none;
    color: #FFFFFF;
    background-color: #8C7A5B;
    padding: 16px 40px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, outline-color 0.3s ease;
    line-height: 1.5;
    outline: 1px solid transparent;
}

.gm-gallery__lightbox-cta:hover {
    background-color: #1A1A1A;
    color: #FFFFFF;
    outline: 1px solid rgba(255, 255, 255, 0.2);
}

/* Navigation */
.gm-gallery__lightbox-nav {
    margin-top: 32px;
    display: flex;
    gap: 16px;
}

.gm-gallery__lightbox-prev,
.gm-gallery__lightbox-next {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.3s ease;
    line-height: 1.5;
}

.gm-gallery__lightbox-prev:hover,
.gm-gallery__lightbox-next:hover {
    color: rgba(255, 255, 255, 0.6);
}

.gm-gallery__lightbox-prev:disabled,
.gm-gallery__lightbox-next:disabled {
    opacity: 0.3;
    cursor: default;
}

.gm-gallery__lightbox-prev:disabled:hover,
.gm-gallery__lightbox-next:disabled:hover {
    color: rgba(255, 255, 255, 0.4);
}
