/* ==========================================================================
   Header Dropdown Menu Styles (Desktop: width >= 1024px)
   ========================================================================== */
@media screen and (min-width: 1024px) {

  /* Ensure parent items are positioned relatively */
  .header__menu-list--item.menu-item-has-children {
    position: relative;
  }

  /* Style parent link to align arrow */
  .header__menu-list--item.menu-item-has-children>a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  /* Create the arrow indicator */
  .header__menu-list--item.menu-item-has-children>a::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -3px;
  }

  /* Rotate arrow on hover */
  .header__menu-list--item.menu-item-has-children:hover>a::after {
    transform: rotate(-135deg);
    margin-top: 2px;
  }

  /* Submenu dropdown container */
  .header__menu-list--item .sub-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 10px 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    list-style: none;
  }

  /* Invisible bridge to keep hover active across the gap */
  .header__menu-list--item .sub-menu::after {
    content: "";
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
  }

  /* Triangle pointer above the dropdown */
  .header__menu-list--item .sub-menu::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 8px 8px 8px;
    border-style: solid;
    border-color: transparent transparent #ffffff transparent;
  }

  /* Show dropdown on parent hover */
  .header__menu-list--item.menu-item-has-children:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }

  /* Submenu list items styling */
  .header__menu-list--item .sub-menu .header__menu-list--item {
    display: block;
    margin: 0 !important;
    padding: 0;
    border-bottom: none;
    text-align: left;
  }

  /* Submenu link styling */
  .header__menu-list--item .sub-menu .header__menu-list--item-link {
    display: block;
    padding: 10px 20px;
    color: #141414;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-radius: 0;
  }

  /* Hover state for submenu links */
  .header__menu-list--item .sub-menu .header__menu-list--item-link:hover {
    background-color: #f1f9fe;
    color: #01a0e2;
  }

  /* Disable the theme's default blue top-border hover line for dropdown links */
  .header__menu-list--item .sub-menu a::before {
    display: none !important;
    content: none !important;
  }
}

/* ==========================================================================
   Header Dropdown Menu Styles (Mobile: width < 1024px)
   ========================================================================== */
@media screen and (max-width: 1023px) {

  /* Parent item wrapper */
  .header__menu-list--item.menu-item-has-children {
    display: block;
    /* Override flex */
    padding: 0 !important;
    border-bottom: 1px solid #e8e8e8;
  }

  /* Make parent link span full width and behave like flex */
  .header__menu-list--item.menu-item-has-children>a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 12px;
    text-transform: uppercase;
    box-sizing: border-box;
    width: 100%;
  }

  /* Custom toggle arrow on the right */
  .header__menu-list--item.menu-item-has-children>a::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #141414;
    border-bottom: 2px solid #141414;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-right: 5px;
    margin-top: -4px;
  }

  /* Rotate arrow when open */
  .header__menu-list--item.menu-item-has-children>a.open::after {
    transform: rotate(-135deg);
    margin-top: 2px;
  }

  /* Submenu list mobile */
  .header__menu-list--item.menu-item-has-children .sub-menu {
    display: none;
    /* Controlled by jQuery slideToggle */
    background-color: #f7f9fa;
    padding: 0;
    margin: 0;
    list-style: none;
    border-top: 1px solid #eee;
  }

  /* Submenu list items mobile */
  .header__menu-list--item.menu-item-has-children .sub-menu .header__menu-list--item {
    display: block;
    padding: 0;
    border-bottom: none;
  }

  /* Submenu link mobile */
  .header__menu-list--item.menu-item-has-children .sub-menu .header__menu-list--item-link {
    display: block;
    padding: 12px 24px;
    font-size: 14px;
    color: #444444;
    text-transform: uppercase;
  }

  .header__menu-list--item.menu-item-has-children .sub-menu .header__menu-list--item-link:active,
  .header__menu-list--item.menu-item-has-children .sub-menu .header__menu-list--item-link:hover {
    background-color: #eef3f6;
    color: #01a0e2;
  }
}

/* ==========================================================================
   PDF Gallery Layout Custom Styles (Blocks in Website Style)
   ========================================================================== */
.pdf-gallery {
  padding-bottom: 60px;
}

/* Custom PDF card to handle document cover page aesthetics */
.gallery__list--item.pdf-gallery__item {
  text-decoration: none;
}

