/* ═══════════════════════════════════════════════════════════════
   SDSN Group — Mobile & Tablet Responsive Enhancements
   Layout fixes only — no desktop redesign
   ═══════════════════════════════════════════════════════════════ */

/* ── Global containment ── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img,
video,
iframe,
svg {
  max-width: 100%;
  height: auto;
}

/* Prevent flex/grid children from forcing horizontal scroll */
.site-header-inner,
.site-logo,
.site-nav,
.hero-content,
.hero-copy-panel,
.institution-card-body,
.contact-institution-card,
.footer-contact-list li,
.top-bar-premium-contact .container {
  min-width: 0;
}

/* Footer clearance for floating buttons — dark bg, no white gap below page */
@media (max-width: 767px) {
  body {
    padding-bottom: 0;
  }

  .site-footer {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .site-footer-bottom {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ── Contact page — institution directory (missing base styles) ── */
.contact-branches-section {
  margin-top: 0.5rem;
}

.contact-branches-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .contact-branches-grid {
    gap: 3rem;
  }
}

.contact-branch-block {
  background: linear-gradient(145deg, rgba(248, 249, 252, 0.9) 0%, #ffffff 100%);
  border: 1px solid rgba(11, 31, 77, 0.07);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 16px 40px -20px rgba(11, 31, 77, 0.12);
}

@media (min-width: 768px) {
  .contact-branch-block {
    padding: 2rem 2.25rem;
  }
}

.contact-branch-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(11, 31, 77, 0.08);
}

.contact-branch-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0B1F4D;
  background: rgba(201, 162, 39, 0.18);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 9999px;
}

.contact-branch-header h3 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  font-weight: 700;
  color: #0B1F4D;
  margin-top: 0.65rem;
  line-height: 1.25;
}

.contact-branch-header p {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.35rem;
  line-height: 1.5;
}

