/* RPK24 V1.5.7 — Hero / Quick access / School introduction / Header polish.
   Additive homepage-only patch; keep PHP data and sidebar / admin unchanged.
   Load AFTER rpk24-responsive-v156.css. */

/* 1. Preserve all artwork and writing at the bottom of the hero image.
   The former negative top margin made Quick Access obscure part of the artwork. */
body.rpk-homepage .rpk24-shortcuts-section {
  margin-top: 0 !important;
  padding-top: clamp(10px, 1.6vw, 22px) !important;
  padding-bottom: clamp(22px, 2.3vw, 34px) !important;
}
body.rpk-homepage .rpk24-hero-region { margin-bottom: 0 !important; }
body.rpk-homepage .rpk24-hero-foreground {
  object-fit: contain !important;
  object-position: center !important;
}
body.rpk-homepage .rpk24-shortcuts { max-width: 100%; }

/* 2. The feature panel uses a real school image without trimming the original poster.
   A soft copy of the image fills the background while the sharp copy is contained. */
body.rpk-homepage .rpk24-v15-highlight-photo {
  display: grid !important;
  place-items: center !important;
  isolation: isolate;
  position: relative;
  overflow: hidden;
  background: #0d377f;
  min-width: 0;
}
body.rpk-homepage .rpk24-v15-highlight-photo img.rpk24-v15-highlight-backdrop {
  position: absolute !important;
  z-index: 0 !important;
  inset: -16px !important;
  width: calc(100% + 32px) !important;
  height: calc(100% + 32px) !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center !important;
  filter: blur(18px) brightness(.58) saturate(.9);
  transform: scale(1.04);
  pointer-events: none;
}
body.rpk-homepage .rpk24-v15-highlight-photo img.rpk24-v15-highlight-foreground {
  display: block !important;
  z-index: 1 !important;
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  filter: drop-shadow(0 5px 10px rgba(0, 15, 45, .22));
}
body.rpk-homepage .rpk24-v15-highlight-photo::after {
  z-index: 2 !important;
  pointer-events: none;
}
body.rpk-homepage .rpk24-v15-highlight-photo .rpk24-v15-highlight-label {
  z-index: 3 !important;
}

/* 3. Keep the full official school title visible rather than an ellipsis. */
body.rpk-homepage > nav a[href="index.php"].group span.block.font-bold {
  white-space: normal !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  text-overflow: clip !important;
  overflow: hidden !important;
  line-height: 1.4 !important;
}
@media (min-width:1024px) and (max-width:1450px) {
  /* The original menu takes more width than some laptops provide.
     Reuse the existing functional hamburger, not a second navigation. */
  body.rpk-homepage > nav .lg\:block.ml-auto { display: none !important; }
  body.rpk-homepage > nav > div > div.flex.items-center.justify-between.h-20 > div.lg\:hidden { display: flex !important; }
  body.rpk-homepage > nav #mobile-menu { display: none !important; }
  body.rpk-homepage > nav #mobile-menu:not(.hidden) { display: block !important; }
  body.rpk-homepage > nav a[href="index.php"].group { max-width: calc(100% - 70px); }
  body.rpk-homepage > nav a[href="index.php"].group span.block.font-bold { font-size: clamp(15px, 1.65vw, 19px) !important; }
}

/* 4. Comfortable content spacing on common screen sizes. */
@media (min-width: 1024px) {
  body.rpk-homepage .rpk24-home-layout-v15 { column-gap: clamp(20px, 2vw, 30px) !important; }
  body.rpk-homepage .rpk24-home-primary { gap: 26px !important; }
}
@media (min-width:601px) and (max-width:1023px) {
  body.rpk-homepage .rpk24-shortcuts-section { padding-top: 15px !important; }
  body.rpk-homepage .rpk24-v15-highlight-photo { min-height: 235px; }
}
@media (max-width:600px) {
  body.rpk-homepage .rpk24-shortcuts-section { margin-top: 0 !important; padding-top: 10px !important; padding-bottom: 23px !important; }
  body.rpk-homepage .rpk24-shortcuts { border-radius: 18px; }
  body.rpk-homepage .rpk24-v15-highlight-photo { min-height: 205px !important; }
  body.rpk-homepage .rpk24-v15-highlight-photo img.rpk24-v15-highlight-foreground { min-height: 205px; }
  body.rpk-homepage .rpk24-v15-highlight-content { padding: 17px !important; }
  body.rpk-homepage .rpk24-hero::after { opacity: .25; }
}
@media (max-width:1399px) {
  /* Chat icon stays available without covering the school director's photo. */
  body.rpk-homepage #chat-widget-btn {
    width: 54px !important; height: 54px !important; padding: 6px !important;
    right: 14px !important; bottom: 18px !important;
    border-radius: 999px !important; justify-content: center !important;
  }
  body.rpk-homepage #chat-widget-btn > div { width: 38px !important; height: 38px !important; }
  body.rpk-homepage #chat-widget-btn > span {
    position: absolute !important; width: 1px !important; height: 1px !important;
    margin: -1px !important; padding: 0 !important; overflow: hidden !important;
    clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important;
  }
}
