/*
 * Ethio-Scholars Academy stability and layout refinements.
 * Loaded after the theme stylesheet so deployment updates are predictable.
 */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: #fff;
}

/* Do not let a failed animation or script leave content hidden. */
.wow {
  visibility: visible !important;
}

/* Core page content must remain visible even if the reveal library is delayed. */
.service-area .wow,
.about-area .wow,
.counter-area .wow,
.program-area .wow,
.event-area .wow,
.testimonial-area .wow,
.cta-area .wow {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  animation: none !important;
}

#loading {
  animation: esa-preloader-fallback 0s 3s forwards;
}

@keyframes esa-preloader-fallback {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

.tp-header-logo img {
  max-width: 150px;
  height: auto;
}

.esa-header-enroll,
.tp-header-inner-btn .esa-header-enroll {
  display: inline-flex !important;
  min-height: 46px;
  padding: 11px 22px !important;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.9) !important;
  border-radius: 7px;
  color: #fff !important;
  background: #134d7d !important;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.tp-header-inner-btn .esa-header-enroll {
  border-color: #134d7d !important;
}

.esa-header-enroll:hover,
.esa-header-enroll:focus-visible {
  color: #134d7d !important;
  background: #fff !important;
}

/* Permanent hero call to action: deliberately outside the Swiper wrapper. */
.esa-hero-area {
  position: relative !important;
  isolation: isolate;
}

.esa-hero-area .tp-slider-active {
  position: relative;
  z-index: 1;
}

.tp-slider-active .swiper-slide-active .tp-hero-subtitle,
.tp-slider-active .swiper-slide-active .tp-hero-title {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  animation: none !important;
}

.tp-hero-item {
  min-height: 720px;
  padding-top: 205px;
  padding-bottom: 180px;
}

.tp-hero-wrapper {
  max-width: 850px;
  margin-left: 0;
}

