/*
Theme Name: Studio Portfolio
Theme URI: https://example.com/studio-portfolio
Author: Built with Claude
Description: A clean, minimal portfolio theme for photographers and designers. Fixed paper sidebar with a menu grouped by section, and a full-height gallery with edge navigation. Projects are managed entirely from the WordPress admin. Typography and colours are chosen with dyslexia-friendly reading in mind (soft off-white surfaces instead of harsh white, softened near-black ink, and the Lexend typeface).
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: studio-portfolio
*/

/* ============================================================
   DESIGN TOKENS
   Edit these to re-skin the whole site. Colours are chosen to be
   dyslexia-friendly: no pure white, no pure black, gentle contrast.
   ============================================================ */
:root {
    /* Colour */
    --ink:        #26241f; /* softened near-black — main text */
    --paper:      #e7e2d6; /* sidebar background (soft oat) */
    --muted:      #797260; /* copyright / secondary text */
    --gallery:    #efebe3; /* gallery surround (a shade lighter than paper) */
    --hairline:   rgba(38, 36, 31, 0.10);
    --panel:      var(--paper); /* opaque text panel on the About page */

    /* To make the gallery dramatic instead of light, swap --gallery
       for something like #1c1b18 and it will still work fine.        */

    /* Layout */
    --sidebar-w:      21%;
    --sidebar-min:    216px;
    --sidebar-max:    320px;
    --pad:            2.2rem;

    /* Type */
    --font: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --fs-base:  17px;
    --lh:       1.65;
    --track:    0.01em; /* gentle positive letter-spacing aids reading */
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: var(--lh);
    letter-spacing: var(--track);
    color: var(--ink);
    background: var(--gallery);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

/* Visible keyboard focus everywhere (accessibility floor) */
:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

/* ============================================================
   SITE LAYOUT
   ============================================================ */
.site {
    min-height: 100vh;
    min-height: 100svh;
}

/* ---- Sidebar --------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: clamp(var(--sidebar-min), var(--sidebar-w), var(--sidebar-max));
    height: 100vh;
    height: 100svh;
    background: var(--paper);
    border-right: 1px solid var(--hairline);
    padding: var(--pad);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 40;
}

.sidebar__title {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.005em;
    line-height: 1.25;
    margin: 0 0 2.4rem;
}
.sidebar__title a { display: inline-block; }

.sidebar__nav {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 1.9rem;
}

.nav-section__label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin: 0 0 0.7rem;
}

.nav-section__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-item a {
    position: relative;
    display: block;
    padding: 0.15rem 0 0.15rem 1.1rem;
    color: var(--muted);
    transition: color 0.18s ease;
}
.nav-item a:hover { color: var(--ink); }

/* Active project marker — a small solid square, no coloured accent */
.nav-item.is-active a {
    color: var(--ink);
    font-weight: 600;
}
.nav-item.is-active a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 0.42rem;
    height: 0.42rem;
    background: var(--ink);
}

/* Standalone links (About) reuse the section list styling */
.sidebar__meta {
    margin-top: 2.4rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--hairline);
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}
.sidebar__meta a { text-decoration: underline; text-underline-offset: 2px; }
.sidebar__meta a:hover { color: var(--ink); }

/* ---- Stage (right-hand area) ----------------------------- */
.stage {
    position: relative;
    margin-left: clamp(var(--sidebar-min), var(--sidebar-w), var(--sidebar-max));
    min-height: 100vh;
    min-height: 100svh;
    background: var(--gallery);
}

/* ============================================================
   GALLERY
   ============================================================ */
.gallery {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.5rem;
    overflow: hidden;
}

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

.gallery__img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.gallery__img.is-loaded { opacity: 1; }

/* Edge navigation */
.gallery__nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 12%;
    min-width: 60px;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--ink);
    display: flex;
    align-items: center;
    z-index: 5;
    transition: opacity 0.2s ease;
    opacity: 0.55;
}
.gallery__nav:hover { opacity: 1; }
.gallery__nav--prev { left: 0; justify-content: flex-start; padding-left: 1.4rem; }
.gallery__nav--next { right: 0; justify-content: flex-end;  padding-right: 1.4rem; }
.gallery__nav svg { width: 26px; height: 26px; }

/* Photo counter */
.gallery__counter {
    position: absolute;
    bottom: 1.6rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: var(--muted);
    z-index: 5;
}

.gallery__caption {
    position: absolute;
    bottom: 1.5rem;
    left: 3.5rem;
    right: 3.5rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--muted);
    z-index: 4;
    pointer-events: none;
}

/* ============================================================
   ABOUT PAGE
   Featured image fills the stage; an opaque panel (matching the
   sidebar) sits over the lower portion holding the text. Opaque,
   same typeface and ink colour, for legibility.
   ============================================================ */
.about {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.about__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.about__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 48%;
    background: var(--panel);
    border-top: 1px solid var(--hairline);
    padding: clamp(1.8rem, 4vw, 3.2rem);
    overflow-y: auto;
    max-height: 78%;
}
.about--no-photo .about__panel { min-height: 100%; }
.about__panel-inner { max-width: 62ch; }
.about__panel h1 { font-size: 1.5rem; font-weight: 600; margin: 0 0 1rem; }
.about__panel p { margin: 0 0 1rem; }
.about__panel p:last-child { margin-bottom: 0; }
.about__panel a { text-decoration: underline; text-underline-offset: 2px; }

/* ============================================================
   GENERIC PAGE / EMPTY / 404
   ============================================================ */
.prose {
    position: relative;
    max-width: 62ch;
    margin: 0;
    padding: clamp(2.5rem, 6vw, 5rem);
}
.prose h1 { font-size: 1.6rem; font-weight: 600; margin: 0 0 1.2rem; }
.prose p { margin: 0 0 1rem; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }

.stage-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: var(--muted);
}
.stage-empty p { max-width: 40ch; }

/* ============================================================
   MOBILE TOGGLE (hidden on desktop)
   ============================================================ */
.menu-toggle {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.2rem;
    background: var(--paper);
    border: 0;
    border-bottom: 1px solid var(--hairline);
    font-family: var(--font);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: var(--track);
    cursor: pointer;
    width: 100%;
}
.menu-toggle__bars {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
}
.menu-toggle__bars span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
}

/* ============================================================
   RESPONSIVE — Instagram traffic is mostly mobile, so this matters
   ============================================================ */
@media (max-width: 820px) {
    .menu-toggle { display: flex; }

    .sidebar {
        width: 100%;
        max-width: none;
        height: auto;
        max-height: 100vh;
        padding-top: 4.4rem; /* clears the toggle bar */
        transform: translateY(-100%);
        transition: transform 0.28s ease;
        border-right: 0;
        border-bottom: 1px solid var(--hairline);
    }
    .site.menu-open .sidebar { transform: translateY(0); }

    .sidebar__title { display: none; } /* title already shown in the toggle bar */

    .stage {
        margin-left: 0;
        padding-top: 3.4rem; /* clears the toggle bar */
    }

    .gallery { padding: 1.2rem; }
    .gallery__nav { width: 22%; }
    .about__panel { min-height: 42%; }
}

/* ============================================================
   MOTION PREFERENCES
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
    .gallery__img { opacity: 1; }
}
