/* ============================================
   Ramadan Festival – Header (parallax, responsive)
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  background-color: #f4c6d1;
}

/* ---- Header container: width 100%, height from aspect ratio (not 100vh) ---- */
.site-header {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  min-height: 280px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Base layer: full bleed, no pointer events ---- */
.header-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ---- Layer 1: Fixed background (parallax: stays fixed) ---- */
.header-bg {
  background-image: url("../images/headbg.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  z-index: 0;
}

/* ---- Layer 2: Buildings (parallax: slight movement on scroll) ---- */
.header-buildings {
  background-image: url("../images/headbuldings.png");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% auto;
  height: 100%;
  bottom: 0;
  top: auto;
  left: 0;
  right: 0;
  z-index: 1;
  will-change: transform;
}

/* ---- Layer 3: Moon (same scale/ratio as design) ---- */
.header-moon {
  background-image: url("../images/moon.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  /* Upper right quadrant; size proportional to viewport */
  top: 12%;
  right: 10%;
  left: auto;
  bottom: auto;
  width: clamp(80px, 18vw, 200px);
  height: clamp(80px, 18vw, 200px);
  z-index: 2;
}

/* ---- Bootstrap-style container: same width/gutter as .container for alignment with content below ---- */
.header-container {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  margin: 0 auto;
  width: 100%;
  padding-top: clamp(1.25rem, 4vw, 2.5rem);
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  z-index: 3;
  pointer-events: none;
}

@media (min-width: 576px) {
  .header-container { max-width: 540px; }
}

@media (min-width: 768px) {
  .header-container { max-width: 720px; }
}

@media (min-width: 992px) {
  .header-container { max-width: 960px; }
}

@media (min-width: 1200px) {
  .header-container { max-width: 1140px; }
}

@media (min-width: 1400px) {
  .header-container { max-width: 1320px; }
}

/* ---- Logo: left aligned with container; explicit top offset so it never touches the header top ---- */
.header-logo {
  position: absolute;
  top: clamp(1.5rem, 5vw, 3rem);
  left: 0.75rem;
  width: clamp(80px, 14vw, 140px);
  height: auto;
  object-fit: contain;
  pointer-events: auto;
}

/* ---- Main title: image (header_maintext.png), horizontally centered ---- */
.header-content {
  position: relative;
  z-index: 4;
  width: 100%;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-maintext {
  width: 100%;
  max-width: min(520px, 70vw);
  height: auto;
  display: block;
  object-fit: contain;
  margin: 0 auto;
}

/* ---- Responsive: keep scale/ratio on small screens ---- */
@media (max-width: 768px) {
  .header-buildings {
    background-size: 180% auto;
    background-position: 50% bottom;
  }

  .header-moon {
    top: 10%;
    right: 6%;
    width: clamp(60px, 22vw, 120px);
    height: clamp(60px, 22vw, 120px);
  }

  .header-logo {
    width: clamp(70px, 20vw, 120px);
  }

  .header-maintext {
    max-width: min(400px, 78vw);
  }
}

@media (max-width: 480px) {
  .header-maintext {
      max-width: 200px;
    }
  .header-buildings {
    background-size: 220% auto;
  }
}

/* ---- Reduced motion: disable parallax for accessibility ---- */
@media (prefers-reduced-motion: reduce) {
  .header-bg {
    background-attachment: scroll;
  }

  .header-buildings {
    will-change: auto;
  }
}
