@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Source+Serif+4:opsz,wght@8..60,500;8..60,600&display=swap");
@import url("quran-fonts.css");

/* Visual theme only. Page structure, wording, and images stay in the PHP. */
:root {
  --surface: #f7faf8;
  --surface-raised: #ffffff;
  --surface-sunken: #ecf3ef;
  --surface-hover: #eef5f1;
  --text: #12241b;
  --text-muted: #4d6357;
  --text-subtle: #7d8f85;
  --accent: #0f6b4a;
  --accent-hover: #0b5439;
  --accent-soft: #dff0e7;
  --arabic: #0c1e15;
  --ornament: #c2a04d;
  --border: #dde8e2;
  --border-strong: #bed1c7;
  --shadow-sm: 0 1px 2px #0c241a0f;
  --shadow-md: 0 4px 16px #0c241a1a;
  --font-ui: "Inter", "Segoe UI", sans-serif;
  --font-display: "Source Serif 4", Georgia, serif;
}

body {
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-ui);
  overflow-x: hidden;
}

.container {
  max-width: 64rem;
  padding-bottom: 2.5rem;
}

body .header {
  position: relative;
  top: auto;
  z-index: 1;
}

body .header-back-img,
body .header-back-img-2,
body .header-back-img-3 {
  opacity: 0.18;
  max-width: 100%;
  height: auto;
}

body .navbar-brand {
  display: inline-flex;
  align-items: center;
  margin-inline-end: 0.35rem;
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
}

body .navbar-brand img,
body .cus-footer .col-lg-3 > a img {
  width: auto;
  max-width: min(126px, 34vw);
  height: auto;
}

body .main-head > a img {
  width: auto;
  max-width: min(100%, 320px);
  height: auto;
}

body .surah-title-div img {
  width: auto;
  max-width: min(100%, 264px);
  height: auto;
}

body .cus-nav ul li a {
  font-family: var(--font-urdu);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 2.4;
}

body .cus-nav ul li a:hover,
body .cus-nav ul li a:focus {
  color: var(--accent);
}

body .cus-nav ul li a:after,
body .cus-footer ul li a:after {
  border-bottom-color: var(--ornament);
}

body .navbar-toggler {
  border-color: var(--border-strong);
  border-radius: 999px;
}

body .main-head {
  margin-top: 1.25rem;
}

body .search-form {
  display: flex;
  align-items: center;
  width: min(100%, 36rem);
  height: auto;
  min-height: 4.25rem;
  margin: 1.25rem auto 0.5rem;
  padding: 0.35rem 0.45rem;
  overflow: visible;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

body .search-form input[type="search"],
body .search-1 input,
body #ayat-list {
  font-family: var(--font-urdu);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1.2;
  height: auto;
  min-height: 3.4rem;
  padding: 1.15rem 0.9rem 0.55rem;
  overflow: visible;
}

body .search-form input[type="search"]::placeholder {
  color: var(--text-subtle);
}

body .title-div,
body .surah-title-div,
body .topic-title-div {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  border-bottom: 0;
  text-align: center;
}

body .title-div h1,
body .surah h2,
body .topic-title-div h1 {
  font-family: var(--font-urdu);
  font-weight: 400;
  color: var(--text);
  font-size: 2rem;
  line-height: 2.6;
  padding-block: 0.45rem 0.2rem;
  overflow: visible;
}

body .surah-title-div h1 {
  font-family: var(--font-arabic);
  color: var(--arabic);
  font-size: 2.15rem;
  line-height: 2.2;
}

body .surah-kicker {
  font-family: var(--font-urdu);
  font-size: 0.92em;
}

body .title-div h3,
body .title-div h3 a {
  font-family: var(--font-urdu);
  color: var(--accent);
  text-decoration: none;
}

body .title-div h3 a:hover {
  color: var(--accent-hover);
}

body .surah-title-div img {
  max-width: min(100%, 16rem);
  height: auto;
}

body a.mqmu,
body .mqmu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: none;
  min-height: 3.35rem;
  padding: 0.95rem 1.45rem 0.7rem;
  margin: 0 0.4rem 0.55rem;
  overflow: visible;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  position: relative;
  z-index: 1;
}

body .mqmu .card-title {
  font-family: var(--font-urdu);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 2.15;
  overflow: visible;
}

body .mqmu:hover {
  background: var(--accent-soft);
  border-color: var(--border-strong);
  box-shadow: none;
}

body .mqmu:hover .card-title {
  color: var(--accent-hover);
}

body .surah .row .col,
body .topic .row .col {
  padding-top: 0.65rem;
}

body .surah .row .col > a,
body .topic .row .col > a {
  display: block;
  height: 100%;
  text-decoration: none;
}

body .surat-no,
body .topic-no {
  height: auto;
  min-height: 0;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  box-shadow: var(--shadow-sm);
}

body .surat-no:hover,
body .topic-no:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

body .surat-no .card-body {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
}

body .surat-no .card-body h4,
body .surat-no:hover .surtno {
  position: static;
  width: 2.4rem;
  height: 2.4rem;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 2.4rem;
}