.contact-branch-cards {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .contact-branch-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

.contact-institution-card {
  background: #ffffff;
  border: 1px solid rgba(11, 31, 77, 0.08);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 8px 24px -14px rgba(11, 31, 77, 0.14);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.contact-institution-card:hover {
  box-shadow: 0 14px 32px -14px rgba(11, 31, 77, 0.2);
  transform: translateY(-2px);
}

.contact-institution-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.contact-institution-num {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4ad2f, #C9A227);
  color: #0B1F4D;
  font-size: 0.75rem;
  font-weight: 700;
}

.contact-institution-name {
  font-family: 'Merriweather', Georgia, serif;
  font-size: clamp(0.95rem, 3.5vw, 1.05rem);
  font-weight: 700;
  color: #0B1F4D;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}

.contact-institution-address {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 0.65rem;
}

.contact-institution-address i {
  color: #C9A227;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.contact-institution-meta {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.contact-institution-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.45;
}

.contact-institution-row i {
  color: #C9A227;
  width: 1rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.contact-phone-links {
  display: inline;
  word-break: break-word;
}

.contact-phone-link,
.contact-email-link {
  color: #0B1F4D;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-phone-link:hover,
.contact-email-link:hover {
  color: #C9A227;
}

/* Contact maps */
.contact-maps-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .contact-maps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem;
  }
}

.contact-map-block {
  background: #ffffff;
  border: 1px solid rgba(11, 31, 77, 0.08);
  border-radius: 1.25rem;
  padding: 1.15rem;
  box-shadow: 0 12px 32px -16px rgba(11, 31, 77, 0.12);
}

.contact-map-block-header {
  margin-bottom: 0.85rem;
}

.contact-map-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #0B1F4D;
  color: #C9A227;
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.contact-map-block-header h3 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: clamp(1.1rem, 3.5vw, 1.35rem);
  font-weight: 700;
  color: #0B1F4D;
  line-height: 1.3;
}

.contact-map-block-header p {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.25rem;
  line-height: 1.45;
}

/* ── Grid fallbacks (Tailwind backup) ── */
@media (max-width: 767px) {
  .grid.sm\:grid-cols-2:not(.hero-stats):not(.why-choose-stats) {
    grid-template-columns: 1fr !important;
  }

  .grid.md\:grid-cols-2,
  .grid.md\:grid-cols-3,
  .grid.md\:grid-cols-4 {
    grid-template-columns: 1fr !important;
  }

  .lg\:grid-cols-12 {
    grid-template-columns: 1fr !important;
  }

  .lg\:col-span-4,
  .lg\:col-span-8,
  .lg\:col-span-5,
  .lg\:col-span-7 {
    grid-column: span 1 / span 1 !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .grid.md\:grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .grid.md\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .site-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
  }

  .footer-col-contact {
    grid-column: 1 / -1;
  }
}

/* ── Typography on small screens — handled in typography.css ── */


/* ── About / premium content image ── */
@media (max-width: 767px) {
  .premium-content-img-wrap {
    overflow: hidden;
    border-radius: 1.5rem;
  }

  .premium-content-img-frame.h-96 {
    height: auto;
    min-height: 14rem;
    aspect-ratio: 4 / 3;
  }

  /* Decorative blob — clip inside parent, don't remove from DOM */
  .premium-content-img-wrap > .absolute.pointer-events-none {
    right: -1rem;
    bottom: -1rem;
    width: 5rem;
    height: 5rem;
  }
}

/* ── Samiti intro band ── */
@media (max-width: 767px) {
  .samiti-intro {
    padding: 1.25rem 1.15rem;
    border-radius: 1.15rem;
  }
}

/* ── Why choose cards — single column on very narrow phones ── */
@media (max-width: 380px) {
  .why-cards-grid {
    grid-template-columns: 1fr;
  }

  .why-card {
    padding: 1rem;
  }
}

/* ── Hero section (homepage slider) ── */
@media (max-width: 767px) {
  .hero-section {
    min-height: 460px;
    max-height: 88vh;
  }

  .hero-content {
    padding-bottom: 3.25rem;
  }

  .hero-title-accent {
    font-size: 0.9em;
    margin-top: 0.15rem;
  }

  .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }

  .hero-btn {
    flex: 1 1 calc(50% - 0.25rem);
    width: auto;
    min-width: 0;
    justify-content: center;
    text-align: center;
    padding: 0.55rem 0.65rem;
    font-size: 0.76rem;
  }

  /* Arrows at mid-height — avoids clash with pagination + FABs at bottom */
  .hero-swiper-prev,
  .hero-swiper-next {
    top: 38%;
    bottom: auto;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
    opacity: 0.9;
  }

  .hero-swiper-prev:hover,
  .hero-swiper-next:hover {
    transform: translateY(-50%) scale(1.05);
  }

  .hero-swiper-prev {
    left: 0.4rem;
  }

  .hero-swiper-next {
    right: 0.4rem;
  }

  .hero-swiper-pagination {
    bottom: 0.65rem !important;
    gap: 0.35rem;
  }

  .hero-swiper-pagination .swiper-pagination-bullet {
    width: 7px;
    height: 7px;
  }

  .hero-swiper-pagination .swiper-pagination-bullet-active {
    width: 22px;
  }

  .hero-slide-counter {
    display: none;
  }

  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    max-width: 100%;
  }

  .hero-stat {
    padding: 0.5rem 0.35rem;
  }

  .hero-stat-num {
    font-size: 1.25rem;
  }

  .hero-stat-label {
    font-size: 0.62rem;
  }

  /* Homepage hero: lift side widgets so they don't cover CTAs / slider controls */
  body:has(.hero-section) .enquiry-float-tab {
    bottom: max(5.75rem, calc(5rem + env(safe-area-inset-bottom, 0px)));
    left: max(0.65rem, env(safe-area-inset-left, 0px));
  }

  body:has(.hero-section) .floating-contact {
    bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
    right: max(0.75rem, env(safe-area-inset-right, 0px));
  }
}

@media (max-width: 360px) {
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-btn {
    font-size: 0.72rem;
    padding: 0.5rem 0.55rem;
  }
}

/* ── Institution cards ── */
@media (max-width: 767px) {
  .institution-card-img-wrap {
    padding: 0.65rem 0.65rem 0;
  }

  .institution-card-body {
    padding: 0.85rem 1rem 1rem;
  }
}

/* ── Gallery grid ── */
@media (max-width: 360px) {
  body[data-page="gallery"] .grid.grid-cols-2,
  section .grid.grid-cols-2.md\:grid-cols-3 {
    gap: 0.5rem;
  }
}

