:root {
  --bg: #f5f1e9;
  --paper: #fffdf8;
  --paper-2: #fbf7ef;
  --ink: #161412;
  --text: #25211d;
  --muted: #746b61;
  --line: #ded4c7;
  --primary: #174a4f;
  --primary-strong: #0f3438;
  --accent: #9c6a3b;
  --soft: #edf2ef;
  --danger: #9a3412;
  --shadow-sm: 0 10px 30px rgba(32, 26, 18, 0.05);
  --shadow: 0 24px 70px rgba(32, 26, 18, 0.08);
  --radius: 24px;
  --max: 1160px;
  --reading: 780px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(23, 74, 79, .06), transparent 34rem),
    linear-gradient(180deg, #f7f3ec 0%, var(--bg) 46%, #f3eee5 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang="ar"] body { font-family: Cairo, Tahoma, system-ui, sans-serif; line-height: 1.92; }
a { color: var(--primary); text-decoration: none; transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease; }
a:hover { color: var(--primary-strong); }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.skip-link { position: fixed; inset-inline-start: 16px; top: 12px; transform: translateY(-150%); background: var(--ink); color: white; padding: 10px 14px; border-radius: 999px; z-index: 9999; }
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 241, 233, .86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(222, 212, 199, .75);
}
.nav-wrap { max-width: var(--max); margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { color: var(--ink); font-size: 20px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.brand small { display: none; }
.nav-links { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--muted); }
.nav-links a { color: var(--muted); padding: 8px 12px; border-radius: 999px; }
.nav-links a.active, .nav-links a:hover { color: var(--ink); background: rgba(255,253,248,.74); }
.nav-toggle { display: none; border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: 8px 12px; cursor: pointer; }

.site-main { min-height: calc(100vh - 220px); }
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.reading-container { max-width: var(--reading); margin: 0 auto; padding: 72px 24px 84px; }

.hero {
  min-height: 74vh;
  padding: 76px 0 88px;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, .72fr);
  gap: clamp(34px, 5vw, 72px);
  align-items: center;
  border-bottom: 1px solid rgba(222, 212, 199, .72);
}
.hero h1 { color: var(--ink); font-size: clamp(58px, 9vw, 108px); line-height: .95; letter-spacing: -.055em; margin: 0; }
html[lang="ar"] .hero h1 { letter-spacing: -.018em; }
.hero .lead { max-width: 720px; margin: 28px 0 0; color: #5d554c; font-size: clamp(20px, 2vw, 27px); line-height: 1.9; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-weight: 800; letter-spacing: .09em; text-transform: uppercase; font-size: 12px; }
html[lang="ar"] .eyebrow { letter-spacing: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.24; letter-spacing: -.035em; margin: 0; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: -.012em; }
h1 { font-size: clamp(42px, 6vw, 72px); }
h2 { font-size: clamp(30px, 4vw, 48px); }
h3 { font-size: 22px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 20px; border-radius: 999px; border: 1px solid rgba(23, 74, 79, .18); cursor: pointer; font-weight: 700; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 10px 28px rgba(23, 74, 79, .18); }
.btn.primary:hover { background: var(--primary-strong); color: #fff; transform: translateY(-1px); }
.btn.ghost { background: rgba(255,253,248,.7); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); background: #fff; }

.hero-panel {
  background: rgba(255,253,248,.88);
  border: 1px solid rgba(222, 212, 199, .9);
  border-radius: 34px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.hero-panel-list { display: grid; gap: 12px; }
.hero-panel-item { display: block; padding: 18px 18px 16px; border-radius: 22px; border: 1px solid transparent; background: linear-gradient(180deg, #ffffff, #fbf7ee); color: var(--text); }
.hero-panel-item:hover { border-color: rgba(23,74,79,.22); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.hero-panel-item span { display: block; color: var(--accent); font-size: 12px; font-weight: 800; margin-bottom: 6px; }
.hero-panel-item strong { display: block; color: var(--ink); font-size: 21px; line-height: 1.45; }
.hero-panel-item small { display: block; color: var(--muted); margin-top: 8px; font-size: 13px; }

.section { padding: 82px 0; margin: 0; border-bottom: 1px solid rgba(222, 212, 199, .66); clear: both; position: relative; }
.section:last-child { border-bottom: 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
.section-head p { color: var(--muted); margin: 8px 0 0; max-width: 640px; }
.section-head > a { color: var(--primary); font-weight: 800; white-space: nowrap; padding: 8px 12px; border-radius: 999px; }
.section-head > a:hover { background: rgba(255,253,248,.82); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: stretch; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { min-width: 0; background: rgba(255,253,248,.9); border: 1px solid rgba(222, 212, 199, .9); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; overflow: hidden; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.badge { display: inline-flex; align-items: center; padding: 6px 11px; border-radius: 999px; background: #edf2ef; color: var(--primary); font-weight: 800; font-size: 12px; }
.card h3 { margin: 0 0 12px; font-size: clamp(21px, 2.5vw, 27px); }
.card p { color: var(--muted); margin: 0 0 18px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: auto; color: var(--muted); font-size: 13px; }
.card-footer a { font-weight: 800; }
.category-bar { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 26px; margin-bottom: 0; scrollbar-width: thin; }
.category-btn { white-space: nowrap; border: 1px solid var(--line); background: rgba(255,253,248,.78); color: var(--muted); border-radius: 999px; padding: 9px 15px; cursor: pointer; font-weight: 700; }
.category-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.article-header { padding-bottom: 34px; border-bottom: 1px solid var(--line); margin-bottom: 38px; }
.article-header .lead { color: var(--muted); font-size: 22px; margin-top: 18px; }
.article-meta { color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; font-size: 14px; }
.article-content { font-family: "Source Serif 4", Georgia, serif; font-size: 20px; line-height: 1.9; }
html[lang="ar"] .article-content { font-family: "Noto Naskh Arabic", Cairo, serif; font-size: 21px; line-height: 2.08; }
.article-content h2 { margin: 48px 0 16px; font-family: inherit; font-size: 32px; }
.article-content h3 { margin: 34px 0 10px; font-family: inherit; }
.article-content p { margin: 0 0 24px; }
.article-content ul, .article-content ol { margin: 0 0 26px; padding-inline-start: 28px; }
.article-content blockquote { margin: 30px 0; padding: 20px 24px; border-inline-start: 4px solid var(--accent); background: rgba(255,253,248,.9); color: var(--primary-strong); border-radius: 18px; }
.article-content code { background: #eee8de; padding: 2px 7px; border-radius: 7px; font-size: .9em; }
.article-content pre { direction: ltr; text-align: left; overflow-x: auto; background: #151a1c; color: #f8f1e6; padding: 20px; border-radius: 18px; font-size: 15px; line-height: 1.65; }
.article-content table { width: 100%; border-collapse: collapse; margin: 30px 0; font-size: 16px; }
.article-content td, .article-content th { border: 1px solid var(--line); padding: 10px; }
.video-box { background: #132b30; color: white; padding: 24px; border-radius: 26px; margin: 38px 0; box-shadow: var(--shadow); }
.video-box h3 { color: #fff; }
.video-box p { color: rgba(255,255,255,.76); margin: 8px 0 16px; }
.video-frame { position: relative; aspect-ratio: 16/9; overflow: hidden; border-radius: 18px; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-card .thumb { aspect-ratio: 16/9; border-radius: 18px; overflow: hidden; background: var(--soft); margin-bottom: 18px; }
.video-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-card .actions { margin-top: auto; }

.book-card-cover { aspect-ratio: 4/5; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #f0ece3; margin-bottom: 18px; }
.book-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-layout { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: clamp(28px, 5vw, 58px); align-items: start; padding: 72px 0 86px; }
.book-cover { border-radius: 24px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--paper); }
.book-cover img { width: 100%; }
.price-card { margin-top: 26px; background: rgba(255,253,248,.92); border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: var(--shadow-sm); }
.price { font-size: 38px; font-weight: 900; color: var(--ink); line-height: 1.1; }
.note { color: var(--muted); font-size: 14px; }
.paypal-area { margin-top: 18px; }
.status-box { border-radius: 18px; padding: 16px; border: 1px solid var(--line); background: rgba(255,253,248,.82); color: var(--primary-strong); }
.status-box.error { background: #fff4ed; color: var(--danger); }
.status-box.success { background: #eaf7ee; color: #166534; }
.newsletter { background: linear-gradient(145deg, rgba(255,253,248,.98), rgba(237,242,239,.98)); border: 1px solid var(--line); border-radius: 30px; padding: 32px; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.newsletter-form { display: flex; gap: 10px; }
.input { width: 100%; border: 1px solid var(--line); background: white; color: var(--text); padding: 12px 14px; border-radius: 14px; outline: none; }
.input:focus { border-color: rgba(23,74,79,.55); box-shadow: 0 0 0 4px rgba(23,74,79,.08); }
textarea.input { min-height: 140px; resize: vertical; }
.form-grid { display: grid; gap: 14px; max-width: 720px; }
.legal-page h2 { margin-top: 34px; }
.site-footer { border-top: 1px solid var(--line); margin-top: 0; background: rgba(255,253,248,.44); }
.footer-wrap { max-width: var(--max); margin: 0 auto; padding: 34px 24px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: end; gap: 14px; }
html[dir="rtl"] .footer-links { justify-content: start; }
.empty-state { border: 1px dashed var(--line); border-radius: 20px; padding: 28px; color: var(--muted); background: rgba(255,253,248,.68); }
.language-gate { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.gate-card { width: min(620px, 100%); background: white; border: 1px solid var(--line); border-radius: 34px; padding: 38px; box-shadow: var(--shadow); text-align: center; }
.gate-card h1 { font-size: 48px; }
.gate-actions { display: flex; justify-content: center; gap: 12px; margin-top: 24px; }
.skeleton { min-height: 160px; border-radius: var(--radius); background: linear-gradient(90deg, #fff, #efebe4, #fff); background-size: 200% 100%; animation: shine 1.2s infinite; }
@keyframes shine { to { background-position-x: -200%; } }

@media (max-width: 980px) {
  .hero, .book-layout, .newsletter, .footer-wrap { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding: 58px 0 68px; }
  .grid, .grid.two { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .section-head { align-items: start; flex-direction: column; }
  .nav-toggle { display: inline-flex; }
  .nav-links { display: none; position: absolute; inset-inline: 18px; top: 70px; flex-direction: column; align-items: stretch; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 14px; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 12px; }
  .book-layout { gap: 26px; }
  .book-cover { max-width: 330px; margin: 0 auto; }
  .newsletter-form { flex-direction: column; }
}
@media (max-width: 620px) {
  .container, .reading-container { padding-inline: 18px; }
  .reading-container { padding-top: 46px; }
  .nav-wrap { padding: 15px 18px; }
  .hero h1 { font-size: 52px; }
  h1 { font-size: 40px; }
  h2 { font-size: 31px; }
  .card { padding: 22px; }
  .hero-panel { padding: 14px; border-radius: 26px; }
  .hero-panel-item { padding: 16px; }
  .article-content { font-size: 18px; }
  html[lang="ar"] .article-content { font-size: 19px; }
  .footer-wrap { padding-inline: 18px; }
  .gate-card { padding: 26px; }
  .gate-actions { flex-direction: column; }
}

/* ==============================
   Premium refinement layer - v3
   ============================== */
:root {
  --bg: #f7f2e9;
  --paper: #fffdf7;
  --paper-2: #fbf6ec;
  --ink: #11100e;
  --text: #28231d;
  --muted: #746a5e;
  --line: #e3d7c7;
  --primary: #0f4c5c;
  --primary-strong: #0b3842;
  --accent: #b7791f;
  --soft: #eef4f1;
  --shadow-sm: 0 12px 34px rgba(40, 31, 18, .055);
  --shadow: 0 28px 90px rgba(40, 31, 18, .105);
  --radius: 28px;
}

body {
  background:
    radial-gradient(circle at 82% 4%, rgba(15, 76, 92, .075), transparent 34rem),
    radial-gradient(circle at 10% 20%, rgba(183, 121, 31, .055), transparent 30rem),
    linear-gradient(180deg, #faf6ef 0%, #f7f2e9 46%, #f3ecdf 100%);
}

.site-header {
  background: rgba(247, 242, 233, .88);
  border-bottom-color: rgba(227, 215, 199, .72);
  box-shadow: 0 10px 34px rgba(40, 31, 18, .026);
}
.nav-wrap { padding-block: 16px; }
.brand { font-size: 21px; letter-spacing: -.015em; }
.nav-links { gap: 8px; font-size: 15px; }
.nav-links a { padding: 9px 14px; }
.nav-links a.active, .nav-links a:hover {
  background: rgba(255, 253, 247, .86);
  box-shadow: 0 8px 22px rgba(40, 31, 18, .035);
}

.hero {
  min-height: 610px;
  padding: 64px 0 70px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .68fr);
  gap: clamp(38px, 6vw, 88px);
}
.hero h1 {
  font-size: clamp(56px, 7.4vw, 88px);
  letter-spacing: -.05em;
}
html[lang="ar"] .hero h1 { letter-spacing: -.012em; }
.hero .lead {
  max-width: 600px;
  margin-top: 24px;
  font-size: clamp(20px, 1.65vw, 25px);
  color: #5b534a;
}
.actions { margin-top: 30px; gap: 13px; }
.btn {
  min-height: 48px;
  padding: 11px 22px;
  border-color: rgba(15, 76, 92, .16);
}
.btn.primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-strong));
  box-shadow: 0 16px 36px rgba(15, 76, 92, .18);
}
.btn.ghost { background: rgba(255,253,247,.72); }

.hero-panel {
  max-width: 420px;
  justify-self: start;
  padding: 16px;
  border-radius: 36px;
  background: rgba(255, 253, 247, .76);
  backdrop-filter: blur(18px);
}
html[dir="ltr"] .hero-panel { justify-self: end; }
.hero-panel-item {
  min-height: 108px;
  padding: 20px 22px 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(251,246,236,.96));
}
.hero-panel-item span {
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 8px;
}
.hero-panel-item strong {
  font-size: 22px;
  line-height: 1.38;
}
.hero-panel-item small { color: #82786c; }

.section {
  padding: 74px 0;
  border-bottom-color: rgba(227, 215, 199, .72);
}
.section-head {
  margin-bottom: 30px;
  align-items: center;
}
.section-head h1,
.section-head h2 {
  font-size: clamp(38px, 4.9vw, 58px);
  letter-spacing: -.04em;
}
html[lang="ar"] .section-head h1,
html[lang="ar"] .section-head h2 { letter-spacing: -.01em; }
.section-head > a {
  border: 1px solid transparent;
  color: var(--primary);
}
.section-head > a:hover {
  border-color: var(--line);
  background: rgba(255,253,247,.72);
}

.grid { gap: 24px; }
.card {
  background: rgba(255,253,247,.92);
  border-color: rgba(227, 215, 199, .94);
  border-radius: 26px;
  padding: 28px;
  box-shadow: 0 16px 48px rgba(40, 31, 18, .055);
}
.card:hover {
  box-shadow: 0 28px 70px rgba(40, 31, 18, .10);
  transform: translateY(-3px);
}
.card .meta { margin-bottom: 16px; }
.badge {
  background: rgba(15, 76, 92, .075);
  color: var(--primary);
  letter-spacing: .01em;
}
.card h3 {
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.34;
  margin-bottom: 12px;
}
.card p { color: #675e54; }
.card-footer { padding-top: 8px; }
.card-footer a { color: var(--primary-strong); }

.article-card { min-height: 220px; }
.article-card h3 a { color: var(--primary-strong); }
.article-card h3 a:hover { color: var(--ink); }

.video-card {
  overflow: hidden;
  padding: 0;
}
.video-card .thumb {
  margin: 0;
  border-radius: 26px 26px 0 0;
  background: linear-gradient(145deg, var(--primary-strong), var(--primary));
}
.video-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-card-body {
  padding: 26px 28px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.video-card .actions { margin-top: auto; }
.video-card h3 { color: var(--ink); }

.book-card {
  display: grid;
  grid-template-columns: minmax(124px, 168px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  min-height: 230px;
}
html[dir="rtl"] .book-card { direction: rtl; }
.book-card-cover {
  margin: 0;
  width: 100%;
  aspect-ratio: 4/5.25;
  border-radius: 20px;
  box-shadow: 0 20px 46px rgba(15, 76, 92, .10);
}
.book-card-cover img { object-fit: cover; }
.book-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
.book-card-body .card-footer { margin-top: auto; }

.book-layout {
  grid-template-columns: minmax(210px, 310px) minmax(0, 1fr);
  padding-top: 70px;
}
.book-cover { border-radius: 28px; }
.price-card { border-radius: 26px; }
.price { color: var(--primary-strong); }

.newsletter {
  margin: 68px 0 78px;
  padding: 30px 34px;
  border-radius: 34px;
  grid-template-columns: 1fr minmax(320px, .62fr);
  background:
    radial-gradient(circle at 92% 16%, rgba(183, 121, 31, .10), transparent 20rem),
    linear-gradient(145deg, rgba(255,253,247,.98), rgba(239,244,241,.98));
}
.newsletter h2 {
  font-size: clamp(30px, 3.4vw, 44px);
  letter-spacing: -.025em;
}
.newsletter p { color: #5f574d; margin: 8px 0 0; }
.newsletter-form { align-items: center; }
.input {
  background: rgba(255,255,255,.88);
  border-color: rgba(227, 215, 199, .95);
}

.site-footer {
  background: rgba(255, 253, 247, .56);
}
.footer-wrap {
  padding-block: 36px;
  align-items: start;
}
.footer-wrap strong { color: var(--ink); font-size: 18px; }
.footer-wrap p { margin: 8px 0 0; }
.footer-links a { color: var(--primary); }
.footer-links a:hover { color: var(--primary-strong); }

.category-bar { padding-bottom: 30px; }
.category-btn {
  background: rgba(255,253,247,.78);
  border-color: rgba(227, 215, 199, .95);
}
.category-btn.active { background: linear-gradient(180deg, var(--primary), var(--primary-strong)); }

.article-header .lead,
.lead { color: #625a50; }
.article-content blockquote { border-inline-start-color: var(--accent); }
.video-box { background: linear-gradient(145deg, #0d3036, #0f4c5c); }
.empty-state { background: rgba(255,253,247,.72); }

@media (max-width: 980px) {
  .hero { min-height: auto; padding: 54px 0 62px; }
  .hero-panel { max-width: none; justify-self: stretch; }
  .newsletter { grid-template-columns: 1fr; }
  .book-card { grid-template-columns: 120px minmax(0,1fr); }
}

@media (max-width: 700px) {
  .hero h1 { font-size: 48px; }
  .hero .lead { font-size: 19px; }
  .section { padding: 56px 0; }
  .section-head { align-items: flex-start; gap: 12px; }
  .book-card {
    grid-template-columns: 1fr;
    text-align: inherit;
  }
  .book-card-cover {
    max-width: 220px;
    margin-inline: auto;
  }
  .newsletter { padding: 26px; margin-block: 50px 58px; }
  .footer-wrap { grid-template-columns: 1fr; }
  .footer-links { justify-content: start; }
  html[dir="rtl"] .footer-links { justify-content: start; }
}

/* ==============================
   Premium refinement layer - v4
   Fixes: mobile overflow, listing grids, book cards, calmer hierarchy
   ============================== */
html, body { max-width: 100%; overflow-x: hidden; }

.container, .nav-wrap, .footer-wrap { width: min(100%, var(--max)); }

.hero {
  min-height: clamp(520px, 68vh, 660px);
  padding-top: clamp(54px, 7vh, 72px);
  padding-bottom: clamp(54px, 7vh, 76px);
  align-items: center;
}
.hero h1 { font-size: clamp(52px, 6.8vw, 82px); }
.hero .lead { font-size: clamp(19px, 1.45vw, 23px); line-height: 1.9; }
.hero-panel { max-width: 460px; }
.hero-panel-item strong { font-size: clamp(18px, 1.55vw, 22px); }

.section { padding-block: clamp(58px, 7vw, 78px); }
.section-head h1, .section-head h2 { font-size: clamp(34px, 4.2vw, 54px); }

/* Listing pages should not use tiny three-column cards for books. */
#articles-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
#videos-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr)); }
#books-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 640px));
  justify-content: center;
}

.book-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); }
.video-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr)); }
.article-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr)); }

.book-card {
  grid-template-columns: minmax(110px, 150px) minmax(0, 1fr);
  min-height: 210px;
  align-items: stretch;
}
.book-card-cover { align-self: center; max-width: 150px; }
.book-card h3 { font-size: clamp(22px, 2.1vw, 28px); line-height: 1.35; }
.book-card p { font-size: 15.5px; line-height: 1.75; }

.video-card .thumb { max-height: 330px; }
.video-card h3 { font-size: clamp(23px, 2.3vw, 30px); }

.newsletter {
  margin: 54px 0 64px;
  padding: clamp(24px, 3.2vw, 34px);
}

/* Book detail page: keep cover elegant and content readable. */
.book-layout { grid-template-columns: minmax(220px, 330px) minmax(0, 1fr); }
.book-layout article .lead { max-width: 680px; }
.book-cover { max-width: 330px; margin-inline: auto; }

@media (max-width: 980px) {
  .nav-wrap { position: relative; }
  .hero {
    grid-template-columns: 1fr !important;
    min-height: auto;
    gap: 28px;
    padding: 46px 0 56px;
  }
  .hero > div:first-child { order: 1; }
  .hero-panel {
    order: 2;
    max-width: 100%;
    width: 100%;
    justify-self: stretch !important;
  }
  .hero h1 { font-size: clamp(46px, 12vw, 64px); }
  .hero .lead { max-width: 620px; font-size: 19px; }
  .actions { gap: 10px; }
  .section-head { align-items: flex-start; }
  .book-layout { grid-template-columns: 1fr !important; }
}

@media (max-width: 700px) {
  .container { padding-inline: 16px; }
  .site-main { min-height: auto; }
  .nav-toggle { width: 48px; height: 48px; justify-content: center; border-radius: 16px; }
  .nav-links { top: 64px; inset-inline: 14px; }
  .hero { padding: 36px 0 46px; }
  .hero h1 { font-size: clamp(42px, 15vw, 56px); }
  .hero .lead { font-size: 18px; line-height: 1.95; }
  .actions { flex-direction: column; align-items: stretch; max-width: 260px; }
  .btn { width: 100%; }
  .hero-panel { padding: 12px; border-radius: 26px; }
  .hero-panel-item { min-height: 0; padding: 16px 18px; }
  .hero-panel-item strong { font-size: 20px; }
  .section { padding-block: 46px; }
  .section-head { margin-bottom: 22px; }
  .section-head h1, .section-head h2 { font-size: clamp(32px, 10vw, 44px); }
  .grid, .grid.two, #articles-grid, #videos-grid, #books-grid, .book-grid, .video-grid, .article-grid {
    grid-template-columns: 1fr !important;
  }
  .card { border-radius: 24px; padding: 22px; }
  .article-card { min-height: 0; }
  .book-card { grid-template-columns: 112px minmax(0, 1fr) !important; gap: 16px; min-height: 0; }
  .book-card-cover { max-width: 112px; border-radius: 16px; }
  .book-card h3 { font-size: 22px; }
  .book-card p { display: none; }
  .book-card .meta { gap: 7px; font-size: 12px; }
  .book-card .card-footer { padding-top: 0; }
  .video-card-body { padding: 22px; }
  .newsletter { margin-block: 42px 48px; }
}

@media (max-width: 430px) {
  .hero h1 { font-size: 42px; }
  .actions { max-width: 100%; }
  .book-card { grid-template-columns: 1fr !important; }
  .book-card-cover { max-width: 150px; margin-inline: auto; }
  .book-card p { display: block; }
}

/* V42: article thumbnails and embedded video cards */
.article-card {
  overflow: hidden;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}
.article-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(15,76,92,.12), rgba(183,121,31,.14));
  border-bottom: 1px solid var(--line);
}
.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.article-card:hover .article-thumb img { transform: scale(1.035); }
.article-thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--primary);
  font-weight: 800;
  min-height: 180px;
}
.article-card-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.article-card-body .card-footer { margin-top: auto; }
.article-cover {
  margin: 34px 0 44px;
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--paper);
}
.article-cover img {
  width: 100%;
  max-height: 680px;
  object-fit: cover;
  display: block;
}
.article-cover figcaption {
  padding: 12px 18px 16px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.video-embed-thumb { padding: 0; aspect-ratio: 16 / 9; }
.video-embed-thumb .video-frame { border-radius: 26px 26px 0 0; }
.video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }

@media (max-width: 700px) {
  .article-card-body { padding: 22px; }
  .article-thumb { aspect-ratio: 16 / 10; }
  .article-cover { border-radius: 22px; margin: 24px 0 34px; }
}

/* ==============================
   SEO + reading experience upgrade - 2026-05-27
   Clean URLs, article TOC, summary boxes, book sales page, video thumbnails
   ============================== */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 28px;
}
.breadcrumbs a { color: var(--primary); font-weight: 800; }
.breadcrumbs span:last-child { color: var(--muted); }
.page-breadcrumbs { padding-top: 34px; margin-bottom: 0; }
.summary-box,
.toc-card {
  background: rgba(255,253,248,.9);
  border: 1px solid rgba(222, 212, 199, .95);
  border-radius: 24px;
  padding: 22px 24px;
  margin: 28px 0;
  box-shadow: var(--shadow-sm);
}
.summary-box strong,
.toc-card strong {
  display: block;
  color: var(--primary-strong);
  font-size: 16px;
  margin-bottom: 8px;
}
.summary-box p { margin: 0; color: #5f574d; }
.toc-card ol {
  margin: 8px 0 0;
  padding-inline-start: 22px;
  display: grid;
  gap: 6px;
}
.toc-card a { font-weight: 700; }
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.tag-list span {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(255,253,248,.72);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}
.back-link { margin-top: 42px; font-weight: 800; }
.compact-related { padding-block: 52px; }
.video-thumb-link { position: relative; display: block; }
.play-badge {
  position: absolute;
  inset-inline-start: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 253, 248, .92);
  color: var(--primary-strong);
  box-shadow: 0 16px 36px rgba(0,0,0,.14);
  font-size: 22px;
  padding-inline-start: 3px;
}
html[dir="rtl"] .play-badge { transform: translate(50%, -50%); }
.info-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 24px;
}
.info-chips span {
  border: 1px solid var(--line);
  background: rgba(255,253,248,.72);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.book-detail-layout article > p:not(.eyebrow):not(.lead) {
  color: #5f574d;
  font-size: 18px;
  max-width: 760px;
}
.mini-section {
  padding-block: 34px;
  border-bottom-style: dashed;
}
.mini-section h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 16px; }
.clean-list {
  margin: 0;
  padding-inline-start: 22px;
  display: grid;
  gap: 10px;
  color: #4f473f;
}
.clean-list li::marker { color: var(--accent); font-weight: 800; }
.faq-list { display: grid; gap: 10px; }
.faq-list details {
  background: rgba(255,253,248,.78);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 18px;
}
.faq-list summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--primary-strong);
}
.faq-list p { margin: 10px 0 0; color: var(--muted); }
.article-content figure {
  margin: 36px 0;
}
.article-content figure img {
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.article-content figcaption {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  margin-top: 10px;
}
@media (max-width: 700px) {
  .breadcrumbs { font-size: 13px; margin-bottom: 20px; }
  .summary-box, .toc-card { border-radius: 20px; padding: 18px; }
  .play-badge { width: 50px; height: 50px; }
  .page-breadcrumbs { padding-top: 22px; }
}


/* ==============================
   Homepage polish - fix3
   Makes the landing page feel fuller and hides empty channel sections.
   ============================== */
.premium-hero {
  min-height: clamp(500px, 62vh, 620px);
}
.hero-copy { max-width: 720px; }
.home-feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 auto;
  padding: 26px 0 18px;
  border-bottom: 1px solid rgba(227, 215, 199, .72);
}
.home-feature-strip > div {
  min-height: 112px;
  border: 1px solid rgba(227, 215, 199, .9);
  border-radius: 24px;
  padding: 20px 22px;
  background: rgba(255, 253, 247, .70);
  box-shadow: var(--shadow-sm);
}
.home-feature-strip strong {
  display: block;
  color: var(--primary-strong);
  font-size: 18px;
  margin-bottom: 5px;
}
.home-feature-strip span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.home-section .section-head,
.home-section .home-cards,
.home-section > .empty-state {
  width: min(100%, 1080px);
  margin-inline: auto;
}
.home-section.single-section .section-head,
.home-section.single-section .home-cards,
.home-section.single-section > .empty-state {
  width: min(100%, 760px);
}
.home-section.single-section .section-head {
  justify-content: space-between;
}
.home-section.single-section .home-cards {
  grid-template-columns: 1fr !important;
}
.home-section.single-section .book-card {
  width: 100%;
}
.home-section .empty-state {
  text-align: center;
}

@media (min-width: 981px) {
  .premium-hero {
    grid-template-columns: minmax(0, 1.04fr) minmax(320px, .64fr);
  }
}
@media (max-width: 980px) {
  .home-feature-strip { grid-template-columns: 1fr; padding-top: 18px; }
}
@media (max-width: 700px) {
  .home-feature-strip { gap: 12px; }
  .home-feature-strip > div { min-height: 0; padding: 18px; border-radius: 20px; }
  .home-section.single-section .section-head,
  .home-section .section-head { align-items: flex-start; }
}

/* ==============================
   Articles library upgrade - fix4
   Search, polished categories, featured article, organized grid, load more.
   ============================== */
.articles-page-shell .articles-hero {
  padding-block: 64px 34px;
  border-bottom: 0;
}
.articles-title-head {
  margin-bottom: 26px;
}
.articles-title-head h1 {
  font-size: clamp(42px, 7vw, 78px);
}
.articles-title-head p:not(.eyebrow) {
  font-size: clamp(17px, 1.7vw, 22px);
  max-width: 760px;
}
.articles-filter-panel {
  background: rgba(255,253,248,.86);
  border: 1px solid rgba(222, 212, 199, .9);
  border-radius: 30px;
  padding: clamp(18px, 2.4vw, 28px);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 18px;
}
.article-search-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 14px;
}
.article-search-wrap > span {
  color: var(--primary-strong);
  font-weight: 900;
}
.article-search-wrap small {
  grid-column: 2;
  color: var(--muted);
  line-height: 1.7;
}
.article-search-input {
  min-height: 54px;
  border-radius: 18px;
  background: #fffdf8;
  border-color: rgba(222, 212, 199, .95);
  padding-inline: 18px;
}
.articles-category-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.article-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(222, 212, 199, .95);
  background: rgba(255,253,248,.72);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 800;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.article-category-chip small {
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(23,74,79,.08);
  color: var(--primary-strong);
  font-size: 12px;
  line-height: 1;
}
.article-category-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(23,74,79,.24);
  box-shadow: var(--shadow-sm);
}
.article-category-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 12px 28px rgba(23,74,79,.14);
}
.article-category-chip.active small {
  background: rgba(255,255,255,.18);
  color: #fff;
}
.articles-results-section {
  padding-top: 34px;
}
.compact-section-head {
  align-items: flex-start;
  margin-bottom: 20px;
}
.compact-section-head h2 {
  font-size: clamp(30px, 4.4vw, 54px);
}
#articles-results-count {
  margin-top: 6px;
  color: var(--muted);
}
.articles-featured-slot:not(:empty) {
  margin-bottom: 28px;
}
.featured-article-card {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(320px, .8fr);
  gap: 0;
  background: rgba(255,253,248,.92);
  border: 1px solid rgba(222, 212, 199, .95);
  border-radius: 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
html[dir="rtl"] .featured-article-card {
  grid-template-columns: minmax(320px, .8fr) minmax(0, .95fr);
}
.featured-article-media {
  min-height: 340px;
  background: linear-gradient(135deg, rgba(15,76,92,.10), rgba(183,121,31,.13));
  overflow: hidden;
  display: block;
}
.featured-article-media img {
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
  transition: transform .45s ease;
}
.featured-article-card:hover .featured-article-media img { transform: scale(1.03); }
.featured-article-copy {
  padding: clamp(26px, 3.6vw, 46px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-article-copy .meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}
.featured-article-copy h2 {
  font-size: clamp(30px, 4.1vw, 50px);
  margin-bottom: 16px;
}
.featured-article-copy h2 a { color: var(--primary-strong); }
.featured-article-copy p {
  color: #625a51;
  margin: 0;
  font-size: 17px;
  line-height: 1.9;
}
.articles-list-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)) !important;
  align-items: stretch;
}
.articles-list-grid .article-card {
  min-height: 100%;
}
.articles-empty-state {
  grid-column: 1 / -1;
}
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}
.load-more-wrap .btn[hidden] { display: none; }

@media (max-width: 900px) {
  .featured-article-card,
  html[dir="rtl"] .featured-article-card {
    grid-template-columns: 1fr;
  }
  .featured-article-media,
  .featured-article-media img {
    min-height: 260px;
  }
}
@media (max-width: 700px) {
  .articles-page-shell .articles-hero { padding-block: 38px 24px; }
  .articles-filter-panel { border-radius: 24px; padding: 16px; }
  .article-search-wrap { grid-template-columns: 1fr; }
  .article-search-wrap small { grid-column: 1; }
  .articles-category-strip { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .article-category-chip { flex: 0 0 auto; }
  .featured-article-card { border-radius: 26px; }
  .featured-article-copy { padding: 24px; }
  .featured-article-copy h2 { font-size: 28px; }
  .featured-article-media,
  .featured-article-media img { min-height: 220px; }
}

/* ==============================
   Conversion services layer - fix5
   ============================== */
.service-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-block: 26px 56px;
  border-bottom: 1px solid var(--line);
}
.service-strip a,
.path-card,
.bundle-card,
.recommend-card,
.lead-magnet {
  background: rgba(255,253,248,.86);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-sm);
}
.service-strip a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  color: var(--text);
}
.service-strip a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.service-strip strong { color: var(--primary); font-size: 18px; }
.service-strip span { color: var(--muted); font-size: 14px; line-height: 1.7; }

