/* Design tokens */
:root {
  --bg:      #faf6f0;
  --text:    #1a1208;
  --accent:  #e8437a;
  --muted:   #8a7d6e;
  --border:  #e8ddd0;
  --white:   #ffffff;
}

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

/* Base */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Site nav ─────────────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-nav {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); }

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

/* ── Gallery page ─────────────────────────────────────────────────────── */
.gallery-header {
  max-width: 1400px;
  margin: 3rem auto 0;
  padding: 0 2rem;
}

.gallery-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  margin-bottom: 0.4rem;
}

.gallery-header p { color: var(--muted); }

/* Filter pills */
.filter-pills {
  max-width: 1400px;
  margin: 1.75rem auto 0;
  padding: 0 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-pill {
  padding: 0.4rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: capitalize;
}

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

/* Grid */
.gallery-grid {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem 5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Card */
.artwork-item { border-radius: 4px; overflow: hidden; }

.artwork-item a { display: block; position: relative; overflow: hidden; }

.artwork-item img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.artwork-item:hover img { transform: scale(1.04); }

.artwork-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 1.75rem 1rem 1rem;
  background: linear-gradient(transparent, rgba(26,18,8,.72));
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.artwork-item:hover .artwork-overlay { transform: translateY(0); }

.artwork-overlay h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.15rem;
}

.artwork-overlay .category-tag {
  font-size: 0.75rem;
  color: rgba(255,255,255,.6);
  text-transform: capitalize;
  letter-spacing: 0.05em;
}

.artwork-overlay .price {
  font-size: 0.9rem;
  color: rgba(255,255,255,.85);
  font-weight: 500;
  margin-top: 0.2rem;
}

/* Sold ribbon */
.sold-ribbon {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.25rem 0.75rem;
  background: rgba(26,18,8,.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 2px;
  pointer-events: none;
}

/* Sold label on detail page */
.sold-label { color: var(--muted); }

/* Empty state */
.empty-gallery {
  grid-column: 1 / -1;
  padding: 5rem 0;
  text-align: center;
  color: var(--muted);
}

.empty-gallery h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-style: italic;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

/* ── Artwork detail ────────────────────────────────────────────────────── */
.artwork-detail {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 2rem 5rem;
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 4rem;
  align-items: start;
}

.artwork-detail-image img { width: 100%; border-radius: 4px; }

.artwork-detail-info .category-label {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.artwork-detail-info h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.price-display {
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.description {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.sold-note {
  color: var(--muted);
  margin-bottom: 1rem;
}

.back-link {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.back-link a:hover { color: var(--accent); }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  padding: 0.8rem 1.75rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
}

.btn-primary:hover { opacity: 0.88; }

.btn-secondary {
  display: inline-block;
  padding: 0.8rem 1.75rem;
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s;
  text-decoration: none;
}

.btn-secondary:hover { border-color: var(--text); }

/* ── Admin layout ──────────────────────────────────────────────────────── */
.admin-body { background: #f5f4f2; }

.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 210px;
  flex-shrink: 0;
  background: var(--text);
  padding: 2rem 1.5rem;
}

.admin-logo {
  font-family: 'Playfair Display', serif;
  color: #fff;
  font-size: 1.15rem;
  margin-bottom: 0.2rem;
}

.admin-subtitle {
  color: rgba(255,255,255,.4);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.admin-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border: none;
  padding: 0;
}

.admin-sidebar nav a {
  display: block;
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  font-size: 0.88rem;
  color: rgba(255,255,255,.6);
  transition: all 0.2s;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.admin-main {
  flex: 1;
  padding: 2.5rem 3rem;
  overflow: auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.admin-main h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
}

/* Admin table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.admin-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.admin-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafafa; }

.admin-table img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 3px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-available   { background: #d1fae5; color: #065f46; }
.badge-unavailable { background: #fee2e2; color: #991b1b; }
.badge-sold        { background: #f3f4f6; color: #6b7280; }
.badge-category    { background: rgba(232,67,122,.1); color: var(--accent); text-transform: capitalize; }

/* Small buttons */
.action-buttons { display: flex; gap: 0.4rem; }

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.btn-edit   { background: #e9ecef; color: var(--text);  }
.btn-edit:hover   { background: #dee2e6; }
.btn-delete { background: #fee2e2; color: #dc2626; }
.btn-delete:hover { background: #fecaca; }
.btn-toggle { background: #d1fae5; color: #065f46; }
.btn-toggle:hover { background: #a7f3d0; }
.btn-toggle.unavailable { background: #fef9c3; color: #854d0e; }
.btn-toggle.unavailable:hover { background: #fef08a; }

/* Forms */
.form-max-width { max-width: 580px; }

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.45rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s;
}

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

.form-group input[type="file"] { background: none; padding: 0.3rem 0; border: none; }

.form-group textarea { resize: vertical; min-height: 90px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.form-check input[type="checkbox"] { width: auto; accent-color: var(--accent); }

.error-message {
  padding: 0.75rem 1rem;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
}

/* ── Auth pages ────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 390px;
  padding: 2.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.auth-card h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  margin-bottom: 0.2rem;
}

.auth-card .subtitle {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 1.75rem;
}

/* ── About page ────────────────────────────────────────────────────────── */
.about-wrap {
  max-width: 760px;
  margin: 3rem auto 5rem;
  padding: 0 2rem;
}

.about-wrap--with-photo {
  max-width: 1000px;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 4rem;
  align-items: start;
}

.about-photo img {
  width: 100%;
  border-radius: 4px;
  display: block;
}

.about-wrap h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

.artist-statement p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.artist-statement p:last-child { margin-bottom: 0; }

.muted-note { color: var(--muted); }

/* Admin save notice */
.save-notice {
  padding: 0.75rem 1rem;
  background: #d1fae5;
  color: #065f46;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
}

/* ── Contact page ──────────────────────────────────────────────────────── */
.contact-wrap {
  max-width: 620px;
  margin: 3rem auto 5rem;
  padding: 0 2rem;
}

.contact-wrap h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  margin-bottom: 0.6rem;
}

.contact-intro {
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.contact-form .form-group { margin-bottom: 1.4rem; }

.contact-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.45rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
}

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

.contact-form textarea { resize: vertical; min-height: 130px; }

.contact-success {
  padding: 1.25rem 1.5rem;
  background: #d1fae5;
  color: #065f46;
  border-radius: 6px;
  font-size: 1rem;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .gallery-grid           { grid-template-columns: repeat(2, 1fr); }
  .artwork-detail         { grid-template-columns: 1fr; gap: 2rem; }
  .about-wrap--with-photo { grid-template-columns: 1fr; gap: 2rem; }
  .about-photo img        { max-width: 340px; }
}

@media (max-width: 620px) {
  .gallery-grid   { grid-template-columns: 1fr; }
  .site-nav       { padding: 1rem 1.25rem; }
  .nav-links      { gap: 1.2rem; }
  .gallery-header,
  .filter-pills,
  .gallery-grid   { padding-left: 1.25rem; padding-right: 1.25rem; }
  .gallery-header h1 { font-size: 1.8rem; }
  .form-row       { grid-template-columns: 1fr; }
}