/* ── Events & testimonials cards ── */
@media (max-width: 767px) {
  .event-card-body {
    padding: 1rem;
  }

  .event-card-title {
    font-size: 1rem;
  }

  .testimonial-card {
    padding: 1.25rem 1.15rem;
  }
}

/* ── Courses tabs ── */
@media (max-width: 767px) {
  .courses-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
    max-width: 100%;
  }

  .courses-tabs::-webkit-scrollbar {
    display: none;
  }

  .courses-tabs .course-tab {
    flex-shrink: 0;
  }
}

/* ── Contact institution cards on narrow screens ── */
@media (max-width: 480px) {
  .contact-institution-card {
    padding: 0.9rem;
  }

  .contact-institution-row {
    flex-wrap: wrap;
  }

  .contact-branch-block {
    padding: 1.15rem;
  }
}

/* ── Tables ── */
@media (max-width: 767px) {
  .responsive-table-wrap {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
  }

  .responsive-table-wrap table th,
  .responsive-table-wrap table td {
    padding: 0.65rem 0.75rem;
    font-size: 0.8125rem;
  }
}

/* ── Floating Call + WhatsApp buttons ── */
.floating-contact-btn.contact-phone-link {
  color: #C9A227;
}

.floating-contact-btn--call.contact-phone-link i {
  color: #C9A227;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform: rotate(-12deg);
}

.floating-contact-btn--whatsapp.contact-phone-link {
  color: #ffffff;
}

.floating-contact-btn--whatsapp.contact-phone-link i {
  color: #ffffff;
}

/* ── Floating buttons & enquiry tab positioning ── */
@media (max-width: 767px) {
  .floating-contact {
    bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
    right: max(0.85rem, env(safe-area-inset-right, 0px));
    z-index: 90;
  }

  .enquiry-float-tab {
    top: auto;
    bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
    left: max(0.85rem, env(safe-area-inset-left, 0px));
    transform: none;
    border-radius: 9999px;
    padding: 0.6rem 0.85rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
    max-width: calc(100vw - 7rem);
    z-index: 90;
  }

  .enquiry-float-tab:hover {
    transform: translateY(-2px);
  }

  .enquiry-float-tab span {
    white-space: nowrap;
  }

  /* Hero controls sit above floating widgets */
  .hero-controls {
    z-index: 30;
  }
}

@media (max-width: 400px) {
  .enquiry-float-tab {
    padding: 0.55rem 0.7rem;
    font-size: 0.7rem;
    gap: 0.4rem;
  }

  .enquiry-float-tab span {
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ── Section padding consistency ── */
@media (max-width: 767px) {
  .section-padding {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .container.mx-auto.px-6,
  .container.mx-auto.px-4,
  section.container.mx-auto {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }
}

@media (max-width: 360px) {
  .section-padding {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}

/* ── Buttons full-width where stacked ── */
@media (max-width: 767px) {
  .flex.flex-wrap.gap-3,
  .flex.flex-wrap.gap-4 {
    flex-direction: column;
    align-items: stretch;
  }

  .flex.flex-wrap.gap-3 > a,
  .flex.flex-wrap.gap-4 > a {
    display: flex;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 100%;
  }

  .text-center.mt-10 > a {
    display: inline-flex;
    justify-content: center;
    max-width: 100%;
  }
}

/* ── College subpage content ── */
@media (max-width: 767px) {
  .section-padding .relative > img.rounded-3xl {
    height: auto;
    min-height: 14rem;
    max-height: 20rem;
  }

  .section-padding .relative {
    overflow: hidden;
    border-radius: 1.5rem;
  }

  .section-padding .relative > .absolute.pointer-events-none,
  .section-padding .relative > .absolute.blur-2xl {
    right: -0.5rem;
    bottom: -0.5rem;
    width: 4rem;
    height: 4rem;
  }
}

/* ── Message pages ── */
@media (max-width: 767px) {
  .message-page-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Announcement ticker very small screens ── */
@media (max-width: 360px) {
  .announcement-ticker-label-text {
    display: none;
  }

  .announcement-ticker-label {
    padding: 0 0.5rem;
  }
}
