/* ============================================================
   SUSAN ERONY — main.css
   Sections:
     1. Variables & Reset
     2. Base / Typography
     3. Navigation
     4. Layout
     5. Page Hero
     6. Artwork Grid (masonry)
     7. Series Cards
     8. Artist Statement
     9. About / CV
    10. Contact Form
    11. Homepage Splash
    12. Lightbox
    13. Artwork Detail
    14. Footer
    15. Utilities
   ============================================================ */


/* ── 1. Variables & Reset ─────────────────────────────────── */

:root {
  --cream: #f5f2ed;
  --ink: #1a1815;
  --warm-gray: #8a8278;
  --rust: #9e5a3a;
  --border: #d8d2c8;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Jost', sans-serif;
}

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


/* ── 2. Base / Typography ─────────────────────────────────── */

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}


/* ── 3. Navigation ────────────────────────────────────────── */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav a {
  text-decoration: none;
  color: var(--warm-gray);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s;
}

nav a:hover { color: var(--ink); }

.dropdown { position: relative; }

/* Arrow indicator on dropdown triggers (added via JS) */
.dropdown-arrow {
  display: inline-block;
  font-size: 0.6rem;
  margin-left: 0.3em;
  vertical-align: middle;
  transition: transform 0.25s;
  color: inherit;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--cream);
  border: 1px solid var(--border);
  min-width: 200px;
  padding: 0.5rem 0;
  z-index: 200;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

.dropdown-scroll-up,
.dropdown-scroll-down {
  display: none;
  position: sticky;
  left: 0;
  right: 0;
  height: 28px;
  z-index: 201;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: var(--warm-gray);
  background: var(--cream);
  cursor: default;
  user-select: none;
}

.dropdown-scroll-up {
  top: 0;
  border-bottom: 1px solid var(--border);
}

.dropdown-scroll-down {
  bottom: 0;
  border-top: 1px solid var(--border);
}

.dropdown-menu.can-scroll-up .dropdown-scroll-up,
.dropdown-menu.can-scroll-down .dropdown-scroll-down {
  display: flex;
}

.dropdown:hover .dropdown-menu { display: block; }

.dropdown-menu li { padding: 0; }

.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 0.82rem;
}

.dropdown-menu .submenu-header {
  padding: 0.6rem 1rem 0.2rem;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--rust);
  border-top: 1px solid var(--border);
  margin-top: 0.3rem;
}

.dropdown-menu .submenu-header:first-child {
  border-top: none;
  margin-top: 0;
}

.dropdown-menu .submenu-header a {
  display: inline;
  padding: 0;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
}


/* ── 4. Layout ────────────────────────────────────────────── */

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

/* Homepage overrides */
body.home-page main {
  padding: 0;
  max-width: 100%;
}

body.home-page header {
  position: fixed;
  width: 100%;
}


/* ── 5. Page Hero ─────────────────────────────────────────── */

.page-hero {
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.1;
  color: var(--ink);
}

.page-hero p {
  margin-top: 0.75rem;
  color: var(--warm-gray);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}


/* ── 6. Artwork Grid (masonry) ────────────────────────────── */

.artwork-grid {
  columns: 3;
  column-gap: 1.5rem;
}

@media (max-width: 900px) { .artwork-grid { columns: 2; } }
@media (max-width: 560px) { .artwork-grid { columns: 1; } }

.artwork-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

.artwork-item img {
  width: 100%;
  display: block;
  transition: opacity 0.3s;
}

.artwork-item:hover img { opacity: 0.88; }

.artwork-caption {
  padding: 0.5rem 0;
  font-size: 0.78rem;
  color: var(--warm-gray);
  line-height: 1.4;
}

.artwork-caption strong {
  display: block;
  color: var(--ink);
  font-weight: 400;
  font-style: italic;
  font-family: var(--font-display);
  font-size: 0.95rem;
}


/* ── 7. Series Cards ──────────────────────────────────────── */

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.series-card {
  text-decoration: none;
  color: inherit;
  display: block;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.series-card:hover { border-color: var(--ink); }

.series-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: #e8e3db;
}

