
/* ========================================
   IMPORTS
======================================== */

@import "./base/reset.css";
@import "./base/variables.css";

@import "./layout/header.css";

@import "./components/lang-switch.css";

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Amiri+Quran&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Scheherazade+New:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500&display=swap');



/* ========================================
   GLOBAL RESET
======================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


html {
  scroll-behavior: auto;
}


/* ===============================
   BODY
   =============================== */

body {
  background: var(--page-bg);
   
  font-family: "Scheherazade New",
               "Amiri Quran",
               serif;
   
  color: var(--page-text);
  
  padding-top: 40px;
}




/* ===============================
   MENU CONTENT
   =============================== */
.menu-content {
  width: 100%;
}

/* MENU LIST */
.menu-content ul {
  list-style: none;
  padding: 0;
  margin: 0 auto;

  display: flex;
  flex-direction: column;
  gap: 10px;

  align-items: flex-end; /* ✅ THIS IS THE KEY */
   
  width: fit-content;
}

/* MENU ITEMS (PILLS) */
.menu-content a {
  display: inline-flex;
  align-items: center;     /* vertical centering */
  justify-content: flex-start; /* horizontal centering */
   
  padding-block: 12px;
  padding-inline: 10px;

  line-height: 1;
   
  background: #f2f2f2;

  border-radius: 20px;

  font-family: "Scheherazade New", sans-serif;
  font-size: 30px;
  font-weight: 700;

  color: #000;
  text-decoration: none;

  direction: rtl;
  text-align: right;
  white-space: nowrap;

  transition: background-color 0.3s ease,
              color 0.3s ease;
}

.menu-content a:not([aria-current="page"]):hover {
  background: #e8e8e8;
}

#main-menu {
  padding: 0;
  height: auto;
  overflow: visible;
  display: block;
}







.menu-overlay-home {
  position: absolute;
  left: 12px;
  top: 0;

  width: 44px;
  height: 44px;

  display: grid;
  place-items: center;

  color: var(--menu-icon-color);
  opacity: 0;
  pointer-events: none;

  z-index: 4;

  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
   
  transition:
    opacity 300ms ease 150ms,
    transform 300ms cubic-bezier(0.22, 1, 0.36, 1) 150ms;

  transform: translateY(0);
}

.menu-overlay-home:focus,
.menu-overlay-home:focus-visible,
.menu-overlay-home:active {
  outline: none !important;
  box-shadow: none !important;
}


body.menu-open .menu-overlay-home {
  opacity: 1;
  pointer-events: auto;
}

.menu-overlay-home .home-icon {
  width: 30px;
  height: 29px;
  display: block;
  fill: currentColor;
  transform: translateY(11.5px);
}

body:not(.menu-open) .menu-overlay-home {
  transition: none;
}


/* ========================================
   HOME
======================================== */

.home {
  min-height: calc(100vh - 40px);
  padding: 40px 24px;

  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;

  padding-top: 80px;
}

.home-title {
  font-size: 32px;
  margin-bottom: 16px;
}

.home-subtitle {
  font-size: 16px;
  color: #555;
  line-height: 1.6;
}

.home-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 14px;
}








/* ========================================
   HOME BUTTONS (ALWAYS DARK)
======================================== */

.choose-surah-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-top: 18px;
  padding: 12px 22px;
   
  height: var(--header-h);
  min-height: var(--header-h);

  border: none;
  border-radius: 999px;

  background: rgba(0, 0, 0, 0.06);
  color: #000000;

  font-family: "Scheherazade New", serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;

  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

html.night-mode .choose-surah-btn,
body.night-mode .choose-surah-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

html.night-mode .choose-surah-btn:hover,
body.night-mode .choose-surah-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.choose-surah-btn:hover {
  background: rgba(0, 0, 0, 0.085);
}

.choose-surah-btn:active {
  transform: translateY(1px);
}

.choose-surah-btn:focus,
.choose-surah-btn:focus-visible {
  outline: none;
  box-shadow: none;
}



/* ========================================
   SURAH PAGE
======================================== */

.surah-container {
  max-width: 800px;
  margin: 0 auto;
   
  margin-top: 0;
  padding: 40px 20px;

  padding-bottom: 110px;
   
  position: relative;
  z-index: 1;
}

.surah-header,
.surah-title {
  text-align: center;
}

.surah-title {
  margin-bottom: 20px;
}

.surah-title h1 {
  font-size: 40px;
  margin: 0;
}

.surah-meta {
  color: #777;
  margin-top: 10px;
  font-size: 14px;
}

.bismillah {
  text-align: center;
  font-family: 'Amiri Quran', serif;
  font-size: 22px;
  margin-bottom: 32px;
}

.ayah {
  text-align: justify;
  text-align-last: start;

  font-family: "Amiri Quran", serif;
  font-size: 24px;

  margin-bottom: 18px;
}

.ayah-text {
  line-height: 2.0;
  word-spacing: 0.2em;

  font-variant-ligatures: normal;
  font-feature-settings: "calt" 1, "liga" 1;
}



/* ========================================
   Quran Badges (Ayah + Page)
======================================== */

.q-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 26px;
  min-width: 26px;
  padding: 0 5px;              /* symmetric padding */
   
  border-radius: 999px;
   
  font-family: "Scheherazade New", serif;
  font-size: 15px;
  line-height: 1;              /* important */
  font-weight: 700;

  white-space: nowrap;
  user-select: none;

  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.q-badge--ayah {
  margin-inline-start: 0;

  background: transparent;                 /* no fill */
  border: 1px solid currentColor;          /* stroke uses text color */
  color: inherit;                          /* same as ayah text */
}



/* ========================================
   QURAN MODE SWITCH
   Reading / Tajweed segmented control
======================================== */

#quran-mode-switch {
margin-bottom: 18px;
}

.quran-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
}


.quran-mode-btn {
  min-width: 92px;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--page-text);
  font: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.quran-mode-btn.is-active {
  background: rgba(0, 0, 0, 0.10);
}

html.night-mode .quran-mode-switch,
body.night-mode .quran-mode-switch {
  background: rgba(255, 255, 255, 0.08);
}

html.night-mode .quran-mode-btn,
body.night-mode .quran-mode-btn {
  color: #ffffff;
}

html.night-mode .quran-mode-btn.is-active,
body.night-mode .quran-mode-btn.is-active {
  background: rgba(255, 255, 255, 0.12);
}


/* ========================================
   TAJWEED MODE
   - Unicode tajweed rendering
   - Improved spacing and shaping
   - Applies only in tajweed mode
======================================== */

