/* Base font size for rem calculations */
html {
    font-size: 16px;
    /* Base size for desktop */
    height: 100%;
    scroll-behavior: smooth;
}

/* Responsive rem adaptation - scales all rem units proportionally */
@media (max-width: 1200px) {
    html {
        font-size: 15px;
        /* Slightly smaller for tablets */
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
        /* Smaller for mobile devices */
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
        /* Even smaller for small mobile devices */
    }

    .logo {
        font-size: 1.6rem;
    }
}

@media (max-width: 320px) {
    html {
        font-size: 12px;
        /* Minimum size for very small screens */
    }
}

body {
    background: #fafafa;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
}

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.8s ease-out;
    transform: translateY(0);
    opacity: 1;
}

/* Breadcrumbs styles */
.breadcrumbs {
    background: #ffffff;
    padding: 5px 0;
    border-bottom: 1px solid #e5e5e5;
    margin-top: 80px;
}

.breadcrumb-nav {
    height: 36px;
    display: flex;
    gap: 25px;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.back-to-main {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f8f8f8;
    color: #333333;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.8s ease-out;
    font-weight: 500;
    font-size: 0.9rem;
}

.back-to-main:hover {
    background: #333333;
    color: #ffffff;
    transform: translateX(-5px);
}

.back-to-main i {
    font-size: 0.9rem;
    transition: transform 0.8s ease-out;
}

.back-to-main:hover i {
    transform: translateX(-3px);
}

.breadcrumb-path {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #666666;
}

.breadcrumb-path a {
    color: #666666;
    text-decoration: none;
    transition: color 0.8s ease-out;
}

.breadcrumb-path a:hover {
    color: #333333;
}

.breadcrumb-path i {
    font-size: 0.7rem;
    color: #999999;
}

.breadcrumb-path span {
    color: #333333;
    font-weight: 500;
}

/* Photoset-specific styles */
.photoset-hero {
    background: #ffffff;
    padding: 60px 20px 40px;
    text-align: center;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
}

.photoset-hero h1 {
    font-size: 3rem;
    font-weight: 400;
    color: #333333;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.photoset-hero p {
    font-size: 1.1rem;
    color: #666666;
    max-width: 600px;
    margin: 0 auto 20px;
    font-weight: 300;
}

.photoset-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 0.9rem;
    color: #999999;
    margin-top: 20px;
}

.photoset-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.photoset-container {
    background: #fafafa;
    padding: 60px 20px;
    min-height: 100vh;
}

/* Masonry Grid for photoset */
.photoset-grid {
    column-count: 4;
    column-gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.photo-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
    background: #ffffff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    break-inside: avoid;
}

.photo-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.photo-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.8s ease-out;
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.8s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.photo-overlay i {
    color: #ffffff;
    font-size: 2rem;
    transform: scale(0.8);
    transition: transform 0.8s ease-out;
}

.photo-item:hover .photo-overlay i {
    transform: scale(1);
}

/* Lightbox styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(20px);
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    /* max-width: 900px;
            max-height: 600px; */
    max-width: min(600px, 90vw);
    max-height: min(600px, 90vh);
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lightboxOpen 0.8s ease-out;
}

.lightbox img {
    /* max-width: 900px;
    max-height: 600px; */
    max-width: min(900px, 90vw);
    max-height: min(900px, 90vh);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    display: block;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: -50px;
    background: #333333;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.8s ease-out;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: #555555;
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #333333;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    padding: 15px 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.8s ease-out;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: #555555;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: -80px;
}

.lightbox-next {
    right: -80px;
}

.lightbox-counter {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    color: #333333;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

/* Add touch gesture support hints */
@media (hover: none) and (pointer: coarse) {
    .lightbox-nav:active {
        transform: translateY(-50%) scale(0.95);
        background: #666666;
    }

    .lightbox-close:active {
        transform: scale(0.95);
        background: #666666;
    }
}

/* Scroll to top button */
.scroll-to-top {
    background-color: #ff6b6b;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    position: fixed;
    bottom: 30px;
    right: 30px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    transition: all 0.8s ease-out;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
}

.scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background-color: #ff4757;
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.4);
}