.series-card-body { padding: 1rem 1.2rem 1.2rem; }

.series-card-body h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 300;
  font-style: italic;
}


/* ── 8. Artist Statement ──────────────────────────────────── */

.statement {
  background: white;
  border-left: 3px solid var(--rust);
  padding: 1.5rem 2rem;
  margin-bottom: 3rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.8;
  color: #3a3530;
}


/* ── 9. About / CV ────────────────────────────────────────── */

.bio-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 700px) { .bio-layout { grid-template-columns: 1fr; } }

.bio-photo { width: 100%; border: 1px solid var(--border); }

.bio-text { font-size: 1rem; line-height: 1.9; }
.bio-text p { margin-bottom: 1.2em; }

.cv-section { margin-bottom: 2.5rem; }

.cv-section h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 300;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.cv-list { list-style: none; }

.cv-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #ece9e3;
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.cv-year {
  font-size: 0.78rem;
  color: var(--rust);
  min-width: 40px;
  letter-spacing: 0.05em;
}


/* ── 10. Contact ──────────────────────────────────────────── */

.contact-info { max-width: 600px; }
.contact-info p { margin-bottom: 1.8rem; line-height: 1.8; }
.contact-info a { color: var(--rust); text-decoration: none; }
.contact-info a:hover { text-decoration: underline; }


/* ── 11. Homepage Splash ──────────────────────────────────── */

.splash {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  gap: 6rem;
  padding: 0 4rem;
}

.splash-img {
  max-height: 80vh;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.splash-text {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: fadeUp 1.1s cubic-bezier(0.22,1,0.36,1) both;
  animation-delay: 0.2s;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.splash-name {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: normal;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  display: block;
  max-width: 3em;
}

.splash-tagline {
  display: block;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(0.75rem, 1.2vw, 0.95rem);
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--ink);
}

.splash-fallback { background: var(--ink); }


/* ── 12. Lightbox ─────────────────────────────────────────── */

.lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 18, 15, 0.92);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: 2rem 1rem;
}

.lb-overlay.is-open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.lb-inner {
  position: relative;
  background: var(--cream);
  max-width: 900px;
  width: 100%;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  animation: lbIn 0.22s ease;
}

@keyframes lbIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 680px) {
  .lb-inner { grid-template-columns: 1fr; }
}

.lb-image-col {
  background: #1a1815;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
}

.lb-image-col img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  max-height: 80vh;
}

.lb-image-placeholder {
  width: 100%;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-style: italic;
  font-family: var(--font-display);
}

.lb-text-col {
  padding: 2rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 90vh;
}

.lb-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.lb-meta {
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.lb-statement {
  font-size: 0.93rem;
  line-height: 1.85;
  color: #2e2b27;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  flex: 1;
  overflow-y: auto;
}

.lb-statement p { margin-bottom: 0.9em; }
.lb-statement em { font-style: italic; }

.lb-statement blockquote {
  border-left: 3px solid var(--rust);
  margin: 1em 0;
  padding: 0.4em 1em;
  font-family: var(--font-display);
  font-style: italic;
  color: #3a3530;
}

.lb-footer {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.lb-full-link {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rust);
  text-decoration: none;
}

.lb-full-link:hover { color: var(--ink); }

.lb-nav { display: flex; gap: 0.8rem; }

.lb-nav button {
  background: none;
  border: 1px solid var(--border);
  padding: 0.35rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  color: var(--warm-gray);
  transition: border-color 0.2s, color 0.2s;
}

.lb-nav button:hover:not(:disabled) {
  border-color: var(--ink);
  color: var(--ink);
}

.lb-nav button:disabled { opacity: 0.3; cursor: default; }

.lb-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--warm-gray);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  z-index: 10;
  transition: color 0.2s;
}

.lb-close:hover { color: var(--ink); }

.lb-loading {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(245,242,237,0.7);
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.lb-loading.is-visible { display: flex; }

.lb-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--rust);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }


/* ── 13. Artwork Detail ───────────────────────────────────── */

.artwork-detail {
  max-width: 900px;
  margin: 0 auto;
}

