/* Shared styles for all project subpages */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
}

html {
    scroll-behavior: smooth;
}

p {
    color: rgb(85, 85, 85);
}

/* TRANSITIONS */
a,
.button {
    transition: all 300ms ease;
}

/* DESKTOP NAV */
nav,
.nav-links {
    display: flex;
}

nav {
    justify-content: space-around;
    height: 4vh;
    margin-top: 2rem;
}

.nav-links {
    gap: 2rem;
    list-style: none;
    font-size: 1.5rem;
}

a {
    color: black;
    text-decoration: none;
    text-decoration-color: white;
}

a:hover {
    color: grey;
    text-decoration: underline;
    text-underline-offset: 1rem;
    text-decoration-color: rgb(181, 181, 181);
}

.name-logo {
    font-size: 2rem;
}

.name-logo:hover {
    cursor: default;
}

/* HAMBURGER MENU */
#hamburger-nav {
    display: none;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    background-color: white;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#hamburger-nav .hamburger-menu {
    display: flex;
    align-items: center;
    height: auto;
}

.menu-links {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    width: fit-content;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 0 0 0.5rem 0.5rem;
}

.menu-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-links a {
    display: block;
    padding: 1rem 2rem;
    text-align: left;
    font-size: 1.2rem;
    color: black;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.menu-links a:hover {
    background-color: #f0f0f0;
}

.menu-links.open {
    max-height: 500px; /* Adjust as needed */
}

 .hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 24px;
  width: 30px;
  cursor: pointer;
}

.hamburger-icon span {
  width: 100%;
  height: 3px;                /* slightly thicker for better visibility */
  background-color: black;
  transition: all 0.3s ease-in-out;
  border-radius: 2px;        /* soft rounded edges */
}

.hamburger-icon.open span:first-child {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-icon.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);       /* optional: adds a collapsing effect */
}

.hamburger-icon.open span:last-child {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Ensure section arrow buttons are consistently placed */
.arrow {
    position: absolute;
    right: 2rem;
    bottom: 1rem; /* sit 1rem above section bottom */
    display: block;
    width: 3rem;
    height: auto;
    max-height: 3rem;
    cursor: pointer;
    z-index: 5;
}

/* TYPOGRAPHY */
.title {
    font-size: 3rem;
    text-align: center;
    margin: 0rem 0;
}

.section__text__p1 {
    text-align: center;
    font-size: 1.5rem;
    margin: 1rem 0;
}

/* PROJECT PAGE STYLES */
section {
    padding-top: 4vh;
    min-height: fit-content;
    box-sizing: border-box;
    margin: 0 10rem;
}

body > nav#hamburger-nav ~ section {
    margin-top: 7vh;
    margin-left: 10rem;
    margin-right: 10rem;
}

.project-hero {
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
}

.project-hero img {
    max-width: 90%;
    max-height: 100%;
    object-fit: contain;
}

.project-details {
    margin: 3rem 0;
    line-height: 1.8;
}

.project-section {
    margin: 2rem 0;
}

.project-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: rgb(0, 102, 204);
}

.project-section ul {
    margin-left: 2rem;
    color: rgb(85, 85, 85);
}

.project-section ul li {
    margin-bottom: 0.5rem;
}

.project-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.project-images img {
    width: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
}

/* Full-width centered project image inside the .project-images grid */
.project-image-full {
    grid-column: 1 / -1;
    text-align: center;
    margin: 3rem 0;
}

.project-image-full img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: inline-block;
}

.back-button {
    margin: 2rem 0;
    display: inline-block;
    color: rgb(0, 102, 204);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.back-button:hover {
    text-decoration: underline;
    text-underline-offset: 0.5rem;
}

/* FOOTER */
footer {
    height: 26vh;
    margin: 0 1rem;
}

footer p {
    text-align: center;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    #desktop-nav {
        display: none;
    }

    #hamburger-nav {
        display: flex;
    }

    body {
        padding-top: 8vh; /* Adjust based on hamburger nav height */
    }

    .title {
        font-size: 2rem;
    }

    .project-section h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 600px) {
    .project-images {
        grid-template-columns: 1fr;
    }

    .project-hero {
        height: 40vh;
    }

    .title {
        font-size: 1.5rem;
    }

    .section__text__p1 {
        font-size: 1.25rem;
    }

    .project-section h3 {
        font-size: 1.1rem;
    }

    section {
        margin: 0 1rem;
    }
}

/* LIGHTBOX MODAL */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-modal-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 98%;
    max-width: none;
    height: 90vh;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    animation: zoomIn 0.3s ease-in-out;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    z-index: 1002;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: rgb(0, 102, 204);
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    padding: 1rem;
    transition: color 0.3s ease;
    z-index: 1001;
}

