/* Market Books: a quiet, editorial library theme. Loaded after the base styles. */
:root {
  --ink: #23332f;
  --muted: #66706b;
  --paper: #f7f4ec;
  --cream: #eee7da;
  --card: #fffefa;
  --accent: #8d3946;
  --accent-dark: #6f2733;
  --line: #e3dacb;
  --shadow: 0 15px 34px rgba(35, 51, 47, .11);
  --library-gold: #c5a676;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', system-ui, sans-serif;
  line-height: 1.7;
}
body[dir="rtl"] {
  font-family: 'Noto Sans Arabic', Tahoma, sans-serif;
  line-height: 1.9;
}
h1, h2, h3, h4, h5, h6 {
  font-family: 'Literata', Georgia, serif;
  font-weight: 600;
  letter-spacing: -.025em;
}
body[dir="rtl"] h1,
body[dir="rtl"] h2,
body[dir="rtl"] h3,
body[dir="rtl"] h4,
body[dir="rtl"] h5,
body[dir="rtl"] h6 {
  font-family: 'Amiri', 'Noto Naskh Arabic', serif;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
}
body[dir="rtl"] h1 { line-height: 1.18; }

.reading-ribbon {
  background: #1f332e;
  color: #f9f1dc;
  border-bottom: 2px solid var(--library-gold);
  padding: .42rem 0;
  font-size: .85rem;
}
.reading-ribbon-inner {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  column-gap: .85rem;
  row-gap: .15rem;
  text-align: center;
}
.ribbon-ornament { color: var(--library-gold); font-size: .78rem; }
.reading-verse {
  font-family: 'Literata', Georgia, serif;
  font-weight: 500;
  line-height: 1.45;
}
body[dir="rtl"] .reading-verse {
  font-family: 'Amiri', 'Noto Naskh Arabic', serif;
  font-size: 1.22rem;
  line-height: 1.25;
}
.verse-reference {
  border-inline-start: 1px solid rgba(197, 166, 118, .55);
  padding-inline-start: .85rem;
  color: #ddcfb0;
  font-size: .68rem;
  white-space: nowrap;
}

