/* ======================== */
/* COLOR VARIABLES          */
/* ======================== */

:root {
    --bg: #eee;
    --bg-bio: #eee;
    --bg-content: #fff;
    --bg-grid: #eee;
    --text: #333;
    --text-light: #555;
    --text-link: #666;
    --text-link-hover: #333;
    --hover-bg: #ddd;
}

[data-theme="dark"] {
    --bg: #1a1a1a;
    --bg-bio: #222;
    --bg-content: #111;
    --bg-grid: #333;
    --text: #ddd;
    --text-light: #aaa;
    --text-link: #aaa;
    --text-link-hover: #fff;
    --hover-bg: #444;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-link);
    padding: 0.5rem;
    user-select: none;
    font-weight: bold;
    -webkit-text-stroke: 0.5px var(--text-link);
    vertical-align: middle;
    position: relative;
    top: -4px;
}


/* ======================== */
/* RESET & BASE            */
/* ======================== */

body, html {
    margin: 0;
    padding: 0;
    height: 100vh;
    box-sizing: border-box;
    font-family: Helvetica, Arial, sans-serif;
    color: var(--text);
    background-color: var(--bg);
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
    scroll-behavior: smooth;
    overflow-y:auto;
}

body.fade-in {
    opacity: 1;
}

body.fade-out {
    opacity: 0;
}

body.fade-out a {
    pointer-events: none;
    opacity: 0.5;
}

h1 {
    font-size: 20px;
    line-height: 125%;
}

h4 {
    font-size: 35px;
    line-height: 120%;
    margin: 0;
}

h1:hover {
    background-color: var(--hover-bg);
}

/* Dots are decorative, not interactive */
.bio-links h1 {
    pointer-events: none;
    user-select: none;
}




/* ======================== */
/* LAYOUT: DESKTOP/MOBILE   */
/* ======================== */

.desktop-layout {
    display: block;
}

.mobile-layout {
    display: none;
}

.mobile-bottom-nav {
    display: none;
}

.mobile-hero-image {
    display: none;
}

.mobile-header {
    display: none;
}

.mobile-contact-grid {
    display: flex;
    justify-content: center;
    gap: 1rem;
    text-align: center;
}

.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}


/* ======================== */
/* CONTAINER & BIO SIDEBAR  */
/* ======================== */

.container {
    display: grid;
    grid-template-columns: 2fr 5fr;
    height: 100vh;
}



.bio {
    background-color: var(--bg-bio);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    overflow-y:auto;
}

/* Gallery page bios: desktop only */
@media (min-width: 769px) {
    .container .bio {
        justify-content: flex-start;
        padding: 1.5rem 0.75rem;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow: hidden;
    }

    .container .bio .bio-items {
        justify-content: flex-start;
        gap: 1rem;
        height: auto !important;
        margin: 0.5rem;
    }

    .container .bio .bio-image-placeholder {
        display: none;
    }

    body > .container {
        grid-template-columns: 1.7fr 5fr;
    }
}

.bio-image {
    background-color: var(--bg-content);
    max-width: 350px;
    height: auto;
    display: block;
}

.bio-image-placeholder {
    background-color: var(--bg-bio);
    max-width: 350px;
    height: auto;
    display: block;
}

.bio-items {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 50%;
    list-style: none;
    margin: 1.5rem;
    text-align:right;
}

.bio-items p {
    text-decoration: none;
    font-size: 16px;
}

.bio-items #title {
    background-color: var(--bg-bio);
    margin-left:auto;
    width:100%;
    text-align:right;
    white-space: nowrap;
}

.bio-items #description {
    background-color: var(--bg-bio);
    display: flex;
    flex-direction: column;
    font-size: 110%;
    color: var(--text);
    justify-content:center;
    width:90%;
    text-align:right;
    margin-left:auto;
    margin-bottom:1rem;
    line-height: 125%;
    min-width:150px;
}

.bio-items #links {
    background-color: var(--bg-bio);
    justify-content:center;
    flex-direction:column;
    justify-items:space-between;
    list-style: none;
    padding: 0;
}

.bio-items li {
    background-color: var(--bg-bio);
    text-align:center;
}

.bio-items #links a {
    text-decoration: none;
    color: var(--text-link);
    font-weight: bold;
    padding: 0.5rem;
    background-color: var(--bg-bio);
    transition: background-color 0.3s ease;
    transition: color 0.9s ease;
}

.bio-items #links a:hover {
    background-color: var(--hover-bg);
    color: var(--text);
}

.bio-links {
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    height:50%;
    list-style: none;
    padding-bottom: 2rem;
}

.bio-links li {
    background-color: var(--bg-bio);
    color: var(--text);
    text-decoration:bold;
    text-align:center;
}

.bio-links li a {
    text-decoration: none;
    color: var(--text-link);
    font-weight: bold;
    padding: 0.5rem;
    background-color: var(--bg-bio);
    transition: background-color 0.3s ease;
    transition: color 0.9s ease;
}

.bio-links li a:hover {
    background-color: var(--hover-bg);
    color: var(--text);
}


