/* =============================================================================
   Studio theme — the conventional artist website: name top-left, a short text
   menu top-right, and the work itself as the home page. White space, plain
   type and museum-style captions (italic title, year, medium, size) so the
   artwork is the only thing with color on the page.
   ============================================================================= */

:root {
    --st-ink: #1a1a1a;
    --st-muted: #6b6b6b;
    --st-line: #e6e6e6;
    --st-paper: #ffffff;
    --st-tile: #f5f5f3;
    --st-gutter: clamp(20px, 4vw, 56px);
    --st-gap: clamp(28px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }

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

body.studio {
    margin: 0;
    background: var(--st-paper);
    color: var(--st-ink);
    font-family: var(--font-body, system-ui, sans-serif);
    font-size: calc(15px * var(--font-body-scale, 1));
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.studio a { color: inherit; text-decoration: none; }
.studio img { display: block; max-width: 100%; height: auto; }
.studio h1, .studio h2, .studio h3 {
    font-family: var(--font-heading, var(--font-body, inherit));
    font-weight: 500;
    line-height: 1.25;
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.st-muted { color: var(--st-muted); }

/* Preview banner ----------------------------------------------------------- */
.st-preview {
    padding: 8px var(--st-gutter);
    background: #fff8e1;
    border-bottom: 1px solid #f0e2b0;
    font-size: 13px;
    text-align: center;
}
.st-preview a { margin-left: 8px; text-decoration: underline; }

/* Header ------------------------------------------------------------------- */
.st-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding: clamp(24px, 4vw, 44px) var(--st-gutter) clamp(28px, 4vw, 52px);
}

.st-brand {
    font-family: var(--font-brand, var(--font-heading, inherit));
    font-size: calc(1.35rem * var(--font-brand-scale, 1));
    font-weight: 500;
    letter-spacing: 0.01em;
}

.st-nav {
    display: flex;
    gap: clamp(18px, 2.5vw, 32px);
    font-size: 14px;
    letter-spacing: 0.02em;
}
.st-nav a {
    color: var(--st-muted);
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: color 0.15s;
}
.st-nav a:hover { color: var(--st-ink); }
.st-nav a.active {
    color: var(--st-ink);
    border-bottom-color: var(--accent-color, var(--st-ink));
}

.st-menu-toggle {
    display: none;
    padding: 0;
    border: 0;
    background: none;
    color: var(--st-ink);
    font: inherit;
    font-size: 14px;
    letter-spacing: 0.02em;
    cursor: pointer;
}

@media (max-width: 640px) {
    .st-header { align-items: center; }
    .st-menu-toggle { display: block; }
    .st-nav {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        gap: 14px;
        padding-top: 8px;
        font-size: 16px;
    }
    .st-nav.open { display: flex; }
    .st-nav a.active { align-self: flex-start; }
}

/* Main --------------------------------------------------------------------- */
.st-main {
    flex: 1;
    width: 100%;
    padding: 0 var(--st-gutter);
}

.st-intro {
    max-width: 40em;
    margin: 0 0 clamp(28px, 4vw, 48px);
    color: var(--st-muted);
    font-size: 1.05em;
}

/* Work index --------------------------------------------------------------- */
.st-works { margin: 0; }

.st-work { margin: 0; }
.st-work-link { display: block; }
.st-work-frame { overflow: hidden; }
.st-work-link img { transition: opacity 0.2s; }
.st-work-link:hover img { opacity: 0.88; }
.st-work-link:focus-visible { outline: 2px solid var(--accent-color, var(--st-ink)); outline-offset: 4px; }

/* Masonry: every work at its own proportions, nothing cropped */
.st-works--masonry {
    column-count: 3;
    column-gap: var(--st-gap);
}
.st-works--masonry .st-work {
    break-inside: avoid;
    margin-bottom: var(--st-gap);
}
.st-works--masonry .st-work-frame img { width: 100%; }

/* With JS, works are dealt into columns in row order (see studio/home.html) */
.st-works--masonry.is-split {
    display: flex;
    align-items: flex-start;
    gap: var(--st-gap);
    column-count: auto;
}
.st-col { flex: 1; min-width: 0; }

/* Grid: even rows; each work sits whole inside a square, never cropped */
.st-works--grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--st-gap);
}
.st-works--grid .st-work-frame {
    aspect-ratio: 1;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}
.st-works--grid .st-work-frame img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}

@media (max-width: 1000px) {
    .st-works--masonry { column-count: 2; }
    .st-works--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .st-works--masonry { column-count: 1; }
    .st-works--grid { grid-template-columns: minmax(0, 1fr); }
    .st-works--grid .st-work-frame { aspect-ratio: auto; }
}

.st-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--st-tile);
    color: #c4c4c4;
    font-size: 28px;
}
.st-no-image--large { aspect-ratio: 4 / 3; max-width: 640px; font-size: 48px; }