/* Override circular image to make it rectangular with rounded corners (book-cover ratio) */
.gallery__list--item.pdf-gallery__item .pdf-gallery__item-image {
  border-radius: 12px;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  object-fit: cover;
}

/* Card hover animation */
.gallery__list--item.pdf-gallery__item:hover .pdf-gallery__item-image {
  transform: translateY(-4px);
  box-shadow: 0px 12px 24px rgba(1, 160, 226, 0.15);
}

/* Fallback cover placeholder if no preview image is uploaded */
.pdf-gallery__placeholder-image {
  width: 250px;
  height: 250px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff7b7b 0%, #e53e3e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: "Inter", sans-serif;
  box-shadow: 0px 8px 16px rgba(229, 62, 62, 0.15);
  margin-bottom: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pdf-gallery__placeholder-image .pdf-icon {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 1px;
}

.gallery__list--item.pdf-gallery__item:hover .pdf-gallery__placeholder-image {
  transform: translateY(-4px);
  box-shadow: 0px 12px 24px rgba(229, 62, 62, 0.25);
}

/* Responsiveness overrides for the PDF preview covers/placeholders */
@media screen and (min-width: 768px) {
  .pdf-gallery__placeholder-image {
    margin-bottom: 0;
  }
}

@media screen and (min-width: 1024px) {
  .pdf-gallery__placeholder-image {
    width: 120px;
    height: 120px;
  }

  .pdf-gallery__placeholder-image .pdf-icon {
    font-size: 20px;
  }
}

@media screen and (min-width: 1200px) {
  .pdf-gallery__placeholder-image {
    width: 165px;
    height: 165px;
  }

  .pdf-gallery__placeholder-image .pdf-icon {
    font-size: 24px;
  }
}

@media screen and (min-width: 1280px) {
  .pdf-gallery__placeholder-image {
    width: 195px;
    height: 195px;
  }

  .pdf-gallery__placeholder-image .pdf-icon {
    font-size: 28px;
  }
}

@media screen and (min-width: 1440px) {
  .pdf-gallery__placeholder-image {
    width: 250px;
    height: 250px;
  }

  .pdf-gallery__placeholder-image .pdf-icon {
    font-size: 32px;
  }
}

.no-records {
  font-size: 18px;
  color: #718096;
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 0;
}

/* ==========================================================================
   Header Menu List Items (Increased font size for very large screens)
   ========================================================================== */

@media screen and (min-width: 1024px) {
  .header__menu-list--item {
    font-size: 12px;
  }
}

@media screen and (min-width: 1600px) {
  .header__menu-list--item {
    font-size: 14px;
  }
}

/* ==========================================================================
   Our Partners Logos Adjustment (Equal size, no stretching, vertical center)
   ========================================================================== */
.our-partners__slider .slick-slide {
  display: flex !important;
  align-items: center;
  justify-content: center;
  height: 90px;
  /* height of slide wrapper */
}

.our-partners__slider img.our-partners {
  height: auto;
  max-height: 80px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto;
}

@media screen and (max-width: 767px) {
  .our-partners__slider .slick-slide {
    height: 60px;
  }

  .our-partners__slider img.our-partners {
    max-height: 50px;
  }
}

.new-photos__list--item-image,
.actual__photos-list--item-image,
.program__list--item-image {
  object-position: center 20%;
}

/* Prevent circular images from deforming/shrinking in flex containers */
.gallery__list--item-image,
.news__list--item-image {
  flex-shrink: 0;
  object-fit: cover;
}

/* ==========================================================================
   Latest News Cards Hover Effects (Homepage)
   ========================================================================== */
.last-news__container--list-item {
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.last-news__container--list-item:hover {
  border-color: #01a0e2;
  transform: translateY(-4px);
  box-shadow: 0px 12px 30px rgba(1, 160, 226, 0.15);
}

/* Arrow micro-animation on hover */
.last-news__container--list-item-button-arrow {
  transition: transform 0.3s ease;
}

.last-news__container--list-item:hover .last-news__container--list-item-button-arrow {
  transform: translateX(5px);
}

/* Title text color transition */
.last-news__container--list-item-title {
  transition: color 0.3s ease;
}

.last-news__container--list-item:hover .last-news__container--list-item-title {
  color: #01a0e2;
}