/* Aeris Luxury Theme - Gallery Components */

/* ========================================
   BASE GALLERY STYLES
======================================== */
.aeris-gallery {
    padding: 4rem 0 5rem;
    background: linear-gradient(135deg, var(--aeris-marble) 0%, var(--aeris-champagne) 30%, #ffffff 70%, rgba(212, 175, 55, 0.03) 100%);
    position: relative;
    overflow: hidden;
}

.aeris-gallery-grid {
    display: grid;
    gap: 1rem;
    transition: all var(--transition-normal, 300ms);
}

/* ========================================
   GALLERY GRID LAYOUTS
======================================== */
.aeris-gallery-grid.cols-1 {
    grid-template-columns: 1fr;
}

.aeris-gallery-grid.cols-2 {
    grid-template-columns: repeat(1, 1fr);
}

.aeris-gallery-grid.cols-3 {
    grid-template-columns: repeat(1, 1fr);
}

.aeris-gallery-grid.cols-4 {
    grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 640px) {
    .aeris-gallery-grid.cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .aeris-gallery-grid.cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .aeris-gallery-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .aeris-gallery-grid.cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .aeris-gallery-grid.cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .aeris-gallery-grid.cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   GALLERY ITEM STYLES
======================================== */
.aeris-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    background: #f3f4f6;
    cursor: pointer;
    transition: all var(--transition-normal, 300ms);
    aspect-ratio: 4/3;
}

.aeris-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.aeris-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.7s ease;
}

.aeris-gallery-item:hover .aeris-gallery-image {
    transform: scale(1.1);
}

/* ========================================
   GALLERY OVERLAY EFFECTS
======================================== */
.aeris-gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: all var(--transition-normal, 300ms);
    display: flex;
    align-items: center;
    justify-content: center;
}

.aeris-gallery-item:hover .aeris-gallery-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.aeris-gallery-zoom-icon {
    width: 4rem;
    height: 4rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    opacity: 0;
    transform: scale(0.75);
    transition: all var(--transition-normal, 300ms);
}

.aeris-gallery-item:hover .aeris-gallery-zoom-icon {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   GALLERY COUNTERS & INDICATORS
======================================== */
.aeris-gallery-counter {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-0.5rem);
    transition: all var(--transition-normal, 300ms);
}

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

