/* ─── Reset & base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

:root {
  --bg:        #ffffff;
  --bg-alt:    #f8f7f4;
  --text:      #1a1a1a;
  --muted:     #767676;
  --border:    #e5e2db;
  --accent:    #4a3728;
  --serif:     Georgia, 'Times New Roman', serif;
  --sans:      -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --max:       1180px;
  --gap:       2rem;
}

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* ─── Header ───────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-left: 1.5rem;
  transition: color 0.2s;
}

nav a:first-child { margin-left: 0; }
nav a:hover { color: var(--text); }

/* Language switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.lang-btn {
  background: none;
  border: none;
  padding: 0.25rem 0.55rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-btn + .lang-btn {
  border-left: 1px solid var(--border);
}

.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--text); color: #fff; }

/* ─── Hero ─────────────────────────────────────────────── */
.hero {
  padding: 7rem 0 6rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-name {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: normal;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero-sub {
  color: var(--muted);
  font-style: italic;
  font-size: 1.05rem;
}

/* ─── Gallery section ──────────────────────────────────── */
.gallery-section {
  padding: 5rem 0 6rem;
}

.section-title {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: normal;
  text-align: center;
  margin-bottom: 2rem;
}

/* ─── Filter area ──────────────────────────────────────── */
.gallery-filters {
  margin-bottom: 3rem;
}

/* Search + sale toggle row */
.filter-top-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

.gallery-search {
  width: 100%;
  padding: 0.6rem 0.85rem 0.6rem 2.2rem;
  border: 1px solid var(--border);
  background: #fff;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--text);
  border-radius: 3px;
  transition: border-color 0.2s;
}

.gallery-search:focus {
  outline: none;
  border-color: var(--text);
}

/* Clear the browser's default search cancel button */
.gallery-search::-webkit-search-cancel-button { -webkit-appearance: none; }

.sale-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  user-select: none;
  transition: color 0.15s;
}

.sale-toggle:hover { color: var(--text); }

.sale-toggle input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
  cursor: pointer;
  accent-color: var(--text);
  flex-shrink: 0;
}

/* Filter groups (Style / Year / Exhibition) */
.filter-group {
  margin-bottom: 1rem;
  text-align: center;
}

.filter-group[hidden] { display: none; }

.filter-group-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.filter-btn {
  padding: 0.35rem 1.1rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.18s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

/* Grid */
.paintings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: var(--gap);
}

.loading-msg {
  grid-column: 1/-1;
  text-align: center;
  color: var(--muted);
  padding: 3rem 0;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 3rem 0;
  font-style: italic;
}

/* Painting card */
.painting-card {
  cursor: pointer;
}

.painting-card:focus { outline: 2px solid var(--accent); outline-offset: 4px; }

.painting-img-wrap {
  position: relative;
  background: var(--bg-alt);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}

/* shimmer sweep while image is loading */
.painting-img-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.55) 50%, transparent 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

/* remove shimmer once loaded */
.painting-img-wrap:has(img.loaded)::before { display: none; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.painting-card:hover .painting-img-wrap {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.10);
}

.painting-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease;
  position: relative;
  z-index: 2;
}

.painting-img-wrap img.loaded { opacity: 1; }

