/**
 * Experience Gallery Styles
 * Brand Colors:
 *   Primary: #632DE9
 *   Secondary: #39AF91
 *   Text: #0F3737
 *   Accent: #FAB295
 *   Interactive: #A7E8DB
 *   Primary BG: #F1F0F6
 *   Secondary BG: #BDB6D9
 */

/* CSS Variables */
:root {
    --exp-primary: #632DE9;
    --exp-secondary: #39AF91;
    --exp-text: #0F3737;
    --exp-accent: #FAB295;
    --exp-interactive: #A7E8DB;
    --exp-bg-primary: #F1F0F6;
    --exp-bg-secondary: #BDB6D9;
}

/* Base Gallery Grid */
.exp-gallery {
    display: grid;
    gap: 1.5rem;
    padding: 1rem 0;
}

.exp-gallery--cols-1 { grid-template-columns: 1fr; }
.exp-gallery--cols-2 { grid-template-columns: repeat(2, 1fr); }
.exp-gallery--cols-3 { grid-template-columns: repeat(3, 1fr); }
.exp-gallery--cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Responsive columns */
/* Tablet landscape */
@media (max-width: 1024px) {
    .exp-gallery--cols-4 { grid-template-columns: repeat(3, 1fr); }
    .exp-gallery { gap: 1.25rem; }
}

/* Tablet portrait */
@media (max-width: 768px) {
    .exp-gallery--cols-3,
    .exp-gallery--cols-4 { grid-template-columns: repeat(2, 1fr); }
    .exp-gallery { gap: 1rem; }

    .exp-gallery__content {
        padding: 1rem;
    }

    .exp-gallery__title {
        font-size: 1rem;
    }

    .exp-gallery__meta {
        font-size: 0.8rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .exp-gallery--cols-2,
    .exp-gallery--cols-3,
    .exp-gallery--cols-4 { grid-template-columns: 1fr; }

    .exp-gallery__card {
        border-radius: 8px;
    }

    .exp-gallery__images {
        border-radius: 8px 8px 0 0;
    }

    .exp-gallery__content {
        padding: 0.875rem;
        gap: 0.375rem;
    }

}

/* Card Styles */
.exp-gallery__card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 55, 55, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
}

a.exp-gallery__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 45, 233, 0.15);
}

a.exp-gallery__card:focus {
    outline: 3px solid var(--exp-interactive);
    outline-offset: 2px;
}

/* Image Container */
.exp-gallery__images {
    display: grid;
    gap: 4px;
    overflow: hidden;
    background: var(--exp-bg-primary);
    border-radius: 8px 8px 0 0;
}

/* Single image */
.exp-gallery__images--count-1 {
    aspect-ratio: 4 / 3;
}

/* Two images - side by side */
.exp-gallery__images--count-2 {
    grid-template-columns: repeat(2, 1fr);
    aspect-ratio: 16 / 9;
}

/* Three images - 1 main + 2 secondary (default layout) */
.exp-gallery__images--count-3 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 4 / 3;
}

.exp-gallery__images--count-3 .exp-gallery__image:first-child {
    grid-row: span 2;
}

/* Main image consistent crop - 4:3 aspect, centered */
.exp-gallery__images--count-3 .exp-gallery__image:first-child {
    aspect-ratio: 3 / 4;
}

/* Four+ images - 2x2 grid */
.exp-gallery__images--count-4,
.exp-gallery__images--count-5,
.exp-gallery__images--count-6 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    aspect-ratio: 4 / 3;
}

.exp-gallery__image {
    overflow: hidden;
    position: relative;
}

.exp-gallery__image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

a.exp-gallery__card:hover .exp-gallery__image img {
    transform: scale(1.05);
}

/* Content Area */
.exp-gallery__content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

/* Meta (Date & Location) */
.exp-gallery__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    color: var(--exp-secondary);
    font-weight: 500;
}

.exp-gallery__date::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 0.35rem;
    vertical-align: -2px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/contain no-repeat;
}

.exp-gallery__location::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 0.35rem;
    vertical-align: -2px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Title */
.exp-gallery__title {
    margin: 0;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--exp-text);
    line-height: 1.3;
}

a.exp-gallery__card:hover .exp-gallery__title {
    color: var(--exp-primary);
}

/* Excerpt */
.exp-gallery__excerpt {
    margin: 0;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    color: #5a6b6b;
    line-height: 1.5;
}

/* Partners */
.exp-gallery__partners {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--exp-bg-primary);
}

.exp-gallery__partners-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: #39AF91 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exp-gallery__partner {
    display: inline-block;
    line-height: 0;
}

.exp-gallery__partner img {
    height: 25px !important;
    width: auto !important;
    display: block;
    object-fit: contain;
}

.exp-gallery__partner-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background: var(--exp-primary);
    border-radius: 4px;
}

/* Empty State */
.exp-gallery-empty {
    text-align: center;
    padding: 3rem;
    color: var(--exp-text);
    background: var(--exp-bg-primary);
    border-radius: 12px;
}

/* =====================
   LAYOUT: Featured
   First card spans full width
   ===================== */
.exp-gallery--featured {
    grid-template-columns: 1fr;
}

.exp-gallery--featured .exp-gallery__card:first-child {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
}

.exp-gallery--featured .exp-gallery__card:first-child .exp-gallery__images {
    aspect-ratio: 4 / 3;
}

