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

:root {
    --max-width: 1200px;
    --row-height: 340px; /* increased desktop row height for larger images */
}

body {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        line-height: 1.6;
        color: #333;
        background: #fff;
    }

    /* Navigation */
    header {
        background: #fff;
        padding: 1rem 2rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        position: fixed;
        width: 100%;
        top: 0;
        z-index: 1000;
    }

    nav {
        max-width: 1200px;
        margin: 0 auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo a {
        color: #333;
        text-decoration: none;
        font-size: 1.5rem;
        font-weight: bold;
    }

    .nav-links {
        list-style: none;
        display: flex;
        gap: 2rem;
    }

    .nav-links a {
        color: #333;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.3s ease;
    }

    .nav-links a:hover,
    .nav-links a.active {
        color: #666;
    }

    /* Dropdown styles */
    .dropdown {
        position: relative;
        display: inline-block;
    }

    .dropdown-content {
        display: none;
        position: absolute;
        background-color: #fff;
        min-width: 200px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        z-index: 1000;
        border-radius: 4px;
        padding: 0.5rem 0;
        margin-top: 0.5rem;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s, visibility 0.2s;
    }

    .dropdown-content li {
        display: block;
    }

    .dropdown-content a {
        color: #333;
        padding: 0.5rem 1rem;
        text-decoration: none;
        display: block;
        transition: background-color 0.3s ease;
    }

    .dropdown-content a:hover {
        background-color: #f5f5f5;
    }

    .dropdown:hover .dropdown-content {
        display: block;
        opacity: 1;
        visibility: visible;
    }

    .dropdown-content::before {
        content: '';
        position: absolute;
        top: -20px;
        left: 0;
        right: 0;
        height: 20px;
    }

    /* Main content */
    main {
        margin-top: 80px;
        padding: 2rem;
        min-height: calc(100vh - 160px);
    }

    /* Gallery: Masonry layout */
    .gallery {
        max-width: 1200px;
        margin: 0 auto;
        padding: 1rem;
    }

    .panorama-section {
        width: 100%;
        margin-bottom: 0;
        display: flex;
        justify-content: center;
    }

    .panorama-section .gallery-item {
        width: 100%;
        margin: 0;
        margin-bottom: 1rem;
    }

    .gallery-section {
        column-count: 3;
        column-gap: 1rem;
        margin-bottom: 4rem;
        position: relative;
    }

    .gallery-heading {
        font-size: 2.5rem;
        margin: 3rem 0 2rem;
        color: #333;
        text-align: center;
        font-weight: 500;
        letter-spacing: -0.02em;
    }

    .gallery-item {
        box-sizing: border-box;
        position: relative;
        cursor: pointer;
        overflow: visible;
        background: transparent;
        display: inline-block;
        width: 100%;
        margin-bottom: 1rem;
        break-inside: avoid;
        -webkit-column-break-inside: avoid;
        transform: scale(1);
        transition: transform 0.2s ease-in-out;
    }
    
    .gallery-item:hover {
        transform: scale(1.02);
        z-index: 1;
    }

    .gallery-item img {
        width: 100%;
        height: auto;
        display: block;
        max-width: 100%;
        object-fit: contain;
    }

    .panorama-section .gallery-item {
        width: 100%;
        margin-bottom: 2rem;
    }

    .panorama-section .gallery-item img {
        width: 100%;
        height: auto;
        display: block;
    }

    .gallery-item.pano {
        position: relative;
        display: block;
    }

    /* Row wrapper when JS groups items into rows */
    .gallery-row {
        display: flex;
        gap: 1rem;
        width: 100%;
        align-items: flex-start;
    }

    .gallery-row .gallery-item {
        /* Use a 6-column grid for precise spanning */
        /* This selector is kept for compatibility but actual spans set below */
        width: auto;
    }

/* Use grid layout inside each row to allow portrait=2, landscape=3 column spans */
.gallery-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.gallery-row .gallery-item.portrait {
    grid-column: span 2;
}

.gallery-row .gallery-item.landscape {
    grid-column: span 3;
}

/* Panorama rows (full-bleed to viewport) */
.gallery-row.pano-row {
    grid-template-columns: 1fr;
}

.gallery-row .gallery-item.pano {
    grid-column: 1 / -1;
    height: auto; /* allow taller panoramas to set their own height */
    padding: 0; /* remove internal spacing */
}

.gallery-item img {
    /* Restored: scale images by width and preserve original aspect ratio (no cropping). */
    width: 100%;
    height: auto; /* preserve aspect ratio */
    object-fit: contain;
    display: block;
    transition: transform 0.25s ease;
}

    .gallery-item.loading {
        background: #eee;
    }

    /* Lightbox */
    .lightbox {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255,255,255,0.95);
        z-index: 1001;
    }

    .lightbox.active {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .lightbox-content {
        max-width: 90%;
        max-height: 90vh;
        object-fit: contain;
    }

    .close {
        position: absolute;
        top: 20px;
        right: 30px;
        color: #333;
        font-size: 40px;
        cursor: pointer;
        z-index: 1002;
    }

    /* Contact Form */
    .contact-container {
        max-width: 600px;
        margin: 0 auto;
        padding: 2rem;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }

    label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
    }

    input,
    textarea {
        width: 100%;
        padding: 0.5rem;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 1rem;
    }

    textarea {
        min-height: 150px;
        resize: vertical;
    }

    button {
        background: #333;
        color: #fff;
        padding: 0.75rem 1.5rem;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 1rem;
        transition: background 0.3s ease;
    }

    button:hover {
        background: #555;
    }

    /* About Text Box */
    .about-container {
        max-width: 900px;
        margin: 0 auto;
        padding: 1rem;
    }

    .about-text {
        border: 2px solid #bbb;
        border-radius: 12px;
        background: #fafafa;
        padding: 2rem 2.5rem;
        max-width: 700px;
        margin: 2rem auto 0 auto;
        box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    }

    .about-photo-wrapper {
        display: flex;
        justify-content: center;
        margin-bottom: 1.5rem;
    }

    .about-photo {
        width: 100%;
        max-width: 600px; /* allow larger on wide screens */
        height: auto;     /* preserve aspect ratio */
        object-fit: contain; /* show the whole photo without cropping */
        border-radius: 8px;
        border: 3px solid #bbb;
        box-shadow: 0 2px 12px rgba(0,0,0,0.08);
        background: #eee;
        display: block;
    }

    @media (max-width: 500px) {
        .about-photo {
            width: 95vw;
            height: 95vw;
            max-width: 100%;
            max-height: 100vw;
        }
    }

    /* Responsive */
    @media (max-width: 1200px) {
        .gallery-section {
            column-count: 2;
        }
    }

    @media (max-width: 900px) {
        .gallery-section {
            column-count: 2;
        }
    }

    @media (max-width: 768px) {
        nav {
            flex-direction: column;
            gap: 1rem;
        }

        .nav-links {
            gap: 1rem;
        }

        .gallery-section {
            column-count: 1;
        }

        .gallery-heading {
            font-size: 1.75rem;
            margin: 2rem 0 1.5rem;
        }
    }

    .gallery-item .img-protect {
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100%;
        height: 100%;
        z-index: 2;
        background: transparent;
        pointer-events: auto;
    }

    /* Footer styles */
    footer {
        background: #fafafa;
        padding: 2rem 0;
        text-align: center;
        border-top: 1px solid #ddd;
    }

    .footer-links {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
        margin-top: 1rem;
    }

    .footer-email {
        color: #333;
        text-decoration: underline;
        font-weight: 500;
        font-size: 1.1rem;
        transition: color 0.2s;
    }
    .footer-email:hover {
        color: #666;
    }

    .footer-instagram-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: opacity 0.2s;
    }
    .footer-instagram-link:hover {
        opacity: 0.8;
    }

    .footer-instagram-svg {
        width: 32px;
        height: 32px;
        display: block;
    }

    /* Thank You Page Styles */
    .thanks-section {
        max-width: 600px;
        margin: 4rem auto;
        text-align: center;
        padding: 2rem;
    }

    .thanks-section h1 {
        margin-bottom: 1rem;
        color: #333;
    }

    .thanks-section p {
        margin-bottom: 2rem;
        color: #666;
    }

    .back-button {
        display: inline-block;
        padding: 0.8rem 1.5rem;
        background-color: #333;
        color: white;
        text-decoration: none;
        border-radius: 4px;
        transition: background-color 0.3s ease;
    }

    .back-button:hover {
        background-color: #555;
    }