/* ==========================================================================
   mobile.css  -  phone / small-tablet layer for index.php
   --------------------------------------------------------------------------
   * Must load LAST: after css/indexstyle.css AND the inline <style> blocks in
     index.php (the patched index.php links it just before footer.php).
   * Breakpoints: <=767.98px (phones + small tablets), <=575.98px (small phones)
   * Desktop is untouched: every rule sits inside a max-width / hover:none
     query, except .m-scroll, which only exists once mobile.js creates it.
   ========================================================================== */

/* Scrollable list that mobile.js swaps in for vertical <marquee> blocks */
.m-scroll {
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.m-scroll hr { margin: .5rem 0; }

/* --------------------------------------------------------------------------
   1. Touch devices: stop :hover effects from "sticking" after a tap
   -------------------------------------------------------------------------- */
@media (hover: none) {
  .card-border:hover { transform: none; top: 0; background: #fff; filter: drop-shadow(0 0 2px lightgray); }
  .card-border:hover div .imge { transform: none; top: 0; filter: none; }
  .card-border:hover .t-text,
  .card-border:hover .p-text { color: #000; filter: none; }

  .h5-service-area .h4-service-column:hover { transform: none; box-shadow: none; }
  .h5-service-area .h4-service-column:hover::after { width: 0; }

  .bx-shadow:hover,
  .bx-shadows:hover { transform: none; box-shadow: none; background: #fff; }
  .bx-shadows:hover .text-card { color: #535454; text-shadow: none; }

  .card1:hover { top: 0; border-radius: 0; padding-bottom: 25px; background: #fffffff0; }
  .card1:hover .font-face-1 .title-app { color: #002147; text-shadow: none; letter-spacing: normal; }

  .event-c:hover { background: #fff; color: inherit; }
  .event-c:hover a.read-button {
    background: linear-gradient(65deg, #3b5998, #14183e);
    color: #fff; text-shadow: none; filter: none;
  }
}

/* ==========================================================================
   PHONES + SMALL TABLETS
   ========================================================================== */
@media (max-width: 767.98px) {

  /* ---- 2. Base ---------------------------------------------------------- */
  html { -webkit-text-size-adjust: 100%; }
  html, body { max-width: 100%; overflow-x: hidden; }
  img, video, iframe { max-width: 100%; }
  section .container { text-align: left; }           /* justified text leaves gaps on narrow columns */
  .text-about { text-align: left !important; font-size: 15px; }
  .row[style*="width:100%"] { width: auto !important; margin-left: 0; margin-right: 0; }
  section[style*="padding: 3rem 0px"] { padding: 1.5rem 0 !important; }
  .pt-20 { padding-top: 56px; }
  .pb-100 { padding-bottom: 40px; }

  /* ---- 3. Hero banner carousel ------------------------------------------ */
  .carousel-item img {                                /* was a fixed 165px height = stretched images */
    height: auto;
    aspect-ratio: 2.6 / 1;
    object-fit: cover;
    width: 100%;
  }
  .carAnim { animation: none; }                       /* 50-95s zoom: wasted GPU work on phones */
  .carousel-indicators { margin: 0 0 .25rem; flex-wrap: wrap; }
  .carousel-indicators [data-bs-target] { width: 16px; margin: 0 2px; }
  .carousel-control-prev, .carousel-control-next { width: 36px; }

  /* ---- 4. "Latest Notification" ticker ---------------------------------- */
  .old-web1 > .text-center { flex: 0 0 auto; max-width: 32%; display: flex; align-items: center; }
  .old-web1 .notifications { font-size: 12px !important; line-height: 1.2; padding: 4px 6px; margin: 0; }
  .old-web1 marquee { padding: 6px 0; }
  .old-web1 a { font-size: 14px; }

  /* ---- 5. Accreditation / quick-link badges: 2 per row ------------------- */
  .h5-service-area .row > [class*="col-"] { flex: 0 0 auto; width: 50%; display: flex; }
  .h5-service-area .h4-service-column {
    flex: 1 1 auto; width: 100%;
    padding: 12px !important; gap: 8px; margin-bottom: 14px;
  }
  .h5-service-area .h4-service-column .icon-wrapper span { width: 60px; height: 60px; font-size: 26px; }
  .h5-service-area .h4-service-column .icon-wrapper span > i.icon-color { padding: 0 !important; }
  .h5-service-area .lnk1 { font-size: 13px !important; line-height: 1.3 !important; margin: 6px 0 0; }

  /* ---- 6. Vice-Chancellor card + welcome text --------------------------- */
  .dr-img { width: min(70%, 240px); height: auto; }
  .principle { padding: .65rem; margin-left: 0; }     /* comfortable tap target */
  .admin-img { height: auto; }

  /* ---- 7. Notice board tabs + "Important Links" ------------------------- */
  #nav-tab { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  #nav-tab::-webkit-scrollbar { display: none; }
  #nav-tab .nav-link { white-space: nowrap; font-size: 15px; padding: .6rem .9rem; }
  .news-wrapper { padding-left: .5rem !important; padding-right: .5rem !important; }
  .m-scroll a { font-size: 15px; line-height: 1.5; }

  .row.my-3 > .col-lg-4.col-md-6.col-sm-12 { flex: 0 0 auto; width: 33.3333%; }
  .row.my-3 .bx-shadows { padding: 8px 4px; gap: 4px; }
  .row.my-3 .text-card { font-size: 12px !important; line-height: 1.25; margin-bottom: .25rem !important; }

  /* ---- 8. "Forthcoming Events" / "Events" columns ----------------------- */
  [style*="border-right: 16px solid #6d79cb"] {       /* heading bars use inline styles */
    margin-left: 0 !important; padding: 4px 10px !important;
    border-right-width: 10px !important; font-size: 18px !important;
  }
  .leaf-box { width: 2.4rem; flex: 0 0 2.4rem; }
  .leaf-1::before, .leaf-2::after, .leaf-3::before { width: 10px; }
  div[style*="height:60vh"] { height: auto !important; max-height: 70vh; min-height: 0; }

  .calender-outer { gap: 10px; align-items: stretch; }
  .calender-time-inside { width: 68px; min-height: 68px; height: auto; padding: 6px;
                          display: flex; align-items: center; justify-content: center; }
  .span-c { font-size: 14px; line-height: 1.2; text-align: center; }
  .calender-time::before, .calender-time::after { display: none; }   /* offset decor only fits desktop */
  .calender-texts { padding-right: 0; font-size: 14px; line-height: 1.4;
                    word-break: break-word; text-align: left; }
  .read-flex { padding: 0 6px 6px; }
  .read-button { width: auto; min-width: 92px; padding: 8px 14px; margin: 3px; font-size: 14px; }

  /* ---- 9. Counters: 3 per row on tablets, 2 on phones ------------------- */
  .counter-container > [class*="col-"] { flex: 0 0 auto; width: 50%; }
  .icon-font, .icon-number { font-size: 26px; }
  .text-white.icon-plus, .icon-plus { font-size: 1.4rem; margin-top: .3rem; }
  .counter { margin: 4px; }
  .ptext { font-size: .95rem; }

  /* ---- 10. Portal tiles (NAD, IDP, Start-up ...): 2 per row ------------- */
  .row > .col-lg-2.col-md-4.my-2 { flex: 0 0 auto; width: 50%; }
  .bx-shadow > .text-card {
    position: static !important; margin: 6px 0 8px !important; padding: 0 6px; font-size: 13px;
  }
  .bx-shadow img { margin-bottom: 4px !important; }

  /* ---- 11. "New-Initiatives" cards --------------------------------------- */
  .eleven h3 { padding-bottom: 36px; letter-spacing: 1px; }
  .eleven h3:before { left: 0 !important; margin-left: 0 !important; width: 100% !important; }
  .slick-slide { margin: 0; padding: 8px 10px; }      /* side margins break slick's width maths */
  .slick-prev, .slick-next { display: none !important; }   /* swipe + dots instead */
  .card1 { height: auto; min-height: 240px; padding: 20px 16px; margin-bottom: 2.4rem; }
  .font-face-1 img { width: 110px; height: 110px; }
  .card1 .title-app { font-size: 16px; }
  .card1 a {                                          /* arrow was hover-only = unreachable on touch */
    display: flex; position: absolute; bottom: -24px; z-index: 2;
    width: 48px; height: 48px; border-radius: 50%; background: #fff;
    align-items: center; justify-content: center; font-size: 26px;
    text-decoration: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  }

  /* ---- 12. "University Events" heading + slider ------------------------- */
  .event-title {
    margin: 0 0 .75rem; flex-direction: row; flex-wrap: wrap;
    justify-content: center; align-items: center; gap: .4rem; text-align: center;
  }
  .event-title::before, .event-title::after { display: none; }   /* offset ribbon: -10rem margin pushed it off-screen */
  .event-title span {
    position: static; left: 0; top: 0; margin: 0; font-size: inherit; letter-spacing: 2px;
    text-shadow: none; background: #00418b; border-radius: .5rem; padding: .1rem .8rem;
  }
  .regular-r .slick-track { display: flex !important; }
  .regular-r .slick-slide { height: auto; }
  .regular-r .slick-slide > div { height: 100%; }
  .card-border { height: auto; margin: 4px; padding: 10px; }      /* was 45rem = 720px tall */
  .regular-r .card-border { height: 100%; margin: 0; }
  .imge { height: 200px; width: 100%; object-fit: cover; }
  .t-text { font-size: 1.05rem !important; line-height: 1.35; padding-top: 8px; }
  .date { font-size: 18px; padding: 2px 10px 2px 12px; transform: translate(1rem, -2.6rem); }

  /* ---- 13. "University Media" videos + logo strip ----------------------- */
  section.video-area { background-attachment: scroll !important; }   /* fixed bg is broken on iOS */
  .h-slide { height: auto; }
  .h-slide iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; }
  .i-slide { height: auto; }
  .imge-1 { border-radius: 0; }

  /* ---- 14. Aerial-view video pop-ups ------------------------------------ */
  .video-area-back { padding: 64px 0 72px; }
  .pop-up, .pop-uper { width: 94%; height: auto; aspect-ratio: 16 / 9; overflow: visible; }
  .pop-up-close, .pop-uper-close { top: -34px; left: auto; right: 0; transform: none; }
  .pop-up-close i, .pop-uper-close i { color: #fff; font-size: 34px; }

  /* ---- 15. Floating news button, news modal, social bar ----------------- */
  .popUpBtn img { width: 56px !important; height: 56px !important; }
  #modalContent {
    left: 4%; right: 4%; width: auto; margin: 0; top: 8vh;
    max-height: 84vh; overflow: hidden; padding: 14px;
  }
  #modalContent .d-flex { flex-wrap: wrap; gap: 4px; }
  #modal marquee { max-height: 60vh; }
  #modal .m-scroll { max-height: 55vh !important; }
  .close { top: 0; right: 4px; height: auto; line-height: 1; font-size: 30px; padding: 6px 10px; }
  .icon-bar a { padding: 8px 10px !important; }
  .icon-bar a .size-icon { font-size: 1.3rem !important; }
  .icon-bar svg { height: 24px !important; width: 26px !important; }
}

/* ==========================================================================
   SMALL PHONES
   ========================================================================== */
@media (max-width: 420px) {
  .row.my-3 > .col-lg-4.col-md-6.col-sm-12 { width: 50%; }
  .calender-time-inside { width: 60px; min-height: 60px; }
  .span-c { font-size: 13px; }
}

/* ==========================================================================
   Respect "reduce motion" on every screen size
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .carAnim, .heartbeat, .rain, .fa-beat-fade { animation: none !important; }
  .card-border, .card1, .h4-service-column { transition: none !important; }
}