/* Captions: the wall-label convention */
.st-work figcaption { margin-top: 12px; }
.st-caption {
    font-size: 13px;
    line-height: 1.5;
    color: var(--st-muted);
}
.st-title { font-style: italic; color: var(--st-ink); }
.st-meta, .st-status { display: block; }
.st-status { margin-top: 2px; color: var(--st-ink); }
.st-dot {
    display: inline-block;
    width: 7px; height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: #c0392b;
    vertical-align: 1px;
}

/* Pagination / prev-next --------------------------------------------------- */
.st-pager {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin: clamp(32px, 5vw, 64px) 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--st-line);
    font-size: 14px;
}
.st-pager > :last-child { justify-self: end; }
.st-pager a { color: var(--st-muted); }
.st-pager a:hover { color: var(--st-ink); }
.st-pager-count { color: var(--st-muted); text-align: center; }

/* Artwork detail ----------------------------------------------------------- */
.st-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: clamp(28px, 5vw, 72px);
    align-items: end;
}
.st-detail-image { display: flex; justify-content: center; }
.st-detail-image img {
    max-height: calc(100vh - 220px);
    width: auto;
    object-fit: contain;
}
.st-detail-image a { cursor: zoom-in; }

.st-detail-title {
    margin: 0 0 10px;
    font-size: calc(1.15rem * var(--font-heading-scale, 1));
    font-family: var(--font-body, inherit);
}
.st-detail-meta { margin: 0 0 20px; color: var(--st-muted); font-size: 14px; }
.st-detail-description { font-size: 14px; }
.st-detail-description p { margin: 0 0 1em; }
.st-detail-price { margin: 0 0 14px; font-size: 15px; }

@media (max-width: 860px) {
    .st-detail { grid-template-columns: minmax(0, 1fr); align-items: start; }
    .st-detail-image img { max-height: 75vh; }
}

/* Text pages: About / CV / Contact ----------------------------------------- */
.st-page { max-width: 1100px; }
.st-page-title {
    margin: 0 0 24px;
    font-size: calc(1.5rem * var(--font-heading-scale, 1));
}
.st-prose { max-width: 38em; }
.st-prose p { margin: 0 0 1.1em; }

.st-about {
    display: grid;
    grid-template-columns: minmax(180px, 340px) minmax(0, 1fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: start;
}
.st-about:not(:has(.st-about-photo)) { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) {
    .st-about { grid-template-columns: minmax(0, 1fr); }
    .st-about-photo { max-width: 280px; }
}

.st-cv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.st-cv-name { margin-bottom: 1.6em !important; }
.st-cv { white-space: normal; }

.st-contact-list { margin: 0; }
.st-contact-list dt { font-size: 13px; color: var(--st-muted); }
.st-contact-list dd { margin: 0 0 18px; }
.st-contact-list a { border-bottom: 1px solid var(--st-line); }
.st-contact-list a:hover { border-bottom-color: var(--st-ink); }

/* Form */
.st-form { display: grid; gap: 18px; margin-top: 28px; }
.st-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .st-form-row { grid-template-columns: 1fr; } }
.st-form label { display: grid; gap: 6px; font-size: 13px; }
.st-form input, .st-form textarea {
    width: 100%;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid #cfcfcf;
    border-radius: 0;
    background: transparent;
    color: var(--st-ink);
    font: inherit;
    font-size: 15px;
}
.st-form textarea { resize: vertical; min-height: 120px; }
.st-form input:focus, .st-form textarea:focus {
    outline: none;
    border-bottom-color: var(--accent-color, var(--st-ink));
}
.st-form .st-button { justify-self: start; margin-top: 8px; }
.st-form-message { margin: 0; font-size: 14px; }
.st-form-message.is-error { color: #b3261e; }

/* Buttons */
.st-button, .st-link-button {
    font: inherit;
    cursor: pointer;
}
.st-button {
    display: inline-block;
    padding: 10px 22px;
    border: 1px solid var(--st-ink);
    background: var(--st-ink);
    color: #fff !important;
    font-size: 14px;
    letter-spacing: 0.02em;
    transition: background 0.15s, color 0.15s;
}
.st-button:hover { background: transparent; color: var(--st-ink) !important; }
.st-button:disabled { opacity: 0.6; cursor: default; }
.st-link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--st-muted);
    font-size: 14px;
}
.st-link-button:hover { color: var(--st-ink); }

.st-empty { padding: 80px 0; text-align: center; color: var(--st-muted); }
.st-empty .st-button { margin-top: 12px; }

/* Footer ------------------------------------------------------------------- */
.st-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 28px;
    margin-top: clamp(56px, 8vw, 112px);
    padding: 24px var(--st-gutter) 32px;
    color: var(--st-muted);
    font-size: 12px;
}
.st-social { display: flex; gap: 16px; font-size: 15px; }
.st-social a:hover, .st-powered a:hover { color: var(--st-ink); }
.st-powered { margin-left: auto; }
.st-powered a { text-decoration: underline; text-underline-offset: 2px; }

/* Print (mainly the CV) ---------------------------------------------------- */
@media print {
    .st-nav, .st-menu-toggle, .st-preview, .st-print, .st-footer, .st-pager { display: none !important; }
    .st-header { padding: 0 0 24px; }
    .st-main { padding: 0; }
    .st-prose { max-width: none; }
}