/* ========================================
   GALLERY LOADING STATES
======================================== */
.aeris-gallery-loading {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: aeris-skeleton-loading 1.5s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aeris-gallery-spinner {
    width: 2rem;
    height: 2rem;
    border: 4px solid var(--aeris-primary, #3b82f6);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes aeris-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   GALLERY CAPTIONS
======================================== */
.aeris-gallery-caption {
    padding: 1rem;
    background: white;
    border-top: none;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
}

/* ========================================
   PROPERTY GALLERY SPECIFIC STYLES
======================================== */
.aeris-property-gallery {
    padding: 4rem 0 5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

.aeris-main-photo {
    position: relative;
    cursor: pointer;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.aeris-main-photo-image {
    width: 100%;
    height: 24rem;
    object-fit: cover;
    transition: all 0.5s ease;
}

.aeris-main-photo:hover .aeris-main-photo-image {
    transform: scale(1.05);
}

.aeris-photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity var(--transition-normal, 300ms);
    display: flex;
    align-items: center;
    justify-content: center;
}

.aeris-main-photo:hover .aeris-photo-overlay {
    opacity: 1;
}

/* ========================================
   THUMBNAIL GRID STYLES
======================================== */
.aeris-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.aeris-thumbnail {
    position: relative;
    cursor: pointer;
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 1;
    transition: all var(--transition-normal, 300ms);
}

.aeris-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.aeris-thumbnail.active {
    box-shadow: 0 0 0 4px var(--aeris-primary, #3b82f6);
    transform: scale(1.05);
}

.aeris-thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all var(--transition-normal, 300ms);
}

.aeris-thumbnail:hover .aeris-thumbnail-image {
    brightness: 1.1;
}

/* ========================================
   LIGHTBOX STYLES
======================================== */
.aeris-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.aeris-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.aeris-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

/* ========================================
   LIGHTBOX NAVIGATION
======================================== */
.aeris-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 1rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all var(--transition-normal, 300ms);
}

.aeris-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.aeris-lightbox-nav.prev {
    left: 1rem;
}

.aeris-lightbox-nav.next {
    right: 1rem;
}

.aeris-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all var(--transition-normal, 300ms);
}

.aeris-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.aeris-lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ========================================
   FLOOR PLAN GALLERY SPECIFIC STYLES
======================================== */
.aeris-floor-plan-gallery {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.aeris-floor-plan-main {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.aeris-floor-plan-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.aeris-floor-plan-image {
    width: 100%;
    height: 24rem;
    object-fit: contain;
    background: #f9fafb;
    transition: all 0.5s ease;
}

.aeris-floor-plan-main:hover .aeris-floor-plan-image {
    transform: scale(1.02);
}

.aeris-floor-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.aeris-floor-plan-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-normal, 300ms);
    border: 2px solid transparent;
}

.aeris-floor-plan-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.aeris-floor-plan-card.active {
    border-color: var(--aeris-primary, #3b82f6);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25);
    transform: translateY(-2px) scale(1.02);
}

.aeris-floor-plan-thumbnail {
    width: 100%;
    height: 12rem;
    object-fit: contain;
    background: #f9fafb;
    padding: 1rem;
}

.aeris-floor-plan-info {
    padding: 1rem;
    border-top: 1px solid #f3f4f6;
}

.aeris-floor-plan-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.aeris-floor-plan-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ========================================
   DOWNLOAD BUTTON STYLES
======================================== */
.aeris-download-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--aeris-primary, #3b82f6);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all var(--transition-normal, 300ms);
}

.aeris-download-btn:hover {
    background: var(--aeris-primary-dark, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.aeris-download-btn svg {
    margin-right: 0.5rem;
}

/* ========================================
   GLIGHTBOX CUSTOM STYLING
======================================== */
.glightbox-clean .gslide-description {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    color: #333 !important;
    padding: 20px 25px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15) !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    text-align: left !important;
    border-left: 4px solid var(--aeris-primary, #3b82f6) !important;
    font-weight: normal !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    max-width: 600px !important;
    animation: slideInUp 0.3s ease-out !important;
}

.glightbox-clean .gslide-description::before {
    content: "📋 " !important;
    font-size: 16px !important;
    margin-right: 8px !important;
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */
@media (max-width: 768px) {
    .aeris-gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .aeris-main-photo-image,
    .aeris-floor-plan-image {
        height: 16rem;
    }
    
    .aeris-thumbnail-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .aeris-floor-plan-grid {
        grid-template-columns: 1fr;
    }
    
    .aeris-lightbox-nav {
        padding: 0.75rem;
    }
    
    .aeris-lightbox-nav.prev {
        left: 0.5rem;
    }
    
    .aeris-lightbox-nav.next {
        right: 0.5rem;
    }
    
    .aeris-lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.5rem;
    }
}

@media (min-width: 1024px) {
    .aeris-main-photo-image,
    .aeris-floor-plan-image {
        height: 37.5rem;
    }
    
    .aeris-thumbnail-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ========================================
   NO CONTENT STATES
======================================== */
.aeris-gallery-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.aeris-gallery-empty-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.aeris-gallery-empty-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.aeris-gallery-empty-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
======================================== */
.aeris-gallery-item:focus,
.aeris-thumbnail:focus,
.aeris-lightbox-nav:focus,
.aeris-lightbox-close:focus {
    outline: 2px solid var(--aeris-primary, #3b82f6);
    outline-offset: 2px;
}

.aeris-gallery-item[aria-label],
.aeris-thumbnail[aria-label] {
    position: relative;
}

/* ========================================
   HIGH CONTRAST MODE SUPPORT
======================================== */
@media (prefers-contrast: high) {
    .aeris-gallery-item,
    .aeris-thumbnail,
    .aeris-floor-plan-card {
        border: 2px solid #000;
    }
    
    .aeris-gallery-overlay,
    .aeris-photo-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .aeris-lightbox {
        background: rgba(0, 0, 0, 0.95);
    }
    
    .aeris-lightbox-nav,
    .aeris-lightbox-close {
        border: 2px solid #fff;
        background: rgba(0, 0, 0, 0.8);
    }
}

/* ========================================
   REDUCED MOTION SUPPORT
======================================== */
@media (prefers-reduced-motion: reduce) {
    .aeris-gallery-item,
    .aeris-gallery-image,
    .aeris-thumbnail,
    .aeris-thumbnail-image,
    .aeris-main-photo-image,
    .aeris-floor-plan-image,
    .aeris-gallery-overlay,
    .aeris-photo-overlay,
    .aeris-gallery-zoom-icon,
    .aeris-gallery-counter,
    .aeris-lightbox-nav,
    .aeris-lightbox-close,
    .aeris-download-btn {
        transition: none !important;
        animation: none !important;
    }
    
    .aeris-gallery-item:hover .aeris-gallery-image,
    .aeris-thumbnail:hover .aeris-thumbnail-image,
    .aeris-main-photo:hover .aeris-main-photo-image,
    .aeris-floor-plan-main:hover .aeris-floor-plan-image {
        transform: none !important;
    }
    
    .aeris-gallery-loading {
        animation: none !important;
        background: #f0f0f0 !important;
    }
    
    .aeris-gallery-spinner {
        animation: none !important;
        border-top-color: var(--aeris-primary, #3b82f6) !important;
    }
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    .aeris-lightbox,
    .aeris-gallery-overlay,
    .aeris-photo-overlay,
    .aeris-gallery-zoom-icon,
    .aeris-lightbox-nav,
    .aeris-lightbox-close {
        display: none !important;
    }
    
    .aeris-gallery-item,
    .aeris-thumbnail,
    .aeris-main-photo,
    .aeris-floor-plan-card {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    .aeris-gallery-caption,
    .aeris-floor-plan-info {
        color: #000 !important;
        background: white !important;
    }
}

/* ========================================
   GLIGHTBOX DISCLAIMER TEXT STYLING FIX
======================================== */

/* Position disclaimer below the image with same width for unified look */
.glightbox-clean .gslide-description {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    
    /* Match the image width for unified appearance */
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    
    /* Styling for maximum readability */
    background: #ffffff !important;
    color: #1f2937 !important;
    text-align: center !important;
    padding: 1rem 1.5rem !important;
    
    /* Connected styling - no top border radius to join with image */
    border-radius: 0 0 0.5rem 0.5rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid #e5e7eb !important;
    border-top: none !important;
    
    /* Typography */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    font-weight: 500 !important;
}

/* Style the disclaimer text paragraphs */
.glightbox-clean .gslide-description p {
    margin: 0 !important;
    color: #374151 !important;
    text-align: center !important;
    font-size: inherit !important;
    line-height: inherit !important;
}

/* Add a subtle icon or indicator */
.glightbox-clean .gslide-description::before {
    content: "ℹ️" !important;
    font-size: 1rem !important;
    margin-right: 0.5rem !important;
    display: inline-block !important;
}

/* Ensure the description container is properly spaced */
.glightbox-clean .gslide-inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2rem !important;
}

/* Style the image container to connect with disclaimer */
.glightbox-clean .gslide-media {
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
    border-radius: 0.5rem 0.5rem 0 0 !important;
    overflow: hidden !important;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e5e7eb !important;
    border-bottom: none !important;
}

/* Style the actual image */
.glightbox-clean .gslide-media img {
    border-radius: 0 !important;
    display: block !important;
}

/* Create a unified card appearance */
.glightbox-clean .gslide-inner > * {
    width: 100% !important;
    max-width: min(90vw, 800px) !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .glightbox-clean .gslide-description {
        padding: 0.75rem 1rem !important;
        font-size: 0.8rem !important;
    }
    
    .glightbox-clean .gslide-inner {
        padding: 1rem !important;
    }
    
    .glightbox-clean .gslide-inner > * {
        max-width: calc(100vw - 2rem) !important;
    }
}

/* Alternative style: Add a subtle connecting line */
.glightbox-clean .gslide-media::after {
    content: '' !important;
    position: absolute !important;
    bottom: -1px !important;
    left: 0 !important;
    right: 0 !important;
    height: 1px !important;
    background: #e5e7eb !important;
    z-index: 1 !important;
}

/* Smooth animation for disclaimer */
.glightbox-clean .gslide-description {
    animation: disclaimerSlideUp 0.4s ease-out !important;
}

@keyframes disclaimerSlideUp {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Optional: Dark theme version (uncomment to use) */
/*
.glightbox-clean .gslide-description {
    background: #1f2937 !important;
    color: #f9fafb !important;
    border-color: #374151 !important;
}

.glightbox-clean .gslide-description p {
    color: #e5e7eb !important;
}

.glightbox-clean .gslide-media {
    border-color: #374151 !important;
}

.glightbox-clean .gslide-media::after {
    background: #374151 !important;
}
*/