/* ============================================================
   SeforimForSale — visual theme
   Dark editorial theme matched to SportsSatireAI.com:
   near-black surfaces, crimson-red accent, blue highlight,
   Playfair Display headings + Source Serif body + DM Sans UI.
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,700&display=swap");

:root {
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --surface-2: #252525;
  --ink: #ffffff;
  --muted: #a8a8a8;
  --accent: #dc3545;       /* crimson red */
  --accent-dark: #b02a37;
  --accent-soft: rgba(220, 53, 69, 0.14);
  --gold: #0d6efd;         /* blue highlight */
  --gold-soft: rgba(13, 110, 253, 0.16);
  --border: #333333;
  --danger: #dc3545;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.55);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --body: "Source Serif 4", Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Noto Sans Hebrew", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.6;
  background-color: var(--bg);
  /* Soft color blooms over a near-black gradient. */
  background-image:
    radial-gradient(900px 500px at 12% -8%, rgba(220, 53, 69, 0.12), transparent 60%),
    radial-gradient(800px 480px at 100% 0%, rgba(13, 110, 253, 0.12), transparent 55%),
    radial-gradient(700px 600px at 50% 120%, rgba(220, 53, 69, 0.08), transparent 60%),
    linear-gradient(180deg, #0d0d0d 0%, #131313 100%);
  background-attachment: fixed;
}

h1, h2, h3 { font-family: var(--serif); letter-spacing: -0.01em; }

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: #ef5a69; text-decoration: underline; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13, 13, 13, 0.78);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.site-header .inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--gold); }
.header-spacer { flex: 1; }

/* ---- Layout ---- */
.container { max-width: 1120px; margin: 0 auto; padding: 30px 22px 72px; }
.page-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 900;
  margin: 6px 0 6px;
  line-height: 1.15;
  background: linear-gradient(120deg, #ffffff, var(--accent) 55%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtle { color: var(--muted); }

/* ---- Search ---- */
.search-bar { display: flex; gap: 10px; margin: 22px 0 30px; }
.search-bar input {
  flex: 1;
  padding: 14px 18px;
  font-size: 1rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-bar input::placeholder { color: #6f6f6f; }
.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  box-shadow: 0 4px 14px -4px rgba(220, 53, 69, 0.5);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.btn:hover {
  text-decoration: none;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px rgba(220, 53, 69, 0.6);
}
.btn:active { transform: translateY(0); }
.btn.secondary {
  background: var(--surface);
  color: #ffffff;
  border: 1.5px solid var(--accent);
  box-shadow: var(--shadow-sm);
}
.btn.secondary:hover { background: var(--accent-soft); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: linear-gradient(135deg, #e0414f, var(--danger)); box-shadow: 0 4px 14px -4px rgba(220, 53, 69, 0.5); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.block { display: flex; width: 100%; }

/* ---- Book grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 22px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent); text-decoration: none; }
.card .thumb {
  aspect-ratio: 3 / 4;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255,255,255,0.12), transparent 60%),
    linear-gradient(160deg, #b02a37 0%, #dc3545 50%, #8f2029 100%);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: 2.8rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .title { font-family: var(--serif); font-weight: 700; font-size: 1.08rem; color: var(--ink); line-height: 1.25; }
.card .author { color: var(--muted); font-size: 0.9rem; }
.card .meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 12px; }
.card .price { font-weight: 700; font-size: 1.05rem; color: var(--accent); }
.badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--gold-soft);
  color: #6ea8fe;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(13, 110, 253, 0.4);
}

/* ---- Detail page ---- */
.detail { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 38px; align-items: start; }
.detail .photo {
  aspect-ratio: 3 / 4;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255,255,255,0.12), transparent 60%),
    linear-gradient(160deg, #b02a37 0%, #dc3545 50%, #8f2029 100%);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.92); font-size: 4.5rem;
  text-shadow: 0 3px 12px rgba(0,0,0,0.4);
}
/* Image gallery (cover + inside page) with prev/next arrows. */
.gallery { position: relative; }
.gallery .photo { transition: background-image 0.15s ease; }
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.gallery-arrow:hover { background: rgba(0, 0, 0, 0.75); }
.gallery-arrow.prev { left: 10px; }
.gallery-arrow.next { right: 10px; }
.gallery-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.gallery-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease;
}
.gallery-dots .dot.active { background: #fff; }

.detail h1 { margin: 0 0 4px; font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.detail .price-lg {
  font-family: var(--serif);
  font-size: 2rem; font-weight: 900; margin: 14px 0;
  color: var(--accent);
}
.detail .desc { white-space: pre-wrap; margin: 18px 0; color: var(--text-secondary, #e0e0e0); font-family: var(--body); }
.kv { display: flex; gap: 10px; margin: 6px 0; }
.kv .k { color: var(--muted); min-width: 96px; font-weight: 600; }

/* ---- Forms / panels ---- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.panel h2 { margin-top: 0; font-size: 1.3rem; }
.form-row { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-weight: 600; font-size: 0.88rem; color: #cfcfcf; }
.form-row input,
.form-row textarea,
.form-row select {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.97rem;
  font-family: inherit;
  background: var(--surface-2);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  background: #2e2e2e;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
textarea { min-height: 96px; resize: vertical; }

/* ---- Notices / misc ---- */
.notice {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  border: 1px solid;
  font-size: 0.95rem;
}
.notice.info { background: var(--gold-soft); border-color: rgba(13, 110, 253, 0.4); color: #8bb8fe; }
.notice.warn { background: rgba(255, 193, 7, 0.12); border-color: rgba(255, 193, 7, 0.4); color: #ffce5a; }
.notice.error { background: var(--accent-soft); border-color: rgba(220, 53, 69, 0.4); color: #f08a92; }
.notice.success { background: rgba(13, 110, 253, 0.12); border-color: rgba(13, 110, 253, 0.4); color: #8bb8fe; }
.empty { text-align: center; color: var(--muted); padding: 64px 20px; font-size: 1.05rem; }
.list-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.row-actions { display: flex; gap: 8px; }
.muted-sm { color: var(--muted); font-size: 0.85rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
.img-preview {
  display: block;
  width: 100%;
  max-width: 120px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--border, rgba(0,0,0,0.15));
}

/* ---- Static content pages (About, Contact, Privacy) ---- */
.prose { max-width: 760px; }
.prose h1 { margin-bottom: 8px; }
.prose h2 { margin-top: 28px; font-size: 1.3rem; }
.prose p, .prose li { font-family: var(--body); color: #e6e6e6; }
.prose ul { padding-left: 1.2em; }
.prose a { color: var(--gold); }

/* ---- Footer ---- */
.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
}
.site-footer .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--ink); text-decoration: none; }
.footer-copy { color: var(--muted); font-size: 0.85rem; }

/* ---- Cookie consent banner ---- */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
}
.cookie-banner span { color: #e6e6e6; }
.cookie-banner a { color: var(--gold); }
.cookie-banner .btn { flex-shrink: 0; }

@media (max-width: 720px) {
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .detail .photo { max-width: 320px; margin: 0 auto; }
  .form-grid { grid-template-columns: 1fr; }
  .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
}
