/* Shared floating header and compact footer for the refreshed secondary pages. */
.site-shell-page { overflow-x: hidden; }
.site-shell-page > .site-header,
.site-shell-page > .mall-header,
.site-shell-page > .contact-header { display: none !important; }
.site-shell-page > .modern-home-footer,
.site-shell-page > .site-footer,
.site-shell-page > .mall-footer { display: block !important; background: transparent !important; border: 0 !important; padding: 0 !important; margin: 0 !important; }
.site-shell-page > .site-footer > .footer-inner,
.site-shell-page > .mall-footer > .footer-inner,
.site-shell-page > .modern-home-footer > .mhf-container { display: none !important; }
.site-shell-page > .copier-mini-footer { display: none !important; }
.site-shell-page > .site-shell-footer,
.site-shell-page > .site-footer > .site-shell-footer { display: block !important; }
.site-shell {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  z-index: 1100;
  width: 620px;
  max-width: calc(100vw - 48px);
  transform: translateX(-50%);
  pointer-events: none;
}
.site-shell-nav {
  pointer-events: auto;
  height: 60px;
  margin-top: 23px;
  border-radius: 30px;
  overflow: hidden;
  background: rgba(237, 237, 237, .68);
  -webkit-backdrop-filter: blur(48px) saturate(150%);
  backdrop-filter: blur(48px) saturate(150%);
  transition: height .55s cubic-bezier(.32,.72,0,1), background .3s ease;
}
html[data-theme="dark"] .site-shell-nav,
body.theme-dark .site-shell-nav,
body.theme-night .site-shell-nav { background: rgba(26,27,28,.74); }
.site-shell-topbar { height: 60px; padding: 0 12px 0 24px; display: flex; align-items: center; justify-content: space-between; }
.site-shell-avatar-link { display: inline-flex; padding: 3px; flex: 0 0 auto; }
.site-shell-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 0; }
.site-shell-links { display: none; align-items: center; gap: 32px; }
.site-shell-link { color: #141414; text-decoration: none; font-family: 'Thmanyah Sans', sans-serif; font-size: 16px; font-weight: 600; transition: opacity .2s ease; }
html[data-theme="dark"] .site-shell-link,
body.theme-dark .site-shell-link,
body.theme-night .site-shell-link { color: #fafafa; }
.site-shell-link:hover { opacity: .55; }
.site-shell-mobile-controls { display: inline-flex; align-items: center; gap: 4px; }
.site-shell-trigger,
.site-shell-theme { border: 0; background: transparent; color: #141414; cursor: pointer; }
html[data-theme="dark"] .site-shell-trigger,
html[data-theme="dark"] .site-shell-theme,
body.theme-dark .site-shell-trigger,
body.theme-dark .site-shell-theme,
body.theme-night .site-shell-trigger,
body.theme-night .site-shell-theme { color: #fafafa; }
.site-shell-theme { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; }
.site-shell-trigger { position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.site-shell-trigger-box { position: relative; width: 20px; height: 20px; }
.site-shell-line { position: absolute; right: 4px; width: 12px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .5s ease, top .5s ease; }
.site-shell-line:first-child { top: 5px; }
.site-shell-line:last-child { top: 13px; }
.site-shell-nav.is-open .site-shell-line:first-child { top: 9px; transform: rotate(45deg); }
.site-shell-nav.is-open .site-shell-line:last-child { top: 9px; transform: rotate(-45deg); }
.site-shell-panel { display: block; padding: 6px 20px 16px; }
.site-shell-panel-link,
.site-shell-panel-theme { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 42px; padding: 8px 0; color: #141414; background: transparent; border: 0; text-decoration: none; font-family: 'Thmanyah Sans', sans-serif; font-size: 18px; font-weight: 600; text-align: right; opacity: 0; transform: translateY(10px); transition: opacity .45s ease, transform .45s ease; }
html[data-theme="dark"] .site-shell-panel-link,
html[data-theme="dark"] .site-shell-panel-theme,
body.theme-dark .site-shell-panel-link,
body.theme-dark .site-shell-panel-theme,
body.theme-night .site-shell-panel-link,
body.theme-night .site-shell-panel-theme { color: #fafafa; }
.site-shell-nav.is-open .site-shell-panel-link,
.site-shell-nav.is-open .site-shell-panel-theme { opacity: 1; transform: translateY(0); }
.site-shell-panel-theme { cursor: pointer; }
.site-shell-panel-theme svg { width: 18px; height: 18px; }
.site-shell-panel-home { display: flex; align-items: center; justify-content: center; min-height: 38px; margin-top: 10px; padding: 0 14px; border-radius: 999px; background: #141414; color: #fff; text-decoration: none; font-family: 'Thmanyah Sans', sans-serif; font-size: 14px; font-weight: 600; }
html[data-theme="dark"] .site-shell-panel-home,
body.theme-dark .site-shell-panel-home,
body.theme-night .site-shell-panel-home { background: #fafafa; color: #111; }
.site-shell-page > .site-shell-footer { display: block; }
.site-shell-footer { width: min(900px, 100%); max-width: 900px; margin-inline: auto; padding: 18px 20px 38px; box-sizing: border-box; }
.site-shell-footer .mini-footer-inner { width: 100%; margin-inline: auto; padding-top: 22px; border-top: 1px solid rgba(13,110,86,.2); display: flex; align-items: center; justify-content: space-between; }
.site-shell-footer .mini-footer-profile { margin-inline: auto; align-items: center; }
.site-shell-footer .copier-back-to-top-btn { margin-inline: auto; }
.site-shell-rights { margin: 3px 0 0; color: var(--text-muted, #8b8f97); font-size: .78rem; }
@media (max-width: 809px) {
  .site-shell { left: 24px; right: 24px; width: auto; max-width: none; transform: none; }
  .site-shell-nav { height: 52px; margin-top: 8px; border-radius: 28px; }
  .site-shell-topbar { height: 52px; padding: 0 4px 0 20px; }
  .site-shell-links { display: none; }
  .site-shell-mobile-controls { display: inline-flex; }
  .site-shell-theme { display: none; }
  .site-shell-panel { display: block; }
  .site-shell-footer { padding: 18px 18px 38px; }
  .site-shell-footer .mini-footer-inner { align-items: center; flex-direction: column; gap: 18px; }
  .site-shell-footer .mini-footer-profile { align-items: center; justify-content: center; text-align: center; }
  .site-shell-footer .copier-back-to-top-btn { align-self: center; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .site-shell-nav, .site-shell-line, .site-shell-panel-link, .site-shell-panel-theme { transition-duration: .001s; }
}

/* Keep the homepage header consistent with the shared shell. */
.home-shell-page .site-shell-nav {
  border-radius: 30px;
}

body.theme-dark.home-shell-page .site-shell-nav,
body.theme-night.home-shell-page .site-shell-nav {
  background: rgba(26, 27, 28, .74);
}

@media (max-width: 809px) {
  .home-shell-page .site-shell-nav { border-radius: 28px; }
}

/* ═══════════════════════════════════════
   HOMEPAGE SHELL (index.html)
   Same interactive shell as tafsir/translation, plus the
   verse-search pill and the connected font dropdown.
═══════════════════════════════════════ */
.home-shell-page .site-shell-topbar { gap: 10px; }
.home-shell-page .site-shell-links { display: none; }
.home-shell-page .site-shell-mobile-controls { display: inline-flex; }
.home-shell-page .site-shell-panel { display: block; }
.home-shell-page .site-shell-nav:has(.home-font-panel.open) .site-shell-panel { display: none; }
.home-shell-page .site-shell-nav:has(.home-font-panel.open) {
  transition: none !important;
}
.home-shell-page .site-shell-font-btn { transform: translateX(-10px); }
.home-shell-page .site-shell-links { flex: 1 1 240px; gap: 8px; }
.home-shell-page .site-shell-link { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; font-size: 13px; }

/* Verse search: written text inside the bar → white field on focus */
.home-shell-page .site-shell-search {
  display: flex;
  align-items: center;
  flex: 0 1 150px;
  width: 150px;
  min-width: 118px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  overflow: hidden;
  cursor: text;
  transition: width .45s cubic-bezier(.22, 1, .36, 1), flex-basis .45s cubic-bezier(.22, 1, .36, 1), background .25s ease, border-color .25s ease;
}
.home-shell-page .site-shell-search:focus-within,
.home-shell-page .site-shell-search:focus,
.home-shell-page .site-shell-search.is-search-open {
  flex: 0 0 245px !important;
  width: 245px !important;
  background: #fff !important;
  border-color: rgba(0, 0, 0, .14) !important;
}
.home-shell-page .site-shell-search-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--text-muted, #8b8f97);
}
.home-shell-page .site-shell-search-input {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary, #14171c);
  font: 500 .86rem 'Thmanyah Sans', sans-serif;
}
.home-shell-page .site-shell-search-input::placeholder { color: var(--text-muted, #8b8f97); opacity: .8; }
body.theme-dark .site-shell-search-input,
body.theme-night .site-shell-search-input,
body.theme-dark .trans-shell-page .site-shell-search-input,
body.theme-night .trans-shell-page .site-shell-search-input { color: #fff; }
body.theme-dark .site-shell-search-input::placeholder,
body.theme-night .site-shell-search-input::placeholder,
body.theme-dark .trans-shell-page .site-shell-search-input::placeholder,
body.theme-night .trans-shell-page .site-shell-search-input::placeholder { color: #fff; opacity: .92; }
body.theme-dark.home-shell-page .site-shell-search:focus-within .site-shell-search-input,
body.theme-night.home-shell-page .site-shell-search:focus-within .site-shell-search-input,
body.theme-dark.trans-shell-page .site-shell-search:focus-within .site-shell-search-input,
body.theme-night.trans-shell-page .site-shell-search:focus-within .site-shell-search-input { color: #111; }
body.theme-dark.home-shell-page .site-shell-search:focus-within .site-shell-search-input::placeholder,
body.theme-night.home-shell-page .site-shell-search:focus-within .site-shell-search-input::placeholder,
body.theme-dark.trans-shell-page .site-shell-search:focus-within .site-shell-search-input::placeholder,
body.theme-night.trans-shell-page .site-shell-search:focus-within .site-shell-search-input::placeholder { color: #555; }

@media (min-width: 810px) {
  .home-shell-page .site-shell-search { flex-basis: 210px; width: 210px; }
  .home-shell-page .site-shell-font-btn { transform: translateX(-50px); }
}
body.theme-dark.home-shell-page .site-shell-search,
body.theme-night.home-shell-page .site-shell-search { background: transparent; border-color: transparent; }
body.theme-dark.home-shell-page .site-shell-search:focus-within,
body.theme-dark.home-shell-page .site-shell-search:focus,
body.theme-night.home-shell-page .site-shell-search:focus-within,
body.theme-night.home-shell-page .site-shell-search:focus {
  background: #fff;
  border-color: rgba(255, 255, 255, .28);
}

/* Font selection trigger (text button inside the bar) */
.home-shell-page .site-shell-font-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #141414;
  cursor: pointer;
  font-family: 'Thmanyah Sans', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  transition: opacity .2s ease;
}
html[data-theme="dark"] .home-shell-page .site-shell-font-btn,
body.theme-dark.home-shell-page .site-shell-font-btn,
body.theme-night.home-shell-page .site-shell-font-btn { color: #fafafa; }
.home-shell-page .site-shell-font-btn:hover,
.home-shell-page .site-shell-font-btn:focus,
.home-shell-page .site-shell-font-btn:active {
  opacity: 1;
}
.home-shell-page .site-shell-font-btn .header-font-arrow {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.home-shell-page .site-shell-font-btn.open .header-font-arrow { transform: rotate(180deg); }

/* Font panel: the same simple reveal used by the hamburger panel */
.home-shell-page .home-font-panel {
  position: static;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  display: none;
  border: 0;
  padding: 10px 16px 18px;
  border-top: 0;
  border-radius: 0 0 30px 30px;
  background: rgba(237, 237, 237, .82);
  -webkit-backdrop-filter: blur(48px) saturate(150%);
  backdrop-filter: blur(48px) saturate(150%);
  box-shadow: 0 30px 60px -18px rgba(0, 0, 0, .18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .45s ease, transform .45s cubic-bezier(.32, .72, 0, 1), visibility 0s linear .45s;
  z-index: 1101;
  max-height: min(68vh, 560px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.home-shell-page .home-font-panel.open {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity .45s ease, transform .45s cubic-bezier(.32, .72, 0, 1);
}
html[data-theme="dark"] .home-shell-page .home-font-panel,
body.theme-dark.home-shell-page .home-font-panel,
body.theme-night.home-shell-page .home-font-panel {
  background: rgba(26, 27, 28, .88);
  border-color: rgba(255, 255, 255, .1);
  box-shadow: 0 30px 60px -18px rgba(0, 0, 0, .6);
}
.home-shell-page .header-live-results { width: 94%; max-width: 580px; }

@media (max-width: 809px) {
  .home-shell-page .site-shell-topbar {
    gap: 6px;
    padding: 0 4px 0 12px;
  }

  /* Compact width for the search rectangle to leave space for font button and burger */
  .home-shell-page .site-shell-search {
    flex: 0 1 132px;
    width: 132px;
    min-width: 106px;
    max-width: 142px;
    height: 36px;
    padding: 0 10px;
    transform: none !important;
  }

  .home-shell-page .site-shell-search:focus-within,
  .home-shell-page .site-shell-search:focus {
    flex: 1 1 auto !important;
    max-width: none !important;
    width: auto !important;
  }

  /* Search placeholder and text in natural, clear, medium font size */
  .home-shell-page .site-shell-search-input {
    font-size: 0.85rem !important;
  }
  .home-shell-page .site-shell-search-input::placeholder {
    font-size: 0.85rem !important;
  }

  .home-shell-page .site-shell-search-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-inline-end: 4px;
  }

  /* "اختر الخط" button placed close to burger lines (الشحطات) via margin-inline-start: auto */
  .home-shell-page .site-shell-font-btn {
    margin-inline-start: auto;
    padding: 6px 6px;
    gap: 4px;
    font-size: 0.83rem;
    transform: none !important;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .home-shell-page .site-shell-font-btn .header-font-arrow {
    width: 12px;
    height: 12px;
  }

  .home-shell-page .site-shell-mobile-controls {
    flex-shrink: 0;
    margin-inline-start: 2px;
  }

  .home-shell-page .site-shell-trigger {
    width: 36px;
    height: 36px;
  }

  .home-shell-page .site-shell-panel { display: block; }
  .home-shell-page .home-font-panel {
    border-radius: 0 0 28px 28px;
    max-height: min(64vh, 520px);
  }
}

/* Specific optimizations for compact mobile screens (<= 420px) */
@media (max-width: 420px) {
  .home-shell-page .site-shell {
    left: 10px;
    right: 10px;
  }

  .home-shell-page .site-shell-topbar {
    gap: 5px;
    padding: 0 3px 0 8px;
  }

  .home-shell-page .site-shell-search {
    flex: 0 1 120px;
    width: 120px;
    min-width: 98px;
    max-width: 128px;
    padding: 0 7px;
    transform: none !important;
  }

  .home-shell-page .site-shell-search-input,
  .home-shell-page .site-shell-search-input::placeholder {
    font-size: 0.84rem !important;
  }

  .home-shell-page .site-shell-search-icon {
    width: 13px;
    height: 13px;
  }

  .home-shell-page .site-shell-font-btn {
    margin-inline-start: auto;
    padding: 5px 4px;
    gap: 3px;
    font-size: 0.81rem;
    transform: none !important;
  }

  .home-shell-page .site-shell-font-btn span {
    display: inline;
  }

  .home-shell-page .site-shell-font-btn .header-font-arrow {
    width: 11px;
    height: 11px;
  }

  .home-shell-page .site-shell-trigger {
    width: 34px;
    height: 34px;
  }
}

/* Explicit Android support */
html.is-android .home-shell-page .site-shell-topbar,
body.is-android.home-shell-page .site-shell-topbar {
  gap: 5px;
}

html.is-android .home-shell-page .site-shell-search,
body.is-android.home-shell-page .site-shell-search {
  flex: 0 1 124px;
  width: 124px;
  max-width: 132px;
  padding: 0 8px;
  transform: none !important;
}

html.is-android .home-shell-page .site-shell-search-input,
body.is-android.home-shell-page .site-shell-search-input {
  font-size: 0.85rem !important;
}

html.is-android .home-shell-page .site-shell-font-btn,
body.is-android.home-shell-page .site-shell-font-btn {
  margin-inline-start: auto;
  padding: 5px 5px;
  gap: 3px;
  font-size: 0.82rem;
  transform: none !important;
}
