:root {
  --bg: #f5f5f5;
  --ink: #1c1c1c;
  --muted: #6b6b6b;
  --line: #e2e2e0;
  --gap: 15px;
  --side-gap: 18px;              /* space between the left menu and the main content */
  --thumb-w: 192px;              /* thumbnail size: images are cropped to fill it */
  --thumb-ratio: 192 / 170;      /* keep equal to width / height above */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.5; }
body.lb-open { overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* Header */
.site-header { display: grid; grid-template-columns: 13rem minmax(0, 1fr); align-items: baseline; gap: 1rem var(--side-gap);
  max-width: 1400px; margin: 0 auto; padding: 2rem 2rem 1.25rem; }
.site-title { font-family: var(--serif); font-size: 1.5rem; letter-spacing: .04em; text-decoration: none; }
.site-nav { grid-column: 2; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: .5rem 1.75rem; }
.site-nav a { text-decoration: none; color: var(--muted); font-size: .95rem; padding: .25rem 0; border-bottom: 1px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* Page + pager */
.page { max-width: 1400px; margin: 0 auto; padding: 0 2rem 3rem; }
.pager { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; margin: 1rem 0 2rem; font-size: .95rem; }
.pager:empty { display: none; }
.pager a, .pager span { min-width: 2rem; padding: .25rem .5rem; text-align: center; text-decoration: none; color: var(--muted); border-bottom: 1px solid transparent; }
.pager a:hover { color: var(--ink); }
.pager [aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.pager .is-disabled { opacity: .35; }

/* Left menu + content */
.layout { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: var(--side-gap); align-items: start; }
.layout.no-menu { grid-template-columns: minmax(0, 1fr); }
.side[hidden] { display: none; }
.side-title { margin: 0 0 .75rem; padding-left: .75rem; font-family: var(--serif); font-size: 1.1rem; font-weight: 400; letter-spacing: .05em; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: .3rem .75rem; text-decoration: none; color: var(--muted); font-size: .95rem; }
.side a:hover { color: var(--ink); }
.side a[aria-current="page"] { color: var(--ink); box-shadow: inset 2px 0 var(--ink); }

/* Grid: 4 columns of 170 x 150 thumbnails on desktop */
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, var(--thumb-w))); justify-content: start; gap: var(--gap); }
.grid > li { min-width: 0; }
.thumb { position: relative; display: block; width: 100%; aspect-ratio: var(--thumb-ratio); padding: 0; border: 0; background: none; cursor: zoom-in; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }

/* Sold marker: red circle in the top-right corner (thumbnail and large view).
   Turn on per painting with "sold": true in data/paintings.json */
