/* ================================
   GLOBAL STYLES
   ================================ */

   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "lft-etica-mono", sans-serif;
}

body, 
.modal,
.gallery-item:hover,
.gallery-item.highlighted {
    background: #fff;
    color: rgb(0, 0, 0);
    overflow-x: hidden;
    transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Night mode */
body.night-mode,
body.night-mode .modal,
body.night-mode .gallery-item:hover,
body.night-mode .gallery-item.highlighted {
    background-color: #000;
    color: #ebff78;
}

body.night-mode span {
    color: #ebff78;
}

/* Disable transitions during page load */
.no-transition,
.no-transition *,
.no-transition *:before,
.no-transition *:after {
    transition: none !important;
    animation-duration: 0s !important;
}

/* Remove all focus outlines */
*:focus,
*:active,
button:focus,
button:active {
    outline: none !important;
}

/* ================================
   TYPOGRAPHY
   ================================ */

p {
    font-weight: 200;
    font-size: 12px;
}

span {
    color: #000000;
    transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 200;
    font-size: 12px;
}

strong {
    font-weight: 200;
    font-size: 12px;
}

/* Modal text styles */
.modal-title {
    font-weight: 400;
}

.modal-label {
    font-weight: 400 !important;
}

/* Intro section */
.intro {
    margin-bottom: 60px;
}

.intro h1 {
    font-size: 14px;
    font-weight: 200;
    line-height: 1.1;
    margin-bottom: 20px;
    max-width: 700px;
}

.intro p {
    font-weight: 200;
    font-size: 14px;
    line-height: 1.6;
    color: #999;
}

/* ================================
   LINKS
   ================================ */

a {
    color: #000000;
    text-decoration: none;
    transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover {
    color: #c9c9c9;
}

a.gallery-link {
    color: #c9c9c9;
}

a.gallery-link:hover {
    color: #000000;
}

/* Night mode links */
body.night-mode a {
    color: #ebff78;
}

body.night-mode a:hover {
    color: #373737;
}

body.night-mode a.gallery-link {
    color: #373737;
}

body.night-mode a.gallery-link:hover {
    color: #ebff78;
}

/* ================================
   LAYOUT STRUCTURE
   ================================ */

.container {
    display: flex;
}

.left-panel {
    width: 40%;
    padding: 20px 0 20px 20px;
    flex-direction: column;
    display: flex;
    min-height: 100vh;
}

.left-panel .left-bottom {
    margin-top: auto;
}

.right-panel {
    width: 60%;
    position: relative;
    min-height: 100vh;
}

/* ================================
   BUTTONS
   ================================ */

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-weight: 200;
}

/* Home Button */
.home-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1200;
    mix-blend-mode: difference;
    background: transparent;
}

/* Fiddle Button & Menu */
.fiddle-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background-color: rgb(0, 0, 0);
    color: #ffffff;
    padding: 2px 2px;
    mix-blend-mode: difference;
    isolation: isolate;
}

body.modal-open .fiddle-button {
    display: none;
}

.fiddle-menu {
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 500;
    display: none;
    flex-direction: column;
    gap: 10px;
    min-width: 150px;
    filter: invert(1);
    background-color: rgb(255, 255, 255);
    color: rgb(0, 0, 0);
    padding: 8px 12px;
    mix-blend-mode: difference;
    isolation: isolate;
}

.fiddle-menu.open {
    display: flex;
}

.fiddle-menu-item {
    background: none;
    border: none;
    text-align: left;
}

/* Next Button */
.next-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1200;
    background-color: rgb(0, 0, 0);
    color: #ffffff;
    padding: 2px 2px;
    mix-blend-mode: difference;
    isolation: isolate;
    display: none;
}

body.modal-open .next-button {
    display: block;
}

/* ================================
   GALLERY SECTION
   ================================ */

.gallery-section {
    margin-bottom: 20px;
    color: #c9c9c9;
}

.gallery-header {
    font-size: 13px;
    font-weight: 200;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 10px;
}

body.modal-open .gallery-header {
    color: #c9c9c9;
}

body.modal-open .gallery-header:hover {
    color: #000000;
}

body.night-mode.modal-open .gallery-header {
    color: #373737;
}

body.night-mode.modal-open .gallery-header:hover {
    color: #ebff78;
}

.gallery-lists {
    display: flex;
    justify-content: space-between;
}

.gallery-list {
    flex: 1;
}

.gallery-list:nth-child(2) {
    text-align: right;
}

.gallery-list:nth-child(2) .gallery-item {
    text-align: right;
}

/* Gallery items */
.gallery-item {
    font-size: 13px;
    font-weight: 200;
    line-height: 1.3;
    margin-bottom: 0;
    transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    display: block;
    width: 100%;
    color: #c9c9c9;
}

body.night-mode .gallery-item {
    color: #373737;
}

