/* Shared layout repairs, loaded after the original theme. */
body { font-family: 'Montserrat', sans-serif; color: #203b3e; }
p:not(:where(.home-courses p)) { line-height: 1.75; text-align: left; }
img, video { max-width: 100%; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #bc9149 !important; outline-offset: 4px; }
.slider { height: auto; margin-top: 0; }
.slider .carousel-inner { overflow: hidden; }
.slider .carousel-item { height: clamp(480px, 70vh, 780px); background: #153c40; }
.slider .carousel-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.slider .carousel-item::before { background: linear-gradient(180deg, rgba(6,32,36,.12), rgba(6,32,36,.72)); }
.slider .banner-overlay { top: auto; bottom: 0; left: 0; transform: none; width: 100%; padding: 48px 72px 64px; animation: none; }
.slider .banner-overlay h1 { max-width: 850px; margin: 0 auto 28px; font-family: inherit; font-size: clamp(32px, 4.5vw, 64px); font-weight: 600; line-height: 1.15; text-wrap: balance; letter-spacing: -.035em; }
.slider .banner-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.slider .banner-buttons .btn { min-height: 48px; padding: 13px 26px; border: 1px solid transparent; }
.slider .btn-contact:hover { color: #005b66; background: #eef7f7; }
.slider .btn-donate { background: #006c76; border-color: #49a1a7; color: white; }
.slider .btn-donate:hover { color: white; background: #004c55; border-color: white; }
.slider .carousel-control-prev, .slider .carousel-control-next { display: none; }
.home-contact-bg iframe { width: 100%; border-radius: 16px; }
#contact { scroll-margin-top: 96px; }
#wsnavtoggle { border: 0; background: transparent; cursor: pointer; }
@media (min-width: 992px) {
  .top-menu, .top-menu.tiny { position: sticky; top: 0; background: white; box-shadow: 0 2px 16px rgba(0,50,55,.06); }
  .top-menu .container1 { max-width: 1440px; margin: auto; padding: 0 28px; }
  .top-menu .wsmenu { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0; min-height: 96px; float: none; }
  .top-menu .desktoplogo { display: block; width: 240px; flex: 0 0 240px; padding: 0; margin: 0; }
  .top-menu .desktoplogo .content, .top-menu .desktoplogo a { display: block; }
  .top-menu .desktoplogo img, .top-menu.tiny .desktoplogo img { width: 100%; height: 68px; object-fit: contain; }
  .top-menu .wsmenu > .wsmenu-list { width: auto; display: flex; align-items: center; gap: 3px; margin: 0; padding: 0; float: none; }
  .top-menu .wsmenu > .wsmenu-list > li > a { padding: 13px 10px; font-size: 13px; white-space: nowrap; color: #17474c; }
  .top-menu .wsmenu > .wsmenu-list > li > a.btn-one-full { background: #005b66; color: white; border-radius: 30px; padding: 12px 22px; }
  .top-menu .wsmenu > .wsmenu-list > li > a.for-xs { display: none; }
  .top-menu .wsmenu > .wsmenu-list > li > ul.sub-menu, .top-menu.tiny .wsmenu > .wsmenu-list > li > ul.sub-menu { top: 100%; }
}
@media (max-width: 991px) {
  .site-container { padding-top: 76px; }
  .wsmobileheader { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; box-shadow: 0 2px 12px rgba(0,50,55,.08); }
  .wsmobileheader > .smllogo { width: auto; margin: 0; padding: 0; max-width: calc(100% - 65px); }
  .smllogo a { float: none; }
  .wsmobileheader .smllogo a img { width: 225px; max-width: 100%; height: 54px; object-fit: contain; object-position: left center; }
  #wsnavtoggle { position: absolute; top: 16px; right: 16px; left: auto; margin: 0; width: 44px; height: 44px; }
  .slider, .inner-banner { margin-top: 0; }
  .slider .carousel-item { height: 560px; max-height: 76svh; min-height: 420px; }
  .slider .banner-overlay { padding: 40px 44px; }
  .home-welcome-bg h5 { font-size: 17px; line-height: 1.8; }
  .inner-banner img { height: 240px; object-fit: cover; }
}
@media (max-width: 575px) {
  .slider .banner-overlay { padding: 32px 24px 40px; }
  .slider .banner-overlay h1 { font-size: 34px; }
  .slider .banner-buttons .btn { padding: 12px 20px; font-size: 14px; }
  ul.project-link-bg { right: 10px; top: auto; bottom: 18px; display: flex; gap: 8px; }
  ul.project-link-bg li { margin: 0; }
  ul.project-link-bg li a span { width: 40px; height: 40px; font-size: 16px; }
  .back-to-top { bottom: 80px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .banner-overlay, .banner-overlay h1, .banner-buttons, .scroll-content { animation: none !important; }
}
/* Courses: reference-style scroll-linked stacking. */
.home-courses .course-stack { --course-pin: 100px; display: flex; flex-direction: column; gap: 60px; position: relative; overflow: visible; padding-bottom: 24px; }
.home-courses .course-stack .home-course-box { position: sticky; top: var(--course-pin); flex: none; height: clamp(500px, 72vh, 680px); width: 100%; margin: 0 !important; padding: 0 !important; border: 0; border-radius: 14px; background: #fff; opacity: 1; transform: scale(var(--course-scale, 1)); transform-origin: center center; transition: none; overflow: hidden; will-change: transform; }
.home-courses .course-stack .home-course-box > img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.home-courses .course-stack .cource-content-box { position: absolute; top: 50%; right: 4.5%; bottom: auto; transform: translateY(-50%); width: 40%; max-width: 440px; padding: 32px; margin: 0; border-radius: 12px; background: #fff; }
.home-courses .course-stack .cource-content-box h2 { font-size: clamp(24px, 2.6vw, 38px) !important; line-height: 1.15; }
.home-courses .course-stack .cource-content-box p { font-size: 14px; line-height: 1.6; text-align: left; }
.home-courses .course-stack .cource-content-box .row p { margin-bottom: 0; }
.home-courses .course-stack .cource-content-box .row a { display: block; padding: 12px 6px; text-align: center; font-size: 12px; }
@media (max-width: 991px) {
  .home-courses .course-stack { --course-pin: 92px; gap: 40px; }
  .home-courses .course-stack .cource-content-box { width: 48%; padding: 24px; }
}
@media (max-width: 575px) {
  .home-courses .course-stack { --course-pin: 88px; gap: 32px; }
  .home-courses .course-stack .home-course-box { height: max(620px, 78svh); }
  .home-courses .course-stack .cource-content-box { top: auto; bottom: 16px; left: 16px; right: 16px; transform: none; width: auto; max-width: none; padding: 22px; }
  .home-courses .course-stack .cource-content-box h2 { font-size: 24px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .home-courses .course-stack .home-course-box { position: relative; top: auto; transform: none; will-change: auto; }
}
/* Keep Hibr's longer description and both actions above the fold. */
.home-courses .course-stack .course-hibr .cource-content-box { top: 20px; bottom: auto; transform: none; width: 52%; max-width: 480px; padding: 24px; }
.home-courses .course-stack .course-hibr .cource-content-box h2 { font-size: clamp(22px, 2.2vw, 32px) !important; margin-bottom: 14px; }
.home-courses .course-stack .course-hibr .cource-content-box p { font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.home-courses .course-stack .course-hibr .cource-content-box .row p { margin-bottom: 0; }
.home-courses .course-stack .course-hibr .cource-content-box .row a { padding: 10px 6px; }
@media (max-width: 575px) {
  .home-courses .course-stack .course-hibr .cource-content-box { top: auto; bottom: 28px; width: auto; padding: 22px; }
}
/* Photos: three continuous vertical film strips with soft white edges. */
.home-photos { padding: 80px 0; background: #fff; }
.home-photos > .container { max-width: 1144px; }
.photos-heading { text-align: center; margin: 0 auto 60px; }
.photos-label { display: inline-flex; align-items: center; gap: 8px; color: #005b66; font-size: 16px; margin-bottom: 30px; }
.photos-heading h2 { color: #111; font-family: inherit; font-size: clamp(36px, 4vw, 52px); font-weight: 600; letter-spacing: -.04em; line-height: 1.12; margin: 0; }
.photos-scribble { display: block; color: #006b78; width: 130px; height: 24px; margin: 8px auto 12px; }
.photos-heading p { text-align: center; font-size: 16px; font-weight: 400; color: #8a8a8a; margin: 0; }
.photos-wall { height: 680px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; overflow: hidden; mask-image: linear-gradient(to bottom, transparent, #000 12.5%, #000 87.5%, transparent); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12.5%, #000 87.5%, transparent); }
.photos-column { min-width: 0; height: 100%; overflow: hidden; }
.photos-track { display: flex; flex-direction: column; width: 100%; will-change: transform; animation: photos-drift var(--photos-duration,33s) linear infinite; }
.photos-column-reverse .photos-track { animation-direction: reverse; }
.photos-loop { display: flex; flex: none; flex-direction: column; gap: 10px; padding-bottom: 10px; }
.photos-card { height: 320px; flex: none; overflow: hidden; border-radius: 8px; background: #eef3f2; }
.photos-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos-wall:hover .photos-track, .photos-wall:focus-within .photos-track { animation-play-state: paused; }
.photos-footer { text-align: center; margin-top: 32px; }
@keyframes photos-drift { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes photos-heading-reveal { from { opacity: 0; transform: translateY(20px); filter: blur(8px); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }
.photos-heading.is-visible h2 { animation: photos-heading-reveal .9s ease both; }
@media (max-width: 767px) {
  .home-photos { padding: 56px 0; }
  .photos-heading { margin-bottom: 36px; }
  .photos-label { margin-bottom: 20px; }
  .photos-wall { height: 520px; gap: 8px; }
  .photos-card { height: 250px; }
  .photos-loop { gap: 8px; padding-bottom: 8px; }
}
@media (max-width: 480px) {
  .photos-wall { height: 440px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .photos-column:last-child { display: none; }
  .photos-card { height: 230px; }
  .photos-heading p { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .photos-track, .photos-heading.is-visible h2 { animation: none; transform: none; filter: none; }
  .photos-loop[aria-hidden="true"] { display: none; }
  .photos-wall { height: auto; mask-image: none; -webkit-mask-image: none; }
  .photos-card:nth-child(n+4) { display: none; }
}
/* Allow the introduction to use the full width beneath its photo. */
.about-intro-copy { display: flow-root; }
.about-intro-image { float: right; width: 40%; height: auto; margin: 0 0 24px 32px; }
.about-intro-copy p { line-height: 1.8; text-align: justify; text-justify: inter-word; }
@media (max-width: 575px) {
  .about-intro-image { float: none; width: 100%; margin: 0 0 24px; display: block; }
}
/* Keep longer content aligned on both edges across information sections. */
.inner-section p:not(.text-center),
.vision-section .missionbox p,
.inner-wisdom-bg p,
.home-founder-message p,
.home-snd-bg p,
.home-courses .course-stack .cource-content-box > p {
    text-align: justify;
    text-justify: inter-word;
}

/* Welcome section: shared top edge for the video and introductory copy. */
.home-snd-bg .home-about-title { display: flex; align-items: center; gap: 10px; text-align: left; margin: 0 0 20px; }
.home-snd-bg .home-about-title svg { width: 32px !important; height: 32px !important; }
.home-snd-bg .row { align-items: flex-start; row-gap: 24px; }
.home-snd-bg video { display: block; width: 100%; margin: 0; }
.home-snd-bg .col-md-7 > p:first-child { margin-top: 0; }

@media (min-width: 768px) {
  .home-snd-bg .row { align-items: flex-start; }
  .home-snd-bg .row > .col-md-5 { display: block; }
  .home-snd-bg .row > .col-md-5 video { height: auto; min-height: 0; }
  .home-snd-bg .col-md-7 > p:last-child { margin-bottom: 0; }
}


/* Let the welcome copy flow into the space beneath the video. */
.home-about-flow::after { content: ''; display: table; clear: both; }
.home-about-video video { width: 100%; height: auto; display: block; }
.home-about-copy p:last-child { margin-bottom: 0; }
@media (min-width: 768px) {
  .home-about-video { float: left; width: 41.666667%; margin: 0 24px 12px 0; }
  .home-about-copy { display: block; }
  .home-about-copy p:first-child { margin-top: 0; }
}
@media (max-width: 767px) {
  .home-about-video { margin-bottom: 24px; }
}

/* Compact course card typography on mobile. */
@media (max-width: 767px) {
  .home-courses .course-stack .cource-content-box h2,
  .home-courses .course-stack .course-hibr .cource-content-box h2 { font-size: 20px !important; line-height: 1.2; }
  .home-courses .course-stack .cource-content-box p,
  .home-courses .course-stack .course-hibr .cource-content-box p { font-size: 12px; line-height: 1.5; }
  .home-courses .course-stack .cource-content-box .row a { font-size: 11px; }
}

/* Shared campus banner across inner pages. */
.inner-banner { margin: 0 auto; overflow: hidden; isolation: isolate; }
.inner-banner > img { display: block; width: 100%; height: clamp(240px, 29.875vw, 478px); object-fit: cover; object-position: center; }
.inner-banner::before { z-index: 1; background: linear-gradient(180deg, rgba(5, 28, 23, .12), rgba(5, 28, 23, .48)); pointer-events: none; }
.inner-banner > .container { z-index: 2; }
.inner-banner h1 { color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* Expand the welcome introduction across the available width. */
.home-welcome-bg .row > .col-md-9 { flex: 0 0 100%; max-width: 100%; width: 100%; }

/* Give the welcome introduction comfortable side spacing. */
.home-welcome-bg .row > .col-md-9 { padding-left: clamp(24px, 5vw, 80px); padding-right: clamp(24px, 5vw, 80px); }

/* Use the same text typography for counter values and their plus signs. */
.counter-content h4 .counter-plus { font-family: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; }

.hibr-introduction { align-items: flex-start; }
.hibr-introduction p:first-child { margin-top: 0; }
.hibr-introduction img { display: block; width: 100%; }

/* Consistent introduction alignment on every institute detail page. */
.institution-introduction { align-items: flex-start; }
.institution-introduction > .col-md-6 > p:first-child { margin-top: 0; }
.institution-introduction > .col-md-6 > img { display: block; width: 100%; }
@media (max-width: 767px) {
  .institution-introduction { row-gap: 24px; }
}

/* Tighter, readable paragraph spacing throughout institute pages. */
.institution-details p:not(.text-center),
.institution-details .vision-section .missionbox p { line-height: 1.5; }

/* Uniform text formatting for all institute detail pages and their subsections. */
.inner-section.institution-details p,
.inner-section.institution-details .vision-section .missionbox p,
.inner-section.institution-details li { line-height: 1.5; }
.inner-section.institution-details p::first-letter { text-transform: uppercase; }

/* Vision and Mission share a row on tablets and desktops. */
@media (min-width: 768px) {
  .institution-details .vision-section > .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-left: 0; margin-right: 0; align-items: stretch; }
  .institution-details .vision-section > .row > .missionbox { width: auto; max-width: none; min-width: 0; margin: 0; padding: clamp(24px, 3vw, 50px); }
}
@media (max-width: 767px) {
  .institution-details .vision-section > .row { display: grid; grid-template-columns: 1fr; gap: 16px; margin-left: 0; margin-right: 0; }
  .institution-details .vision-section > .row > .missionbox { width: 100%; margin: 0; }
}

/* Bring facilities cards closer to their section heading. */
.inner-vm .row:has(> .activity-card) > .col-12 > .headMain { padding-bottom: 0; margin-bottom: 12px; }
.inner-vm .row > .activity-card { margin-top: 8px; }

/* Separate the facilities heading from the preceding section. */
.inner-vm .row:has(> .activity-card) > .col-12 > .headMain { margin-top: 32px; }

.safawez-title { white-space: nowrap; font-size: clamp(20px, 3.5vw, 45px); }

/* Keep institute introduction headings on one line. */
.institution-details > .container > h2.headMain { white-space: nowrap; font-size: clamp(16px, 3vw, 40px); letter-spacing: -.02em; }
.institution-details > .container > h2.headMain span { display: inline; }
@media (max-width: 575px) {
  .institution-details > .container > h2.headMain { font-size: clamp(11px, 3.2vw, 18px); }
}

/* Align the project date label with the top of the project image. */
@media (min-width: 768px) {
  .home-project-bx > .row { align-items: flex-start; }
  .home-project-bx > .row > .col-md-6.p-5 { padding-top: 0 !important; }
  .home-project-bx > .row > .col-md-6.p-5 > p:first-child { margin-top: 0; }
  .home-project-bx .project-img-wrap > img { display: block; }
}

/* Balanced project image and copy, sharing the same top edge. */
.home-project-bx { padding: 24px; }
.home-project-bx > .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; margin: 0; align-items: start; }
.home-project-bx > .row > .col-md-6 { width: 100%; padding: 0; min-width: 0; }
.home-project-bx .project-img-wrap { border-radius: 18px; }
.home-project-bx .project-img-wrap > img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; box-shadow: none; }
.home-project-bx .project-copy > p:first-child { margin: 0 0 20px; line-height: 1; }
.home-project-bx .project-copy > p:first-child .btn-one { display: inline-flex; align-items: center; margin: 0; line-height: 1.4; }
.home-project-bx .project-copy h5 { margin: 0 0 18px; text-align: left; line-height: 1.3; }
.home-project-bx .project-copy > p:last-child { margin: 0; text-align: left; line-height: 1.6; }
@media (max-width: 767px) {
  .home-project-bx { padding: 16px; }
  .home-project-bx > .row { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .home-project-bx .project-img-wrap > img { aspect-ratio: 4 / 3; }
}