.thumb.is-sold::after, .lb-frame.is-sold::after { content: ""; position: absolute; bottom: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%;
  background: #d62d2d; box-shadow: 0 0 0 1px #fff, 0 1px 4px rgba(0, 0, 0, .35); pointer-events: none; }
.status { color: var(--muted); }
.status:empty { display: none; }
.site-footer { max-width: 1400px; margin: 0 auto; padding: 1.5rem 2rem 2.5rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }

@media (max-width: 899px) {
  .site-header { grid-template-columns: minmax(0, 1fr); }
  .site-nav { grid-column: 1; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .side ul { display: flex; flex-wrap: wrap; gap: 0 .75rem; }
  .side-title, .side a { padding-left: 0; padding-right: 0; }
  .side a { padding: .3rem 0; }
  .side a[aria-current="page"] { box-shadow: none; border-bottom: 1px solid var(--ink); }
}
@media (max-width: 699px) { .grid { grid-template-columns: repeat(3, minmax(0, var(--thumb-w))); } }
@media (max-width: 599px) {
  .grid { grid-template-columns: repeat(2, minmax(0, var(--thumb-w))); }
  .site-header, .page, .site-footer { padding-left: 1rem; padding-right: 1rem; }
}

/* About pages (about-he.html, about-en.html) */
.about { font-size: .875rem; line-height: 1.45; }
.about { display: grid; grid-template-columns: 13rem minmax(0, 1fr); column-gap: var(--side-gap); align-items: start; }
.about-inner { grid-column: 2; max-width: 52rem; margin: 0; }
.lang-bar { display: flex; margin: 0 0 1.25rem; }
.lang-btn { margin-inline-start: auto; padding: .3rem .9rem; border: 1px solid #7b7465; background: #b1d8bb; color: var(--ink); text-decoration: none; font-size: .85rem; letter-spacing: .03em; }
.lang-btn:hover, .lang-btn:focus-visible { background: #d2efd9; }
.intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.intro-text { flex: 1; min-width: 0; }
.portrait { flex: none; display: block; width: 261px; max-width: 100%; height: auto; }
.statement { margin: 0 0 1.5rem; font-family: var(--serif); font-size: 1.125rem; line-height: 1.5; }
.about h2 { margin: 0 0 .5rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 1rem; font-weight: 400; letter-spacing: .05em; }
.cv-list, .exh { list-style: none; margin: 0; padding: 0; }
.cv-list li { padding: .1rem 0; }
.exh { margin-bottom: 2rem; }
.exh li { margin-bottom: .5rem; }
.exh .t, .exh .m { display: block; }
.exh .m { color: var(--muted); font-size: .8rem; }
@media (max-width: 899px) { .about { display: block; } }
@media (max-width: 699px) {
  .intro { flex-direction: column; align-items: stretch; gap: 1rem; }
  .portrait { order: -1; width: 180px; align-self: center; }
}

/* Contact page (contact.html) */
.contact-list { list-style: none; margin: 0 0 1.75rem; padding: 0; }
.contact-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .6rem; padding: .25rem 0; }
.contact-list a { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.contact-list a:hover span, .contact-list li > span a:hover, .galleries a:hover { text-decoration: underline; }
.ico { width: 1.35rem; height: 1.35rem; flex: none; }
.alt-link { margin-left: .4rem; color: var(--muted); font-size: .75rem; text-decoration: underline; }
.alt-link:hover { color: var(--ink); }
.contact-form { max-width: 26rem; margin-bottom: 1rem; }
.field { display: block; margin-bottom: .8rem; }
.field span { display: block; margin-bottom: .2rem; color: var(--muted); font-size: .8rem; letter-spacing: .03em; }
.field input, .field textarea { display: block; width: 100%; padding: .45rem .6rem; border: 1px solid #cfcfcc; border-radius: 0; background: #fff; color: var(--ink); font: inherit; }
.field textarea { min-height: 7.5rem; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.send-btn { padding: .35rem 1.3rem; border: 1px solid #7b7465; background: #b1d8bb; color: var(--ink); font: inherit; font-size: .85rem; letter-spacing: .03em; cursor: pointer; }
.send-btn:hover, .send-btn:focus-visible { background: #d2efd9; }
.send-btn:disabled { opacity: .6; cursor: default; }
.form-status { min-height: 1.4em; margin: .75rem 0 0; font-size: .85rem; }
.form-status.is-ok { color: #2f6b3f; }
.form-status.is-error { color: #a12b2b; }
.galleries { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.1rem 2rem; }
.galleries span { display: block; color: var(--muted); }
.galleries a { color: inherit; text-decoration: none; }
.g-name { display: block; margin-bottom: .1rem; font-family: var(--serif); font-size: 1rem; font-weight: 400; letter-spacing: .02em; }
.contact-photo { width: 44%; max-width: 360px; height: auto; }
@media (max-width: 699px) { .contact-photo { width: 100%; max-width: 360px; } }

/* Sale page intro text (sale.html) */
.sale-intro { max-width: 42rem; margin: 0 0 1.75rem; font-size: .95rem; line-height: 1.5; }
.sale-intro p { margin: 0 0 .3rem; }
.sale-intro .hi { font-family: var(--serif); font-size: 1.15rem; }
.sale-intro a { text-decoration: underline; }

/* Sale page sections (Large / Medium / Small Paintings) */
.sale-section { margin: 0 0 2.5rem; }
.section-title { margin: 0 0 .6rem; font-family: var(--serif); font-size: 1.4rem; font-weight: 400; letter-spacing: .02em; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(14, 14, 14, .95); color: #eee;
  display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lb-frame { position: relative; }
.lb-frame.is-sold::after { top: auto; bottom: 12px; right: 12px; width: 22px; height: 22px; }
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.lb-img { display: block; width: auto; height: auto; max-width: calc(100vw - 9rem); max-height: calc(100vh - 9rem); max-height: calc(100dvh - 9rem); transition: opacity .15s; }
.lb-img.is-loading { opacity: .25; }
.lb-caption { margin-top: 1rem; max-width: min(46rem, calc(100vw - 9rem)); max-height: 5rem; overflow: auto; text-align: center; font-size: .95rem; line-height: 1.5; white-space: pre-line; color: #cfcfcf; }
.lb-caption .lb-title { display: block; color: #fff; font-family: var(--serif); font-size: 1.1rem; }
.lb-caption .lb-count { display: block; margin-top: .25rem; color: #8a8a8a; font-size: .8rem; }
.lb-btn { position: absolute; background: none; border: 0; color: #ddd; cursor: pointer; line-height: 1; font-family: var(--sans); font-weight: 300; }
.lb-btn:hover { color: #fff; }
.lb-btn:disabled { opacity: .2; cursor: default; }
.lb-close { top: .75rem; right: 1rem; font-size: 2.75rem; padding: .25rem .75rem; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 4rem; padding: 1rem 1.25rem; }
.lb-prev { left: .5rem; } .lb-next { right: .5rem; }
@media (max-width: 599px) {
  .lb-img { max-width: calc(100vw - 1rem); max-height: calc(100vh - 10rem); max-height: calc(100dvh - 10rem); }
  .lb-caption { max-width: calc(100vw - 2rem); }
  .lb-prev, .lb-next { top: auto; bottom: .5rem; transform: none; font-size: 3rem; padding: .25rem 1.25rem; }
  .lb-prev { left: 0; } .lb-next { right: 0; }
}
@media (prefers-reduced-motion: reduce) { .lb-img { transition: none; } }
