/* Sarah Ruggeri - styles for the gallery page and the 404 page */

/* ---------- Fonts (kept on this site; licence in fonts/OFL-*.txt) ---------- */
@font-face {
    font-family: 'Cormorant Garamond';
    font-style: italic;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/cormorant-garamond-italic-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Cormorant Garamond';
    font-style: italic;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/cormorant-garamond-italic-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 500 600;
    font-display: swap;
    src: url('fonts/cormorant-garamond-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 500 600;
    font-display: swap;
    src: url('fonts/cormorant-garamond-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'EB Garamond';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/eb-garamond-italic-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'EB Garamond';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/eb-garamond-italic-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'EB Garamond';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/eb-garamond-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'EB Garamond';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/eb-garamond-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --paper: #F6F2EA;
    --ink: #2A231D;
    --muted: #6B5D50;
    --accent: #8F4527;
    --mount: #FDFBF7;
    --line: #CDBFA8;
    --display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --body: 'EB Garamond', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: 19px;
    line-height: 1.6;
}

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

a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: var(--ink); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 clamp(18px, 5vw, 64px);
}

/* ---------- Header ---------- */
.site-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: clamp(36px, 6vw, 60px) 0 clamp(24px, 4vw, 40px);
    text-align: center;
}
.site-name {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(2.6rem, 7vw, 4.2rem);
    line-height: 1.1;
}
.site-name a { color: var(--ink); text-decoration: none; }
.tagline { font-style: italic; color: var(--muted); }
.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 clamp(24px, 5vw, 44px);
    margin-top: 10px;
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.site-nav a {
    display: inline-block;
    padding: 12px 0;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--accent); }

/* ---------- The mount around every painting ---------- */
.mount {
    display: block;
    padding: clamp(8px, 1.4vw, 14px);
    background: var(--mount);
    border: 1px solid var(--line);
    box-shadow: 0 18px 28px -20px rgba(42, 35, 29, 0.5);
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.mount:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 34px -22px rgba(42, 35, 29, 0.55);
}
.mount img { width: 100%; background: #E9E0CF; }

/* ---------- Featured painting ---------- */
.featured {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-bottom: clamp(56px, 9vw, 96px);
    text-align: center;
}
.featured .mount {
    display: inline-block;
    max-width: 100%;
    padding: clamp(10px, 1.8vw, 18px);
}
.featured .mount img {
    width: auto;
    max-width: 100%;
    max-height: min(72vh, 760px);
}
.eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}
.featured h2 {
    font-family: var(--display);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(1.8rem, 4.4vw, 2.5rem);
    line-height: 1.2;
}
.featured .enquire { display: inline-block; padding: 10px 0; font-size: 1.05rem; }

/* ---------- Section headings with a hairline either side ---------- */
.rule-heading {
    display: flex;
    align-items: center;
    gap: clamp(14px, 3vw, 24px);
    margin-bottom: 10px;
}
.rule-heading::before,
.rule-heading::after {
    content: '';
    flex: 1 1 30px;
    height: 1px;
    background: var(--line);
}
.rule-heading h2 {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    line-height: 1.2;
    text-align: center;
}
.gallery-intro {
    margin-bottom: clamp(20px, 3vw, 28px);
    text-align: center;
    font-style: italic;
    color: var(--muted);
}

/* ---------- Subject buttons ---------- */
.filters {
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 12px;
    margin-bottom: clamp(32px, 5vw, 52px);
}
.js .filters { display: flex; }
.filters button {
    min-height: 44px;
    padding: 8px 18px;
    font: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.filters button:hover { border-color: var(--accent); color: var(--accent); }
.filters button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.filters button[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--mount);
}
.painting[hidden] { display: none; }

/* ---------- Gallery: paintings keep their own proportions ---------- */
.gallery {
    columns: 3 290px;
    column-gap: clamp(28px, 4vw, 56px);
}
.painting {
    break-inside: avoid;
    margin-bottom: clamp(40px, 5vw, 60px);
    text-align: center;
}
.painting figcaption { margin-top: 14px; }
.painting .title {
    font-family: var(--display);
    font-style: italic;
    font-weight: 500;
    font-size: 1.5rem;
    line-height: 1.25;
}
.painting .note { font-size: 0.95rem; color: var(--muted); }
.painting .enquire { display: inline-block; padding: 6px 4px; font-size: 0.95rem; }

