/* Daisy Dennison Art — see docs/design-direction.md */
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("/assets/fonts/jost-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: "Jost"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("/assets/fonts/jost-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: "Jost"; font-style: italic; font-weight: 400 500; font-display: swap; src: url("/assets/fonts/jost-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: "Jost"; font-style: italic; font-weight: 400 500; font-display: swap; src: url("/assets/fonts/jost-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; }
:root {
  --paper: #FFFFFF;
  --grey: #EEEEEE;      /* faded grey: hover on buttons and menu items */
  --line: #D9D9D9;      /* light outline for floating boxes */
  --radius: 12px;       /* boxes */
  --radius-sm: 8px;     /* buttons, fields, menu items */
  --ink: #1A1A1A;
  --ink-soft: #5C5C58;
  --sky: #B9D7EC;
  --sky-deep: #2E6A99;
  --white: #FFFFFF;
  --font: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --wrap: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; -webkit-tap-highlight-color: rgb(0 0 0 / 0.06); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font);
  overflow-wrap: break-word;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--sky-deep); }
:focus-visible { outline: 2px solid var(--sky-deep); outline-offset: 2px; }
::selection { background: var(--sky); color: var(--ink); }
html { scrollbar-color: var(--ink-soft) var(--paper); accent-color: var(--sky-deep); caret-color: var(--sky-deep); }
h1, h2, h3 { text-wrap: balance; font-weight: 500; line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.75rem, 3vw, 2.4rem); letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; }
p { margin: 0 0 1em; max-width: 68ch; }
.small { font-size: 0.875rem; color: var(--ink-soft); }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.page { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--white); padding: 0.75rem 1rem;
}
.skip-link:focus { top: 1rem; }
.skip-link:hover { color: var(--white); }

/* ---------- Header and nav ---------- */
.site-header { position: relative; z-index: 10; }
.header-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 5.5rem;
}
.home .header-row { justify-content: center; }
.brand img { width: 84px; }
.nav-list, .sub, .contact-links { list-style: none; margin: 0; padding: 0; }
.nav-list { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.nav-item {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.4rem 0.75rem;
  font: 500 1.0625rem/1 var(--font); color: var(--ink); text-decoration: none;
  background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer;
  transition: background-color 120ms ease-out;
}
.nav-item:hover, .has-sub > .nav-item[aria-expanded="true"] { background: var(--grey); color: var(--ink); }
.nav-item.is-current, .nav-item[aria-current="page"] {
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.4em;
}
.has-sub { position: relative; }
.has-sub > .nav-item::after {
  content: ""; width: 0.45em; height: 0.45em; margin-left: 0.45em; margin-top: -0.2em;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
}
.sub {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 11rem; padding: 0.4rem;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 28px -12px rgb(0 0 0 / 0.25);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 120ms, transform 120ms, visibility 0s 120ms;
}
.sub::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; } /* keeps hover alive across the gap */
.sub a { display: block; padding: 0.6rem 0.85rem; border-radius: var(--radius-sm); text-decoration: none; }
.sub a:hover { background: var(--grey); color: var(--ink); }
.sub a[aria-current="page"] { font-weight: 500; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.4em; }
.has-sub > [aria-expanded="true"] + .sub { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
@media (hover: hover) {
  .has-sub:hover > .sub { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .has-sub:hover > .nav-item { background: var(--grey); }
}
.menu-toggle { display: none; }

@media (max-width: 760px) {
  .home .header-row { justify-content: flex-end; }
  .menu-toggle {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0.4rem 1rem;
    font: 500 1rem var(--font); color: var(--ink); background: transparent;
    border: 1.5px solid var(--ink); border-radius: var(--radius-sm); cursor: pointer;
  }
  .menu-toggle:hover, .menu-toggle[aria-expanded="true"] { background: var(--grey); }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--white); border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 28px -16px rgb(0 0 0 / 0.25);
    padding: 0.75rem var(--gutter) 1.25rem;
  }
  .menu-toggle[aria-expanded="true"] + .site-nav { display: block; }
  .nav-list { flex-direction: column; gap: 0; }
  /* On phones the media are group headings with both links always shown. */
  .has-sub > .nav-item { pointer-events: none; padding-bottom: 0; }
  .has-sub > .nav-item::after { display: none; }
  .sub {
    position: static; opacity: 1; visibility: visible; transform: none;
    border: 0; border-radius: 0; box-shadow: none; background: none; display: flex; padding: 0 0 0.5rem 0.25rem;
  }
  .sub a { padding: 0.7rem 0.6rem; min-height: 44px; }
}

/* ---------- Home ---------- */
.home-hero {
  display: grid; justify-items: center; align-content: center; gap: clamp(0.5rem, 2vw, 1.25rem);
  min-height: calc(100vh - 5.5rem - 7rem); padding: 1rem var(--gutter) 3rem;
}
.home-logo { width: min(58vh, 82vw, 560px); }
.home-signature { width: min(46vh, 74vw, 440px); }

/* ---------- Footer ---------- */
.site-footer { padding-block: 2rem; }
.footer-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  border-top: 1.5px solid var(--ink); padding-top: 1.25rem;
}
.contact-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.icon-link { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px; text-decoration: none; }
.icon-link img { width: 34px; }
.icon-link:hover span { text-decoration: underline; }
.footer-row .small { margin: 0; }


