/* Public site (/, /shkrime, /videot, /libra). Separate from site.css, which styles the app.
   Deliberately quiet: light paper, one green for text, gold only as a small accent. The book
   reader (Views/Site/Read.cshtml) has its own styles and is not affected by this file. */

@font-face {
  font-family: "UthmanicHafs";
  src: url("../fonts/UthmanicHafs-Regular.otf") format("opentype");
  font-display: swap;
}

:root {
  --sj-ink: #01423D;
  --sj-ink-2: #1D5A52;
  --sj-gold: #B79560;
  --sj-paper: #f7f7f3;
  --sj-tint: #ecefe8;
  --sj-text: #1c2722;
  --sj-muted: #66736b;
  --sj-rule: #e2e5de;
  --sj-serif: "Literata", Georgia, "Times New Roman", serif;
  --sj-sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sj-wrap: 1120px;
}

* { box-sizing: border-box; }

body.sajti {
  margin: 0;
  background: var(--sj-paper);
  color: var(--sj-text);
  font-family: var(--sj-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.sajti a { color: inherit; }
.sajti img { max-width: 100%; display: block; }
.sajti :focus-visible { outline: 2px solid var(--sj-ink-2); outline-offset: 3px; border-radius: 2px; }

.sj-wrap { max-width: var(--sj-wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .sj-wrap { padding: 0 32px; } }

/* ── Header ─────────────────────────────────────────────────────────── */
.sj-header {
  background: rgba(247, 247, 243, 0.94);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--sj-rule);
}
.sj-header .sj-wrap { display: flex; align-items: center; gap: 1.5rem; height: 60px; }
.sj-brand { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; font-family: var(--sj-serif); font-size: 1.2rem; font-weight: 600; color: var(--sj-ink) !important; }
.sj-brand img { width: 28px; height: 28px; }
.sj-nav { display: flex; gap: 1.6rem; margin-left: auto; }
.sj-nav a { text-decoration: none; color: var(--sj-muted); font-weight: 500; padding: 0.3rem 0; border-bottom: 2px solid transparent; }
.sj-nav a:hover { color: var(--sj-ink); }
.sj-nav a[aria-current="page"] { color: var(--sj-ink); border-bottom-color: var(--sj-ink); }
.sj-login { text-decoration: none; font-size: 0.9rem; font-weight: 600; color: var(--sj-ink-2) !important; }
@media (max-width: 640px) {
  .sj-header .sj-wrap { gap: 1rem; }
  .sj-brand span { display: none; }
  .sj-nav { margin-left: 0; gap: 1.1rem; }
  .sj-login { margin-left: auto; }
}

/* ── Hero: the ayah, quiet ──────────────────────────────────────────── */
.sj-hero { padding: 4.5rem 0 3rem; text-align: center; }
.sj-ayah-ar {
  font-family: "UthmanicHafs", "Amiri", serif;
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.7;
  color: var(--sj-ink);
  margin: 0;
  direction: rtl;
  font-weight: normal;
}
.sj-ayah-sq {
  font-family: var(--sj-serif);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-style: italic;
  margin: 0.6rem 0 0.3rem;
  color: var(--sj-text);
}
.sj-ayah-ref { color: var(--sj-muted); font-size: 0.85rem; }
.sj-ayah { animation: sj-fade 1.2s ease-out both; }
@keyframes sj-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sj-ayah { animation: none; } }

/* Featured item: one quiet line under the ayah. */
.sj-featured {
  display: inline-flex; align-items: center; gap: 0.9rem; margin-top: 2.5rem;
  text-decoration: none; text-align: left; max-width: 100%;
}
.sj-featured-media { position: relative; flex: none; width: 46px; aspect-ratio: 2/3; border-radius: 3px; overflow: hidden; background: var(--sj-tint); }
.sj-featured-media img, .sj-featured-media video { width: 100%; height: 100%; object-fit: cover; }
.sj-featured-media .sj-cover-plain { display: none; }
.sj-featured-kind { color: var(--sj-muted); font-size: 0.82rem; }
.sj-featured-title { font-family: var(--sj-serif); font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.sj-featured:hover .sj-featured-title { text-decoration: underline; text-underline-offset: 3px; }

/* ── Sections ───────────────────────────────────────────────────────── */
.sj-section { padding: 2.5rem 0 3rem; }
.sj-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.sj-section-head h2 { font-family: var(--sj-serif); font-weight: 600; font-size: 1.5rem; margin: 0; }
.sj-more { color: var(--sj-muted); font-size: 0.92rem; text-decoration: none; white-space: nowrap; }
.sj-more:hover { color: var(--sj-ink); text-decoration: underline; }

.sj-page-head { padding: 3rem 0 0.5rem; }
.sj-page-head h1 { font-family: var(--sj-serif); font-weight: 600; font-size: clamp(1.9rem, 4vw, 2.5rem); margin: 0 0 0.35rem; }
.sj-page-head p { color: var(--sj-muted); margin: 0; max-width: 40rem; }

/* Videos: portrait posters — the generated videos are 9:16. */
.sj-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(160px, 190px); gap: 1.1rem; overflow-x: auto; padding-bottom: 0.5rem; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.sj-video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1.5rem 1.1rem; }
.sj-video { text-decoration: none; scroll-snap-align: start; }
.sj-video-poster { position: relative; aspect-ratio: 9/16; border-radius: 8px; overflow: hidden; background: var(--sj-tint); }
.sj-video-poster img, .sj-video-poster video { width: 100%; height: 100%; object-fit: cover; }
.sj-play {
  position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.9); color: var(--sj-ink); display: grid; place-items: center; font-size: 0.7rem;
  padding-left: 2px;
}
.sj-video h3 { font-size: 0.95rem; font-weight: 500; line-height: 1.35; margin: 0.55rem 0 0.1rem; }
.sj-video:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.sj-video small { color: var(--sj-muted); font-size: 0.85rem; }

