/* scripture.ink — Warm Archival Editorial Bookstore Stylesheet (DESIGN.md tokens) */

@font-face {
  font-family: "EB Garamond";
  src: url("/static/fonts/EBGaramond[wght].ttf") format("truetype");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("/static/fonts/EBGaramond-Italic[wght].ttf") format("truetype");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg-ground: #F6F2EA;
  --bg-card: #FFFFFF;
  --bg-well: #E9E2D4;
  --ink-primary: #1A1815;
  --ink-secondary: #524B42;
  --ink-muted: #6E655A;
  --accent: #7D5D1E;
  --accent-hover: #5E4514;
  --accent-tint: #F3EBDC;
  --border-subtle: #DDD5C6;
  --border-strong: #BBAE98;
  --warn-bg: #FDF6E7;
  --warn-ink: #6A4B0F;
  --error-bg: #FDF0EE;
  --error-ink: #8C2318;
  --ok-bg: #EFF6F0;
  --ok-ink: #1D5A2A;
  --font-serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Segoe UI Variable", -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(26, 24, 21, 0.04), 0 8px 24px rgba(26, 24, 21, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-ground);
  color: var(--ink-primary);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-primary);
  background-color: var(--bg-ground);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-tint);
  color: var(--ink-primary);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.is-hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-narrow {
  max-width: 760px;
}

/* Announcement & Banners */
.announcement-bar {
  background-color: var(--ink-primary);
  color: #F6F2EA;
  font-size: 0.875rem;
  text-align: center;
  padding: 0.55rem 0;
}

.announcement-bar p {
  margin: 0;
  letter-spacing: 0.01em;
}

.preview-banner {
  background-color: var(--warn-bg);
  color: var(--warn-ink);
  border-bottom: 1px solid #E5D1A4;
  padding: 0.65rem 0;
  font-size: 0.875rem;
  text-align: center;
}

.notice-banner {
  background-color: var(--accent-tint);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 0;
  font-size: 0.92rem;
}

.notice-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.notice-inner p {
  margin: 0;
}

/* Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(246, 242, 234, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
}

.brand-wordmark {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-primary);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  padding: 0.45rem 0.25rem;
}

.nav-link:hover {
  color: var(--ink-primary);
}

.nav-manage {
  color: var(--accent);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.nav-manage:hover {
  border-color: var(--accent);
  background-color: var(--accent-tint);
  color: var(--accent-hover);
}

/* Hero */
.hero {
  padding: clamp(2.25rem, 5vw, 4rem) 0 clamp(2.5rem, 5vw, 4.25rem);
}

.hero-copy {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2.25rem;
}

.eyebrow {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.3rem, 5.2vw, 3.75rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  color: var(--ink-primary);
}

.hero-subline {
  font-size: clamp(1rem, 1.8vw, 1.14rem);
  color: var(--ink-secondary);
  margin: 0 auto 1.25rem;
  max-width: 640px;
}

.schedule-pill {
  display: inline-block;
  margin: 0 0 1.5rem;
  padding: 0.45rem 0.95rem;
  background-color: var(--accent-tint);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--ink-primary);
  font-size: 0.9rem;
  font-weight: 500;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.hero-shelf-figure {
  margin: 0;
}

.shelf-scroll-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  background-color: #241C14;
}

.shelf-zoom-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.hero-shelf-img {
  width: 100%;
  height: auto;
  transition: transform 0.35s ease;
}

.shelf-zoom-btn:hover .hero-shelf-img {
  transform: scale(1.012);
}

.hero-shelf-caption {
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn-primary {
  background-color: var(--ink-primary);
  color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
  background-color: #2F2B25;
  color: #FFFFFF;
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background-color: transparent;
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background-color: var(--accent-tint);
  border-color: var(--accent);
  color: var(--ink-primary);
}

.btn-full {
  width: 100%;
}

/* Sections */
.editions-section,
.bulk-section,
.faq-section {
  padding: clamp(2.5rem, 5vw, 4.25rem) 0;
  border-top: 1px solid var(--border-subtle);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2.25rem;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.6vw, 2.65rem);
  font-weight: 500;
  margin: 0 0 0.5rem;
  line-height: 1.15;
}

.section-header p {
  margin: 0;
  color: var(--ink-secondary);
}

/* Product Cards */
.product-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.product-card-lead {
  display: grid;
  grid-template-columns: minmax(280px, 440px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 2.75rem);
  align-items: start;
  margin-bottom: 1.75rem;
}

.secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem;
}

.book-well {
  background-color: var(--bg-well);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-well-compact {
  aspect-ratio: 4 / 3.9;
}

.cover-zoom-btn {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  display: flex;
  justify-content: center;
  width: 100%;
}

.book-cover-img {
  max-height: 460px;
  width: auto;
  border-radius: 4px;
}

.book-well-compact .book-cover-img {
  max-height: 350px;
}

.thumb-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  justify-content: center;
}

.thumb-pill {
  background-color: var(--bg-ground);
  color: var(--ink-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  min-height: 36px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
}

.thumb-pill:hover,
.thumb-pill.is-active {
  border-color: var(--accent);
  color: var(--accent-hover);
  background-color: var(--accent-tint);
}

.product-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.product-card h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 2.8vw, 2.2rem);
  font-weight: 500;
  margin: 0 0 0.45rem;
  line-height: 1.15;
}

.product-subtitle {
  margin: 0 0 0.9rem;
  color: var(--ink-secondary);
  font-size: 0.97rem;
}

.spec-strip {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  font-size: 0.86rem;
  color: var(--ink-muted);
}

.spec-strip li::before {
  content: "· ";
  color: var(--accent);
  font-weight: 700;
}

.spec-strip li:first-child::before {
  content: "";
}