.tp-hero-title {
  max-width: 850px;
  margin-bottom: 22px;
  font-size: clamp(58px, 6vw, 82px);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.esa-hero-copy {
  max-width: 720px;
  color: #fff;
  background: transparent !important;
  font-size: 19px;
  line-height: 1.55;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

.tp-hero-bg::before {
  background: rgba(0, 0, 0, 0.5);
}

.esa-hero-cta {
  position: absolute !important;
  right: auto !important;
  bottom: 72px !important;
  left: max(calc((100% - 1200px) / 2), 24px) !important;
  z-index: 50 !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.esa-hero-cta a {
  display: inline-flex !important;
  box-sizing: border-box;
  min-width: 230px;
  min-height: 58px;
  padding: 15px 30px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 2px solid #fff;
  border-radius: 7px;
  color: #fff !important;
  background: #134d7d !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.esa-hero-cta a:hover,
.esa-hero-cta a:focus-visible {
  color: #134d7d !important;
  background: #fff !important;
  transform: translateY(-2px);
}

/* Keep feature cards orderly instead of overlapping the hero. */
.tp-service-bg {
  padding-top: 72px;
  padding-bottom: 68px;
}

.tp-service-item {
  height: calc(100% - 30px);
  margin-top: 0 !important;
  margin-bottom: 30px !important;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.tp-service-wrap {
  margin-bottom: 0;
  padding: 28px 20px 22px;
}

.tp-service-wrap::before,
.tp-service-item:hover .tp-service-wrap::before {
  top: 0;
  height: 100%;
  box-shadow: 0 8px 24px rgba(18, 37, 54, 0.15);
}

.tp-service-btn {
  display: none;
}

.tp-service-content {
  min-height: 118px;
  padding: 22px 8px 0;
}

.tp-service-content p {
  margin-bottom: 0;
}

.tp-service-shape,
.tp-about-shape,
.tp-about-exprience {
  display: none;
}

/* Simplify the About section while retaining its original content and image. */
.about-area {
  padding-top: 90px !important;
}

.tp-about-bg {
  padding-bottom: 90px;
}

.tp-about-wrap {
  margin-top: 0;
}

.tp-about-thumb-wrapper,
.tp-about-thumb-1 {
  width: 100%;
}

.tp-about-thumb-1 img {
  width: 100%;
  height: 500px;
  border-radius: 16px;
  object-fit: cover;
}

.tp-about-thumb-2 {
  display: none;
}

.tp-about-wrapper {
  margin-left: 20px;
}

.tp-section-title,
.tp-section-2-title {
  overflow-wrap: anywhere;
}

.tp-about-box {
  border: 1px solid rgba(19, 77, 125, 0.1);
  box-shadow: 0 8px 24px rgba(22, 40, 56, 0.06) !important;
}

/* Registration facts no longer overlap the preceding section. */
.tp-counter-wrap {
  margin-top: 60px;
  margin-bottom: 85px !important;
}

.esa-registration-facts {
  overflow: hidden;
  box-shadow: 0 14px 35px rgba(19, 77, 125, 0.18);
}

.esa-registration-facts .tp-counter-item {
  min-height: 178px;
}

/* Consistent feature cards in the existing program slider. */
.program-area {
  padding-top: 10px;
  margin-bottom: 85px !important;
}

.tp-program-item {
  display: flex;
  min-height: 355px;
  padding: 28px 22px 20px;
  flex-direction: column;
  border: 1px solid rgba(19, 77, 125, 0.1);
  box-shadow: 0 10px 28px rgba(22, 40, 56, 0.07);
}

.tp-program-thumb:empty {
  display: none;
}

.tp-program-content {
  padding: 0;
}

.tp-program-content > p {
  min-height: 96px;
}

.tp-program-tag p {
  margin-bottom: 24px;
}

.tp-program-btn {
  margin-top: auto;
}

/* Present the existing program details as calm, readable cards. */
.event-area {
  padding-top: 85px !important;
  padding-bottom: 95px !important;
}

.event-area .row.align-items-end > .col-xl-5 {
  width: 100%;
}

.tp-event-section {
  max-width: 900px;
}

.tp-event-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.tp-event-item,
.tp-event-item:first-child {
  height: 100%;
  padding: 28px;
  border: 1px solid rgba(19, 77, 125, 0.1);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(22, 40, 56, 0.06);
}

.tp-event-list-count {
  font-family: var(--tp-ff-body);
  font-size: 38px;
  font-style: normal;
  font-weight: 700;
}

.tp-event-title {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}

.tp-event-content p {
  margin-bottom: 0;
}

/* The promise section had an empty left column and excessive offsets. */
.testimonial-area {
  padding: 85px 0;
  background-color: #eef4f8;
  background-position: center;
  background-size: cover;
}

.tp-testimonial-themebg,
.tp-testimonial-shape,
.tp-testimonial-arrow {
  display: none;
}

.tp-testimonial-wrapper {
  margin: 0;
  padding: 52px;
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(22, 40, 56, 0.1);
}

.tp-testimonial-wrapper .tp-section-title {
  font-size: clamp(34px, 4vw, 48px);
}

.tp-testimonial-wrapper p {
  max-width: 850px !important;
  margin-bottom: 0;
}

.cta-area {
  padding: 65px 0;
}

.tp-cta-wrapper {
  gap: 24px;
}

.tp-cta-title {
  font-size: clamp(28px, 3vw, 40px);
}

.esa-registration-details {
  line-height: 1.6;
}

/* Contact page refinements. */
.tp-contact-area {
  padding-top: 130px !important;
  padding-bottom: 95px !important;
}

.tp-contact-heading {
  max-width: 850px;
  margin: 0 auto 40px;
}

.tp-contact-title {
  font-size: clamp(44px, 6vw, 70px);
  line-height: 1.05;
}

.tp-contact-from-box {
  border: 1px solid rgba(19, 77, 125, 0.1);
  box-shadow: 0 14px 38px rgba(22, 40, 56, 0.08);
}

.tp-contact-input-form input,
.tp-contact-input-form textarea {
  font-size: 16px;
}

.esa-map-placeholder {
  min-height: 420px;
}

.tp-footer-newsletter-social a,
.tp-footer-4-social a,
.offcanvas-social a {
  transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.tp-footer-newsletter-social a:hover,
.tp-footer-4-social a:hover,
.offcanvas-social a:hover {
  transform: translateY(-2px);
}

@media only screen and (max-width: 991px) {
  .tp-hero-item {
    min-height: 680px;
    padding-top: 170px;
    padding-bottom: 185px;
  }

  .tp-hero-title {
    font-size: clamp(48px, 9vw, 68px);
  }

  .esa-hero-cta {
    bottom: 62px !important;
    left: 24px !important;
  }

  .tp-about-wrapper {
    margin-left: 0;
  }

  .tp-event-wrap {
    grid-template-columns: 1fr;
  }
}

@media only screen and (max-width: 767px) {
  .tp-header-logo img {
    max-width: 112px;
  }

  .tp-hero-item {
    min-height: 720px;
    padding-top: 145px;
    padding-bottom: 190px;
  }

  .tp-hero-subtitle {
    font-size: 15px;
  }

  .tp-hero-title {
    font-size: clamp(40px, 12vw, 54px);
    line-height: 1;
  }

  .esa-hero-copy {
    font-size: 16px;
  }

  .esa-hero-cta {
    right: 20px !important;
    bottom: 48px !important;
    left: 20px !important;
    text-align: center;
  }

  .esa-hero-cta a {
    width: 100%;
    max-width: 320px;
    min-width: 0;
    min-height: 56px;
  }

  .tp-service-bg,
  .about-area,
  .event-area,
  .testimonial-area {
    padding-top: 65px !important;
    padding-bottom: 65px !important;
  }

  .tp-service-content {
    min-height: 0;
  }

  .tp-about-thumb-1 img {
    height: 320px;
  }

  .tp-counter-wrap {
    margin-top: 45px;
    margin-bottom: 65px !important;
  }

  .tp-program-item {
    min-height: 330px;
  }

  .tp-event-item,
  .tp-event-item:first-child {
    padding: 24px 18px;
  }

  .tp-event-list {
    margin-bottom: 15px;
  }

  .tp-testimonial-wrapper {
    padding: 32px 24px;
  }

  .tp-testimonial-wrapper .tp-section-title {
    font-size: 34px;
  }

  .tp-cta-wrapper {
    align-items: flex-start !important;
    flex-direction: column;
  }

  .tp-contact-area {
    padding-top: 105px !important;
    padding-bottom: 70px !important;
  }

  .tp-contact-from-box {
    padding: 26px 20px;
  }

  .esa-map-placeholder {
    min-height: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
