body.quran-index {
  min-height: 100vh;
  direction: ltr;
  overflow-x: hidden;
}

body.quran-index *,
body.quran-index *::before,
body.quran-index *::after {
  box-sizing: border-box;
}

body.quran-index .quran-index-shell {
  width: min(100% - 24px, 1120px);
  max-width: 100vw;
  margin: clamp(18px, 4vw, 48px) auto clamp(28px, 6vw, 72px);
}

body.quran-index .index-panel {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  direction: rtl;
  padding: clamp(16px, 3vw, 30px);
  background: #fffaf0;
  border: 1px solid #d9c28a;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(67, 49, 15, 0.13);
}

body.quran-index .index-panel::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(185, 145, 61, 0.34);
  border-radius: 6px;
  pointer-events: none;
}

body.quran-index .index-panel::after {
  content: "";
  position: absolute;
  inset-inline: clamp(32px, 9vw, 120px);
  top: 0;
  height: 3px;
  background: #b9913d;
  pointer-events: none;
}

body.quran-index .index-panel > * {
  position: relative;
  z-index: 1;
}

body.quran-index .index-heading {
  margin: clamp(18px, 4vw, 34px) auto clamp(16px, 3vw, 28px);
  padding: clamp(18px, 4vw, 32px) clamp(18px, 5vw, 42px);
  color: #fff8e7;
  text-align: center;
  background: #123e36;
  border: 1px solid #b9913d;
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(20, 48, 42, 0.18);
}

body.quran-index .index-title {
  margin: 0;
  color: #fff8e7;
  font: 700 clamp(2rem, 6vw, 3.8rem) "qpc-hafs", "Alyamama", "Traditional Arabic", serif;
  line-height: 1.45;
}

body.quran-index .index-kicker {
  margin: 4px 0 0;
  color: #d9bd6d;
  font: 700 clamp(1rem, 3vw, 1.35rem) "Alyamama", "Traditional Arabic", "Noto Naskh Arabic", serif;
  line-height: 1.6;
}

body.quran-index .surah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(10px, 2vw, 16px);
  min-width: 0;
}

body.quran-index .surah-card {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(14px, 2.6vw, 20px);
  padding-right: clamp(78px, 9vw, 96px);
  color: #173f35;
  text-align: right;
  text-decoration: none;
  background: #fffdf8;
  border: 1px solid #dbc48b;
  border-bottom: 3px solid #b9913d;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75), 0 8px 18px rgba(74, 52, 15, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

body.quran-index .surah-card:visited,
body.quran-index .surah-card:focus,
body.quran-index .surah-card:active {
  color: #173f35;
}

body.quran-index .surah-card > span:last-child {
  display: block;
  width: 100%;
  min-width: 0;
}

body.quran-index .surah-card:hover {
  transform: translateY(-2px);
  color: #fff8e7;
  background: #123e36;
  border-color: #b9913d;
  box-shadow: 0 14px 26px rgba(49, 39, 14, 0.14);
}

body.quran-index .surah-number {
  position: absolute;
  right: clamp(14px, 2.6vw, 20px);
  top: 50%;
  width: clamp(50px, 7vw, 62px);
  height: clamp(50px, 7vw, 62px);
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  color: #123e36;
  background: #f3e6c5;
  border: 1px solid #c79b38;
  border-radius: 50%;
  font: 700 clamp(1.05rem, 3vw, 1.35rem) "Alyamama", "Traditional Arabic", "Noto Naskh Arabic", serif;
  line-height: 1;
}

body.quran-index .surah-card:hover .surah-number {
  color: #fff8e7;
  background: #b9913d;
}

body.quran-index .surah-name {
  display: block;
  overflow-wrap: anywhere;
  font: 700 clamp(1.35rem, 4vw, 1.9rem) "qpc-hafs", "Alyamama", "Traditional Arabic", serif;
  line-height: 1.45;
}

body.quran-index .surah-meta {
  display: block;
  margin-top: 4px;
  color: #8a6c2b;
  font: 700 clamp(0.9rem, 2.4vw, 1rem) "Alyamama", "Traditional Arabic", "Noto Naskh Arabic", serif;
  line-height: 1.5;
}

body.quran-index .surah-card:hover .surah-meta {
  color: #d9bd6d;
}

@media (max-width: 520px) {
  body.quran-index .quran-index-shell {
    width: 100%;
    margin: 0 auto;
  }

  body.quran-index .index-panel {
    border-inline: 0;
    border-radius: 0;
    padding: 14px 12px 18px;
  }

  body.quran-index .index-heading {
    margin-top: 14px;
  }

  body.quran-index .surah-grid {
    grid-template-columns: 1fr;
  }

  body.quran-index .surah-card {
    min-height: 92px;
    padding-right: 16px;
    padding-left: 78px;
  }

  body.quran-index .surah-number {
    right: auto;
    left: 16px;
  }
}