body .surat-no .card-body div {
  margin-top: 0;
  text-align: start;
}

body .suratname {
  font-family: var(--font-arabic);
  color: var(--arabic);
  text-align: start;
  font-size: 1.35rem;
  line-height: 2;
}

body .suratayat {
  font-family: var(--font-urdu);
  font-size: 1.05rem;
  line-height: 2.4;
  color: var(--text-muted);
  text-align: start;
}

body .topic-no {
  cursor: pointer;
}

body .topic-no .card-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.6rem;
  padding: 0.95rem 1.25rem 0.7rem;
}

body .topic-no .card-body .card-title {
  font-family: var(--font-urdu);
  color: var(--text);
  line-height: 2.2;
  font-size: 1.35rem;
  overflow: visible;
}

body .topic-no:hover .card-title {
  color: var(--accent);
}

body .topic-title-div p {
  font-family: var(--font-urdu);
  color: var(--text-muted);
  line-height: 2;
}

body .surah-card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

body .surah-card .card-body {
  padding: 1.35rem 0.25rem;
}

body .ayat-detail h2 {
  font-family: var(--font-arabic);
  color: var(--arabic);
  font-size: clamp(1.7rem, 4.4vw, 2.35rem);
  line-height: 2.35;
  overflow-wrap: anywhere;
}

body .surah-title-div ~ .surah-detail .ayat-detail h2 {
  font-family: var(--font-indopak);
  font-size: clamp(1.85rem, 4.8vw, 2.55rem);
  line-height: 2.6;
}

body .ayat-detail p {
  font-family: var(--font-urdu);
  color: var(--text-muted);
  font-size: 1.45rem;
  line-height: 2.8;
}

body .surah-title-div ~ .surah-detail .ayat-detail p {
  font-family: var(--font-urdu);
  font-size: 1.45rem;
  line-height: 2.8;
}

body .ayat-info p {
  font-family: var(--font-ui);
  color: var(--text-subtle);
  font-size: 0.85rem;
}

body .surah-card .card-body::after {
  content: "";
  display: block;
  clear: both;
}

body .ayat-detail {
  float: right;
  width: 92%;
}

body .ayat-info {
  float: left;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.45rem;
  width: auto;
  margin-top: 0.35rem;
}

body .ayat_end {
  position: static;
  display: inline-block;
  margin-inline-start: 0.25rem;
  /* Uthmanic Hafs draws Eastern digits as the ornamental ayah medallion */
  font-family: "UthmanicHafs", "Kitab", serif;
  font-size: 1.55em;
  line-height: 1;
  color: var(--arabic);
  vertical-align: middle;
}

body .ayah-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--text-muted);
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
}

body .ayah-icon-btn svg {
  grid-area: 1 / 1;
}

body .ayah-icon-btn:hover,
body .ayah-share[open] > summary,
body .ayah-icon-btn.is-copied {
  border-color: var(--accent);
  color: var(--accent);
}

body .ayah-share {
  position: relative;
}

body .ayah-share > summary {
  list-style: none;
}

body .ayah-share > summary::-webkit-details-marker {
  display: none;
}

body .ayah-share-menu {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 6px);
  z-index: 8;
  min-width: 13.5rem;
  display: flex;
  flex-direction: column;
  direction: ltr;
  padding: 0.35rem;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-md);
}

body .ayah-share-menu a,
body .ayah-share-menu button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--text);
  text-align: start;
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}

body .ayah-share-menu a:hover,
body .ayah-share-menu button:hover {
  background: var(--surface-sunken);
}

body .cus-footer {
  margin-top: 2rem;
  padding: 1.5rem 0 0.5rem;
  border-top: 1px solid var(--border);
  background: transparent;
}

body .cus-footer ul li a {
  font-family: var(--font-urdu);
  font-size: 1.15rem;
  line-height: 2.4;
  color: var(--text-muted);
}

body .cus-footer ul li a:hover {
  color: var(--accent);
}

body .select2-selection {
  border: 0 !important;
  border-inline-end: 1px solid var(--border) !important;
  background: transparent;
}

body .select2-dropdown {
  border: 1px solid var(--border-strong) !important;
  border-radius: 0.875rem;
  box-shadow: var(--shadow-md);
}

body .select2-selection #select2-suarh-id-container,
#select2-suarh-id-results li {
  font-family: var(--font-arabic) !important;
  line-height: 2.1;
}

@media (max-width: 991px) {
  body .main-head > a img {
    width: auto;
    max-width: min(100%, 280px);
  }
}

@media (max-width: 767px) {
  body .surah .row .col,
  body .topic .row .col {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }

  body .search-form,
  body .search {
    width: 100%;
  }

  body .ayat-detail {
    width: 86%;
  }

  body .links {
    position: static;
  }

  body .cus-footer .row > div {
    margin-bottom: 1rem;
    text-align: center;
  }

  body .search .row > div {
    width: 100%;
  }

  body .select2-selection {
    border-inline-end: 0 !important;
    border-bottom: 1px solid var(--border) !important;
  }
}
