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

body {
    font-family: "Volkhov", serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    max-width: 650px;
    margin: 0 auto;
    padding: 40px 20px;
    font-size: 18px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Full width for gallery page only */
body.gallery-full-width {
    max-width: 100%;
    padding: 0;
    margin: 0;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Typography */
h1 {
    font-size: 40px;
    font-weight: 500;
    margin-bottom: 8px;
    text-align: center;
}

h2 {
    font-size: 22px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
    color: #666;
}

h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

p {
    font-size: 16px;
    margin-bottom: 16px;
    color: #444;
}

a {
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #ddd;
    transition: border-color 0.2s;
}

a:hover {
    border-color: #333;
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 20px;
    right: 250px;
    display: flex;
    gap: 24px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.top-nav a {
    font-family: "Computer Modern Serif", serif;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: none;
    color: #666;
    transition: color 0.2s;
    text-decoration: none;
}

.top-nav a:hover {
    color: #333;
}

.top-nav a:first-child {
    color: #333;
    font-weight: 600;
}

/* Profile section */
.profile {
    text-align: center;
    margin-bottom: 20px;
}

.profile-image {
    width: 200px;
    height: 200px;
    margin: 0 auto 24px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #eee;
}

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

.bio {
    font-size: 18px;
    color: #666;
    margin-bottom: 16px;
    font-weight: 400;
}

.about-label {
    font-size: 28px;
    color: #000000ba;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    margin-bottom: 10px;
    margin-top: 20px;
}

/* Social links */
.social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 60px;
}

.social-label {
    font-size: 16px;
    color: #666;
    margin-right: 16px;
    font-family: "Volkhov", serif;
}

.social a {
    font-size: 20px;
    border-bottom: none;
    color: #666;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
}

.social a:hover {
    color: #333;
}

.social a i {
    font-size: 20px;
}

/* Sections */
section {
    margin-bottom: 80px;
    content-visibility: auto;
    contain-intrinsic-size: 500px;
}

.about {
    text-align: center;
    margin-bottom: 80px;
    margin-top: 0;
}

.about p {
    font-size: 18px;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

/* Gallery - Peter McKinnon Style */
.gallery-page {
    max-width: 100%;
    margin: 0;
    padding: 60px 40px 40px;
    width: 100%;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin: 0;
    background-color: #fff;
    width: 100%;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    background: #f0f0f0;
    aspect-ratio: 4/3;
    padding: 0;
    margin: 0;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.98) contrast(1.02);
    backface-visibility: hidden;
    opacity: 0;
    transform: scale(0.96) translateY(10px);
    will-change: transform, opacity;
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item img[data-load="false"] {
    background: #f0f0f0;
}

.gallery-item.loaded img {
    opacity: 1;
    transform: scale(1) translateY(0);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover img {
    transform: scale(1.03);
    filter: brightness(1) contrast(1.05);
    z-index: 10;
    transition: transform 0.3s ease, filter 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-overflow-scrolling: touch;
}

.gallery-page h1 {
    font-size: 48px;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
    color: #000;
    padding-left: 0;
    padding-right: 0;
}

.gallery-page p {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 40px;
}

/* Full width gallery container */
body.gallery-full-width main {
    max-width: 100%;
    padding: 0;
    margin: 0;
}

body.gallery-full-width .gallery-page {
    padding: 80px 0 40px 0;
}

body.gallery-full-width .gallery-page h1,
body.gallery-full-width .gallery-page p {
    padding-left: 40px;
    padding-right: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer */
footer {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #999;
}

/* Responsive design */
/* Laptop and smaller screens */
@media (max-width: 1024px) {
    body {
        max-width: 90%;
        padding: 30px 20px;
    }
    
    /* Gallery page stays full width */
    body.gallery-full-width {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .top-nav {
        right: 30px;
        gap: 20px;
    }
    
    .top-nav a {
        font-size: 13px;
    }
    
    h1 {
        font-size: 36px;
    }
    
    .profile-image {
        width: 180px;
        height: 180px;
    }
    
    .about-label {
        font-size: 26px;
    }
    
    .social a {
        width: 32px;
        height: 32px;
    }
    
    .social a i {
        font-size: 18px;
    }
    
    /* Gallery responsive for laptop */
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .gallery-page h1 {
        font-size: 36px;
    }
    
    body.gallery-full-width .gallery-page h1,
    body.gallery-full-width .gallery-page p {
        padding-left: 30px;
        padding-right: 30px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    body {
        max-width: 95%;
        padding: 60px 15px 20px 15px;
    }
    
    /* Gallery page stays full width */
    body.gallery-full-width {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .top-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        justify-content: center;
        margin-bottom: 30px;
        padding: 8px 12px;
        border-bottom: 1px solid #eee;
        background: rgba(255, 255, 255, 0.95);
        gap: 16px;
        z-index: 1000;
    }
    
    .top-nav a {
        font-size: 12px;
    }
    
    .profile {
        margin-top: 60px;
    }
    
    h1 {
        font-size: 32px;
    }
    
    .about-label {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .about p {
        font-size: 16px;
    }
    
    .profile-image {
        width: 160px;
        height: 160px;
    }
    
    .bio {
        font-size: 16px;
    }
    
    .social {
        flex-direction: row;
        gap: 15px;
        align-items: center;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .social-label {
        margin-right: 0;
        margin-bottom: 0;
        font-size: 15px;
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .social a {
        width: 30px;
        height: 30px;
    }
    
    .social a i {
        font-size: 16px;
    }
    
    /* Gallery responsive for tablet */
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .gallery-page h1 {
        font-size: 32px;
    }
    
    body.gallery-full-width .gallery-page h1,
    body.gallery-full-width .gallery-page p {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    body {
        padding: 80px 10px 15px 10px;
    }
    
    /* Gallery page stays full width */
    body.gallery-full-width {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    main {
        padding-top: 0;
    }
    
    .profile {
        margin-top: 80px;
    }
    
    h1 {
        font-size: 28px;
    }
    
    .about-label {
        font-size: 20px;
    }
    
    .about p {
        font-size: 15px;
    }
    
    .profile-image {
        width: 130px;
        height: 130px;
    }
    
    .bio {
        font-size: 15px;
    }
    
    .top-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        gap: 12px;
        flex-wrap: wrap;
        padding: 6px 10px;
        justify-content: center;
        z-index: 1000;
    }
    
    .top-nav a {
        font-size: 11px;
    }
    
    .social {
        gap: 12px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .social-label {
        font-size: 14px;
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
    }
    
    .social a {
        width: 28px;
        height: 28px;
    }
    
    .social a i {
        font-size: 14px;
    }
    
    /* Gallery responsive for mobile */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-page h1 {
        font-size: 28px;
    }
    
    body.gallery-full-width .gallery-page h1,
    body.gallery-full-width .gallery-page p {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
}

.lightbox-slideshow {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.lightbox-slideshow-wrapper {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.lightbox-slideshow-container {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease;
    will-change: transform;
}

.lightbox-slideshow-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-slideshow-slide img {
    max-width: 96vw;
    max-height: 96vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    transition: opacity 0.3s ease;
}

.close-lightbox {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #000000;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 2001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
    .close-lightbox {
        display: none;
    }
}

.lightbox.active .close-lightbox {
    opacity: 0.7;
}

.close-lightbox:hover {
    opacity: 1 !important;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 32px;
    color: #000;
    cursor: pointer;
    z-index: 2001;
    opacity: 0;
    transition: opacity 0.3s ease;
    user-select: none;
    background: none;
    border: none;
    padding: 10px 20px;
    font-weight: 300;
    line-height: 1;
}

.lightbox-nav:hover {
    opacity: 1 !important;
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}
