@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600&display=swap');

:root {
  --paper: #f7f2e9;
  --ink: #211f1c;
  --accent: #2f4538;
  --accent-ink: #f7f2e9;
  --muted: #8a8175;
  --line: #dad3c4;
  --sold: #a23e2e;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 28px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.wordmark span {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}

.cart-link {
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}

/* ---------- gallery grid ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 28px;
  padding: 56px 0 80px;
}

@media (max-width: 800px) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 32px 20px; }
}
@media (max-width: 520px) {
  .gallery { grid-template-columns: 1fr; }
}

.tile { text-decoration: none; color: inherit; }

.tile-frame {
  border: 1px solid var(--line);
  background: #fff;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  position: relative;
}

.tile-frame img { width: 100%; height: 100%; object-fit: cover; }

.tile-frame .placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.85rem;
}

.tile-tag {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  padding: 3px 8px;
  color: var(--sold);
}

.tile-meta { padding-top: 12px; }

.tile-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
}

.tile-price {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

.empty-state {
  padding: 80px 0;
  text-align: center;
  color: var(--muted);
}

/* ---------- product page ---------- */

.product-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  padding: 48px 0 80px;
  align-items: start;
}

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

.product-image {
  border: 1px solid var(--line);
  background: #fff;
}

.back-link {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 20px;
}

.product-name {
  font-family: var(--serif);
  font-size: 2.1rem;
  font-weight: 500;
  margin: 0 0 6px;
  line-height: 1.15;
}

.product-facts {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.product-price {
  font-size: 1.3rem;
  margin-bottom: 24px;
}

.product-description {
  max-width: 46ch;
  margin-bottom: 28px;
}

.status-pill {
  display: inline-block;
  border: 1px solid var(--sold);
  color: var(--sold);
  font-size: 0.85rem;
  padding: 8px 16px;
}

/* ---------- buttons & forms ---------- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  padding: 12px 26px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border-radius: 2px;
}

.btn:hover { opacity: 0.9; }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.btn-quiet {
  background: none;
  border: none;
  color: var(--muted);
  text-decoration: underline;
  padding: 0;
  font-size: 0.85rem;
  cursor: pointer;
}

form.inline { display: inline; }

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 18px 0 6px;
}

label:first-child { margin-top: 0; }

input[type="text"],
input[type="number"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 0.95rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

textarea { min-height: 120px; resize: vertical; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 6px;
}
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }

/* ---------- cart & checkout ---------- */

.page-title {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 500;
  padding-top: 48px;
  margin-bottom: 8px;
}

.page-lede { color: var(--muted); margin-bottom: 32px; }

.cart-row {
  display: grid;
  grid-template-columns: 72px 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.cart-thumb {
  width: 72px; height: 90px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
}

.cart-name { font-family: var(--serif); font-size: 1.05rem; }
.cart-qty { color: var(--muted); font-size: 0.9rem; }

.cart-total {
  display: flex;
  justify-content: space-between;
  padding: 24px 0;
  font-size: 1.15rem;
}

.cart-actions { padding-bottom: 80px; }

.center-page {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  padding: 80px 0;
}

.center-page h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.7rem;
}

.center-page p { color: var(--muted); }

/* ---------- admin ---------- */

.admin-bar {
  background: var(--ink);
  color: var(--paper);
  padding: 14px 0;
}

.admin-bar .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-bar a { color: var(--paper); text-decoration: none; margin-left: 18px; font-size: 0.9rem; }

.admin-section { padding: 40px 0; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

th { color: var(--muted); font-weight: 500; }

.thumb-sm {
  width: 44px; height: 55px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.status-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.status-badge.active { border-color: var(--accent); color: var(--accent); }
.status-badge.sold { border-color: var(--sold); color: var(--sold); }

.form-card {
  max-width: 560px;
  margin-top: 24px;
}

.error-box {
  background: #fbe9e6;
  border: 1px solid var(--sold);
  color: var(--sold);
  padding: 12px 16px;
  margin-top: 20px;
  font-size: 0.9rem;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.current-image { margin-top: 10px; width: 120px; border: 1px solid var(--line); }

footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.85rem;
}
