/* ==========================================================
   Artist website — minimal gallery style
   ========================================================== */

:root {
  --text: #222;
  --text-light: #777;
  --line: #e2e2e2;
  --accent: #8a6d4f;
  --bg: #fff;
  --header-h: 72px;
}

html { scrollbar-gutter: stable; }

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

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.25;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); }
a:hover { color: #6d5238; }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 48px) 24px 80px;
}

/* ----------------------------------------------------------
   Header & navigation
   ---------------------------------------------------------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
}

.site-nav ul {
  list-style: none;
}

.site-nav > ul {
  display: flex;
  gap: 4px;
}

.site-nav a {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a.active { color: var(--accent); }

.site-nav a.active { border-bottom: 2px solid var(--accent); }

.caret { font-size: 0.7em; vertical-align: middle; }

/* Dropdown */
.has-dropdown { position: relative; }

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  flex-direction: column;
  display: none;
}

.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  display: flex;
}

.dropdown li { width: 100%; }

.dropdown a {
  padding: 12px 18px;
  text-transform: none;
  letter-spacing: 0.02em;
  border-bottom: none;
}

.dropdown a:hover { background: #f6f4f1; }

/* Mobile nav toggle (hidden on desktop) */
.nav-toggle { display: none; }
.nav-toggle-label { display: none; }

/* ----------------------------------------------------------
   Home / hero
   ---------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  margin-bottom: 72px;
  margin-top: 24px;
}

.hero-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.hero-text h1 {
  font-size: 2.8rem;
  margin-bottom: 8px;
}

.tagline {
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 24px;
}

.hero-text p { margin-bottom: 18px; }

.hero-actions {
  margin-top: 28px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 26px;
  background: var(--text);
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--text);
  cursor: pointer;
  font-family: inherit;
}

.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--text);
}

.exhibition-announcement {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 28px;
  margin-top: 24px;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  background: #f6f4f1;
}

.exhibition-kicker {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.exhibition-announcement h2 { font-size: clamp(2rem, 4.5vw, 3.4rem); margin-bottom: 12px; }
.exhibition-venue { font-size: 1.15rem; }
.exhibition-dates { margin-top: 4px; color: #555; }
.exhibition-announcement + .hero { margin-top: 56px; }

@media (max-width: 760px) {
  .exhibition-announcement { grid-template-columns: 1fr; gap: 24px; }
  .exhibition-announcement .btn { justify-self: start; }
}

.caption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-light);
  text-align: center;
}

/* ----------------------------------------------------------
   Page intro
   ---------------------------------------------------------- */

.page-intro {
  max-width: 720px;
  margin-bottom: 48px;
}

.page-intro h1 {
  font-size: 2.4rem;
  margin-bottom: 14px;
}

.page-intro p { color: #444; }

/* ----------------------------------------------------------
   Gallery grid
   ---------------------------------------------------------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 48px 36px;
}

.artwork-card { }

.artwork-image {
  position: relative;
  overflow: hidden;
  background: #f4f2ef;
}

.artwork-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.artwork-card:hover .artwork-image img { transform: scale(1.03); }

.image-placeholder {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  border: 1px dashed var(--line);
}

.sold-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #b3402e;
  color: #fff;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
}

.artwork-details { padding-top: 16px; }

.artwork-details h3 {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.artwork-meta {
  color: var(--text-light);
  font-size: 0.9rem;
}

.artwork-price {
  margin-top: 6px;
  font-size: 1rem;
  color: var(--text);
}

/* ----------------------------------------------------------
   Lightbox viewer
   ---------------------------------------------------------- */

.artwork-zoom { display: block; cursor: zoom-in; }

.lightbox {
  --image-max-height: min(78vh, calc(100vh - 180px));
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 18, 16, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.open { display: flex; }

body.lightbox-open { overflow: hidden; }

.lightbox-figure {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lightbox-img {
  width: min(92vw, 1400px, calc(var(--image-max-height) * var(--image-ratio, 1)));
  max-height: var(--image-max-height);
  height: auto;
  aspect-ratio: var(--image-ratio, 1);
  object-fit: contain;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-status { color: #e8e4de; font-size: .85rem; text-align: center; min-height: 1.65em; }
.lightbox-status.is-ready { visibility: hidden; }
.lightbox-original { color: #e8e4de; }
.lightbox-original[hidden] { display: none; }
.lightbox.is-loading .lightbox-img { filter: blur(1px); }

@media (prefers-reduced-motion: reduce) {
  .artwork-image img { transition: none; }
}

.lightbox-caption {
  text-align: center;
  color: #e8e4de;
  font-size: 0.95rem;
}

.lightbox-title {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.lightbox-meta {
  display: block;
  color: #a9a49c;
  font-size: 0.85rem;
  margin-top: 2px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  z-index: 210;
  background: none;
  border: none;
  color: #d8d3cb;
  cursor: pointer;
  font-family: Georgia, serif;
  line-height: 1;
  padding: 10px 16px;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { color: #fff; }

.lightbox-close {
  top: 14px;
  right: 18px;
  font-size: 2.4rem;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.2rem;
}

.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

@media (max-width: 760px) {
  .lightbox { padding: 12px; --image-max-height: min(70vh, calc(100vh - 160px)); }
  .lightbox-img { max-width: 96vw; }
  .lightbox-prev, .lightbox-next { font-size: 2.4rem; }
}

/* ----------------------------------------------------------
   Events
   ---------------------------------------------------------- */

.events-list {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.event-card {
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.event-card-link { display: block; padding: 28px 32px; border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.event-card-link:hover { color: var(--text); background: #f6f4f1; }
.event-card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.event-card-action { display: inline-block; margin-top: 12px; color: var(--accent); font-size: .9rem; }

.event-date {
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.event-card h2 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.event-venue {
  color: var(--text-light);
  margin-bottom: 10px;
}

.empty-message {
  color: var(--text-light);
  font-style: italic;
}

/* Event popup; the native dialog handles modal keyboard focus and the Escape key. */
body.event-dialog-open { overflow: hidden; }
.event-new { display: inline-block; margin-left: 10px; color: #b32626; font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.event-dialog {
  width: min(1140px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(0, 0, 0, .25);
}
.event-dialog::backdrop { background: rgba(20, 18, 16, .72); }
.event-dialog-content {
  padding: 0;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
.event-dialog-close {
  position: absolute; z-index: 1; top: 8px; right: 8px;
  width: 44px; height: 44px; border: 0;
  color: var(--text); background: var(--bg); font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.event-dialog-close:hover { color: var(--accent); }
.event-dialog-close:focus-visible { outline: 2px solid var(--accent); }
.event-details { max-width: 720px; margin: 0 auto; }
.event-dialog .event-details:not(.event-details-with-painting) { padding: 48px 32px 32px; }
.event-details-with-painting { max-width: none; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: stretch; }
.event-details-with-painting .event-details-body { padding: 48px 32px 32px; }
.event-details-body { min-width: 0; }
.event-painting { margin: 0; position: relative; min-width: 0; background: #f6f4f1; }
.event-painting img { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.rsvp-submit { display: flex; justify-content: center; }
.rsvp-help { text-align: center; }
.event-details h1, .event-details h2 { font-size: clamp(1.8rem, 5vw, 2.4rem); margin-bottom: 24px; }
.event-facts { display: grid; gap: 12px; margin-bottom: 24px; }
.event-facts div { display: grid; grid-template-columns: 64px 1fr; gap: 16px; }
.event-facts dt { color: var(--text-light); }
.event-facts dd { margin: 0; overflow-wrap: anywhere; }
.event-description { margin-bottom: 24px; }
.event-rsvp { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.event-rsvp h3 { font-size: 1.5rem; margin-bottom: 8px; }
.event-rsvp > p { margin-bottom: 24px; }
.field-optional { color: var(--text-light); font-weight: normal; }
.rsvp-privacy, .rsvp-help { color: var(--text-light); font-size: .85rem; margin: 0 0 20px; }
.rsvp-help { margin-top: 16px; }
.event-back { margin-top: 28px; }
@media (max-width: 760px) {
  .event-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
  .event-dialog-content { max-height: calc(100dvh - 24px); }
  .event-details-with-painting { grid-template-columns: minmax(0, 1fr); }
  .event-dialog .event-details:not(.event-details-with-painting),
  .event-details-with-painting .event-details-body { padding: 28px 20px 24px; }
  .event-painting img { position: static; height: auto; object-fit: contain; }
}

/* ----------------------------------------------------------
   Contact
   ---------------------------------------------------------- */

.contact-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 64px;
  align-items: start;
}

.form-field { margin-bottom: 20px; }

.form-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #555;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  border: 1px solid #ccc;
  background: #fff;
  color: var(--text);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Honeypot — hide from humans */
.field-website {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

.form-message {
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.form-message ul { list-style-position: inside; }

.form-success {
  background: #eef5ee;
  border: 1px solid #bcd8bc;
  color: #2e5e2e;
}

.form-errors {
  background: #faeeec;
  border: 1px solid #e5beb7;
  color: #8c3325;
}

.contact-info h2 {
  font-size: 1.4rem;
  margin-bottom: 18px;
}

.contact-info p { margin-bottom: 16px; }

.studio-note {
  color: var(--text-light);
  font-style: italic;
}

/* ----------------------------------------------------------
   Footer
   ---------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 24px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
}

.footer-note { margin-top: 4px; }

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

@media (max-width: 760px) {
  /* Hamburger */
  .nav-toggle-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 110;
  }

  .nav-toggle-label span {
    display: block;
    height: 2px;
    background: var(--text);
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: none;
  }

  .nav-toggle:checked ~ .site-nav { display: block; }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }

  .site-nav a { padding: 14px 24px; }
  .site-nav a.active { border-bottom: none; }

  /* Dropdown becomes inline sub-list on mobile */
  .dropdown {
    position: static;
    display: flex;
    border: none;
    box-shadow: none;
    background: #faf9f7;
  }

  .dropdown a { padding-left: 44px; }

  .caret { display: none; }
}