.page-hero.service-page-hero {
  text-align: center;
  padding: 92px 0 48px;
  border-bottom: 0;
}
.page-hero.service-page-hero h1 { font-size: clamp(52px, 6.6vw, 86px); }
.page-hero.service-page-hero p { color: var(--muted); max-width: 760px; margin: 12px auto 0; font-size: 20px; line-height: 1.9; }

.path-grid,
.bundles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  border-top: 0;
  padding-top: 24px;
}
.path-card,
.bundle-card,
.recommend-card,
.lead-magnet {
  padding: 28px;
}
.path-card h2,
.bundle-card h2,
.recommend-card h2 { margin: 12px 0 10px; font-size: clamp(28px, 3.2vw, 42px); }
.path-card p,
.bundle-card p,
.recommend-card p,
.lead-magnet p { color: var(--muted); }
.path-steps,
.bundle-books {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.path-steps a,
.bundle-books a,
.path-steps span,
.bundle-books span {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(237,242,239,.9);
  color: var(--primary-strong);
  font-weight: 800;
}
.bundle-price {
  margin: 20px 0;
  display: grid;
  gap: 4px;
}
.bundle-price del { color: var(--muted); }
.bundle-price strong { font-size: 32px; color: var(--primary); }
.bundle-price small { color: var(--muted); }

.rating-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #b7791f;
  font-weight: 900;
  margin: 8px 0 14px;
}
.rating-row small { color: var(--muted); font-weight: 700; }
.offer-ribbon {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid rgba(183,121,31,.26);
  background: rgba(255,241,204,.72);
  color: #7a4a08;
  border-radius: 20px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.offer-ribbon code {
  background: rgba(255,253,248,.86);
  border: 1px dashed rgba(183,121,31,.5);
  color: var(--primary-strong);
  border-radius: 12px;
  padding: 5px 9px;
  font-weight: 900;
}
.offer-ribbon small { color: #7a4a08; }
.sample-actions { margin-top: 18px; display: grid; gap: 10px; }
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
}
.trust-row span,
.mini-checks li {
  background: rgba(237,242,239,.95);
  color: var(--primary-strong);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}
.free-sample-section blockquote { font-size: 21px; line-height: 2; }
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.testimonial-grid blockquote {
  margin: 0;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,253,248,.9);
  border: 1px solid var(--line);
}
.testimonial-grid p { color: var(--text); }
.testimonial-grid cite { color: var(--muted); font-size: 13px; }
.inline-book-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 18px;
  align-items: center;
  background: linear-gradient(145deg, rgba(15,76,92,.08), rgba(255,253,248,.95));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  margin: 34px 0;
  box-shadow: var(--shadow-sm);
}
.inline-book-cta h2 { margin: 2px 0 8px; font-size: 30px; }
.inline-book-cta p { color: var(--muted); margin: 0 0 16px; }
.inline-book-cta img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.conversion-newsletter .mini-checks {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quiz-panel {
  max-width: 960px;
  margin-inline: auto;
  background: rgba(255,253,248,.9);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.quiz-result { margin-top: 22px; }
.lead-magnet {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 22px;
}
.book-card { position: relative; }
.book-card .offer-ribbon {
  position: absolute;
  z-index: 2;
  inset-inline-start: 18px;
  top: 18px;
  margin: 0;
  max-width: calc(100% - 36px);
  backdrop-filter: blur(8px);
}
@media (max-width: 1100px) {
  .service-strip, .path-grid, .bundles-grid, .testimonial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .service-strip, .path-grid, .bundles-grid, .testimonial-grid { grid-template-columns: 1fr; }
  .inline-book-cta { grid-template-columns: 1fr; }
  .inline-book-cta img { max-width: 170px; }
  .lead-magnet { grid-template-columns: 1fr; }
  .page-hero.service-page-hero { padding-top: 58px; }
}


/* ==============================
   Bookstore conversion layer - fix6
   ============================== */
.bookstore-nav .brand small { display:block; color: var(--muted); font-size: 11px; font-weight: 700; margin-top: 4px; letter-spacing: 0; }
.bookstore-nav .brand { line-height: 1.05; }
.bookstore-hero { min-height: 68vh; }
.bookstore-trust { margin-top: -18px; }
.bookstore-service-strip { padding-top: 36px; }
.reader-journey { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .7fr); gap: 24px; align-items: center; background: linear-gradient(135deg, rgba(23,74,79,.08), rgba(255,253,248,.78)); border: 1px solid var(--line); border-radius: 34px; padding: clamp(28px, 4vw, 46px); margin-block: 42px; }
.reader-journey p { color: var(--muted); max-width: 680px; }
.journey-steps { display: grid; gap: 12px; }
.journey-steps span { background: #fffdf8; border: 1px solid var(--line); border-radius: 999px; padding: 13px 16px; font-weight: 900; color: var(--primary-strong); }
.library-stats { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-top:22px; }
.library-stats span { display:inline-flex; align-items:center; gap:8px; border:1px solid var(--line); background:rgba(255,253,248,.82); border-radius:999px; padding:9px 14px; color:var(--muted); font-weight:800; }
.library-stats strong { color:var(--primary); font-size:20px; }
.book-filter-panel { background:rgba(255,253,248,.9); border:1px solid var(--line); border-radius:30px; padding:clamp(18px,2.4vw,28px); box-shadow:var(--shadow-sm); display:grid; gap:18px; }
.book-type-tabs { display:flex; flex-wrap:wrap; gap:10px; }
.book-type-chip { border:1px solid var(--line); background:rgba(255,253,248,.72); color:var(--muted); border-radius:999px; padding:10px 16px; cursor:pointer; font-weight:900; }
.book-type-chip.active { background:var(--primary); border-color:var(--primary); color:#fff; }
.sort-field { display:flex; gap:12px; align-items:center; max-width:360px; color:var(--primary-strong); font-weight:900; }
.sort-field .input { min-height:48px; border-radius:16px; }
.books-featured-slot:not(:empty) { margin-bottom:28px; }
.featured-book-card { display:grid; grid-template-columns:220px minmax(0,1fr); gap:28px; align-items:center; background:rgba(255,253,248,.93); border:1px solid var(--line); border-radius:32px; box-shadow:var(--shadow); padding:clamp(22px,3vw,34px); }
.featured-book-cover { max-width:220px; aspect-ratio:2/3; border-radius:22px; overflow:hidden; border:1px solid var(--line); background:var(--paper-2); }
.featured-book-cover img { width:100%; height:100%; object-fit:cover; }
.featured-book-copy h2 { font-size:clamp(32px,4vw,54px); margin-bottom:12px; }
.featured-book-copy p { color:var(--muted); max-width:720px; }
.book-card-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:auto; padding-top:12px; }
.book-card-actions .btn { min-height:40px; padding:8px 14px; font-size:14px; }
.product-cta-row { display:flex; flex-wrap:wrap; gap:12px; margin:24px 0 12px; }
.checkout-confirm-card { margin-top:28px; scroll-margin-top:110px; }
.checkout-confirm-card h2 { font-size:clamp(24px,3vw,36px); margin:4px 0 16px; }
.order-summary-list { list-style:none; padding:0; margin:0 0 18px; display:grid; gap:10px; }
.order-summary-list li { display:flex; justify-content:space-between; gap:14px; padding:12px 14px; border-radius:16px; background:rgba(237,242,239,.8); }
.order-summary-list strong { color:var(--primary-strong); }
.empty-review-state { background:rgba(237,242,239,.85); border:1px dashed rgba(23,74,79,.22); border-radius:20px; padding:18px; color:var(--muted); }
.muted-rating { color: var(--muted); font-weight: 800; }
.guided-path-grid .path-card { display:flex; flex-direction:column; }
.rich-help-list h2 { border-top:1px solid var(--line); padding-top:24px; }
.rich-help-list h2:first-child { border-top:0; padding-top:0; }
@media (max-width: 860px) { .reader-journey, .featured-book-card { grid-template-columns:1fr; } .featured-book-cover { max-width:180px; } .sort-field { max-width:100%; align-items:flex-start; flex-direction:column; } }
@media (max-width: 620px) { .book-type-tabs { flex-wrap:nowrap; overflow-x:auto; padding-bottom:4px; } .book-type-chip { flex:0 0 auto; } .order-summary-list li { flex-direction:column; } }

/* Fix9: community library, authors, submissions, refined discovery */
.author-grid .author-card { display:flex; gap:1.1rem; align-items:flex-start; padding:1.2rem; }
.author-avatar { width:76px; height:76px; border-radius:22px; object-fit:cover; flex:0 0 76px; background:var(--soft, #f1eadf); display:grid; place-items:center; font-weight:800; font-size:1.8rem; color:var(--primary, #0f4c5c); }
.author-card h3 { margin:.1rem 0 .35rem; }
.author-card p { margin:.2rem 0 .75rem; color:var(--muted, #64748b); }
.small-chips { display:flex; flex-wrap:wrap; gap:.45rem; margin-top:.65rem; }
.small-chips span { padding:.28rem .6rem; border:1px solid rgba(15,76,92,.14); border-radius:999px; background:rgba(255,255,255,.6); font-size:.82rem; color:var(--muted, #64748b); }
.byline { margin:.15rem 0 .35rem; color:var(--muted, #64748b); font-size:.92rem; }
.submit-page .contribution-form { margin-top:1.25rem; border:1px solid rgba(15,76,92,.12); border-radius:28px; padding:1.25rem; background:linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.62)); box-shadow:0 18px 50px rgba(15,76,92,.08); }
.review-note { background:rgba(15,76,92,.045); border-radius:24px; padding:1.2rem; }
.legal-page .article-content h2, .support-page .article-content h2 { margin-top:1.6rem; }
.authors-hero .actions, .page-hero .actions { display:flex; flex-wrap:wrap; gap:.7rem; margin-top:1rem; }
.book-card .small-chips { margin-bottom:.7rem; }
.library-discovery { display:grid; grid-template-columns: minmax(220px, 280px) 1fr; gap:1.3rem; align-items:start; }
.discovery-panel { position:sticky; top:1rem; padding:1rem; border-radius:24px; border:1px solid rgba(15,76,92,.12); background:rgba(255,255,255,.78); }
.discovery-panel .field { margin-bottom:.75rem; }
.pwa-note { border:1px dashed rgba(15,76,92,.25); background:rgba(15,76,92,.05); padding:.85rem 1rem; border-radius:18px; margin-top:1rem; }
@media (max-width: 820px){ .library-discovery { grid-template-columns:1fr; } .discovery-panel { position:static; } .author-grid .author-card { flex-direction:column; } }


/* ==============================
   Library polish layer - fix10
   ============================== */
:root { --max: 1220px; }
.container { max-width: min(var(--max), calc(100% - 48px)); }
.section { padding: clamp(42px, 5vw, 74px) 0; }
.compact-hero.hero { min-height: 500px; padding: clamp(48px, 6vw, 78px) 0 clamp(44px, 6vw, 68px); }
.home-polished .home-section { padding-top: clamp(36px, 4vw, 62px); padding-bottom: clamp(42px, 5vw, 72px); }
.home-polished .section-head { margin-bottom: 22px; }
.calm-principles { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:16px; margin: -18px 0 22px; border-block:1px solid var(--line); padding-block:22px; }
.calm-principles article { background: rgba(255,253,248,.72); border:1px solid rgba(227,215,199,.78); border-radius:24px; padding:22px; min-height:110px; box-shadow: var(--shadow-sm); }
.calm-principles strong { display:block; color:var(--primary-strong); font-size:18px; margin-bottom:8px; }
.calm-principles span { display:block; color:var(--muted); line-height:1.8; }
.bookstore-card .meta span:last-child { white-space:nowrap; }
.bookstore-card .byline { color: var(--muted); margin: -4px 0 10px; font-size:14px; }
.books-hero.page-hero.service-page-hero,
.articles-hero.section,
.page-hero.service-page-hero,
.authors-hero.section { padding-top: clamp(54px, 6vw, 86px); padding-bottom: clamp(30px, 4vw, 52px); }
.books-filter-section, .articles-hero + .articles-results-section { padding-top: 24px; }
.book-filter-panel, .articles-filter-panel { box-shadow: 0 18px 55px rgba(40,31,18,.055); }
.books-results-section, .articles-results-section { padding-top: 32px; }
.featured-book-card, .featured-article-card { box-shadow: 0 20px 64px rgba(40,31,18,.085); }
.book-layout.book-detail-layout { padding-top: clamp(38px, 5vw, 68px); padding-bottom: clamp(48px, 6vw, 78px); }
.book-detail-layout article > .mini-section { padding: 34px 0; }
.product-cta-row .btn.primary { min-width: 180px; }
.site-footer { margin-top: 24px; }
.static-fallback { padding: 54px 0; }
.static-fallback .static-card { background:rgba(255,253,248,.86); border:1px solid var(--line); border-radius:28px; padding:30px; max-width:860px; box-shadow:var(--shadow-sm); }
.static-fallback h1 { margin-bottom: 12px; }
.static-fallback p { color:var(--muted); font-size:18px; line-height:1.9; }
.admin-redirect { min-height:100vh; display:grid; place-items:center; padding:24px; }
@media (max-width: 980px) {
  .container { max-width: min(var(--max), calc(100% - 36px)); }
  .compact-hero.hero { min-height:auto; }
  .calm-principles { grid-template-columns:1fr; margin-top: 8px; }
}
@media (max-width: 620px) {
  .container { max-width:100%; padding-inline:18px; }
  .section { padding: 38px 0; }
  .compact-hero.hero { padding-top: 42px; }
}


/* ==============================
   Homepage calm polish - fix11
   ============================== */
.home-polished .compact-hero.hero {
  min-height: clamp(430px, 54vh, 555px) !important;
  padding-top: clamp(42px, 5vw, 64px) !important;
  padding-bottom: clamp(38px, 4.6vw, 58px) !important;
}
.home-polished .hero .lead {
  max-width: 760px;
}
.home-polished .actions .btn {
  min-width: 128px;
}
.home-polished .calm-principles {
  margin: 0 0 clamp(18px, 3vw, 30px) !important;
  padding-block: 18px !important;
}
.home-polished .calm-principles article {
  min-height: 92px !important;
  padding: 18px 20px !important;
}
.home-polished .home-section {
  padding-top: clamp(34px, 4vw, 56px) !important;
  padding-bottom: clamp(34px, 4vw, 58px) !important;
}
.home-polished .section-head {
  margin-bottom: 18px !important;
}
.home-polished .section-head h2 {
  line-height: 1.16;
}
.home-polished .book-card {
  min-height: 252px;
  box-shadow: 0 18px 58px rgba(40,31,18,.07);
}
.home-polished .book-card .offer-ribbon,
.home-section .book-card .offer-ribbon,
#books-grid .book-card .offer-ribbon {
  display: none !important;
}
.home-polished .book-card-cover {
  max-width: 142px;
}
.home-polished .article-card {
  box-shadow: 0 18px 58px rgba(40,31,18,.07);
}
.home-polished .article-card h3 {
  line-height: 1.35;
}
.calm-newsletter.newsletter {
  margin: clamp(36px, 4.4vw, 52px) 0 clamp(46px, 5vw, 60px) !important;
  padding: clamp(22px, 2.8vw, 30px) !important;
  min-height: 0;
}
.calm-newsletter .mini-checks {
  margin-top: 12px;
}
.grouped-footer {
  grid-template-columns: minmax(240px, .85fr) minmax(0, 1.35fr) !important;
  gap: clamp(26px, 5vw, 72px) !important;
}
.footer-link-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.footer-link-group {
  display: grid;
  gap: 9px;
  align-content: start;
}
.footer-link-group h3 {
  color: var(--ink);
  font-size: 15px;
  margin: 0 0 4px;
}
.footer-link-group a {
  color: var(--primary);
  line-height: 1.45;
}
.footer-link-group a:hover {
  color: var(--primary-strong);
}
.footer-about p {
  max-width: 520px;
}
@media (max-width: 980px) {
  .grouped-footer { grid-template-columns: 1fr !important; }
  .footer-link-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .home-polished .compact-hero.hero { padding-top: 34px !important; }
  .footer-link-groups { grid-template-columns: 1fr; }
  .home-polished .calm-principles { gap: 10px; }
}

/* ==============================
   Books discovery polish - fix12
   ============================== */
.refined-books-page .refined-books-hero {
  padding-top: clamp(34px, 4.5vw, 58px) !important;
  padding-bottom: clamp(18px, 2.8vw, 34px) !important;
  text-align: center;
}
.refined-books-page .refined-books-hero h1 {
  font-size: clamp(42px, 5.6vw, 74px) !important;
  line-height: 1.08;
  margin-bottom: 12px;
}
.refined-books-page .refined-books-hero p:not(.eyebrow) {
  max-width: 760px;
  margin-inline: auto;
  color: var(--muted);
  line-height: 1.9;
  font-size: clamp(16px, 1.25vw, 20px);
}
.refined-books-filter-section {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}
.refined-book-filter-panel {
  border-radius: 26px !important;
  padding: clamp(14px, 1.7vw, 22px) !important;
  gap: 12px !important;
  box-shadow: 0 12px 38px rgba(40,31,18,.045) !important;
}
.books-search-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) repeat(auto-fit, minmax(170px, max-content));
  align-items: end;
  gap: 12px;
}
.books-search-wrap {
  margin: 0;
}
.books-search-wrap small {
  display: none;
}
.books-search-wrap .article-search-input {
  min-height: 52px;
}
.compact-sort {
  max-width: none !important;
  min-width: 170px;
  gap: 6px !important;
  align-items: flex-start !important;
  flex-direction: column;
  font-size: 14px;
}
.compact-sort .input {
  min-height: 52px !important;
  width: 100%;
  border-radius: 17px !important;
}
.refined-type-tabs,
.refined-category-strip {
  gap: 8px !important;
}
.refined-type-tabs .book-type-chip,
.refined-category-strip .article-category-chip {
  padding: 8px 13px !important;
  min-height: 40px;
}
.refined-category-strip .article-category-chip span {
  text-transform: none;
}
.books-filter-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}
.refined-books-results {
  padding-top: 20px !important;
}
.refined-books-results .compact-section-head {
  margin-bottom: 16px !important;
}
.refined-books-results .compact-section-head h2 {
  font-size: clamp(34px, 4vw, 54px) !important;
}
.refined-books-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 450px), 1fr)) !important;
  justify-content: stretch !important;
  align-items: stretch;
  gap: clamp(18px, 2.2vw, 28px);
}
.library-book-card {
  min-height: 272px !important;
  grid-template-columns: minmax(126px, 170px) minmax(0, 1fr) !important;
  gap: clamp(18px, 2vw, 24px) !important;
  align-items: center !important;
  padding: clamp(18px, 2.2vw, 26px) !important;
}
.library-book-card .book-card-cover {
  max-width: 168px !important;
  width: 100%;
  aspect-ratio: 2/3 !important;
  margin: 0 !important;
  border-radius: 18px !important;
}
.library-book-card .book-card-body {
  gap: 6px;
}
.library-book-card .calm-book-meta {
  margin-bottom: 2px;
}
.library-book-card .calm-book-meta span:not(.badge) {
  color: var(--muted);
}
.library-book-card h3 {
  font-size: clamp(24px, 2.4vw, 34px) !important;
  line-height: 1.28 !important;
  margin: 4px 0 2px;
}
.library-book-card .byline {
  margin: 0 0 4px !important;
  font-size: 14px;
}
.library-book-card p {
  line-height: 1.8 !important;
  margin: 4px 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-info-line {
  margin-top: 4px !important;
  margin-bottom: 8px !important;
}
.book-info-line span {
  background: rgba(237,242,239,.72);
}
.library-book-card .book-card-actions {
  padding-top: 8px !important;
  gap: 9px !important;
}
.library-book-card .book-card-actions .btn {
  min-height: 40px;
}
.refined-featured-slot:empty {
  display: none;
}
.refined-featured-book-card {
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) !important;
  padding: clamp(20px, 2.6vw, 30px) !important;
  gap: 24px !important;
}
.refined-featured-book-card .featured-book-cover {
  max-width: 190px !important;
}
.refined-featured-book-card .featured-book-copy h2 {
  font-size: clamp(30px, 3.5vw, 46px) !important;
}
@media (max-width: 900px) {
  .books-search-row { grid-template-columns: 1fr; }
  .compact-sort { width: 100%; }
  .library-book-card { grid-template-columns: minmax(105px, 132px) minmax(0, 1fr) !important; }
  .library-book-card .book-card-cover { max-width: 132px !important; }
  .library-book-card h3 { font-size: clamp(21px, 5vw, 28px) !important; }
}
@media (max-width: 620px) {
  .refined-books-page .refined-books-hero { padding-top: 28px !important; }
  .library-book-card { grid-template-columns: 1fr !important; text-align: center; }
  .library-book-card .book-card-cover { margin-inline: auto !important; max-width: 150px !important; }
  .library-book-card .book-card-actions,
  .library-book-card .small-chips,
  .library-book-card .meta { justify-content: center; }
  .books-filter-hint { text-align: center; }
}

/* ==============================
   Articles page polish - fix13
   Lighter hero, lighter filters, balanced cards when content is limited.
   ============================== */
.articles-page-shell .articles-hero {
  padding-block: clamp(28px, 4vw, 52px) 20px;
}
.articles-title-head {
  margin-bottom: 18px;
}
.articles-title-head h1 {
  font-size: clamp(38px, 5.8vw, 66px);
  letter-spacing: -0.035em;
}
.articles-title-head p:not(.eyebrow) {
  font-size: clamp(15px, 1.35vw, 19px);
  max-width: 760px;
}
.articles-filter-panel.slim-articles-filter {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  gap: 14px;
}
.slim-articles-filter .article-search-wrap {
  max-width: 920px;
  margin-inline: auto;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr);
}
.slim-articles-filter .article-search-input {
  min-height: 48px;
  border-radius: 999px;
}
.slim-articles-filter .article-search-wrap small {
  font-size: 13px;
}
.slim-articles-filter .articles-category-strip {
  justify-content: center;
  gap: 8px;
}
.slim-articles-filter .article-category-chip {
  padding: 8px 13px;
  font-size: 14px;
}
.slim-articles-filter .article-category-chip small {
  min-width: 24px;
  height: 24px;
}
.articles-results-section {
  padding-top: 22px;
}
.compact-section-head {
  margin-bottom: 16px;
}
.compact-section-head h2 {
  font-size: clamp(28px, 3.8vw, 46px);
}
#articles-results-count {
  margin-top: 2px;
  font-size: 14px;
}
.articles-featured-slot.is-hidden {
  display: none;
}
.articles-featured-slot:not(:empty) {
  margin-bottom: 22px;
}
.featured-article-card {
  grid-template-columns: minmax(0, .9fr) minmax(300px, .72fr);
  border-radius: 28px;
}
html[dir="rtl"] .featured-article-card {
  grid-template-columns: minmax(300px, .72fr) minmax(0, .9fr);
}
.featured-article-media,
.featured-article-media img {
  min-height: 280px;
}
.featured-article-copy {
  padding: clamp(22px, 3vw, 36px);
}
.featured-article-copy h2 {
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.18;
}
.featured-article-copy p {
  font-size: 16px;
  line-height: 1.85;
}
.articles-list-grid,
.articles-list-grid.balanced-article-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)) !important;
  align-items: stretch;
  gap: clamp(18px, 2vw, 24px);
}
.articles-list-grid.balanced-article-grid .article-card {
  max-width: none;
}
.articles-list-grid .article-card .article-thumb {
  aspect-ratio: 16 / 8.8;
}
.articles-list-grid .article-card-body {
  padding: clamp(20px, 2.3vw, 28px);
}
.articles-list-grid .article-card h3 {
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.25;
}
.articles-list-grid .article-card p {
  line-height: 1.85;
}
.load-more-wrap {
  margin-top: 24px;
}
@media (max-width: 700px) {
  .articles-page-shell .articles-hero {
    padding-block: 30px 18px;
  }
  .slim-articles-filter .article-search-wrap {
    grid-template-columns: 1fr;
  }
  .slim-articles-filter .article-search-wrap > span {
    display: none;
  }
  .slim-articles-filter .article-search-wrap small {
    grid-column: 1;
  }
  .featured-article-media,
  .featured-article-media img {
    min-height: 210px;
  }
  .articles-list-grid .article-card .article-thumb {
    aspect-ratio: 16 / 10;
  }
}

