/* ---------------------------------------------------------------------------
   Love Letter palette — slate blue, warm cream, black
   ---------------------------------------------------------------------------
   Fonts: the design calls for "Slippery Regular". Until you have the licensed
   font files, we use Fraunces (a free elegant look-alike). To switch:
     1. Drop Slippery-Regular.woff2 (or .otf/.ttf) into public/assets/fonts/
     2. Un-comment the @font-face block below
     3. Change --font to 'Slippery'
--------------------------------------------------------------------------- */

/*
@font-face {
  font-family: 'Slippery';
  src: url('/assets/fonts/Slippery-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}
*/

:root {
  --blue: #3c5470;
  --blue-deep: #2e4258;
  --cream: #ece7dc;
  --cream-light: #f6f3ea;
  --cream-dark: #d9d2c0;
  --ink: #0d0d0d;
  --font: 'Fraunces', 'Slippery', Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }

/* ------------------------------ Header ---------------------------------- */

.site-header {
  text-align: center;
  padding: 4rem 1.5rem 2.5rem;
}

.site-header .eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1rem;
}

.site-header h1 {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.1;
}

.site-header .rule {
  width: 72px;
  height: 2px;
  background: var(--blue);
  margin: 1.4rem auto;
  border: none;
}

.site-header p.intro {
  max-width: 34rem;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #3a3a3a;
}

/* ------------------------------ Card grid ------------------------------- */

/* Masonry-style columns: cards keep their natural height and stack neatly.
   3 columns on desktop, 2 on tablet, 1 on mobile. */
.grid {
  columns: 3;
  column-gap: 1.5rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

@media (max-width: 900px) { .grid { columns: 2; } }
@media (max-width: 600px) { .grid { columns: 1; } }

.card {
  background: var(--cream-light);
  border: 1px solid var(--cream-dark);
  border-top: 4px solid var(--blue);
  padding: 1.75rem 1.6rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

.card .card-img {
  display: block;
  width: calc(100% + 3.2rem);
  margin: -1.75rem -1.6rem 0.5rem;
  max-height: 340px;
  object-fit: cover;
  background: var(--cream-dark);
}

.card.bought .card-img {
  filter: grayscale(1);
  opacity: 0.4;
}

.card:not(.bought):hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(13, 13, 13, 0.08);
}

.card h2 {
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
}

.card .price {
  color: var(--blue);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.card .desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #3a3a3a;
  flex: 1;
}

.card .actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Bought state — crossed out, still visible */
.card.bought {
  background: transparent;
  border-top-color: var(--cream-dark);
}
.card.bought h2 { text-decoration: line-through; }
.card.bought h2,
.card.bought .price,
.card.bought .desc { opacity: 0.45; }

.stamp {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--cream-light);
  background: var(--blue);
  padding: 0.35rem 0.7rem;
}

/* ------------------------------ Buttons --------------------------------- */

.btn {
  font-family: var(--font);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.65rem 1.2rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover { background: var(--ink); color: var(--cream-light); }

.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--cream-light);
}
.btn.primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }

.btn.subtle {
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}
.btn.subtle:hover { background: transparent; color: var(--blue); }

.confirm-note {
  font-size: 0.85rem;
  color: var(--blue);
  font-style: italic;
}

/* ------------------------------ Login ----------------------------------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  background: var(--cream-light);
  border: 1px solid var(--cream-dark);
  border-top: 4px solid var(--blue);
  padding: 3rem 2.5rem;
  max-width: 26rem;
  width: 100%;
  text-align: center;
}

.login-card h1 {
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.login-card p.hint {
  color: #3a3a3a;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.6rem;
}

.login-card input[type='password'] {
  font-family: var(--font);
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  border: 1px solid var(--cream-dark);
  background: #fff;
  color: var(--ink);
  margin-bottom: 1rem;
  text-align: center;
  letter-spacing: 0.08em;
}

.login-card input[type='password']:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.login-card .btn { width: 100%; }

.error {
  color: #a04040;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ------------------------------ Admin ----------------------------------- */

.admin-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

.admin-wrap h1 { font-size: 2rem; font-weight: 500; margin-bottom: 0.3rem; }
.admin-wrap .sub { color: #3a3a3a; margin-bottom: 2rem; }

.admin-form {
  background: var(--cream-light);
  border: 1px solid var(--cream-dark);
  border-top: 4px solid var(--blue);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  display: grid;
  gap: 0.8rem;
}

.admin-form h2 { font-size: 1.2rem; font-weight: 500; }

.admin-form input,
.admin-form textarea {
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--cream-dark);
  background: #fff;
  color: var(--ink);
  width: 100%;
}

.admin-form textarea { resize: vertical; min-height: 4rem; }

.admin-form input:focus,
.admin-form textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

.form-row { display: grid; grid-template-columns: 2fr 1fr; gap: 0.8rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.admin-item {
  background: var(--cream-light);
  border: 1px solid var(--cream-dark);
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-item .thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--cream-dark);
  flex-shrink: 0;
}

.admin-item .thumb.none {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream-dark);
  font-size: 1.3rem;
  background: #fff;
}

.admin-item .meta { flex: 1; min-width: 200px; }
.admin-item .meta strong { font-size: 1.05rem; font-weight: 500; }
.admin-item .meta .small { font-size: 0.85rem; color: #3a3a3a; }

.admin-item .row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.topbar {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1.5rem 0;
}

.topbar form { display: inline; }
.topbar .btn { font-size: 0.7rem; padding: 0.4rem 0.8rem; }

.empty-note {
  text-align: center;
  color: #3a3a3a;
  font-style: italic;
  padding: 3rem 0;
}