/* Variant & Quantity Controls */
.control-group {
  margin-bottom: 1.15rem;
}

.control-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 0.45rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.variant-chip {
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background-color: #FFFFFF;
  color: var(--ink-primary);
  font-size: 0.9rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.variant-chip:hover {
  border-color: var(--accent);
}

.variant-chip.is-selected {
  background-color: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent-hover);
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 600;
}

.variant-caption {
  margin: 0.45rem 0 0;
  font-size: 0.86rem;
  color: var(--ink-muted);
}

.handedness-spread-preview {
  display: block;
  margin-top: 0.7rem;
  padding: 0.35rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background-color: var(--bg-well);
  cursor: zoom-in;
  width: 100%;
  max-width: 320px;
}

.handedness-spread-preview img {
  border-radius: 3px;
  width: 100%;
}

.qty-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.qty-presets {
  display: flex;
  gap: 0.4rem;
}

.qty-pill {
  min-width: 46px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background-color: #FFFFFF;
  color: var(--ink-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.qty-pill.is-selected {
  background-color: var(--ink-primary);
  border-color: var(--ink-primary);
  color: #FFFFFF;
}

.qty-input {
  width: 84px;
  min-height: 44px;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
  background-color: #FFFFFF;
}

.inline-note {
  margin: 0.45rem 0 0;
  font-size: 0.86rem;
  color: var(--warn-ink);
}

.price-readout {
  background-color: var(--bg-ground);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-variant-numeric: tabular-nums;
}

.price-readout p {
  margin: 0;
}

.readout-math {
  font-weight: 600;
  color: var(--ink-primary);
  font-size: 0.94rem;
}

.readout-total {
  color: var(--ink-secondary);
  font-size: 0.9rem;
  margin-top: 0.2rem !important;
}

.readout-schedule {
  color: var(--accent-hover);
  font-size: 0.85rem;
  margin-top: 0.25rem !important;
}

.card-error {
  background-color: var(--error-bg);
  color: var(--error-ink);
  border: 1px solid #E5B4AE;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}

/* Bulk & FAQ */
.bulk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.info-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.info-card-accent {
  background-color: var(--accent-tint);
  border-color: var(--border-strong);
}

.info-card h3 {
  font-family: var(--font-serif);
  font-size: 1.38rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.info-card p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 32px;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--accent);
  font-weight: 400;
  margin-left: 1rem;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 0.75rem 0 0;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 0;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.footer-mission {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--ink-primary);
  margin: 0 0 0.4rem;
}

.footer-trust {
  margin: 0 0 0.75rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
}

/* Native <dialog> Bulk Confirmation Modal */
.modal-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 560px;
  width: calc(100% - 2rem);
  max-height: 90dvh;
}

.modal-dialog::backdrop {
  background: rgba(26, 24, 21, 0.58);
  backdrop-filter: blur(3px);
}

.modal-sheet {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  overflow-y: auto;
  max-height: 90dvh;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-header h2 {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  margin: 0 0 0.25rem;
}

.modal-subtitle {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.92rem;
}

.icon-dismiss {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ink-secondary);
  cursor: pointer;
  flex-shrink: 0;
}

.step-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.bulk-summary-box {
  background-color: var(--warn-bg);
  border: 1px solid #E5D1A4;
  border-radius: var(--radius-sm);
  padding: 0.95rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  color: var(--ink-primary);
  font-variant-numeric: tabular-nums;
}

.bulk-summary-box p {
  margin: 0 0 0.45rem;
}

.bulk-summary-box p:last-child {
  margin-bottom: 0;
}

.bulk-strong {
  font-weight: 700;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
  cursor: pointer;
}

.checkbox-row input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.text-input {
  width: 100%;
  min-height: 46px;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.75rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.15rem;
}

/* Native <dialog> Lightbox */
.lightbox-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 1120px;
  width: calc(100% - 1.5rem);
  max-height: 92dvh;
}

.lightbox-dialog::backdrop {
  background: rgba(18, 16, 13, 0.84);
}

.lightbox-shell {
  background-color: #1A1815;
  color: #F6F2EA;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 92dvh;
}

.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(246, 242, 234, 0.14);
}

.lightbox-caption {
  margin: 0;
  font-size: 0.92rem;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.lightbox-nav-btn,
.lightbox-close-btn {
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(246, 242, 234, 0.25);
  background: transparent;
  color: #F6F2EA;
  font-size: 1.15rem;
  cursor: pointer;
}

.lightbox-counter {
  font-size: 0.85rem;
  color: #D5CCBE;
  min-width: 3rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.lightbox-stage {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.lightbox-stage img {
  max-height: 78dvh;
  width: auto;
  border-radius: 4px;
}

/* Status Pages (/order/success & /order/error) */
.status-main {
  padding: clamp(2.5rem, 6vw, 5rem) 0;
}

.status-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  box-shadow: var(--shadow-card);
}

.status-card-ok {
  border-top: 4px solid var(--accent);
}

.status-card h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 500;
  margin: 0 0 1rem;
  line-height: 1.15;
}

.status-lead {
  font-size: 1.05rem;
  color: var(--ink-primary);
  margin: 0 0 1rem;
}

.status-note {
  font-size: 0.95rem;
  color: var(--ink-secondary);
  margin: 0 0 0.75rem;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .product-card-lead {
    grid-template-columns: 1fr;
  }
  .secondary-grid,
  .bulk-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  /* Strict 2-item mobile header (scripture.ink + Manage Plan) */
  .nav-desktop-only {
    display: none;
  }
  .shelf-scroll-frame {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .hero-shelf-img {
    min-width: 640px;
  }
  .modal-actions {
    flex-direction: column-reverse;
  }
  .modal-actions .btn {
    width: 100%;
  }
}