.exp-gallery--featured .exp-gallery__card:first-child .exp-gallery__content {
    padding: 2rem;
    justify-content: center;
}

.exp-gallery--featured .exp-gallery__card:first-child .exp-gallery__title {
    font-size: 1.5rem;
}

.exp-gallery--featured .exp-gallery__card:not(:first-child) {
    display: grid;
    grid-template-columns: 200px 1fr;
}

.exp-gallery--featured .exp-gallery__card:not(:first-child) .exp-gallery__images {
    aspect-ratio: 1;
}

@media (max-width: 768px) {
    .exp-gallery--featured .exp-gallery__card:first-child,
    .exp-gallery--featured .exp-gallery__card:not(:first-child) {
        grid-template-columns: 1fr;
    }

    .exp-gallery--featured .exp-gallery__card:not(:first-child) .exp-gallery__images {
        aspect-ratio: 16 / 9;
    }
}

/* =====================
   LAYOUT: Compact
   Smaller cards, minimal spacing
   ===================== */
.exp-gallery--compact {
    gap: 1rem;
}

.exp-gallery--compact .exp-gallery__card {
    border-radius: 8px;
}

.exp-gallery--compact .exp-gallery__images {
    aspect-ratio: 3 / 2;
}

.exp-gallery--compact .exp-gallery__content {
    padding: 0.875rem;
    gap: 0.35rem;
}

.exp-gallery--compact .exp-gallery__meta {
    font-size: 0.75rem;
    gap: 0.5rem;
}

.exp-gallery--compact .exp-gallery__title {
    font-size: 1rem;
}

/* =====================
   Accent Variations
   Add class to gallery for color themes
   ===================== */
.exp-gallery--accent-primary .exp-gallery__card {
    border-top: 3px solid var(--exp-primary);
}

.exp-gallery--accent-secondary .exp-gallery__card {
    border-top: 3px solid var(--exp-secondary);
}

.exp-gallery--accent-gradient .exp-gallery__card {
    position: relative;
}

.exp-gallery--accent-gradient .exp-gallery__card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--exp-primary), var(--exp-secondary));
}

/* Dark Background Variant */
.exp-gallery--dark {
    background: var(--exp-text);
    padding: 2rem;
    border-radius: 16px;
}

.exp-gallery--dark .exp-gallery__card {
    background: rgba(255, 255, 255, 0.95);
}

/* Partners Mobile */
@media (max-width: 480px) {
    .exp-gallery__partner img {
        height: 20px !important;
    }

    .exp-gallery__partner-initials {
        width: 20px;
        height: 20px;
        font-size: 0.55rem;
    }

    .exp-gallery__partners-label {
        font-size: 0.65rem;
    }
}

/* =====================
   PAGINATION STYLES
   ===================== */

/* Grid wrapper for pagination support */
.exp-gallery__grid {
    display: contents;
}

/* Pagination container */
.exp-gallery__pagination {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 2rem 0;
    margin-top: 1rem;
}

/* Load More Button */
.exp-gallery__load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    padding: 0.875rem 2rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: var(--exp-primary);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.exp-gallery__load-more:hover {
    background: var(--exp-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 45, 233, 0.25);
}

.exp-gallery__load-more:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.exp-gallery__load-more-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.exp-gallery__load-more-loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: exp-spinner 0.8s linear infinite;
}

/* Infinite Scroll Sentinel */
.exp-gallery__sentinel {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 2rem 0;
    min-height: 60px;
}

.exp-gallery__loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    color: var(--exp-secondary);
}

.exp-gallery__loading::before {
    content: "";
    width: 24px;
    height: 24px;
    border: 3px solid var(--exp-bg-primary);
    border-top-color: var(--exp-primary);
    border-radius: 50%;
    animation: exp-spinner 0.8s linear infinite;
}

@keyframes exp-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Numbered Pagination */
.exp-gallery__nav {
    width: 100%;
}

.exp-gallery__nav .page-numbers {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.exp-gallery__nav .page-numbers li {
    margin: 0;
}

.exp-gallery__nav .page-numbers a,
.exp-gallery__nav .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--exp-text);
    background: #fff;
    border: 1px solid var(--exp-bg-primary);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.exp-gallery__nav .page-numbers a:hover {
    background: var(--exp-bg-primary);
    border-color: var(--exp-primary);
    color: var(--exp-primary);
}

.exp-gallery__nav .page-numbers .current {
    background: var(--exp-primary);
    border-color: var(--exp-primary);
    color: #fff;
}

.exp-gallery__nav .page-numbers .prev,
.exp-gallery__nav .page-numbers .next {
    padding: 0 1rem;
}

.exp-gallery__nav .page-numbers .dots {
    border: none;
    background: transparent;
}

/* Responsive pagination */
@media (max-width: 480px) {
    .exp-gallery__load-more {
        width: 100%;
        max-width: 280px;
    }

    .exp-gallery__nav .page-numbers a,
    .exp-gallery__nav .page-numbers span {
        min-width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .exp-gallery__nav .page-numbers .prev,
    .exp-gallery__nav .page-numbers .next {
        font-size: 0;
    }

    .exp-gallery__nav .page-numbers .prev::before {
        content: "\00AB";
        font-size: 1rem;
    }

    .exp-gallery__nav .page-numbers .next::after {
        content: "\00BB";
        font-size: 1rem;
    }
}
