
/* ===========================
   GALLERY PAGE STYLES
   =========================== */

/* --- 1. Liquid Glass Filter Bar --- */
.glass-filter-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .glass-filter-container {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.05);
}

/* Filter Buttons */
.filter-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.filter-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

.filter-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(184, 26, 29, 0.3);
    transform: scale(1.05);
}

/* --- 2. Masonry Grid Layout --- */
.gallery-grid {
    margin: 0 auto;
    width: 100%;
}

/* Grid Sizing - CRITICAL FOR ISOTOPE */
/* padding creates the gutter visually */
.grid-sizer,
.gallery-item {
    width: 100%;
    margin-bottom: 24px; /* Vertical gap */
    padding: 0 12px; /* Horizontal gap */
    box-sizing: border-box; /* Important so padding is included in width */
}

/* Responsive Columns */
@media (min-width: 768px) {
    .grid-sizer,
    .gallery-item {
        width: 50%; /* 2 Columns */
    }
}

@media (min-width: 1024px) {
    .grid-sizer,
    .gallery-item {
        width: 33.333%; /* 3 Columns */
    }
}

/* --- 3. Gallery Items & Interactions --- */
/* Reset any project-card heights inherited from global style */
.gallery-item .project-card {
    height: auto !important; /* Allow masonry to dictate height */
}

.gallery-item a {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3; /* Constrain to wider ratio while maintaining fluid grid */
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.5s ease;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.gallery-item img {
    object-fit: cover; /* Fill container without stretching, crops edges if needed */
}

/* Portrait aspect ratio for mobile/phone mockups */
.gallery-item.portrait a {
    aspect-ratio: 3 / 4; /* Matches case-image sizing to reduce visual height */
    max-height: 640px; /* Constrain tall mockups similar to case-image styling */
}

.gallery-item.portrait img {
    object-fit: contain; /* Keep full phone frame visible without cropping */
}

.gallery-item:hover a {
    transform: translateY(-5px);
}

[data-theme="dark"] .gallery-item a {
    box-shadow: 0 14px 36px -16px rgba(0,0,0,0.28);
}

[data-theme="dark"] .gallery-item:hover a {
    box-shadow: 0 18px 48px -18px rgba(0,0,0,0.38);
}

[data-theme="light"] .gallery-item a {
    box-shadow: none;
}

[data-theme="light"] .gallery-item:hover a {
    box-shadow: 0 18px 48px -18px rgba(0,0,0,0.28);
}

/* Fix for Isotope overlapping: Ensure image takes up space */
.gallery-item img {
    width: 100% !important;
    height: 100% !important;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 0.7s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Icon Overlay */
.gallery-overlay-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-overlay-icon > div {
    width: 2.75rem;
    height: 2.75rem;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-overlay-icon svg,
.gallery-overlay-icon i {
    width: 1.75rem;
    height: 1.75rem;
    stroke-width: 1.25;
}

.gallery-item:hover .gallery-overlay-icon {
    opacity: 1;
}

/* Overlay Animation */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    transition: opacity 0.4s ease;
    pointer-events: none; /* Let clicks pass through to anchor */
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
} 

.gallery-overlay span {
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

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

.gallery-item:hover .gallery-overlay span:nth-child(2) {
    transition-delay: 0.1s;
}

/* --- 4. Animation Utility --- */
.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
} 