/* ==========================================================
   ARTWORKS GRID ([artwork_grid] Shortcode)
   ========================================================== */
/* Container class removed - layout controlled by Elementor Advanced tab */

/* Header (Title & Filter) */
.ls-artwork-header {
    display: flex;
    margin-bottom: var(--ls-filter-gap, 30px);
    width: 100%;
}

.ls-grid-header-title {
    font-family: var(--ls-font-heading, 'Playfair Display', serif);
    font-size: 2.5rem;
    color: var(--ls-text-primary, #f5f5f5);
    margin: 0 !important;
    line-height: 1.2;
}

/* Header Alignments */
.ls-header-align-center {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.ls-header-align-left {
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

/* Filters */
.ls-artwork-filter {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    transition: all 0.3s ease;
    margin: 0 !important;
}

/* Sticky Header */
.ls-header-is-sticky {
    position: sticky;
    top: 20px;
    z-index: 100;
    padding: 15px 20px;
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-left: -20px;
    margin-right: -20px;
    margin-top: -10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.ls-filter-btn {
    background: transparent;
    color: var(--ls-text-secondary);
    font-family: var(--ls-font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    padding: 0;
    position: relative;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* KIỂU NÚT (Button Style) */
.ls-filter-style-button .ls-filter-btn {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 25px;
    border-radius: 4px;
}

.ls-filter-style-button .ls-filter-btn:hover,
.ls-filter-style-button .ls-filter-btn.active {
    background-color: rgba(201, 169, 110, 0.85);
    color: var(--ls-bg-primary);
    border-color: rgba(201, 169, 110, 0.85);
    box-shadow: 0 5px 15px rgba(201, 169, 110, 0.15);
}

/* KIỂU GẠCH CHÂN (Underline - Premium Style) */
.ls-filter-style-underline {
    gap: 40px;
}

.ls-filter-style-underline .ls-filter-btn {
    padding: 5px 0 10px 0; /* Add more bottom padding so underline isn't too close */
    background: transparent !important;
}

.ls-filter-style-underline .ls-filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1.5px;
    background-color: rgba(201, 169, 110, 0.8);
    transition: width 0.4s ease;
}

.ls-filter-style-underline .ls-filter-btn:hover,
.ls-filter-style-underline .ls-filter-btn.active {
    color: rgba(201, 169, 110, 0.95);
    background: transparent !important;
}

.ls-filter-style-underline .ls-filter-btn:hover::after,
.ls-filter-style-underline .ls-filter-btn.active::after {
    width: 100%;
}

/* Grid */
.ls-artwork-grid {
    display: grid;
    grid-template-columns: repeat(var(--ls-grid-cols-desktop, 3), 1fr);
    gap: var(--ls-grid-gap, 30px);
}

/* Kiểu Masonry (Lộn xộn nhưng khít) */
.ls-artwork-grid.ls-layout-masonry {
    display: block;
    column-count: var(--ls-grid-cols-desktop, 3);
    column-gap: var(--ls-grid-gap, 30px);
}

.ls-layout-masonry .ls-artwork-item {
    display: inline-block;
    width: 100%;
    margin-bottom: var(--ls-grid-gap-desktop, 30px);
}

/* Kiểu Justified (Khít hàng) — chỉ khi bật Fullsize */
.ls-artwork-grid.ls-layout-justified.ls-fullsize {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ls-grid-gap-desktop, 30px);
}

.ls-layout-justified.ls-fullsize .ls-artwork-item {
    height: var(--ls-justified-h, 280px);
    min-width: 100px;
    overflow: hidden;
    position: relative;
}

.ls-layout-justified.ls-fullsize .ls-artwork-inner {
    aspect-ratio: auto;
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.ls-layout-justified.ls-fullsize .ls-artwork-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ls-layout-justified.ls-fullsize .ls-artwork-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hàng cuối: không giãn quá to nếu ít item */
.ls-layout-justified.ls-fullsize::after {
    content: '';
    flex-grow: 999;
}

.ls-artwork-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
}

.ls-artwork-inner {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--ls-bg-secondary);
    aspect-ratio: 4 / 5;
}

/* Kiểu Fullsize (Không crop) */
.ls-fullsize .ls-artwork-inner {
    aspect-ratio: auto;
}

.ls-fullsize .ls-artwork-image img {
    object-fit: contain;
    height: auto;
}

.ls-layout-masonry .ls-artwork-inner {
    aspect-ratio: auto;
}

.ls-artwork-image {
    width: 100%;
    height: 100%;
    position: relative;
}

.ls-artwork-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
    display: block;
}

.ls-artwork-item:hover .ls-artwork-image img {
    transform: scale(1.1);
}

/* Overlay */
.ls-artwork-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(15, 15, 15, 0.9) 0%, rgba(15, 15, 15, 0.2) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    opacity: 0;
    transition: all 0.4s ease;
    transform: translateY(10px);
}

.ls-artwork-item:hover .ls-artwork-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* ===== HOVER STYLE: Full Overlay ===== */
.ls-hover-full .ls-artwork-overlay {
    background: rgba(15, 15, 15, 0.75);
    justify-content: center;
    align-items: center;
    text-align: center;
    transform: none;
    opacity: 0;
}

.ls-hover-full .ls-artwork-item:hover .ls-artwork-overlay {
    opacity: 1;
}

.ls-hover-full .ls-artwork-link {
    align-self: center;
}

/* ===== HOVER STYLE: Gravity (Tập trung giữa) ===== */
.ls-hover-gravity .ls-artwork-overlay {
    background: radial-gradient(ellipse at center, rgba(15, 15, 15, 0.85) 0%, rgba(15, 15, 15, 0.4) 60%, transparent 100%);
    justify-content: center;
    align-items: center;
    text-align: center;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ls-hover-gravity .ls-artwork-item:hover .ls-artwork-overlay {
    opacity: 1;
    transform: scale(1);
}

.ls-hover-gravity .ls-artwork-link {
    align-self: center;
}

/* ===== HOVER STYLE: None ===== */
.ls-hover-none .ls-artwork-overlay {
    display: none !important;
}

.ls-hover-none .ls-artwork-item:hover .ls-artwork-image img {
    transform: scale(1.05);
}

.ls-artwork-title {
    font-size: 1.6rem;
    margin: 0 0 10px 0;
    color: var(--ls-accent);
}

.ls-artwork-excerpt {
    font-size: 0.9rem;
    color: var(--ls-text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: var(--ls-excerpt-lines, 2);
}

.ls-artwork-meta-hover {
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--ls-text-secondary);
    line-height: 1.6;
}

.ls-meta-item-hover {
    margin: 0 0 4px 0;
}

.ls-meta-item-hover .ls-meta-label {
    color: var(--ls-text-primary);
    font-weight: 500;
}

.ls-artwork-link {
    display: inline-block;
    color: var(--ls-text-primary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--ls-accent);
    padding-bottom: 5px;
    align-self: flex-start;
}

.ls-artwork-link:hover {
    color: var(--ls-accent);
}

/* Placeholder */
.ls-placeholder-art {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #151515 25%, #1a1a1a 50%, #151515 75%);
    background-size: 200% 200%;
    animation: placeholderShimmer 2s infinite;
}

@keyframes placeholderShimmer {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@media (max-width: 1024px) {
    .ls-artwork-grid {
        grid-template-columns: repeat(var(--ls-grid-cols-tablet, 2), 1fr);
        gap: var(--ls-grid-gap-tablet, 20px);
    }

    .ls-artwork-grid.ls-layout-masonry {
        column-count: var(--ls-grid-cols-tablet, 2);
        column-gap: var(--ls-grid-gap-tablet, 20px);
    }

    .ls-layout-masonry .ls-artwork-item {
        margin-bottom: var(--ls-grid-gap-tablet, 20px);
    }

    .ls-artwork-grid.ls-layout-justified.ls-fullsize {
        gap: var(--ls-grid-gap-tablet, 20px);
    }
}

@media (max-width: 768px) {
    .ls-artwork-grid {
        grid-template-columns: repeat(var(--ls-grid-cols-mobile, 1), 1fr);
        gap: var(--ls-grid-gap-mobile, 15px);
    }

    .ls-artwork-grid.ls-layout-masonry {
        column-count: var(--ls-grid-cols-mobile, 1);
        column-gap: var(--ls-grid-gap-mobile, 15px);
    }

    .ls-layout-masonry .ls-artwork-item {
        margin-bottom: var(--ls-grid-gap-mobile, 15px);
    }

    .ls-artwork-grid.ls-layout-justified.ls-fullsize {
        gap: var(--ls-grid-gap-mobile, 15px);
    }

    .ls-layout-justified.ls-fullsize .ls-artwork-item {
        height: auto;
        min-width: 100%;
    }

    .ls-layout-justified.ls-fullsize .ls-artwork-image {
        position: relative;
    }

    .ls-layout-justified.ls-fullsize .ls-artwork-image img {
        height: auto;
    }

    .ls-artwork-filter {
        gap: 10px;
    }

    .ls-filter-btn {
        padding: 8px 15px;
        font-size: 0.8rem;
    }
}