/* ======================== */
/* HOME PAGE GRID           */
/* ======================== */

.grid-container {
    background-color: var(--bg-content);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    padding: 2rem;
    box-sizing: border-box;
    align-items: center;
    justify-items: center;
}

.grid-item {
    background-color: var(--bg-bio);
    width: 200px;
    aspect-ratio: 1;
    display: flex;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.grid-item a {
    text-decoration: none !important;
    color: var(--text);
    font-weight: bold;
    line-height:125%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.grid-item-clear {
    background-color: var(--bg-content);
    width: 200px;
    aspect-ratio: 1;
    display: flex;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.grid-item-clear:hover {
    background-color: var(--bg-bio);
    transition: background-color 2.0s ease;
}

.grid-item a:link,
.grid-item a:hover,
.grid-item a:visited,
.grid-item a:active {
    color: var(--text) !important;
    text-decoration-color: var(--text);
}

.grid-item:hover {
    text-decoration: none;
    color: var(--text);
    text-align: center;
    background-color: var(--hover-bg);
    transition: background-color 2.0s ease;
}

.grid-item-clear a{
    color: #fff;
}

.grid-item small a {
    color: #999;
    font-weight: normal;
    font-size: 12px;
    text-decoration: none;
    position: relative;
    z-index: 2;
}

.grid-item small a:hover {
    color: var(--text);
}


/* ======================== */
/* GALLERY SCROLLBOXES      */
/* ======================== */

.scrollbox-container {
    display: flex;
    gap: 2rem;
    padding: 2rem;
}

.scrollbox {
    flex: 1;
    max-height: 90vh;
    overflow-y: auto;
    align-content: center;
    gap: 2rem;
    padding: 1rem;
    background-color: var(--bg-content);
}

/* Panels page: 4-column grid */
.panels-scrollbox-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1.9rem;
    padding: 2rem;
    height: 90vh;
}

.panels-scrollbox {
    max-height: 100%;
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--bg-content);
}


/* ======================== */
/* ARTWORK COMPONENTS       */
/* ======================== */

/*
 * ARTWORK COMPONENT — How to add a new artwork:
 *
 * Horizontal artwork (landscape orientation):
 *
 *   <figure class="artwork artwork-horiz">
 *       <a href="artworks/FOLDER/FILENAME.jpg" target="_blank" rel="noopener noreferrer">
 *           <img loading="lazy" src="artworks/FOLDER/FILENAME.jpg">
 *       </a>
 *       <figcaption>
 *           <span class="pink-dot"></span> <cite>title</cite>
 *           <br><br>date
 *           <br>medium, dimensions
 *       </figcaption>
 *   </figure>
 *
 * Vertical artwork (portrait orientation):
 *
 *   <figure class="artwork artwork-vert">
 *       <a href="artworks/FOLDER/FILENAME.jpg" target="_blank" rel="noopener noreferrer">
 *           <img loading="lazy" src="artworks/FOLDER/FILENAME.jpg">
 *       </a>
 *       <figcaption>
 *           <span class="pink-dot"></span> <cite>title</cite>
 *           <br><br>date
 *           <br>medium, dimensions
 *       </figcaption>
 *   </figure>
 *
 * Use class="pink-dot" if available, "gray-dot" if not.
 * Add class="desktop-only" to the <figure> to hide on mobile.
 */

.artwork {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 2rem;
    margin: 0;
    font-size: 85%;
}

.artwork img {
    width: 100%;
    height: auto;
}

.artwork figcaption {
    text-align: center;
    line-height: 133%;
    margin-top: 1rem;
    width: 95%;
}

.artwork-horiz {
    flex-direction: column;
}

.artwork-horiz img {
    width: 95%;
}

.artwork-horiz figcaption {
    width: 95%;
}

.artwork-vert {
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.artwork-vert img {
    width: 70%;
}

.artwork-vert figcaption {
    width: 30%;
    margin: 1rem;
    text-align: center;
}

.artwork-vert-left figcaption {
    order: -1;
}

/* Legacy support */
.scroll-item {
    font-size: 85%;
    display:flex;
    flex-direction: column;
    padding-bottom: 2rem;
}

table {
    margin: 0 auto;
    border-collapse: collapse;
}

td {
    text-align: center;
    vertical-align: middle;
    padding: 10px;
}

.scroll-item img {
    width: 100%;
    height:auto;
}

#vert-description {
    width: 30%;
    margin: 1rem;
    line-height:133%;
    text-align:center;
    align-items:center;
}

#horiz-description {
    width: 95%;
    margin: 1rem;
    line-height:133%;
    text-align:center;
    align-items:center;
}

#horiz-image {
    width: 95%;
    height:auto;
    align-items:center;
    padding-bottom:1rem;
}

#vert-image {
    width: 70%;
    height:auto;
    align-items:center;
}


/* ======================== */
/* ARTWORK SIZE VARIANTS    */
/* ======================== */

.artwork-tall    { width: auto; height: 90vh; }
.artwork-wide    { width: 68.5%; height: auto; }
.artwork-medium  { width: 70%; height: auto; }