body[data-quran-mode="tajweed"] .ayah {
  align-items: baseline;
}

body[data-quran-mode="tajweed"] .ayah-text {
  display: inline;
  direction: rtl;
  unicode-bidi: plaintext;

  font-family: "Amiri Quran", serif;
  font-size: 1.08em;
  font-weight: 400;

  line-height: 2.35;
  letter-spacing: 0;
  word-spacing: 0.02em;

  white-space: normal;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-variant-ligatures: contextual common-ligatures;
  font-feature-settings: "calt" 1, "liga" 1, "kern" 1;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Tajweed tags returned by the API */
body[data-quran-mode="tajweed"] .ayah-text tajweed {
  display: inline;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
}

/* Quiet ayah ending markers inside tajweed markup */
body[data-quran-mode="tajweed"] .ayah-text .end {
  color: inherit;
}

/* Improve badge alignment next to taller tajweed text */
body[data-quran-mode="tajweed"] .q-badge--ayah {
  align-self: center;
}

/* Slightly tighter spacing on small screens so lines stay balanced */
@media (max-width: 768px) {
  body[data-quran-mode="tajweed"] .ayah-text {
    font-size: 1.03em;
    line-height: 2.2;
  }
}

/* ========================================
   TAJWEED COLORS — LIGHT MODE
======================================== */

body[data-quran-mode="tajweed"] .ayah-text tajweed.ham_wasl {
  color: #a16207;
}

body[data-quran-mode="tajweed"] .ayah-text tajweed.laam_shamsiyah {
  color: #9333ea;
}

body[data-quran-mode="tajweed"] .ayah-text tajweed.silent {
  color: #6b7280;
}

body[data-quran-mode="tajweed"] .ayah-text tajweed.ghunnah {
  color: #059669;
}

body[data-quran-mode="tajweed"] .ayah-text tajweed.idgham_wo_ghunnah {
  color: #7c3aed;
}

body[data-quran-mode="tajweed"] .ayah-text tajweed.idgham_wi_ghunnah {
  color: #0f766e;
}

body[data-quran-mode="tajweed"] .ayah-text tajweed.iqlab {
  color: #2563eb;
}

body[data-quran-mode="tajweed"] .ayah-text tajweed.ikhafa {
  color: #dc2626;
}

body[data-quran-mode="tajweed"] .ayah-text tajweed.madda_normal {
  color: #ea580c;
}

body[data-quran-mode="tajweed"] .ayah-text tajweed.madda_permissible {
  color: #d97706;
}

body[data-quran-mode="tajweed"] .ayah-text tajweed.madda_necessary {
  color: #b91c1c;
}

body[data-quran-mode="tajweed"] .ayah-text tajweed.qalaqah {
  color: #0891b2;
}


/* ========================================
   TAJWEED COLORS — DARK MODE
======================================== */

html.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.ham_wasl,
body.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.ham_wasl {
  color: #fbbf24;
}

html.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.laam_shamsiyah,
body.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.laam_shamsiyah {
  color: #d8b4fe;
}

html.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.silent,
body.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.silent {
  color: #9ca3af;
}

html.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.ghunnah,
body.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.ghunnah {
  color: #34d399;
}

html.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.idgham_wo_ghunnah,
body.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.idgham_wo_ghunnah {
  color: #c084fc;
}

html.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.idgham_wi_ghunnah,
body.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.idgham_wi_ghunnah {
  color: #2dd4bf;
}

html.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.iqlab,
body.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.iqlab {
  color: #60a5fa;
}

html.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.ikhafa,
body.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.ikhafa {
  color: #f87171;
}

html.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.madda_normal,
body.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.madda_normal {
  color: #fb923c;
}

html.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.madda_permissible,
body.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.madda_permissible {
  color: #fbbf24;
}

html.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.madda_necessary,
body.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.madda_necessary {
  color: #fca5a5;
}

html.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.qalaqah,
body.night-mode body[data-quran-mode="tajweed"] .ayah-text tajweed.qalaqah {
  color: #67e8f9;
}


/* ===============================
   Mushaf page footer line
=============================== */

.mushaf-page-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;

  /* this spacing is the “gap” you like above the page pill */
  margin-top: 18px;
  margin-bottom: 26px;

  /* this is EXACTLY the spacing between the pill and the line */
  gap: 18px;
}

.mushaf-page-footer::after {
  content: "";
  width: 100%;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
}

html.night-mode .mushaf-page-footer::after,
body.night-mode .mushaf-page-footer::after {
  background: rgba(255, 255, 255, 0.16);
}


.q-badge--page {
  all: unset;

  display: block;
  margin-top: 32px;

  font-family: "Scheherazade New", serif;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;

  color: rgba(0, 0, 0, 0.75);
  opacity: 0.75;
  text-align: center;
}

html.night-mode .q-badge--page,
body.night-mode .q-badge--page {
  color: rgba(255, 255, 255, 0.88);
}




/* ===============================
   EASY READ MODE
   =============================== */

body.easy-read {
  font-family: "Scheherazade New",
               "Amiri Quran",
               serif;
}

body.easy-read .ayah {
  font-size: 1.6rem;
  line-height: 2.8;
  text-align: right;
}

body.easy-read .surah,
body.easy-read .surah-title {
  text-align: center;
}




/* ========================================
   STATE: MENU OPEN
======================================== */

/* LOCK SCROLL WHEN MENU OPEN */
body.menu-open,
body.search-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
  touch-action: none;
}



/* ===============================
   NIGHT MODE
   =============================== */

/* Surah section */
body.night-mode .surah,
html.night-mode .surah {
  background: transparent;
}

/* Ayah text */
body.night-mode .ayah,
html.night-mode .ayah {
  color: #f1f1f1;
}

/* Menu pills */
body.night-mode .menu-content a,
html.night-mode .menu-content a {
  background: #1e1e1e;
  color: #f1f1f1;
}

body.night-mode .menu-content a:not([aria-current="page"]):hover,
html.night-mode .menu-content a:not([aria-current="page"]):hover {
  background: #333;
}

/* Home subtitle */
body.night-mode .home-subtitle,
html.night-mode .home-subtitle {
  color: #bbbbbb;
}




/* ===============================
   NIGHT MODE — LANG SWITCH
=============================== */

body.night-mode .lang-switch button,
html.night-mode .lang-switch button {
  background: #1e1e1e;
  border: 1px solid #333;
  color: #f1f1f1;
}

body.night-mode .lang-switch button:hover,
html.night-mode .lang-switch button:hover {
  background: #2a2a2a;
}

body.night-mode .lang-switch button.active,
html.night-mode .lang-switch button.active {
  background: #f1f1f1;
  color: #000000;
  border-color: #f1f1f1;
}

