﻿/* ================================================
   Beads of Brilliance — Bootstrap Compatibility Layer
   Fixes mobile/tablet layout using Bootstrap utilities
   Works alongside existing styles.css
   ================================================ */

/* ── Base resets to let Bootstrap breathe ── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}
body {
  overflow-x: hidden;
}

/* ── Container — responsive max-width ── */
.page-container,
.content-container,
.sim-container,
.pp-container,
.seo-container {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* ── Hero sections — stack on mobile ── */
.hero-content,
.educator-hero-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}
.hero-text {
  flex: 1 1 300px;
}
.hero-image {
  flex: 1 1 280px;
  text-align: center;
}
.hero-image img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* ── Educator hero buttons — wrap on mobile ── */
.educator-hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* ── Hero benefits — wrap on mobile ── */
.hero-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
}
.hero-benefit {
  flex: 1 1 120px;
}

/* ── Program/course grids — responsive ── */
.programs-grid,
.courses-grid,
.modules-grid,
.course-overview-grid,
.inst-grid,
.why-grid,
.curriculum-grid,
.countries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* ── Paper cards grid ── */
.papers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

/* ── Teachers grid ── */
.teachers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

/* ── Footer — stack on mobile ── */
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

/* ── Fixed buttons — safe area on mobile ── */
.fixed-feedback-button,
.fixed-trial-button,
.fixed-kit-button {
  z-index: 999;
}

/* ── Images — always responsive ── */
img {
  max-width: 100%;
  height: auto;
}

/* ── Tables — scrollable on mobile ── */
table {
  width: 100%;
  overflow-x: auto;
  display: block;
}

/* ── CTA buttons — full width on small screens ── */
@media (max-width: 480px) {
  .cta-button,
  .educator-hero-buttons a,
  .educator-hero-buttons button {
    width: 100%;
    text-align: center;
    display: block;
  }
  .educator-hero-buttons {
    flex-direction: column;
  }
}

/* ── Typography scale — adjusted for mobile readability ── */
@media (max-width: 576px) {
  h1,
  .hero-title {
    font-size: clamp(1.8rem, 7vw, 2.5rem) !important;
  }
  h2 {
    font-size: clamp(1.5rem, 5vw, 2rem) !important;
  }
  h3 {
    font-size: clamp(1.25rem, 4vw, 1.6rem) !important;
  }
  .sim-value {
    font-size: clamp(1.6rem, 6vw, 2.8rem) !important;
  }
}

/* ── Abacus simulator — full width on mobile ── */
@media (max-width: 600px) {
  .sim-value-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .sim-input-row {
    flex-wrap: wrap;
    width: 100%;
  }
  .sim-input-row input {
    width: 100%;
  }
  canvas {
    width: 100% !important;
  }
}

/* ── Practice worksheet cards — single column on mobile ── */
@media (max-width: 480px) {
  .papers-grid {
    grid-template-columns: 1fr;
  }
  .match-grid {
    grid-template-columns: 1fr;
  }
  .prob-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Level tabs — wrap on mobile ── */
.level-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
@media (max-width: 576px) {
  .level-tab {
    flex: 1 1 calc(50% - 0.5rem);
    text-align: center;
  }
}

/* ── Sub nav — scrollable on mobile ── */
.sub-nav-list {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.sub-nav-list::-webkit-scrollbar {
  display: none;
}

/* ── Breadcrumb — wrap on mobile ── */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  font-size: 0.85rem;
}
.breadcrumb-nav {
  background: #f8f9fa;
  padding: 0.4rem 1rem;
  border-bottom: 1px solid #e9ecef;
}

/* ── Testimonials / review cards ── */
.testimonials-grid,
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* ── Video grid ── */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.video-embed {
  aspect-ratio: 16/9;
  width: 100%;
}
.video-embed iframe {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}