.arrow-up {
    color: #fff;
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
    line-height: 1;
}

@media (max-width: 768px) {
    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }

    .arrow-up {
        font-size: 1.3rem;
    }
}

/* Footer styles */
.footer {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 50%, #111111 100%);
    color: #fff;
    padding: 30px 20px;
    text-align: center;
}

.footer-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
}

.footer p {
    font-size: 0.9rem;
    margin: 0;
}

@media (max-width: 768px) {
    .footer p {
        font-size: 0.85rem;
    }
}

@keyframes lightboxOpen {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive design */
@media (max-width: 1200px) {
    .photoset-grid {
        column-count: 3;
    }

    .lightbox-content {
        max-width: min(600px, 90vw);
        max-height: min(600px, 90vh);
    }

    .lightbox img {
        max-width: min(900px, 90vw);
        max-height: min(900px, 90vh);
    }
}

@media (max-width: 768px) {
    .photoset-hero {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 40px 20px 30px;
    }

    .photoset-hero h1 {
        font-size: 2.2rem;
    }

    .photoset-meta {
        flex-direction: column;
        gap: 10px;
    }

    .photoset-grid {
        column-count: 2;
        column-gap: 15px;
    }

    .photo-item {
        margin-bottom: 15px;
    }

    .breadcrumb-nav {
        flex-direction: column;
        justify-content: center;
        gap: 15px;
        align-items: flex-start;
    }

    .breadcrumb-path {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }

    /* Tablet lightbox adjustments */
    .lightbox {
        padding: 15px;
    }

    /* .lightbox-content { */
    /* max-width: min(500px, calc(100vw - 30px));
                max-height: min(500px, calc(100vh - 100px)); */
    /* } */

    /* .lightbox img { */
    /* max-width: min(500px, calc(100vw - 30px));
                max-height: min(500px, calc(100vh - 100px)); */
    /* } */

    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        padding: 10px;
    }

    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        padding: 12px 10px;
    }

    .lightbox-prev {
        left: 15px;
    }

    .lightbox-next {
        right: 15px;
    }

    .lightbox-counter {
        bottom: 25px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .photoset-grid {
        column-count: 1;
        column-gap: 0;
    }

    .photo-item {
        margin-bottom: 20px;
    }

    .photoset-container {
        padding: 40px 15px;
    }

    .breadcrumbs {
        padding: 10px 0;
    }

    .breadcrumb-nav {
        padding: 0 15px;
    }

    .breadcrumb-path {
        font-size: 0.75rem;
    }

    /* Mobile lightbox optimizations */
    .lightbox {
        padding: 10px;
    }

    .lightbox-content {
        /* max-width: min(400px, calc(100vw - 20px));
                max-height: min(400px, calc(100vh - 120px)); */
        width: auto;
        height: auto;
    }

    .lightbox img {
        /* max-width: min(400px, calc(100vw - 20px));
                max-height: min(400px, calc(100vh - 120px)); */
        width: auto;
        height: auto;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        padding: 8px;
        background: rgba(51, 51, 51, 0.9);
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        padding: 8px;
        background: rgba(51, 51, 51, 0.9);
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-counter {
        bottom: 15px;
        padding: 8px 16px;
        font-size: 0.85rem;
        background: rgba(255, 255, 255, 0.9);
    }

    /* Touch-friendly sizing for very small screens */
    .lightbox img {
        border-radius: 4px;
    }
}

@media (max-width: 320px) {

    /* Extra small screens - ensure controls are still accessible */
    .lightbox {
        padding: 5px;
    }

    .lightbox-content {
        max-width: min(300px, calc(100vw - 10px));
        max-height: min(300px, calc(100vh - 100px));
    }

    .lightbox img {
        max-width: min(300px, calc(100vw - 10px));
        max-height: min(300px, calc(100vh - 100px));
    }

    .lightbox-close {
        top: 5px;
        right: 5px;
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }

    .lightbox-nav {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }

    .lightbox-prev {
        left: 5px;
    }

    .lightbox-next {
        right: 5px;
    }

    .lightbox-counter {
        bottom: 10px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* Page entrance animation */
.page-enter {
    animation: pageEnter 0.8s ease-out;
}

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

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