body.night-mode .lang-switch button:focus-visible,
html.night-mode .lang-switch button:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #666;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

body,
.surah-container,
.menu-content a,
.search-input,
.surah-bottom-pill,
.auto-scroll-bar,
.font-size-pill,
.lang-switch button,
.next-surah-link,
.mushaf-surah-title,
.q-badge,
.mushaf-text .end {
  transition:
    background-color 420ms cubic-bezier(0.22, 1, 0.36, 1),
    color 420ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 420ms cubic-bezier(0.22, 1, 0.36, 1),
    fill 420ms cubic-bezier(0.22, 1, 0.36, 1),
    stroke 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 420ms cubic-bezier(0.22, 1, 0.36, 1);
}



body:not(.theme-ready) * {
  transition: none !important;
}

html:not(.theme-ready) * {
  transition: none !important;
}



.menu-content a[aria-current="page"] {
  background-color: #000;
  color: #fff;
}

body.night-mode .menu-content a[aria-current="page"],
html.night-mode .menu-content a[aria-current="page"] {
  background-color: #fff;
  color: #000;
}

.menu-content a:focus-visible {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
  border-radius: 20px;
}

body.night-mode .menu-content a:focus-visible,
html.night-mode .menu-content a:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.menu-content a:focus,
.menu-content a:focus-visible,
.lang-switch button:focus,
.lang-switch button:focus-visible,
.menu-toggle:focus,
.menu-toggle:focus-visible {
  outline: none;
}




/* ===============================
   HIDE MENU SCROLLBAR
=============================== */

.menu-content a,
.menu-content a * {
  -webkit-tap-highlight-color: transparent;
}

.menu-content a:focus {
  outline: none;
}

.menu-content a:focus-visible {
  outline: none;
  box-shadow: none;
}

/* Smooth blur for page behind menu */
body > *:not(.main-header):not(.surah-bottom-controls) {
  transition: filter 0.35s ease-in-out;
  will-change: filter;
}

body.menu-open > *:not(.main-header):not(.surah-bottom-controls),
body.search-open > *:not(.main-header):not(.surah-bottom-controls) {
  filter: blur(6px);
}

/* Instant blur removal when closing */
body.no-blur-transition > *:not(.main-header) {
  transition: none !important;
}




/* ========================================
   AUTO SCROLL BAR (Surah pages only)
======================================== */

.surah-bottom-controls{
  position: fixed;
  left: 50%;
  bottom: var(--nav-gap);

  transform: translateX(-50%);

  display: flex;
  align-items: flex-end;
  justify-content: center;

  gap: 12px;
  padding-inline: 0;

  direction: ltr;

  width: max-content;

  z-index: 9998;
}

body:not([data-page-type="mushaf"]) .auto-scroll-bar {
  order: 1;
}

body:not([data-page-type="mushaf"]) .surah-bottom-right {
  order: 2;

  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;

  direction: ltr;

  position: relative;
  padding-right: calc(var(--header-h) + 10px);
}

.surah-bottom-left,
.auto-scroll-bar{
  height: var(--header-h);
  width: var(--header-h);

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  isolation: isolate;

  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);

  clip-path: inset(0 round var(--nav-radius));
  -webkit-clip-path: inset(0 round var(--nav-radius));
}

.auto-scroll-bar:has(.auto-scroll-btn.is-on) {
  background-color: #ffffff;
}

html.night-mode .auto-scroll-bar:has(.auto-scroll-btn.is-on),
body.night-mode .auto-scroll-bar:has(.auto-scroll-btn.is-on) {
  background-color: #000000;
}

.surah-bottom-pill{
  height: var(--header-h);
  min-width: 104px;
  padding: 0 4px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  border-radius: 999px;
  isolation: isolate;

  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);

  clip-path: inset(0 round 999px);
  -webkit-clip-path: inset(0 round 999px);
}



html.night-mode .surah-bottom-left,
body.night-mode .surah-bottom-left,
html.night-mode .surah-bottom-pill,
body.night-mode .surah-bottom-pill,
html.night-mode .auto-scroll-bar,
body.night-mode .auto-scroll-bar{
  background-color: rgba(0, 0, 0, 0.6);
}

.left-utility-btn,
.auto-scroll-btn{
  background: none;
  border: none;
  padding: 0;

  display: grid;
  place-items: center;

  height: 55px;
  width: 55px;

  color: var(--page-text);
  cursor: pointer;

  transition: color 100ms ease;
}

.left-utility-btn{
  cursor: default;
}

.auto-icon{
  width: 38px;
  height: 38px;
  display: block;
}

.auto-chev{
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auto-thin,
.auto-mid,
.auto-thick {
  stroke-width: 2;
}

.auto-dot{
  transition:
    y 150ms cubic-bezier(0.22, 1, 0.36, 1),
    height 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

.auto-scroll-btn.is-on .auto-dot{
  transition:
    y 900ms cubic-bezier(0.22, 1, 0.36, 1),
    height 900ms cubic-bezier(0.22, 1, 0.36, 1);

  height: 6px;
  y: 1.8px;
}

.auto-scroll-btn.is-on{
  color: var(--auto-active-color);
}

.left-utility-btn:focus,
.left-utility-btn:focus-visible,
.auto-scroll-btn:focus,
.auto-scroll-btn:focus-visible,
.surah-bottom-pill-btn:focus,
.surah-bottom-pill-btn:focus-visible{
  outline: none;
  box-shadow: none;
}

.left-utility-btn,
.left-utility-btn *,
.auto-scroll-btn,
.auto-scroll-btn *,
.surah-bottom-pill-btn,
.surah-bottom-pill-btn *{
  -webkit-tap-highlight-color: transparent;
}

.left-utility-btn:focus,
.left-utility-btn:focus-visible,
.left-utility-btn:active,
.auto-scroll-btn:focus,
.auto-scroll-btn:focus-visible,
.auto-scroll-btn:active,
.surah-bottom-pill-btn:focus,
.surah-bottom-pill-btn:focus-visible,
.surah-bottom-pill-btn:active{
  outline: none !important;
  box-shadow: none !important;
}

.left-utility-btn,
.auto-scroll-btn,
.surah-bottom-pill-btn{
  -webkit-appearance: none;
  appearance: none;
}

.surah-bottom-pill-btn{
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  margin: 0;

  border: none;
  background: none;

  display: grid;
  place-items: center;

  color: var(--page-text);
  cursor: pointer;
  transition: color 100ms ease, opacity 100ms ease;
}

.surah-bottom-pill-btn:hover{
  opacity: 0.82;
}

.surah-bottom-pill-icon{
  width: 32px;
  height: 32px;
  display: block;
}

.surah-bottom-pill-icon path,
.surah-bottom-pill-icon line{
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}



/* ===============================
   NAVBAR SURAH TITLE
   - Hidden by default
   - Visible only on Surah pages
   - Smoothly fades out when menu/search opens
=============================== */

.nav-surah-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(0);

  display: flex;
  align-items: center;
  justify-content: center;

  height: 100%;

  font-family: "Scheherazade New", serif;
  font-size: 19px;
  font-weight: 700;

  pointer-events: none;
  white-space: nowrap;
   
gap: 10px;
   
  opacity: 0;
  visibility: hidden;

transition:
  opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
  visibility 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-surah-title .nav-page-number {
  margin-inline-end: 10px;
}

/* Show only on Surah pages */
body[data-surah] #nav-surah-title {
  opacity: 1;
  visibility: visible;
}

/* Hide smoothly when menu/search overlay is open */
body.menu-open #nav-surah-title,
body.search-open #nav-surah-title {
  opacity: 0;
  visibility: hidden;
}