/* timeline thumbnails — fade only, no shimmer (too small) */
.timeline-thumb img {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.timeline-thumb img.loaded { opacity: 1; }

.painting-info {
  padding: 0.7rem 0 0;
}

.painting-title {
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: normal;
  margin-bottom: 0.2rem;
}

.painting-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.painting-price {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.25rem;
}

.painting-price.is-sold-text {
  color: #999;
  font-weight: 500;
  font-style: italic;
}


/* ─── Lightbox ─────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.93);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] { display: none; }

.lb-inner {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  max-width: 90vw;
  max-height: 90vh;
}

.lb-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.lb-img-wrap img {
  max-width: 65vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

.lb-info {
  color: #fff;
  min-width: 200px;
  max-width: 260px;
  padding-top: 0.5rem;
}

.lb-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: normal;
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.lb-meta {
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.lb-desc {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  line-height: 1.65;
}

.lb-price {
  margin-top: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
}

.lb-price[hidden] { display: none; }

.lb-price--sold {
  color: #bbb;
  font-style: italic;
  font-weight: 400;
  font-size: 0.9rem;
}

.lb-exhibition {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  line-height: 1.5;
}

.lb-exhibition[hidden] { display: none; }

.lb-close {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.65;
  line-height: 1;
  transition: opacity 0.15s;
}

.lb-close:hover { opacity: 1; }

.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  opacity: 0.5;
  padding: 1rem;
  transition: opacity 0.15s;
  line-height: 1;
}

.lb-nav:hover { opacity: 1; }
.lb-prev { left: 0.5rem; }
.lb-next { right: 0.5rem; }

/* ─── Timeline ─────────────────────────────────────────── */
.timeline-section {
  padding: 5rem 0;
  background: var(--bg);
}

.timeline-section[hidden] { display: none; }

.timeline-list {
  max-width: 720px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0 2.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.timeline-item:last-child { border-bottom: none; }

.timeline-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 0.25rem;
}

.timeline-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: normal;
  margin-bottom: 0.3rem;
}

.timeline-location {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
}

.timeline-type {
  font-size: 0.8rem;
  color: var(--accent);
  font-style: italic;
  margin-bottom: 0.2rem;
}

.timeline-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 0.4rem;
}

.timeline-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.timeline-thumb {
  width: 72px;
  height: 72px;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: var(--bg-alt);
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.timeline-thumb:hover { opacity: 0.75; }

.timeline-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.timeline-thumb-more {
  width: 72px;
  height: 72px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .timeline-date { padding-top: 0; }
}

/* ─── About ────────────────────────────────────────────── */
.about-section {
  padding: 5.5rem 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-inner {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 4rem;
  align-items: start;
  max-width: 860px;
  margin: 0 auto;
}

.about-photo-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--border);
  border: 1px dashed var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.about-photo {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
}

.about-text h2 {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: normal;
  margin-bottom: 1.25rem;
}

.about-text p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 0.9rem;
}

/* ─── Contact ──────────────────────────────────────────── */
.contact-section {
  padding: 5.5rem 0 6rem;
}

.contact-inner {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.contact-inner h2 {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: normal;
  margin-bottom: 0.5rem;
}

.contact-sub {
  color: var(--muted);
  font-style: italic;
  margin-bottom: 2.5rem;
}

.contact-form { text-align: left; }

/* Honeypot — off-screen, invisible to real users */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  background: #fff;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--text);
  border-radius: 2px;
  transition: border-color 0.2s;
}

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

.form-group textarea { resize: vertical; }

.btn-submit {
  width: 100%;
  padding: 0.85rem;
  background: var(--text);
  color: #fff;
  border: none;
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  margin-top: 0.5rem;
  transition: background 0.2s;
}

.btn-submit:hover { background: var(--accent); }

.form-msg {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 2px;
  font-size: 0.9rem;
  text-align: center;
}

.form-msg[hidden] { display: none; }
.form-msg.success { background: #edf7ed; color: #2d6a2d; border: 1px solid #b8dcb8; }
.form-msg.error   { background: #fdf0f0; color: #9a2020; border: 1px solid #e8c0c0; }

/* ─── Footer ───────────────────────────────────────────── */
footer {
  padding: 1.75rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 720px) {
  .about-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-photo-placeholder { max-width: 220px; margin: 0 auto; }

  .lb-inner {
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
  }

  .lb-img-wrap img {
    max-width: 90vw;
    max-height: 55vh;
  }

  .lb-info { min-width: unset; max-width: 90vw; }

  nav a { margin-left: 1rem; }
  .hero { padding: 4rem 0 3rem; }
}