/* fix14 PDF reader */
.pdf-reader-page { width:min(1180px, calc(100% - 32px)); margin:0 auto; padding:26px 0 52px; }
.pdf-reader-topbar { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; background:var(--card); border:1px solid var(--line); border-radius:28px; padding:22px; box-shadow:var(--shadow-soft); margin-bottom:18px; }
.pdf-reader-topbar h1 { margin:3px 0 6px; font-size:clamp(24px, 3.2vw, 42px); }
.pdf-reader-topbar p { color:var(--muted); max-width:780px; margin:0; }
.reader-actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; min-width:260px; }
.pdf-reader-frame-wrap { background:#1f2933; border-radius:24px; overflow:hidden; border:1px solid rgba(0,0,0,.12); min-height:72vh; box-shadow:0 20px 60px rgba(9,33,36,.18); }
.pdf-reader-frame { width:100%; height:78vh; border:0; display:block; background:#fff; }
.reader-preview-end { margin-top:18px; background:linear-gradient(135deg, rgba(23,74,79,.08), rgba(255,253,248,.95)); border:1px solid var(--line); border-radius:26px; padding:22px; text-align:center; }
.reader-preview-end h2 { margin-top:0; }
.reader-teaser { border:1px solid var(--line); background:rgba(23,74,79,.04); border-radius:22px; padding:18px; display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.reader-teaser p { margin:0; color:var(--muted); flex:1 1 260px; }
.reader-empty { padding:42px; }
.status-box.success .actions { margin-top:14px; display:flex; gap:10px; flex-wrap:wrap; }
@media (max-width: 760px) {
  .pdf-reader-page { width:min(100% - 18px, 1180px); padding-top:12px; }
  .pdf-reader-topbar { flex-direction:column; border-radius:22px; padding:18px; }
  .reader-actions { justify-content:flex-start; min-width:0; width:100%; }
  .pdf-reader-frame-wrap { min-height:68vh; border-radius:18px; }
  .pdf-reader-frame { height:72vh; }
}


/* fix15 experience polish: language gate, book detail, reader, submit/help/rights */
.polished-language-gate {
  min-height: 100vh;
  background:
    radial-gradient(circle at 22% 18%, rgba(23,74,79,.11), transparent 34%),
    radial-gradient(circle at 78% 80%, rgba(210,157,94,.16), transparent 36%),
    linear-gradient(135deg, #fffaf0, #f4efe5 58%, #e9dfd0);
}
.polished-gate-card {
  width: min(620px, calc(100% - 32px));
  padding: clamp(34px, 5vw, 56px);
  border: 1px solid rgba(15,76,92,.12);
  border-radius: 36px;
  background: rgba(255,253,248,.86);
  box-shadow: 0 30px 90px rgba(13,48,52,.14);
  text-align: center;
  backdrop-filter: blur(14px);
}
.polished-gate-card h1 { font-size: clamp(48px, 8vw, 82px); margin: 10px 0 12px; color: var(--primary); }
.polished-gate-card h1 span { color: var(--ink); font-weight: 600; }
.polished-gate-card p:not(.eyebrow) { color: var(--muted); font-size: 1.08rem; max-width: 480px; margin-inline: auto; }
.gate-mini-links { margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.gate-mini-links span { border: 1px solid var(--line); background: rgba(255,255,255,.56); color: var(--muted); border-radius: 999px; padding: 7px 12px; font-weight: 700; font-size: .88rem; }

.refined-book-detail-page .page-breadcrumbs { margin-top: 26px; margin-bottom: 14px; }
.book-detail-hero {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) minmax(260px, .42fr);
  gap: clamp(20px, 3vw, 34px);
  align-items: start;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 34px;
  background: linear-gradient(135deg, rgba(255,253,248,.95), rgba(248,241,230,.72));
  box-shadow: var(--shadow-soft);
}
.book-detail-cover { max-width: 260px; margin-inline: auto; }
.book-detail-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 22px; box-shadow: 0 22px 60px rgba(11,35,40,.18); border: 1px solid rgba(0,0,0,.06); background: #fff; }
.book-detail-intro h1 { font-size: clamp(36px, 5vw, 64px); line-height: 1.18; margin: 8px 0 10px; }
.book-author-line { color: var(--muted); font-weight: 800; margin: 4px 0 12px; }
.book-status-note { color: var(--muted); max-width: 720px; font-size: 1.02rem; }
.book-main-actions { margin-top: 18px; }
.book-detail-side { display: grid; gap: 14px; }
.book-side-card { border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.62); padding: 18px; box-shadow: 0 14px 40px rgba(9,33,36,.07); }
.book-side-card h2, .book-side-card h3 { margin-top: 0; font-size: 1.25rem; }
.book-side-card p { color: var(--muted); }
.vertical-actions, .vertical-chips { display: grid; gap: 10px; }
.book-reading-path { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 24px 0; }
.book-reading-path article { border: 1px solid var(--line); border-radius: 22px; background: rgba(255,253,248,.78); padding: 18px; }
.book-reading-path strong { display: block; color: var(--primary); margin-bottom: 6px; }
.book-reading-path span { color: var(--muted); }
.book-detail-content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 26px; align-items: start; }
.book-detail-main { display: grid; gap: 18px; }
.book-detail-block { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: clamp(22px, 3vw, 34px); box-shadow: 0 16px 50px rgba(9,33,36,.06); }
.book-detail-block h2 { margin-top: 0; font-size: clamp(24px, 3vw, 34px); }
.book-detail-aside { position: sticky; top: 98px; display: grid; gap: 16px; }
.calm-checkout-panel { display: grid; grid-template-columns: minmax(0, .9fr) minmax(280px, .8fr); gap: 22px; align-items: start; background: linear-gradient(135deg, rgba(23,74,79,.07), rgba(255,253,248,.96)); }
.paypal-box { border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.7); padding: 16px; }
.refined-reader-teaser { margin-top: 12px; }

.polished-reader-page { padding-top: 18px; }
.polished-reader-topbar { border-radius: 30px; background: linear-gradient(135deg, rgba(255,253,248,.96), rgba(247,238,224,.86)); }
.reader-heading { flex: 1 1 520px; }
.reader-mode-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.reader-mode-chips span { border: 1px solid var(--line); background: rgba(255,255,255,.68); color: var(--muted); border-radius: 999px; padding: 6px 10px; font-weight: 800; font-size: .86rem; }
.reader-guidance { display: flex; justify-content: space-between; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.74); padding: 12px 16px; margin-bottom: 14px; color: var(--muted); }
.reader-guidance strong { color: var(--primary); }
.polished-frame-wrap { min-height: 76vh; }
.polished-preview-end .actions { justify-content: center; }

.polished-service-hero, .submit-hero {
  margin-top: 28px;
  padding: clamp(26px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 34px;
  background: linear-gradient(135deg, rgba(255,253,248,.94), rgba(248,241,230,.7));
  box-shadow: var(--shadow-soft);
}
.submit-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .48fr); gap: 24px; align-items: center; }
.submit-hero h1, .polished-service-hero h1 { font-size: clamp(36px, 5vw, 64px); margin: 8px 0; }
.submit-hero-note { border: 1px solid var(--line); border-radius: 24px; padding: 18px; background: rgba(255,255,255,.62); }
.submit-hero-note strong { display: block; color: var(--primary); margin-bottom: 8px; }
.submit-hero-note span { color: var(--muted); }
.review-flow-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 24px 0; }
.review-flow-grid article { border: 1px solid var(--line); border-radius: 22px; background: rgba(255,253,248,.82); padding: 18px; }
.review-flow-grid span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(15,76,92,.1); color: var(--primary); font-weight: 900; margin-bottom: 10px; }
.review-flow-grid strong { display: block; color: var(--ink); margin-bottom: 6px; }
.review-flow-grid p { color: var(--muted); margin: 0; }
.submit-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; margin-bottom: 46px; }
.submit-guidelines { position: sticky; top: 98px; border: 1px solid var(--line); border-radius: 26px; background: var(--card); padding: 22px; box-shadow: 0 16px 50px rgba(9,33,36,.06); }
.polished-contribution-form { margin: 0; }
.help-card-grid, .rights-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }
.help-card, .rights-card { border: 1px solid var(--line); border-radius: 24px; background: var(--card); padding: 22px; box-shadow: 0 14px 42px rgba(9,33,36,.06); }
.help-card h2, .rights-card h2 { margin-top: 0; font-size: 1.25rem; }
.help-card p, .rights-card p { color: var(--muted); }
.support-strip { display: flex; justify-content: space-between; gap: 20px; align-items: center; border: 1px solid var(--line); border-radius: 28px; background: linear-gradient(135deg, rgba(23,74,79,.08), rgba(255,253,248,.92)); padding: 24px; margin: 28px 0 52px; }
.support-strip p { color: var(--muted); margin: 0; }

@media (max-width: 980px) {
  .book-detail-hero, .book-detail-content-grid, .submit-hero, .submit-layout { grid-template-columns: 1fr; }
  .book-detail-side, .book-detail-aside, .submit-guidelines { position: static; }
  .book-reading-path, .review-flow-grid, .help-card-grid, .rights-grid { grid-template-columns: 1fr; }
  .calm-checkout-panel { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .book-detail-hero, .polished-service-hero, .submit-hero { border-radius: 24px; padding: 20px; }
  .reader-guidance, .support-strip { flex-direction: column; align-items: flex-start; }
  .book-detail-cover { max-width: 190px; }
}

/* ==============================
   Fix17: strict language separation + article formatting polish
   ============================== */
html[lang="en"] .article-content h2,
html[lang="en"] .article-content h3 {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--primary-strong);
}
html[lang="en"] .article-content h2 {
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.22;
  margin-top: 58px;
  margin-bottom: 18px;
}
html[lang="en"] .article-content h3 {
  font-size: clamp(23px, 2.1vw, 30px);
  line-height: 1.3;
}
html[lang="en"] .article-content p {
  margin-bottom: 28px;
}
html[lang="en"] .article-content ol,
html[lang="en"] .article-content ul {
  line-height: 1.9;
}
.language-fallback-note { display: none !important; }


