/* --- Common / Reset --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #fdf8f6;
}

::-webkit-scrollbar-thumb {
    background: #dccac6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a68a84;
}

/* --- Home Page (index.html) --- */
body.home-page {
    background-color: #FDF8F6;
    color: #44403C;
}

.fade-in {
    animation: fadeIn 0.8s ease-in;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Details Page (details.html) --- */
body.details-page {
    font-family: 'Lato', sans-serif;
    margin: 0;
    padding: 20px;
    background: #f9f9f9;
}

/* Scoped Header Elements for Details Page */
.details-page header {
    max-width: 1000px;
    margin: 0 auto 40px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 20px;
}

.details-page .back-link {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    font-size: 1.1em;
}

.details-page .back-link:hover {
    color: #007bff;
}

.details-page h1 {
    font-family: 'Playfair Display', serif;
    margin: 0;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 3;
}

/* Header Banner Structure */
.header-banner {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    display: none;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(33, 33, 33, 0.7);
    z-index: 2;
    display: none;
}

/* State: Has Image */
.header-banner.has-image {
    height: 300px;
}

.header-banner.has-image .header-image,
.header-banner.has-image .header-overlay {
    display: block;
}

.header-banner.has-image h1 {
    color: white;
}

/* Grid Layout for Artworks */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Artwork Card Styling */
.art-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.art-card:hover {
    transform: translateY(-5px);
}

.art-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background-color: #eee;
}

.art-info {
    padding: 15px;
}

.art-title {
    margin: 0 0 5px;
    font-family: 'Playfair Display', serif;
    font-size: 1.2em;
    color: #222;
}

.art-desc {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.price {
    font-family: 'Playfair Display', serif;
    font-weight: bold;
    color: #2ecc71;
    font-size: 1.1em;
    display: block;
    margin-top: 10px;
}

.price.sold {
    color: #555;
    text-decoration: line-through;
}

/* Message when no category is found */
.error-message {
    text-align: center;
    color: #666;
    font-size: 1.2em;
    margin-top: 50px;
}

/* The Modal (background) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.9);
}

/* Modal Content (image) */
.modal-images-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    width: 90%;
    max-width: 1200px;
    margin: auto;
    height: 80vh;
    overflow-y: auto;
}

.modal-content {
    max-height: 100%;
    object-fit: contain;
    border-radius: 15px;
    transition: transform 0.3s;
    animation-name: zoom;
    animation-duration: 0.6s;
}

/* Single Image Mode */
.modal-images-container.single .modal-content {
    max-width: 90%;
}

/* Dual Image Mode */
.modal-images-container.dual .modal-content {
    max-width: 48%;
    max-height: 90%;
}

/* Triple & Quad Image Mode (2x2 Grid) */
.modal-images-container.triple .modal-content,
.modal-images-container.quad .modal-content {
    width: 45%;
    max-width: 45%;
    max-height: 45%;
    margin: 5px;
    object-fit: contain;
}

@keyframes zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

/* The Close Button */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* 100% Image Width on Smaller Screens */
@media only screen and (max-width: 700px) {
    .modal-content {
        width: 100%;
    }
}

/* New Sold Label Style */
.sold-label {
    color: #e74c3c;
    /* Red color for visibility */
    font-weight: bold;
    font-size: 1em;
    margin-top: 5px;
    font-family: 'Lato', sans-serif;
}