:root {
  --ink: #23252b;
  --ink-soft: #4a4d55;
  --paper: #f5efe3;
  --paper-2: #efe7d6;
  --card: #fffdf8;
  --line: #e2d7c2;
  --accent: #b5573a;
  --accent-dark: #9a4530;
  --gold: #c2963f;
  --shadow: 0 18px 45px -24px rgba(35, 37, 43, .45);
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Public Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(194,150,63,.10), transparent 55%),
    var(--paper);
  margin: 0;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .display, .navbar-brand {
  font-family: var(--serif);
  color: var(--ink);
  letter-spacing: -.01em;
}

a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent-dark); }

::selection { background: var(--gold); color: #fff; }

/* ---------- Announcement + header ---------- */
.announce-bar {
  background: var(--ink);
  color: #f3e8d2;
  text-align: center;
  font-size: .82rem;
  letter-spacing: .02em;
  padding: .5rem 1rem;
}
.announce-bar strong { color: var(--gold); }

.site-header {
  position: sticky; top: 0; z-index: 1030;
  background: rgba(245, 239, 227, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.navbar { padding: .85rem 0; }
.navbar-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.25rem; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--ink); color: var(--paper);
  font-family: var(--serif); font-weight: 700; font-size: .95rem;
  letter-spacing: .02em;
}
.navbar-nav .nav-link {
  font-family: var(--sans);
  color: var(--ink-soft); font-weight: 500;
  padding: .4rem 1rem; position: relative;
}
.navbar-nav .nav-link:hover { color: var(--ink); }
.navbar-nav .nav-link::after {
  content: ""; position: absolute; left: 1rem; right: 1rem; bottom: .1rem;
  height: 2px; background: var(--accent); transform: scaleX(0);
  transform-origin: left; transition: transform .25s ease;
}
.navbar-nav .nav-link:hover::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: .6rem; }
.cart-link { position: relative; font-size: 1.3rem; color: var(--ink); padding: .2rem .4rem; }
.cart-count {
  position: absolute; top: -4px; right: -6px;
  background: var(--accent); color: #fff; font-family: var(--sans);
  font-size: .65rem; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 999px; display: grid; place-items: center; padding: 0 4px;
}
.btn-account { background: transparent; border: none; color: var(--ink); font-weight: 500; }