/* EPUB reader support */
.epub-reader-page .reader-guidance { margin-bottom: 1rem; }
.epub-reader-shell {
  background: rgba(255,255,255,.72);
  border: 1px solid var(--border, #ded4c2);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(35, 30, 20, .08);
  max-width: 1120px;
  margin: 0 auto 2rem;
}
.epub-reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border, #ded4c2);
  background: rgba(250, 246, 236, .9);
}
.epub-location { color: var(--muted, #6d6558); font-weight: 700; text-align: center; }
.epub-reader-stage {
  height: min(76vh, 820px);
  min-height: 560px;
  padding: 1rem;
  background: #fffdf7;
}
.epub-reader-stage iframe { background: #fffdf7; }
@media (max-width: 720px) {
  .epub-reader-toolbar { flex-wrap: wrap; justify-content: center; }
  .epub-location { order: -1; width: 100%; }
  .epub-reader-stage { min-height: 68vh; height: 72vh; padding: .5rem; }
}

/* fix23: Related books inside article pages */
.related-books-section {
  padding-block: clamp(32px, 5vw, 58px) !important;
  margin-top: clamp(24px, 4vw, 42px);
  border-top: 1px solid var(--line);
}
.related-books-section > h2 {
  font-size: clamp(30px, 3.6vw, 48px);
  line-height: 1.12;
  margin: 0 0 18px;
}
.related-books-grid {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
  align-items: stretch;
}
.related-books-grid.single-related-book {
  grid-template-columns: minmax(0, 1fr);
}
.related-books-grid.multi-related-books {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}
.related-book-card {
  display: grid;
  grid-template-columns: minmax(112px, 150px) minmax(0, 1fr);
  gap: clamp(16px, 2.2vw, 24px);
  align-items: center;
  padding: clamp(18px, 2.4vw, 28px) !important;
  min-height: 0;
  overflow: hidden;
}
.single-related-book .related-book-card {
  max-width: 820px;
}
.related-book-cover {
  display: block;
  width: 100%;
  max-width: 150px;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #f0ece3;
  box-shadow: 0 16px 36px rgba(15, 76, 92, .10);
}
.related-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.related-book-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.related-book-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.related-book-card h3 {
  margin: 2px 0 0;
  color: var(--primary-strong);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.22;
  overflow-wrap: anywhere;
}
.related-book-card h3 a {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-book-author {
  color: #6f675c;
  font-weight: 700;
  font-size: 14px;
}
.related-book-card p {
  margin: 2px 0;
  color: #5f574d;
  font-size: 15.5px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-book-chips {
  margin: 2px 0 4px !important;
}
.related-book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.related-book-actions .btn {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 14px;
}
@media (max-width: 680px) {
  .related-book-card {
    grid-template-columns: minmax(92px, 118px) minmax(0, 1fr);
    padding: 16px !important;
    gap: 14px;
  }
  .related-book-cover { max-width: 118px; border-radius: 15px; }
  .related-book-card h3 { font-size: clamp(21px, 6vw, 28px); }
  .related-book-card p { display: none; }
}
@media (max-width: 440px) {
  .related-book-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .related-book-cover { margin-inline: auto; }
  .related-book-meta, .related-book-chips, .related-book-actions { justify-content: center; }
}


/* ==============================
   Secondary pages polish - fix24
   ============================== */
.secondary-polished-page {
  padding-bottom: clamp(54px, 7vw, 92px);
}
.secondary-hero.compact-secondary-hero {
  padding: clamp(58px, 7vw, 92px) 0 clamp(26px, 4vw, 44px);
  max-width: 940px;
  margin-inline: auto;
  text-align: center;
}
.secondary-hero.compact-secondary-hero h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 92px);
  line-height: .98;
  letter-spacing: -0.045em;
}
html[dir="rtl"] .secondary-hero.compact-secondary-hero h1 { letter-spacing: -0.025em; }
.secondary-hero.compact-secondary-hero .lead {
  max-width: 760px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.8;
}
.reading-guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 22px;
  align-items: stretch;
  max-width: 1050px;
  margin: 0 auto;
}
.quiz-card,
.guide-side-card,
.secondary-info-card,
.secondary-strip {
  background: rgba(255,253,248,.88);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow-sm);
}
.quiz-card {
  max-width: none;
  padding: clamp(22px, 3vw, 34px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.quiz-card .full,
.quiz-card .btn { grid-column: 1 / -1; }
.guide-side-card {
  padding: clamp(22px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.guide-side-card h2,
.secondary-info-card h2,
.secondary-strip h2 {
  margin: 0 0 12px;
  color: var(--primary-strong);
  font-size: clamp(20px, 2vw, 28px);
}
.guide-side-card ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 18px;
  display: grid;
  gap: 10px;
}
.guide-side-card li {
  position: relative;
  padding-inline-start: 26px;
  color: var(--text);
  line-height: 1.7;
}
html[dir="rtl"] .guide-side-card li { padding-inline-start: 0; padding-inline-end: 26px; }
.guide-side-card li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .72em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(15,76,92,.08);
}
html[dir="rtl"] .guide-side-card li::before { inset-inline-start: auto; inset-inline-end: 0; }
.guide-side-card p,
.secondary-info-card p,
.secondary-strip p { color: var(--muted); line-height: 1.85; margin: 0; }
.polished-quiz-result {
  max-width: 1050px;
  margin-inline: auto;
}
.polished-recommend-card {
  margin-top: 22px;
  background: linear-gradient(145deg, rgba(255,253,248,.98), rgba(237,242,239,.9));
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: clamp(24px, 4vw, 38px);
  box-shadow: var(--shadow);
}
.polished-recommend-card h2 { margin: 0 0 12px; font-size: clamp(26px, 3vw, 42px); color: var(--primary-strong); }
.secondary-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto;
}
.secondary-info-card {
  padding: clamp(22px, 3vw, 30px);
  min-height: 170px;
}
.secondary-info-card h2 { font-size: clamp(20px, 2vw, 26px); }
.secondary-strip {
  max-width: 1080px;
  margin: 26px auto 0;
  padding: clamp(24px, 3vw, 34px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 22px;
}
.secondary-strip .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.legal-polished-page .secondary-hero,
.support-polished-page .secondary-hero { text-align: start; margin-inline: 0; }
.legal-polished-page .secondary-hero h1,
.support-polished-page .secondary-hero h1 { max-width: 900px; }
.legal-polished-page .secondary-hero .lead,
.support-polished-page .secondary-hero .lead { margin-inline: 0; }
.legal-card-grid .secondary-info-card:nth-child(1),
.legal-card-grid .secondary-info-card:nth-child(2) { min-height: 190px; }
.support-polished-page .secondary-card-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.support-polished-page .secondary-info-card { min-height: 210px; }
@media (max-width: 960px) {
  .reading-guide-layout,
  .secondary-strip { grid-template-columns: 1fr; }
  .support-polished-page .secondary-card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .secondary-card-grid,
  .support-polished-page .secondary-card-grid,
  .quiz-card { grid-template-columns: 1fr; }
  .secondary-hero.compact-secondary-hero { text-align: start; }
  .secondary-hero.compact-secondary-hero .lead { margin-inline: 0; }
}


/* fix26-safe: discovery page and reading paths */
.explore-hero { padding-top: 52px; padding-bottom: 38px; }
.explore-hero h1 { max-width: 850px; }
.explore-hero .actions { margin-top: 22px; }
.explore-filter-section { padding-top: 10px; padding-bottom: 18px; }
.explore-filter-panel { background: rgba(255,253,248,.74); border: 1px solid rgba(222,212,199,.9); border-radius: 24px; padding: 18px; box-shadow: var(--shadow-sm); display: grid; gap: 16px; }
.explore-type-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.explore-type-tabs button { border: 1px solid var(--line); background: var(--paper); color: var(--muted); border-radius: 999px; padding: 8px 13px; cursor: pointer; }
.explore-type-tabs button.active, .explore-type-tabs button:hover { background: var(--primary); color: white; border-color: var(--primary); }
.explore-results-section, .explore-paths-section { padding-top: 28px; }
.explore-grid .card { min-width: 0; }
.reading-paths-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.reading-path-card { background: var(--paper); border: 1px solid var(--line); border-radius: 26px; padding: 22px; box-shadow: var(--shadow-sm); }
.path-card-head h3 { margin: 8px 0 6px; font-size: clamp(22px, 2.5vw, 30px); color: var(--ink); }
.path-card-head p { margin: 0 0 16px; color: var(--muted); }
.path-rail { display: grid; gap: 12px; }
.path-step { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; }
.path-step > span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--primary); font-weight: 800; border: 1px solid rgba(23,74,79,.16); }
.path-step strong { display: block; color: var(--ink); margin-bottom: 2px; }
.path-step a, .path-step em { display: inline-block; color: var(--muted); font-style: normal; }
.path-step a:hover { color: var(--primary); }
.compact-reading-path-card { padding: 18px; }
.compact-reading-path-card .path-card-head h3 { font-size: 22px; }
@media (max-width: 820px) { .reading-paths-grid { grid-template-columns: 1fr; } .path-step { grid-template-columns: 32px 1fr; } .explore-filter-panel { padding: 14px; } }

/* ==============================
   fix27: Mobile reading polish
   Built on the stable fix26-safe base.
   Goals: comfortable mobile cards + paper-like PDF/EPUB reading.
   ============================== */
:root {
  --reader-paper: #fffdf7;
  --reader-paper-edge: #e7dccd;
  --reader-ink: #211c16;
}

/* Give all content cards a safer mobile layout; no vertical squeezed text. */
.book-card h3,
.library-book-card h3,
.related-book-card h3,
.article-card h3 {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.article-card h3 a,
.book-card h3 a,
.library-book-card h3 a,
.related-book-card h3 a {
  overflow-wrap: anywhere;
}

/* Tablet and mobile: allow cards to breathe. */
@media (max-width: 760px) {
  body { line-height: 1.75; }
  html[lang="ar"] body { line-height: 1.92; }
  .site-header { position: sticky; }
  .nav-wrap { padding: 12px 16px; min-height: 62px; }
  .brand { font-size: 18px; }
  .container { padding-inline: 14px; }
  .reading-container { padding: 34px 16px 54px; }
  .section { padding-block: 36px; }
  .section-head { gap: 12px; margin-bottom: 18px; }
  .section-head h1, .section-head h2 { font-size: clamp(30px, 9.5vw, 40px) !important; }
  .hero { padding: 30px 0 38px !important; }
  .hero h1 { font-size: clamp(38px, 12.5vw, 52px) !important; line-height: 1.04; }
  .hero .lead { font-size: 17px !important; line-height: 1.85; margin-top: 16px; }
  .actions { max-width: none; width: 100%; }
  .btn { min-height: 44px; padding: 9px 15px; }

  /* Book cards: one-column, cover first, readable title and description. */
  #books-grid,
  .book-grid,
  .refined-books-grid,
  .related-books-grid,
  .grid.two {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .book-card,
  .library-book-card,
  .related-book-card,
  .featured-book-card,
  .refined-featured-book-card {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    padding: 18px !important;
    text-align: center !important;
    gap: 14px !important;
    border-radius: 24px !important;
  }
  html[dir="rtl"] .book-card,
  html[dir="rtl"] .library-book-card,
  html[dir="rtl"] .related-book-card {
    direction: rtl;
  }
  .book-card-cover,
  .library-book-card .book-card-cover,
  .related-book-cover,
  .featured-book-cover,
  .refined-featured-book-card .featured-book-cover {
    width: min(46vw, 168px) !important;
    max-width: 168px !important;
    min-width: 0 !important;
    margin-inline: auto !important;
    margin-bottom: 4px !important;
    aspect-ratio: 2 / 3 !important;
    border-radius: 18px !important;
  }
  .book-card-body,
  .related-book-copy,
  .featured-book-copy {
    width: 100% !important;
    min-width: 0 !important;
    align-items: center !important;
  }
  .book-card .meta,
  .library-book-card .meta,
  .related-book-meta,
  .small-chips,
  .book-info-line,
  .related-book-chips,
  .book-card-actions,
  .related-book-actions,
  .card-footer {
    justify-content: center !important;
  }
  .book-card h3,
  .library-book-card h3,
  .related-book-card h3,
  .featured-book-card h2,
  .refined-featured-book-card .featured-book-copy h2 {
    width: 100%;
    font-size: clamp(22px, 8vw, 30px) !important;
    line-height: 1.28 !important;
    text-align: center !important;
    margin: 4px 0 2px !important;
  }
  .book-card h3 a,
  .library-book-card h3 a,
  .related-book-card h3 a {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .book-card p,
  .library-book-card p,
  .related-book-card p,
  .featured-book-card p {
    display: -webkit-box !important;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
    max-width: 30rem;
    margin-inline: auto !important;
    font-size: 15px !important;
    line-height: 1.72 !important;
    text-align: center;
  }
  .byline,
  .related-book-author { text-align: center; width: 100%; }
  .book-card-actions,
  .related-book-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px !important;
  }
  .book-card-actions .btn,
  .related-book-actions .btn { width: 100%; }

  /* Article cards: balanced thumbnail, visible title, no oversized blocks. */
  .articles-list-grid,
  #articles-grid,
  .article-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .article-card { border-radius: 24px !important; min-height: 0 !important; }
  .article-thumb,
  .articles-list-grid .article-card .article-thumb {
    aspect-ratio: 16 / 9 !important;
    max-height: 230px;
  }
  .article-card-body,
  .articles-list-grid .article-card-body { padding: 18px !important; }
  .article-card h3,
  .articles-list-grid .article-card h3 {
    font-size: clamp(22px, 7vw, 30px) !important;
    line-height: 1.35 !important;
    margin-bottom: 10px !important;
  }
  .article-card p,
  .articles-list-grid .article-card p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 15.5px;
    line-height: 1.75;
  }

  /* Article reading page: comfortable phone typography. */
  .article-header { margin-bottom: 24px; padding-bottom: 24px; }
  .article-header h1 { font-size: clamp(34px, 11vw, 48px) !important; line-height: 1.12; }
  .article-header .lead { font-size: 18px; line-height: 1.75; }
  .article-content { font-size: 18px; line-height: 1.9; }
  html[lang="ar"] .article-content { font-size: 19px; line-height: 2.05; }
  .article-content h2 { font-size: clamp(26px, 8vw, 34px); margin-top: 34px; }
  .article-content h3 { font-size: clamp(22px, 7vw, 28px); }
}

@media (max-width: 420px) {
  .container { padding-inline: 12px; }
  .card { padding: 18px !important; }
  .book-card,
  .library-book-card,
  .related-book-card { padding: 16px !important; }
  .book-card-cover,
  .library-book-card .book-card-cover,
  .related-book-cover {
    width: min(54vw, 160px) !important;
  }
  .book-card-actions,
  .related-book-actions { grid-template-columns: 1fr; }
  .book-info-line span,
  .small-chips span,
  .badge { font-size: 11.5px; padding: 5px 9px; }
}

/* Paper-like reader mode for PDF and EPUB. */
.polished-reader-page {
  background:
    radial-gradient(circle at top, rgba(156,106,59,.055), transparent 32rem),
    linear-gradient(180deg, rgba(247,242,233,.92), rgba(241,234,222,.88));
}
.polished-frame-wrap,
.epub-reader-shell {
  border-radius: 26px !important;
  border: 1px solid var(--reader-paper-edge) !important;
  background: linear-gradient(90deg, #f0e6d7 0, var(--reader-paper) 2.2%, var(--reader-paper) 97.8%, #efe4d4 100%) !important;
  box-shadow: 0 26px 70px rgba(43,34,21,.16), inset 0 1px 0 rgba(255,255,255,.72) !important;
}
.pdf-reader-frame-wrap { background: #eee3d4; }
.pdf-reader-frame { background: var(--reader-paper); }
.epub-reader-toolbar {
  background: rgba(246,239,228,.94) !important;
  border-bottom: 1px solid var(--reader-paper-edge) !important;
}
.epub-reader-stage {
  background:
    linear-gradient(90deg, rgba(121,82,45,.075), transparent 3%, transparent 97%, rgba(121,82,45,.06)),
    var(--reader-paper) !important;
}
.reader-loading-box {
  background: rgba(255,253,247,.9);
  border: 1px solid var(--reader-paper-edge);
  color: var(--muted);
  border-radius: 18px;
  padding: 18px;
  text-align: center;
}

@media (max-width: 760px) {
  .pdf-reader-page { width: min(100% - 14px, 1180px) !important; padding: 10px 0 24px !important; }
  .pdf-reader-topbar,
  .polished-reader-topbar {
    padding: 16px !important;
    border-radius: 22px !important;
    margin-bottom: 12px !important;
  }
  .pdf-reader-topbar h1 { font-size: clamp(24px, 8vw, 36px) !important; line-height: 1.2; }
  .reader-mode-chips span { font-size: 12px; padding: 5px 8px; }
  .reader-actions {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px !important;
    width: 100% !important;
  }
  .reader-guidance {
    border-radius: 16px !important;
    padding: 10px 12px !important;
    font-size: 14px;
  }
  .pdf-reader-frame-wrap,
  .epub-reader-shell {
    border-radius: 18px !important;
    min-height: calc(100vh - 210px) !important;
  }
  .pdf-reader-frame { height: calc(100vh - 190px) !important; min-height: 560px; }
  .epub-reader-toolbar { padding: 8px !important; gap: 8px !important; }
  .epub-reader-toolbar .btn { min-height: 38px; padding: 7px 12px; width: auto; }
  .epub-location { font-size: 13px; }
  .epub-reader-stage {
    height: calc(100vh - 235px) !important;
    min-height: 560px !important;
    padding: 10px !important;
  }
  .reader-preview-end { border-radius: 20px !important; padding: 18px !important; }
}

/* FIX28: unified article reading typography and paper frame */
.article-content {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, rgba(255,253,248,.96), rgba(251,247,239,.96));
  border: 1px solid rgba(222, 212, 199, .92);
  border-radius: 30px;
  padding: clamp(28px, 5vw, 54px);
  box-shadow: 0 24px 70px rgba(32, 26, 18, 0.06);
  color: var(--text);
  font-size: 19px;
  line-height: 1.95;
  margin: 34px 0 28px;
}
html[lang="ar"] .article-content {
  font-family: Cairo, Tahoma, system-ui, sans-serif;
  font-size: 20px;
  line-height: 2.05;
}
.article-content h2,
.article-content h3 {
  font-family: inherit;
  color: var(--primary-strong);
  letter-spacing: -.018em;
}
html[lang="ar"] .article-content h2,
html[lang="ar"] .article-content h3 { letter-spacing: -.008em; }
.article-content h2 {
  font-size: clamp(27px, 3.4vw, 38px);
  margin: 44px 0 18px;
  padding-top: 8px;
}
.article-content h2:first-child { margin-top: 0; }
.article-content h3 {
  font-size: clamp(22px, 2.5vw, 28px);
  margin: 34px 0 12px;
}
.article-content p { margin: 0 0 22px; }
.article-content p:last-child { margin-bottom: 0; }
.article-content ul,
.article-content ol {
  background: rgba(237,242,239,.5);
  border: 1px solid rgba(222,212,199,.72);
  border-radius: 20px;
  padding: 18px 28px;
  padding-inline-start: 44px;
}
.article-content li { margin: 8px 0; }
.article-content blockquote {
  background: rgba(237,242,239,.72);
  border: 1px solid rgba(23,74,79,.10);
  border-inline-start: 5px solid var(--accent);
}
.article-header,
.article-cover,
.summary-box,
.toc-card,
.inline-book-cta,
.related-books-section,
.compact-related {
  max-width: var(--reading);
  margin-inline: auto;
}
.reading-container .back-link { max-width: var(--reading); margin-inline: auto; }

/* FIX28: authors page de-duplication layout polish */
.author-grid .author-card { min-height: 180px; }
.author-card h3 { overflow-wrap: anywhere; }

@media (max-width: 680px) {
  .article-content {
    border-radius: 24px;
    padding: 24px 18px;
    margin: 26px -4px 22px;
    font-size: 17px;
    line-height: 1.88;
  }
  html[lang="ar"] .article-content { font-size: 18px; line-height: 2; }
  .article-content h2 { font-size: 25px; margin-top: 34px; }
  .article-content h3 { font-size: 21px; }
  .article-content ul,
  .article-content ol { padding: 16px 20px; padding-inline-start: 36px; }
}


/* fix30: author links and profile pages */
.byline a,
.related-book-author a,
.book-author-line a,
.article-meta a {
  color: var(--accent, #0f4c5c);
  font-weight: 700;
  text-decoration: none;
}
.byline a:hover,
.related-book-author a:hover,
.book-author-line a:hover,
.article-meta a:hover { text-decoration: underline; }
.author-count-links a {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  border: 1px solid var(--border, #ded6c7);
  border-radius: 999px;
  padding: .35rem .75rem;
  color: var(--accent, #0f4c5c);
  text-decoration: none;
  background: rgba(15,76,92,.04);
}
.author-count-links a:hover { background: rgba(15,76,92,.09); }
.author-card h3 a { color: inherit; text-decoration: none; }
.author-card h3 a:hover { color: var(--accent, #0f4c5c); }
.author-profile-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1.25rem;
}
.author-profile-avatar {
  width: 112px;
  height: 112px;
  border-radius: 28px;
  object-fit: cover;
  background: #eef4f1;
  display: grid;
  place-items: center;
  color: var(--accent, #0f4c5c);
  font-size: 2.2rem;
  font-weight: 800;
  text-decoration: none;
}
@media (max-width: 720px){
  .author-profile-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .author-count-links { justify-content: center; }
}


/* ==============================
   FIX32: hard responsive image/card layout
   Goal: no horizontal overflow, professional image ratios on phone/desktop.
   Built on stable fix30/fix28 line, not on broken fix31.
   ============================== */
:root {
  --mobile-safe-pad: 16px;
  --article-card-media-ratio: 16 / 9;
  --book-cover-ratio: 2 / 3;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; max-width: 100%; overflow-x: clip; }
body { overscroll-behavior-x: none; }
img, svg, video, canvas, iframe { max-width: 100%; }
a, h1, h2, h3, h4, p, span { overflow-wrap: break-word; }

/* Global safety: every content block must stay inside the viewport. */
.site-main,
.container,
.section,
.grid,
.book-grid,
.article-grid,
.video-grid,
.articles-list-grid,
.explore-grid,
.home-cards,
.book-card,
.article-card,
.featured-article-card,
.featured-book-card,
.related-book-card,
.newsletter,
.site-footer,
.footer-wrap {
  max-width: 100%;
}

.container { width: min(var(--max), calc(100% - 48px)); }

/* Article images: always horizontal, cropped elegantly. */
.article-thumb,
.featured-article-media,
.video-card .thumb,
.video-embed-thumb {
  width: 100%;
  aspect-ratio: var(--article-card-media-ratio);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(15,76,92,.10), rgba(183,121,31,.14));
}
.article-thumb img,
.featured-article-media img,
.video-card .thumb img,
.article-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* Article list cards: professional newspaper-like cards, not giant images. */
.article-card {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 28px;
}
.article-card .article-thumb {
  max-height: 300px;
}
.article-card-body p,
.book-card-body p,
.featured-article-copy p,
.featured-book-copy p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-body p { -webkit-line-clamp: 3; }
.book-card-body p { -webkit-line-clamp: 3; }

/* Book covers: keep vertical cover identity without squeezing text. */
.book-card,
.library-book-card,
.calm-book-card,
.bookstore-card {
  min-width: 0;
  overflow: hidden;
}
.book-card-cover,
.featured-book-cover,
.related-book-cover,
.book-detail-cover img,
.book-cover,
.book-cover img {
  aspect-ratio: var(--book-cover-ratio);
}
.book-card-cover,
.related-book-cover,
.featured-book-cover {
  overflow: hidden;
  flex: 0 0 auto;
}
.book-card-cover img,
.related-book-cover img,
.featured-book-cover img,
.book-detail-cover img,
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.book-card h3,
.related-book-card h3,
.featured-book-copy h2 {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
}
.book-card h3 a,
.related-book-card h3 a,
.article-card h3 a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-card h3 a { -webkit-line-clamp: 3; }
.article-card h3 a { -webkit-line-clamp: 3; }
.related-book-card h3 a { -webkit-line-clamp: 3; }

/* Chips and filters should scroll gently, never widen the page. */
.articles-category-strip,
.refined-category-strip,
.book-type-tabs,
.explore-type-tabs,
.small-chips,
.book-info-line,
.library-stats {
  max-width: 100%;
}
.articles-category-strip,
.refined-category-strip,
.book-type-tabs,
.explore-type-tabs {
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.article-category-chip,
.book-type-chip,
.explore-type-tabs button,
.small-chips span {
  white-space: nowrap;
}

/* Desktop: balanced visual rhythm. */
@media (min-width: 901px) {
  .article-card .article-thumb { max-height: 280px; }
  .articles-list-grid .article-card .article-thumb { aspect-ratio: 16 / 9; }
  .home-section .article-card .article-thumb { max-height: 270px; }
  .featured-article-media,
  .featured-article-media img { min-height: 0 !important; height: auto; }
  .featured-article-media { aspect-ratio: 16 / 10; }
  .featured-book-card { align-items: center; }
  .featured-book-cover { max-width: 190px; }
  .newsletter { min-height: 0; }
}

/* Tablet and phone: cards become clean vertical blocks. */
@media (max-width: 900px) {
  .container { width: min(100% - 32px, var(--max)); }
  .grid,
  .grid.two,
  .home-cards,
  #articles-grid,
  #books-grid,
  #videos-grid,
  .articles-list-grid,
  .book-grid,
  .article-grid,
  .video-grid,
  .explore-grid,
  .reading-paths-grid {
    grid-template-columns: 1fr !important;
    justify-items: stretch;
  }
  .featured-article-card,
  html[dir="rtl"] .featured-article-card,
  .featured-book-card,
  .related-book-card,
  .book-card,
  .library-book-card,
  .calm-book-card,
  .bookstore-card {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .article-card,
  .book-card,
  .related-book-card,
  .featured-book-card,
  .featured-article-card {
    margin-inline: auto;
  }
}

@media (max-width: 700px) {
  body { overflow-x: hidden; }
  .container { width: 100%; max-width: 100%; padding-inline: var(--mobile-safe-pad); }
  .site-main { width: 100%; overflow-x: hidden; }
  .section { padding-block: 34px; }
  .section-head { margin-bottom: 18px; gap: 8px; }
  .section-head h1,
  .section-head h2,
  .compact-section-head h2 {
    font-size: clamp(28px, 9vw, 38px) !important;
    line-height: 1.12;
  }

  /* Hero and home: shorter, calmer, less scrolling. */
  .hero,
  .compact-hero.hero {
    min-height: auto !important;
    padding-block: 30px 36px !important;
    gap: 20px !important;
  }
  .hero h1 { font-size: clamp(40px, 14vw, 54px) !important; line-height: 1.02; }
  .hero .lead { font-size: 16.5px !important; line-height: 1.85 !important; }
  .hero-panel { padding: 12px !important; border-radius: 24px !important; }
  .hero-panel-item { padding: 15px 16px !important; min-height: 0 !important; }
  .hero-panel-item strong { font-size: 18px !important; line-height: 1.45; }
  .calm-principles,
  .home-feature-strip {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-block: 10px 16px !important;
    padding-block: 12px !important;
  }
  .calm-principles article,
  .home-feature-strip > div {
    min-height: 0 !important;
    padding: 16px !important;
    border-radius: 18px !important;
  }

  /* Article cards on phone: image fixed ratio and modest height. */
  .article-card { border-radius: 22px !important; padding: 0 !important; }
  .article-thumb,
  .articles-list-grid .article-card .article-thumb,
  .home-section .article-card .article-thumb {
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
  .article-card-body {
    padding: 18px 18px 20px !important;
  }
  .article-card h3 {
    font-size: clamp(22px, 7.4vw, 30px) !important;
    line-height: 1.25 !important;
    margin-bottom: 10px !important;
  }
  .article-card p {
    font-size: 15.5px !important;
    line-height: 1.75 !important;
    -webkit-line-clamp: 3;
  }
  .article-card .meta,
  .card-footer {
    font-size: 12.5px !important;
    gap: 8px !important;
  }

  /* Featured articles should not become giant mobile panels. */
  .featured-article-card { border-radius: 22px !important; }
  .featured-article-media,
  .featured-article-media img {
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
  }
  .featured-article-copy { padding: 18px !important; }
  .featured-article-copy h2 { font-size: clamp(24px, 8vw, 32px) !important; line-height: 1.2 !important; }
  .featured-article-copy p { -webkit-line-clamp: 3; font-size: 15.5px !important; }

  /* Book cards on phone: cover centered, text below, no side squeeze. */
  .book-card,
  .library-book-card,
  .calm-book-card,
  .bookstore-card,
  .related-book-card,
  .featured-book-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 14px !important;
    padding: 18px !important;
    border-radius: 22px !important;
  }
  .book-card-cover,
  .related-book-cover,
  .featured-book-cover {
    width: min(52vw, 170px) !important;
    max-width: 170px !important;
    min-width: 0 !important;
    margin-inline: auto !important;
    border-radius: 18px !important;
  }
  .book-card-body,
  .related-book-copy,
  .featured-book-copy {
    width: 100% !important;
    min-width: 0 !important;
    align-items: center !important;
  }
  .book-card h3,
  .related-book-card h3,
  .featured-book-copy h2 {
    font-size: clamp(22px, 8vw, 31px) !important;
    line-height: 1.23 !important;
    text-align: center !important;
  }
  .book-card p,
  .related-book-card p,
  .featured-book-copy p {
    display: -webkit-box !important;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 15.5px !important;
    line-height: 1.75 !important;
    margin-inline: auto;
  }
  .book-card .meta,
  .related-book-meta,
  .small-chips,
  .book-info-line,
  .book-card-actions,
  .related-book-actions {
    justify-content: center !important;
  }
  .book-card-actions {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 9px !important;
  }
  .book-card-actions .btn,
  .related-book-actions .btn {
    width: 100% !important;
    min-height: 46px !important;
  }

  /* Filters and category chips must never push page width. */
  .articles-filter-panel,
  .book-filter-panel,
  .explore-filter-panel {
    padding: 14px !important;
    border-radius: 20px !important;
    overflow: hidden;
  }
  .article-search-wrap,
  .books-search-row,
  .sort-field {
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: 1fr !important;
  }
  .articles-category-strip,
  .refined-category-strip,
  .book-type-tabs,
  .explore-type-tabs {
    margin-inline: calc(var(--mobile-safe-pad) * -1);
    padding-inline: var(--mobile-safe-pad);
    max-width: calc(100vw - 0px);
  }

  /* Newsletter and footer: shorter and more comfortable on phone. */
  .newsletter,
  .calm-newsletter,
  .conversion-newsletter {
    margin-block: 34px 40px !important;
    padding: 20px !important;
    border-radius: 24px !important;
    grid-template-columns: 1fr !important;
  }
  .newsletter h2 { font-size: clamp(28px, 9vw, 38px) !important; }
  .newsletter-form { grid-template-columns: 1fr !important; gap: 10px !important; }
  .site-footer { overflow: hidden; }
  .footer-wrap {
    width: 100% !important;
    padding: 28px var(--mobile-safe-pad) 34px !important;
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .footer-links {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    justify-items: start !important;
  }
  html[dir="rtl"] .footer-links { justify-items: end !important; }
  .footer-links a { line-height: 1.7; }

  /* Reader: calm paper feeling without overflow. */
  .pdf-reader-page { width: 100% !important; padding-inline: 10px !important; }
  .pdf-reader-topbar { border-radius: 22px !important; }
  .pdf-reader-frame-wrap,
  .epub-reader-shell {
    border-radius: 20px !important;
    background: #fffdf7 !important;
    box-shadow: 0 18px 50px rgba(38,31,18,.10) !important;
  }
  .pdf-reader-frame { height: 74vh !important; }
  .epub-reader-stage { min-height: 70vh !important; height: 74vh !important; }
}

@media (max-width: 420px) {
  .container { padding-inline: 12px; }
  :root { --mobile-safe-pad: 12px; }
  .book-card-cover,
  .related-book-cover,
  .featured-book-cover { width: min(58vw, 168px) !important; }
  .article-card h3 { font-size: clamp(21px, 7.8vw, 28px) !important; }
}

/* fix33: full-image display system — no visual cropping in cards or article media.
   The goal is a smoother reading-library experience: images are resized to fit
   their frame completely (contain), while the frame preserves a calm, consistent layout. */
.article-thumb,
.featured-article-media,
.article-cover,
.video-card .thumb,
.video-embed-thumb,
.book-card-cover,
.related-book-cover,
.featured-book-cover,
.book-cover {
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,.68), transparent 34%),
    linear-gradient(135deg, #fbf8f0 0%, #eee8dc 100%) !important;
}

.article-thumb,
.featured-article-media {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  min-height: 0 !important;
}

.article-thumb img,
.featured-article-media img,
.video-card .thumb img,
.video-embed-thumb img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  transform: none !important;
}

.article-card:hover .article-thumb img,
.featured-article-card:hover .featured-article-media img,
.video-card:hover .thumb img {
  transform: none !important;
}

/* Article cards: keep a cinematic frame, but never crop the artwork. */
.article-thumb,
.articles-list-grid .article-card .article-thumb,
.home-section .article-card .article-thumb {
  aspect-ratio: 16 / 9 !important;
  height: auto !important;
  max-height: 340px !important;
}

.featured-article-media,
.featured-article-media img {
  aspect-ratio: 16 / 9 !important;
  min-height: 0 !important;
  height: auto !important;
}
.featured-article-media { max-height: 390px !important; }

/* Article detail images should read like an inserted illustration, not a cropped banner. */
.article-cover {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  overflow: hidden !important;
}
.article-cover img {
  width: 100% !important;
  height: auto !important;
  max-height: 620px !important;
  object-fit: contain !important;
  object-position: center center !important;
}

/* Book covers: preserve the whole cover, including typography and edges. */
.book-card-cover,
.related-book-cover,
.featured-book-cover,
.book-cover {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.book-card-cover img,
.related-book-cover img,
.featured-book-cover img,
.book-cover img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}

@media (min-width: 901px) {
  .featured-article-card {
    align-items: stretch !important;
  }
  .featured-article-media {
    min-height: 300px !important;
  }
  .home-section .article-thumb,
  .articles-list-grid .article-card .article-thumb {
    max-height: 320px !important;
  }
  .library-book-card .book-card-cover,
  .home-section .book-card-cover,
  .related-book-cover {
    max-height: 270px !important;
  }
}

@media (max-width: 700px) {
  .article-thumb,
  .articles-list-grid .article-card .article-thumb,
  .home-section .article-card .article-thumb {
    aspect-ratio: 16 / 9 !important;
    max-height: 220px !important;
  }
  .featured-article-media {
    aspect-ratio: 16 / 9 !important;
    max-height: 220px !important;
  }
  .article-cover img {
    max-height: 420px !important;
  }
  .book-card-cover,
  .related-book-cover,
  .featured-book-cover {
    aspect-ratio: 2 / 3 !important;
    max-height: 245px !important;
  }
}

/* ==============================
   fix34: smart image composition
   Images should look full and harmonious: the original image remains visible,
   while a soft blurred backdrop fills the frame so cards never look empty.
   ============================== */
.smart-media-frame {
  position: relative !important;
  isolation: isolate;
  overflow: hidden !important;
  background: linear-gradient(135deg, #fbf8f0 0%, #eee8dc 100%) !important;
}
.smart-media-frame::before {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: 0;
  background-image: var(--media-bg, none);
  background-size: cover;
  background-position: center;
  filter: blur(18px) saturate(1.05);
  transform: scale(1.12);
  opacity: .34;
}
.smart-media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(255,253,248,.12), transparent 42%),
    linear-gradient(180deg, rgba(255,253,248,.18), rgba(238,232,220,.20));
  pointer-events: none;
}
.smart-media-frame > img {
  position: relative !important;
  z-index: 1;
  display: block !important;
  margin: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  transform: none !important;
}
.article-card:hover .smart-media-frame > img,
.featured-article-card:hover .smart-media-frame > img,
.video-card:hover .smart-media-frame > img {
  transform: none !important;
}

/* Article images: frame changes gently with the real image orientation. */
.article-thumb.smart-media-frame,
.featured-article-media.smart-media-frame,
.video-card .thumb.smart-media-frame,
.video-embed-thumb.smart-media-frame {
  width: 100% !important;
  min-height: 0 !important;
}
.article-thumb.smart-media-frame.media-wide,
.video-card .thumb.smart-media-frame.media-wide,
.video-embed-thumb.smart-media-frame.media-wide { aspect-ratio: 16 / 9 !important; }
.article-thumb.smart-media-frame.media-balanced,
.video-card .thumb.smart-media-frame.media-balanced,
.video-embed-thumb.smart-media-frame.media-balanced { aspect-ratio: 4 / 3 !important; }
.article-thumb.smart-media-frame.media-square,
.video-card .thumb.smart-media-frame.media-square,
.video-embed-thumb.smart-media-frame.media-square { aspect-ratio: 1 / 1 !important; }
.article-thumb.smart-media-frame.media-portrait,
.video-card .thumb.smart-media-frame.media-portrait,
.video-embed-thumb.smart-media-frame.media-portrait { aspect-ratio: 4 / 5 !important; }

.featured-article-media.smart-media-frame.media-wide { aspect-ratio: 16 / 9 !important; }
.featured-article-media.smart-media-frame.media-balanced { aspect-ratio: 4 / 3 !important; }
.featured-article-media.smart-media-frame.media-square { aspect-ratio: 1 / 1 !important; }
.featured-article-media.smart-media-frame.media-portrait {
  aspect-ratio: 4 / 5 !important;
  width: min(100%, 420px) !important;
  justify-self: center !important;
  align-self: center !important;
}
html[dir="rtl"] .featured-article-card .featured-article-media.smart-media-frame.media-portrait {
  justify-self: center !important;
}

/* The foreground image should occupy the useful frame space, not appear as a tiny icon. */
.article-thumb.smart-media-frame > img,
.featured-article-media.smart-media-frame > img,
.video-card .thumb.smart-media-frame > img,
.video-embed-thumb.smart-media-frame > img {
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
}
.smart-media-frame.media-portrait > img {
  width: auto !important;
  height: 100% !important;
}
.smart-media-frame.media-square > img,
.smart-media-frame.media-balanced > img {
  width: 100% !important;
  height: 100% !important;
}

/* Book covers keep a stable paper-like proportion and always show the whole cover. */
.book-card-cover.smart-media-frame,
.related-book-cover.smart-media-frame,
.featured-book-cover.smart-media-frame,
.book-cover.smart-media-frame {
  aspect-ratio: 2 / 3 !important;
}
.book-card-cover.smart-media-frame > img,
.related-book-cover.smart-media-frame > img,
.featured-book-cover.smart-media-frame > img,
.book-cover.smart-media-frame > img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/* Article detail image: keep it complete and elegant, but avoid a tiny picture in a huge frame. */
.article-cover.smart-media-frame {
  padding: 0 !important;
  border-radius: 28px !important;
  max-height: none !important;
}
.article-cover.smart-media-frame > img {
  width: 100% !important;
  height: auto !important;
  max-height: 680px !important;
  object-fit: contain !important;
}
.article-cover.smart-media-frame.media-portrait > img,
.article-cover.smart-media-frame.media-square > img {
  width: auto !important;
  max-width: 100% !important;
}

/* Card rhythm after natural images: balanced, not oversized. */
.articles-list-grid .article-card,
.home-section .article-card {
  overflow: hidden !important;
}
.articles-list-grid .article-card .article-thumb,
.home-section .article-card .article-thumb {
  max-height: none !important;
}
.articles-list-grid .article-card .article-thumb.media-portrait,
.home-section .article-card .article-thumb.media-portrait {
  max-height: 390px !important;
}
.featured-article-card .featured-article-media.media-portrait {
  max-height: 430px !important;
}

@media (min-width: 901px) {
  .articles-list-grid .article-card .article-thumb.media-wide,
  .home-section .article-card .article-thumb.media-wide { min-height: 250px !important; }
  .articles-list-grid .article-card .article-thumb.media-balanced,
  .home-section .article-card .article-thumb.media-balanced { min-height: 270px !important; }
  .articles-list-grid .article-card .article-thumb.media-portrait,
  .home-section .article-card .article-thumb.media-portrait { min-height: 330px !important; }
  .featured-article-card .featured-article-media.media-wide { min-height: 320px !important; }
  .featured-article-card .featured-article-media.media-balanced { min-height: 360px !important; }
}
@media (max-width: 700px) {
  .article-thumb.smart-media-frame.media-wide,
  .featured-article-media.smart-media-frame.media-wide { aspect-ratio: 16 / 10 !important; }
  .article-thumb.smart-media-frame.media-balanced,
  .featured-article-media.smart-media-frame.media-balanced { aspect-ratio: 4 / 3 !important; }
  .article-thumb.smart-media-frame.media-square,
  .featured-article-media.smart-media-frame.media-square { aspect-ratio: 1 / 1 !important; }
  .article-thumb.smart-media-frame.media-portrait,
  .featured-article-media.smart-media-frame.media-portrait { aspect-ratio: 4 / 5 !important; }
  .articles-list-grid .article-card .article-thumb.media-portrait,
  .home-section .article-card .article-thumb.media-portrait,
  .featured-article-card .featured-article-media.media-portrait {
    max-height: 330px !important;
  }
  .article-cover.smart-media-frame > img { max-height: 440px !important; }
}

/* V29: reader accounts, profile, review progress */
.auth-page,.profile-page{padding-block:44px 70px;}
.auth-intro,.profile-hero{border:1px solid var(--line);background:linear-gradient(135deg,#fffaf2,#f6efe2);border-radius:30px;padding:30px;margin-bottom:22px;box-shadow:var(--shadow-soft,0 12px 40px rgba(0,0,0,.06));}
.auth-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:18px;}
.auth-card,.profile-panel,.profile-submission-card{border:1px solid var(--line);background:#fff;border-radius:24px;padding:22px;box-shadow:0 10px 30px rgba(17,24,39,.05);}
.auth-card h2,.profile-panel h2{margin-top:0;}
.google-card{text-align:center;}
.google-login{min-width:min(100%,280px);}
.auth-inline-note{border:1px solid #ead8b8;background:#fff8ea;color:#5f4631;border-radius:18px;padding:12px 14px;margin-bottom:8px;}
.auth-inline-note a{font-weight:700;text-decoration:underline;}
.profile-hero{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(240px,.8fr);gap:22px;align-items:center;}
.profile-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.profile-stats article{background:#fff;border:1px solid var(--line);border-radius:20px;padding:16px;text-align:center;}
.profile-stats strong{display:block;font-size:30px;color:var(--primary);}
.profile-stats span{font-size:13px;color:var(--muted);}
.profile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:18px;}
.profile-list{display:grid;gap:12px;}
.profile-mini-card{border:1px solid var(--line);border-radius:18px;padding:14px;background:#fbfaf7;}
.profile-mini-card h3{font-size:17px;margin:8px 0 4px;}
.profile-mini-card p{margin:0 0 4px;color:var(--muted);}
.profile-mini-card small{color:var(--muted);}
.profile-submissions{display:grid;gap:14px;}
.profile-submission-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,.8fr);gap:16px;align-items:start;}
.profile-submission-card h3{margin:8px 0 4px;}
.profile-review-note{border-inline-start:4px solid #d8cdbf;background:#fbfaf7;border-radius:14px;padding:10px 12px;color:#4b4036;}
.inquiry-form{display:grid;gap:8px;}
.badge.rejected{background:#fff1f2;color:#9f1239;border-color:#fecdd3;}
.badge.converted,.badge.published,.badge.replied{background:#ecfdf5;color:#047857;border-color:#bbf7d0;}
.badge.pending,.badge.new{background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe;}
@media(max-width:850px){.auth-grid,.profile-hero,.profile-grid,.profile-submission-card{grid-template-columns:1fr}.profile-stats{grid-template-columns:1fr 1fr}.profile-stats article:last-child{grid-column:1/-1}}
@media(max-width:520px){.profile-stats{grid-template-columns:1fr}.auth-card,.profile-panel,.profile-submission-card,.auth-intro,.profile-hero{border-radius:20px;padding:18px}}


/* V29.1: account pages aligned with Madar calm library theme */
.auth-page.account-page,
.profile-page.account-page { padding-block: 0 clamp(46px, 6vw, 76px); }
.account-page .account-page-hero {
  padding-top: clamp(54px, 6vw, 82px) !important;
  padding-bottom: clamp(34px, 4vw, 52px) !important;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(222, 212, 199, .66);
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.account-page .account-page-hero h1,
.account-profile-hero h1 {
  font-size: clamp(42px, 6vw, 74px) !important;
  line-height: 1.12;
  max-width: 920px;
  margin-inline: auto;
}
.account-page .account-page-hero p,
.account-profile-hero .lead {
  color: var(--muted);
  max-width: 760px;
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.95;
}
.account-page .account-page-hero p { margin-inline: auto; }
.center-actions { justify-content: center; }
.account-access-section { padding-top: clamp(24px, 4vw, 42px) !important; }
.account-login-layout {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 22px;
  align-items: stretch;
}
.account-card.card,
.profile-panel.card {
  background: rgba(255,253,248,.9);
  border-color: rgba(222, 212, 199, .92);
  border-radius: 26px;
  box-shadow: var(--shadow-sm);
  padding: clamp(22px, 3vw, 30px);
}
.account-card h2,
.profile-panel h3 {
  font-size: clamp(24px, 2.6vw, 34px) !important;
  margin: 0 0 12px;
}
.account-card-note { margin: -4px 0 4px; }
.account-card .field span,
.profile-panel .field span { color: var(--primary-strong); font-weight: 800; }
.account-card .input,
.inquiry-form .input { background: rgba(255,255,255,.78); }
.account-card-soft { background: linear-gradient(180deg, rgba(255,253,248,.92), rgba(237,242,239,.68)) !important; }
.account-google-strip {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px dashed rgba(23,74,79,.22);
  border-radius: 22px;
  background: rgba(237,242,239,.56);
  padding: 14px 18px;
}
.account-google-strip p { margin: 0; color: var(--muted); }
.account-status-note { min-height: 24px; margin-top: 12px; }
.account-profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .66fr);
  gap: clamp(24px, 5vw, 54px);
  align-items: end;
  padding-top: clamp(54px, 6vw, 82px) !important;
  padding-bottom: clamp(34px, 4vw, 52px) !important;
  border-bottom: 1px solid rgba(222, 212, 199, .66);
  text-align: start !important;
}
.account-profile-hero h1 { margin-inline: 0; }
.account-profile-copy .lead { margin: 14px 0 0; }
.account-identity {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 8px 13px;
  border: 1px solid rgba(222,212,199,.9);
  border-radius: 999px;
  background: rgba(255,253,248,.72);
  max-width: 100%;
}
.account-identity span { color: var(--muted); font-size: 13px; }
.account-identity strong {
  color: var(--primary-strong);
  font-size: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.account-stats.profile-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.account-stats.profile-stats article {
  text-align: start;
  background: rgba(255,253,248,.82);
  border: 1px solid rgba(222,212,199,.9);
  border-radius: 20px;
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
}
.account-stats.profile-stats strong {
  display: inline-block;
  min-width: 38px;
  color: var(--primary);
  font-size: 24px;
  line-height: 1;
  margin-inline-end: 8px;
}
.account-stats.profile-stats span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.account-dashboard-section { padding-top: clamp(34px, 4vw, 56px) !important; }
.account-grid.profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 0;
}
.profile-panel.card h2 { font-size: clamp(28px, 3vw, 42px) !important; }
.profile-list { gap: 10px; }
.profile-mini-card {
  background: rgba(251,247,239,.72);
  border-color: rgba(222,212,199,.85);
  border-radius: 18px;
}
.profile-mini-card h3 { font-size: 18px !important; line-height: 1.45; }
.profile-submission-card {
  background: rgba(251,247,239,.66);
  border: 1px solid rgba(222,212,199,.86);
  border-radius: 22px;
  padding: 18px;
  box-shadow: none;
}
.profile-submission-card h3 { font-size: clamp(21px, 2.4vw, 28px) !important; }
.profile-review-note { border-inline-start-color: rgba(156,106,59,.55); }
@media (max-width: 900px) {
  .account-login-layout,
  .account-profile-hero,
  .account-grid.profile-grid,
  .profile-submission-card { grid-template-columns: 1fr !important; }
  .account-page .account-page-hero { text-align: start; }
  .account-page .account-page-hero h1,
  .account-page .account-page-hero p { margin-inline: 0; }
  .center-actions { justify-content: flex-start; }
  .account-google-strip { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  .auth-page.account-page,
  .profile-page.account-page { padding-bottom: 42px; }
  .account-page .account-page-hero h1,
  .account-profile-hero h1 { font-size: clamp(34px, 12vw, 48px) !important; }
  .account-card.card,
  .profile-panel.card { border-radius: 22px; padding: 20px; }
  .account-identity { border-radius: 18px; align-items: flex-start; }
  .account-stats.profile-stats article { padding: 13px 14px; }
}

/* V29.3: calm submission review workflow in reader profile */
.review-path-card{
  gap:18px;
}
.submission-card-main{
  min-width:0;
}
.submission-timeline{
  list-style:none;
  margin:14px 0 0;
  padding:0;
  display:grid;
  gap:10px;
}
.submission-timeline li{
  display:grid;
  grid-template-columns:20px minmax(0,1fr);
  gap:10px;
  align-items:start;
  color:var(--muted);
}
.submission-timeline .timeline-dot{
  width:12px;
  height:12px;
  border-radius:50%;
  margin-top:7px;
  border:2px solid rgba(15,76,92,.22);
  background:#fff;
  box-shadow:0 0 0 4px rgba(15,76,92,.04);
}
.submission-timeline strong{
  display:block;
  color:var(--text);
  font-size:15px;
  line-height:1.5;
}
.submission-timeline p{
  margin:1px 0 0;
  font-size:13px;
  line-height:1.75;
}
.submission-timeline li.done .timeline-dot{
  background:var(--primary);
  border-color:var(--primary);
}
.submission-timeline li.current .timeline-dot{
  background:#9c6a3b;
  border-color:#9c6a3b;
  box-shadow:0 0 0 5px rgba(156,106,59,.12);
}
.submission-timeline li.waiting{opacity:.62;}
.profile-review-note.rejection-note{
  border-inline-start-color:#b45309;
  background:#fff8ed;
}
.profile-review-note.inquiry-note{
  background:#f7faf8;
}
.badge.received,.badge.under_review,.badge.accepted,.badge.rejected,.badge.publishing,.badge.published{
  border:1px solid rgba(15,76,92,.12);
}
.badge.under_review{background:#f1f5f9;color:#334155;}
.badge.accepted{background:#ecfdf5;color:#166534;}
.badge.rejected{background:#fff7ed;color:#9a3412;}
.badge.publishing{background:#eef2ff;color:#3730a3;}
.badge.published{background:#ecfdf5;color:#14532d;}
@media(max-width:850px){
  .review-path-card{gap:14px;}
}
.review-flow-grid{grid-template-columns:repeat(4,minmax(0,1fr));}
@media(max-width:980px){.review-flow-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:620px){.review-flow-grid{grid-template-columns:1fr;}}

/* ==============================
   v29.6 — Visual Consistency Polish
   A final calm layer to unify pages, cards, account, profile, and contribution flow.
   ============================== */
:root {
  --mobile-safe-pad: 16px;
  --page-top: clamp(38px, 5vw, 66px);
  --card-pad: clamp(20px, 2.4vw, 30px);
  --soft-border: rgba(227, 215, 199, .88);
  --calm-surface: rgba(255,253,247,.86);
}
.site-main { overflow-x: clip; }
.container { width: min(100% - 48px, var(--max)); padding-inline: 0; }
.reading-container { width: min(100% - 48px, var(--reading)); padding-inline: 0; }

/* Navigation: keep the library calm and avoid visual crowding on laptops. */
.nav-wrap { width: min(100% - 48px, 1240px); padding-inline: 0; gap: clamp(16px, 2.2vw, 32px); }
.brand { min-width: max-content; }
.nav-links { min-width: 0; gap: 4px; }
.nav-links a { padding: 8px 10px; font-size: 14px; }
.nav-links .nav-account { background: rgba(255,253,247,.76); color: var(--ink); }
.nav-links .nav-language { font-weight: 800; }
@media (min-width: 981px) and (max-width: 1180px) {
  .nav-links .nav-help { display: none; }
  .nav-links a { padding-inline: 8px; }
}
@media (min-width: 981px) and (max-width: 1080px) {
  .nav-links .nav-secondary:not(.active) { display: none; }
}

/* Global page rhythm. */
.section { padding-block: clamp(46px, 6vw, 74px); }
.page-hero,
.articles-hero,
.submit-hero,
.secondary-hero,
.polished-service-hero,
.compact-secondary-hero,
.account-page .account-page-hero,
.account-profile-hero {
  padding-block: var(--page-top) clamp(28px, 4vw, 48px) !important;
}
.hero, .compact-hero.hero {
  min-height: clamp(480px, 62vh, 620px) !important;
  padding-block: clamp(44px, 6vw, 64px) clamp(46px, 6vw, 68px) !important;
}
.hero h1 { font-size: clamp(48px, 6.2vw, 78px) !important; }
.hero .lead { max-width: 640px; }
.section-head h1,
.section-head h2,
.compact-section-head h2,
.page-hero h1,
.articles-hero h1,
.submit-hero h1,
.secondary-hero h1,
.account-page .account-page-hero h1,
.account-profile-hero h1 {
  font-size: clamp(34px, 4.4vw, 58px) !important;
  line-height: 1.14 !important;
}
.card,
.profile-panel.card,
.account-card.card,
.secondary-info-card,
.rights-card,
.submit-guidelines,
.polished-contribution-form,
.articles-filter-panel,
.book-filter-panel,
.explore-filter-panel {
  background: var(--calm-surface) !important;
  border-color: var(--soft-border) !important;
  box-shadow: 0 16px 46px rgba(40,31,18,.052) !important;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 24px 70px rgba(40,31,18,.09) !important; }

/* Media and listings: consistent scale on desktop and phone. */
.article-card,
.video-card,
.book-card,
.library-book-card,
.related-book-card,
.featured-book-card,
.featured-article-card {
  border-radius: 26px !important;
}
.article-card-body,
.video-card-body { padding: var(--card-pad) !important; }
.article-card h3,
.video-card h3,
.book-card h3 {
  line-height: 1.28 !important;
}
.article-card p,
.video-card p,
.book-card p,
.secondary-info-card p,
.rights-card p {
  line-height: 1.78 !important;
}
.article-thumb-placeholder {
  min-height: 100%;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(circle at 70% 20%, rgba(183,121,31,.14), transparent 35%),
    radial-gradient(circle at 30% 80%, rgba(15,76,92,.12), transparent 32%),
    linear-gradient(135deg, #fffaf2, #eee7da);
}
.article-thumb-placeholder::before {
  content: "مدار";
  color: rgba(15,76,92,.42);
  border: 1px solid rgba(15,76,92,.16);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255,253,247,.62);
}
html[lang="en"] .article-thumb-placeholder::before { content: "Madar"; }
@media (min-width: 901px) {
  #articles-grid,
  .articles-list-grid,
  .article-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)) !important; }
  #books-grid,
  .book-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)) !important; }
  .article-thumb.smart-media-frame,
  .article-thumb,
  .video-card .thumb { max-height: 280px !important; }
  .book-card-cover,
  .library-book-card .book-card-cover,
  .related-book-cover { max-height: 250px !important; }
}

/* Profile: tabs keep the reader account light instead of a long dashboard. */
.account-polished-page .profile-overview-hero {
  border-bottom: 1px solid rgba(227,215,199,.74);
  gap: clamp(20px, 4vw, 44px);
  align-items: center;
}
.profile-tabs-section { padding-top: clamp(24px, 4vw, 44px) !important; }
.profile-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px;
  margin: 0 0 24px;
  border: 1px solid var(--soft-border);
  border-radius: 999px;
  background: rgba(255,253,247,.64);
  scrollbar-width: none;
}
.profile-tabs::-webkit-scrollbar { display: none; }
.profile-tab {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.profile-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 30px rgba(15,76,92,.15);
}
.profile-tab-panel { display: none; }
.profile-tab-panel.active { display: block; animation: madarFadeIn .18s ease-out; }
@keyframes madarFadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.profile-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}
.profile-mini-card { min-height: 132px; }
.account-detail-card { max-width: 760px; }
.account-identity-block { border-radius: 18px; width: fit-content; }

/* Contributions: the form becomes a guided calm flow. */
.submit-wizard-layout {
  grid-template-columns: minmax(240px, .72fr) minmax(0, 1.15fr) !important;
  align-items: start;
}
.submission-wizard-form {
  gap: 0 !important;
  overflow: hidden;
}
.submit-stepper {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.submit-stepper span {
  flex: 1;
  min-width: 34px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15,76,92,.12);
}
.submit-stepper span.active { background: var(--primary); }
.submission-step { display: none; }
.submission-step.active {
  display: grid;
  gap: 14px;
  animation: madarFadeIn .18s ease-out;
}
.submission-step h2 { font-size: clamp(25px, 3vw, 36px) !important; }
.submission-wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}
.submission-wizard-actions .btn { min-width: 130px; }
.review-flow-grid article {
  background: rgba(255,253,247,.82);
  border: 1px solid var(--soft-border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 12px 34px rgba(40,31,18,.045);
}
.review-flow-grid article span {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(15,76,92,.10);
  color: var(--primary);
  font-weight: 900;
}
.review-flow-grid article strong { display: block; margin-top: 12px; color: var(--ink); }
.review-flow-grid article p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }

/* Secondary pages: lighter, more library-like spacing. */
.secondary-card-grid,
.rights-grid,
.author-grid {
  gap: 18px !important;
}
.secondary-info-card h2,
.rights-card h2 { font-size: clamp(22px, 2.5vw, 30px) !important; }
.support-strip,
.secondary-strip {
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 90% 10%, rgba(183,121,31,.10), transparent 18rem),
    linear-gradient(145deg, rgba(255,253,247,.92), rgba(239,244,241,.86)) !important;
}

@media (max-width: 980px) {
  .container,
  .reading-container,
  .nav-wrap { width: min(100% - 36px, var(--max)); }
  .nav-wrap { position: relative; }
  .nav-links a { font-size: 15px; padding: 11px 13px; }
  .submit-wizard-layout { grid-template-columns: 1fr !important; }
  .profile-tabs { border-radius: 22px; }
}
@media (max-width: 700px) {
  :root { --mobile-safe-pad: 14px; --card-pad: 18px; }
  .container,
  .reading-container,
  .nav-wrap { width: 100%; padding-inline: var(--mobile-safe-pad); }
  .section { padding-block: 34px !important; }
  .page-hero,
  .articles-hero,
  .submit-hero,
  .secondary-hero,
  .account-page .account-page-hero,
  .account-profile-hero { padding-block: 34px 24px !important; }
  .hero, .compact-hero.hero { padding-block: 30px 34px !important; }
  .hero h1,
  .page-hero h1,
  .articles-hero h1,
  .submit-hero h1,
  .secondary-hero h1,
  .account-page .account-page-hero h1,
  .account-profile-hero h1 { font-size: clamp(34px, 11vw, 46px) !important; }
  .lead,
  .hero .lead,
  .article-header .lead { font-size: 16.5px !important; line-height: 1.86 !important; }
  .actions { max-width: none !important; }
  .actions .btn { width: auto; }
  .book-card,
  .library-book-card,
  .related-book-card,
  .featured-book-card { text-align: center !important; }
  .book-card-cover,
  .related-book-cover,
  .featured-book-cover { width: min(46vw, 158px) !important; max-width: 158px !important; max-height: 230px !important; }
  .article-card h3,
  .book-card h3,
  .video-card h3 { font-size: clamp(21px, 7vw, 28px) !important; }
  .article-content { font-size: 18px !important; line-height: 1.92 !important; }
  html[lang="ar"] .article-content { font-size: 18.5px !important; line-height: 2.02 !important; }
  .profile-tabs { margin-inline: calc(var(--mobile-safe-pad) * -1); padding-inline: var(--mobile-safe-pad); border-inline: 0; border-radius: 0; background: transparent; }
  .profile-tab { background: rgba(255,253,247,.78); border: 1px solid var(--soft-border); }
  .profile-list-grid { grid-template-columns: 1fr; }
  .account-stats.profile-stats { grid-template-columns: 1fr !important; }
  .submission-wizard-actions { display: grid; grid-template-columns: 1fr; }
  .submission-wizard-actions .btn { width: 100%; }
  .review-flow-grid article { padding: 16px; }
  .support-strip .actions,
  .secondary-strip .actions { flex-direction: column; align-items: stretch; }
  .support-strip .actions .btn,
  .secondary-strip .actions .btn { width: 100%; }
}
@media (max-width: 420px) {
  :root { --mobile-safe-pad: 12px; }
  .book-card-cover,
  .related-book-cover,
  .featured-book-cover { width: min(52vw, 150px) !important; }
  .profile-tab { padding-inline: 13px; }
}

/* V29.7: Reading comfort polish — remove visual gaps and make the reader appear immediately on phones. */
.pdf-reader-topbar,
.polished-reader-topbar {
  min-height: 0 !important;
  height: auto !important;
  justify-content: flex-start !important;
  align-content: flex-start !important;
}
.polished-reader-page {
  padding-top: clamp(10px, 2vw, 18px) !important;
}
.reader-heading .eyebrow {
  margin-bottom: 8px;
  letter-spacing: .09em;
}
.reader-heading h1 {
  margin-bottom: 8px !important;
  text-wrap: balance;
}
.reader-heading p {
  line-height: 1.7;
}
.reader-mode-chips {
  margin-top: 10px !important;
}
.reader-actions {
  align-self: flex-start;
}
.pdf-reader-frame-wrap,
.epub-reader-shell {
  margin-top: 0 !important;
  overflow: hidden !important;
}
.epub-reader-shell {
  display: flex !important;
  flex-direction: column !important;
}
.epub-reader-stage {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}
.reader-preview-end.polished-preview-end {
  margin-top: 14px !important;
}

@media (max-width: 760px) {
  body[data-page="reader"] .site-header {
    margin-bottom: 6px !important;
  }
  body[data-page="reader"] .site-main {
    padding-top: 0 !important;
  }
  .pdf-reader-page,
  .polished-reader-page {
    width: 100% !important;
    padding: 8px 10px 18px !important;
  }
  .pdf-reader-topbar,
  .polished-reader-topbar {
    display: block !important;
    padding: 14px !important;
    margin-bottom: 8px !important;
    border-radius: 20px !important;
    box-shadow: 0 12px 34px rgba(32, 26, 18, .055) !important;
  }
  .reader-heading .eyebrow {
    margin: 0 0 6px !important;
    font-size: 11px !important;
    letter-spacing: .10em !important;
  }
  .pdf-reader-topbar h1,
  .reader-heading h1 {
    font-size: clamp(22px, 6.7vw, 30px) !important;
    line-height: 1.22 !important;
    margin: 0 0 6px !important;
  }
  .reader-heading p {
    font-size: 14.5px !important;
    line-height: 1.58 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .reader-mode-chips {
    gap: 6px !important;
    margin-top: 9px !important;
  }
  .reader-mode-chips span {
    font-size: 11.5px !important;
    padding: 4px 8px !important;
    line-height: 1.25 !important;
  }
  .reader-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 10px !important;
    min-width: 0 !important;
  }
  .reader-actions .btn {
    width: 100% !important;
    min-height: 40px !important;
    padding: 9px 10px !important;
    font-size: 13.5px !important;
    white-space: normal !important;
    line-height: 1.25 !important;
  }
  .reader-actions .btn:first-child:nth-last-child(3),
  .reader-actions .btn:first-child:nth-last-child(3) ~ .btn:last-child {
    grid-column: auto;
  }
  .reader-guidance {
    margin: 0 0 8px !important;
    padding: 8px 10px !important;
    border-radius: 14px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
  }
  .reader-guidance span {
    display: none !important;
  }
  .reader-guidance strong {
    width: 100%;
    text-align: center;
  }
  .pdf-reader-frame-wrap,
  .epub-reader-shell {
    border-radius: 16px !important;
    min-height: 0 !important;
    height: calc(100svh - 245px) !important;
    max-height: none !important;
  }
  .pdf-reader-frame {
    height: 100% !important;
    min-height: 0 !important;
  }
  .epub-reader-toolbar {
    flex: 0 0 auto !important;
    padding: 7px !important;
    gap: 6px !important;
  }
  .epub-reader-toolbar .btn {
    min-height: 34px !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
  }
  .epub-location {
    font-size: 12.5px !important;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .epub-reader-stage {
    height: auto !important;
    min-height: 0 !important;
    padding: 8px !important;
  }
  .reader-preview-end.polished-preview-end {
    margin-top: 10px !important;
    padding: 14px !important;
    border-radius: 18px !important;
  }
}

@media (max-width: 420px) {
  .pdf-reader-page,
  .polished-reader-page {
    padding-inline: 8px !important;
  }
  .pdf-reader-topbar,
  .polished-reader-topbar {
    padding: 12px !important;
    border-radius: 18px !important;
  }
  .reader-heading p {
    -webkit-line-clamp: 1;
  }
  .reader-actions {
    grid-template-columns: 1fr !important;
  }
  .reader-actions .btn {
    min-height: 38px !important;
  }
  .pdf-reader-frame-wrap,
  .epub-reader-shell {
    height: calc(100svh - 235px) !important;
  }
}

/* V29.7: softer browsing rhythm — cards and page sections feel less heavy on phones. */
@media (max-width: 700px) {
  .book-detail-hero,
  .featured-book-card,
  .article-card,
  .video-card,
  .book-card,
  .library-book-card,
  .related-book-card,
  .account-card,
  .submission-wizard-form,
  .profile-mini-card {
    box-shadow: 0 12px 34px rgba(40,31,18,.045) !important;
  }
  .book-detail-hero,
  .account-profile-hero,
  .account-page .account-page-hero,
  .submit-hero,
  .page-hero,
  .secondary-hero {
    border-radius: 24px !important;
  }
  .article-thumb,
  .video-card .thumb,
  .smart-media-frame {
    border-radius: 20px !important;
  }
  .book-card-actions .btn,
  .related-book-actions .btn,
  .article-card .btn,
  .video-card .btn {
    min-height: 42px;
  }
}

/* ==========================================================
   V29.8 — Mobile catalog comfort polish
   Goal: books/articles pages should feel calm on phone, without
   visible horizontal scrollbars, over-tall filter cards, or delayed content.
   ========================================================== */
.articles-category-strip,
.refined-category-strip,
.book-type-tabs,
.explore-type-tabs,
.profile-tabs {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.articles-category-strip::-webkit-scrollbar,
.refined-category-strip::-webkit-scrollbar,
.book-type-tabs::-webkit-scrollbar,
.explore-type-tabs::-webkit-scrollbar,
.profile-tabs::-webkit-scrollbar { display: none !important; }

@media (max-width: 700px) {
  /* Calm mobile page rhythm: show useful content sooner. */
  .articles-page-shell,
  .books-page-shell { padding-top: 0 !important; }

  .articles-page-shell .articles-hero,
  .refined-books-page .refined-books-hero {
    padding-top: 22px !important;
    padding-bottom: 10px !important;
  }

  .articles-title-head,
  .refined-books-page .refined-books-hero {
    margin-bottom: 10px !important;
  }

  .articles-title-head h1,
  .refined-books-page .refined-books-hero h1 {
    font-size: clamp(36px, 12vw, 46px) !important;
    line-height: 1.04 !important;
    margin-bottom: 8px !important;
    letter-spacing: -0.035em !important;
  }

  html[dir="rtl"] .articles-title-head h1,
  html[dir="rtl"] .refined-books-page .refined-books-hero h1 { letter-spacing: -0.01em !important; }

  .articles-title-head p:not(.eyebrow),
  .refined-books-page .refined-books-hero p:not(.eyebrow) {
    font-size: 15px !important;
    line-height: 1.72 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    max-width: 100% !important;
  }

  .articles-page-shell .eyebrow,
  .refined-books-page .eyebrow {
    font-size: 11px !important;
    letter-spacing: .12em !important;
    margin-bottom: 6px !important;
  }

  /* Filter panels: compact, readable, and no internal clipping. */
  .articles-filter-panel.slim-articles-filter,
  .book-filter-panel.refined-book-filter-panel {
    margin-top: 12px !important;
    padding: 12px !important;
    border-radius: 22px !important;
    gap: 10px !important;
    overflow: visible !important;
    box-shadow: 0 12px 34px rgba(40,31,18,.055) !important;
  }

  .slim-articles-filter .article-search-wrap,
  .books-search-wrap {
    gap: 0 !important;
    margin: 0 !important;
  }

  .slim-articles-filter .article-search-wrap > span,
  .slim-articles-filter .article-search-wrap small,
  .books-search-wrap > span,
  .books-search-wrap small,
  .compact-sort > span,
  .books-filter-hint {
    display: none !important;
  }

  .article-search-input,
  .books-search-wrap .article-search-input,
  .compact-sort .input {
    min-height: 44px !important;
    height: 44px !important;
    border-radius: 16px !important;
    padding: 0 14px !important;
    font-size: 14px !important;
    line-height: 44px !important;
  }

  .books-search-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  .books-search-wrap {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .compact-sort {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 0 !important;
  }

  .compact-sort .input {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Chip rails: scroll gently without visible scrollbar or clipped pills. */
  .slim-articles-filter .articles-category-strip,
  .refined-book-filter-panel .book-type-tabs,
  .refined-book-filter-panel .refined-category-strip {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
    padding-bottom: 1px !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .slim-articles-filter .articles-category-strip::after,
  .refined-book-filter-panel .book-type-tabs::after,
  .refined-book-filter-panel .refined-category-strip::after {
    content: "";
    flex: 0 0 2px;
  }

  .article-category-chip,
  .book-type-chip {
    flex: 0 0 auto !important;
    min-height: 36px !important;
    padding: 7px 10px !important;
    border-radius: 999px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    scroll-snap-align: start;
    box-shadow: none !important;
  }

  .article-category-chip small {
    width: 21px !important;
    min-width: 21px !important;
    height: 21px !important;
    font-size: 11px !important;
    margin-inline-start: 4px !important;
  }

  /* Results should begin sooner after filters. */
  .articles-results-section,
  .books-results-section.refined-books-results {
    padding-top: 20px !important;
  }

  .compact-section-head {
    margin-bottom: 12px !important;
  }

  .compact-section-head h2,
  .refined-books-results .compact-section-head h2 {
    font-size: clamp(32px, 10.5vw, 42px) !important;
    line-height: 1.08 !important;
  }

  #articles-results-count,
  #books-results-count {
    font-size: 13px !important;
    margin-top: 4px !important;
  }

  .articles-featured-slot:not(:empty),
  .books-featured-slot:not(:empty) {
    margin-bottom: 16px !important;
  }

  #articles-grid,
  #books-grid,
  .articles-list-grid,
  .refined-books-grid {
    gap: 16px !important;
  }

  /* Cards: softer and less bulky on phone. */
  .article-card,
  .book-card,
  .library-book-card,
  .featured-article-card,
  .featured-book-card {
    border-radius: 21px !important;
    box-shadow: 0 12px 34px rgba(40,31,18,.055) !important;
  }

  .article-card-body { padding: 16px 16px 18px !important; }
  .book-card,
  .library-book-card { padding: 16px !important; }

  .article-card h3,
  .book-card h3,
  .library-book-card h3 {
    font-size: clamp(21px, 7.2vw, 28px) !important;
    line-height: 1.24 !important;
  }

  .article-card p,
  .book-card p,
  .library-book-card p {
    font-size: 15px !important;
    line-height: 1.72 !important;
  }

  .book-card-cover,
  .library-book-card .book-card-cover,
  .featured-book-cover {
    width: min(48vw, 154px) !important;
    max-width: 154px !important;
    border-radius: 16px !important;
  }

  .book-card-actions .btn,
  .related-book-actions .btn {
    min-height: 43px !important;
  }
}

@media (max-width: 390px) {
  .books-search-row {
    grid-template-columns: 1fr !important;
  }
  .article-category-chip,
  .book-type-chip {
    font-size: 12.5px !important;
    padding-inline: 9px !important;
  }
  .articles-title-head h1,
  .refined-books-page .refined-books-hero h1 {
    font-size: clamp(34px, 12vw, 42px) !important;
  }
}


/* v29.9 — Submission feedback states */
#submission-status {
  display: block;
  margin-top: 14px;
  min-height: 1.5em;
  font-weight: 700;
}
#submission-status.is-success {
  color: #0f5f4d;
  background: rgba(15, 95, 77, .08);
  border: 1px solid rgba(15, 95, 77, .18);
  border-radius: 18px;
  padding: 12px 16px;
}
#submission-status.is-error {
  color: #8a3a24;
  background: rgba(138, 58, 36, .08);
  border: 1px solid rgba(138, 58, 36, .18);
  border-radius: 18px;
  padding: 12px 16px;
}
#submission-status.is-loading {
  color: var(--muted);
}
.submission-wizard-actions .btn:disabled {
  opacity: .62;
  cursor: wait;
}

/* V29.11: embedded video cards and calmer in-site playback */
.embedded-video-card { overflow: hidden; }
.embedded-video-card .video-card-embed { display: block; margin: 0; border-radius: 24px 24px 0 0; background: #0b171a; aspect-ratio: 16 / 9; overflow: hidden; }
.embedded-video-card .video-card-embed .video-frame { border-radius: 24px 24px 0 0; height: 100%; }
.embedded-video-card .video-card-embed iframe,
.embedded-video-card .video-card-embed video { display: block; width: 100%; height: 100%; }
.video-related-actions { gap: 10px; flex-wrap: wrap; }
.video-related-actions .subtle-external-video { opacity: .78; }
@media (max-width: 760px) {
  .embedded-video-card .video-card-embed { border-radius: 18px 18px 0 0; }
  .embedded-video-card .video-card-embed .video-frame { border-radius: 18px 18px 0 0; }
  .video-related-actions .btn { width: auto; min-height: 38px; padding-inline: 14px; }
}


/* V29.12: stable in-site videos and admin-safe visual polish */
.videos-grid,
#videos-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 680px)) !important;
  justify-content: center !important;
  align-items: start !important;
}
.home-section .videos-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr)) !important;
}
.video-card.embedded-video-card {
  padding: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  background: rgba(255,253,248,.94) !important;
}
.video-card-player {
  display: block !important;
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  background: #101414 !important;
  overflow: hidden !important;
  border-radius: 24px 24px 0 0 !important;
}
.video-card-player .video-frame,
.video-card-player iframe,
.video-card-player video {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  border: 0 !important;
  border-radius: 0 !important;
}
.video-card-player img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}
.video-card-body {
  min-height: 0 !important;
}
.video-card .video-inline-note {
  margin-top: -4px !important;
  margin-bottom: 16px !important;
  color: var(--muted) !important;
  font-size: 13px !important;
  line-height: 1.7 !important;
}
.video-related-actions .subtle-external-video {
  display: inline-flex !important;
  opacity: .72 !important;
}
.admin-recovery h1 { font-size: clamp(26px, 3vw, 34px); }
@media (max-width: 760px) {
  .videos-grid, #videos-grid { grid-template-columns: 1fr !important; }
  .video-card-player { border-radius: 20px 20px 0 0 !important; }
  .video-card .video-inline-note { display: none !important; }
}


/* v29.15 mobile performance polish: reserve enough space before JS hydration
   so the footer does not jump into/out of the first viewport on slow mobile. */
.static-fallback { min-height: 78svh; display: grid; align-items: start; }
.static-fallback .static-card { contain: layout paint; }
@media (max-width: 760px) {
  .static-fallback { min-height: 86svh; padding-top: 24px; }
  .site-footer { content-visibility: auto; contain-intrinsic-size: 520px; }
  .home-section, .calm-principles, .newsletter { content-visibility: auto; contain-intrinsic-size: 720px; }
  .book-card-cover, .article-thumb, .featured-article-media, .video-card-player { contain: layout paint; }
}


/* ==============================
   v29.15.3 — Compact catalog grids
   Goal: professional dense cards, max 4 per row on desktop, 2 on mobile,
   without oversized cards when only a few items are available.
   ============================== */
:root {
  --catalog-gap: clamp(14px, 1.45vw, 20px);
  --catalog-radius: 24px;
}

/* Home + catalog pages: 4 columns on wide screens. */
.home-section .home-cards,
#books-grid.refined-books-grid,
#articles-grid.articles-list-grid,
#videos-grid.videos-grid,
.refined-books-grid,
.articles-list-grid,
.videos-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: var(--catalog-gap) !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

/* Keep fewer homepage items compact instead of expanding into huge cards. */
.home-section.count-1 .home-cards { grid-template-columns: minmax(0, min(100%, 270px)) !important; }
.home-section.count-2 .home-cards { grid-template-columns: repeat(2, minmax(0, min(100%, 270px))) !important; }
.home-section.count-3 .home-cards { grid-template-columns: repeat(3, minmax(0, min(100%, 270px))) !important; }
.home-section.count-1 .home-cards,
.home-section.count-2 .home-cards,
.home-section.count-3 .home-cards { justify-content: start !important; }
html[dir="rtl"] .home-section.count-1 .home-cards,
html[dir="rtl"] .home-section.count-2 .home-cards,
html[dir="rtl"] .home-section.count-3 .home-cards { justify-content: end !important; }

/* Compact book cards for grids. */
.home-section .book-card,
#books-grid .book-card,
.refined-books-grid .book-card {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  padding: 16px !important;
  gap: 12px !important;
  border-radius: var(--catalog-radius) !important;
  text-align: start !important;
}
.home-section .book-card-cover,
#books-grid .book-card-cover,
.refined-books-grid .book-card-cover,
.home-section .library-book-card .book-card-cover,
#books-grid .library-book-card .book-card-cover,
.refined-books-grid .library-book-card .book-card-cover {
  width: min(74%, 150px) !important;
  max-width: 150px !important;
  min-width: 0 !important;
  aspect-ratio: 2 / 3 !important;
  margin: 0 auto 4px !important;
  border-radius: 18px !important;
}
.home-section .book-card-body,
#books-grid .book-card-body,
.refined-books-grid .book-card-body {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  gap: 5px !important;
  align-items: stretch !important;
}
.home-section .book-card h3,
#books-grid .book-card h3,
.refined-books-grid .book-card h3 {
  font-size: clamp(18px, 1.45vw, 22px) !important;
  line-height: 1.32 !important;
  margin: 4px 0 0 !important;
}
.home-section .book-card h3 a,
#books-grid .book-card h3 a,
.refined-books-grid .book-card h3 a {
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.home-section .book-card p,
#books-grid .book-card p,
.refined-books-grid .book-card p {
  font-size: 14px !important;
  line-height: 1.62 !important;
  margin: 4px 0 2px !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.home-section .book-card .meta,
#books-grid .book-card .meta,
.refined-books-grid .book-card .meta,
.home-section .small-chips,
#books-grid .small-chips,
.refined-books-grid .small-chips {
  gap: 6px !important;
  margin: 0 !important;
  font-size: 12px !important;
}
.home-section .book-card .byline,
#books-grid .book-card .byline,
.refined-books-grid .book-card .byline {
  font-size: 13px !important;
  margin: 0 !important;
}
.home-section .book-card-actions,
#books-grid .book-card-actions,
.refined-books-grid .book-card-actions {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
  margin-top: auto !important;
  padding-top: 8px !important;
}
.home-section .book-card-actions .btn,
#books-grid .book-card-actions .btn,
.refined-books-grid .book-card-actions .btn {
  width: 100% !important;
  min-height: 38px !important;
  padding: 8px 10px !important;
  font-size: 13px !important;
}

/* Compact article cards. */
.home-section .article-card,
#articles-grid .article-card,
.articles-list-grid .article-card {
  border-radius: var(--catalog-radius) !important;
  min-height: 0 !important;
}
.home-section .article-card-body,
#articles-grid .article-card-body,
.articles-list-grid .article-card-body {
  padding: 16px !important;
}
.home-section .article-thumb,
#articles-grid .article-thumb,
.articles-list-grid .article-thumb {
  aspect-ratio: 16 / 10 !important;
}
.home-section .article-card h3,
#articles-grid .article-card h3,
.articles-list-grid .article-card h3 {
  font-size: clamp(18px, 1.4vw, 21px) !important;
  line-height: 1.45 !important;
  margin: 6px 0 !important;
}
.home-section .article-card h3 a,
#articles-grid .article-card h3 a,
.articles-list-grid .article-card h3 a {
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.home-section .article-card p,
#articles-grid .article-card p,
.articles-list-grid .article-card p {
  font-size: 14px !important;
  line-height: 1.65 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.home-section .article-card .card-footer,
#articles-grid .article-card .card-footer,
.articles-list-grid .article-card .card-footer {
  font-size: 12.5px !important;
  gap: 8px !important;
}

/* Compact video cards. */
.home-section .video-card,
#videos-grid .video-card,
.videos-grid .video-card {
  border-radius: var(--catalog-radius) !important;
  min-height: 0 !important;
}
.home-section .video-card-player,
#videos-grid .video-card-player,
.videos-grid .video-card-player {
  border-radius: var(--catalog-radius) var(--catalog-radius) 0 0 !important;
}
.home-section .video-card-body,
#videos-grid .video-card-body,
.videos-grid .video-card-body {
  padding: 16px !important;
}
.home-section .video-card h3,
#videos-grid .video-card h3,
.videos-grid .video-card h3 {
  font-size: clamp(18px, 1.4vw, 21px) !important;
  line-height: 1.42 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.home-section .video-card p,
#videos-grid .video-card p,
.videos-grid .video-card p {
  font-size: 14px !important;
  line-height: 1.6 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.home-section .video-inline-note,
#videos-grid .video-inline-note,
.videos-grid .video-inline-note { display: none !important; }

@media (max-width: 1180px) {
  .home-section .home-cards,
  #books-grid.refined-books-grid,
  #articles-grid.articles-list-grid,
  #videos-grid.videos-grid,
  .refined-books-grid,
  .articles-list-grid,
  .videos-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 860px) {
  .home-section .home-cards,
  #books-grid.refined-books-grid,
  #articles-grid.articles-list-grid,
  #videos-grid.videos-grid,
  .refined-books-grid,
  .articles-list-grid,
  .videos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 560px) {
  .home-section .home-cards,
  #books-grid.refined-books-grid,
  #articles-grid.articles-list-grid,
  #videos-grid.videos-grid,
  .refined-books-grid,
  .articles-list-grid,
  .videos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
  .home-section.count-1 .home-cards,
  .home-section.count-2 .home-cards,
  .home-section.count-3 .home-cards { justify-content: stretch !important; }
  .home-section.count-1 .home-cards { grid-template-columns: 1fr !important; }
  .home-section.count-2 .home-cards,
  .home-section.count-3 .home-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .home-section .book-card,
  #books-grid .book-card,
  .refined-books-grid .book-card,
  .home-section .article-card-body,
  #articles-grid .article-card-body,
  .articles-list-grid .article-card-body,
  .home-section .video-card-body,
  #videos-grid .video-card-body,
  .videos-grid .video-card-body {
    padding: 12px !important;
  }
  .home-section .book-card-cover,
  #books-grid .book-card-cover,
  .refined-books-grid .book-card-cover,
  .home-section .library-book-card .book-card-cover,
  #books-grid .library-book-card .book-card-cover,
  .refined-books-grid .library-book-card .book-card-cover {
    width: min(82%, 126px) !important;
    max-width: 126px !important;
    border-radius: 15px !important;
  }
  .home-section .book-card h3,
  #books-grid .book-card h3,
  .refined-books-grid .book-card h3,
  .home-section .article-card h3,
  #articles-grid .article-card h3,
  .articles-list-grid .article-card h3,
  .home-section .video-card h3,
  #videos-grid .video-card h3,
  .videos-grid .video-card h3 {
    font-size: 15.5px !important;
    line-height: 1.45 !important;
    -webkit-line-clamp: 3 !important;
  }
  .home-section .book-card p,
  #books-grid .book-card p,
  .refined-books-grid .book-card p,
  .home-section .article-card p,
  #articles-grid .article-card p,
  .articles-list-grid .article-card p,
  .home-section .video-card p,
  #videos-grid .video-card p,
  .videos-grid .video-card p {
    display: none !important;
  }
  .home-section .book-card .meta,
  #books-grid .book-card .meta,
  .refined-books-grid .book-card .meta,
  .home-section .article-card .meta,
  #articles-grid .article-card .meta,
  .articles-list-grid .article-card .meta,
  .home-section .video-card .meta,
  #videos-grid .video-card .meta,
  .videos-grid .video-card .meta {
    font-size: 11px !important;
    gap: 5px !important;
  }
  .home-section .small-chips,
  #books-grid .small-chips,
  .refined-books-grid .small-chips,
  .home-section .article-card .card-footer span,
  #articles-grid .article-card .card-footer span,
  .articles-list-grid .article-card .card-footer span {
    display: none !important;
  }
  .home-section .book-card-actions .btn,
  #books-grid .book-card-actions .btn,
  .refined-books-grid .book-card-actions .btn,
  .home-section .article-card .card-footer a,
  #articles-grid .article-card .card-footer a,
  .articles-list-grid .article-card .card-footer a,
  .home-section .video-related-actions .btn,
  #videos-grid .video-related-actions .btn,
  .videos-grid .video-related-actions .btn {
    min-height: 34px !important;
    padding: 7px 9px !important;
    font-size: 12px !important;
  }
  .home-section .article-thumb,
  #articles-grid .article-thumb,
  .articles-list-grid .article-thumb { aspect-ratio: 1.1 / 1 !important; }
}
@media (max-width: 340px) {
  .home-section .home-cards,
  #books-grid.refined-books-grid,
  #articles-grid.articles-list-grid,
  #videos-grid.videos-grid,
  .refined-books-grid,
  .articles-list-grid,
  .videos-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==============================
   v29.15.4 — Balanced grids and video comfort
   - Align titles, metadata and actions across cards.
   - Use 2/3/4 columns according to available items, no empty fourth slot.
   - Video titles open the in-site videos page anchor; embedded players stay inside Madar.
   ============================== */
.home-section .home-cards.items-count-2,
#books-grid.items-count-2,
#articles-grid.items-count-2,
#videos-grid.items-count-2,
.refined-books-grid.items-count-2,
.articles-list-grid.items-count-2,
.videos-grid.items-count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  justify-content: stretch !important;
}
.home-section .home-cards.items-count-3,
#books-grid.items-count-3,
#articles-grid.items-count-3,
#videos-grid.items-count-3,
.refined-books-grid.items-count-3,
.articles-list-grid.items-count-3,
.videos-grid.items-count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  justify-content: stretch !important;
}
.home-section .home-cards.items-count-1,
#books-grid.items-count-1,
#articles-grid.items-count-1,
#videos-grid.items-count-1,
.refined-books-grid.items-count-1,
.articles-list-grid.items-count-1,
.videos-grid.items-count-1 {
  grid-template-columns: minmax(0, min(100%, 360px)) !important;
  justify-content: start !important;
}
html[dir="rtl"] .home-section .home-cards.items-count-1,
html[dir="rtl"] #books-grid.items-count-1,
html[dir="rtl"] #articles-grid.items-count-1,
html[dir="rtl"] #videos-grid.items-count-1,
html[dir="rtl"] .refined-books-grid.items-count-1,
html[dir="rtl"] .articles-list-grid.items-count-1,
html[dir="rtl"] .videos-grid.items-count-1 { justify-content: end !important; }

/* Override v29.15.3: 2/3 cards should fill their row, not stay narrow. */
.home-section.count-2 .home-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; justify-content: stretch !important; }
.home-section.count-3 .home-cards { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; justify-content: stretch !important; }

/* Balanced vertical rhythm for cards. */
.home-section .book-card,
#books-grid .book-card,
.refined-books-grid .book-card,
.home-section .article-card,
#articles-grid .article-card,
.articles-list-grid .article-card,
.home-section .video-card,
#videos-grid .video-card,
.videos-grid .video-card {
  height: 100% !important;
}
.home-section .book-card-body,
#books-grid .book-card-body,
.refined-books-grid .book-card-body,
.home-section .article-card-body,
#articles-grid .article-card-body,
.articles-list-grid .article-card-body,
.home-section .video-card-body,
#videos-grid .video-card-body,
.videos-grid .video-card-body {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
}
.home-section .book-card .calm-book-meta,
#books-grid .book-card .calm-book-meta,
.refined-books-grid .book-card .calm-book-meta,
.home-section .article-card .meta,
#articles-grid .article-card .meta,
.articles-list-grid .article-card .meta,
.home-section .video-card .meta,
#videos-grid .video-card .meta,
.videos-grid .video-card .meta {
  min-height: 32px;
  align-items: center;
}
.home-section .book-card h3,
#books-grid .book-card h3,
.refined-books-grid .book-card h3,
.home-section .article-card h3,
#articles-grid .article-card h3,
.articles-list-grid .article-card h3,
.home-section .video-card h3,
#videos-grid .video-card h3,
.videos-grid .video-card h3 {
  min-height: calc(1.45em * 3);
  display: flex !important;
  align-items: flex-start;
}
.home-section .book-card .byline,
#books-grid .book-card .byline,
.refined-books-grid .book-card .byline {
  min-height: 22px;
}
.home-section .book-card p,
#books-grid .book-card p,
.refined-books-grid .book-card p,
.home-section .article-card p,
#articles-grid .article-card p,
.articles-list-grid .article-card p,
.home-section .video-card p,
#videos-grid .video-card p,
.videos-grid .video-card p {
  min-height: calc(1.62em * 2);
}
.home-section .book-info-line,
#books-grid .book-info-line,
.refined-books-grid .book-info-line,
.home-section .article-card .card-footer,
#articles-grid .article-card .card-footer,
.articles-list-grid .article-card .card-footer {
  min-height: 40px;
}
.home-section .book-card-actions,
#books-grid .book-card-actions,
.refined-books-grid .book-card-actions,
.home-section .article-card .card-footer,
#articles-grid .article-card .card-footer,
.articles-list-grid .article-card .card-footer,
.home-section .video-related-actions,
#videos-grid .video-related-actions,
.videos-grid .video-related-actions {
  margin-top: auto !important;
}
.video-card h3 a {
  color: var(--primary-strong);
  text-decoration: none;
}
.video-card h3 a:hover { color: var(--ink); }
.video-card-anchor {
  position: absolute;
  top: -92px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.video-card-player { position: relative; }
.video-related-actions .btn.primary {
  background: var(--primary);
  color: #fff;
}
.video-related-actions .btn.primary:hover { background: var(--primary-strong); }

@media (max-width: 860px) {
  .home-section .home-cards.items-count-3,
  #books-grid.items-count-3,
  #articles-grid.items-count-3,
  #videos-grid.items-count-3,
  .refined-books-grid.items-count-3,
  .articles-list-grid.items-count-3,
  .videos-grid.items-count-3,
  .home-section.count-3 .home-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 560px) {
  .home-section .home-cards.items-count-1,
  #books-grid.items-count-1,
  #articles-grid.items-count-1,
  #videos-grid.items-count-1,
  .refined-books-grid.items-count-1,
  .articles-list-grid.items-count-1,
  .videos-grid.items-count-1 {
    grid-template-columns: 1fr !important;
    justify-content: stretch !important;
  }
  .home-section .book-card h3,
  #books-grid .book-card h3,
  .refined-books-grid .book-card h3,
  .home-section .article-card h3,
  #articles-grid .article-card h3,
  .articles-list-grid .article-card h3,
  .home-section .video-card h3,
  #videos-grid .video-card h3,
  .videos-grid .video-card h3 {
    min-height: calc(1.45em * 3);
  }
  .home-section .book-card p,
  #books-grid .book-card p,
  .refined-books-grid .book-card p,
  .home-section .article-card p,
  #articles-grid .article-card p,
  .articles-list-grid .article-card p,
  .home-section .video-card p,
  #videos-grid .video-card p,
  .videos-grid .video-card p {
    min-height: 0;
  }
}

/* v30.0 Author Revenue Foundation */
.terms-check{display:flex;gap:.65rem;align-items:flex-start;font-size:.92rem;line-height:1.7;color:var(--muted, #5f655f);background:rgba(255,255,255,.55);border:1px solid rgba(15,76,92,.10);border-radius:18px;padding:.8rem .95rem}.terms-check input{margin-top:.38rem;accent-color:var(--primary,#0f4c5c);flex:0 0 auto}.terms-check a{font-weight:700}.subtle-check{background:transparent;border-style:dashed}.google-terms{max-width:820px;margin:.75rem auto 0;text-align:start}.wallet-panel{display:grid;gap:1.2rem}.wallet-intro{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.wallet-intro h2{margin:.2rem 0 .4rem}.wallet-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.85rem}.wallet-stats article{background:linear-gradient(180deg,#fff,#fbf7ef);border:1px solid rgba(15,76,92,.10);border-radius:20px;padding:1rem;box-shadow:0 14px 32px rgba(15,76,92,.06)}.wallet-stats span{display:block;color:var(--muted,#667);font-size:.88rem;margin-bottom:.35rem}.wallet-stats strong{font-size:1.25rem;color:var(--primary,#0f4c5c)}.wallet-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.75rem;align-items:end;background:#fff;border:1px solid rgba(15,76,92,.10);border-radius:22px;padding:1rem}.payout-request-form{grid-template-columns:auto minmax(0,1fr)}.wallet-tables{display:grid;gap:.8rem}.wallet-tables h3{margin:1rem 0 .15rem}.table-scroll{overflow-x:auto}.mini-ledger-table{width:100%;border-collapse:separate;border-spacing:0;background:#fff;border:1px solid rgba(15,76,92,.10);border-radius:18px;overflow:hidden}.mini-ledger-table th,.mini-ledger-table td{padding:.8rem .9rem;border-bottom:1px solid rgba(15,76,92,.08);text-align:start;vertical-align:top}.mini-ledger-table th{font-size:.82rem;color:var(--muted,#667);background:#fbf7ef}.mini-ledger-table tr:last-child td{border-bottom:none}@media(max-width:760px){.wallet-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.wallet-form,.payout-request-form{grid-template-columns:1fr}.wallet-stats strong{font-size:1rem}.terms-check{font-size:.86rem}}

/* v30.1 — Legal & Author Dashboard Polish */
.wallet-stats-explained article small{
  display:block;
  margin-top:.45rem;
  color:var(--muted,#667);
  font-size:.78rem;
  line-height:1.55;
}
.detailed-ledger-table th,
.detailed-ledger-table td{white-space:nowrap;}
.detailed-ledger-table td:first-child{white-space:normal;min-width:170px;}
.author-terms-page .secondary-hero{max-width:980px;margin-inline:auto;}
.author-terms-grid .secondary-info-card{min-height:170px;}
@media(max-width:760px){
  .detailed-ledger-table th,
  .detailed-ledger-table td{font-size:.82rem;padding:.65rem .7rem;}
}

/* v30.2 — Affiliate program foundation */
.affiliate-link-box{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:end;margin:18px 0;padding:16px;border:1px solid rgba(20,54,48,.12);border-radius:20px;background:rgba(255,255,255,.68)}
.affiliate-link-box .field{margin:0}.affiliate-link-box input{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.92rem;direction:ltr;text-align:left}.affiliate-panel .wallet-stats article{min-height:105px}.affiliate-panel code{background:rgba(20,54,48,.08);padding:2px 6px;border-radius:8px}
@media(max-width:720px){.affiliate-link-box{grid-template-columns:1fr}.affiliate-link-box .btn{width:100%}}

/* v30.3 — Public Trust & Contributor Onboarding */
.onboarding-page { padding-bottom: 3.5rem; }
.onboarding-hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr); align-items: center; gap: 1.4rem; }
.onboarding-hero .actions { margin-top: 1.15rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.onboarding-hero-card { border: 1px solid rgba(15,76,92,.13); border-radius: 30px; background: linear-gradient(160deg, rgba(255,255,255,.86), rgba(244,238,223,.92)); box-shadow: 0 24px 55px rgba(15,76,92,.09); padding: 1.35rem; min-height: 190px; display: grid; place-items: center; text-align: center; position: relative; overflow: hidden; }
.onboarding-hero-card::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 180px; height: 180px; border-radius: 50%; background: rgba(15,76,92,.08); }
.onboarding-hero-card strong { font-size: clamp(3rem, 7vw, 5.4rem); line-height: .9; color: var(--primary, #0f4c5c); letter-spacing: -0.05em; position: relative; }
.onboarding-hero-card span { color: var(--ink, #1f2d2f); font-weight: 800; position: relative; }
.onboarding-hero-card small { color: var(--muted, #6b6f66); line-height: 1.6; position: relative; }
.onboarding-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1.35rem 0 2rem; }
.onboarding-card-grid article { border: 1px solid rgba(15,76,92,.1); border-radius: 24px; padding: 1.05rem; background: rgba(255,253,248,.88); box-shadow: 0 14px 34px rgba(15,76,92,.055); min-height: 158px; }
.onboarding-card-grid h2 { font-size: 1.08rem; margin: 0 0 .45rem; color: var(--ink, #1f2d2f); }
.onboarding-card-grid p { margin: 0; color: var(--muted, #667); line-height: 1.75; font-size: .94rem; }
.onboarding-flow-grid article { min-height: 180px; }
.onboarding-info-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.onboarding-info-split article { border: 1px solid rgba(15,76,92,.10); border-radius: 26px; padding: 1.25rem; background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(249,244,233,.92)); }
.onboarding-info-split h2 { margin: 0 0 .55rem; font-size: clamp(1.25rem, 2vw, 1.7rem); }
.onboarding-info-split p { margin: 0; color: var(--muted, #667); line-height: 1.9; }
.onboarding-cta { margin-bottom: 2.5rem; }
.affiliate-landing-page .onboarding-hero-card strong { color: #8a5d1f; }
@media (max-width: 980px) { .onboarding-hero { grid-template-columns: 1fr; } .onboarding-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .onboarding-card-grid, .onboarding-info-split { grid-template-columns: 1fr; } .onboarding-hero-card { min-height: 145px; border-radius: 24px; } .onboarding-card-grid article { min-height: auto; } .onboarding-hero .actions .btn { width: 100%; } }


/* v30.4 Growth landing pages */
.growth-gateway-section{margin-top:28px;padding:28px;border:1px solid rgba(15,76,92,.10);border-radius:28px;background:linear-gradient(135deg,rgba(255,250,240,.92),rgba(245,252,248,.92));box-shadow:0 14px 40px rgba(26,58,53,.06)}
.growth-gateway-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.growth-gateway-card{display:flex;flex-direction:column;gap:8px;min-height:178px;padding:18px;border-radius:22px;background:rgba(255,255,255,.72);border:1px solid rgba(15,76,92,.08)}.growth-gateway-card h3{margin:0;font-size:1.05rem}.growth-gateway-card p{margin:0;color:var(--muted);line-height:1.75}.growth-gateway-card a{margin-top:auto;font-weight:800;color:var(--brand);text-decoration:none}
.landing-page .landing-hero{padding:42px 30px;margin:26px 0;border-radius:34px;background:linear-gradient(135deg,rgba(255,247,232,.96),rgba(239,250,247,.96));border:1px solid rgba(15,76,92,.10);box-shadow:0 18px 50px rgba(26,58,53,.08)}
.landing-page .landing-hero h1{max-width:920px;margin:.2rem 0 .8rem;font-size:clamp(2rem,5vw,4.6rem);line-height:1.08}.landing-page .landing-hero .lead{max-width:760px}.landing-page .landing-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:20px}.landing-page .landing-section{padding:26px 0}.landing-page .landing-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.landing-page .landing-card{display:flex;flex-direction:column;gap:10px;padding:20px;border:1px solid rgba(15,76,92,.09);border-radius:24px;background:rgba(255,255,255,.78);box-shadow:0 10px 30px rgba(26,58,53,.05)}.landing-page .landing-card h2,.landing-page .landing-card h3{margin:0}.landing-page .landing-card p{margin:0;color:var(--muted);line-height:1.8}.landing-page .landing-card a{margin-top:auto}.landing-page .topic-pills{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}.landing-page .topic-pills a,.landing-page .topic-pills span{padding:9px 13px;border-radius:999px;background:#fff;border:1px solid rgba(15,76,92,.10);text-decoration:none;color:var(--brand);font-weight:700}.landing-page .landing-strip{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px;border-radius:26px;background:#0f4c5c;color:white}.landing-page .landing-strip p{color:rgba(255,255,255,.82);margin:.3rem 0 0}.landing-page .landing-strip .btn{background:#fff;color:#0f4c5c;border-color:#fff}.admin-dashboard-lists{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:18px}.admin-mini-list{list-style:none;margin:0;padding:0;display:grid;gap:10px}.admin-mini-list li{padding:10px 12px;border-radius:14px;background:rgba(15,76,92,.045);border:1px solid rgba(15,76,92,.07)}.admin-mini-list strong{display:block}.admin-mini-list small{color:#667;display:block;margin-top:4px}.admin-quick-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}
@media (max-width: 980px){.growth-gateway-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.landing-page .landing-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-dashboard-lists{grid-template-columns:1fr}}
@media (max-width: 620px){.growth-gateway-section{padding:18px;border-radius:22px}.growth-gateway-grid{grid-template-columns:1fr}.growth-gateway-card{min-height:auto}.landing-page .landing-hero{padding:26px 18px;border-radius:26px}.landing-page .landing-grid{grid-template-columns:1fr}.landing-page .landing-strip{align-items:flex-start;flex-direction:column}.landing-page .landing-actions .btn{width:100%;justify-content:center}}


/* v30.4.1 — Landing strip pill label visibility fix */
.landing-page .landing-strip .topic-pills a,
.landing-page .landing-strip .topic-pills span {
  color: #0f4c5c !important;
  background: #fff;
  border-color: rgba(255,255,255,.92);
  text-shadow: none;
  opacity: 1;
}
.landing-page .landing-strip .topic-pills a:hover,
.landing-page .landing-strip .topic-pills a:focus-visible {
  color: #083b47 !important;
  background: #f8fbfa;
  transform: translateY(-1px);
}

/* v30.4.2 — Video detail routing and in-site viewing */
.video-detail-page {
  max-width: min(1080px, calc(100% - 32px));
}
.video-detail-header {
  text-align: center;
  margin-bottom: clamp(22px, 4vw, 34px);
}
.video-detail-player {
  margin: 0 auto clamp(24px, 4vw, 38px);
  max-width: 940px;
}
.video-detail-player .video-frame {
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(15, 76, 92, .14);
}
.video-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-detail-description {
  max-width: 840px;
  margin-inline: auto;
}
.video-detail-actions {
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
.video-card-body h3 a {
  text-decoration: none;
}
@media (max-width: 760px) {
  .video-detail-page { max-width: calc(100% - 20px); }
  .video-detail-player .video-frame { border-radius: 20px; }
  .video-detail-actions .btn { width: 100%; }
}

/* v30.5 — Content Growth & SEO Publishing System */
.topic-clusters-section{position:relative}.topic-cluster-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}.topic-cluster-card{display:flex;flex-direction:column;gap:8px;padding:18px;border:1px solid rgba(15,76,92,.10);border-radius:24px;background:rgba(255,255,255,.82);box-shadow:0 12px 34px rgba(26,58,53,.055);text-decoration:none;color:inherit;min-height:142px}.topic-cluster-card span{font-size:.85rem;color:#a87820;font-weight:800}.topic-cluster-card strong{font-size:1.08rem;color:var(--brand);line-height:1.45}.topic-cluster-card small{margin-top:auto;color:var(--muted);line-height:1.6}.topic-cluster-card:hover{transform:translateY(-2px);box-shadow:0 18px 42px rgba(26,58,53,.08)}.topic-page .topic-hero{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:24px;align-items:stretch;padding:42px;border-radius:34px;background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(247,239,224,.72));border:1px solid rgba(15,76,92,.09);box-shadow:0 18px 48px rgba(26,58,53,.06);margin:28px 0}.topic-page .topic-hero h1{font-size:clamp(2.2rem,5vw,4.2rem);margin:.2rem 0 .8rem}.topic-page .topic-hero .lead{max-width:760px}.topic-stat-card{display:flex;flex-direction:column;justify-content:center;gap:8px;padding:24px;border-radius:28px;background:#0f4c5c;color:#fff}.topic-stat-card strong{font-size:3.4rem;line-height:1}.topic-stat-card span{font-weight:800}.topic-stat-card small{color:rgba(255,255,255,.76);line-height:1.7}.topic-reading-order{margin:30px 0}.topic-content-grid{align-items:stretch}.topic-next-section{padding-bottom:30px}.content-growth-settings{border-top:1px solid rgba(15,76,92,.08);padding-top:18px;margin-top:8px}.content-growth-settings h2{margin-bottom:4px}
@media (max-width:1100px){.topic-cluster-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.topic-page .topic-hero{grid-template-columns:1fr}.topic-stat-card{min-height:180px}}
@media (max-width:720px){.topic-cluster-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.topic-cluster-card{padding:14px;min-height:122px}.topic-page .topic-hero{padding:24px;border-radius:26px}.topic-stat-card{min-height:140px}.topic-stat-card strong{font-size:2.7rem}}


/* V30.5.2: professional Madar logo integration */
.brand-logo { display:inline-flex; align-items:center; gap:10px; min-width:max-content; color:var(--ink); text-decoration:none; }
.brand-logo .brand-mark { width:42px; height:42px; border-radius:14px; box-shadow:0 10px 24px rgba(15,76,92,.12); flex:0 0 auto; }
.brand-logo .brand-copy { display:flex; flex-direction:column; justify-content:center; line-height:1.06; }
.brand-logo .brand-copy > span { font-size:21px; font-weight:900; color:var(--ink); letter-spacing:-.02em; }
html[lang="ar"] .brand-logo .brand-copy > span { letter-spacing:0; }
.brand-logo .brand-copy small { display:block; margin-top:4px; color:var(--muted); font-size:11px; font-weight:800; letter-spacing:0; }
.footer-brand { display:inline-flex; align-items:center; gap:12px; color:inherit; text-decoration:none; margin-bottom:8px; }
.footer-brand-mark { width:46px; height:46px; border-radius:16px; box-shadow:0 12px 28px rgba(15,76,92,.10); flex:0 0 auto; }
.footer-brand span { display:flex; flex-direction:column; line-height:1.08; }
.footer-brand strong { font-size:20px; color:var(--ink); font-weight:900; }
.footer-brand small { margin-top:4px; color:var(--muted); font-size:12px; font-weight:800; }
@media (max-width: 760px){
  .brand-logo .brand-mark { width:38px; height:38px; border-radius:13px; }
  .brand-logo .brand-copy > span { font-size:19px; }
  .brand-logo .brand-copy small { font-size:10px; }
}

/* v30.6 — Hero promo video & homepage conversion */
.hero-promo-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 660px);
  margin: 0 0 clamp(18px, 2.4vw, 28px);
  border: 1px solid rgba(222, 212, 199, .9);
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(255,253,248,.92), rgba(237,242,239,.78));
  box-shadow: 0 24px 70px rgba(32, 26, 18, .08);
  isolation: isolate;
}
.hero-promo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(15,52,56,.36) 100%),
    radial-gradient(circle at 85% 12%, rgba(255,253,248,.22), transparent 22rem);
  z-index: 1;
}
.hero-promo-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #efe7da;
}
.hero-promo-caption {
  position: absolute;
  z-index: 2;
  inset-inline: 20px;
  bottom: 18px;
  display: grid;
  gap: 2px;
  color: #fffdf8;
  text-shadow: 0 2px 18px rgba(0,0,0,.28);
}
.hero-promo-caption span {
  color: rgba(255,253,248,.84);
  font-size: 12px;
  font-weight: 900;
}
.hero-promo-caption strong {
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1.2;
  letter-spacing: -.02em;
}
.hero-promo-caption small {
  max-width: 520px;
  color: rgba(255,253,248,.84);
  font-size: 13px;
  line-height: 1.65;
}
.hero-promo-control {
  position: absolute;
  z-index: 3;
  inset-block-start: 14px;
  inset-inline-end: 14px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,253,248,.52);
  background: rgba(255,253,248,.82);
  color: var(--primary);
  box-shadow: 0 10px 28px rgba(0,0,0,.10);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-weight: 900;
}
.hero-promo-control:hover { background: #fff; transform: translateY(-1px); }
.hero-conversion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.hero-conversion-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(23, 74, 79, .14);
  background: rgba(255,253,248,.66);
  color: var(--primary);
  font-weight: 800;
  font-size: 13px;
}
.hero-conversion-chips a:hover {
  background: #fff;
  border-color: rgba(23,74,79,.28);
  color: var(--primary-strong);
  transform: translateY(-1px);
}
@media (min-width: 981px) {
  .home-polished .hero-copy { align-self: center; }
  html[dir="rtl"] .home-polished .hero-promo-card { margin-inline-start: auto; }
  html[dir="ltr"] .home-polished .hero-promo-card { margin-inline-end: auto; }
}
@media (max-width: 980px) {
  .hero-promo-card { width: 100%; border-radius: 28px; }
  .hero-promo-caption { inset-inline: 16px; bottom: 14px; }
  .hero-promo-caption small { display: none; }
}
@media (max-width: 700px) {
  .hero-promo-card { border-radius: 24px; margin-bottom: 16px; }
  .hero-promo-control { width: 38px; height: 38px; inset-block-start: 10px; inset-inline-end: 10px; }
  .hero-promo-caption strong { font-size: 19px; }
  .hero-conversion-chips { margin-top: 14px; gap: 8px; }
  .hero-conversion-chips a { font-size: 12px; padding-inline: 11px; }
}

/* ==============================
   v30.6.3 — Homepage visual balance polish
   Focus: homepage rhythm, hero balance, section density, and one-video layout.
   ============================== */
.home-polished {
  --home-section-y: clamp(30px, 3.9vw, 54px);
  --home-head-gap: clamp(14px, 1.8vw, 20px);
}
.home-polished .compact-hero.hero {
  min-height: clamp(430px, 55vh, 560px) !important;
  padding-block: clamp(28px, 4.6vw, 54px) clamp(30px, 4.8vw, 56px) !important;
  grid-template-columns: minmax(0, .94fr) minmax(260px, .42fr) !important;
  gap: clamp(22px, 3.4vw, 44px) !important;
  align-items: center !important;
}
.home-polished .hero-copy {
  max-width: 760px !important;
}
.home-polished .hero-promo-card {
  width: min(100%, 610px) !important;
  margin-bottom: clamp(14px, 1.8vw, 20px) !important;
  border-radius: 30px !important;
}
.home-polished .hero h1 {
  font-size: clamp(46px, 5.6vw, 70px) !important;
  line-height: 1.02 !important;
}
.home-polished .hero .lead {
  max-width: 690px !important;
  margin-top: 14px !important;
  font-size: clamp(18px, 1.45vw, 22px) !important;
  line-height: 1.78 !important;
}
.home-polished .actions {
  margin-top: 22px !important;
  gap: 10px !important;
}
.home-polished .actions .btn {
  min-height: 44px !important;
  padding: 9px 19px !important;
}
.home-polished .hero-conversion-chips {
  margin-top: 12px !important;
  gap: 8px !important;
}
.home-polished .hero-panel {
  max-width: 330px !important;
  padding: 12px !important;
  border-radius: 28px !important;
  box-shadow: 0 14px 42px rgba(40,31,18,.055) !important;
}
.home-polished .hero-panel-item {
  min-height: 0 !important;
  padding: 13px 15px !important;
  border-radius: 18px !important;
}
.home-polished .hero-panel-item span {
  margin-bottom: 5px !important;
}
.home-polished .hero-panel-item strong {
  font-size: clamp(16px, 1.15vw, 18px) !important;
  line-height: 1.42 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.home-polished .hero-panel-item small {
  margin-top: 5px !important;
}
.home-polished .calm-principles {
  margin: 0 0 clamp(14px, 2vw, 24px) !important;
  padding-block: 16px !important;
  gap: 12px !important;
}
.home-polished .calm-principles article {
  min-height: 82px !important;
  padding: 16px 18px !important;
  border-radius: 22px !important;
}
.home-polished .calm-principles strong {
  margin-bottom: 5px !important;
}
.home-polished .section,
.home-polished .home-section,
.home-polished .growth-gateway-section,
.home-polished .topic-clusters-section {
  padding-top: var(--home-section-y) !important;
  padding-bottom: var(--home-section-y) !important;
}
.home-polished .growth-gateway-section {
  margin-top: clamp(14px, 2vw, 24px) !important;
  padding-inline: clamp(20px, 3vw, 30px) !important;
}
.home-polished .growth-gateway-card {
  min-height: 154px !important;
  padding: 16px !important;
}
.home-polished .section-head {
  align-items: center !important;
  margin-bottom: var(--home-head-gap) !important;
}
.home-polished .section-head h2 {
  font-size: clamp(34px, 3.9vw, 52px) !important;
  line-height: 1.14 !important;
}
.home-polished .section-head p {
  margin-top: 6px !important;
  line-height: 1.75 !important;
}
.home-polished .section-head > a {
  align-self: center !important;
  margin-top: 0 !important;
}
.home-polished .topic-cluster-grid,
.home-polished .growth-gateway-grid,
.home-polished .home-cards {
  margin-top: 0 !important;
}
.home-polished .topic-cluster-card {
  min-height: 126px !important;
  padding: 16px !important;
}
.home-polished .home-section.count-1 .videos-grid {
  grid-template-columns: minmax(0, min(100%, 620px)) !important;
  justify-content: center !important;
}
.home-polished .home-section.count-1 .videos-grid .video-card {
  max-width: 620px !important;
  margin-inline: auto !important;
}
.home-polished .home-section.count-1 .videos-grid .video-card h3 {
  font-size: clamp(20px, 1.8vw, 25px) !important;
}
.home-polished .calm-newsletter.newsletter {
  margin-top: clamp(28px, 3.6vw, 44px) !important;
  margin-bottom: clamp(34px, 4.2vw, 52px) !important;
}
@media (min-width: 981px) {
  html[dir="rtl"] .home-polished .hero-promo-card {
    margin-inline-start: auto !important;
    margin-inline-end: 0 !important;
  }
  html[dir="ltr"] .home-polished .hero-promo-card {
    margin-inline-end: auto !important;
    margin-inline-start: 0 !important;
  }
}
@media (max-width: 980px) {
  .home-polished .compact-hero.hero {
    grid-template-columns: 1fr !important;
    padding-top: 34px !important;
  }
  .home-polished .hero-panel {
    max-width: 100% !important;
  }
  .home-polished .section-head {
    align-items: flex-start !important;
  }
  .home-polished .section-head > a {
    align-self: flex-start !important;
  }
  .home-polished .growth-gateway-card {
    min-height: 132px !important;
  }
}
@media (max-width: 700px) {
  .home-polished {
    --home-section-y: 30px;
    --home-head-gap: 14px;
  }
  .home-polished .hero-promo-card {
    border-radius: 22px !important;
  }
  .home-polished .hero h1 {
    font-size: clamp(40px, 13vw, 52px) !important;
  }
  .home-polished .hero .lead {
    font-size: 16.5px !important;
    line-height: 1.8 !important;
  }
  .home-polished .calm-principles {
    padding-block: 12px !important;
  }
  .home-polished .calm-principles article {
    min-height: 0 !important;
    padding: 14px 16px !important;
  }
  .home-polished .section-head h2 {
    font-size: clamp(30px, 9vw, 40px) !important;
  }
  .home-polished .growth-gateway-section {
    padding: 18px !important;
  }
}

/* ==============================
   v30.6.4 — Premium homepage composition
   Goal: restore a strong editorial landing page, keep Madar's calm theme, and improve hero hierarchy.
   ============================== */
.home-premium {
  --home-section-y: clamp(54px, 6.2vw, 88px);
  --home-head-gap: clamp(22px, 2.5vw, 32px);
}
.home-premium .premium-home-hero {
  position: relative;
  min-height: auto !important;
  padding-block: clamp(70px, 8vw, 108px) clamp(58px, 7vw, 90px) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, .88fr) !important;
  gap: clamp(42px, 6vw, 86px) !important;
  align-items: center !important;
  border-bottom: 0 !important;
}
.home-premium .premium-home-hero::before {
  content: "";
  position: absolute;
  inset: 18px -24px 0;
  z-index: -1;
  border-radius: 44px;
  background:
    radial-gradient(circle at 15% 10%, rgba(156,106,59,.13), transparent 32%),
    radial-gradient(circle at 82% 18%, rgba(23,74,79,.14), transparent 34%),
    linear-gradient(135deg, rgba(255,253,248,.66), rgba(237,242,239,.42));
  border: 1px solid rgba(222,212,199,.58);
  box-shadow: 0 28px 90px rgba(32,26,18,.055);
}
.home-premium .premium-home-copy {
  max-width: 740px !important;
  align-self: center;
}
.home-premium .premium-home-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 14px;
  margin-bottom: 18px;
  border: 1px solid rgba(156,106,59,.22);
  border-radius: 999px;
  background: rgba(255,253,248,.72);
  color: var(--accent);
  box-shadow: 0 10px 32px rgba(32,26,18,.035);
}
.home-premium .premium-home-copy h1 {
  font-size: clamp(72px, 9.2vw, 122px) !important;
  line-height: .92 !important;
  letter-spacing: -.045em !important;
  margin: 0 !important;
  text-wrap: balance;
}
html[lang="ar"] .home-premium .premium-home-copy h1 {
  letter-spacing: -.014em !important;
}
.home-premium .premium-home-copy .lead {
  max-width: 700px !important;
  margin-top: 24px !important;
  color: #5e554b !important;
  font-size: clamp(21px, 1.55vw, 26px) !important;
  line-height: 1.95 !important;
  text-wrap: pretty;
}
.home-premium .premium-hero-actions {
  margin-top: 30px !important;
  gap: 12px !important;
}
.home-premium .premium-hero-actions .btn {
  min-height: 50px !important;
  padding: 11px 24px !important;
  font-weight: 800;
}
.home-premium .hero-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}
.home-premium .hero-trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid rgba(222,212,199,.78);
  border-radius: 999px;
  background: rgba(255,253,248,.62);
  color: #6d6258;
  font-size: 13px;
  font-weight: 700;
}
.home-premium .hero-trust-row span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
  opacity: .72;
}
.home-premium .hero-conversion-chips {
  margin-top: 16px !important;
  gap: 9px !important;
}
.home-premium .hero-conversion-chips a {
  background: rgba(255,253,248,.52) !important;
  border-color: rgba(23,74,79,.14) !important;
  color: var(--primary) !important;
}
.home-premium .premium-hero-visual {
  position: relative;
  display: grid;
  justify-items: stretch;
  align-self: center;
}
.home-premium .hero-promo-card {
  width: 100% !important;
  max-width: 680px !important;
  margin: 0 !important;
  aspect-ratio: 16 / 9;
  border-radius: 36px !important;
  overflow: hidden;
  border: 1px solid rgba(255,253,248,.86) !important;
  background: #e9dfcf;
  box-shadow: 0 34px 90px rgba(32,26,18,.16), 0 1px 0 rgba(255,255,255,.82) inset !important;
}
.home-premium .hero-promo-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(17,14,10,.04), rgba(17,14,10,.22)),
    radial-gradient(circle at 74% 18%, rgba(255,253,248,.38), transparent 30%);
}
.home-premium .hero-promo-card::after {
  content: "";
  position: absolute;
  z-index: 3;
  pointer-events: none;
  inset: 37% 15% 36%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,253,248,.34), rgba(255,253,248,.16));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,253,248,.18);
  opacity: .72;
}
.home-premium .hero-promo-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.035);
  filter: saturate(.88) contrast(.96) brightness(.92);
}
.home-premium .hero-promo-control {
  z-index: 5;
  inset-block-start: 18px;
  inset-inline-end: 18px;
  width: 44px;
  height: 44px;
  box-shadow: 0 14px 36px rgba(32,26,18,.16);
}
.home-premium .premium-hero-panel {
  position: relative;
  z-index: 4;
  width: min(92%, 560px) !important;
  max-width: none !important;
  justify-self: center;
  margin-top: -44px;
  padding: 14px !important;
  border-radius: 30px !important;
  background: rgba(255,253,248,.88) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: rgba(222,212,199,.76) !important;
  box-shadow: 0 26px 70px rgba(32,26,18,.105) !important;
}
.home-premium .hero-panel-heading {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  padding: 2px 6px 10px;
}
.home-premium .premium-hero-panel .hero-panel-list {
  gap: 9px !important;
}
.home-premium .premium-hero-panel .hero-panel-item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  padding: 13px 14px !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.68) !important;
}
.home-premium .premium-hero-panel .hero-panel-item::before {
  content: "";
  grid-row: 1 / span 2;
  width: 9px;
  height: 9px;
  margin-top: 8px;
  border-radius: 99px;
  background: var(--primary);
  opacity: .72;
}
.home-premium .premium-hero-panel .hero-panel-item span,
.home-premium .premium-hero-panel .hero-panel-item strong,
.home-premium .premium-hero-panel .hero-panel-item small {
  grid-column: 2;
}
.home-premium .premium-hero-panel .hero-panel-item strong {
  font-size: clamp(16px, 1.15vw, 19px) !important;
  line-height: 1.45 !important;
  -webkit-line-clamp: 2 !important;
}
.home-premium .premium-principles {
  position: relative;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px !important;
  margin: 0 0 clamp(34px, 4vw, 54px) !important;
  padding: 0 !important;
  border: 0 !important;
}
.home-premium .premium-principles article {
  min-height: 112px !important;
  padding: 22px 24px !important;
  border-radius: 26px !important;
  background: linear-gradient(180deg, rgba(255,253,248,.92), rgba(251,247,239,.72)) !important;
  border: 1px solid rgba(222,212,199,.76) !important;
  box-shadow: 0 18px 54px rgba(32,26,18,.055);
}
.home-premium .premium-principles strong {
  color: var(--primary-strong);
  font-size: 20px;
}
.home-premium .premium-principles span {
  color: #6b6258;
  line-height: 1.8;
}
.home-premium .growth-gateway-section,
.home-premium .topic-clusters-section,
.home-premium .home-section {
  padding-top: var(--home-section-y) !important;
  padding-bottom: var(--home-section-y) !important;
}
.home-premium .growth-gateway-section {
  margin-top: 0 !important;
  padding-inline: clamp(26px, 4vw, 46px) !important;
  border-radius: 34px !important;
  background:
    radial-gradient(circle at 15% 16%, rgba(23,74,79,.08), transparent 28%),
    linear-gradient(135deg, rgba(255,253,248,.72), rgba(237,242,239,.58)) !important;
  border: 1px solid rgba(222,212,199,.72) !important;
  box-shadow: 0 22px 70px rgba(32,26,18,.055);
}
.home-premium .section-head {
  align-items: flex-end !important;
  margin-bottom: var(--home-head-gap) !important;
}
.home-premium .section-head h2 {
  max-width: 980px;
  font-size: clamp(42px, 5.2vw, 78px) !important;
  line-height: 1.06 !important;
  letter-spacing: -.04em !important;
  text-wrap: balance;
}
html[lang="ar"] .home-premium .section-head h2 {
  letter-spacing: -.012em !important;
}
.home-premium .section-head p {
  max-width: 760px !important;
  margin-top: 10px !important;
  color: #6a6056 !important;
  font-size: clamp(17px, 1.3vw, 20px) !important;
  line-height: 1.9 !important;
}
.home-premium .section-head > a {
  align-self: center !important;
  border: 1px solid rgba(222,212,199,.85);
  background: rgba(255,253,248,.64);
}
.home-premium .growth-gateway-grid,
.home-premium .topic-cluster-grid {
  gap: 18px !important;
}
.home-premium .growth-gateway-card,
.home-premium .topic-cluster-card {
  min-height: 178px !important;
  padding: 24px !important;
  border-radius: 26px !important;
  background: rgba(255,253,248,.82) !important;
  box-shadow: 0 18px 54px rgba(32,26,18,.052);
}
.home-premium .growth-gateway-card h3,
.home-premium .topic-cluster-card strong {
  color: var(--ink);
  line-height: 1.3;
}
.home-premium .home-cards.items-count-1,
.home-premium .home-cards.items-count-2,
.home-premium .home-cards.items-count-3,
.home-premium .home-cards.items-count-4 {
  gap: 24px !important;
}
.home-premium .book-card,
.home-premium .article-card,
.home-premium .video-card {
  border-radius: 30px !important;
  box-shadow: 0 22px 70px rgba(32,26,18,.065) !important;
}
.home-premium .book-card:hover,
.home-premium .article-card:hover,
.home-premium .video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 86px rgba(32,26,18,.09) !important;
}
.home-premium .book-card-cover,
.home-premium .article-thumb,
.home-premium .video-card-player {
  border-radius: 24px !important;
  overflow: hidden;
}
.home-premium .home-section.count-1 .videos-grid {
  grid-template-columns: minmax(0, min(100%, 720px)) !important;
  justify-content: center !important;
}
.home-premium .home-section.count-1 .videos-grid .video-card {
  max-width: 720px !important;
}
.home-premium .calm-newsletter.newsletter {
  margin-block: clamp(42px, 5vw, 68px) clamp(54px, 6vw, 78px) !important;
  border-radius: 34px !important;
  background: linear-gradient(135deg, rgba(255,253,248,.88), rgba(237,242,239,.58)) !important;
  box-shadow: 0 24px 80px rgba(32,26,18,.06);
}
@media (max-width: 1100px) {
  .home-premium .premium-home-hero {
    grid-template-columns: 1fr !important;
    padding-block: 52px 62px !important;
  }
  .home-premium .premium-home-copy {
    max-width: 820px !important;
  }
  .home-premium .premium-hero-visual {
    max-width: 760px;
    width: 100%;
    justify-self: center;
  }
}
@media (max-width: 860px) {
  .home-premium .premium-home-hero::before {
    inset-inline: -16px;
    border-radius: 32px;
  }
  .home-premium .premium-home-copy h1 {
    font-size: clamp(56px, 16vw, 78px) !important;
  }
  .home-premium .premium-home-copy .lead {
    font-size: 18px !important;
    line-height: 1.9 !important;
  }
  .home-premium .premium-principles,
  .home-premium .growth-gateway-grid,
  .home-premium .topic-cluster-grid {
    grid-template-columns: 1fr !important;
  }
  .home-premium .premium-hero-panel {
    width: calc(100% - 22px) !important;
    margin-top: -28px;
  }
  .home-premium .section-head {
    align-items: flex-start !important;
    gap: 14px !important;
  }
  .home-premium .section-head h2 {
    font-size: clamp(34px, 10vw, 48px) !important;
  }
}
@media (max-width: 620px) {
  .home-premium {
    --home-section-y: 38px;
  }
  .home-premium .premium-home-hero {
    padding-block: 34px 46px !important;
    gap: 28px !important;
  }
  .home-premium .premium-home-hero::before {
    inset: 8px -12px 0;
    border-radius: 28px;
  }
  .home-premium .premium-home-copy .eyebrow {
    font-size: 11px;
    padding: 7px 11px;
  }
  .home-premium .premium-home-copy h1 {
    font-size: clamp(48px, 18vw, 64px) !important;
  }
  .home-premium .premium-hero-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }
  .home-premium .premium-hero-actions .btn {
    width: 100% !important;
  }
  .home-premium .hero-trust-row span,
  .home-premium .hero-conversion-chips a {
    font-size: 12px !important;
  }
  .home-premium .hero-promo-card {
    border-radius: 24px !important;
  }
  .home-premium .hero-promo-card::after {
    inset: 35% 12% 35%;
  }
  .home-premium .premium-principles article,
  .home-premium .growth-gateway-card,
  .home-premium .topic-cluster-card {
    border-radius: 22px !important;
    padding: 18px !important;
  }
  .home-premium .section-head h2 {
    font-size: clamp(32px, 11vw, 42px) !important;
  }
}


