/* madelinefenton.com — 2026 redesign
   Light, restrained palette so the paintings carry the visual weight.
   Mobile-first. Single CSS file, no preprocessor. */

:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --ink: #1c1c1c;
  --muted: #5e5e5a;
  --rule: #d6d4cd;
  --accent: #8a3324;          /* warm sienna, echoes Old Master palette */
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.06);
  --maxw: 1180px;
  --serif: "Cormorant Garamond", "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 4px;
}

@font-face {
  /* Local Georgia fallback — we don't pull a webfont to keep things fast.
     If you want Cormorant Garamond, add a <link> to head.njk later. */
  font-family: system-fallback;
  src: local("Georgia");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration: none; }
.small { font-size: .85em; }
.muted { color: var(--muted); }
.sep { opacity: .5; padding: 0 .35em; }

/* ---------- Header ---------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  max-width: var(--maxw);
  margin: 0 auto;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.1;
}
.brand-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.55rem;
  letter-spacing: .01em;
}
.brand-tag {
  font-size: .78rem;
  color: var(--muted);
  margin-top: .15em;
  font-style: italic;
}

/* ---------- Primary nav ---------- */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.primary-nav { display: none; width: 100%; margin-top: .5rem; }
.primary-nav.open { display: block; }
.primary-nav ul { list-style: none; padding: 0; margin: 0; }
.primary-nav > ul > li { border-top: 1px solid var(--rule); }
.primary-nav a {
  display: block;
  padding: .65rem .25rem;
  color: var(--ink);
  text-decoration: none;
  font-size: .95rem;
}
.primary-nav a[aria-current="page"] { color: var(--accent); }
.primary-nav .submenu a {
  padding-left: 1rem;
  font-size: .9rem;
  color: var(--muted);
}

@media (min-width: 760px) {
  .nav-toggle { display: none; }
  .primary-nav { display: block; width: auto; margin: 0; }
  .primary-nav > ul {
    display: flex;
    gap: 1.5rem;
    align-items: center;
  }
  .primary-nav > ul > li { border: 0; position: relative; }
  .primary-nav a { padding: .3rem 0; }
  .primary-nav .has-children > a::after {
    content: " ▾";
    font-size: .65em;
    opacity: .6;
  }
  .primary-nav .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface);
    box-shadow: var(--shadow);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: .5rem 0;
    min-width: 200px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity .15s, transform .15s;
    z-index: 20;
  }
  .primary-nav .has-children:hover .submenu,
  .primary-nav .has-children:focus-within .submenu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
  .primary-nav .submenu a { padding: .4rem 1rem; }
  .primary-nav .submenu a:hover { background: rgba(0,0,0,.04); }
}

/* ---------- Main ---------- */
.site-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.4rem 4rem;
}
.page-head { margin-bottom: 1.5rem; }
.page-head h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  margin: 0 0 .25rem;
}
.page-head .subtitle {
  color: var(--muted);
  font-style: italic;
  margin: 0;
}
.intro { color: var(--muted); margin-bottom: 1rem; max-width: 70ch; }

/* ---------- Home ---------- */
.layout-home .site-main { padding-top: 2.5rem; }
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3rem;
}
@media (min-width: 880px) {
  .hero { grid-template-columns: 1.2fr 1fr; gap: 3rem; }
}
.hero-text h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}
.hero-text .lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 38ch;
  margin: 0 0 1.5rem;
}
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero-image img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.home-strips { margin: 2rem 0 3rem; }
.strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
}
.strip a {
  position: relative;
  display: block;
  text-decoration: none;
  color: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 1 / 1;
}
.strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.strip a:hover img { transform: scale(1.05); }
.strip span {
  position: absolute;
  inset: auto 0 0 0;
  padding: .6rem .8rem;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: .02em;
}

.home-about { max-width: 65ch; }
.home-about h2 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0 0 .5rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: .65rem 1.15rem;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid currentColor;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #6f2a1d; border-color: #6f2a1d; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { border-color: var(--ink); }

/* ---------- Gallery grid ---------- */
.gallery-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .9rem;
}
@media (min-width: 600px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.1rem; }
}
.g-item {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  aspect-ratio: 1 / 1;
}
.g-item a {
  display: block;
  width: 100%;
  height: 100%;
}
.g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.g-item:hover img { transform: scale(1.04); }

/* ---------- Card grid (gallery index) ---------- */
.card-grid {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.card {
  display: block;
  padding: 1.5rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--ink); transform: translateY(-1px); }
.card strong {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.25rem;
  margin-bottom: .25rem;
}
.card span { color: var(--muted); font-size: .9rem; }

/* ---------- Text pages ---------- */
.prose { max-width: 65ch; }
.prose p { margin: 0 0 1em; }
.prose h2, .prose h3 { font-family: var(--serif); font-weight: 500; margin-top: 1.4em; }
.prose-with-figure {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}
@media (min-width: 760px) {
  .prose-with-figure { grid-template-columns: 1.4fr 1fr; }
}
.prose-with-figure figure { margin: 0; }
.prose-with-figure img { border-radius: var(--radius); box-shadow: var(--shadow); }

.figure-grid {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.figure-grid figure { margin: 0; }
.figure-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.figure-grid figcaption {
  font-size: .85rem;
  color: var(--muted);
  margin-top: .35rem;
  text-align: center;
}

.exhibition-list { padding-left: 1.2rem; max-width: 78ch; }
.exhibition-list li { margin: .35em 0; }

.quote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.quote footer { margin-top: .5rem; color: var(--muted); font-style: italic; }

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--maxw);
  margin: 3rem auto 0;
  padding: 1.5rem 1.4rem 3rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: .9rem;
}
.site-footer p { margin: .3rem 0; }
.site-footer .small { color: var(--muted); }

/* ---------- Modal ---------- */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 18, .65);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem 1.75rem 1.5rem;
  width: min(100%, 520px);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-card h2 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0 0 .5rem;
  font-size: 1.4rem;
}
.modal-card label {
  display: block;
  margin: 1rem 0 0;
  font-size: .9rem;
  color: var(--muted);
}
.modal-card input,
.modal-card textarea {
  display: block;
  width: 100%;
  font: inherit;
  margin-top: .35rem;
  padding: .6rem .75rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}
.modal-card input:focus,
.modal-card textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.modal-close {
  position: absolute;
  top: .5rem;
  right: .75rem;
  background: transparent;
  border: 0;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.modal-close:hover { color: var(--ink); }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: 1.25rem;
}
.form-status {
  margin: .75rem 0 0;
  min-height: 1.2em;
  font-size: .9rem;
}
.form-status.ok { color: #2a6f3a; }
.form-status.err { color: #8a2f2f; }

/* GLightbox: nudge the description (which holds our request button) */
.glightbox-clean .gdesc-inner { padding: 16px 24px; }
.request-from-lightbox {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  padding: .55rem 1rem;
  border-radius: 999px;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  margin-top: .35rem;
}
.request-from-lightbox:hover { background: #6f2a1d; }
