html {
  scroll-behavior: smooth;
}

html, body {
  overscroll-behavior: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::-webkit-scrollbar {
  display: none;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #ffffff;
    padding-top: 30px;
    font-family: "Lato", sans-serif;
    font-weight: 340;
    font-style: normal;
}

.gallery {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 25px;
    padding-left: 330px;
}

/* CHANGED: .gallery div  →  #box */
#box {
    position: fixed;
    top: 65px;
    left: calc((100vw - 1400px) / 2 + 25px);
    text-align: right;
    width: 290px;
    padding-right: 20px;
    z-index: 1;
}

.gallery img {
    width: 100%;
    max-width: 100%;
    height: 250px;
    object-fit: cover;
}

#title_card {
    font-size: 38px;
    margin-top: 12px;
    margin-right: -3px;
}

#title_card:hover {
    cursor: default;
}

#top_text {
    margin-top: -30px;
}

.formatted_text {
    margin-top: -10px;
    display: block;
}

.formatted_text:hover {
    color: #E5383B;
    cursor: pointer;
}

/* Reset link styling */
a {
    color: inherit;
    text-decoration: none;
}

a:visited {
    color: inherit;
}

#top-image {
    width: 50%;
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
}

.gallery img[src*="instagram"] {
    width: 16px;
    height: auto;
}

.gallery img[src*="instagram"]:hover {
    cursor: pointer;
}

.gallery img[src*="house_logo"] {
    width: 38px;
    height: 38px;
    object-fit: contain;
    vertical-align: baseline;
    margin-right: 4px;
}

/* Portfolio page: iframe spans the full 3-column content area */
.portfolio-content {
    grid-column: 1 / -1;
}

.embed-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 65%; /* aspect ratio for the issuu embed */
}

.embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Resume page */
.resume-content {
    grid-column: 1 / -1;
}

.resume-content iframe {
    width: 100%;
    height: 85vh;
    border: none;
}

.download-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 14px;
    color: #555;
}

.download-link:hover {
    color: #E5383B;
}

/* Contact page */
.contact-content {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.profile-card .headshot {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
}

.profile-info p {
    font-size: 15px;
    color: #555;
    margin: 8px 0;
    text-align: center;
}

.profile-info a:hover {
    color: #E5383B;
}

/* Lightbox */
#lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

#lightbox-overlay.active {
    display: flex;
}

#lightbox-container {
    display: flex;
    max-width: 80vw;
    max-height: 80vh;
    background: #fff;
    overflow: hidden;
}

#lightbox-img {
    display: block;
    max-height: 80vh;
    width: auto;
    max-width: 60vw;
    object-fit: contain;
}

#lightbox-sidebar {
    width: 280px;
    min-width: 280px;
    padding: 32px 28px;
    display: flex;
    align-items: flex-start;
    overflow-y: auto;
}

#lightbox-desc {
    font-family: "Lato", sans-serif;
    font-size: 15px;
    font-weight: 340;
    color: #333;
    line-height: 1.6;
    margin: 0;
}

#lightbox-close {
    position: fixed;
    top: 18px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    z-index: 101;
    line-height: 1;
}

#lightbox-close:hover {
    color: #ccc;
}

#lightbox-prev,
#lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 48px;
    cursor: pointer;
    z-index: 101;
    padding: 8px 14px;
    line-height: 1;
}

#lightbox-prev { left: 16px; }
#lightbox-next { right: 16px; }

#lightbox-prev:hover,
#lightbox-next:hover {
    color: #ccc;
}

/* ══════════════════════════════════
   Mobile header & hamburger
   (hidden on desktop, shown on mobile)
   ══════════════════════════════════ */

.mobile-header {
    display: none;
}

.mobile-nav {
    display: none;
}

/* ══════════════════════════════════
   Responsive — tablets & phones
   ══════════════════════════════════ */

@media (max-width: 900px) {

    /* Show mobile header */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 50;
    }

    .mobile-logo {
        font-family: "Lato", sans-serif;
        font-size: 24px;
        font-weight: 340;
        color: inherit;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .mobile-logo img {
        width: 28px;
        height: 28px;
        object-fit: contain;
    }

    /* Hamburger button */
    .hamburger {
        background: none;
        border: none;
        cursor: pointer;
        padding: 4px;
        display: flex;
        flex-direction: column;
        gap: 5px;
        z-index: 51;
    }

    .hamburger span {
        display: block;
        width: 24px;
        height: 2px;
        background: #333;
        transition: transform 0.3s, opacity 0.3s;
    }

    .hamburger.open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .hamburger.open span:nth-child(2) {
        opacity: 0;
    }
    .hamburger.open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Mobile nav dropdown */
    .mobile-nav {
        display: block;
        max-height: 0;
        overflow: hidden;
        background: #fff;
        transition: max-height 0.3s ease;
        position: sticky;
        top: 60px;
        z-index: 49;
    }

    .mobile-nav.open {
        max-height: 200px;
    }

    .mobile-nav a {
        display: block;
        padding: 12px 20px;
        font-family: "Lato", sans-serif;
        font-size: 16px;
        font-weight: 340;
        color: #333;
        text-decoration: none;
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-nav a:hover {
        color: #E5383B;
    }

    /* Hide desktop sidebar */
    #box {
        display: none;
    }

    /* Reset gallery for mobile */
    body {
        padding-top: 0;
    }

    .gallery {
        padding-left: 20px;
        padding-right: 20px;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .gallery img {
        height: 180px;
    }

    /* Portfolio */
    .embed-wrapper {
        padding-bottom: 80%;
    }

    /* Resume */
    .resume-content iframe {
        height: 70vh;
    }

    /* Contact */
    .contact-content {
        min-height: auto;
        padding-top: 40px;
    }

    .profile-card .headshot {
        width: 160px;
        height: 160px;
    }

    /* Lightbox — stack vertically */
    #lightbox-container {
        flex-direction: column;
        max-width: 92vw;
        max-height: 85vh;
        overflow-y: auto;
    }

    #lightbox-img {
        max-width: 92vw;
        max-height: 55vh;
        width: 100%;
    }

    #lightbox-sidebar {
        width: 100%;
        min-width: unset;
        padding: 20px;
    }

    #lightbox-prev { left: 6px; font-size: 36px; }
    #lightbox-next { right: 6px; font-size: 36px; }
    #lightbox-close { top: 10px; right: 14px; font-size: 30px; }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: 1fr;
    }

    .gallery img {
        height: 220px;
    }

    .profile-card .headshot {
        width: 130px;
        height: 130px;
    }
}