/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0.7rem 1.5rem;
  font: 500 1.0625rem/1 var(--font); color: var(--ink); text-decoration: none;
  background: var(--sky); border: 1.5px solid var(--ink); border-radius: var(--radius-sm); cursor: pointer;
  transition: background-color 120ms ease-out, transform 120ms ease-out;
}
.button:hover { color: var(--ink); background: var(--grey); }
.button:active { transform: translateY(1px); }

/* ---------- Catalogue ---------- */
.gallery {
  list-style: none; margin: 1.5rem 0 0; padding: 0;
  display: grid; gap: clamp(2rem, 4vw, 3.5rem) clamp(1.25rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  align-items: start;
}
.card { display: grid; gap: 0.35rem; text-decoration: none; }
.card-frame {
  display: block; margin-bottom: 0.6rem;
  box-shadow: 0 1px 2px rgb(26 26 26 / 0.18), 0 10px 22px -14px rgb(26 26 26 / 0.45);
  transition: transform 150ms ease-out, box-shadow 150ms ease-out;
}
.card-frame img { width: 100%; }
/* Shown when an uploaded photo can't be read (see lib/image.js). */
.img-missing { display: block; aspect-ratio: 4 / 5; background: var(--white); border: 1.5px dashed var(--ink-soft); border-radius: var(--radius); }
.card:hover { color: var(--ink); }
.card:hover .card-frame { transform: translateY(-2px); box-shadow: 0 2px 3px rgb(26 26 26 / 0.18), 0 16px 28px -14px rgb(26 26 26 / 0.5); }
.card-title { font-weight: 500; font-size: 1.125rem; line-height: 1.3; }
.card:hover .card-title { text-decoration: underline; text-underline-offset: 0.2em; }
.card-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; color: var(--ink-soft); }
.card-price { color: var(--ink); }
.is-sold { color: var(--ink-soft); font-style: italic; }
.empty { font-size: 1.125rem; }

/* ---------- Painting ---------- */
.painting { display: grid; gap: clamp(1.5rem, 4vw, 4rem); grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.painting-media { display: grid; gap: 1.5rem; }
.painting-media img { width: auto; max-height: calc(100vh - 8rem); object-fit: contain; background: var(--white); box-shadow: 0 1px 2px rgb(26 26 26 / 0.18), 0 14px 30px -16px rgb(26 26 26 / 0.5); }
.painting-info { position: sticky; top: 1.5rem; }
.painting-meta { color: var(--ink-soft); }
.buy { border-top: 1.5px solid var(--ink); padding-top: 1.25rem; margin-top: 1.75rem; }
.buy h2 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.buy-price { font-size: 1.5rem; margin-bottom: 0.9rem; }
.edition { margin: -0.5rem 0 0.9rem; color: var(--ink-soft); }
.print-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.print-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; }
.print-picker label { display: block; font-weight: 500; margin-bottom: 0.35rem; }
select, input, textarea {
  font: inherit; color: var(--ink); background: var(--white);
  border: 1.5px solid var(--ink); border-radius: var(--radius-sm); padding: 0.65rem 0.75rem; min-height: 48px;
}
.print-picker select { min-width: 12rem; margin-bottom: 0.9rem; }
/* Rounded dropdown list to match the menu (Chrome/Edge 135+; other browsers keep their native list). */
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { display: inline-flex; align-items: center; justify-content: space-between; gap: 0.75rem; cursor: pointer; }
  select:hover { background: var(--grey); }
  select::picker-icon {
    content: ""; width: 0.45em; height: 0.45em; margin-top: -0.2em;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; rotate: 45deg;
  }
  select:open::picker-icon { rotate: 225deg; margin-top: 0.2em; }
  ::picker(select) {
    position-area: block-end span-inline-end; position-try-fallbacks: flip-block; position-try-order: normal; /* below unless it does not fit */
    margin-block: 8px; max-height: 18rem; padding: 0.4rem; background: var(--white);
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 12px 28px -12px rgb(0 0 0 / 0.25);
  }
  option { padding: 0.55rem 0.75rem; border-radius: var(--radius-sm); cursor: pointer; }
  option:hover, option:focus-visible { background: var(--grey); outline: none; }
  ::picker(select):has(option:hover) option:not(:hover) { background: none; } /* mouse wins over keyboard focus */
  option:checked { font-weight: 500; }
  option::checkmark { content: none; }
}
.back { margin-top: 2rem; }
@media (max-width: 860px) {
  .painting { grid-template-columns: 1fr; }
  .painting-info { position: static; }
}


/* ---------- About ---------- */
.about.has-photo { display: grid; gap: clamp(1.5rem, 4vw, 4rem); grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
.about-photo img { width: 100%; box-shadow: 0 1px 2px rgb(26 26 26 / 0.18), 0 14px 30px -16px rgb(26 26 26 / 0.5); }
.about-text { font-size: 1.125rem; }

/* ---------- Commissions ---------- */
.commission { display: grid; gap: clamp(1.5rem, 4vw, 4rem); grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
.commission-intro p { font-size: 1.125rem; }
.commission-form { display: grid; gap: 1.25rem; max-width: 36rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; }
.field textarea { resize: vertical; min-height: 9rem; }
.commission-form .button { justify-self: start; }
@media (max-width: 860px) {
  .about.has-photo, .commission { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