/* ================================
   CONTACT SECTION
   ================================ */

.contact-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.contact-left {
    display: flex;
    gap: 20px;
    font-weight: 200;
    align-items: flex-start;
}

.contact-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-link {
    font-size: 13px;
    font-weight: 200;
    text-transform: uppercase;
}

/* ================================
   IMAGE GALLERY
   ================================ */

.image-gallery {
    height: 100vh;
    overflow-y: auto;
    padding: 20px;
}

.image-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.image-placeholder {
    aspect-ratio: 8/5;
    cursor: zoom-in;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    position: relative;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    background-color: #f5f5f5;
}

.image-placeholder.landscape {
    background-size: cover;
}

.image-placeholder.portrait {
    background-size: contain;
}

.image-placeholder.has-video iframe {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Slideshow arrows */
.slideshow-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    opacity: 0;
    background-color: transparent;
    z-index: 10;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.slideshow-arrow svg {
    width: 20px;
    height: 20px;
}

.slideshow-arrow.left {
    left: 10px;
}

.slideshow-arrow.right {
    right: 10px;
}

.image-placeholder:hover .slideshow-arrow {
    opacity: 1;
}

/* ================================
   MODAL
   ================================ */

.modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 60%;
    height: 100vh;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    padding: 20px;
}

.modal-gallery {
    margin-top: 20px;
}

.modal-gallery-image {
    width: 100%;
    font-size: 12px;
    margin-top: 15px;
    cursor: zoom-in;
}

.modal-gallery-video {
    aspect-ratio: 16/9;
}

.modal-image.has-video iframe,
.modal-gallery-video iframe {
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

body.modal-open .fiddle-menu .fiddle-menu-item:first-child {
    display: none;
}

/* ================================
   TABLET
   ================================ */

@media (max-width: 1024px) and (min-width: 769px) {
    .left-panel {
        width: 40%;
    }

    .right-panel {
        width: 60%;
    }

    .modal {
        width: 60%;
    }
}

/* ================================
   MOBILE
   ================================ */

@media (max-width: 768px) {
    .home-button {
        top: 35px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        z-index: 1200;
    }

    .contact-links span {
        display: none;
    }
    
    .container {
        flex-direction: column;
        height: auto;
    }

    .left-panel {
        width: 100%;
        min-height: auto;
        position: relative;
        padding: 120px 20px 20px 20px;
    }

    .right-panel {
        width: 100%;
    }

    .intro {
        margin-bottom: 30px;
    }

    .intro h1 {
        font-size: 16px;
    }

    .intro p {
        font-size: 16px;
    }

    .image-gallery {
        height: 100%;
        overflow-y: unset;
    }

    .image-grid {
        grid-template-columns: 1fr !important;
    }

    .gallery-section {
        display: none;
    }

    .contact-section {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
    }

    .contact-links {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0;
    }

    .contact-left {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .contact-links p {
        display: none;
    }

    .contact-link {
        font-size: 25px;
        font-weight: 200;
        text-decoration: none;
        text-transform: uppercase;
        margin-bottom: 0;
    }

    .contact-right {
        margin-top: 10px;
    }

    .modal {
        width: 100%;
        flex-direction: column;
    }

    .modal-content {
        padding: 120px 20px 20px 20px;
    }

    .fiddle-menu .fiddle-menu-item:first-child {
        display: none;
    }

    /* Override all text to 16px on mobile */
    *, 
    p, 
    span, 
    strong, 
    a, 
    button,
    .modal-title,
    .modal-label,
    .gallery-item,
    .fiddle-menu-item,
    .home-button {
        font-size: 16px;
    }
}
/* ================================
   LIGHTBOX - UPDATED
   ================================ */
   .lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: black;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 60px 60px 60px; /* Add padding to prevent touching edges */
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* This ensures the image maintains aspect ratio */
    display: block;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    z-index: 2001;
    padding: 10px;
    line-height: 1;
}

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

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    padding: 20px;
    z-index: 2001;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

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

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

/* Mobile lightbox styles */
@media (max-width: 768px) {
    .lightbox {
        padding: 40px 20px; /* Reduce padding on mobile */
    }
    
    .lightbox-close {
        top: 20px;
        right: 20px;
        font-size: 24px;
    }

    .lightbox-nav {
        font-size: 30px;
        padding: 15px;
    }

    .lightbox-prev {
        left: 20px;
    }

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

.lightbox-nav svg {
    display: block;
    width: 36px;
    height: 36px;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    background: none;
    border: none;
    cursor: pointer;
    padding: 20px;
    z-index: 2001;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    opacity: 1;
}

.lightbox-close {
    top: 30px;
    right: 30px;
}

.lightbox-close svg,
.lightbox-nav svg {
    display: block;
    width: 36px;
    height: 36px;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}