/* =========================================================
   QUR'AN SURAH READER
   ========================================================= */

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

.surah-page {
  width: 100%;
  flex: 1 0 auto;

  margin-top: 0;
  padding-top: 82px;

  overflow-x: hidden;

  background: var(--home-bg);

  text-align: left;
}

.surah-page section {
  margin-top: 0;
}

/* =========================================================
   HERO
   ========================================================= */

.surah-hero {
  position: relative;

  overflow: hidden;

  background:
    radial-gradient(
      circle at 78% 42%,
      rgba(140, 98, 57, 0.24),
      transparent 30rem
    ),
    linear-gradient(135deg, #0d3b26 0%, #123f2d 52%, #18332f 100%);
}

.surah-hero::before {
  content: "";

  position: absolute;

  inset: 0;

  pointer-events: none;

  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px);

  background-size: 52px 52px;

  mask-image: linear-gradient(to right, transparent, black 55%, transparent);
}

.surah-hero-inner {
  position: relative;
  z-index: 1;

  display: grid;

  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);

  gap: clamp(2.5rem, 6vw, 6rem);

  width: min(1100px, calc(100% - 40px));

  min-height: 430px;

  margin-inline: auto;

  padding: clamp(4rem, 7vw, 6rem) 0;

  align-items: center;
}

/* =========================================================
   HERO TEXT
   ========================================================= */

.surah-hero-copy {
  max-width: 680px;
}

.surah-eyebrow {
  margin-bottom: 0.8rem;

  color: #d8c3a8;

  font-size: 0.76rem;

  font-weight: 800;

  letter-spacing: 0.18em;

  text-transform: uppercase;
}

.surah-hero h1 {
  margin: 0;

  color: var(--home-bg);

  font-family: Georgia, "Times New Roman", serif;

  font-size: clamp(2.7rem, 6vw, 4.8rem);

  font-weight: 600;

  line-height: 1.05;

  letter-spacing: -0.035em;
}

.surah-hero-description {
  max-width: 620px;

  margin-top: 1.3rem;

  color: rgba(250, 244, 232, 0.78);

  font-size: 1.05rem;

  line-height: 1.75;
}

/* =========================================================
   HERO META
   ========================================================= */

.surah-meta {
  display: flex;

  flex-wrap: wrap;

  gap: 0.75rem 1.15rem;

  margin-top: 1.8rem;

  color: rgba(250, 244, 232, 0.82);

  font-size: 0.78rem;

  font-weight: 700;
}

.surah-meta span {
  display: inline-flex;

  align-items: center;

  gap: 0.42rem;
}

.surah-meta i {
  color: #d8c3a8;
}

/* =========================================================
   HERO ARABIC ART
   ========================================================= */

.surah-hero-art {
  display: grid;

  place-items: center;
}

.surah-hero-art-frame {
  position: relative;

  display: flex;

  width: min(100%, 350px);

  aspect-ratio: 1.08;

  align-items: center;

  justify-content: center;

  flex-direction: column;

  padding: 2rem;

  border: 1px solid rgba(250, 244, 232, 0.18);

  border-radius: 28px;

  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.07),
    rgba(255, 255, 255, 0.025)
  );

  box-shadow:
    inset 0 0 0 8px rgba(255, 255, 255, 0.018),
    0 30px 80px rgba(0, 0, 0, 0.16);

  text-align: center;
}

.surah-hero-art-frame::before {
  content: "";

  position: absolute;

  inset: 18px;

  border: 1px solid rgba(216, 195, 168, 0.22);

  border-radius: 20px;

  pointer-events: none;
}

.surah-arabic-title {
  position: relative;

  z-index: 1;

  color: var(--home-bg);

  font-family: Thuluth, Amiri, serif;

  font-size: clamp(4rem, 9vw, 6.3rem);

  line-height: 1.2;

  direction: rtl;
}

.surah-arabic-subtitle {
  position: relative;

  z-index: 1;

  margin-top: 0.8rem;

  color: rgba(250, 244, 232, 0.62);

  font-family: Amiri, serif;

  font-size: 1rem;

  direction: rtl;
}

/* =========================================================
   READING SECTION
   ========================================================= */

.surah-reading-section {
  width: min(940px, calc(100% - 40px));

  margin-inline: auto;

  padding: clamp(4rem, 7vw, 6rem) 0;
}

/* =========================================================
   SURAH NAVIGATION
   ========================================================= */

.surah-navigation {
  display: flex;

  gap: 0.8rem;

  align-items: center;

  justify-content: space-between;

  margin-bottom: 1.2rem;
}

.bottom-navigation {
  margin-top: 1.2rem;

  margin-bottom: 0;
}