/* ======================== */
/* INDICATORS               */
/* ======================== */

.pink-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #ff459f;
    border-radius: 50%;
    margin-right: 2px;
    vertical-align: middle;
}

.gray-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #909090;
    border-radius: 50%;
    margin-right: 2px;
    vertical-align: middle;
}


/* ======================== */
/* SINGLE SCROLL GALLERY    */
/* (used on "new" pages)    */
/* ======================== */

.single-scroll-gallery {
    height: 100vh;
    overflow-y: scroll;
    overflow-x: hidden;
    padding: 2rem;
    display: flex;
    gap: 2rem;
}

.gallery-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.single-scroll-gallery .artwork {
    flex-direction: column;
    margin: 0;
    padding-bottom: 0;
}

.single-scroll-gallery .artwork a {
    order: 0;
    width: 100%;
}

.single-scroll-gallery .artwork img {
    width: 100%;
    height: auto;
    display: block;
}

.single-scroll-gallery .artwork figcaption {
    width: 100%;
    order: 1;
    margin-top: 0.75rem;
    margin-bottom: 0;
    text-align: center;
    line-height: 133%;
    font-size: 85%;
}


/* ======================== */
/* MOBILE OVERRIDES         */
/* (must be last to win)    */
/* ======================== */

@media (max-width: 768px) {

    /* Unlock page height — one long scroll, no horizontal scroll */
    body, html {
        height: auto;
        overflow-x: hidden;
        overflow-y: visible;
    }

    .desktop-layout {
        display: none;
    }

    .mobile-layout {
        display: block;
        background-color: var(--bg-bio);
        min-height: 100vh;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: block;
    }

    /* On mobile: everything is just plain blocks stacking top to bottom */
    .container,
    .container .bio,
    .container .bio .bio-items,
    .single-scroll-gallery,
    .gallery-col {
        all: unset;
        display: block;
    }

    .container .bio {
        padding: 1rem 1.5rem;
        background-color: var(--bg-content);
        width: 100%;
        box-sizing: border-box;
    }

    /* Homepage bio: keep the gray background */
    .mobile-layout .bio {
        background-color: var(--bg-bio);
    }

    .bio-image-placeholder {
        display: none;
    }

    .bio-items {
        text-align: center;
        height: auto;
        margin: 0;
    }

    .bio-items #title {
        width: auto;
        text-align: center;
        margin: 0 auto 1em auto;
        background-color: transparent;
    }

    .bio-items #description {
        width: 90% !important;
        text-align: center;
        margin: 0 auto 1rem auto;
    }

    /* Gallery pages: transparent so the bio band shows through */
    .container .bio-items li,
    .container .bio-items #description {
        background-color: transparent;
    }

    /* Homepage: keep gray bg on bio items */
    .mobile-layout .bio-links li {
        background-color: var(--bg-bio);
    }

    /* Hide the sidebar back link — it's at the bottom now */
    .bio-items #links {
        display: none;
    }

    /* Scrollboxes: no height cap, no inner scroll, flush to edges */
    .scrollbox-container {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }

    .scrollbox {
        max-height: none;
        overflow-y: visible;
        padding: 0;
    }

    /* Panels: single column */
    .panels-scrollbox-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
        padding: 0;
        gap: 0;
    }

    .panels-scrollbox {
        max-height: none;
        overflow-y: visible;
        padding: 0;
    }

    /* All artworks: full width, centered, flush to screen edges */
    .artwork {
        padding-bottom: 1.5rem;
        align-items: center;
    }

    .artwork img {
        width: 100%;
        display: block;
        margin: 0 auto;
    }

    .artwork figcaption {
        width: 90%;
        padding: 0 5%;
    }

    .artwork-horiz img {
        width: 100%;
    }

    .artwork-vert {
        flex-direction: column;
    }

    .artwork-vert img {
        width: 100%;
    }

    .artwork-vert figcaption {
        width: 90%;
        padding: 0 5%;
    }

    .artwork-vert-left figcaption {
        order: 1;
    }

    .artwork-vert-left a {
        order: 0;
    }


    /* Bottom nav */
    .mobile-bottom-nav {
        display: flex;
        justify-content: center;
        padding: 2rem 1rem;
    }

    .mobile-bottom-nav a {
        text-decoration: none;
        color: var(--text-link);
        font-weight: bold;
        padding: 0.5rem;
    }

    /* Homepage: start from top, not centered */
    .mobile-layout .bio {
        justify-content: flex-start;
        gap: 0;
    }

    /* Photo + name side by side */
    .mobile-header {
        display: flex;
        align-items: flex-end;
        justify-content: center;
        gap: 0.8rem;
        margin-bottom: 0.3rem;
    }

    .mobile-header h4 {
        margin: 0;
    }

    /* Homepage hero image */
    .mobile-hero-image {
        display: block;
        width: 120px;
        height: 120px;
        object-fit: contain;
    }

    /* Homepage contact links in one row */
    .mobile-contact-grid {
        display: flex;
        justify-content: center;
        gap: 1rem;
        text-align: center;
    }
}