/* ==============================
   v30.6.6 — Premium homepage video restored polish
   Keeps the real Hero video, fixes the visual balance, and reduces oversized sections.
   ============================== */
.home-premium {
  --home-section-y: clamp(40px, 5vw, 72px) !important;
  --home-head-gap: clamp(16px, 2vw, 26px) !important;
}
.home-premium .premium-home-hero {
  padding-block: clamp(46px, 5.6vw, 74px) clamp(34px, 4.5vw, 58px) !important;
  grid-template-columns: minmax(0, .96fr) minmax(420px, .92fr) !important;
  gap: clamp(28px, 4.5vw, 64px) !important;
  align-items: center !important;
}
.home-premium .premium-home-hero::before {
  inset: 10px -18px 0 !important;
  border-radius: 40px !important;
  background:
    radial-gradient(circle at 13% 12%, rgba(156,106,59,.10), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(23,74,79,.11), transparent 32%),
    linear-gradient(135deg, rgba(255,253,248,.74), rgba(238,243,240,.42)) !important;
  box-shadow: 0 22px 70px rgba(32,26,18,.045) !important;
}
.home-premium .premium-home-copy { max-width: 660px !important; }
.home-premium .premium-home-copy .eyebrow {
  padding: 7px 13px !important;
  margin-bottom: 14px !important;
  font-size: 12px !important;
}
.home-premium .premium-home-copy h1 {
  font-size: clamp(62px, 7.2vw, 104px) !important;
  line-height: .96 !important;
  letter-spacing: -.035em !important;
}
html[lang="ar"] .home-premium .premium-home-copy h1 { letter-spacing: -.008em !important; }
.home-premium .premium-home-copy .lead {
  max-width: 620px !important;
  margin-top: 18px !important;
  font-size: clamp(19px, 1.35vw, 23px) !important;
  line-height: 1.86 !important;
}
.home-premium .premium-hero-actions { margin-top: 22px !important; }
.home-premium .premium-hero-actions .btn {
  min-height: 48px !important;
  padding: 10px 22px !important;
}
.home-premium .hero-trust-row { margin-top: 14px !important; }
.home-premium .hero-conversion-chips { margin-top: 12px !important; }
.home-premium .premium-hero-visual {
  max-width: 640px !important;
  width: 100% !important;
  justify-self: stretch !important;
}
.home-premium .hero-promo-card {
  width: 100% !important;
  max-width: 640px !important;
  aspect-ratio: 16 / 9 !important;
  border-radius: 32px !important;
  box-shadow: 0 26px 76px rgba(32,26,18,.12), 0 1px 0 rgba(255,255,255,.86) inset !important;
}
.home-premium .hero-promo-card::before {
  background:
    linear-gradient(180deg, rgba(17,14,10,.02), rgba(17,14,10,.16)),
    radial-gradient(circle at 74% 15%, rgba(255,253,248,.30), transparent 30%) !important;
}
.home-premium .hero-promo-card::after { opacity: 0 !important; }
.home-premium .hero-promo-video {
  transform: scale(1.02) !important;
  filter: saturate(.94) contrast(.98) brightness(.96) !important;
}
.home-premium .hero-promo-control {
  inset-block-start: 16px !important;
  inset-inline-start: 16px !important;
  inset-inline-end: auto !important;
  width: 42px !important;
  height: 42px !important;
}
.home-premium .premium-hero-panel {
  width: min(94%, 560px) !important;
  margin-top: -24px !important;
  padding: 12px !important;
  border-radius: 26px !important;
  box-shadow: 0 20px 58px rgba(32,26,18,.08) !important;
}
.home-premium .premium-hero-panel .hero-panel-item {
  padding: 11px 13px !important;
  border-radius: 16px !important;
}
.home-premium .premium-hero-panel .hero-panel-item strong {
  font-size: clamp(15px, 1.05vw, 18px) !important;
  line-height: 1.42 !important;
}
.home-premium .premium-principles {
  margin: 0 0 clamp(24px, 3vw, 42px) !important;
  gap: 12px !important;
}
.home-premium .premium-principles article {
  min-height: 96px !important;
  padding: 18px 22px !important;
  border-radius: 24px !important;
}
.home-premium .premium-principles strong { font-size: 18px !important; }
.home-premium .premium-principles span { font-size: 15px !important; line-height: 1.72 !important; }
.home-premium .growth-gateway-section {
  margin-top: clamp(16px, 2.6vw, 30px) !important;
  padding: clamp(36px, 4.6vw, 58px) clamp(22px, 3.6vw, 40px) !important;
  border-radius: 32px !important;
}
.home-premium .growth-gateway-section,
.home-premium .topic-clusters-section,
.home-premium .home-section {
  padding-top: var(--home-section-y) !important;
  padding-bottom: var(--home-section-y) !important;
}
.home-premium .section-head {
  align-items: center !important;
  gap: 18px !important;
  margin-bottom: var(--home-head-gap) !important;
}
.home-premium .section-head h2 {
  max-width: 880px !important;
  font-size: clamp(34px, 3.8vw, 58px) !important;
  line-height: 1.13 !important;
  letter-spacing: -.026em !important;
}
html[lang="ar"] .home-premium .section-head h2 {
  letter-spacing: -.004em !important;
  line-height: 1.18 !important;
}
.home-premium .growth-gateway-section .section-head h2,
.home-premium .topic-clusters-section .section-head h2 {
  max-width: 920px !important;
  font-size: clamp(35px, 4vw, 60px) !important;
}
.home-premium .section-head p {
  max-width: 720px !important;
  margin-top: 8px !important;
  font-size: clamp(16px, 1.16vw, 19px) !important;
  line-height: 1.82 !important;
}
.home-premium .section-head > a {
  align-self: center !important;
  padding: 10px 17px !important;
  font-size: 14px !important;
}
.home-premium .growth-gateway-grid,
.home-premium .topic-cluster-grid { gap: 16px !important; }
.home-premium .growth-gateway-card,
.home-premium .topic-cluster-card {
  min-height: 150px !important;
  padding: 21px !important;
  border-radius: 24px !important;
}
.home-premium .topic-cluster-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)) !important;
}
.home-premium .home-section .section-head,
.home-premium .home-section .home-cards,
.home-premium .home-section > .empty-state { width: min(100%, 1160px) !important; }
.home-premium .book-card,
.home-premium .article-card,
.home-premium .video-card { border-radius: 28px !important; }
@media (min-width: 1180px) {
  .home-premium .premium-home-hero { grid-template-columns: minmax(0, .98fr) minmax(420px, .84fr) !important; }
}
@media (max-width: 1100px) {
  .home-premium .premium-home-hero {
    grid-template-columns: 1fr !important;
    padding-block: 38px 48px !important;
  }
  .home-premium .premium-hero-visual { max-width: 720px !important; justify-self: center !important; }
  .home-premium .premium-home-copy { max-width: 800px !important; }
}
@media (max-width: 860px) {
  .home-premium .premium-home-copy h1 { font-size: clamp(52px, 15vw, 76px) !important; }
  .home-premium .section-head { align-items: flex-start !important; flex-direction: column !important; }
  .home-premium .section-head h2,
  .home-premium .growth-gateway-section .section-head h2,
  .home-premium .topic-clusters-section .section-head h2 { font-size: clamp(31px, 8.6vw, 46px) !important; }
}
@media (max-width: 620px) {
  .home-premium { --home-section-y: 34px !important; }
  .home-premium .premium-home-hero { padding-block: 28px 38px !important; }
  .home-premium .premium-home-copy h1 { font-size: clamp(46px, 17vw, 62px) !important; }
  .home-premium .premium-home-copy .lead { font-size: 17px !important; }
  .home-premium .premium-principles { grid-template-columns: 1fr !important; }
}