.breadcrumb {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warm-gray);
  margin-bottom: 2rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--warm-gray); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb-sep { color: var(--border); }

.artwork-main-image {
  width: 100%;
  display: block;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.artwork-meta { margin-bottom: 2rem; }

.artwork-meta .artwork-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-style: italic;
  font-weight: 300;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.artwork-meta .artwork-year,
.artwork-meta .artwork-medium,
.artwork-meta .artwork-dimensions {
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 0.15rem;
}

.artwork-statement {
  border-top: 1px solid var(--border);
  padding-top: 1.8rem;
  margin-top: 0.5rem;
  font-size: 1rem;
  line-height: 1.85;
  color: #2e2b27;
}

.artwork-statement p { margin-bottom: 1.1em; }
.artwork-statement em { font-style: italic; }

.artwork-statement blockquote {
  border-left: 3px solid var(--rust);
  margin: 1.5em 0;
  padding: 0.5em 1.5em;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: #3a3530;
}

.artwork-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.artwork-nav a {
  color: var(--warm-gray);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-width: 40%;
}

.artwork-nav a:hover { color: var(--ink); }

.artwork-nav .nav-label { color: var(--rust); font-size: 0.7rem; }

.artwork-nav .nav-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.artwork-nav .nav-next { text-align: right; }
.artwork-nav .nav-spacer { flex: 1; }

.back-to-series {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rust);
  text-decoration: none;
}

.back-to-series:hover { color: var(--ink); }


/* ── 14. Footer ───────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--warm-gray);
  letter-spacing: 0.06em;
}


/* ── 15. Utilities ────────────────────────────────────────── */

.text-rust { color: var(--rust); }
.text-gray { color: var(--warm-gray); }


/* ── 16. Mobile Navigation ────────────────────────────────── */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s, opacity 0.25s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

@media (max-width: 700px) {

  /* Show hamburger button */
  .nav-toggle { display: flex; }

  /* Hide desktop nav by default, show as full-screen overlay when open */
  nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--cream);
    overflow-y: auto;
    z-index: 99;
    padding: 0.5rem 0 2rem;
    border-top: 1px solid var(--border);
  }

  nav.is-open { display: block; }

  nav ul {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }

  nav > ul > li {
    border-bottom: 1px solid var(--border);
  }

  nav > ul > li > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    font-size: 0.82rem;
    color: var(--ink);
  }

  /* Mobile dropdown accordion */
  .dropdown.is-open > a .dropdown-arrow {
    transform: rotate(180deg);
  }

  .dropdown-menu {
    display: none;
    position: static;
    border: none;
    border-left: 2px solid var(--border);
    padding: 0.25rem 0 0.75rem 1.5rem;
    margin: 0 2rem 0.5rem;
    max-height: none;
    overflow: visible;
    min-width: 0;
  }

  .dropdown.is-open .dropdown-menu { display: block; }

  .dropdown-menu a {
    padding: 0.55rem 0.5rem;
    font-size: 0.82rem;
  }

  /* Hide scroll indicators on mobile — not needed in accordion */
  .dropdown-scroll-up,
  .dropdown-scroll-down { display: none !important; }

  /* Reduce page padding on mobile */
  main { padding: 2rem 1.25rem 3rem; }

  /* Artwork nav: allow wrapping on very small screens */
  .artwork-nav { flex-wrap: wrap; gap: 1rem; }
  .artwork-nav a { max-width: 100%; }

  /* Artist statement: trim horizontal padding */
  .statement { padding: 1.2rem 1.25rem; }

  /* Touch-friendlier lightbox nav buttons */
  .lb-nav button { padding: 0.65rem 1.2rem; }

  /* Contact info fits comfortably */
  .contact-info { max-width: 100%; }
}

/* ── 17. Homepage splash — mobile ─────────────────────────── */

@media (max-width: 680px) {
  .splash {
    flex-direction: column;
    gap: 2.5rem;
    padding: 2rem 1.5rem;
    height: auto;
    min-height: 100vh;
  }

  .splash-img {
    max-height: 50vh;
    max-width: 100%;
    width: auto;
  }

  .splash-text {
    align-items: center;
    text-align: center;
  }
}