/* ==================================================
   SURAH NAVIGATION (Previous / Next Surah Buttons)
   --------------------------------------------------
   Bottom navigation displayed after the final page
   of a Surah. Provides links to the previous and
   next Surahs with their names.

   Desktop / tablet RTL layout:
   - Next Surah on the left
   - Previous Surah on the right

   Mobile layout:
   - Previous Surah on top
   - Next Surah below
================================================== */

.surah-nav-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}

.next-surah-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 46px;
  width: 100%;
  max-width: 800px;
   
  margin: 25px auto 10px;
  padding: 0 19px;

  border-radius: 999px;
  text-decoration: none;
   
  box-sizing: border-box;
   
  background: #000000;
  color: #ffffff;

  font-family: "Scheherazade New", "Amiri Quran", serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}



.next-surah-link:active,
.previous-surah-link:active {
  transform: translateY(1px);
}

/* Remove focus outline for navigation buttons */

.next-surah-link:focus,
.previous-surah-link:focus,
.next-surah-link:active,
.previous-surah-link:active {
  outline: none !important;
  box-shadow: none !important;
}

/* Remove mobile tap highlight */
.next-surah-link,
.previous-surah-link {
  -webkit-tap-highlight-color: transparent;
}

/* Desktop / tablet order in RTL:
   Next on the left, Previous on the right */
.next-surah-link {
  order: 1;
}

.previous-surah-link {
  order: 2;
}

/* Night mode */

body.night-mode .next-surah-link,
html.night-mode .next-surah-link{
  background: #ffffff;
  color: #000000;
}


/* Mobile:
   Previous on top, Next below */
@media (max-width: 768px) {
  .surah-nav-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .previous-surah-link {
    order: 1;
  }

  .next-surah-link {
    order: 2;
  }

  .next-surah-link,
  .previous-surah-link {
    width: 100%;
  }
}


/* ========================================
   MUSHAF MODE
   Single-font Mushaf rendering
======================================== */

body[data-quran-mode="mushaf"] .ayah {
  align-items: baseline;
}

