/* Anne Nygren Doherty — site styles. The paintings supply the color. */
:root {
  --ground: #F6F4F0;
  --band: #ECE8E1;
  --ink: #24231F;
  --muted: #625E57;
  --line: #D9D3C8;
  --accent: #2F4F3E;
  --accent-ink: #FFFFFF;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 300 17px/1.65 var(--sans);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--ground); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; flex-wrap: wrap; }
.brand { font-family: var(--serif); font-size: 1.6rem; font-weight: 500; text-decoration: none; }
.nav { display: flex; gap: clamp(16px, 3vw, 36px); }
.nav a { text-decoration: none; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; padding: 12px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* Shared pieces */
.eyebrow { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.2em; }
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.lede { font-size: 1.08rem; max-width: 62ch; }
.small { font-size: .9rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 1.8em; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  font: 400 .82rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.btn:hover { background: #24402F; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--ground); }
.text-link { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.text-link:hover { color: var(--accent); }
.band { background: var(--band); padding: clamp(48px, 8vw, 96px) 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.notice { background: #E3ECE5; border: 1px solid #A9C2B1; padding: 14px 18px; }
.notice p:last-child { margin: 0; }
.notice-error { background: #F6E4E1; border-color: #D9A9A1; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Home */
.hero { display: grid; grid-template-columns: 1fr; gap: 40px; padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(48px, 8vw, 96px); align-items: center; }
.hero-quote { margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.35rem; line-height: 1.45; max-width: 34ch; color: var(--muted); }
.hero-figure { margin: 0; }
.hero-figure img { max-height: 78vh; width: auto; margin: 0 auto; }
.hero-figure figcaption { font-size: .85rem; color: var(--muted); margin-top: 12px; text-align: center; }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1fr 1fr; gap: 64px; }
}
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, 1fr); gap: 28px; } }
.tiles a { text-decoration: none; display: block; }
.tile-img { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--line); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.tiles a:hover .tile-img img { transform: scale(1.03); }
.tile-name { display: block; font-family: var(--serif); font-size: 1.4rem; margin-top: 12px; }
.tile-count { display: block; font-size: .85rem; color: var(--muted); }
.statement { display: grid; gap: 32px; padding-top: clamp(56px, 9vw, 112px); padding-bottom: clamp(56px, 9vw, 112px); }
.statement-quote { font-family: var(--serif); font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.2; margin: 0; }
.statement-body { max-width: 62ch; }
@media (min-width: 900px) { .statement { grid-template-columns: 5fr 7fr; gap: 64px; } }
.notes { display: grid; gap: 28px; align-items: end; }
@media (min-width: 900px) { .notes { grid-template-columns: 1fr 1fr; gap: 64px; } }
.signup label { display: block; font-size: .85rem; margin-bottom: 6px; }
.signup-row { display: flex; gap: 10px; flex-wrap: wrap; }
.signup-row input { flex: 1 1 220px; }

/* Forms */
input[type="email"], input[type="text"], input:not([type]), input[type="number"], input[type="password"], select, textarea {
  font: 300 1rem/1.4 var(--sans); color: var(--ink); background: #FFFFFF;
  border: 1px solid #B9B2A6; border-radius: 0; padding: 12px 14px; min-height: 48px; width: 100%;
}
textarea { min-height: 160px; resize: vertical; }
.form label { display: block; font-size: .85rem; margin-bottom: 6px; }
.form p { margin-bottom: 18px; }

/* Work */
.page-intro { padding-top: clamp(40px, 6vw, 72px); padding-bottom: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 8px; }
.filters a { text-decoration: none; border: 1px solid var(--ink); padding: 10px 18px; min-height: 44px; display: inline-flex; align-items: center; font-size: .9rem; }
.filters a:hover { background: var(--band); }
.filters a[aria-current="page"] { background: var(--ink); color: var(--ground); }
.series { padding-top: clamp(40px, 6vw, 72px); padding-bottom: 16px; }
.series-head { display: grid; gap: 8px 48px; margin-bottom: 32px; border-top: 1px solid var(--line); padding-top: 28px; }
.series-head p { max-width: 60ch; color: var(--muted); margin: 0; }
@media (min-width: 900px) { .series-head { grid-template-columns: 4fr 8fr; align-items: baseline; } }
/* Rows of equal cards; how many per row is set per series (grid_open in layout.php). A short last row is centered. */
.grid { --c: 1; --gap: 28px; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 44px var(--gap); }
.grid > li { flex: 0 0 calc((100% - (var(--c) - 1) * var(--gap)) / var(--c)); min-width: 0; }
@media (min-width: 640px) { .grid { --c: var(--c-md, 2); } }
@media (min-width: 1000px) { .grid { --c: var(--c-lg, 3); } }
.card a { display: block; text-decoration: none; }
.card-img { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; background: var(--band); padding: 18px; }
.card-img img { height: auto; max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.scale-note { font-size: .88rem; color: var(--muted); margin: 0 0 8px; }

/* Layout switcher on the unlisted /preview page */
.viewbar { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; font-size: .85rem; color: var(--muted); }
.viewbar span { letter-spacing: .14em; text-transform: uppercase; font-size: .75rem; margin-right: 4px; }
.viewbar a { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.viewbar a:hover { border-color: var(--ink); }
.viewbar a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Shelf view: no tinted squares; paintings stand on a common bottom line. */
.grid-shelf .card-img { background: none; padding: 0; align-items: flex-end; }

/* Equal view: every picture fills its square the same way. */
.grid-equal .card-img img { width: auto; max-height: 100%; }

/* Wall view: one shared scale (--ppi pixels per inch) for every painting.
   Rows line up along the bottom of the pictures; captions sit underneath. */
.wall { --ppi: 6px; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 48px 40px; }
@media (min-width: 640px) { .wall { --ppi: 8px; } }
@media (min-width: 1000px) { .wall { --ppi: 10px; } }
.wall-card { flex: 0 0 auto; width: max(calc(var(--in) * var(--ppi)), 150px); max-width: 100%; }
.wall-card a { display: flex; flex-direction: column; align-items: center; text-decoration: none; text-align: center; }
.wall-card .card-img { display: block; aspect-ratio: auto; background: none; padding: 0; width: calc(var(--in) * var(--ppi)); max-width: 100%; }
.wall-card .card-img img { width: 100%; height: auto; max-height: none; box-shadow: 0 2px 6px rgba(0,0,0,.16); }
/* Every caption gets the same height, so picture bottoms line up across a row. */
.wall-cap { display: block; height: 7.4em; max-width: 220px; overflow: hidden; }
.wall-card .card-title { font-size: 1.15rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title { display: block; font-family: var(--serif); font-size: 1.3rem; margin-top: 14px; line-height: 1.25; }
.card-meta { display: block; font-size: .88rem; color: var(--muted); }
.card a:hover .card-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Painting */
.painting { display: grid; gap: 36px; padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(40px, 6vw, 72px); }
@media (min-width: 1000px) { .painting { grid-template-columns: 8fr 4fr; gap: 56px; align-items: start; } }
.painting-figure { margin: 0; background: var(--band); padding: clamp(16px, 3vw, 40px); display: flex; justify-content: center; }
.painting-figure img { max-height: 82vh; width: auto; box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.zoom { cursor: zoom-in; display: block; }
.painting-info h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.facts { margin: 24px 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 7em 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; }
.price { font-family: var(--serif); font-size: 1.7rem; margin: 0; }
.prevnext { display: flex; justify-content: space-between; gap: 16px; margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .9rem; }
.prevnext a { text-decoration: none; }
.prevnext a:hover { text-decoration: underline; }

.price-note { margin-top: 6px; }
.about-painting { padding-bottom: clamp(16px, 3vw, 32px); }
.about-painting h2 { border-top: 1px solid var(--line); padding-top: 28px; }

/* About */
.about { display: grid; gap: 40px; padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(48px, 7vw, 88px); }
@media (min-width: 900px) { .about { grid-template-columns: 4fr 7fr; gap: 64px; align-items: start; } .portrait { position: sticky; top: 32px; } }
.portrait { margin: 0; }
.portrait img { width: 100%; max-width: 440px; }
.prose { max-width: 66ch; }
.prose-wide { max-width: 72ch; }

/* Contact */
.contact { display: grid; gap: 40px; padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(48px, 7vw, 88px); }
@media (min-width: 900px) { .contact { grid-template-columns: 5fr 7fr; gap: 64px; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; font-size: .85rem; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap; }
.footer-row p { margin: 0; }
