:root {
  --bg: #ffffff;
  --panel: #f5f5f5;
  --text: #0b0c10;
  --nav-text-muted: #f5f5f5;
  --nav-text: #039345;
  --muted: #555;
  --line: rgba(0, 0, 0, 0.1);
  --accent: #039345;
  --overlay: rgba(0, 0, 0, 0.4); /* new */
}

.dark-mode {
  --bg: #0b0c10;
  --panel: #11131a;
  --text: #e9eef5;
  --nav-text-muted: #f5f5f5;
  --nav-text: #039345;
  --muted: #aab4c0;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #d7b56d;
  --overlay: rgba(0, 0, 0, 0.6); /* darker overlay in dark mode */
}

* {
  transition: background-color 0.7s ease, color 0.7s ease, border-color 0.7s ease;
  box-sizing: border-box
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell;
  transition: background 1s ease, color 1s ease;
}

a {
  color: inherit;
  text-decoration: none
}

.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1px
}

.siteHeader {
  position: sticky;
  top: 0;
  background: rgba(11, 12, 16, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 10
}

.headerInner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px
}

.logo {
  width: 34px;
  height: 34px
}

.brandText {
  font-weight: 700;
  letter-spacing: .2px
}

.nav {
  display: flex;
  gap: 14px;
  margin-left: auto;
  padding: 12px 0;
  padding-right: 20px;
}

.nav a {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--nav-text-muted)
}

.nav a:hover {
  /* background: var(--panel); */
  color: var(--nav-text)
}

.cta {
  margin-left: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--accent);
  color: #111;
  font-weight: 700
}

.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  padding: 22px 0
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr
  }

  .sidebar {
    order: -1
  }

  @media (max-width: 980px) {
    .nav {
      display: none;
      position: absolute;
      top: 100%; /* under header */
      right: 0;
      left: 0;
      background: var(--panel);
      flex-direction: column;
      gap: 0;
      padding: 10px 0;
      width: 100%;
      z-index: 9;
      border-bottom: 1px solid var(--line);
    }
  
    .nav.show {
      display: flex;
    }
  
    .nav a {
      padding: 12px 20px;
      text-align: left;
      color: var(--text);
      width: 100%;
    }
  
    .settings-dropdown {
      padding: 10px 20px;
      width: 100%;
    }
  }
}

.hero {
  padding: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(215, 181, 109, .08), rgba(17, 19, 26, .65));
  border-radius: 18px
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 34px
}

.hero p {
  margin: 0;
  color: var(--muted)
}

.btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
}

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

@media (max-width: 700px) {
  .grid {
    grid-template-columns: 1fr
  }
}

.card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px;
  overflow: hidden
}

.cardMedia {
  height: 180px;
  background: #0f1117
}

.cardMedia img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.cardBody {
  padding: 14px
}

.meta {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px
}

.tag {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px
}

.cardTitle {
  margin: 8px 0 6px;
  font-size: 18px
}

.cardExcerpt {
  margin: 0;
  color: var(--muted)
}

.sidebarBox {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px;
  padding: 14px;
  position: sticky;
  top: 80px
}

.searchForm {
  display: flex;
  gap: 10px
}

.searchInput {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text)
}

.searchBtn {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0f1117;
  color: var(--text)
}

.sidebarSection {
  margin-top: 16px
}

.sidebarSection h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em
}

.pillRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

.pill {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0f1117;
  color: var(--muted)
}

.pill:hover {
  color: var(--text)
}

.article {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px
}

.article h1 {
  margin: 10px 0 10px;
  font-size: 30px
}

.articleCover {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin: 12px 0
}

.prose p {
  color: var(--text)
}

.muted {
  color: var(--muted)
}

.siteFooter {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  color: var(--muted);
  margin-top: 30px
}

.hero-section {
  background: url('/img/hero-background.jpg') no-repeat center center;
  background-size: cover;
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-align: center;
  padding: 1rem;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--overlay);
  z-index: 1;
}

.hero-section::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11, 13, 16, 0.3) 20%, var(--bg) 100%);
  z-index: 1;
  pointer-events: none;
}

.hero-section > * {
  position: relative;
  z-index: 2;
}

@media (max-width: 600px) {
  .hero-section {
    background-position: 22% 90%;
  }
}

/* Overlay container for content */
.hero-overlay {
  padding: 2rem;
  border-radius: 8px;
  max-width: 800px;
  margin: 0 auto;
}

