:root {
  --paper: #EFEDE6;
  --seaglass: #8FA89B;
  --deep: #2B3A3A;
  --ink: #26302E;
  --wash: #D9CFC0;
  --navy: #0B1550;
  --gold: #E8B85F;
  --rust: #D83B17;
  --muted: #4A5654;
}

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

html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Work Sans', sans-serif;
  font-weight: 300;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Pushes the footer to the bottom of the viewport on short pages,
   without artificially stretching any content section to fill space. */
main { flex: 1 0 auto; }

/* Artwork images render via <picture> (webp + jpeg source); this keeps
   the wrapper out of layout so existing img-targeted rules still apply
   unchanged. */
picture { display: contents; }

h1, h2, h3, .serif {
  font-family: 'Fraunces', serif;
  color: var(--deep);
}

a { color: inherit; }

/* Header */
.site-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 56px;
  flex-wrap: wrap;
  gap: 16px;
}
.wordmark img { height: 72px; width: auto; display: block; }
.site-header nav a {
  text-decoration: none;
  font-size: 14px;
  margin-left: 36px;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
}
.site-header nav a:first-child { margin-left: 0; }
.site-header nav a:hover,
.site-header nav a.active {
  color: var(--seaglass);
  border-bottom-color: var(--seaglass);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero (home page) */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: stretch;
  min-height: 560px;
}
.hero-image { position: relative; overflow: hidden; }
.hero-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid img, .hero-image img, .artwork-card img {
  -webkit-user-drag: none;
  user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.hero-image::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.45), transparent 40%);
}
.hero-caption {
  position: absolute;
  bottom: 24px; left: 24px;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  font-style: italic;
  font-family: 'Fraunces', serif;
}
.hero-panel {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px;
  margin-left: -64px;
  z-index: 2;
  box-shadow: -24px 0 48px -24px rgba(0,0,0,0.08);
}
.hero-panel h1 {
  font-weight: 500;
  font-size: 44px;
  line-height: 1.1;
  max-width: 9ch;
}
.hero-panel p {
  margin-top: 20px;
  font-size: 16px;
  line-height: 1.6;
  max-width: 36ch;
  color: var(--muted);
}
.cta {
  margin-top: 28px;
  display: inline-block;
  width: fit-content;
  padding: 12px 22px;
  border: 1px solid var(--navy);
  font-size: 14px;
  text-decoration: none;
  color: var(--navy);
}
.cta:hover { background: var(--navy); color: var(--gold); border-color: var(--navy); }

/* Generic page header (About / Gallery / Contact) */
.page-header { padding: 64px 56px 32px; max-width: 1200px; margin: 0 auto; }
.page-header h1 { font-weight: 500; font-size: 34px; }

/* About */
section.about {
  padding: 64px 56px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 64px;
  max-width: 1200px;
  margin: 0 auto;
}
section.about .portrait img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}
section.about h2 { font-weight: 500; font-size: 26px; }
section.about p { font-size: 16px; line-height: 1.75; max-width: 60ch; color: var(--muted); margin-top: 12px; }

.stockists { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--wash); max-width: 60ch; }
.stockists h3 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 18px; color: var(--deep); margin-bottom: 16px; }
.stockists ul { list-style: none; }
.stockists li + li { margin-top: 20px; }
.stockists .stockist-name { font-size: 16px; }
.stockists .stockist-name a { color: var(--navy); text-decoration: underline; }
.stockists .stockist-detail { font-size: 14px; color: var(--muted); margin-top: 2px; }
.stockists .stockist-date { font-size: 14px; color: var(--seaglass); font-style: italic; margin-top: 4px; }
.stockists + .stockists { margin-top: 32px; padding-top: 0; border-top: none; }

/* Gallery / recent-work preview */
.gallery-preview, .gallery-full {
  padding: 0 56px 96px;
  max-width: 1200px;
  margin: 0 auto;
}
.gallery-preview h3 { font-weight: 500; font-size: 26px; margin-bottom: 28px; }
.category-block { margin-bottom: 56px; }
.category-block h2 { font-size: 22px; margin-bottom: 24px; }
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.grid figure {
  aspect-ratio: 4/5;
  background: var(--wash);
  position: relative;
  overflow: hidden;
}
.grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid figure.sold::before {
  content: "Sold";
  position: absolute;
  top: 12px; left: 12px;
  background: var(--rust);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  z-index: 1;
}

/* Gallery intro (print information) */
.gallery-intro { margin-top: 16px; max-width: 70ch; font-size: 14px; line-height: 1.7; color: var(--muted); }