/* Articles: a lead piece and a plain list. */
.sj-articles { display: grid; gap: 2rem 3rem; }
@media (min-width: 900px) { .sj-articles { grid-template-columns: 1.2fr 1fr; } }
.sj-lead { text-decoration: none; display: block; }
.sj-lead-img { aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: var(--sj-tint); margin-bottom: 1rem; }
.sj-lead-img img { width: 100%; height: 100%; object-fit: cover; }
.sj-lead h3 { font-family: var(--sj-serif); font-size: clamp(1.35rem, 2.5vw, 1.7rem); font-weight: 600; line-height: 1.25; margin: 0 0 0.5rem; }
.sj-lead p { color: var(--sj-muted); margin: 0 0 0.5rem; max-width: 36rem; }
.sj-meta { color: var(--sj-muted); font-size: 0.85rem; }
.sj-list { list-style: none; margin: 0; padding: 0; }
.sj-list li + li { border-top: 1px solid var(--sj-rule); }
.sj-list a { display: grid; grid-template-columns: 1fr 72px; gap: 1rem; padding: 1rem 0; text-decoration: none; align-items: start; }
.sj-list li:first-child a { padding-top: 0; }
.sj-list a.no-img { grid-template-columns: 1fr; }
.sj-list h4 { font-family: var(--sj-serif); font-size: 1.08rem; font-weight: 600; line-height: 1.35; margin: 0 0 0.3rem; }
.sj-list a:hover h4, .sj-lead:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.sj-list-img { aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--sj-tint); }
.sj-list-img img { width: 100%; height: 100%; object-fit: cover; }

