/* ==========================================================================
   mobile.css  —  Step 1 (public site, phones & tablets)
   Loaded AFTER demo.css / inner.css / phase1.css. Only adds rules; delete this
   file (and its <link> in layout.php) to go back to the previous look.
   ========================================================================== */

/* ---- 1. No sideways scrolling (cause of the empty strip on the right) ----
   Scroll-reveal elements start 56px off to one side, which stretched the page.
   `clip` hides that overflow without breaking the sticky header. */
html, body { max-width: 100%; overflow-x: clip; }
main, section, footer, .hero, .top-bar, .header-main, .notice-ticker { max-width: 100%; overflow-x: clip; }
img, video, iframe, svg { max-width: 100%; }

/* ---- 2. Developer credit (all screen sizes) ---- */
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: nowrap; text-align: left; }
.footer-bottom > p { flex: 1 1 auto; min-width: 0; margin: 0; line-height: 1.6; }
.footer-bottom .footer-dev { margin: 0; flex: 0 0 auto; display: flex; flex-direction: row; align-items: center; gap: 10px; }
.footer-dev .dev-by { font-size: .85rem; letter-spacing: .2px; color: rgba(255, 255, 255, .85); line-height: 1; white-space: nowrap; }
.footer-dev .dev-logo { display: inline-flex; align-items: center; background: #fff; border-radius: 8px; padding: 4px 9px; box-shadow: 0 4px 12px -8px rgba(0, 0, 0, .5); transition: transform .2s ease, box-shadow .2s ease; }
.footer-dev a.dev-logo:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .6); }
.footer-dev .dev-logo img { display: block; height: 20px; width: auto; max-width: 100%; }

