/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Aleo', serif;
    background-color: white;
    color: #374151;
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Loading screen */
.loading-screen, .error-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content, .error-content {
    text-align: center;
    padding: 2rem;
}

.loading-text {
    font-size: 1.25rem;
    color: #6b7280;
}

.error-content h1 {
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1f2937;
}

.error-content p {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
    max-width: 32rem;
}

.retry-button {
    background-color: #2563eb;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Aleo', serif;
    transition: background-color 0.2s;
}

.retry-button:hover {
    background-color: #1d4ed8;
}

/* Header */
.header {
    width: 100%;
}

.hero-image {
    width: 100%;
    height: 24rem;
    overflow: hidden;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artist-info {
    padding: 3rem 0;
    text-align: center;
    background-color: white;
}

.artist-name {
    font-size: clamp(3rem, 8vw, 4.5rem);
    font-weight: 400;
    letter-spacing: 0.025em;
    margin-bottom: 0.5rem;
    color: #1f2937;
}



/* Bio section */
.bio-section {
    padding: 2rem 1.5rem;
    max-width: 56rem;
    margin: 0 auto;
}

.bio-container {
    text-align: left;
}

.bio-text {
    font-size: 1.25rem;
    line-height: 1.75;
    color: #374151;
    margin-bottom: 1.5rem;
}

.bio-text:last-child {
    margin-bottom: 0;
}

.contact-link {
    color: #1e40af;
    background-color: #eff6ff;
    padding: 0.25rem 0.5rem;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.2s;
}

.contact-link:hover {
    color: #1e3a8a;
    background-color: #dbeafe;
}

/* Paintings section */
.paintings-section {
    padding: 5rem 2rem;
}

.paintings-container {
    max-width: 80rem;
    margin: 0 auto;
}

/* Waterfall container */
.paintings-grid.waterfall-container {
    position: relative;
    width: 100%;
}

/* Painting item - now positioned absolutely by JavaScript */
.painting-item {
    position: absolute;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 0.625rem;
}

.painting-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    margin-bottom: 1rem;
}

.painting-image {
    width: 100%;
    height: auto;
    border-radius: 3px;
    transition: transform 0.3s ease;
}

.painting-item:hover .painting-image {
    transform: scale(1.05);
}

/* For Sale badge */
.for-sale-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background-color: black;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 3px;
    font-size: 1rem;
    font-weight: 500;
    z-index: 2;
}

/* Hover overlay */
.painting-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.3s ease;
    pointer-events: none;
}

.painting-item:hover .painting-overlay {
    background-color: rgba(0, 0, 0, 0.2);
}

/* Painting details */
.painting-details {
    text-align: center;
}

.painting-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.inquire-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #1e40af;
    background-color: #eff6ff;
    padding: 0.25rem 0.75rem;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.2s;
}

.inquire-link:hover {
    color: #1e3a8a;
    background-color: #dbeafe;
}

/* Load more and completion states */
.load-more, .all-loaded {
    margin-top: 3rem;
    text-align: center;
}

.load-more {
    height: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.load-more-text {
    color: #6b7280;
    font-size: 1rem;
}

.all-loaded-text {
    color: #4b5563;
    font-size: 1rem;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.lightbox.show {
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    z-index: 1001;
    padding: 0.5rem;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: #d1d5db;
}

.close-icon {
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
}

.lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-width: 95vw;
    max-height: 95vh;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 3px;
    cursor: pointer;
}

/* Body scroll lock when lightbox is open */
.body-scroll-lock {
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .paintings-section {
        padding: 3rem 1rem;
    }
    
    /* Waterfall layout is handled by JavaScript positioning */
    
    .bio-section {
        padding: 2rem 1rem;
    }
    
    .bio-text {
        font-size: 1.125rem;
    }
    
    .lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero-image {
        height: 20rem;
    }
    
    .artist-info {
        padding: 2rem 0;
    }
    
    .paintings-section {
        padding: 2rem 0.5rem;
    }
    
    .for-sale-badge {
        font-size: 0.875rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Smooth animations */
@media (prefers-reduced-motion: no-preference) {
    .painting-item {
        animation: fadeInUp 0.6s ease-out forwards;
        opacity: 0;
        transform: translateY(2rem);
    }
    
    .painting-item.animate {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(2rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* High contrast support */
@media (prefers-contrast: high) {
    .contact-link, .inquire-link {
        border: 1px solid currentColor;
    }
    
    .for-sale-badge {
        border: 1px solid white;
    }
    
    .painting-overlay {
        border: 1px solid rgba(255, 255, 255, 0.5);
    }
}

/* Shimmer skeleton */
.skeleton {
  position: relative;
  background: #f2f3f5;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.6) 50%, rgba(255,255,255,0) 100%);
  transform: translateX(-100%);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* Image fade-in */
.fade-in { opacity: 0; transition: opacity .35s ease; }
.fade-in.loaded { opacity: 1; }