.surah-nav-button {
  display: inline-flex;

  min-height: 46px;

  gap: 0.5rem;

  align-items: center;

  justify-content: center;

  padding: 0.7rem 1rem;

  border: 1px solid var(--home-green);

  border-radius: 10px;

  color: #ffffff;

  background: var(--home-green);

  font-size: 0.82rem;

  font-weight: 800;

  text-decoration: none;

  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.surah-nav-button:hover {
  color: #ffffff;

  background: var(--home-green-light);

  transform: translateY(-1px);
}

.surah-nav-button.secondary {
  border-color: var(--home-border);

  color: var(--home-green);

  background: var(--home-surface);
}

.surah-nav-button.secondary:hover {
  border-color: rgba(140, 98, 57, 0.3);

  color: var(--home-brown-dark);

  background: var(--home-surface-soft);
}

/* =========================================================
   READING CARD
   ========================================================= */

.surah-reading-card {
  overflow: hidden;

  border: 1px solid var(--home-border);

  border-radius: 24px;

  background: var(--home-surface);

  box-shadow: var(--home-shadow);
}

/* =========================================================
   READING HEADER
   ========================================================= */

.surah-reading-header {
  display: flex;

  gap: 1rem;

  align-items: center;

  justify-content: space-between;

  padding: 1.35rem 1.5rem;

  border-bottom: 1px solid var(--home-border);
}

.surah-reading-label {
  color: var(--home-green);

  font-size: 0.82rem;

  font-weight: 800;
}

.surah-reading-header p {
  margin-top: 0.25rem;

  color: var(--home-muted);

  font-size: 0.74rem;
}

.surah-reading-icon {
  display: grid;

  width: 42px;

  height: 42px;

  flex-shrink: 0;

  place-items: center;

  border: 1px solid var(--home-border);

  border-radius: 10px;

  color: var(--home-green);

  background: var(--home-surface-soft);
}

/* =========================================================
   AYAH BLOCKS
   ========================================================= */

.ayah-block {
  position: relative;

  padding: clamp(2rem, 5vw, 3.2rem) clamp(1.3rem, 5vw, 3.4rem);

  border-bottom: 1px solid rgba(13, 59, 38, 0.09);

  background: #ffffff;
}

.ayah-block:last-child {
  border-bottom: 0;
}

/* =========================================================
   ARABIC TEXT
   ========================================================= */

.arabic-text {
  width: 100%;

  margin: 0;

  padding: 0.8rem 0 1.6rem;

  color: var(--home-green);

  font-family: "Quran-Hafs", Uthman, Amiri, serif;

  font-size: clamp(1.8rem, 4vw, 2.05rem);

  font-weight: normal;

  line-height: 2.15;

  direction: rtl;

  text-align: right;
}

/* =========================================================
   TRANSLATION
   ========================================================= */

.translation-text {
  width: 100%;

  margin: 0;

  color: var(--home-muted);

  font-size: 1rem;

  line-height: 1.75;

  direction: ltr;

  text-align: left;

  max-width: none;
}

/* =========================================================
   AYAH HOVER
   ========================================================= */

.ayah-block {
  position: relative;

  padding: clamp(2rem, 5vw, 3rem) clamp(1.4rem, 5vw, 3.2rem);

  border-bottom: 1px solid rgba(13, 59, 38, 0.09);

  background: #ffffff;

  transition: background-color 0.2s ease;
}

.ayah-block:hover {
  background: #fffefa;
}

/* =========================================================
   FOCUS
   ========================================================= */

.surah-page a:focus-visible {
  outline: 3px solid rgba(140, 98, 57, 0.45);

  outline-offset: 3px;
}

/* =========================================================
   TABLET
   ========================================================= */

@media only screen and (max-width: 900px) {
  .surah-hero-inner {
    grid-template-columns: 1fr;

    min-height: auto;

    text-align: center;
  }

  .surah-hero-copy {
    max-width: 760px;

    margin-inline: auto;
  }

  .surah-hero-description {
    margin-inline: auto;
  }

  .surah-meta {
    justify-content: center;
  }

  .surah-hero-art-frame {
    width: min(76vw, 310px);
  }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media only screen and (max-width: 768px) {
  .surah-page {
    padding-top: 72px;
  }

  .surah-hero-inner {
    width: min(100% - 28px, 1100px);

    gap: 2.8rem;

    padding: 3.8rem 0 4.5rem;
  }

  .surah-reading-section {
    width: min(100% - 28px, 940px);

    padding: 4rem 0;
  }

  .surah-hero h1 {
    font-size: clamp(2.5rem, 11vw, 3.8rem);
  }

  .surah-navigation {
    gap: 0.55rem;
  }

  .surah-nav-button {
    flex: 1;

    padding: 0.7rem 0.6rem;

    font-size: 0.76rem;
  }

  .surah-reading-card {
    border-radius: 18px;
  }

  .surah-reading-header {
    padding: 1.1rem 1.15rem;
  }

  .ayah-block {
    padding: 2rem 1rem;
  }

  .arabic-text {
    padding: 0.8rem 0 1.3rem;

    font-size: clamp(1.75rem, 7vw, 2.2rem);

    line-height: 2;

    text-align: right;

    width: 100%;
  }

  .translation-text {
    font-size: 0.95rem;

    line-height: 1.7;

    text-align: left;

    width: 100%;

    max-width: none;

    margin: 0;
  }
}

/* =========================================================
   SMALL PHONES
   ========================================================= */

@media only screen and (max-width: 480px) {
  .surah-meta {
    align-items: center;

    flex-direction: column;
  }

  .surah-hero-art-frame {
    width: min(80vw, 270px);
  }

  .surah-navigation {
    align-items: stretch;

    flex-direction: column;
  }

  .surah-nav-button {
    width: 100%;
  }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .ayah-block,
  .surah-nav-button {
    transition: none;
  }
}

/* ================= SURAH READER EXTRA SUPPORT ================= */

/* Bismillah used before Surahs such as Al-Baqarah */

.surah-bismillah {
  padding: 2.2rem 1rem 1.7rem;

  border-bottom: 1px solid rgba(13, 59, 38, 0.09);

  color: var(--home-green);

  background: #ffffff;

  font-family: Amiri, serif;

  font-size: 2.2rem;

  line-height: 1.5;

  direction: rtl;

  text-align: center;
}

/* Disabled next/previous Surah navigation */

.surah-nav-button.disabled {
  border-color: var(--home-border);

  color: var(--home-muted);

  background: var(--home-surface-soft);

  opacity: 0.65;

  cursor: not-allowed;

  pointer-events: none;
}

@media only screen and (max-width: 768px) {
  .surah-bismillah {
    padding: 1.8rem 1rem 1.4rem;

    font-size: 1.9rem;
  }
}