/* ---- 3. Tablets & phones ---- */
@media (max-width: 900px) {
  /* Banner: YouTube (16:9) shape, never a tall crop */
  .hero { height: auto; min-height: 0; aspect-ratio: 16 / 9; }
  .hero-slide img { object-position: center; }
  /* text sits on the left, smaller */
  .hero-content.hc { justify-content: flex-start; align-items: center; text-align: left; }
  .hero-content .container { align-items: flex-start; max-width: 100%; width: 100%; padding-left: 18px; padding-right: 18px; }
  .hero-title { max-width: 68%; margin-bottom: 8px; font-size: clamp(1rem, 4.6vw, 1.9rem); line-height: 1.2; }
  .hero-desc { max-width: 62%; margin-bottom: 12px; font-size: clamp(.72rem, 2.8vw, 1rem); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-badge { padding: 3px 10px; font-size: .62rem; margin-bottom: 8px; }
  .hero-btn-white, .hero-btn-outline { padding: 7px 14px; font-size: clamp(.68rem, 2.8vw, .9rem); }
  .hero-buttons { gap: 8px; }
  /* arrows small, bottom right; dots bottom centre */
  .hero-arrows { top: auto; bottom: 8px; transform: none; width: 100%; padding: 0 10px; justify-content: flex-end; gap: 8px; }
  .hero-arrow { width: 30px; height: 30px; font-size: .75rem; }
  .hero-nav { bottom: 14px; gap: 7px; }
  .hero-dot { width: 9px; height: 9px; }
  /* no more "ghost" of the previous slide's text while fading */
  .hero-content.hc { transition: opacity .3s ease, visibility 0s linear .3s; }
  .hero-content.hc.active { transition: opacity .35s ease .25s, visibility 0s; }
}

@media (max-width: 768px) {
  /* Top bar: one tidy row = phone + social + Login */
  .top-bar { padding: 6px 0; font-size: .8rem; }
  .top-bar .container { flex-wrap: nowrap; justify-content: space-between; gap: 8px; }
  .top-bar-left, .top-bar-right { gap: 10px; flex-wrap: nowrap; min-width: 0; }
  .top-bar-left > span:not(:first-child) { display: none; }
  .top-bar-right > span { display: none; }
  .social-mini { gap: 6px; }
  .social-mini a { width: 26px; height: 26px; }
  .top-bar .login-btn { padding: 6px 12px; font-size: .8rem; white-space: nowrap; }
  .top-bar .login-menu { right: 0; max-width: calc(100vw - 24px); }

  /* Header: logo + name always fit */
  .header-inner { padding: 8px 0; gap: 10px; }
  .brand { min-width: 0; flex: 1 1 auto; gap: 10px; }
  .brand-logo { width: 48px; height: 48px; flex: 0 0 48px; }
  .brand-text { min-width: 0; }
  .brand-text h1 { font-size: clamp(.9rem, 4.2vw, 1.15rem); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .brand-text span { font-size: .7rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand-text .motto { display: none; }
  .header-actions { flex: 0 0 auto; gap: 8px; }
  .mobile-toggle { flex: 0 0 auto; }

  /* Notice ticker */
  .notice-ticker { padding: 7px 0; }
  .ticker-wrap { gap: 8px; }
  .ticker-label { padding: 5px 9px; font-size: .66rem; }
  .ticker-wrap > a.btn { padding: 6px 10px !important; font-size: .7rem !important; }
  .ticker-wrap > a.btn i { display: none; }
  .ticker-items a { font-size: .82rem; }

  /* Footer: two columns */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px 16px; margin-bottom: 22px; }
  .footer-grid > * { min-width: 0; }
  .footer-grid > :first-child, .footer-grid > :last-child { grid-column: 1 / -1; }
  .footer-title { font-size: 1rem; }
  .footer-links a, .footer-contact li { overflow-wrap: anywhere; }
  .footer-bottom { font-size: .74rem; padding: 16px 0 74px; }   /* room for the floating badges */
  .footer-dev .dev-logo img { height: 16px; }
  .footer-dev .dev-logo { padding: 3px 7px; border-radius: 7px; }
}

@media (max-width: 560px) {
  /* beats the older single-column footer rule */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px 16px; margin-bottom: 22px; }
  .footer-bottom { justify-content: space-between; text-align: left; }
  .footer-bottom .footer-dev { margin: 0; }
  .live-visitors { bottom: 10px; }
}

/* ==========================================================================
   Step 2 — home page cards (2 per row on phones), testimonials, result page
   ========================================================================== */

/* Home: calendar panel now stands alone (result search moved to the menu) */
.split-section.single { grid-template-columns: 1fr; max-width: 760px; margin-left: auto; margin-right: auto; }

@media (max-width: 560px) {
  /* App-like density: two cards per row */
  .news-grid, .program-grid, .facility-grid, .service-bento, .gallery-grid, .stars { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .news-grid > *, .program-grid > *, .facility-grid > *, .service-bento > *, .gallery-grid > *, .stars > * { min-width: 0; }
  .news-grid h3, .news-grid h4, .program-grid h3, .program-grid h4, .facility-grid h3, .facility-grid h4, .service-item h4 { font-size: .9rem; line-height: 1.3; overflow-wrap: anywhere; }
  .news-grid p, .program-grid p, .facility-grid p, .service-item p { font-size: .76rem; line-height: 1.45; overflow-wrap: anywhere; }
  .news-grid p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .news-img-wrap { height: 110px; }
  .program-grid > *, .facility-grid > * { padding: 14px 10px; }
  .service-item { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 12px; }
  .service-item i { font-size: 1.15rem; }
  .gallery-grid img { width: 100%; height: 120px; object-fit: cover; }
  .stars > * { padding: 14px 8px; }
  /* section rhythm */
  .section { padding-top: 38px; padding-bottom: 38px; }
  .section-title { font-size: 1.35rem; }
  /* Testimonials: smaller cards */
  .testi-track { gap: 12px; }
  .testi-track .testi-card { width: 224px; flex: 0 0 224px; padding: 16px 14px; border-radius: 14px; }
  .testi-card p, .testi-card blockquote { font-size: .8rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
  .testi-card h4, .testi-card b { font-size: .85rem; }
  .testi-card img, .testi-card .avatar { width: 36px; height: 36px; }
}

/* ---- Result search page (/results) ---- */
.result-page .portal-hero { max-width: 1020px; border: 0; border-radius: 26px; box-shadow: 0 30px 60px -28px rgba(15, 40, 100, .45); }
.result-page .portal-hero .art { background: linear-gradient(150deg, #0a2f78 0%, #1d4ed8 60%, #38bdf8 120%); padding: 40px 34px; color: #fff; }
.result-page .portal-hero .art::before { content: ""; position: absolute; left: -50px; top: -50px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255, 255, 255, .08); animation: rpFloat 9s ease-in-out infinite; }
.result-page .portal-hero .art > * { position: relative; z-index: 1; }
.rp-steps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; counter-reset: rp; }
.rp-steps li { counter-increment: rp; display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: 14px; padding: 11px 14px; font-size: .9rem; backdrop-filter: blur(4px); transition: transform .25s ease, background .25s ease; }
.rp-steps li:hover { transform: translateX(4px); background: rgba(255, 255, 255, .2); }
.rp-steps li i { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 10px; background: #fff; color: #1d4ed8; font-size: .9rem; }
.result-page .portal-hero .form { padding: 38px 34px; }
.result-page .field label { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink, #0f172a); }
.result-page .field label i { color: #1d4ed8; width: 16px; text-align: center; }
.result-page .inp, .result-page select.inp { min-height: 48px; border-radius: 14px; background: #f8fafc; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.result-page .inp:focus { transform: translateY(-1px); background: #fff; }
.result-page .btn-block { min-height: 50px; border-radius: 999px; font-size: 1rem; font-weight: 700; box-shadow: 0 14px 26px -14px rgba(29, 78, 216, .8); transition: transform .2s ease, box-shadow .2s ease; }
.result-page .btn-block:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -14px rgba(29, 78, 216, .9); }
@keyframes rpFloat { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(18px, 14px); } }
@media (prefers-reduced-motion: reduce) { .result-page .portal-hero .art::before { animation: none; } .rp-steps li, .result-page .btn-block, .result-page .inp { transition: none; } }
@media (max-width: 760px) {
  .result-page { padding-top: 18px; }
  .result-page .portal-hero { border-radius: 20px; }
  .result-page .portal-hero .art { padding: 24px 20px; }
  .result-page .portal-hero .art h2 { font-size: 1.3rem; }
  .rp-steps { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
  .rp-steps li { flex-direction: column; text-align: center; gap: 6px; padding: 10px 6px; font-size: .7rem; line-height: 1.3; }
  .result-page .portal-hero .form { padding: 22px 18px 26px; }
  .result-page .inp, .result-page select.inp { font-size: 16px; }   /* stops iOS zoom-on-focus */
}

/* ---- Desktop banner: wide, uncropped feel (phones/tablets are handled above) ---- */
@media (min-width: 901px) {
  .hero { height: auto; aspect-ratio: 21 / 8; min-height: 440px; max-height: 680px; }
}


/* ==========================================================================
   Step 6 — leadership messages in 2 columns on phones, "Stars" marquee
   ========================================================================== */
@media (max-width: 900px) {
  .msg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .msg-card { flex-direction: column; align-items: center; text-align: center; padding: 16px 12px; gap: 10px; }
  .msg-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .msg-avatar { width: 108px !important; height: 134px !important; border-radius: 14px !important; margin: 0 auto; }
  .msg-body { width: 100%; min-width: 0; }
  .msg-role { font-size: .62rem; padding: 3px 9px; margin-bottom: 6px; }
  .msg-card h3 { font-size: .95rem; margin-bottom: 6px; overflow-wrap: anywhere; }
  .msg-card p { font-size: .78rem; line-height: 1.55; -webkit-line-clamp: 4; }
  .msg-read { font-size: .78rem; }
}
@media (max-width: 560px) { .footer-dev .dev-by { font-size: .78rem; } .footer-dev { gap: 8px; } }

/* Stars: top 3 of every class, moving right to left */
.stars-section { background: linear-gradient(180deg, var(--surface-2, #f4f6fb), #fff); overflow: hidden; }
.stars-sub { text-align: center; color: var(--muted, #64748b); margin: -6px auto 22px; max-width: 640px; font-size: .95rem; }
.stars-marquee { position: relative; overflow: hidden; padding: 18px 0 30px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.stars-track { display: flex; gap: 20px; width: max-content; padding: 0 10px; animation: starsMove var(--dur, 40s) linear infinite; will-change: transform; }
.stars-marquee:hover .stars-track, .stars-marquee:focus-within .stars-track, .stars-marquee:active .stars-track { animation-play-state: paused; }
@keyframes starsMove { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 10px)); } }   /* the list is repeated twice, so -50% loops seamlessly */
.star-card { --g1: #fde68a; --g2: #f59e0b; --ink: #422006; position: relative; flex: 0 0 236px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 16px 20px; border-radius: 24px; color: var(--ink); text-align: center; overflow: hidden;
  background: linear-gradient(150deg, var(--g1) 0%, var(--g2) 100%); box-shadow: 0 22px 40px -24px rgba(120, 53, 15, .7), inset 0 1px 0 rgba(255, 255, 255, .6); transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s; }
.star-card::before { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .55), transparent 70%); }
.star-card::after { content: ""; position: absolute; left: -30px; bottom: -50px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.star-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 30px 50px -22px rgba(120, 53, 15, .8); }
.star-card > * { position: relative; z-index: 1; }
.sc2 { --g1: #f1f5f9; --g2: #94a3b8; --ink: #0f172a; box-shadow: 0 22px 40px -24px rgba(51, 65, 85, .7), inset 0 1px 0 rgba(255, 255, 255, .7); }
.sc3 { --g1: #fed7aa; --g2: #c2773a; --ink: #3b1d08; box-shadow: 0 22px 40px -24px rgba(124, 45, 18, .7), inset 0 1px 0 rgba(255, 255, 255, .5); }
.star-rank { position: absolute !important; top: 14px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; background: rgba(255, 255, 255, .85); font-family: Poppins, sans-serif; font-weight: 700; font-size: .78rem; letter-spacing: .02em; color: var(--ink); box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .4); }
.star-rank i { color: #d97706; }
.star-photo { width: 108px; height: 108px; border-radius: 50%; object-fit: cover; border: 4px solid rgba(255, 255, 255, .95); box-shadow: 0 14px 26px -12px rgba(0, 0, 0, .55), 0 0 0 5px rgba(255, 255, 255, .28); background: #fff; margin-top: 4px; }
.star-photo.ph { display: grid; place-items: center; font-size: 2.2rem; color: #94a3b8; }
.star-card h3 { margin: 6px 0 0; font-family: Poppins, 'Noto Sans Bengali', sans-serif; font-size: 1.05rem; font-weight: 700; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.star-class { font-size: .8rem; font-weight: 600; opacity: .85; display: inline-flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.star-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .55); backdrop-filter: blur(4px); border: 1px solid rgba(255, 255, 255, .6); font-size: .76rem; font-weight: 600; max-width: 100%; }
.star-chip.gpa { background: rgba(255, 255, 255, .8); font-weight: 700; }
@media (max-width: 560px) { .star-card { flex-basis: 198px; padding: 40px 12px 16px; border-radius: 20px; } .star-photo { width: 88px; height: 88px; } .star-card h3 { font-size: .95rem; } .stars-track { gap: 14px; } }
/* no animation for people who asked for less motion: the row can be swiped instead */
@media (prefers-reduced-motion: reduce) { .stars-marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; } .stars-track { animation: none; } .star-card[aria-hidden="true"] { display: none; } }


/* ===== Update: banner cross-fade, centred main menu, taller About picture ===== */
.hero-slide { transition: opacity 1.6s ease-in-out; }
.hero-slide.leaving { opacity: 1; z-index: 1; transition: none; }
.hero-slide.active { z-index: 2; }
.hero-content.hc.active { animation: hcFadeIn 1.4s ease both; }
@keyframes hcFadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hero-slide { transition: none; } .hero-content.hc.active { animation: none; } }

.nav-desktop .container { justify-content: center; }
.nav-desktop .nav-list { justify-content: center; flex-wrap: wrap; }

.about-img-wrap.about-plain img { width: 100%; height: clamp(480px, 44vw, 640px); min-height: 0; max-height: none; object-fit: cover; object-position: center top; }
@media (max-width: 900px) { .about-img-wrap.about-plain img { height: auto; aspect-ratio: 4 / 3; min-height: 0; max-height: 420px; } }

/* Stars marquee: loop distance is measured by site.js (--shift), so it repeats without a gap or a jump */
@keyframes starsMove { from { transform: translateX(0); } to { transform: translateX(calc(var(--shift, 50%) * -1)); } }
