/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --bg:          #faf9f7;
  --surface:     #ffffff;
  --text:        #1a1a1a;
  --text-muted:  #6b6560;
  --border:      #e4e0da;
  --accent:      #7c6a55;
  --accent-dark: #5c4f3d;
  --available:   #3a7d44;
  --sold:        #888;
  --gap:         1.5rem;
  --radius:      4px;
  --transition:  0.2s ease;
  --font:        'Georgia', 'Times New Roman', serif;
  --font-ui:     system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #151412;
    --surface:    #1e1c1a;
    --text:       #e8e4de;
    --text-muted: #9a9490;
    --border:     #302d29;
    --accent:     #a89070;
    --accent-dark:#c8aa88;
  }
}

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

body.lightbox-open { overflow: hidden; }

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

/* ============================================================
   Header
   ============================================================ */
header {
  position: relative;
  padding: 3rem var(--gap) 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.artist-name {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: normal;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.artist-tagline {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============================================================
   Site navigation
   ============================================================ */
.site-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.25rem;
}

.site-nav a {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

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

/* Language switcher */
.lang-switch {
  position: absolute;
  top: 1.25rem;
  right: var(--gap);
  display: flex;
  gap: 0.25rem;
}

.lang-switch button {
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.15rem;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius);
  opacity: 0.4;
  transition: opacity var(--transition), border-color var(--transition);
}

.lang-switch button:hover {
  opacity: 0.75;
}

.lang-switch button.active {
  opacity: 1;
  border-color: var(--accent);
}

/* ============================================================
   Filter bars
   ============================================================ */
#filters {
  border-bottom: 1px solid var(--border);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem var(--gap);
  border-top: 1px solid var(--border);
}

.filter-row:first-child {
  border-top: none;
}

.filter-row-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 7rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-pills button {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 2rem;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.filter-pills button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-pills button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

@media (max-width: 600px) {
  .filter-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ============================================================
   Gallery grid
   ============================================================ */
#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
  padding: var(--gap);
  max-width: 1400px;
  margin: 0 auto;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-ui);
  padding: 4rem 0;
}

/* ============================================================
   Card
   ============================================================ */
.card {
  position: relative;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}

.card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 30% 30%;
  transition: object-position 1.5s ease;
}

.card:hover img {
  animation: img-pan 6s linear infinite alternate;
}

@keyframes img-pan {
  from { object-position: 20% 20%; }
  to   { object-position: 80% 80%; }
}

.card figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.5rem 1rem 0.9rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--transition), transform var(--transition);
}

.card:hover figcaption {
  opacity: 1;
  transform: translateY(0);
}

.card-title {
  font-size: 1rem;
  font-weight: normal;
}

.card-meta {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

/* ============================================================
   Lightbox overlay
   ============================================================ */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

#lightbox.open {
  visibility: visible;
  opacity: 1;
}

#lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 9, 8, 0.92);
}

/* ============================================================
   Lightbox panel
   ============================================================ */
#lightbox-panel {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  max-height: 100vh;
}

/* Image area */
#lightbox-image-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem 3rem 3rem;
  overflow: hidden;
}

#lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 6rem);
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* Metadata sidebar */
#lightbox-meta {
  flex: 0 0 300px;
  width: 300px;
  background: var(--surface);
  padding: 3.5rem 2rem 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

#meta-title {
  font-size: 1.4rem;
  font-weight: normal;
  line-height: 1.3;
}

#meta-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

#meta-details dt {
  color: var(--text-muted);
  white-space: nowrap;
}

#meta-details dd {
  color: var(--text);
}

#meta-description {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
  flex: 1;
}

/* Exhibitions list */
#meta-exhibitions { display: flex; flex-direction: column; gap: 0.4rem; }

.exhibitions-list {
  list-style: disc;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.exhibitions-list li {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Zoom / full-size button on lightbox image */
#lightbox-image-wrap {
  position: relative;
}

#lightbox-zoom {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  width: 2.2rem;
  height: 2.2rem;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
}

#lightbox-image-wrap:hover #lightbox-zoom {
  opacity: 1;
}

#lightbox-zoom:hover {
  background: rgba(0, 0, 0, 0.7);
}

#lightbox-zoom svg {
  width: 1rem;
  height: 1rem;
}

/* Enquire link */
.enquire-link {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  align-self: flex-start;
  transition: opacity var(--transition);
}
.enquire-link:hover { opacity: 0.7; }

/* Tags */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 2rem;
  background: var(--border);
  color: var(--text-muted);
}

/* Availability badge */
.badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 2rem;
  align-self: flex-start;
}

.badge-available {
  background: rgba(58, 125, 68, 0.12);
  color: var(--available);
  border: 1px solid rgba(58, 125, 68, 0.3);
}

.badge-sold {
  background: rgba(136, 136, 136, 0.1);
  color: var(--sold);
  border: 1px solid rgba(136, 136, 136, 0.25);
}

/* ============================================================
   Lightbox controls
   ============================================================ */
#lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox-close:hover { background: rgba(255,255,255,0.25); }

#lightbox-prev,
#lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.8rem;
  height: 2.8rem;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.1rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox-prev { left: 1rem; }
#lightbox-next { right: calc(300px + 1rem); }

#lightbox-prev:hover,
#lightbox-next:hover { background: rgba(255,255,255,0.25); }

#lightbox-prev:disabled,
#lightbox-next:disabled { opacity: 0.2; cursor: default; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 700px) {
  #lightbox-panel {
    flex-direction: column;
    overflow-y: auto;
  }

  #lightbox-image-wrap {
    padding: 3.5rem 1rem 1rem;
    flex: none;
  }

  #lightbox-img {
    max-height: 55vh;
  }

  #lightbox-meta {
    flex: none;
    width: 100%;
    padding: 1.5rem 1.25rem 2rem;
  }

  #lightbox-next {
    right: 1rem;
  }
}

/* ============================================================
   Contact page
   ============================================================ */
.contact-wrap {
  max-width: 680px;
  margin: 3rem auto;
  padding: 0 var(--gap);
}

.contact-bio {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.contact-block {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.25rem 1.5rem;
  align-items: baseline;
}

.contact-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 0.1rem;
}

.contact-block p,
.contact-block a {
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}

.contact-block a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.contact-sub {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contact-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.contact-links li {
  font-size: 1rem;
}

@media (max-width: 500px) {
  .contact-block {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  text-align: center;
  padding: 3rem var(--gap);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
