/* Royilda & Co. — client gallery demo. Light, minimal, no build step. */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #1d1a16;
  --ink-soft: #5c554b;
  --line: #e4ded4;
  --accent: #9a7b4f;
  --accent-dark: #7d6238;
  --ok: #3f6b4f;
  --warn-bg: #fdf3e0;
  --warn-ink: #7a5a17;
  --badge-selected-bg: #f3e5c3;
  --badge-selected-ink: #6d5312;
  --badge-claimed-bg: #dde5da;
  --badge-claimed-ink: #3c5541;
  --badge-purchased-bg: #1d1a16;
  --badge-purchased-ink: #f5efe4;
  --radius: 10px;
  --shadow: 0 8px 30px rgba(29, 26, 22, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3, .brand {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: 0.01em;
}

a { color: var(--accent-dark); }

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  padding: 9px 18px;
  border-radius: 999px;
}
button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
button.ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: transparent;
}
button:disabled { opacity: 0.38; cursor: not-allowed; }
button:not(:disabled):hover { filter: brightness(1.12); }

input, textarea, select {
  font: inherit;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
label { display: block; font-size: 13px; color: var(--ink-soft); margin: 14px 0 5px; }
label:first-child { margin-top: 0; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px 140px; }

/* ---------- header ---------- */
.site-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; padding: 26px 0 6px; flex-wrap: wrap;
}
.brand { font-size: 26px; letter-spacing: 0.14em; text-transform: uppercase; }
.brand small { display: block; font-size: 11px; letter-spacing: 0.3em; color: var(--ink-soft); text-transform: uppercase; margin-top: 2px; }
.head-meta { color: var(--ink-soft); font-size: 13px; text-align: right; }

/* ---------- demo viewer switcher ---------- */
.demo-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #f1ece2; border: 1px dashed var(--accent);
  border-radius: var(--radius); padding: 10px 14px; margin: 14px 0 4px;
  font-size: 13px;
}
.demo-bar select { width: auto; padding: 5px 8px; }
.demo-bar .tag {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-dark); font-weight: 700;
}

/* ---------- banners ---------- */
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius); padding: 14px 18px; margin: 16px 0;
}
.banner.warn { background: var(--warn-bg); border-color: #ecd9a8; color: var(--warn-ink); }
.banner strong { font-weight: 600; }

/* ---------- gate / cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; max-width: 440px;
  margin: 60px auto; box-shadow: var(--shadow);
}
.card h1 { margin-top: 0; font-size: 24px; }
.card p { color: var(--ink-soft); }
.error { color: #9c2b1e; font-size: 13px; min-height: 18px; }

/* ---------- photo grid ---------- */
.section-title { margin: 34px 0 4px; font-size: 22px; }
.section-sub { color: var(--ink-soft); margin: 0 0 16px; }

.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.tile {
  position: relative; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.tile img {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  cursor: zoom-in; background: #eee7da;
}
.tile.locked img { filter: saturate(0.55); }
.tile .tile-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; gap: 8px;
}
.tile .fname { font-size: 12px; color: var(--ink-soft); font-family: ui-monospace, Menlo, monospace; }
.pick-btn {
  border-radius: 999px; padding: 5px 12px; font-size: 13px;
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  white-space: nowrap;
}
.pick-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pick-btn:disabled { cursor: not-allowed; }

.badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 4px 9px; border-radius: 999px; pointer-events: none;
}
.badge.selected { background: var(--badge-selected-bg); color: var(--badge-selected-ink); }
.badge.claimed { background: var(--badge-claimed-bg); color: var(--badge-claimed-ink); }
.badge.purchased { background: var(--badge-purchased-bg); color: var(--badge-purchased-ink); }
.badge.mine { background: var(--accent); color: #fff; }

/* ---------- sticky tally ---------- */
.tally {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
}
.tally-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.tally .nums { font-size: 14px; }
.tally .nums strong { font-size: 16px; }
.tally .spacer { flex: 1; }
.tally .note { font-size: 12px; color: var(--ink-soft); width: 100%; }

/* ---------- lightbox / modal ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; display: none;
  background: rgba(24, 20, 16, 0.72); align-items: center; justify-content: center;
  padding: 20px;
}
.overlay.open { display: flex; }
.sheet {
  background: var(--surface); border-radius: 14px; max-width: 880px; width: 100%;
  max-height: 92vh; overflow: auto; padding: 22px; box-shadow: var(--shadow);
}
.sheet.narrow { max-width: 430px; }
.sheet img.preview { width: 100%; border-radius: 8px; display: block; }
.sheet .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.sheet .row .spacer { flex: 1; }
.price-line { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.price-line.total { font-weight: 700; border-bottom: none; }

/* ---------- finals ---------- */
.finals-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.final-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.final-tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.final-tile .tile-foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; }
.dl-btn { font-size: 13px; padding: 5px 12px; }

/* ---------- filename list ---------- */
.filelist {
  background: #fbf9f5; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; font-family: ui-monospace, Menlo, monospace; font-size: 13px;
  white-space: pre-wrap; word-break: break-all;
}
.pill {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: #efe9dd; color: var(--ink-soft); margin-left: 8px; font-family: inherit;
}
.pill.locked { background: var(--badge-claimed-bg); color: var(--badge-claimed-ink); }

/* ---------- admin ---------- */
.admin-grid { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; margin-top: 20px; }
@media (max-width: 860px) { .admin-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel h2 { margin-top: 0; font-size: 19px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.status { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #efe9dd; white-space: nowrap; }
.status.approved { background: var(--badge-claimed-bg); color: var(--badge-claimed-ink); }
.status.expired { background: #f3d9d2; color: #8a3524; }
.detail { margin-top: 18px; }
.muted { color: var(--ink-soft); font-size: 13px; }
.hidden { display: none !important; }