.lightbox-arrow:hover {
    color: rgb(0, 102, 204);
}

.lightbox-prev {
    left: 10px;
}

.lightbox-next {
    right: 10px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.project-images img {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.project-images img:hover {
    opacity: 0.8;
}

@media (max-width: 600px) {
    .lightbox-arrow {
        font-size: 2rem;
        padding: 0.5rem;
    }

    .lightbox-close {
        font-size: 2rem;
        right: 10px;
        top: 10px;
    }

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

@media (max-width: 360px) {
    /* Fix body and html overflow */
    html {
        overflow-x: hidden;
        width: 100vw;
    }

    body {
        overflow-x: hidden;
        width: 100vw;
        margin: 0;
        padding: 0;
    }

    /* Navigation - small floating hamburger in corner */
    nav#hamburger-nav {
        display: none;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        padding: 1rem 2rem;
        background-color: white;
        z-index: 100;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    #desktop-nav {
        display: none !important;
    }

    .name-logo {
        display: none;
    }

    .hamburger-position {
        display: flex;
        justify-content: center;
        align-items: center;
        width: fit-content;
    }

    /* Main content spacing */
    section {
        margin: 0 !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 1.5vh !important;
        max-width: 100vw !important;
        width: 100vw !important;
        box-sizing: border-box !important;
        height: auto !important;
    }

    body > section:first-of-type {
        margin-top: 6vh;
        padding-top: 1rem !important;
    }

    /* Typography */
    .title {
        font-size: 1.5rem;
        margin: 1rem 0;
    }

    .section__text__p1 {
        font-size: 1rem;
        margin: 0.5rem 0;
    }

    /* Project hero */
    .project-hero {
        height: 30vh;
        margin: 1rem 0;
    }

    .project-hero img {
        max-width: 95%;
        max-height: 100%;
    }

    /* Project details */
    .project-details {
        margin: 1.5rem 0;
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .project-section {
        margin: 1.5rem 0;
    }

    .project-section h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .project-section ul {
        margin-left: 1.5rem;
        font-size: 0.9rem;
    }

    .project-section ul li {
        margin-bottom: 0.4rem;
    }

    /* Project images grid - single column */
    .project-images {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0;
        width: 100%;
    }

    .project-images img {
        width: 100%;
        height: auto;
        border-radius: 0.3rem;
    }

    .back-button {
        margin: 1rem 0;
        font-size: 0.95rem;
    }

    /* Lightbox for small screens */
    .lightbox-modal-content {
        width: 95%;
        height: 70vh;
    }

    .lightbox-arrow {
        font-size: 1.5rem;
        padding: 0.25rem;
    }

    .lightbox-close {
        font-size: 1.5rem;
        right: 5px;
        top: 5px;
    }

    .lightbox-counter {
        font-size: 0.8rem;
        padding: 0.25rem 0.6rem;
        bottom: 5px;
    }

    /* Footer */
    footer {
        height: auto;
        padding: 1rem 1rem !important;
        width: 100vw;
        margin: 0 !important;
        box-sizing: border-box;
    }

    footer p {
        font-size: 0.9rem;
    }
}

/* ----------------------------------------------------------
   Fix subpage margins and layout on phones/tablets
   override inline section margins and tighten spacing
   ---------------------------------------------------------- */
@media (max-width: 900px) {
    /* Override inline margins on <section> in project pages */
    section {
        margin: 0 1.5rem !important;
        padding-top: 3vh !important;
    }

    body > nav#hamburger-nav ~ section {
        margin-top: 7vh;
        margin-left: 1.5rem !important;
        margin-right: 1.5rem !important;
    }

    .project-hero {
        height: auto !important;
        margin: 1rem 0;
    }

    .project-hero img {
        max-width: 100%;
        height: auto;
    }

    .project-details {
        margin: 1.5rem 0;
    }

    footer {
        margin: 0 1rem !important;
    }
}

@media (max-width: 600px) {
    /* Tighter margins for small phones */
    section {
        margin: 0 0.75rem !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    body > nav#hamburger-nav ~ section {
        margin-left: 0.75rem !important;
        margin-right: 0.75rem !important;
    }

    .project-hero {
        height: auto !important;
        margin: 0.75rem 0;
    }

    .project-details {
        margin: 1rem 0;
        line-height: 1.5;
    }
}

@media screen and (max-width: 1200px) {
    nav, .nav-links {
        display: none;
    }
    #hamburger-nav {
        display: flex;
    }
    body {
        padding-top: 8vh; /* Add padding to body to prevent content from being hidden behind the fixed nav */
    }
}
