/* Gallery Page Specific Styles */

.gallery-page {
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
    background:
        radial-gradient(ellipse 90% 60% at 0% 0%, rgba(191, 219, 254, 0.35), transparent 60%),
        radial-gradient(ellipse 70% 50% at 100% 100%, rgba(221, 214, 254, 0.4), transparent 60%),
        linear-gradient(to bottom, #ffffff, #f8fafc 65%, #ffffff);
}

/* Lightbox */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
}

.gallery-lightbox.hidden {
    display: none;
}

.gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
}

.gallery-lightbox-dialog {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 3rem auto;
    padding: 1.5rem;
    border-radius: 1rem;
    background: radial-gradient(circle at top left, rgba(147, 197, 253, 0.3), transparent 55%),
        radial-gradient(circle at bottom right, rgba(221, 214, 254, 0.35), transparent 60%),
        #020617;
    color: #e5e7eb;
    box-shadow: 0 25px 60px -30px rgba(15, 23, 42, 0.9);
}

.gallery-lightbox-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
}

.gallery-lightbox-image-wrapper {
    position: relative;
    border-radius: 0.75rem;
    background-color: transparent;
}

.gallery-lightbox-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
}

.gallery-lightbox-meta {
    margin-top: 0.75rem;
}

.gallery-lightbox-category {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background-color: rgba(15, 118, 110, 0.8);
    color: #e5e7eb;
}

.gallery-lightbox-description {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #e5e7eb;
}

.gallery-lightbox-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none;
    background-color: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
    cursor: pointer;
}

.gallery-lightbox-nav {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(15, 23, 42, 0.7);
    color: #e5e7eb;
    cursor: pointer;
}

.gallery-lightbox-open {
    overflow: hidden;
}

.gallery-shell {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3.5rem;
}

@media (min-width: 1024px) {
    .gallery-shell {
        padding: 3rem 2rem 4rem;
    }
}

/* Header */
.gallery-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.gallery-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    /* Mobile */
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--color-primary), #7b3ccd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    /* Fallback */
    margin-bottom: 1rem;
    display: inline-block;
    padding: 0 1rem;
    /* Prevent edge touching on small screens */
}

@media (min-width: 640px) {
    .gallery-title {
        font-size: 3.5rem;
        /* Small Tablets / Large Phones */
    }
}

@media (min-width: 1024px) {
    .gallery-title {
        font-size: 4rem;
        /* Desktop */
    }
}

.gallery-subtitle {
    max-width: 40rem;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-gray-600);
}

/* Filters */
.gallery-filters {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: center;
}

.gallery-filter-row {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 0.25rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.gallery-filter-row::-webkit-scrollbar {
    display: none;
}

.gallery-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    padding: 0 1.5rem;
    border-radius: 9999px;
    border: 1px solid var(--color-gray-200);
    background-color: #ffffff;
    color: var(--color-gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 200ms ease;
}

.gallery-chip:hover {
    border-color: rgba(123, 60, 205, 0.5);
    background: linear-gradient(135deg, var(--color-primary), #7b3ccd);
    color: #ffffff;
}

.gallery-chip-active,
.gallery-chip-active:hover {
    background: linear-gradient(135deg, var(--color-primary), #7b3ccd);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 8px 18px -10px rgba(15, 23, 42, 0.4);
}

/* Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.gallery-card {
    position: relative;
    width: 100%;
    padding-bottom: 75%;
    /* 4:3 aspect ratio */
    border-radius: 0.75rem;
    background-color: var(--color-gray-100);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow 300ms ease, transform 300ms ease;
}

.gallery-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.gallery-card-media {
    position: absolute;
    inset: 0;
}

.gallery-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.02);
    transition: transform 700ms ease;
}

.gallery-card:hover .gallery-card-bg {
    transform: scale(1.1);
}

.gallery-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.2), transparent);
    opacity: 0.7;
    transition: opacity 300ms ease;
}

.gallery-card:hover .gallery-card-overlay {
    opacity: 0.85;
}

.gallery-card-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    color: #ffffff;
    cursor: pointer;
    transform: translateY(-10px);
    opacity: 0;
    transition: transform 300ms ease, opacity 300ms ease, background-color 200ms ease;
}

.gallery-card:hover .gallery-card-icon {
    transform: translateY(0);
    opacity: 1;
}

.gallery-card-icon:hover {
    background-color: rgba(60, 205, 123, 0.9);
}

.gallery-card-label {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    transform: translateY(8px);
    transition: transform 300ms ease;
}

.gallery-card:hover .gallery-card-label {
    transform: translateY(0);
}

.gallery-card-description-short {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(248, 250, 252, 0.9);
}

.gallery-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
}

.gallery-tag-teal {
    background-color: #3ccd7b;
}

.gallery-tag-purple {
    background-color: #7b3ccd;
}

.gallery-tag-blue {
    background-color: #3b82f6;
}

.gallery-tag-yellow {
    background-color: #eab308;
}

.gallery-tag-indigo {
    background-color: #6366f1;
}

.gallery-tag-pink {
    background-color: #ec4899;
}

/* Card visibility for filtering/pagination */
.gallery-card-hidden {
    display: none !important;
}

/* CTA */
.gallery-cta {
    display: flex;
    justify-content: center;
    padding: 3rem 0 0 0;
}

.gallery-cta-button-hidden {
    display: none !important;
}

.gallery-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    height: 3rem;
    padding: 0 2rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--color-primary), #7b3ccd);
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.015em;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 250ms ease;
}

.gallery-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.gallery-cta-button .material-symbols-outlined {
    font-size: 1.125rem;
    margin-left: 0.5rem;
    transition: transform 250ms ease;
}

.gallery-cta-button:hover .material-symbols-outlined {
    transform: translateY(2px);
}

/* Simple fade-in animation hooks */
.gallery-card {
    opacity: 0;
    transform: translateY(16px);
    animation: gallery-fade-up 600ms ease-out forwards;
}

.gallery-card:nth-child(2) {
    animation-delay: 80ms;
}

.gallery-card:nth-child(3) {
    animation-delay: 160ms;
}

.gallery-card:nth-child(4) {
    animation-delay: 240ms;
}

.gallery-card:nth-child(5) {
    animation-delay: 320ms;
}

.gallery-card:nth-child(6) {
    animation-delay: 400ms;
}

@keyframes gallery-fade-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}