:root {
  color-scheme: dark;
  --header-height: 80px;
  font-family: "Instrument Sans", sans-serif;
  font-size: 20px;
  font-optical-sizing: auto;
  font-style: normal;
  font-variation-settings: "wdth" 100;
  color: white;
}

body {
  background: linear-gradient(0deg, #ff9597 0%, #5a658d 100%);
  background-attachment: fixed;
  min-height: 100%;
  margin: 0;
  padding: 0;
  position: relative;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
}

header {
  margin-left: 15px;
  margin-top: 15px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 15px;
}

header svg,
header svg * {
  height: 100%;
  width: auto;
  color: white !important;
  fill: white !important;
}

h1.logo {
  font-weight: 500;
  margin: 0;
}

.hadith {
  margin-left: 15%;
  margin-right: 15%;
  display: flex;
  min-height: calc(75vh - var(--header-height));
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hadith .text {
  font-size: 36px;
  font-weight: 500;
}
.hadith .caption {
  font-size: 20px;
}

.dune,
.dune * {
  width: 100%;
  fill: #181824;
}

.content-background {
  margin-top: -30px;
  background-color: #181824;
  width: 100%;
}

.content {
  padding-left: 10%;
  padding-right: 10%;
  padding-top: 20px;
  padding-bottom: 40px;
  box-sizing: border-box;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

span.purple {
  color: #c9a7d4;
}

.intro {
  margin-bottom: 50px;
}

.intro h1,
.intro h3 {
  font-weight: 400;
}

.intro h3 {
  color: #5c6079;
}

.intro h3 b {
  color: white;
}

.showcase {
  margin-bottom: 50px;
  position: relative;
  width: 100%;
  min-height: 70vh;
}

.carousel {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 400px;
  overflow: hidden;
  will-change: transform;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out;
  box-sizing: border-box;
  z-index: 1;
  will-change: opacity;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* Default: show first slide when no JS and no target */
.slide:first-child {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

/* CSS-only fallback: target-based navigation */
.slide:target {
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 2 !important;
}

/* Hide first slide when any slide is targeted */
.slide:target ~ .slide:first-child {
  z-index: 1;
}

/* JavaScript enhanced: active class overrides everything */
.slide.active {
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 2 !important;
}

/* When JS is enabled, hide all slides that don't have active class */
.carousel.js-enabled .slide:not(.active) {
  opacity: 0 !important;
  visibility: hidden !important;
  z-index: 1 !important;
}

/* Reset z-index for active slide when JS is enabled */
.carousel.js-enabled .slide.active {
  z-index: 2 !important;
}

.slide img {
  flex: 1;
  width: 100%;
  height: 0;
  object-fit: contain;
}

.slide figcaption {
  margin-top: 40px;
  margin-bottom: 40px;
  font-size: 28px;
  font-weight: 400;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.8);
  color: #181824;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: none; /* Hidden until JS enables them */
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.nav-arrow:hover {
  background-color: rgba(255, 255, 255, 1);
}

.nav-prev {
  left: 15px;
}

.nav-next {
  right: 15px;
}

/* No-JS fallback navigation */
.no-js-nav {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.nav-link {
  background-color: rgba(255, 255, 255, 0.8);
  color: #181824;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
    font-size: 16px;
  }

  header {
    margin-left: 10px;
    margin-top: 10px;
    gap: 10px;
  }

  .hadith {
    margin-left: 5%;
    margin-right: 5%;
  }

  .hadith .text {
    font-size: 24px;
  }

  .hadith .caption {
    font-size: 16px;
  }

  .content {
    padding-left: 5%;
    padding-right: 5%;
  }

  .intro {
    margin-bottom: 30px;
  }

  .showcase {
    margin-bottom: 30px;
    min-height: 60vh;
  }

  .carousel {
    height: 60vh;
    min-height: 450px;
  }

  .slide {
    min-height: 450px;
  }

  .slide figcaption {
    font-size: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .nav-arrow {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }

  .nav-prev {
    left: 8px;
  }

  .nav-next {
    right: 8px;
  }

  .nav-link {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .contact-us p {
    font-size: 18px;
  }

  .email-link {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  :root {
    --header-height: 50px;
    font-size: 14px;
  }

  header {
    margin-left: 8px;
    margin-top: 8px;
    gap: 8px;
  }

  .hadith .text {
    font-size: 20px;
  }

  .hadith .caption {
    font-size: 14px;
  }

  .content {
    padding-left: 3%;
    padding-right: 3%;
  }

  .carousel {
    height: 55vh;
    min-height: 400px;
  }

  .slide {
    min-height: 400px;
  }

  .slide figcaption {
    font-size: 18px;
    margin-top: 15px;
    margin-bottom: 15px;
  }

  .nav-arrow {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .nav-prev {
    left: 5px;
  }

  .nav-next {
    right: 5px;
  }

  .contact-us p {
    font-size: 16px;
  }

  .email-link {
    font-size: 18px;
  }
}

.contact-us {
  width: 100%;
  text-align: center;
}

.contact-us h1 {
  font-weight: 400;
  margin-bottom: 20px;
}

.contact-us p {
  font-size: 22px;
  color: #5c6079;
  margin-bottom: 15px;
}

.email-link {
  font-size: 24px;
  color: #c9a7d4;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.email-link:hover {
  color: white;
  text-decoration: underline;
}
/* Stars background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(4px 4px at 80px 60px, white, transparent),
    radial-gradient(3px 3px at 300px 120px, white, transparent),
    radial-gradient(5px 5px at 500px 80px, white, transparent),
    radial-gradient(3px 3px at 700px 40px, white, transparent),
    radial-gradient(4px 4px at 900px 100px, white, transparent),
    radial-gradient(3px 3px at 1100px 60px, white, transparent),
    radial-gradient(5px 5px at 1300px 140px, white, transparent),
    radial-gradient(4px 4px at 1500px 80px, white, transparent),
    radial-gradient(3px 3px at 200px 200px, white, transparent),
    radial-gradient(4px 4px at 450px 250px, white, transparent),
    radial-gradient(5px 5px at 650px 180px, white, transparent),
    radial-gradient(3px 3px at 850px 220px, white, transparent),
    radial-gradient(4px 4px at 1050px 190px, white, transparent),
    radial-gradient(5px 5px at 1250px 240px, white, transparent),
    radial-gradient(3px 3px at 1450px 200px, white, transparent),
    radial-gradient(4px 4px at 100px 320px, white, transparent),
    radial-gradient(3px 3px at 350px 380px, white, transparent),
    radial-gradient(5px 5px at 550px 340px, white, transparent),
    radial-gradient(4px 4px at 750px 360px, white, transparent),
    radial-gradient(3px 3px at 950px 320px, white, transparent),
    radial-gradient(4px 4px at 1150px 380px, white, transparent),
    radial-gradient(5px 5px at 1350px 340px, white, transparent);
  background-repeat: repeat;
  background-size: 1600px 400px;
  opacity: 0.7;
  z-index: -1;
  animation: twinkle 2s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% {
    opacity: 0.5;
  }
  100% {
    opacity: 0.8;
  }
}