/* Main heading */
.hero-section h2 {
  font-size: clamp(1.5rem, 4vw + 1rem, 3rem);
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

/* Arabic verses */
.hero-section .arabic {
  font-size: 1.5rem;
  line-height: 1.8;
  direction: rtl;
  font-family: "Amiri", serif; /* Optional: Arabic-friendly font */
  margin: 1rem 0 0.5rem;
}

/* Translation text */
.hero-section .translation {
  font-size: 1rem;
  font-style: italic;
  margin: 0.25rem 0;
}

/* Source references */
.hero-section .source {
  font-size: 0.9rem;
  /* color: #ccc; */
  margin-bottom: 1rem;
}

@media (min-width: 768px) {

  .hero-overlay
  {
    padding-left: 10rem;
  }  

  .hero-section h1 {
    font-size: 4rem;
  }

  .hero-section .arabic {
    font-size: 1.8rem;
  }

  .hero-section .translation {
    font-size: 1.2rem;
  }
}

.introduction {
  padding-top: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 80px;
}

.banners {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap; /* wrap on small screens */
  margin-bottom: 20px;
}

.introduction-banner {
  max-width: 140px;
  height: auto;
}

.introduction h2
{
  max-width: 80vw;
}

.introduction .highlight-title
{
  color: #039345;
  font-weight: 600;
}

.funding {
  /* background-color: #f5f5f5; */
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;     /* center items horizontally */
  justify-content: center; /* optional: vertical centering if needed */
  text-align: center;
  padding: 40px 20px;
}

.funding h1
{
  font-size: clamp(1.5rem, 4vw + 1rem, 3rem);
}

.funding h3
{
  font-size: clamp(1rem, 3vw, 1.7rem);
  max-width: 90vw;
}

.funding p
{
  font-size: clamp(2rem, 2.5vw, 3rem);
  max-width: 90vw;
}

.funding-qr
{
  max-width: clamp(10rem, 4.5vw, 20rem);
}

.contact-us
{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.siteFooter
{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 30px;
  margin-bottom: 30px;
  width: 100%;
  max-width: 90vw;
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.book {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  transition: background 0.2s ease;
}

.book:hover {
  border: 1px solid #039345;
  background: rgba(255, 255, 255, 0.05);
}

.btn2 {
  position: relative;
  display: inline-block;
  padding: 15px 30px;
  border: 2px solid #039345;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 20px;
  transition: 0.3s;
  background-color: transparent;
  cursor: pointer;
}

.btn2::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  width: calc(100% + 6px);
  height: calc(100% + 2px);
  background-color: var(--bg);
  transition: 0.3s ease-out;
  transform: scaleY(1);
}

.btn2::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  width: calc(100% + 4px);
  height: calc(100% - 50px);
  background-color: var(--bg);
  transition: 0.3s ease-out;
  transform: scaleY(1);
}

.btn2:hover::before {
  transform: translateY(-25px);
  height: 0;
}

.btn2:hover::after {
  transform: scaleX(0);
  transition-delay: 0.15s;
}

.btn2:hover {
  border: 2px solid #039345;
}

.btn2 .spn2 {
  position: relative;
  z-index: 3;
  text-decoration: none;
  border: none;
  background-color: transparent;
}

.settings-dropdown {
  position: relative;
}

.settings-icon {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
  padding: 8px;
}

.settings-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-width: 150px;
  box-shadow: 0 2px 6px rgba(7, 6, 6, 0.2);
  z-index: 999;
}

.settings-menu button {
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 12px;
  text-align: left;
  width: 100%;
}

.settings-menu button:hover {
  background-color: var(--bg);
}

/* Show the settings menu when toggled */
.settings-dropdown.show .settings-menu {
  display: block;
}

/* On small screens */
@media (max-width: 768px) {
  .settings-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0;
    min-width: unset;
  }

  .settings-icon {
    font-size: 18px;
    padding: 6px;
  }

  .settings-menu button {
    padding: 10px;
  }
}

.theme-switch {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.theme-switch input[type="checkbox"] {
  display: none;
}

.switch-label {
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
  width: 50px;
  height: 26px;
  background: var(--line);
  border-radius: 50px;
  transition: background 0.3s ease;
  padding: 0 6px;
}

.switch-label .icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.switch-label .sun {
  left: 6px;
  opacity: 1;
}

.switch-label .moon {
  right: 6px;
  opacity: 0;
}

.switch-label .slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: var(--bg);
  border-radius: 50%;
  transition: transform 0.3s ease;
}

/* When checkbox is checked (dark mode) */
#theme-toggle:checked + .switch-label .sun {
  opacity: 0;
}

#theme-toggle:checked + .switch-label .moon {
  opacity: 1;
}

#theme-toggle:checked + .switch-label .slider {
  transform: translateX(24px);
}

@media (max-width: 768px) {
  .switch-label {
    width: 44px;
    height: 22px;
  }

  .switch-label .icon {
    font-size: 12px;
  }

  .switch-label .slider {
    width: 18px;
    height: 18px;
  }

  #theme-toggle:checked + .switch-label .slider {
    transform: translateX(20px);
  }
}
.theme-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.theme-toggle-wrapper input[type="checkbox"] {
  display: none;
}

.slider {
  position: relative;
  width: 40px;
  height: 20px;
  background-color: var(--line);
  border-radius: 20px;
  transition: background-color 0.3s ease;
}

.slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background-color: var(--text);
  border-radius: 50%;
  transition: transform 0.3s ease;
}

/* When checked */
.theme-toggle-wrapper input[type="checkbox"]:checked + .slider::before {
  transform: translateX(20px);
}

.theme-label {
  font-size: 14px;
  color: var(--text);
}

/* Hide menu toggle on desktop */
.menu-toggle {
  display: none;
  font-size: 24px;
  background: none;
  border: none;
  color: var(--nav-text-muted);
  cursor: pointer;
}

/* Mobile styles */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    margin-left: auto;
    padding: 10px;
  }

  .nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    z-index: 999;
  }

  .nav.show {
    display: flex;
  }
  
.nav a {
  color: var(--text)
}

  .nav a,
  .settings-dropdown {
    padding: 10px;
    width: 100%;
    text-align: left;
  }
}

.animate-on-scroll {
  opacity: 0;
}

.animate-on-scroll.is-visible {
  opacity: 1;
}