/* Books: covers on a shelf. */
.sj-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 2rem 1.5rem; }
.sj-book { text-decoration: none; }
.sj-cover {
  position: relative; aspect-ratio: 2/3; border-radius: 2px 4px 4px 2px; overflow: hidden;
  background: var(--sj-ink-2);
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 14px -6px rgba(10, 46, 34, 0.3);
  transition: transform 0.2s ease;
}
.sj-cover img { width: 100%; height: 100%; object-fit: cover; }
/* A faint spine crease on the left edge. */
.sj-cover::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; z-index: 1;
  background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(255,255,255,.08) 60%, transparent);
}
.sj-book:hover .sj-cover { transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .sj-cover { transition: none; } .sj-book:hover .sj-cover { transform: none; } }
.sj-cover-plain {
  position: absolute; inset: 0; padding: 1.1rem 0.9rem 0.9rem 1.2rem; display: flex; flex-direction: column; justify-content: space-between;
  color: #efe9d8;
}
.sj-cover-plain strong { font-family: var(--sj-serif); font-weight: 600; font-size: 1rem; line-height: 1.25; }
.sj-cover-plain span { font-size: 0.78rem; color: #b7c4bb; }
.sj-book h3 { font-family: var(--sj-serif); font-size: 0.98rem; font-weight: 600; line-height: 1.3; margin: 0.75rem 0 0.1rem; }
.sj-book small { color: var(--sj-muted); font-size: 0.85rem; }

/* ── Single article ─────────────────────────────────────────────────── */
.sj-article { max-width: 42rem; margin: 0 auto; padding: 3rem 0 1rem; }
.sj-article-head h1 { font-family: var(--sj-serif); font-weight: 600; font-size: clamp(1.9rem, 4.5vw, 2.6rem); line-height: 1.2; margin: 0 0 0.8rem; }
.sj-article-head .sj-standfirst { font-family: var(--sj-serif); font-size: 1.18rem; color: var(--sj-muted); margin: 0 0 0.9rem; line-height: 1.55; }
.sj-article-cover { margin: 2rem 0; border-radius: 6px; overflow: hidden; }
.sj-article-head + .sj-prose { margin-top: 2rem; }
.sj-prose { font-family: var(--sj-serif); font-size: 1.14rem; line-height: 1.8; }
.sj-prose p { margin: 0 0 1.3em; }
.sj-prose h2 { font-size: 1.4rem; font-weight: 600; line-height: 1.3; margin: 2em 0 0.6em; }
.sj-prose blockquote { margin: 1.8em 0; padding: 0 0 0 1.2em; border-left: 2px solid var(--sj-gold); color: var(--sj-ink-2); font-style: italic; }
.sj-prose blockquote p { margin: 0; }

/* ── Single video ───────────────────────────────────────────────────── */
.sj-watch { display: grid; gap: 2rem; padding: 2.5rem 0 1rem; align-items: start; }
@media (min-width: 900px) { .sj-watch { grid-template-columns: minmax(0, 380px) 1fr; gap: 3rem; } }
.sj-player { background: #000; border-radius: 8px; overflow: hidden; }
.sj-player video { width: 100%; max-height: 80vh; display: block; background: #000; }
.sj-watch h1 { font-family: var(--sj-serif); font-weight: 600; font-size: clamp(1.6rem, 3.5vw, 2.1rem); line-height: 1.25; margin: 0 0 0.5rem; }
.sj-watch .sj-desc { font-size: 1.05rem; max-width: 34rem; margin-top: 1rem; }

.sj-btn {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.1rem; border-radius: 6px;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 600; font-size: 0.95rem;
}
.sj-btn-primary { background: var(--sj-ink); color: #f7f7f3 !important; }
.sj-btn-primary:hover { background: var(--sj-ink-2); }
.sj-btn-ghost { background: transparent; border-color: var(--sj-rule); color: var(--sj-ink) !important; }
.sj-btn-ghost:hover { border-color: var(--sj-muted); }
.sj-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem; }

/* ── Single book ────────────────────────────────────────────────────── */
.sj-bookpage { display: grid; gap: 2.5rem; padding: 3rem 0 1rem; align-items: center; }
@media (min-width: 820px) { .sj-bookpage { grid-template-columns: 260px 1fr; gap: 4rem; } }
.sj-bookpage .sj-cover { max-width: 260px; margin: 0 auto; width: 100%; }
.sj-bookpage h1 { font-family: var(--sj-serif); font-weight: 600; font-size: clamp(1.9rem, 4.5vw, 2.6rem); line-height: 1.2; margin: 0 0 0.35rem; }
.sj-bookpage .sj-author { font-size: 1.05rem; color: var(--sj-muted); margin: 0 0 1.1rem; }
.sj-bookpage .sj-desc { font-family: var(--sj-serif); font-size: 1.08rem; line-height: 1.7; max-width: 34rem; }

/* ── Listings / misc ────────────────────────────────────────────────── */
.sj-listing { padding: 1.5rem 0 3rem; }
.sj-list-wide { max-width: 46rem; }
.sj-list-wide h4 { font-size: 1.25rem; }
.sj-list-wide a { grid-template-columns: 1fr 104px; }
.sj-list-summary { color: var(--sj-muted); margin: 0 0 0.35rem; }
.sj-narrow { max-width: 46rem; }

.sj-empty { text-align: center; padding: 3rem 1rem 5rem; color: var(--sj-muted); }
.sj-empty p { font-family: var(--sj-serif); font-size: 1.1rem; margin: 0; }
.sj-pager { display: flex; justify-content: space-between; padding: 1rem 0 2rem; }

.sj-footer { border-top: 1px solid var(--sj-rule); color: var(--sj-muted); margin-top: 2rem; padding: 2rem 0; font-size: 0.88rem; }
.sj-footer .sj-wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.sj-footer nav { display: flex; gap: 1.25rem; }
.sj-footer a { text-decoration: none; }
.sj-footer a:hover { color: var(--sj-ink); }

/* QR share card dialog (Views/Site/_QrShare.cshtml). */
.sj-qr-dialog {
  border: 0; border-radius: 14px; padding: 1.25rem; background: var(--sj-paper);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); max-width: min(92vw, 420px);
}
.sj-qr-dialog::backdrop { background: rgba(28, 39, 34, 0.55); }
.sj-qr-dialog img { width: 100%; aspect-ratio: 4 / 5; border-radius: 10px; background: var(--sj-tint); display: block; }
.sj-qr-dialog .sj-actions { justify-content: center; margin-top: 1rem; }
.sj-article-share { border-top: 1px solid var(--sj-rule); padding-top: 1.5rem; margin-top: 2.5rem; }

/* ── Desktop app downloads (/shkarko) ───────────────────────────────── */
.sj-dl { border-top: 1px solid var(--sj-rule); padding: 2rem 0 1rem; margin-top: 1.5rem; }
.sj-dl h2 { font-family: var(--sj-serif); font-weight: 600; font-size: 1.5rem; margin: 0 0 0.3rem; }
.sj-dl-req { color: var(--sj-muted); font-size: 0.9rem; margin: 0.3rem 0 0.9rem; }
.sj-dl-action { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; margin: 0; }
.sj-dl-action small { color: var(--sj-muted); font-size: 0.85rem; }
.sj-dl-soon { display: inline-block; margin: 0; padding: 0.6rem 1.1rem; border-radius: 6px; background: var(--sj-tint); color: var(--sj-muted); font-weight: 600; font-size: 0.95rem; }
.sj-dl-pair { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.sj-dl ol { padding-left: 1.2rem; margin: 1rem 0; }
.sj-dl li { margin-bottom: 0.5rem; }
.sj-dl-cmd { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.5rem; }
.sj-dl-cmd code { background: var(--sj-tint); border-radius: 6px; padding: 0.55rem 0.75rem; font-size: 0.85rem; overflow-wrap: anywhere; }
