/* Shared by all drafts: sizes chosen for easy reading, plus the big-picture viewer. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-size: calc(19px * var(--ts, 1)); line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #c8641e; outline-offset: 3px; }
section { scroll-margin-top: 90px; }
/* Only one part of the page shows at a time (app.js hides the rest). */
section[hidden] { display: none !important; }
/* A group title inside a section: a heading across the full width, in the same lettering as the section's own title (it is an h2). */
.group-title { grid-column: 1 / -1; column-span: all; margin: 56px 0 30px; }
.group-title:first-child { margin-top: 0; }
nav a[aria-current] { border-bottom-color: var(--accent); color: var(--fg); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.tile { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.tile img { width: 100%; height: auto; transition: opacity .2s; }
.tile:hover img { opacity: .86; }
.tile .cap { display: block; padding: 12px 2px 0; }
.tile .cap b { display: block; font-weight: 600; }
.tile .cap i { display: block; font-style: normal; opacity: .72; font-size: .88em; }
[data-hero] img { transition: opacity .25s; cursor: zoom-in; }

.viewer { position: fixed; inset: 0; z-index: 50; background: rgba(12, 12, 12, .96); color: #fff; display: grid; grid-template-columns: 80px 1fr 80px; align-items: center; }
.viewer[hidden] { display: none; }
.viewer figure { margin: 0; padding: 70px 0 24px; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.viewer figure img { max-height: calc(100vh - 190px); max-width: 100%; object-fit: contain; }
.viewer figcaption { text-align: center; font-size: calc(20px * var(--ts, 1)); }
.viewer figcaption b { display: block; font-size: calc(24px * var(--ts, 1)); font-weight: 600; }
.viewer figcaption span { opacity: .8; }
.viewer button { background: none; border: 0; color: #fff; }
.v-prev, .v-next { font-size: calc(72px * var(--ts, 1)); line-height: 1; height: 160px; }
.v-prev:hover, .v-next:hover, .v-close:hover { color: #f2b27a; }
.v-close { position: absolute; top: 14px; right: 22px; font-size: calc(20px * var(--ts, 1)); padding: 10px 14px; border: 1px solid rgba(255, 255, 255, .5) !important; border-radius: 4px; }
.drafts-bar { position: fixed; left: 12px; bottom: 12px; z-index: 40; background: #222; color: #fff; font: 14px/1 system-ui, sans-serif; padding: 9px 12px; border-radius: 6px; opacity: .85; }
.drafts-bar a { color: #ffd9b5; margin-left: 8px; }
@media (max-width: 700px) {
  body { font-size: calc(18px * var(--ts, 1)); }
  .viewer { grid-template-columns: 48px 1fr 48px; }
  .v-prev, .v-next { font-size: calc(48px * var(--ts, 1)); }
}

/* Design settings chosen through the website helper (applied by app.js). */
@media (min-width: 900px) {
  html[data-cols] .grid { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
  html[data-cols] .cols { columns: var(--cols); }
}
.front-single [data-hero-prev], .front-single [data-hero-next], .front-single [data-hero-dots],
.front-grid [data-hero-prev], .front-grid [data-hero-next], .front-grid [data-hero-dots],
.front-grid [data-hero] > img, .front-grid [data-hero-caption], .front-grid .now { display: none; }
/* Gallery previews: a painting fills its column's width, except an upright one, which is made narrower so it is no
   taller than --upright times the column's width (a usual landscape is about .75), centred in its column.
   --r is the painting's width / height, set by app.js; without it the painting fills the column as before.
   "full" (html.upright-full) lets upright paintings fill the column width too. */
.grid .tile, .cols .tile { container-type: inline-size; }
.grid .tile img, .cols .tile img { width: min(100%, calc(var(--upright, .75) * 100cqw * var(--r, 100))); margin: 0 auto; }
.grid .tile .cap, .cols .tile .cap { text-align: center; }
html.upright-full .tile img { width: 100%; }
/* Phones show one painting per row, so there is nothing to tower over: only keep it from getting very long. */
@media (max-width: 700px) { html:not(.upright-full) .grid .tile img, html:not(.upright-full) .cols .tile img { width: min(100%, calc(1.35 * 100cqw * var(--r, 100))); } }
.hero-mosaic { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.hero-mosaic button { padding: 0; border: 0; background: none; cursor: zoom-in; }
[data-hero] .hero-mosaic img { width: 100%; height: auto; max-height: none; aspect-ratio: 4 / 3; object-fit: cover; }

/* Extras added through the helper (app.js): home-page announcement, contact line, links and downloadable files. */
.site-notice { grid-column: 1 / -1; max-width: 760px; margin: 24px auto; padding: 14px 20px; border: 2px solid var(--accent); text-align: center; font-size: 1.05em; }
.site-extras { margin: 28px auto 0; max-width: 1000px; text-align: center; }
.site-extras p { margin: 10px 0; }
.site-links a { display: inline-block; margin: 4px 14px; }
.site-doc { display: inline-block; margin: 6px 14px; padding: 10px 18px; border: 1px solid var(--line); text-decoration: none; }
.site-doc::before { content: "\2193  "; }
.site-doc:hover { border-color: var(--accent); }
