:root {
    --bg-color: #fff;
    --text-main: #3b2621;
    --link-color: #5a364d;
    --title-color: #e6b2c2;
    --image-border: #ffffff;
    --symbol-color: #5a3e36;
    --icon-filter: invert(1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-main: #e0e0e0;
        --link-color: #a5dee8;
        --title-color: #e6b2c2;
        --image-border: #333333;
        --symbol-color: #e6b2c2;
        --icon-filter: invert(0);
    }
}

/* Basic Reset to clear browser defaults */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color); 
    font-family: sans-serif; 
    height: 100vh; 
    display: flex;
    flex-direction: column; 
    /* min-width: 1100px; */
    overflow-x: hidden;
}

.background img {
    width: 100svw;
    height: 100svh;
    object-fit: cover;
    object-position: top left; /* This anchors the art perfectly under your top title and left menu */
}

.background {
    position: fixed;
    z-index: -1;
    padding: 0;
    top: 0;
    right: 0;
}

.header-container {
    width: 100%;
    top: 0;
    position: fixed;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    background-color: var(--bg-color);
    z-index: 11111;
    max-height: 125px;
}

.header-container.home {
    background-color: transparent;
    display: block;
}

.header-links {
    display: flex;
    justify-content: space-evenly;
    color: var(--symbol-color)
}

a {
    text-decoration: none;
    color: #5a3e36; 
    transition: all 0.3s ease-in-out;
}

a:hover {
    transform: translateY(-2px);
    /* filter: brightness(0.75);    */
}

.header-links a img {
    max-height: 30px;
}

a img {
    margin-top: -2px;
    transition: all 0.3s ease-in-out;
}

.title-container {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 10px;
    transition: all 0.3s ease-in-out;
}

.title-container.mobile {
    display: none;
}

.title-container:hover {
    transform: translateY(-4px) scale(1.01);
    cursor: pointer;
}

.title-container img {
    max-height: 100px;
    object-fit: contain;
}

.title-container h1 {
    color: var(--title-color);
    font-size: 2em;
    font-weight: normal; 
}

.title-container h2 {
    color: var(--text-main);
    font-size: 1.2em;
    font-weight: normal;
}

.main-container {
    margin-top: 180px; 
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0 50px; 
}

.main-container h3 {
    font-weight: 300;
    font-size: 2rem;
}

.main-scroll {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 50px;
    overflow-y: scroll;
}

.text-container {
    padding: 0px 10px 0px 10px; /* Top, Right, Bottom, Left */
    font-size: 1.25rem; 
    line-height: 1.6; 
    color: var(--text-main);
}

.main-fixed {
    position: fixed;
    top: 15%;
    right: 0;
    padding: 50px;
}

.main-fixed img {
    width: 40svw;
    height: 70svh;
    object-fit: cover;
}

/* Container 2, Main Body, Navigation and Star Map */
.main-body {
    flex-grow: 1; 
    margin-top: 10%;
    display: grid;
    grid-template-columns: 1fr 3fr; 
    grid-template-rows: auto; 
    gap: 20px; 
    padding: 0 50px; 
}

/* Column 1, Side Navigation */
.side-nav {
    width: fit-content;
    z-index: 999999;
    display: flex;
    align-items: flex-start; 
    padding-top: 5vh; 
    /* background-color: var(--bg-color); */
}

.side-nav ul {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 2rem;
    list-style-type: none; 
}

.side-nav li {
    margin-bottom: 20px; 
}

.side-nav a {
    transition: all 0.3s ease-in-out;
}

.side-nav a img {
    max-height: 45px;
}

.side-nav a:hover {
    transform: translateY(-4px) scale(1.01);
    filter: brightness(0.75);
}

/* Column 2, Star Map Area */
.star-map-area {
    display: flex;
    justify-content: flex-end; 
    align-items: flex-start;
}

.star-map-image {
    max-width: 90%; 
    height: auto; 
}

/* Container 3, Footer */
footer {
    padding: 20px 50px; 
    text-align: left; 
}

.footer-note {
    color: #a99a9a; 
    font-size: 1.2em;
}

.cover {
    pointer-events: none;
    z-index: 9999999;
    position: fixed;
    height: 100%;
    width: 100%;
    background: var(--bg-color);
    opacity: 1;
    display: block;
    transition: opacity 0.5s ease;
}

/* PORTFOLIO HOME AND GALLERY LAYOUTS */

.portfolio-home, .gallery-wrapper {
    grid-column: 1 / -1;
    width: 100%;
    color: var(--text-main);
}

/* Portfolio Home Layout */
.portfolio-home {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
}


.sidebar ul { 
    list-style: none; 
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 30px; /* This spreads the links out to match the carousel height */
    margin-top: 20px; /* This nudges the list down to align with the image */
}

.sidebar a { 
    text-decoration: none; 
    color: var(--text-main);
    transition: all 0.3s ease-in-out;
    display: inline-block; 
    font-size: 1.5rem; /* This makes the text buttons larger */
}

/* If you want to remove the permanent underline from "See all" update this too */
.see-all { 
    font-weight: bold; 
    text-decoration: none; 
}


.page-title { 
    font-size: 1.8rem; 
    font-weight: bold; 
    margin-top: 50px; 
}