/* ---------- Buttons ---------- */
.btn { font-family: var(--sans); font-weight: 600; border-radius: 999px; padding: .55rem 1.3rem; transition: transform .18s ease, background-color .2s ease, box-shadow .2s ease; }
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-accent:hover { background: var(--accent-dark); color: #fff; box-shadow: 0 10px 22px -12px rgba(181,87,58,.8); }
.btn-ink { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.btn-ink:hover { background: #000; color: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-outline-ink { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-outline-ink:hover { background: var(--ink); color: var(--paper); }

/* ---------- Flash ---------- */
.flash-container { margin-top: 1rem; }
.flash-container:empty { margin: 0; }
.alert-soft-success { background: #e8f2e6; border: 1px solid #bcd8b6; color: #33612c; border-radius: 12px; }
.alert-soft-danger { background: #f8e6e1; border: 1px solid #e6bcae; color: #90402c; border-radius: 12px; }

/* ---------- Hero ---------- */
.hero { padding: 5.5rem 0 4rem; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .25em; font-size: .72rem; font-weight: 700; color: var(--accent); }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.02; margin: 1rem 0 1.2rem; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p.lead { font-size: 1.18rem; color: var(--ink-soft); max-width: 34rem; }
.hero-figure {
  position: relative; border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  transform: rotate(1.4deg);
}
.hero-figure img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 4/5; }
.hero-badge {
  position: absolute; bottom: -18px; left: -18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: .8rem 1.1rem; box-shadow: var(--shadow); transform: rotate(-3deg);
  font-family: var(--serif); font-weight: 600;
}
.hero-badge small { display: block; font-family: var(--sans); font-weight: 500; color: var(--ink-soft); font-size: .72rem; }

/* ---------- Sections ---------- */
.section { padding: 4rem 0; }
.section-head { margin-bottom: 2.4rem; }
.section-head .eyebrow { text-transform: uppercase; letter-spacing: .22em; font-size: .72rem; font-weight: 700; color: var(--accent); }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin-top: .4rem; }
.divider-note { color: var(--ink-soft); }
.bg-paper2 { background: var(--paper-2); }
.bg-ink { background: var(--ink); color: var(--paper); }
.bg-ink h2, .bg-ink h3 { color: var(--paper); }

/* ---------- Cards ---------- */
.card-soft {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; height: 100%; transition: transform .25s ease, box-shadow .25s ease;
}
.card-soft:hover { transform: translateY(-5px); box-shadow: var(--shadow); }

/* Book cards */
.book-card .cover { aspect-ratio: 3/4; overflow: hidden; background: var(--paper-2); }
.book-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.book-card:hover .cover img { transform: scale(1.05); }
.book-card .body { padding: 1rem 1.1rem 1.2rem; }
.book-card h3 { font-size: 1.12rem; margin: 0 0 .2rem; }
.book-card .author { color: var(--ink-soft); font-size: .85rem; }
.book-card .price { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.badge-cat { background: var(--paper-2); color: var(--ink-soft); border: 1px solid var(--line); font-weight: 600; font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; padding: .3rem .6rem; border-radius: 999px; }
.badge-out { background: #f3e0da; color: var(--accent-dark); border: none; }
.badge-in { background: #e6efe1; color: #3d6b34; border: none; }
.badge-digital { background: #ece4f2; color: #6a4a86; border: none; }

/* Post cards */
.post-card .thumb { aspect-ratio: 16/10; overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .thumb img { transform: scale(1.04); }
.post-card .body { padding: 1.2rem 1.3rem 1.4rem; }
.post-meta { font-size: .78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; }
.post-card h3 { font-size: 1.25rem; margin: .4rem 0 .5rem; }

/* Star rating */
.stars { color: var(--gold); letter-spacing: .05em; }
.stars .bi { font-size: .95rem; }

/* Testimonials */
.quote-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; height: 100%; }
.quote-card .quote { font-family: var(--serif); font-size: 1.05rem; font-style: italic; }
.quote-card .who { font-weight: 600; margin-top: 1rem; }

/* ---------- Article ---------- */
.article-hero img { width: 100%; max-height: 440px; object-fit: cover; border-radius: 18px; border: 1px solid var(--line); }
.article-body { font-size: 1.12rem; color: #2c2f36; }
.article-body p { margin-bottom: 1.3rem; }
.prose-narrow { max-width: 46rem; margin: 0 auto; }

/* Comments */
.comment { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.15rem; margin-bottom: .9rem; }
.comment .who { font-weight: 700; }
.comment .when { color: var(--ink-soft); font-size: .78rem; }
.comment-replies { margin-left: 1.6rem; border-left: 2px solid var(--line); padding-left: 1rem; }
.reply-toggle { background: none; border: none; color: var(--accent); font-weight: 600; font-size: .82rem; padding: 0; }

/* ---------- Forms ---------- */
.form-control, .form-select {
  border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  padding: .6rem .85rem; font-family: var(--sans);
}
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(181,87,58,.15); }
.form-label { font-weight: 600; font-size: .88rem; }
.auth-card, .panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); padding: 2.2rem;
}
.newsletter-form .form-control { border-radius: 999px 0 0 999px; }
.newsletter-form .btn { border-radius: 0 999px 999px 0; }

/* Filters sidebar */
.filter-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; position: sticky; top: 100px; }
.filter-panel h6 { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; color: var(--ink-soft); font-family: var(--sans); font-weight: 700; }

/* Cart / tables */
.table-clean { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.table-clean thead th { background: var(--paper-2); border: none; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.table-clean td { vertical-align: middle; }
.summary-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; position: sticky; top: 100px; }

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 70vh; }
.admin-sidebar { background: var(--ink); color: #d8cdb8; padding: 2rem 1.1rem; }
.admin-sidebar .brand { color: var(--paper); font-family: var(--serif); font-weight: 700; font-size: 1.2rem; margin-bottom: 1.5rem; display: block; }
.admin-sidebar a { display: flex; align-items: center; gap: .7rem; color: #cabfa8; padding: .6rem .8rem; border-radius: 9px; font-weight: 500; margin-bottom: .2rem; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,.08); color: #fff; }
.admin-main { padding: 2rem; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; }
.stat-card .num { font-family: var(--serif); font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-card .lbl { color: var(--ink-soft); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; margin-top: .4rem; }
.status-pill { font-size: .72rem; font-weight: 700; padding: .28rem .7rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.st-Pending { background: #f5ecd2; color: #8a6d1f; }
.st-Paid { background: #dcecf5; color: #1f5f8a; }
.st-Shipped { background: #e6e0f5; color: #4a3f8a; }
.st-Completed { background: #e0f0e0; color: #2f6b2f; }
.st-Cancelled { background: #f5e0e0; color: #8a2f2f; }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { display: flex; flex-wrap: wrap; gap: .3rem; }
  .admin-sidebar .brand { width: 100%; margin-bottom: .5rem; }
  .admin-sidebar a { margin: 0; }
  .hero-figure { transform: none; margin-top: 2rem; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cabfa8; padding: 3.5rem 0 1.5rem; margin-top: 4rem; }
.footer-brand { font-family: var(--serif); font-size: 1.3rem; color: var(--paper); display: flex; align-items: center; gap: .5rem; margin-bottom: .8rem; }
.footer-tag { color: #b3a88f; font-size: .92rem; }
.footer-head { text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; color: #9a8f78; font-family: var(--sans); font-weight: 700; margin-bottom: 1rem; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: #cabfa8; }
.footer-links a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2.5rem; padding-top: 1.3rem; font-size: .82rem; color: #8b8069; }

.reveal { opacity: 0; transform: translateY(18px); animation: reveal .7s ease forwards; }
.paypal-btn { background: #ffc439; border: 1px solid #f0b90b; color: #003087; font-weight: 700; }
.paypal-btn:hover:not(:disabled) { background: #f0b90b; color: #003087; }
.paypal-btn:disabled { opacity: .55; }
@keyframes reveal { to { opacity: 1; transform: none; } }
