* {
    color: white !important;
}

/* Elements on the light background use black text */
.profile-name,
.profile-sub,
.photography-section h2,
.art-section h2,
.gallery-heading,
.home-btn,
.gallery-nav-btn,
.gallery-topbar-title,
.see-all-link {
    color: black !important;
}

html {
    background: white;
}

body {
    background: transparent !important;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* Gingham background */
#bg {
    position: fixed;
    inset: 0;
    background: white;
    z-index: -1;
    pointer-events: none;
}

#bg-inner {
    position: fixed;
    width: 600vw;
    height: 600vw;
    top: -250vw;
    left: -250vw;
    transform: rotate(20deg);
    background-image: url('/images/gingham_tile.png');
    background-repeat: repeat;
    opacity: 0.6;
    pointer-events: none;
    z-index: -1;
}

/* --- Profile / Home page --- */

.profile-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 1rem;
}

.profile-image {
    max-width: 300px;
    flex-shrink: 0;
    order: 2;
}

.profile-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.profile-info {
    order: 1;
    text-align: center;
}

.profile-name {
    font-family: 'Caveat Brush', cursive;
    font-size: 6rem;
    line-height: 1;
    margin: 0;
    text-shadow: 1px 3px 8px rgba(0, 0, 0, 0.18);
}

.profile-sub {
    font-size: 1.5rem;
    opacity: 0.75;
    margin: 0.4rem 0 0;
    text-shadow: 1px 2px 5px rgba(0, 0, 0, 0.15);
}

@media (max-width: 576px) {
    .profile-header {
        gap: 1.25rem;
    }

    .profile-image {
        width: 45%;
        max-width: 180px;
    }

    .profile-name {
        font-size: 3rem;
    }

    .profile-sub {
        font-size: 1.2rem;
    }
}

.row {
    width: 100%;
}

.tile {
    display: flex;
    justify-content: center;
    width: 50%;
}

.card {
    background-color: #353535;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 80%;
}

.card-body {
    padding: 1rem;
    text-align: center;
}

.social-media-card {
    background-color: #71a0e57d;
    backdrop-filter: blur(8px);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    margin: 2rem auto;
    width: fit-content;
}

.social-media-card img {
    width: 40px;
    height: 40px;
    margin: 0 5px;
    transition: transform 0.3s;
}

.social-media-card img:hover {
    transform: scale(1.2);
}

.social-media-card a {
    text-decoration: none;
}

/* --- Photography / Art sections (home page previews) --- */

.photography-section,
.art-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(0, 0, 0, 0.15);
}

.photography-section h2,
.art-section h2 {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-shadow: 1px 2px 5px rgba(0, 0, 0, 0.15);
}

/* --- Gallery page heading --- */

.gallery-heading {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-shadow: 1px 2px 5px rgba(0, 0, 0, 0.15);
}

/* --- Photo grid (shared) --- */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    max-width: 900px;
    margin: 0 auto 1.25rem;
}

/* Full gallery: 4 columns on desktop */
.photo-grid--full {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1200px;
}

@media (max-width: 576px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .photo-grid--full {
        grid-template-columns: repeat(2, 1fr);
    }
}

.photo-grid-item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0.5rem;
    background-color: #353535;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.photo-grid-item:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
}

.photo-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-grid-item .placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #353535, #252525);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.see-all-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: rgba(0, 0, 0, 0.7) !important;
    text-decoration: none;
    font-size: 1.15rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.35);
    transition: color 0.2s, border-color 0.2s;
}

.see-all-link:hover {
    color: black !important;
    border-color: black;
}

/* Gallery page top bar */
.gallery-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    z-index: 100;
    background: #71a0e57d;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.gallery-nav {
    position: absolute;
    left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.home-btn {
    font-weight: bold;
    font-size: 1rem;
    text-decoration: none !important;
    background: none;
    border: none;
    padding: 0.15rem 0.4rem;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.home-btn:hover {
    opacity: 1;
}

.gallery-nav-btn {
    font-size: 0.85rem;
    font-weight: bold;
    text-decoration: none !important;
    padding: 0.15rem 0.5rem;
    border-radius: 0.3rem;
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
}

.gallery-nav-btn:hover {
    opacity: 1;
}

.gallery-nav-btn.active {
    background: white;
    opacity: 1;
}

.gallery-topbar-title {
    font-family: 'Caveat Brush', cursive;
    font-size: 1.8rem;
    line-height: 1;
    text-shadow: 1px 2px 5px rgba(0, 0, 0, 0.15);
}

@media (min-width: 577px) {
    .gallery-topbar {
        height: 5rem;
    }

    .gallery-topbar-title {
        font-size: 3.6rem;
    }

    .gallery-page .container {
        padding-top: 6rem !important;
    }
}

/* --- Modal --- */

.photo-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.photo-modal-overlay.active {
    display: flex;
}

.modal-viewport {
    width: 100vw;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.modal-track {
    display: flex;
    width: 300vw;
    will-change: transform;
}

.modal-slot {
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

.photo-modal-img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    display: block;
    user-select: none;
}

.modal-loading {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modal-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.45);
    border: none;
    color: white;
    font-size: 2rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1001;
}

.modal-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
}

.modal-arrow-left {
    left: 1rem;
    padding-bottom: 6px;
    padding-right: 9px;
}

.modal-arrow-right {
    right: 1rem;
    padding-bottom: 6px;
    padding-left: 9px;
}

.modal-arrow.hidden { display: none; }

.modal-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

@media (max-width: 768px) {
    .modal-arrow { display: none !important; }
}
