/* Theme Improvements for Aracelis Entebi Art Gallery */
/* This file contains fixes for image cropping and enhanced light/dark theme support */

/* ===============================================
   SHIPPING CALCULATOR SECTION
   =============================================== */

.shipping-section {
    background: var(--secondary-bg, rgba(26, 71, 42, 0.3));
    padding: 5rem 0;
}

.shipping-calculator-widget {
    max-width: 640px;
    margin: 0 auto;
    background: var(--card-bg, rgba(255,255,255,0.05));
    border: 1px solid var(--card-border, rgba(255,255,255,0.1));
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.shipping-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.shipping-form .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--accent, #6dbf7b);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.shipping-form select {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--input-bg, rgba(0,0,0,0.3));
    border: 1px solid var(--card-border, rgba(255,255,255,0.15));
    border-radius: 8px;
    color: var(--text, #f5f5f5);
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.shipping-form select:focus {
    outline: none;
    border-color: var(--accent, #6dbf7b);
}

.shipping-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--card-bg, rgba(255,255,255,0.04));
    border: 1px solid var(--accent, #6dbf7b);
    border-radius: 12px;
    animation: fadeInUp 0.4s ease;
}

.shipping-result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dhl-logo-sm {
    height: 28px;
    width: auto;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

.shipping-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted, #aaa);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shipping-cost-display {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--accent, #6dbf7b);
    margin-bottom: 0.5rem;
}

.delivery-info {
    font-size: 0.95rem;
    color: var(--text-muted, #aaa);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.shipping-note {
    font-size: 0.82rem;
    color: var(--text-muted, #888);
    font-style: italic;
    border-top: 1px solid var(--card-border, rgba(255,255,255,0.08));
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===============================================
   GALLERY IMAGE FIX - Prevent Top/Bottom Cropping
   =============================================== */

/* Fix the main gallery image cropping issue */
.gallery-item img {
    width: 100%;
    height: 280px; /* Increased height to better accommodate paintings */
    object-fit: contain !important; /* Changed from cover to contain to show full image */
    object-position: center;
    background: var(--card-bg);
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    padding: 8px; /* Add padding to prevent edge cutting */
    box-sizing: border-box;
}

/* Adjust gallery item to accommodate the new image sizing */
.gallery-item {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        0 1px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(5px);
    border: 1px solid var(--card-border);
    min-height: 420px; /* Ensure consistent card heights */
}

/* Ensure hover effects work properly with the new image sizing */
.gallery-item:hover img {
    transform: scale(1.02); /* Reduced scale to prevent overflow issues */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===============================================
   RESPONSIVE IMPROVEMENTS
   =============================================== */

@media (max-width: 768px) {
    .gallery-item img {
        height: 220px; /* Adjust for mobile */
    }
    
    .gallery-item {
        min-height: 360px;
    }
}

@media (max-width: 480px) {
    .gallery-item img {
        height: 200px;
        padding: 6px;
    }
    
    .gallery-item {
        min-height: 340px;
    }
}

/* ===============================================
   ACCESSIBILITY IMPROVEMENTS
   =============================================== */

/* Focus states for keyboard navigation */
.gallery-item:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .gallery-item img {
        transition: none;
    }
    
    .gallery-item:hover img {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gallery-item {
        border: 2px solid var(--primary-text);
    }
}

/* ===============================================
   PERFORMANCE OPTIMIZATIONS
   =============================================== */

/* GPU acceleration for smooth animations */
.gallery-item,
.gallery-item img {
    will-change: transform;
    backface-visibility: hidden;
}

/* Optimize repaints */
.gallery-item:hover {
    contain: layout style paint;
}