/* Artwork detail card (gallery page) */
.artwork-card { margin-bottom: 20px; }
.artwork-card figure { cursor: zoom-in; }
.artwork-card figure.holding { cursor: default; }
.artwork-card .artwork-meta { padding-top: 12px; }
.artwork-card .artwork-meta h3 { font-size: 16px; font-weight: 500; }
.artwork-card .artwork-meta p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.artwork-card .enquire {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--navy);
  text-decoration: underline;
}

/* Contact form */
.contact-form { padding: 0 56px 96px; max-width: 560px; margin: 0 auto; }
.contact-form form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.contact-form label { font-size: 13px; color: var(--muted); }
.contact-form input,
.contact-form textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--wash);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
}
.contact-form textarea { min-height: 140px; resize: vertical; }
.contact-form button {
  align-self: flex-start;
  margin-top: 8px;
  padding: 12px 24px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: var(--gold);
  font-size: 14px;
  cursor: pointer;
}
.contact-form button:hover { background: var(--deep); }
.honeypot-field { position: absolute; left: -9999px; }

/* Privacy / Cookie policy pages */
.policy-page { padding: 0 56px 96px; max-width: 720px; margin: 0 auto; }
.policy-updated { font-size: 13px; color: var(--muted); margin-bottom: 32px; }
.policy-page h2 { font-size: 20px; margin: 40px 0 16px; }
.policy-page h2:first-child { margin-top: 0; }
.policy-page p { font-size: 16px; line-height: 1.75; color: var(--muted); margin-bottom: 16px; }
.policy-page ul { margin: 0 0 16px 20px; color: var(--muted); font-size: 16px; line-height: 1.75; }
.policy-page a { color: var(--navy); }
.policy-page strong { color: var(--ink); }
.policy-page table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 14px;
}
.policy-page th, .policy-page td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--wash);
}
.policy-page th { color: var(--deep); font-weight: 500; }
.policy-page td { color: var(--muted); }
.policy-page code {
  background: var(--wash);
  padding: 2px 6px;
  font-size: 13px;
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: var(--paper);
  padding: 48px 56px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
}
.site-footer a { color: var(--paper); margin-left: 20px; }
.site-footer .footer-links a:first-child { margin-left: 0; }
.footer-legal { margin-top: 8px; font-size: 12px; }
.footer-legal a {
  margin-left: 16px;
  color: rgba(239, 237, 230, 0.7);
  text-decoration: none;
}
.footer-legal a:first-child { margin-left: 0; }
.footer-legal a:hover { color: var(--paper); }

.site-credit {
  background: var(--navy);
  text-align: center;
  padding: 0 56px 24px;
}
.site-credit a {
  color: rgba(239, 237, 230, 0.7);
  font-size: 11px;
  text-decoration: none;
}
.site-credit a:hover { color: var(--paper); }

/* Cookie consent banner */
.cookie-consent {
  position: fixed;
  bottom: 16px; left: 16px; right: 16px;
  max-width: 420px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--wash);
  padding: 20px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 12px 32px rgba(43, 58, 58, 0.18);
  z-index: 10;
}
.cookie-consent[hidden] { display: none; }
.cookie-consent-mark { flex-shrink: 0; margin-top: 2px; }
.cookie-consent-body p { color: var(--muted); }
.cookie-consent-body a { color: var(--navy); }
.cookie-consent-actions { display: flex; gap: 10px; margin-top: 14px; }
.cookie-consent-actions button {
  padding: 8px 18px;
  font-size: 13px;
  border: 1px solid var(--navy);
  background: transparent;
  color: var(--navy);
  cursor: pointer;
}
.cookie-consent-actions button:hover { background: var(--deep); border-color: var(--deep); color: var(--paper); }
#cookie-accept { background: var(--navy); border-color: var(--navy); color: var(--gold); }
#cookie-accept:hover { background: var(--deep); border-color: var(--deep); color: var(--gold); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-image { min-height: 320px; }
  .hero-panel { margin-left: 0; box-shadow: none; padding: 32px 24px; }
  section.about { grid-template-columns: 1fr; padding: 32px 24px 64px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  /* Home page's 3 featured pieces: centre the odd one out on its own row. */
  .gallery-preview .grid figure:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 10px);
  }
  .site-header { padding: 24px; }
  .site-header nav a { margin-left: 20px; }
  .gallery-preview, .gallery-full, .contact-form, .page-header { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .site-header nav {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--paper);
    padding: 8px 24px 24px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    z-index: 20;
  }
  .site-header nav.open { display: flex; }
  .site-header nav a { margin-left: 0; margin-top: 16px; font-size: 16px; }
  .site-header nav a:first-child { margin-top: 0; }
}
