* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f7fb;
  --bg-soft: #eef4fb;
  --card: rgba(255, 255, 255, 0.88);
  --card-strong: #ffffff;
  --text: #1c2733;
  --muted: #617284;
  --primary: #0b4b78;
  --primary-2: #0f6aa8;
  --primary-dark: #073554;
  --accent: #b78b2a;
  --border: rgba(11, 75, 120, 0.12);
  --shadow: 0 14px 40px rgba(8, 35, 61, 0.10);
  --shadow-soft: 0 8px 24px rgba(8, 35, 61, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Naskh Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15, 106, 168, 0.05), transparent 25%),
    radial-gradient(circle at top right, rgba(183, 139, 42, 0.05), transparent 22%),
    linear-gradient(180deg, #f4f8fb 0%, #f8fbfd 100%);
  color: var(--text);
}

img {
  max-width: 100%;
}

.container {
  width: min(1180px, 92%);
  margin: 0 auto;
}

/* =========================
   HEADER
========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, rgba(7, 37, 64, 0.96), rgba(9, 56, 91, 0.94));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(4, 23, 40, 0.16);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
}

.brand-wrap h1 {
  margin: 0;
  color: #ffffff;
  font-size: 28px;
  direction: ltr;
  text-align: left;
  letter-spacing: 0.2px;
}

.brand-subtitle {
  margin: 6px 0 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  direction: ltr;
  text-align: left;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.language-switcher {
  min-height: 42px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.10);
  color: #fff;
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.language-switcher option {
  color: #111;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  direction: ltr;
}

.nav a {
  color: #ffffff;
  text-decoration: none;
  padding: 10px 15px;
  border-radius: 999px;
  font-size: 15px;
  transition: 0.25s ease;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

/* =========================
   HERO
========================= */

.hero-section {
  padding: 36px 0 20px 0;
}

.hero-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(246,251,255,0.96));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
  padding: 28px;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 30px;
  align-items: center;
  overflow: hidden;
}

.hero-image-wrap {
  position: relative;
}

.hero-image {
  width: 100%;
  display: block;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 16px 30px rgba(7, 35, 61, 0.16);
}

.hero-content {
  text-align: right;
}

.bismillah {
  margin: 0 0 14px 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.hero-badge {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: #eef6fd;
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(11, 75, 120, 0.08);
}

.hero-title {
  margin: 0 0 14px 0;
  font-size: 34px;
  line-height: 1.75;
  color: #0d2439;
}

.hero-text {
  margin: 0 0 18px 0;
  font-size: 18px;
  line-height: 2;
  color: var(--muted);
}

/* =========================
   BUTTONS
========================= */

.hero-actions,
.center-actions,
.book-buttons,
.detail-buttons,
.reader-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  text-decoration: none;
  font-weight: 700;
  border-radius: 14px;
  transition: 0.25s ease;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 10px 22px rgba(11, 75, 120, 0.18);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: translateY(-1px);
}

.btn-secondary {
  background: #edf4fb;
  color: var(--primary);
  border: 1px solid #dce8f3;
}

.btn-secondary:hover {
  background: #e3eef8;
  transform: translateY(-1px);
}

/* =========================
   SECTIONS
========================= */

.section-block {
  padding: 18px 0 26px 0;
}

.soft-bg {
  background: linear-gradient(180deg, rgba(239, 246, 252, 0.65), rgba(245, 248, 251, 0));
}