/* Paintings fade up gently as they scroll into view */
.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- About ---------- */
.about {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: clamp(40px, 7vw, 80px);
    padding: clamp(48px, 7vw, 72px) 0;
    border-top: 1px solid var(--line);
    text-align: center;
}
.about h2 {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(1.6rem, 4vw, 2.1rem);
}
.about p { max-width: 640px; font-size: 1.1rem; }

/* ---------- Footer ---------- */
.site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: clamp(24px, 4vw, 40px);
    padding: clamp(48px, 7vw, 64px) 0 clamp(48px, 7vw, 72px);
    border-top: 1px solid var(--line);
    text-align: center;
}
.about + .site-footer { margin-top: 0; }
/* Small photo of Sarah at the right-hand end of "The gallery" line */
.rule-heading .artist-photo { order: 3; }
/* Empty space on the left, the same width as the photo, keeps the heading centred */
.photo-balance { order: -1; flex: 0 0 120px; }
@media (max-width: 600px) { .photo-balance { flex-basis: 72px; } }
.artist-photo {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 120px;
    text-align: center;
}
.artist-photo img {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--mount);
    box-shadow: 0 0 0 1px var(--line), 0 10px 18px -12px rgba(42, 35, 29, 0.5);
}
.artist-photo figcaption { font-size: 0.8rem; font-style: italic; line-height: 1.3; color: var(--muted); }
@media (max-width: 600px) {
    .rule-heading:has(.artist-photo) { gap: 10px; }
    .rule-heading h2 { white-space: nowrap; }
    .artist-photo { width: 72px; }
    .artist-photo img { width: 66px; height: 66px; border-width: 3px; }
    .artist-photo figcaption { font-size: 0.72rem; }
}
.site-footer .invite { font-style: italic; font-size: 1.1rem; color: var(--muted); }
.site-footer .email {
    display: inline-block;
    padding: 6px 0;
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(1.4rem, 5vw, 2.1rem);
    overflow-wrap: anywhere;
}
.site-footer .copyright { margin-top: 16px; font-size: 0.85rem; color: var(--muted); }

/* Small photo can be clicked to see it a little larger */
.photo-zoom { display: block; border-radius: 50%; cursor: zoom-in; transition: transform 0.25s ease; }
.photo-zoom:hover { transform: scale(1.05); }
.photo-zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.photo-popup {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(42, 35, 29, 0.55);
    cursor: zoom-out;
    animation: popup-fade 0.25s ease;
}
.photo-popup[hidden] { display: none; }
.photo-popup figure {
    /* 380px photo plus its 26px frame, but narrower if the photo would be too tall for the screen */
    width: min(406px, 100%, calc((100vh - 130px) * var(--photo-ratio, 1) + 26px));
    padding: 12px 12px 10px;
    background: var(--mount);
    border: 1px solid var(--line);
    box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.6);
    text-align: center;
    animation: popup-grow 0.25s ease;
}
.photo-popup img { width: 100%; height: auto; }
.photo-popup figcaption { margin-top: 8px; font-style: italic; color: var(--muted); }
@keyframes popup-fade { from { opacity: 0; } }
@keyframes popup-grow { from { transform: scale(0.9); } }

/* Back to top arrow */
.to-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-top: 18px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 50%;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.to-top:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }

.empty-notice { padding: 4rem 1rem; text-align: center; color: var(--muted); }

/* Space under the gallery intro when there are no subject buttons */
.filters-spacer { height: 24px; }

/* Full-screen viewer: clicking the big image goes back to the gallery (see site.js) */
.glightbox-container .gslide-image img,
.glightbox-container .gslide-image img.zoomable { cursor: zoom-out; }

/* ---------- "Page not found" page (404.html) ---------- */
.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: clamp(32px, 8vw, 80px) 0 clamp(56px, 10vw, 110px);
    text-align: center;
}
.not-found h2 {
    font-family: var(--display);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(1.8rem, 4.4vw, 2.5rem);
    line-height: 1.2;
}
.not-found p { max-width: 520px; color: var(--muted); }
.not-found .back { display: inline-block; padding: 10px 0; font-size: 1.1rem; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .mount, .js .reveal, .filters button, .photo-zoom, .to-top { transition: none; }
    .photo-popup, .photo-popup figure { animation: none; }
    .js .reveal { opacity: 1; transform: none; }
}