.carousel-container {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* Update this rule to make arrows larger and bolder */
.arrow {
    font-size: 3rem; 
    font-weight: bold; 
    background: none;
    border: none;
    cursor: pointer;
    color: var(--title-color);
    user-select: none;
    transition: filter 0.3s ease;
    flex-shrink: 0; 
}
.arrow:hover {
    filter: brightness(0.9);
}

.gallery-slide { 
    text-align: center; 
}

.image-placeholder {
    width: 400px;
    height: 400px;
    border: 4px solid var(--image-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.caption { 
    max-width: 400px;
    text-align: center; /* Updated from text-justify */
    font-size: 1.2rem; 
    color: var(--text-main);
}

/* Specific Medium Gallery Layout */
.gallery-wrapper {
    display: flex;
    gap: 40px;
    margin-top: 40px;
}

.grid-container {
    flex: 1; /* This tells the grid to stretch and fill all remaining space */
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Two columns that dynamically share the wide space */
    gap: 30px;
    align-items: start; /* This makes the brown border hug the bottom of each image perfectly */
}

.side-text {
    flex: 0 0 150px; /* This locks the text column to exactly 150 pixels wide */
    font-size: 1.5rem;
    line-height: 2;
    padding-top: 20px;
}

.grid-item {
    border: 4px solid var(--image-border);
    border-radius: 10px;
    background-color: var(--bg-color);
    overflow: hidden; 
    position: relative;
}

.grid-item img, .grid-item video {
    width: 100%;
    height: auto;
    display: block; 
}

.gallery-page-title {
    font-size: 1.8rem;
    font-weight: bold;
    margin-top: 20px;
    grid-column: 1 / -1; 
}

img.multiple-icon {
    position: absolute;
    bottom: auto;
    top: 10px;
    right: 10px;
    left: auto;
    width: 35px;
    height: auto;
    pointer-events: none;
    z-index: 10;
    filter: var(--icon-filter);
}

/* Lightbox Popup Styles */

.lightbox {
    display: none; 
    position: fixed;
    z-index: 9999999; /* Keeps it above everything else */
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    --color-with-transparency: color-mix(in srgb, var(--bg-color), transparent 20%);
    background-color: var(--color-with-transparency); 
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 20px;
    cursor: pointer;
}

.lightbox-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 80vw;
    max-height: 90vh;
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border: 4px solid var(--image-border);
    border-radius: 10px;
    background-color: var(--bg-color);
}

.lightbox-caption {
    color: var(--text-main);
    margin-top: 15px;
    font-size: 1.2rem;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    color: var(--text-main);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    user-select: none;
}

.close-btn:hover, .lightbox-arrow:hover {
    color: var(--title-color);
}

.lightbox-arrow {
    background: none;
    border: none;
    color: var(--title-color);
    font-size: 4rem;
    cursor: pointer;
    user-select: none;
    transition: 0.3s;
    padding: 20px;
}

/* Adds a hover effect so people know they can click your art */
.gallery-clickable {
    cursor: pointer;
    transition: filter 0.3s ease;
}

.gallery-clickable:hover {
    filter: brightness(0.8);
}


/* Contact page */

.contact-wrapper {
    grid-column: 1 / -1; /* This forces the form to span across all columns */
    max-width: 600px; /* This keeps the form from getting too wide */
    width: 100%;
    margin: 60px auto 80px auto; /* Top, Right, Bottom, Left */
    padding-bottom: 80px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group-name {
    display: flex;
    gap: 20px;
}

.form-group-name .input-box {
    flex: 1;
}

.input-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-box label {
    font-size: 1.1rem;
    color: var(--text-main);
}

.input-box label span {
    color: var(--text-main);
    font-size: 0.9rem;
}

.input-box input,
.input-box textarea {
    padding: 15px;
    border: 2px solid var(--text-main);
    border-radius: 20px; 
    background-color: transparent;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
}

.input-box textarea {
    border-radius: 15px;
    resize: vertical;
}

.send-btn {
    width: fit-content;
    padding: 12px 40px;
    background-color: var(--text-main);
    color: var(--bg-color);
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.send-btn:hover {
    filter: brightness(0.8);
}



/* CV Page Layout */
.cv-wrapper {
    grid-column: 1 / -1; 
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding-bottom: 80px;
}

.cv-category {
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: normal;
    margin-top: 50px;
    margin-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.cv-entry {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 30px;
    margin-bottom: 20px;
    font-size: 1.15rem;
    color: var(--text-main);
    line-height: 1.6;
}

.cv-year {
    font-weight: bold;
    color: var(--text-main);
}

@media (max-width: 767px) {
    body {
        align-items: center;
    }
    .side-nav {
        align-items: center;
    }

    .header-container {
        display: flex;
        display: block;
        max-height: unset;
    }

    .title-container {
        display: none;
    }

    .title-container.mobile {
        display: flex;
    }

    .main-container {
        display: flex;
        flex-direction: column-reverse;
        padding: 0;
        align-items: center;
        padding-top: 50px;
        gap: 50px;
    }

    .main-fixed {
        position: inherit;
        padding: 0;
    }

    .main-fixed img {
        width: 90svw;
        height: unset;
    }

    .carousel-container {
        gap: 0;
    }

    .gallery-slide {
        width: fit-content;
        justify-items: center;
    }

    .image-placeholder {
        width: 80svw;
        height: auto;
        padding: 0;
        object-fit: cover;
    }
    
    .sidebar {
        margin-bottom: 50px;
    }

    .cv-wrapper {
        padding: 20px;
    }

    .contact-wrapper {
        width: 90svw;
    }

    .form-group-name {
        flex-direction: column;
    }

    .gallery-wrapper {
        flex-direction: column-reverse;
        padding: 10px;
    }

    .side-text {
        display: none;
    }

    img.multiple-icon {
        width: 25px;
    }
}