.section-card {
  background: var(--card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
}

.compact-card {
  padding: 30px;
}

.section-head {
  text-align: center;
  margin-bottom: 20px;
}

.section-kicker {
  display: inline-block;
  color: var(--primary);
  background: #eef6fd;
  border-radius: 999px;
  padding: 7px 13px;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 12px;
}

.section-title {
  margin: 0;
  font-size: 34px;
  color: var(--primary);
}

.content-flow p,
.center-text,
.books-subtitle,
.detail-description-box p,
.donation-intro {
  font-size: 19px;
  line-height: 2.1;
  color: var(--text);
}

.content-flow p {
  text-align: justify;
  margin: 0 0 18px 0;
}

.highlight-box {
  border-radius: 18px;
  padding: 20px;
  margin: 24px 0;
}

.ayah-box {
  background: linear-gradient(135deg, #edf6ff, #f7fbff);
  border-right: 5px solid var(--primary);
}

.highlight-title {
  margin: 0 0 10px 0;
  font-size: 24px;
  line-height: 1.9;
  color: var(--primary);
  text-align: center;
}

.highlight-subtitle {
  margin: 0 0 8px 0;
  text-align: center;
  color: var(--muted);
}

.highlight-note {
  display: block;
  text-align: center;
  color: #65768a;
  font-size: 15px;
}

.quote-box {
  background: linear-gradient(135deg, #fff8ea, #fffdf6);
  border-right: 5px solid var(--accent);
}

.quote-box p {
  margin: 0;
  font-size: 22px;
  line-height: 2.1;
  text-align: center;
  color: #4a3720;
}

.featured-list-box {
  margin-top: 24px;
  background: linear-gradient(135deg, #f8fbff, #fcfdff);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
}

.featured-list-box h4 {
  margin: 0 0 14px 0;
  text-align: center;
  color: var(--primary);
  font-size: 26px;
}

.featured-list-box ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.featured-list-box li {
  padding: 10px 0;
  text-align: center;
  border-bottom: 1px solid #edf2f7;
  font-size: 18px;
}

.featured-list-box li:last-child {
  border-bottom: none;
}

.center-text {
  text-align: center;
  max-width: 920px;
  margin: 0 auto 20px auto;
}

.center-actions {
  justify-content: center;
  margin-top: 24px;
}

/* =========================
   CONTACT
========================= */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 22px;
  align-items: start;
}

.contact-info-panel {
  display: grid;
  gap: 18px;
}

.mini-info-card {
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.mini-info-card h4 {
  margin: 0 0 14px 0;
  color: var(--primary);
  font-size: 24px;
  text-align: center;
}

.mini-info-card p {
  margin: 10px 0;
  text-align: center;
  font-size: 17px;
  line-height: 1.9;
}

.mini-info-card a {
  color: var(--primary);
  text-decoration: none;
  word-break: break-word;
}

.mini-info-card a:hover {
  text-decoration: underline;
}

.contact-form-panel {
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

.form-title {
  margin: 0 0 18px 0;
  text-align: center;
  color: var(--primary);
  font-size: 28px;
}

.contact-form {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #23445f;
  font-weight: 700;
  font-size: 15px;
  text-align: right;
}

.form-group input,
.form-group textarea {
  width: 100%;
  border: 1px solid #d7e4ef;
  border-radius: 14px;
  padding: 14px 14px;
  font-size: 16px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #9dc3e2;
  box-shadow: 0 0 0 4px rgba(13, 94, 151, 0.08);
}

.form-group textarea {
  resize: vertical;
  min-height: 150px;
}

.form-submit-btn {
  width: 100%;
  margin-top: 4px;
}

.form-note {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
  text-align: center;
}

/* =========================
   DONATION
========================= */

.donation-outer {
  padding-top: 10px;
  padding-bottom: 40px;
}

.donation-card {
  background: linear-gradient(135deg, #0a3657 0%, #0d4f7f 55%, #11639d 100%);
  color: #fff;
  border: none;
  box-shadow: 0 20px 36px rgba(8, 44, 73, 0.22);
}

.donation-card .section-kicker {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.donation-card .section-title {
  color: #fff;
}

.donation-intro {
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  max-width: 920px;
  margin: 0 auto 22px auto;
}

.donation-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.donation-item {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  border-radius: 18px;
  padding: 18px;
  text-align: center;
}

.donation-item-full {
  grid-column: 1 / -1;
}

.donation-label {
  display: block;
  font-size: 13px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  opacity: 0.84;
  margin-bottom: 10px;
}

.donation-item strong {
  font-size: 19px;
  line-height: 1.8;
  word-break: break-word;
}

/* =========================
   FOOTER
========================= */

.site-footer {
  margin-top: 14px;
  background:
    linear-gradient(135deg, rgba(6, 29, 49, 0.98), rgba(9, 46, 74, 0.96)),
    radial-gradient(circle at top right, rgba(183, 139, 42, 0.12), transparent 25%);
  color: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-inner {
  padding: 28px 0;
  text-align: center;
}

.footer-inner p {
  margin: 6px 0;
  direction: ltr;
  font-size: 15px;
}

/* =========================
   BOOKS PAGE
========================= */

.books-page-section {
  padding-top: 22px;
  padding-bottom: 40px;
}

.page-title {
  text-align: center;
  margin: 0 0 10px 0;
  font-size: 34px;
  color: var(--primary);
}

.books-subtitle {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 20px auto;
}

.books-toolbar {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 22px;
  padding: 18px;
  margin: 20px 0 10px 0;
}

.search-wrap {
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #d7e4ef;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 16px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.search-input:focus {
  border-color: #9dc3e2;
  box-shadow: 0 0 0 4px rgba(13, 94, 151, 0.08);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 26px 0 12px 0;
}

.filter-btn {
  border: 1px solid var(--border);
  background: #eef4fb;
  color: var(--primary);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.25s ease;
}

.filter-btn:hover {
  background: #e1edf8;
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border-color: transparent;
}

.results-note {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  margin-top: 8px;
}

.empty-state {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 20px;
  padding: 26px;
  text-align: center;
  color: var(--muted);
  font-size: 18px;
  line-height: 2;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 20px;
  margin-top: 28px;
  margin-bottom: 40px;
}

.book-card {
  background: var(--card-strong);
  border: 1px solid var(--border);
  padding: 15px;
  border-radius: 20px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.book-card img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 12px;
  display: block;
}

.book-card h3 {
  font-size: 22px;
  line-height: 1.9;
  margin: 10px 0;
}

.book-card p {
  font-size: 17px;
  line-height: 1.85;
  margin: 8px 0;
}

.book-buttons {
  justify-content: center;
  margin-top: 14px;
}

.book-buttons a {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 15px;
}

.book-title-link {
  text-decoration: none;
  color: var(--text);
}

.book-title-link:hover {
  color: var(--primary);
}

/* =========================
   DETAIL PAGE
========================= */

.book-detail-page {
  padding: 28px 0 50px 0;
}

.book-detail-card {
  background: linear-gradient(135deg, #ffffff, #f7fbff);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

.book-detail-image img {
  width: 100%;
  border-radius: 16px;
  object-fit: cover;
  display: block;
}

.book-detail-info h2 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 32px;
  color: var(--primary);
}

.detail-badge {
  display: inline-block;
  background: #e8f1f8;
  color: var(--primary);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  margin-bottom: 14px;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px;
  margin: 18px 0 12px 0;
}

.detail-meta p {
  margin: 0;
  font-size: 17px;
  line-height: 1.9;
}

.detail-description-box {
  margin-top: 18px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.detail-description-box h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 24px;
}

.compat-note {
  margin-top: 18px;
  background: #f7fbff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--muted);
}

/* =========================
   READER
========================= */

.reader-page {
  padding: 28px 0 50px 0;
}

.left-title {
  text-align: right;
  margin-bottom: 8px;
}

.reader-shell {
  background: transparent;
}

.reader-topbar {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 22px;
  padding: 22px;
  margin-bottom: 18px;
}

.reader-subtitle {
  margin: 0;
  font-size: 17px;
  line-height: 1.9;
  color: var(--muted);
}

.reader-note {
  background: #fff6df;
  border: 1px solid #efd79a;
  color: #6a5317;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 16px;
  line-height: 1.9;
}

.reader-box {
  background: #fff;
  padding: 18px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 40px;
}

.pdf-object,
.reader-box iframe {
  width: 100%;
  height: 80vh;
  min-height: 600px;
  border: none;
  border-radius: 12px;
  background: #fff;
}

.pdf-fallback-card {
  padding: 28px;
  text-align: center;
}

.pdf-fallback-card h3 {
  margin-top: 0;
  color: var(--primary);
  font-size: 28px;
}

.pdf-fallback-card p {
  font-size: 18px;
  line-height: 2;
  color: var(--muted);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 980px) {
  .header-inner,
  .contact-layout,
  .hero-card,
  .book-detail-card {
    grid-template-columns: 1fr;
    display: grid;
  }

  .header-inner {
    gap: 14px;
  }

  .brand-wrap h1,
  .brand-subtitle {
    text-align: center;
  }

  .header-controls {
    justify-content: center;
  }

  .nav {
    justify-content: center;
  }

  .hero-title {
    font-size: 29px;
  }

  .contact-layout {
    gap: 18px;
  }

  .form-grid,
  .donation-grid {
    grid-template-columns: 1fr;
  }

  .donation-item-full {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .site-header {
    position: static;
  }

  .hero-section {
    padding: 22px 0 14px 0;
  }

  .section-card,
  .hero-card,
  .contact-form-panel,
  .mini-info-card,
  .book-card,
  .book-detail-card,
  .reader-box,
  .reader-topbar {
    padding: 18px;
  }

  .brand-wrap h1 {
    font-size: 22px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

  .language-switcher {
    width: 100%;
  }

  .nav a {
    font-size: 14px;
    padding: 9px 12px;
  }

  .bismillah {
    font-size: 22px;
  }

  .hero-title,
  .section-title,
  .page-title {
    font-size: 26px;
    line-height: 1.8;
  }

  .hero-text,
  .content-flow p,
  .center-text,
  .books-subtitle,
  .donation-intro,
  .book-card p,
  .detail-description-box p,
  .mini-info-card p,
  .donation-item strong,
  .reader-subtitle,
  .reader-note,
  .compat-note,
  .pdf-fallback-card p {
    font-size: 16px;
    line-height: 2;
  }

  .highlight-title {
    font-size: 18px;
  }

  .quote-box p {
    font-size: 18px;
  }

  .book-card img {
    height: 260px;
  }

  .btn {
    width: 100%;
  }

  .books-toolbar {
    padding: 14px;
  }

  .search-input {
    font-size: 15px;
  }

  .pdf-object,
  .reader-box iframe {
    height: 62vh;
    min-height: 420px;
  }

  .pdf-fallback-card h3 {
    font-size: 22px;
  }
}

:root{
  --brand:#0f6d50;
  --brand-dark:#0a4d3a;
  --soft:#f5faf7;
  --ink:#16211d;
}

body{
  background:linear-gradient(180deg,#f7faf8 0%,#eef6f2 100%);
  color:var(--ink);
}

.site-header{
  backdrop-filter: blur(12px);
  box-shadow:0 10px 30px rgba(13,42,29,.08);
}

.hero-card,
.section-card,
.book-card,
.book-detail-card,
.mini-info-card,
.donation-item{
  border-radius:22px;
  box-shadow:0 14px 40px rgba(12,45,32,.08);
  border:1px solid rgba(15,109,80,.08);
}

.hero-card{
  background:linear-gradient(135deg,#ffffff 0%,#f4fbf7 100%);
}

.hero-title,
.section-title,
.page-title,
#detail-title{
  color:var(--brand-dark);
}

.btn{
  border-radius:14px;
  font-weight:700;
  letter-spacing:.2px;
}

.btn-primary{
  background:linear-gradient(135deg,var(--brand),#148460);
  border:none;
}

.btn-secondary{
  border:1px solid rgba(15,109,80,.25);
}

.intro-article{
  font-size:1.08rem;
  line-height:2.15;
}

.intro-article p{
  font-weight:500;
}

.intro-lead,
.intro-dua{
  font-weight:700 !important;
}

.poetry-box{
  background:linear-gradient(180deg,#fff 0%,#f4faf7 100%);
  text-align:center;
}

.poetry-line{
  margin:0;
  font-size:1.18rem;
  font-weight:700;
  line-height:2;
}

.poetry-note{
  margin-top:12px;
  font-size:.95rem;
  color:#5a665f;
}

.highlight-box.ayah-box{
  border-inline-start:5px solid var(--brand);
}

.contact-layout,
.donation-grid{
  gap:20px;
}

.book-card{
  transition:transform .18s ease, box-shadow .18s ease;
  overflow:hidden;
  background:#fff;
}

.book-card:hover{
  transform:translateY(-4px);
  box-shadow:0 20px 40px rgba(12,45,32,.12);
}

.book-card img,
#detail-cover,
.hero-image{
  border-radius:18px;
}

.book-buttons a,
.detail-buttons .btn{
  min-width:150px;
  text-align:center;
}

.compat-note{
  border-radius:16px;
  background:#f3fbf7;
  border:1px solid rgba(15,109,80,.12);
}

.reader-removed-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:40px 16px;
}

.reader-removed-card{
  text-align:center;
  max-width:780px;
  margin-inline:auto;
}

@media (max-width:768px){
  .intro-article{
    font-size:1rem;
    line-height:2;
  }
  .poetry-line{
    font-size:1.06rem;
  }
  .hero-card,
  .section-card,
  .book-card,
  .book-detail-card{
    border-radius:18px;
  }
}