body[data-quran-mode="mushaf"] .ayah-text {
  display: inline;
  direction: rtl;
  unicode-bidi: plaintext;

  font-family: "Amiri Quran", "Amiri", serif;
  font-size: 1.36rem;
  font-weight: 400;

  line-height: 2.45;
  letter-spacing: 0;
  word-spacing: 0.01em;

  white-space: normal;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-variant-ligatures: contextual common-ligatures;
  font-feature-settings: "calt" 1, "liga" 1, "kern" 1;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body[data-quran-mode="mushaf"] .bismillah {
  font-family: "Amiri Quran", "Amiri", serif;
  font-size: 2rem;
  line-height: 1.9;
}

body[data-quran-mode="mushaf"] .q-badge--ayah {
  align-self: center;
}

@media (max-width: 768px) {
  body[data-quran-mode="mushaf"] .ayah-text {
    font-size: 1.2rem;
    line-height: 2.25;
  }

  body[data-quran-mode="mushaf"] .bismillah {
    font-size: 1.7rem;
  }
}


/* ========================================
   SEARCH UI (Overlay Contents)
   - Clean, centered sheet
   - RTL-ready for Arabic
======================================== */

/* Search sheet wrapper (centers within expanded header) */
.search-sheet{
  margin: 0 auto;
  max-width: 800px;
  padding: 0 19px;
   
  height: auto;
  display: flex;
  flex-direction: column;
}

/* Sticky header area inside the search overlay
   - Creates the permanent top “mask zone” ABOVE the input
   - Covers results while they scroll underneath */
.search-head{
  position: sticky;
  top: 0;
  z-index: 5;
  background: transparent;
}


.search-input-wrap{
  position: relative;
  width: 100%;

  display: flex;
  align-items: center;
  gap: 10px;
  flex-direction: row-reverse;
}


/* Search input */
.search-input{
 width: 100%;
  flex: 1;
  height: 56px;

  border-radius: 20px;
  border: none;

  /* Exact same glass effect as the nav bar */
  background-color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
   
  color: var(--page-text);

  padding-block: 0;
  line-height: 44px;

  padding-inline: 52px 36px;

  font: inherit;
  outline: none;

  -webkit-appearance: none;
  appearance: none;

  margin-top: 0;

  position: relative;
  z-index: 1;
}

.search-input-wrap[dir="rtl"] .search-input{
  padding-right: 52px;
  padding-left: 36px;
}

.search-input-wrap[dir="ltr"] .search-input{
  padding-left: 52px;
  padding-right: 36px;
}

html.night-mode .search-input,
body.night-mode .search-input{
  background-color: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

.search-submit{
  position: absolute;
  top: 50%;
  right: 6px;          /* Force icon to the right side */
  left: auto;          /* Remove any left positioning */
  inset-inline-end: auto;
  transform: translateY(calc(-50% - 1px)); /* Move up by 1px */

  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;

  border: none;
  background: transparent;
  border-radius: 0;
  box-sizing: border-box;

  color: var(--control-stroke);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  cursor: default;
  pointer-events: none;

  -webkit-tap-highlight-color: transparent;

  z-index: 3;
}


.search-submit-icon{
  width: 30px;
  height: 30px;
  display: block;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Active state in light mode */
.search-submit.is-active{
  color: #5a5a5f;
  background: transparent;
  border: none;

  cursor: pointer;
  pointer-events: auto;
}

/* Dark mode default */
html.night-mode .search-submit,
body.night-mode .search-submit{
  color: #8e8e93;
}

/* Active state in dark mode */
html.night-mode .search-submit.is-active,
body.night-mode .search-submit.is-active{
  color: #c7c7cc;
  background: transparent;
  border: none;

  cursor: pointer;
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  .search-submit.is-active:hover{
    color: #000000;
  }

  html.night-mode .search-submit.is-active:hover,
  body.night-mode .search-submit.is-active:hover{
    color: #ffffff;
  }
}

/* ========================================
   SEARCH INPUT CLEAR BUTTON (Native X)
   - Native behavior preserved
   - Styled fill + SVG icon
======================================== */

.search-input::-webkit-search-cancel-button{
  -webkit-appearance: none;
  appearance: none;

  width: 44px;
  height: 44px;

  border-radius: 0;
  margin-left: -35px;

  /* Light mode: obvious dark grey circle */
  background-color: transparent;
  background-size: 22px 22px;
  background-repeat: no-repeat;
  background-position: center;

  cursor: pointer;
  opacity: 0.5;
  transition: opacity 200ms ease;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='7' fill='%23000000'/%3E%3Cpath d='M6.5 6.5 L11.5 11.5 M11.5 6.5 L6.5 11.5' fill='none' stroke='%23ffffff' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

@media (hover: hover) and (pointer: fine) {
  .search-input::-webkit-search-cancel-button:hover{
    opacity: 1;
  }
}

html.night-mode .search-input::-webkit-search-cancel-button,
body.night-mode .search-input::-webkit-search-cancel-button{
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='7' fill='%23ffffff'/%3E%3Cpath d='M6.5 6.5 L11.5 11.5 M11.5 6.5 L6.5 11.5' fill='none' stroke='%23000000' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
}


/* Results stack */
.search-results{
  margin-top: 12px;

  display: flex;
  flex-direction: column;
  gap: 10px;

  direction: rtl;
  text-align: right;
}

/* Result row (button) — no borders, keep hover */
.search-result{
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: calc(100% - 80px);
  
  border: none !important;
  outline: none;
  box-shadow: none;

  background: transparent;
   
  padding: 12px 14px;
  margin: 0;
  margin-inline: auto;

  text-align: right;

  appearance: none;
  -webkit-appearance: none;

  cursor: pointer;
  color: var(--page-text);

  border-radius: 13px;
   
  font-family: "Amiri Quran", serif;
  font-size: 20px;
  line-height: 1.6;
  font-feature-settings: "calt" 1, "liga" 1;

  transition: background 0.15s ease;
}

.search-result-meta {
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.65;
}

/* Hover */
.search-result:hover{
  background: rgba(0,0,0,0.04);
}

html.night-mode .search-result:hover,
body.night-mode .search-result:hover{
  background: rgba(255,255,255,0.10);
}

html.night-mode .search-result-meta,
body.night-mode .search-result-meta {
  color: rgba(255, 255, 255, 0.68);
}

/* Empty / hint text */
.search-empty{
  opacity: 0.7;
  padding: 16px 4px;

  direction: rtl;
  text-align: right;
}

/* ========================================
   SEARCH MATCH HIGHLIGHT
   Highlight matched text inside search results
======================================== */

.search-highlight{
  background: rgba(0, 0, 0, 0.10);
  color: inherit;
  border-radius: 4px;
  padding: 0 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

html.night-mode .search-highlight,
body.night-mode .search-highlight{
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
}

/* ========================================
   AYAH LANDING HIGHLIGHT
   Smooth fade highlight when jumping to ayah
======================================== */

.ayah-targeted{
  background: rgba(0,0,0,0.10);
  border-radius: 18px;
  animation: ayahFlashLight 3.5s ease forwards;
}

/* Light mode animation */
@keyframes ayahFlashLight{
  0%{
    background: rgba(0,0,0,0.16);
  }

  60%{
    background: rgba(0,0,0,0.10);
  }

  100%{
    background: transparent;
  }
}

/* Dark mode (slightly brighter grey) */
html.night-mode .ayah-targeted,
body.night-mode .ayah-targeted{
  animation: ayahFlashDark 3.5s ease forwards;
}

@keyframes ayahFlashDark{
  0%{
    background: rgba(255,255,255,0.20);
  }

  60%{
    background: rgba(255,255,255,0.14);
  }

  100%{
    background: transparent;
  }
}


/* ========================================
   FOCUS CLEANUP (Search + Header Controls)
   Removes browser focus outlines and tap highlights
======================================== */

.search-input:focus,
.search-input:focus-visible,
.search-result:focus,
.search-result:focus-visible{
  outline: none;
  box-shadow: none;
}

/* Remove mobile tap highlight */

.search-input,
.search-result{
  -webkit-tap-highlight-color: transparent;
}


/* ==================================================
   SEARCH PAGE
================================================== */

.search-page {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 42px) 19px 48px;
  box-sizing: border-box;
}

.search-page-header {
  margin-top: -35px;
  margin-bottom: 20px;
}

.search-page-title {
  margin: 0;
  font-family: "Amiri Quran", serif;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--page-text);
}

.search-page-subtitle {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: #909090;
  width: 100%;
  text-align: center;
}

.search-page-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-page-results .search-result {
  display: flex;
  flex-direction: column;
  gap: 4px;

  width: 100%;
  padding: 16px 18px;

  border-radius: 18px;
  text-decoration: none;

  background: rgba(0, 0, 0, 0.035);
  color: var(--page-text);

  box-sizing: border-box;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.search-page-results .search-result:hover {
  background: rgba(0, 0, 0, 0.06);
}

.search-page-results .search-result:active {
  transform: translateY(1px);
}

.search-page-results .search-result-type {
  font-size: 12px;
  line-height: 1.3;
  opacity: 0.6;
}

.search-page-results .search-result-text {
  font-family: "Amiri Quran", serif;
  font-size: 20px;
  line-height: 1.5;
  word-break: break-word;
}

.search-page-results .search-empty {
  padding: 18px 4px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted-text, rgba(0, 0, 0, 0.58));
}

html.night-mode .search-page-title,
body.night-mode .search-page-title,
html.night-mode .search-page-results .search-result,
body.night-mode .search-page-results .search-result {
  color: #ffffff;
}

html.night-mode .search-page-subtitle,
body.night-mode .search-page-subtitle {
  color: #A8A8A8;
}

html.night-mode .search-page-results .search-empty,
body.night-mode .search-page-results .search-empty,
html.night-mode .search-page-results .search-result-type,
body.night-mode .search-page-results .search-result-type {
  color: rgba(255, 255, 255, 0.68);
}


html.night-mode .search-page-results .search-result,
body.night-mode .search-page-results .search-result {
  background: rgba(255, 255, 255, 0.08);
}

html.night-mode .search-page-results .search-result:hover,
body.night-mode .search-page-results .search-result:hover {
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 768px) {
  .search-page {
    padding-top: calc(var(--header-h) + 34px);
    padding-bottom: 34px;
  }

  .search-page-title {
    font-size: 29px;
  }

  .search-page-results .search-result {
    padding: 14px 16px;
    border-radius: 18px;
  }

  .search-page-results .search-result-text {
    font-size: 20px;
  }
}

.search-page-results .search-result-meta {
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.65;
}

html.night-mode .search-page-results .search-result-meta,
body.night-mode .search-page-results .search-result-meta {
  color: rgba(255, 255, 255, 0.68);
}

.search-page-input-wrap {
  margin-bottom: 20px;
}



/* ========================================
   MUSHAF PAGE
   - Clean continuous Quran layout
   - Page-based structure (virtualization ready)
======================================== */

/* Main container */
.mushaf-container {
  max-width: 720px;
  margin: 0 auto;

  padding-top: 20px;
  padding-bottom: 60px;
   
  color: var(--mushaf-text);
   
  position: relative;
}


body.mushaf-surah-picker-open .mushaf-container {
  opacity: 0.25;

  transition:
    opacity 550ms cubic-bezier(0.22, 1, 0.36, 1);
}


/* Each Mushaf page */
.mushaf-page {
  width: 100%;

  min-height: 88vh;
  max-height: none;

  padding: 20px 0;
   
  display: flex;
  flex-direction: column;
  justify-content: space-between;

  margin-bottom: 10px;
}

/* Quran text block (core layout) */
.mushaf-text {
  direction: rtl;

  padding: 0 20px;
   
  text-align: justify;
  text-align-last: right;

  font-family: "Amiri Quran", serif;
  font-size: 27px;

  line-height: 2.5;
  word-spacing: 0.02em;
  letter-spacing: 0;

  flex: 1;
  max-height: 100%;
  overflow: visible;

  text-wrap: pretty;
  white-space: normal;

  text-rendering: optimizeLegibility;
  font-kerning: normal;

  font-feature-settings:
    "calt" 1,
    "liga" 1,
    "kern" 1;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


.mushaf-ayah-inline {
  display: inline;
  vertical-align: baseline;
}

/* Inline ayah */
.mushaf-text span {
  display: inline;
}

/* Page separator (clean line) */
.mushaf-page::after {
  content: "";
  display: block;

  width: 100%;
  height: 1px;

  margin-top: 18px;

  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;

  flex-shrink: 0;
}

/* Dark mode separator */
html.night-mode .mushaf-page::after,
body.night-mode .mushaf-page::after {
  background: rgba(255, 255, 255, 0.16);
}

/* Page number (simple, NOT pill) */
.mushaf-page-number {
  text-align: center;

  margin-top: 32px;

  font-size: 25px;
  font-weight: 700;

  letter-spacing: 0.5px;
   
  opacity: 0.75;

  flex-shrink: 0;
}

/* Dark mode page number */
html.night-mode .mushaf-page-number,
body.night-mode .mushaf-page-number {
  opacity: 0.85;
}


/* ========================================
   MUSHAF SURAH START
======================================== */

.mushaf-surah-start {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-bottom: 18px;
}

.mushaf-surah-title {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  max-width: 800px;       /* 🔥 EXACT same as navbar */
  margin: 25px auto 10px;

  height: 46px;

  padding: 0 19px;        /* 🔥 SAME as navbar */

  box-sizing: border-box;

  border-radius: 999px;

  background: #000000;
  color: #ffffff;

  font-family: "Scheherazade New", "Amiri Quran", serif;
  font-size: 24px;
  font-weight: 700;

  text-align: center;
}

.mushaf-bismillah {
  font-family: "Amiri Quran", serif;
  font-size: 22px;
  line-height: 1.8;
  margin-top: 25px;
  margin-bottom: 25px;
}


html.night-mode .mushaf-surah-title,
body.night-mode .mushaf-surah-title {
  background: #ffffff;
  color: #000000;
}


/* ========================================
   MUSHAF AYAH NUMBER (API BASED)
======================================== */

.mushaf-text .end {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 26px;
  min-width: 26px;
  padding: 0 5px;

  margin-inline: 0;

  border-radius: 999px;

  font-family: "Scheherazade New", serif;
  font-size: 15px;
  line-height: 1;
  font-weight: 700;

  white-space: nowrap;
  user-select: none;

  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;

  background: transparent;
  border: 1px solid currentColor;
  color: inherit;

  vertical-align: middle;
  text-align: center;
}

html.night-mode .mushaf-text .end,
body.night-mode .mushaf-text .end {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}


/* ========================================
   MUSHAF BOTTOM CONTROLS
   - Auto scroll (left)
   - Next Surah pill (right)
   - Clean, minimal, no unused arrow styles
======================================== */

.mushaf-scroll-bottom-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;

  height: 44px;
  padding: 0 16px;

  border: none;
  border-radius: 999px;

  background: rgba(0, 0, 0, 0.72);
  color: #fff;

  font-family: "Scheherazade New", serif;
  font-size: 17px;
  font-weight: 700;

  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mushaf-scroll-bottom-btn:focus,
.mushaf-scroll-bottom-btn:focus-visible {
  outline: none;
  box-shadow: none;
}

html.night-mode .mushaf-scroll-bottom-btn,
body.night-mode .mushaf-scroll-bottom-btn {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Remove unused left slot */
.surah-bottom-left {
  display: none !important;
}

/* Mushaf bottom layout */
body[data-page-type="mushaf"] .surah-bottom-controls {
  left: 50%;
  right: auto;
  bottom: var(--nav-gap);

  transform: translateX(-50%);

  display: flex;
  align-items: flex-end;
  justify-content: center;

  gap: 12px;
  padding-inline: 0;

  width: max-content;

  direction: ltr;
}

/* Auto scroll left */
body[data-page-type="mushaf"] .auto-scroll-bar {
  order: 1;
}

/* Right-side group */
body[data-page-type="mushaf"] .mushaf-bottom-right {
  order: 2;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
  direction: ltr;

  position: relative;
  padding-right: calc(var(--header-h) + 10px);
}



/* Inside right group: Next Surah first, Font second */
body[data-page-type="mushaf"] .mushaf-next-surah-btn {
  order: 1;
  direction: rtl;

  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-direction: column;

  text-decoration: none;
  color: var(--page-text);
   
  padding-inline: 12px;
  gap: 0px;
}

body[data-page-type="mushaf"] .font-size-pill {
  order: 2;
}

#mushafNextSurahName {
  white-space: nowrap;
  font-weight: 700;
  font-size: 18px;
}





.font-size-btn--small {
  font-size: 13px;
}

.font-size-btn--normal {
  font-size: 16px;
}

.font-size-btn--large {
  font-size: 22px;
}



.font-size-btn.is-active {
  opacity: 1;
}

.font-size-btn:not(.is-active) {
  opacity: 0.45;
}

/* Apply larger Quran text size */
body[data-quran-font-size="small"] .ayah-text {
  font-size: 0.9em;
}

body[data-quran-font-size="small"] .mushaf-text {
  font-size: 24px;
}

body[data-quran-font-size="large"] .ayah-text {
  font-size: 1.2em;
}

body[data-quran-font-size="large"] .mushaf-text {
  font-size: 32px;
}


/* ========================================
   QURAN FONT SIZE CONTROL
======================================== */

.surah-bottom-controls {
  align-items: flex-end;
}

.font-size-pill {
  position: absolute;
  right: 0;
  bottom: 0;

  width: var(--header-h);
  height: var(--header-h);
  padding: 0;

  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-start;

  border-radius: 999px;
  isolation: isolate;
  overflow: hidden;

  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);

  clip-path: inset(0 round 999px);
  -webkit-clip-path: inset(0 round 999px);

  flex-shrink: 0;

transition:
  width 420ms cubic-bezier(0.22, 1, 0.36, 1),
  background-color 420ms cubic-bezier(0.22, 1, 0.36, 1),
  opacity 120ms ease;
   
  z-index: 100;
}

.font-size-pill.is-open {
  width: var(--font-size-open-width);
  height: var(--header-h);
  background-color: #ffffff;

  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}


html.night-mode .font-size-pill,
body.night-mode .font-size-pill {
  background-color: rgba(0, 0, 0, 0.6);
}

html.night-mode .font-size-pill.is-open,
body.night-mode .font-size-pill.is-open {
  background-color: #000000;
}

.font-size-trigger,
.font-size-btn {
  width: var(--header-h);
  height: var(--header-h);
  min-width: var(--header-h);
  min-height: var(--header-h);

  position: relative;
  z-index: 1;

  padding: 0;
  margin: 0;

  border: none;
  background: none;

  display: grid;
  place-items: center;

  color: var(--page-text);
  cursor: pointer;

  font-family: "Scheherazade New", serif;
  font-weight: 700;
  line-height: 1;

  -webkit-tap-highlight-color: transparent;
}

.font-size-trigger {
  flex: 0 0 var(--header-h);
  font-size: 24px;
}

.font-size-pill.is-open .font-size-trigger {
  pointer-events: none;
}

.font-size-pill.is-open .font-size-trigger,
.font-size-pill.is-open .font-size-btn {
  color: #000000;
}

html.night-mode .font-size-pill.is-open .font-size-trigger,
html.night-mode .font-size-pill.is-open .font-size-btn,
body.night-mode .font-size-pill.is-open .font-size-trigger,
body.night-mode .font-size-pill.is-open .font-size-btn {
  color: #ffffff;
}

/* Closed-state big letter */
.font-size-trigger::before {
  content: "ء";

  position: absolute;

  top: 50%;
  left: 18px;

  transform: translateY(-70%);

  font-family: "Scheherazade New", serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;

  opacity: 1;

  transition:
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0ms linear 0ms;
}

/* Closed-state small letter */
.font-size-trigger .font-size-trigger-large {
  position: absolute;

  top: 50%;
  left: 34px;

  transform: translateY(-70%);

  font-family: "Scheherazade New", serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;

  opacity: 1;
  pointer-events: none;

  transition:
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0ms linear 0ms;
}



/* Opening: letters disappear instantly */
.font-size-pill.is-open .font-size-trigger::before,
.font-size-pill.is-open .font-size-trigger .font-size-trigger-large {
  opacity: 0;
  transform: translate(-18px, -70%);
  transition:
    transform 0ms linear,
    opacity 0ms linear;
}


/* Menu expands to the left of the trigger */
.font-size-menu {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;

  flex-shrink: 0;

  gap: 0;
   
  transform: translate(60px, -14px);
   
  pointer-events: none;
}


.font-size-menu .font-size-btn {
  opacity: 0;
  visibility: hidden;
  margin-inline-start: -14px;

  transition: none;
}










.font-size-pill.is-open .font-size-menu {
  pointer-events: auto;
}


.font-size-pill.is-open .font-size-menu .font-size-btn {
  opacity: 1;
  visibility: visible;

  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1) 50ms,
    visibility 0ms linear 0ms;
}


.font-size-btn {
  transition:
    transform 160ms ease;
}


.font-size-btn::before {
  content: "";
  transform: translateY(-6px);
}

.font-size-btn:not(.is-active) {
  color: #000000;
}

html.night-mode .font-size-btn:not(.is-active),
body.night-mode .font-size-btn:not(.is-active) {
  color: #ffffff;
}

.font-size-pill.is-open .font-size-btn:not(.is-active) {
  color: #000000;
  opacity: 1;
}

html.night-mode .font-size-pill.is-open .font-size-btn:not(.is-active),
body.night-mode .font-size-pill.is-open .font-size-btn:not(.is-active) {
  color: #ffffff;
  opacity: 1;
}

.font-size-btn.is-active {
  opacity: 1;
  color: #ffffff;

  background-image: radial-gradient(
    circle at 50% 73%,
    #000000 0 15px,
    transparent 16px
  );
}

html.night-mode .font-size-btn.is-active,
body.night-mode .font-size-btn.is-active {
  color: #000000;

  background-image: radial-gradient(
    circle at 50% 73%,
    #ffffff 0 15px,
    transparent 16px
  );
}


.mushaf-surah-pill,
.auto-scroll-bar {
  opacity: 1;
  transform: translateY(0);

  transition:
    opacity 120ms ease,
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 420ms cubic-bezier(0.22, 1, 0.36, 1);
}



.font-size-pill.is-open .font-size-btn.is-active {
  color: #ffffff;

  background-image: radial-gradient(
    circle at 50% 73%,
    #000000 0 15px,
    transparent 16px
  );
}

html.night-mode .font-size-pill.is-open .font-size-btn.is-active,
body.night-mode .font-size-pill.is-open .font-size-btn.is-active {
  color: #000000;

  background-image: radial-gradient(
    circle at 50% 73%,
    #ffffff 0 15px,
    transparent 16px
  );
}

.font-size-btn--xs { font-size: 20px; }
.font-size-btn--sm { font-size: 24px; }
.font-size-btn--md { font-size: 30px; }
.font-size-btn--lg { font-size: 34px; }
.font-size-btn--xl { font-size: 40px; }

.font-size-trigger,
.font-size-trigger:focus,
.font-size-trigger:focus-visible,
.font-size-trigger:active,
.font-size-btn:focus,
.font-size-btn:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}


/* Ayah text */

body[data-quran-font-size="xsmall"] .ayah-text {
  font-size: 0.72em;
}

body[data-quran-font-size="small"] .ayah-text {
  font-size: 0.86em;
}

body[data-quran-font-size="large"] .ayah-text {
  font-size: 1.32em;
}

body[data-quran-font-size="xlarge"] .ayah-text {
  font-size: 1.72em;
}


/* Mushaf text */

body[data-quran-font-size="xsmall"] .mushaf-text {
  font-size: 19px;
}

body[data-quran-font-size="small"] .mushaf-text {
  font-size: 23px;
}

body[data-quran-font-size="large"] .mushaf-text {
  font-size: 36px;
}

body[data-quran-font-size="xlarge"] .mushaf-text {
  font-size: 46px;
}


/* ========================================
   MUSHAF SURAH PICKER
======================================== */

.mushaf-surah-pill {
  position: relative;

  width: 104px;
  height: var(--header-h);

  display: flex;
  flex-direction: column;

  border-radius: var(--nav-radius);
  overflow: hidden;
  isolation: isolate;

  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);

  clip-path: inset(0 round var(--nav-radius));
  -webkit-clip-path: inset(0 round var(--nav-radius));

  flex-shrink: 0;

  transition:
    width 420ms cubic-bezier(0.22, 1, 0.36, 1),
    height 420ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.mushaf-surah-picker-open .mushaf-surah-pill {
  width: calc(100vw - (2 * var(--nav-inset)));
  height: calc(100dvh - var(--header-h) - var(--nav-gap) - 130px);
  background-color: #ffffff;
}



html.night-mode .mushaf-surah-pill,
body.night-mode .mushaf-surah-pill {
  background-color: rgba(0, 0, 0, 0.1);
}

html.night-mode body.mushaf-surah-picker-open .mushaf-surah-pill,
body.night-mode.mushaf-surah-picker-open .mushaf-surah-pill {
  background-color: #000000;
}

.mushaf-surah-pill .mushaf-next-surah-btn {
  width: 100%;
  min-width: 0;
  height: var(--header-h);
  min-height: var(--header-h);

  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  clip-path: none;
  -webkit-clip-path: none;
}


body.mushaf-surah-picker-open .mushaf-surah-pill .mushaf-next-surah-btn {
  height: 50px;
  min-height: 50px;
}


.mushaf-surah-picker {
  order: 1;
}

.mushaf-next-surah-btn {
  order: 2;
}

.mushaf-surah-picker {
  flex: 1;
  min-height: 0;

  padding: 0px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;

  opacity: 0;
  pointer-events: none;

  transform: translateY(8px);

  transition:
    opacity 220ms ease 80ms,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.mushaf-surah-picker-open .mushaf-surah-picker {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}


.mushaf-surah-picker-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;

  display: flex;
  flex-direction: column;
  gap: 0;

  padding-top: 8px;
  padding-bottom: 26px;

  direction: rtl;

  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.mushaf-surah-picker-list::-webkit-scrollbar {
  display: none;
}

.mushaf-surah-picker-item {
  width: 100%;
  height: 56px;
  min-height: 56px;

  border: none;
  border-radius: 0;

  background: transparent;
  color: inherit;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0 16px;
  box-sizing: border-box;

  font-family: "Scheherazade New", serif;
  font-size: 21px;
  font-weight: 700;

  text-align: center;
  direction: rtl;

  cursor: pointer;

  transition:
    background-color 120ms ease,
    border-radius 120ms ease,
    transform 120ms ease;
}

.mushaf-surah-picker-item.is-current-surah {
  background: rgba(0, 0, 0, 0.10);
  border-radius: 999px;
}

html.night-mode .mushaf-surah-picker-item.is-current-surah,
body.night-mode .mushaf-surah-picker-item.is-current-surah {
  background: rgba(255, 255, 255, 0.18);
}

body.mushaf-surah-picker-open {
  overflow: hidden;
}


body.mushaf-surah-picker-open .font-size-pill,
body.mushaf-surah-picker-open .auto-scroll-bar {
  opacity: 0;
  pointer-events: none;

  transition: none;
}


.fihris-icon {
  width: 46px;
  height: 24px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;
}

.fihris-chevron-svg {
  width: 46px;
  height: 24px;

  display: block;
   
  position: relative;
  top: 2px;
   
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fihris-chevron-svg line {
  stroke-width: 3.4;
  stroke-linecap: round;
}

.fihris-label {
  font-family: "Scheherazade New", serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
   
  opacity: 1;
    transform: translateY(-2px);
    transition: opacity 120ms ease;
}

body.mushaf-surah-picker-open .fihris-label {
  opacity: 0;
  transition: none;
}


body.mushaf-surah-picker-open .fihris-icon {
  transform: translateY(10px);
}

#mushafNextSurahBtn,
.mushaf-surah-picker-item {
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

#mushafNextSurahBtn:focus,
#mushafNextSurahBtn:focus-visible,
#mushafNextSurahBtn:active,
.mushaf-surah-picker-item:focus,
.mushaf-surah-picker-item:focus-visible,
.mushaf-surah-picker-item:active {
  outline: none !important;
  box-shadow: none !important;
}



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

.home-footer {
  position: relative;

  margin-top: 60px;
  padding-top: 60px;
  padding-bottom: 60px;

  width: calc(100% - (2 * var(--nav-inset)));
  margin-left: auto;
  margin-right: auto;

  text-align: center;

  --footer-width: 95%;
  --footer-line: rgba(0, 0, 0, 0.20);
}

.home-footer::before {
  display: none;
  content: "";

  position: absolute;
  top: 0;
  left: calc((100% - var(--footer-width)) / 2);

  width: var(--footer-width);
  height: 1px;

  background: var(--footer-line);
}

.night-mode .home-footer {
  --footer-line: rgba(255, 255, 255, 0.28);
}


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

.home-footer-inner {
  width: var(--footer-width);
  margin: 0 auto;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 4px;
  direction: ltr;
}

.footer-logo {
  width: 60px;
  height: auto;
  display: block;

  color: var(--footer-line);
}

