* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #1a1a1a;
    color: #ffffff;
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    padding: 20px;
}

/* Add spacing before h2 sections - scoped to contact page */
.contact-page h2 {
    margin-top: 15px;
    margin-bottom: 2px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Logo in header */
.header .logo {
    display: block;
    margin: 0 auto 12px;
    max-width: 220px;
    height: auto;
}

.header p {
    font-size: 1.2rem;
    color: #cccccc;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

/* Stacked gallery for single-artist pages (full-width images, rounded cards) */
.stacked-gallery {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 20px 0;
}

.stacked-card {
    background-color: #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.stacked-card img {
    width: 100%;
    height: auto; /* keep natural aspect ratio */
    display: block;
    object-fit: contain;
}

.image-card {
    background-color: #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

/* Image cards are anchors on index — don't show link underlines and keep card colors */
.image-card {
    text-decoration: none;
    color: inherit;
}

.image-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.image-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.card-content {
    padding: 20px;
}

.card-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffffff;
}

.card-description {
    color: #cccccc;
    font-size: 0.95rem;
    line-height: 1.5;
}

.image-info {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #888888;
}

/* Link styles - improved contrast on dark background */
a {
    color: #64b5f6; /* light blue - good contrast on dark background */
    text-decoration: underline;
}

a:visited {
    color: #4a90e2;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    max-width: 95%;
    max-height: 95%;
    width: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    background-color: #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.modal-image {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.modal-details {
    padding: 25px 30px;
    text-align: center;
    flex-shrink: 0;
    min-height: auto;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 12px;
    color: #ffffff;
}

.modal-description {
    font-size: 1rem;
    color: #cccccc;
    line-height: 1.5;
    margin-bottom: 12px;
}

.modal-info {
    font-size: 0.85rem;
    color: #888888;
    margin-bottom: 20px;
}

.modal-navigation {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.nav-btn {
    background-color: #404040;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s ease;
    min-width: 100px;
}

.nav-btn:hover:not(:disabled) {
    background-color: #555555;
}

.nav-btn:disabled {
    background-color: #2a2a2a;
    color: #666666;
    cursor: not-allowed;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

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

/* Return link with poulpe GIF - compact horizontal button that overlays the header */
.return-link {
    position: absolute;
    top: 14px;
    left: 12px;
    display: inline-flex;
    flex-direction: row; /* image and text on one line */
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #ffffff;
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 8px;
    border-radius: 6px;
    z-index: 999; /* sit above header text */
    box-shadow: 0 4px 8px rgba(0,0,0,0.35);
}

.return-link img {
    width: 50px;
    height: auto;
    margin: 0; /* inline with text */
    display: block;
}

.return-link:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: scale(1.03);
    transition: background 0.15s ease, transform 0.15s ease;
}

/* Keep header centered; the return button overlays on top-left */
.header {
    position: relative;
    z-index: 1;
    padding-left: 0; /* no offset needed, button overlays instead */
    text-align: center;
}

/* Override padding-left for index page to keep it centered */
body:not(.contact-page) .container > .header:not(:has(+ main > .stacked-gallery)) {
    padding-left: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Adjust return link and header layout on small screens */
    .return-link {
        top: 10px;
        left: 8px;
        padding: 6px 8px;
    }

    .return-link img {
        width: 28px;  /* Smaller on mobile */
    }

    .header {
        padding-left: 0;
        word-wrap: break-word;  /* Ensure long titles wrap properly */
        hyphens: auto;  /* Enable hyphenation for very long words */
    }
    
    .container {
        padding: 10px;
    }

    .modal.active {
        padding: 10px;
    }

    .modal-content {
        max-width: 98%;
        max-height: 98%;
    }

    .modal-image {
        max-height: 50vh;
    }

    .modal-details {
        padding: 15px 20px;
    }

    .modal-title {
        font-size: 1.3rem;
    }

    .modal-description {
        font-size: 0.9rem;
    }

    .modal-navigation {
        flex-direction: column;
        gap: 10px;
        margin-top: 10px;
    }

    .nav-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
        min-width: auto;
    }

    .close-btn {
        top: 10px;
        right: 15px;
        font-size: 1.5rem;
        width: 35px;
        height: 35px;
    }
}