/* ==============================
   v30.6.7 — Homepage hero separation polish
   Keeps the Hero video visible, separates "From Madar" from the video, and moves the main copy upward.
   ============================== */
.home-premium {
  --home-section-y: clamp(38px, 4.6vw, 66px) !important;
  --home-head-gap: clamp(15px, 1.8vw, 24px) !important;
}
.home-premium .premium-home-hero {
  padding-block: clamp(32px, 4.4vw, 56px) clamp(22px, 3.2vw, 38px) !important;
  align-items: start !important;
  gap: clamp(30px, 4.3vw, 58px) !important;
}
.home-premium .premium-home-hero::before {
  inset: 8px -18px 0 !important;
}
.home-premium .premium-home-copy {
  padding-top: clamp(8px, 1.45vw, 22px) !important;
  align-self: start !important;
}
.home-premium .premium-home-copy .eyebrow {
  margin-bottom: 12px !important;
}
.home-premium .premium-home-copy h1 {
  font-size: clamp(60px, 6.8vw, 98px) !important;
}
.home-premium .premium-home-copy .lead {
  margin-top: 16px !important;
  max-width: 650px !important;
}
.home-premium .premium-hero-actions {
  margin-top: 20px !important;
}
.home-premium .hero-trust-row {
  margin-top: 13px !important;
}
.home-premium .hero-conversion-chips {
  margin-top: 11px !important;
}
.home-premium .premium-hero-visual {
  align-self: start !important;
  padding-top: 0 !important;
}
.home-premium .hero-promo-card {
  max-width: 620px !important;
  border-radius: 30px !important;
}
.home-premium .hero-picks-section {
  position: relative;
  margin: clamp(18px, 2.4vw, 32px) 0 clamp(22px, 3.2vw, 44px) !important;
  padding: 0 !important;
}
.home-premium .hero-picks-section .hero-picks-panel {
  position: relative !important;
  z-index: 1 !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  justify-self: stretch !important;
  padding: clamp(14px, 1.8vw, 20px) !important;
  border-radius: 30px !important;
  background: linear-gradient(180deg, rgba(255,253,248,.88), rgba(250,246,238,.76)) !important;
  border: 1px solid rgba(222,212,199,.78) !important;
  box-shadow: 0 18px 56px rgba(32,26,18,.055) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.home-premium .hero-picks-section .hero-panel-heading {
  padding: 2px 8px 12px !important;
  color: var(--accent) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}
.home-premium .hero-picks-section .hero-panel-list {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
}
.home-premium .hero-picks-section .hero-panel-item {
  min-height: 112px !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  grid-template-rows: auto auto auto !important;
  align-content: center !important;
  column-gap: 10px !important;
  padding: 16px 18px !important;
  border-radius: 20px !important;
  background: rgba(255,255,255,.72) !important;
}
.home-premium .hero-picks-section .hero-panel-item::before {
  content: "";
  grid-row: 1 / span 3;
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: 99px;
  background: var(--primary);
  opacity: .68;
}
.home-premium .hero-picks-section .hero-panel-item span,
.home-premium .hero-picks-section .hero-panel-item strong,
.home-premium .hero-picks-section .hero-panel-item small {
  grid-column: 2 !important;
}
.home-premium .hero-picks-section .hero-panel-item strong {
  font-size: clamp(16px, 1.12vw, 19px) !important;
  line-height: 1.42 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.home-premium .premium-principles {
  margin-top: 0 !important;
}
@media (min-width: 1180px) {
  .home-premium .premium-home-hero {
    grid-template-columns: minmax(0, .96fr) minmax(430px, .86fr) !important;
  }
}
@media (max-width: 1100px) {
  .home-premium .premium-home-hero {
    padding-block: 34px 38px !important;
  }
  .home-premium .premium-home-copy {
    padding-top: 0 !important;
  }
  .home-premium .hero-picks-section .hero-panel-list {
    grid-template-columns: 1fr !important;
  }
  .home-premium .hero-picks-section .hero-panel-item {
    min-height: 0 !important;
  }
}
@media (max-width: 620px) {
  .home-premium .premium-home-hero {
    padding-block: 24px 30px !important;
  }
  .home-premium .hero-picks-section {
    margin-block: 16px 26px !important;
  }
  .home-premium .hero-picks-section .hero-picks-panel {
    border-radius: 24px !important;
  }
  .home-premium .hero-picks-section .hero-panel-item {
    padding: 14px 15px !important;
    border-radius: 18px !important;
  }
}

/* ==============================
   v30.6.9 — Hero final spacing polish
   Small polish only: keeps the full Hero video, improves first-screen balance, and preserves the premium calm theme.
   ============================== */
.home-premium {
  --home-section-y: clamp(36px, 4.3vw, 62px) !important;
  --home-head-gap: clamp(14px, 1.7vw, 22px) !important;
}
.home-premium .premium-home-hero {
  padding-block: clamp(24px, 3.65vw, 46px) clamp(18px, 2.75vw, 32px) !important;
  grid-template-columns: minmax(0, 1fr) minmax(380px, .78fr) !important;
  gap: clamp(24px, 3.5vw, 48px) !important;
  align-items: center !important;
}
.home-premium .premium-home-hero::before {
  inset: 6px -12px 0 !important;
  border-radius: 34px !important;
  background:
    radial-gradient(circle at 16% 12%, rgba(156,106,59,.075), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(23,74,79,.095), transparent 32%),
    linear-gradient(135deg, rgba(255,253,248,.78), rgba(238,243,240,.38)) !important;
  box-shadow: 0 18px 58px rgba(32,26,18,.04) !important;
}
.home-premium .premium-home-copy {
  padding-top: clamp(0px, .7vw, 10px) !important;
  max-width: 660px !important;
}
.home-premium .premium-home-copy .eyebrow {
  margin-bottom: 10px !important;
  padding: 7px 12px !important;
}
.home-premium .premium-home-copy h1 {
  font-size: clamp(56px, 6.25vw, 88px) !important;
  line-height: .98 !important;
}
.home-premium .premium-home-copy .lead {
  max-width: 620px !important;
  margin-top: 13px !important;
  font-size: clamp(18px, 1.28vw, 22px) !important;
  line-height: 1.76 !important;
}
.home-premium .premium-hero-actions {
  margin-top: 18px !important;
  gap: 9px !important;
}
.home-premium .premium-hero-actions .btn {
  min-height: 46px !important;
  padding: 9px 21px !important;
}
.home-premium .hero-trust-row {
  margin-top: 12px !important;
  gap: 8px !important;
}
.home-premium .hero-trust-row span {
  padding: 7px 12px !important;
}
.home-premium .hero-conversion-chips {
  margin-top: 10px !important;
  gap: 8px !important;
}
.home-premium .hero-conversion-chips a {
  min-height: 34px !important;
  padding: 6px 12px !important;
}
.home-premium .premium-hero-visual {
  max-width: 590px !important;
  width: 100% !important;
  justify-self: start !important;
  align-self: center !important;
}
html[dir="ltr"] .home-premium .premium-hero-visual { justify-self: end !important; }
.home-premium .hero-promo-card {
  max-width: 590px !important;
  border-radius: 28px !important;
  box-shadow: 0 22px 64px rgba(32,26,18,.105), 0 1px 0 rgba(255,255,255,.86) inset !important;
}
.home-premium .hero-promo-card::before {
  background:
    linear-gradient(180deg, rgba(17,14,10,.015), rgba(17,14,10,.13)),
    radial-gradient(circle at 74% 15%, rgba(255,253,248,.24), transparent 30%) !important;
}
.home-premium .hero-promo-video {
  transform: scale(1.008) !important;
}
.home-premium .hero-promo-control {
  inset-block-start: 14px !important;
  inset-inline-start: 14px !important;
  width: 40px !important;
  height: 40px !important;
}
.home-premium .hero-picks-section {
  margin: clamp(14px, 1.9vw, 24px) 0 clamp(18px, 2.5vw, 34px) !important;
}
.home-premium .hero-picks-section .hero-picks-panel {
  padding: clamp(12px, 1.55vw, 18px) !important;
  border-radius: 26px !important;
}
.home-premium .hero-picks-section .hero-panel-item {
  min-height: 98px !important;
  padding: 14px 16px !important;
}
.home-premium .premium-principles {
  margin-bottom: clamp(18px, 2.7vw, 34px) !important;
}
@media (min-width: 1180px) {
  .home-premium .premium-home-hero {
    grid-template-columns: minmax(0, 1fr) minmax(390px, .76fr) !important;
  }
}
@media (max-width: 1100px) {
  .home-premium .premium-home-hero {
    grid-template-columns: 1fr !important;
    padding-block: 30px 34px !important;
  }
  .home-premium .premium-hero-visual,
  html[dir="ltr"] .home-premium .premium-hero-visual {
    max-width: 680px !important;
    justify-self: center !important;
  }
}
@media (max-width: 620px) {
  .home-premium { --home-section-y: 32px !important; }
  .home-premium .premium-home-hero {
    padding-block: 22px 28px !important;
    gap: 24px !important;
  }
  .home-premium .premium-home-copy h1 {
    font-size: clamp(44px, 16vw, 58px) !important;
  }
  .home-premium .premium-home-copy .lead {
    font-size: 16.5px !important;
    line-height: 1.78 !important;
  }
  .home-premium .hero-picks-section {
    margin-block: 14px 22px !important;
  }
}

/* v30.6.10: show article authors clearly on article cards */
.article-card-author {
  margin: -4px 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.featured-article-author {
  margin: -6px 0 14px;
  font-size: 14px;
  color: var(--muted);
}
.article-card-author a,
.featured-article-author a {
  color: var(--primary);
  font-weight: 800;
}
html[dir="rtl"] .article-card-author,
html[dir="rtl"] .featured-article-author {
  letter-spacing: 0;
}

/* v30.6.14 — Madar contests and community growth */
.contests-hero,.contest-detail-hero{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(260px,.65fr);gap:clamp(18px,3vw,34px);align-items:stretch;margin-block:24px 30px;padding:clamp(24px,4vw,42px);border:1px solid rgba(15,76,92,.12);border-radius:32px;background:linear-gradient(135deg,#fffdf7,#eef8f4);box-shadow:0 22px 60px rgba(15,76,92,.08)}
.contest-auth-note,.contest-participation-card{border:1px solid rgba(15,76,92,.14);border-radius:24px;background:#fff;padding:22px;box-shadow:0 12px 34px rgba(15,76,92,.08);display:flex;flex-direction:column;gap:10px;justify-content:center}
.contest-auth-note strong,.contest-participation-card strong{font-size:1.1rem;color:var(--primary)}
.contest-grid,.contest-submissions-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:18px}
.contest-card,.contest-entry-card{border:1px solid rgba(15,76,92,.12);border-radius:24px;background:#fff;box-shadow:0 14px 40px rgba(15,76,92,.07);overflow:hidden}
.contest-card-media{min-height:150px;background:linear-gradient(135deg,#0f4c5c,#f2d38b);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800}
.contest-card-media img{width:100%;height:190px;object-fit:cover;display:block}
.contest-card-copy,.contest-entry-card{padding:20px}
.contest-card h2,.contest-entry-card h3{margin:.25rem 0 .65rem;line-height:1.35}
.contest-card p,.contest-entry-card p{color:var(--muted);line-height:1.75}
.contest-dates,.contest-meta-row span{display:inline-flex;border:1px solid rgba(15,76,92,.12);border-radius:999px;padding:6px 10px;background:#fbfaf6;color:var(--muted);font-size:.88rem;margin-top:6px}
.contest-meta-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.contests-values{margin-block:18px 28px}.contest-info-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:18px;margin:22px 0 32px;align-items:start}.contest-info-grid article{border:1px solid rgba(15,76,92,.12);border-radius:24px;background:#fff;padding:22px;box-shadow:0 12px 36px rgba(15,76,92,.06)}.contest-info-grid li{margin:.45rem 0;line-height:1.7}.contest-submit-section{background:#fff;border:1px solid rgba(15,76,92,.12);border-radius:28px;padding:clamp(18px,3vw,28px);box-shadow:0 14px 40px rgba(15,76,92,.06)}
.contest-submission-form{background:#fbfaf7;border:1px solid rgba(15,76,92,.12);border-radius:24px;padding:20px}.contest-login-note{border:1px solid rgba(15,76,92,.12);border-radius:18px;background:#f9fbf9;padding:16px}.contest-entry-card details{margin-top:12px}.contest-entry-card summary{cursor:pointer;font-weight:800;color:var(--primary)}.contest-entry-content{margin-top:12px;border-top:1px solid rgba(15,76,92,.12);padding-top:12px;max-height:520px;overflow:auto}.contest-vote-status{min-height:1.2em}.contest-profile-card{display:grid;gap:10px}
@media(max-width:860px){.contests-hero,.contest-detail-hero{grid-template-columns:1fr;border-radius:24px;padding:22px}.contest-card-media img{height:170px}}


.contest-entry-head{display:flex;gap:14px;align-items:flex-start;justify-content:space-between}.contest-vote-count{min-width:92px;border:1px solid rgba(15,76,92,.14);border-radius:16px;background:#f7faf8;padding:10px 12px;text-align:center;color:var(--primary);box-shadow:0 8px 24px rgba(15,76,92,.06)}.contest-vote-count strong{display:block;font-size:1.35rem;line-height:1}.contest-vote-count span{display:block;font-size:.78rem;color:var(--muted);margin-top:4px}.contest-results-section{background:linear-gradient(135deg,rgba(15,76,92,.06),rgba(242,211,139,.12));border:1px solid rgba(15,76,92,.1);border-radius:28px;padding:22px}.contest-results-list{display:grid;gap:14px}.contest-result-card{display:grid;grid-template-columns:auto 1fr auto;gap:16px;align-items:center;border:1px solid rgba(15,76,92,.1);background:#fff;border-radius:22px;padding:16px 18px;box-shadow:0 12px 34px rgba(15,76,92,.07)}.contest-result-card.rank-1{background:linear-gradient(135deg,#fff8e4,#ffffff);border-color:rgba(194,137,38,.35);box-shadow:0 18px 48px rgba(194,137,38,.18)}.contest-result-card.rank-2,.contest-result-card.rank-3{background:linear-gradient(135deg,#f4fbfa,#ffffff);border-color:rgba(15,76,92,.22)}.contest-rank-badge{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:#eef6f3;color:var(--primary);font-weight:900}.rank-1 .contest-rank-badge{background:#d8a33a;color:#fff}.rank-2 .contest-rank-badge{background:#8aa0a8;color:#fff}.rank-3 .contest-rank-badge{background:#9b6b3d;color:#fff}.contest-result-main h3{margin:.1rem 0 .35rem}.contest-result-main p{margin:.2rem 0;color:var(--muted);line-height:1.55}.contest-result-votes{text-align:center;color:var(--primary)}.contest-result-votes strong{display:block;font-size:1.45rem}.contest-result-votes span{font-size:.78rem;color:var(--muted)}@media(max-width:720px){.contest-entry-head,.contest-result-card{grid-template-columns:1fr}.contest-vote-count,.contest-result-votes{text-align:start;min-width:0}.contest-result-card{align-items:start}}

/* v30.6.14.3 contest large entries handling */
.contest-accepted-section .section-head{align-items:flex-start;gap:18px}
.contest-list-hint{display:block;margin-top:8px;color:var(--muted);line-height:1.55;font-size:.92rem}
.contest-list-counter{border:1px solid rgba(15,76,92,.12);background:#f7faf8;border-radius:999px;padding:9px 14px;color:var(--primary);font-weight:800;white-space:nowrap;box-shadow:0 8px 20px rgba(15,76,92,.05)}
.contest-load-more-row{display:flex;justify-content:center;margin-top:22px}
.contest-load-more-row .btn{min-width:220px}
@media(max-width:720px){.contest-accepted-section .section-head{display:block}.contest-list-counter{display:inline-flex;margin-top:12px}.contest-load-more-row .btn{width:100%}}


/* v30.6.15 annual contest season */
.annual-contest-hero{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(260px,.65fr);gap:clamp(18px,3vw,34px);align-items:center;margin-block:24px 30px;padding:clamp(26px,5vw,54px);border:1px solid rgba(15,76,92,.12);border-radius:34px;background:radial-gradient(circle at 15% 20%,rgba(242,211,139,.22),transparent 32%),linear-gradient(135deg,#fffdf7,#eef8f4);box-shadow:0 24px 70px rgba(15,76,92,.09)}
.annual-contest-hero h1{max-width:840px}.annual-contest-hero .lead{max-width:760px}.annual-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.annual-stats article{border:1px solid rgba(15,76,92,.12);border-radius:22px;background:#fff;padding:18px;text-align:center;box-shadow:0 12px 34px rgba(15,76,92,.07)}.annual-stats strong{display:block;font-size:clamp(1.55rem,3vw,2.25rem);color:var(--primary);line-height:1}.annual-stats span{display:block;color:var(--muted);margin-top:7px;font-size:.92rem}.annual-rounds-list{display:grid;gap:14px}.annual-round-card{display:grid;grid-template-columns:auto 1fr auto;gap:16px;align-items:center;border:1px solid rgba(15,76,92,.12);border-radius:24px;background:#fff;padding:18px;box-shadow:0 14px 38px rgba(15,76,92,.07)}.annual-round-card.status-open,.annual-round-card.status-voting{background:linear-gradient(135deg,#fff,#f3fbf7);border-color:rgba(15,76,92,.24)}.annual-round-index{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;font-weight:900;color:#fff;background:linear-gradient(135deg,#0f4c5c,#286a74)}.annual-round-main h3{margin:.15rem 0 .45rem}.annual-round-main p{color:var(--muted);line-height:1.65;margin:.25rem 0}.annual-round-main small{display:inline-flex;margin-top:6px;color:var(--muted);background:#fbfaf6;border:1px solid rgba(15,76,92,.1);border-radius:999px;padding:6px 10px}.annual-leader-list{display:grid;gap:14px}.annual-leader-card{display:grid;grid-template-columns:auto 1fr auto auto;gap:14px;align-items:center;border:1px solid rgba(15,76,92,.1);border-radius:22px;background:#fff;padding:16px 18px;box-shadow:0 12px 34px rgba(15,76,92,.07)}.annual-leader-card.rank-1{background:linear-gradient(135deg,#fff8e4,#ffffff);border-color:rgba(194,137,38,.35);box-shadow:0 18px 48px rgba(194,137,38,.18)}.annual-leader-card.rank-2,.annual-leader-card.rank-3{background:linear-gradient(135deg,#f4fbfa,#ffffff);border-color:rgba(15,76,92,.22)}.annual-leader-card h3,.annual-author-card h3{margin:.1rem 0 .3rem}.annual-leader-card p,.annual-author-card p{margin:.2rem 0;color:var(--muted);line-height:1.55}.annual-authors-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px}.annual-author-card{display:flex;gap:14px;align-items:center;border:1px solid rgba(15,76,92,.1);border-radius:22px;background:#fff;padding:16px;box-shadow:0 12px 34px rgba(15,76,92,.06)}.annual-author-card.rank-1{background:linear-gradient(135deg,#fff8e4,#fff);border-color:rgba(194,137,38,.35)}.annual-campaign-section .contest-info-grid article p{color:var(--muted);line-height:1.75}@media(max-width:860px){.annual-contest-hero,.annual-round-card,.annual-leader-card{grid-template-columns:1fr}.annual-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.annual-round-card>.btn,.annual-leader-card>.btn{width:100%;justify-content:center}}@media(max-width:520px){.annual-stats{grid-template-columns:1fr}.annual-contest-hero{border-radius:24px;padding:22px}}


/* ==============================
   v30.6.15.1 — Header Navigation Polish
   Keep contest links calm, single-line, and avoid double active pills.
   ============================== */
.nav-links { flex-wrap: nowrap; }
.nav-links a { white-space: nowrap; line-height: 1.25; }
.nav-links .nav-season { font-weight: 750; }
@media (min-width: 981px) {
  .nav-links { gap: 3px; }
  .nav-links a { padding: 8px 9px; font-size: 13.5px; }
  html[lang="ar"] .nav-links a { font-size: 13.25px; }
}
@media (min-width: 981px) and (max-width: 1260px) {
  .nav-links .nav-help,
  .nav-links .nav-secondary:not(.active):not(.nav-season) { display: none; }
}
@media (min-width: 981px) and (max-width: 1120px) {
  .nav-links .nav-season:not(.active) { display: none; }
}

/* v30.6.15.2 — Contest cover fit polish
   Contest cover images may be vertical posters with embedded campaign text.
   Use contain on list cards so important writing is not cropped on /contests pages. */
.contest-card-media{
  min-height:clamp(230px,24vw,340px);
  background:
    radial-gradient(circle at 18% 20%,rgba(242,211,139,.18),transparent 34%),
    linear-gradient(135deg,#16110b,#2a2118 48%,#0f4c5c);
  overflow:hidden;
}
.contest-card-media img{
  width:100%;
  height:clamp(230px,24vw,340px);
  object-fit:contain;
  object-position:center center;
  background:
    radial-gradient(circle at 15% 20%,rgba(242,211,139,.18),transparent 32%),
    linear-gradient(135deg,#16110b,#2a2118 55%,#0f4c5c);
}
@media(max-width:860px){
  .contest-card-media{min-height:260px}
  .contest-card-media img{height:260px;object-fit:contain}
}
@media(max-width:520px){
  .contest-card-media{min-height:230px}
  .contest-card-media img{height:230px}
}

/* v30.6.15.8 — Polished homepage Gmail entry */
.home-quick-signup{
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(300px,.95fr);
  gap:22px;
  align-items:center;
  border:1px solid rgba(215,201,177,.9);
  border-radius:28px;
  background:
    radial-gradient(circle at 8% 15%,rgba(195,143,47,.12),transparent 30%),
    linear-gradient(135deg,rgba(255,255,255,.96),rgba(251,246,235,.88));
  box-shadow:0 18px 54px rgba(15,42,46,.07);
  margin-top:26px;
  padding:30px;
}
.home-quick-signup h2{margin:8px 0 10px;font-size:clamp(1.55rem,3vw,2.35rem);line-height:1.25;}
.quick-signup-copy{max-width:760px;}
.quick-signup-box{
  display:grid;
  gap:12px;
  align-content:center;
  padding:18px;
  border:1px solid rgba(215,201,177,.78);
  border-radius:24px;
  background:rgba(255,255,255,.72);
  box-shadow:0 12px 34px rgba(15,42,46,.05);
}
.quick-terms{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:12px 14px;
  border:1px solid rgba(215,201,177,.85);
  border-radius:16px;
  background:rgba(255,255,255,.82);
  line-height:1.65;
  font-size:.96rem;
}
html[dir="rtl"] .quick-terms{flex-direction:row-reverse;text-align:right;}
.quick-terms input{margin-top:.45em;accent-color:var(--primary);flex:0 0 auto;}
.google-quick-btn{width:100%;justify-content:center;min-height:52px;font-weight:900;}
.quick-signup-links{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:center;}
.text-link-btn{background:transparent;border-color:transparent;box-shadow:none;color:var(--primary);}
.text-link-btn:hover{background:rgba(15,79,91,.06);}
.home-quick-signup.signed-in .quick-signed-actions{justify-content:flex-end;display:flex;flex-wrap:wrap;gap:10px;}
.profile-identity-form{display:grid;gap:14px;margin:18px 0;padding:18px;border:1px solid var(--line);border-radius:20px;background:rgba(255,255,255,.72);}
.profile-identity-form label{display:grid;gap:8px;font-weight:800;color:var(--primary);}
.profile-identity-form textarea{resize:vertical;min-height:92px;}
@media (max-width: 900px){
  .home-quick-signup{grid-template-columns:1fr;padding:22px;}
  .home-quick-signup.signed-in .quick-signed-actions{justify-content:flex-start;}
}
@media (max-width: 560px){
  .home-quick-signup{padding:18px;border-radius:22px;}
  .quick-signup-box{padding:14px;border-radius:20px;}
  .quick-signup-links{grid-template-columns:1fr;}
}