.site-header {
  background: #fffefa;
  box-shadow: 0 1px 0 var(--line), 0 8px 22px rgba(35, 51, 47, .035);
}
.site-header .navbar { min-height: 84px; }
.brand-logo-dark { width: clamp(178px, 21vw, 244px); height: 60px; }
.nav-link {
  position: relative;
  color: var(--ink) !important;
  font-size: .86rem;
  font-weight: 700;
  padding: .55rem .72rem !important;
  transition: color .18s ease;
}
.nav-link:hover, .nav-link.active { color: var(--accent) !important; }
.nav-link.active::after {
  content: '';
  position: absolute;
  inset-inline: .72rem;
  bottom: .2rem;
  height: 2px;
  background: var(--accent);
}
.category-menu {
  border-radius: 8px;
  background: #fffefa;
  box-shadow: var(--shadow);
}
.category-menu .dropdown-item:hover,
.category-menu .dropdown-item:focus { background: #f4ede5; color: var(--accent-dark); }
.lang-switch {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.lang-switch a { border-radius: 6px; font-family: 'Manrope', sans-serif; font-weight: 800; }
.lang-switch a[lang="ar"] { font-family: 'Noto Sans Arabic', Tahoma, sans-serif; padding-inline: .65rem; }
.lang-switch a.active { background: var(--ink); color: #fff; }

.hero {
  background:
    radial-gradient(circle at 86% 10%, rgba(197, 166, 118, .18), transparent 28%),
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(140, 113, 77, .022) 35px 36px),
    linear-gradient(135deg, #fbf8f1, #eee7da);
  border-bottom: 1px solid var(--line);
}
.hero-inner { min-height: 430px; padding-block: 4.25rem; }
.eyebrow {
  color: var(--accent-dark);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: .71rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
body[dir="rtl"] .eyebrow {
  font-family: 'Noto Sans Arabic', sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
.eyebrow:before { width: 24px; height: 1px; background: var(--accent); }
.hero h1 { max-width: 770px; color: #21332d; }
body[dir="rtl"] .hero h1 { font-size: clamp(2.65rem, 5vw, 4.7rem); }
.hero p { color: #59675f; line-height: 1.9; }
.hero-art::before {
  content: '';
  position: absolute;
  width: min(83%, 350px);
  height: 78%;
  border: 1px solid rgba(141, 57, 70, .18);
  transform: rotate(-7deg);
  border-radius: 4px;
}
.hero-book {
  border-radius: 3px 9px 9px 3px;
  box-shadow: 12px 19px 28px rgba(35, 51, 47, .22);
}
body[dir="rtl"] .hero-book { border-left: 0; border-right: 12px solid rgba(0, 0, 0, .10); }
.btn-accent, .btn-outline-ink {
  border-radius: 7px;
  font-size: .86rem;
  padding: .76rem 1.4rem;
  box-shadow: none;
}
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-outline-ink { border-color: #748078; color: var(--ink); }
.btn-outline-ink:hover { background: var(--ink); border-color: var(--ink); }
.btn:focus-visible, .nav-link:focus-visible, a:focus-visible {
  outline: 3px solid #d0a65b;
  outline-offset: 3px;
}

.section-pad { padding-block: 4.4rem; }
.featured-section { background: #fffefa; }
.section-heading { margin-bottom: 1.7rem; }
.section-heading h2 { color: var(--ink); }
.section-heading a, .read-link { color: var(--accent-dark); }
.book-card, .featured-section .book-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 5px 18px rgba(35, 51, 47, .045);
  background: #fffefa;
}
.book-card:hover { box-shadow: var(--shadow); }
.cover-panel, .featured-section .book-card .cover-panel {
  background: linear-gradient(180deg, #f3eee5 0%, #eee7db 94%, #dfd3be 94%);
  border-bottom: 1px solid var(--line);
}
.cover-panel img {
  box-shadow: 5px 9px 16px rgba(32, 44, 37, .2);
  transition: transform .2s ease;
}
.book-card:hover .cover-panel img { transform: translateY(-3px); }
.cover-placeholder {
  background: linear-gradient(145deg, #395248, #1f352e);
  border-left-color: #182b24;
  color: #fff7e7;
}
.cover-placeholder span:first-child { color: var(--library-gold); }
.book-content { padding: 1.2rem 1.25rem 1.3rem; }
.book-content .category-label {
  color: var(--accent-dark);
  font-family: 'Manrope', system-ui, sans-serif;
  letter-spacing: .04em;
}
body[dir="rtl"] .book-content .category-label { font-family: 'Noto Sans Arabic', sans-serif; letter-spacing: 0; }
.book-content h3 { font-size: 1.06rem; line-height: 1.45; }
body[dir="rtl"] .book-content h3 { font-size: 1.3rem; line-height: 1.35; }
.book-content p { line-height: 1.7; }

#categories {
  background: linear-gradient(180deg, #f5f0e5, #f7f4ec);
  border-block: 1px solid var(--line);
}
.category-card {
  border-radius: 8px;
  border-top: 3px solid var(--accent);
  background: #fffefa;
  box-shadow: 0 5px 18px rgba(35, 51, 47, .04);
}
.category-card::after { background: rgba(197, 166, 118, .09); }
.category-icon {
  width: 64px;
  height: 64px;
  border: 1px solid #ead8d2;
  border-radius: 50%;
  background: #f7ebe7;
  color: var(--accent);
}
.category-icon svg { width: 38px; height: 38px; flex: none; }
#categories .col-6:nth-child(2n) .category-icon { background: #edf2e9; color: #496b51; border-color: #d5e3d3; }
#categories .col-6:nth-child(3n) .category-icon { background: #edf0f1; color: #4f6e72; border-color: #dae3e5; }
#categories .col-6:nth-child(5n) .category-icon { background: #f5eddb; color: #8f6a30; border-color: #e9dbb9; }
.category-card h3 { font-size: 1.12rem; }
body[dir="rtl"] .category-card h3 { font-size: 1.4rem; }
.category-card p { color: var(--muted); }
.category-count { color: var(--accent-dark); }

.page-banner {
  background: linear-gradient(135deg, #f8f3e9, #eee6d9);
  border-bottom: 1px solid var(--line);
}
.page-banner h1 { color: var(--ink); }
.detail-cover { background: #f0e9dd; border-radius: 8px; }
.article-body {
  color: #33433c;
  line-height: 2;
  max-width: 76ch;
}
body[dir="rtl"] .article-body { line-height: 2.15; }
.article-body h2, .article-body h3 { color: var(--ink); }
body[dir="rtl"] .article-body h2 { font-size: 1.8rem; }
body[dir="rtl"] .article-body h3 { font-size: 1.48rem; }
.article-body blockquote { background: #f3ece1; border-radius: 4px; }
.notice-box { background: #fbf7ed; border-color: #e8d9bd; border-radius: 8px; }
.soft-card {
  background: linear-gradient(135deg, #fffefa, #f5eee2);
  border-color: var(--line);
  border-inline-start: 4px solid var(--accent);
  border-radius: 8px;
  padding: 2rem;
}
.site-footer { background: #1f332e; color: #f5f0e5; }
.site-footer p { color: #c7d0c6; }
.site-footer a { color: #ecf0e7; }
.site-footer a:hover { color: #e5bd83; }
.footer-bottom { border-color: #4b6255; color: #c7d0c6; }
.not-found .code { color: var(--accent); }

/* Reader-submitted directory: quiet editorial cards, distinct from the catalog. */
.directory-invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 2.3rem;
  border: 1px solid #d9d0c0;
  border-inline-start: 5px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(120deg, #f1e8d8, #fffefa 75%);
}
.directory-invite h2 { color: var(--ink); }
.directory-invite p { max-width: 62ch; color: var(--muted); margin-bottom: 0; }
.directory-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(115deg, #f9f5eb, #ece4d5);
}
.directory-banner::after {
  content: '✦';
  position: absolute;
  inset-inline-end: 8%;
  top: -2.7rem;
  color: rgba(141, 57, 70, .08);
  font: 12rem 'Literata', Georgia, serif;
  line-height: 1;
  pointer-events: none;
}
.directory-banner .site-container { position: relative; z-index: 1; }
.directory-banner p { max-width: 67ch; line-height: 1.9; }
.directory-back { color: var(--accent-dark); font-weight: 700; }
.directory-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 2.5rem;
  align-items: start;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}
.directory-intro-copy p { color: var(--muted); margin-bottom: 0; }
.directory-steps, .directory-sidebar ol { counter-reset: directory-step; list-style: none; padding: 0; margin: 0; }
.directory-steps li, .directory-sidebar ol li {
  counter-increment: directory-step;
  position: relative;
  padding: .45rem 3.25rem .9rem .4rem;
  color: #4f5c55;
}
.directory-steps li::before, .directory-sidebar ol li::before {
  content: counter(directory-step, decimal-leading-zero);
  position: absolute;
  inset-inline-start: 0;
  top: .22rem;
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border: 1px solid #ddc8ad;
  border-radius: 50%;
  background: #f8f1e3;
  color: var(--accent-dark);
  font: 700 .72rem 'Manrope', system-ui, sans-serif;
}
.directory-steps li, .directory-sidebar ol li { padding-inline-start: 3.25rem; padding-inline-end: .4rem; }
.directory-filter {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .8fr) auto;
  align-items: end;
  gap: .85rem;
  padding: 1.2rem;
  margin-top: 2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
}
.directory-filter .btn { white-space: nowrap; }
.directory-book {
  display: grid;
  grid-template-columns: 38% 62%;
  min-height: 274px;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 0 5px 18px rgba(35, 51, 47, .045);
}
.directory-book-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 270px;
  border-inline-end: 1px solid #d7c6a7;
  background: radial-gradient(circle at 50% 30%, rgba(255, 248, 229, .18), transparent 60%), linear-gradient(145deg, #385247, #20392f);
  color: #f9f2e0;
}
.directory-book-art::before {
  content: '';
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(249, 242, 224, .34);
}
.directory-book-art.has-cover { padding: 18px; }
.directory-book-art.has-cover::before { display: none; }
.directory-book-art.has-cover img { display: block; width: 100%; max-width: 190px; max-height: 250px; height: auto; object-fit: contain; box-shadow: 0 9px 20px rgba(0, 0, 0, .2); }
.directory-book-initial { font: 500 5rem 'Literata', 'Amiri', Georgia, serif; line-height: 1; }
.directory-book-imprint { position: absolute; inset-block-end: 27px; font: 700 .48rem 'Manrope', sans-serif; letter-spacing: .14em; }
.directory-book-copy { display: flex; flex-direction: column; padding: 1.25rem; min-width: 0; }
.directory-book-kicker { color: var(--accent-dark); font-size: .69rem; font-weight: 800; }
.directory-book-copy h3 { font-size: 1.08rem; margin: .55rem 0 .15rem; overflow-wrap: anywhere; }
.directory-book-copy h3 a:hover { color: var(--accent-dark); text-decoration: underline; }
body[dir="rtl"] .directory-book-copy h3 { font-size: 1.28rem; }
.directory-book-copy p { font-size: .78rem; line-height: 1.65; color: var(--muted); overflow-wrap: anywhere; }
.directory-book-author { color: #44564b !important; font-weight: 700; margin-bottom: .5rem; }
.directory-book-link { margin-top: auto; color: var(--accent-dark); font-size: .78rem; font-weight: 800; }
.directory-book-link:hover { text-decoration: underline; }
.directory-empty { text-align: center; padding: 3rem 1rem; border: 1px dashed #d7c6a7; border-radius: 8px; background: #fffefa; }
.directory-empty > span { display: block; font-size: 2rem; color: var(--accent); }
.directory-empty p { color: var(--muted); }
.directory-submit-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(255px, .8fr); align-items: start; gap: 1.6rem; }
.directory-form-panel, .directory-sidebar { border: 1px solid var(--line); border-radius: 8px; background: #fffefa; padding: 2rem; }
.directory-submit-form .form-label, .directory-filter .form-label { color: var(--ink); font-size: .84rem; font-weight: 700; }
.directory-submit-form .form-control, .directory-submit-form .form-select, .directory-filter .form-control, .directory-filter .form-select { border-color: #d9d0c0; border-radius: 6px; background-color: #fff; }
.directory-submit-form .form-control:focus, .directory-submit-form .form-select:focus, .directory-filter .form-control:focus, .directory-filter .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(141, 57, 70, .14); }
.directory-submit-form textarea { resize: vertical; min-height: 170px; }
.directory-privacy-note { padding: 1rem; border-radius: 6px; background: #f8f3e9; color: var(--muted); font-size: .78rem; }
.directory-privacy-note a { color: var(--accent-dark); text-decoration: underline; }
.directory-sidebar { background: linear-gradient(160deg, #f4ede0, #fffefa); }
.directory-sidebar h2 { margin: .8rem 0 1rem; }
.directory-sidebar h3 { font-size: 1.1rem; margin: 1.8rem 0 .7rem; }
.directory-sidebar details { padding: .8rem 0; border-top: 1px solid var(--line); }
.directory-sidebar summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.directory-sidebar details p { margin: .5rem 0 0; color: var(--muted); font-size: .82rem; }
.directory-success { margin: 0; }
.directory-honeypot { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.directory-detail-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, .7fr); gap: 1.8rem; align-items: start; }
.directory-detail-article, .directory-detail-facts { background: #fffefa; border: 1px solid var(--line); border-radius: 8px; padding: 2rem; }
.directory-detail-body { color: #33433c; font-size: 1.02rem; line-height: 2; overflow-wrap: anywhere; }
.directory-detail-body p, .directory-detail-body div, .directory-detail-body ul, .directory-detail-body ol, .directory-detail-body blockquote { margin-bottom: 1rem; }
.directory-detail-body h2 { font-size: 1.35rem; margin: 1.5rem 0 .55rem; }
.directory-detail-body h3 { font-size: 1.15rem; margin: 1.25rem 0 .5rem; }
.directory-detail-body blockquote { padding: .7rem 1rem; border-inline-start: 3px solid var(--accent); background: #f8f3e9; }
.directory-detail-notice { border-inline-start: 3px solid var(--accent); background: #f8f3e9; padding: 1rem; color: var(--muted); font-size: .82rem; }
.directory-detail-facts h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.directory-detail-cover { display: block; max-width: 100%; width: auto; max-height: 360px; height: auto; margin: 0 auto 1.5rem; box-shadow: 0 9px 24px rgba(0, 0, 0, .13); }
.directory-admin-cover { display: block; max-width: 220px; max-height: 330px; width: auto; height: auto; border: 1px solid var(--line); border-radius: 5px; }
.directory-detail-facts dt { color: var(--muted); font-size: .75rem; }
.directory-detail-facts dd { margin: 0 0 1rem; font-weight: 700; overflow-wrap: anywhere; }

@media (max-width: 991px) {
  .directory-submit-layout { grid-template-columns: 1fr; }
  .directory-detail-layout { grid-template-columns: 1fr; }
  .directory-sidebar { order: -1; }
}

@media (max-width: 991px) {
  .site-header .navbar { min-height: 74px; }
  .brand-logo-dark { width: 190px; height: 54px; }
  .nav-link.active::after { display: none; }
  .category-menu { box-shadow: none; }
}
@media (max-width: 767px) {
  .directory-invite { flex-direction: column; align-items: stretch; padding: 1.5rem; }
  .directory-intro-grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .directory-filter { grid-template-columns: 1fr; }
  .directory-form-panel, .directory-sidebar { padding: 1.3rem; }
  .directory-book { grid-template-columns: 35% 65%; }
  .directory-book-art { min-height: 240px; }
  .reading-ribbon { padding: .46rem 0; }
  .reading-ribbon-inner { column-gap: .55rem; }
  .ribbon-ornament { display: none; }
  .reading-verse { width: 100%; font-size: .79rem; }
  body[dir="rtl"] .reading-verse { font-size: 1.1rem; }
  .verse-reference { border: 0; padding: 0; font-size: .6rem; }
  .hero-inner { padding-block: 3rem; }
  .hero-art::before { height: 70%; }
  .section-pad { padding-block: 3rem; }
  .book-content { padding: .95rem; }
  .category-card { min-height: 230px; }
  .category-icon { width: 54px; height: 54px; }
  .category-icon svg { width: 34px; height: 34px; }
  .soft-card { padding: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cover-panel img { transition: none; }
}

/* Private reader feedback on book pages and the contact page. */
.content-feedback {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-top: 2rem;
  padding: 1.3rem 1.5rem;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--accent);
  border-radius: 10px;
  background: #fffefa;
}
.content-feedback-icon,
.report-contact-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f5e9e8;
  color: var(--accent-dark);
  font-size: 1.45rem;
}
.content-feedback-copy { flex: 1; min-width: 0; }
.content-feedback h2 { margin: 0 0 .25rem; font-size: 1.35rem; }
.content-feedback p { margin: 0; color: var(--muted); font-size: .9rem; }
.content-feedback-action { white-space: nowrap; }
.report-contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(250px, .7fr);
  gap: 1.25rem;
  align-items: start;
}
.report-form-card,
.report-contact-aside { min-width: 0; }
.report-form-card { scroll-margin-top: 1.5rem; }
.report-context {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .6rem;
  margin: 1rem 0;
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8f3e9;
  font-size: .85rem;
}
.report-context span { color: var(--muted); }
.report-context a,
.report-email-link { color: var(--accent-dark); font-weight: 700; overflow-wrap: anywhere; }
.report-contact-aside p { color: var(--muted); }
@media (max-width: 900px) {
  .report-contact-layout { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .content-feedback { align-items: flex-start; flex-wrap: wrap; padding: 1.1rem; }
  .content-feedback-action { width: 100%; text-align: center; }
}

.book-pdf-box {
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--accent);
  border-radius: 10px;
  background: #fffefa;
}
.book-pdf-box h2 { margin: 0 0 .85rem; }
.book-pdf-status { color: var(--muted); }
.book-pdf-box [hidden] { display: none !important; }
