/* ==================================================
   RESPONSIVE DESIGN SYSTEM
   Mobile-First Responsive Architecture
================================================== */

/* ==================================================
   FOUNDATION
   Global Responsive Rules
================================================== */

/* Prevent horizontal overflow caused by pseudo-elements or media */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

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

/* ==================================================
   BREAKPOINT · DESKTOP TO TABLET
   Laptops & Landscape Tablets
   ≤ 1100px
================================================== */
@media (max-width: 1100px) {
  .container {
    width: min(100% - 40px, var(--container));
  }

  .header-content {
    gap: 24px;
  }

  .nav {
    gap: 22px;
  }

  .hero-grid,
  .about-grid,
  .team-profile,
  .course-product {
    grid-template-columns: 1fr;
  }

  .hero-grid,
  .about-grid {
    gap: 52px;
  }

  .hero-content,
  .about-content {
    max-width: 760px;
  }

  .hero-image,
  .about-image,
  .team-photo {
    width: 100%;
    max-width: 680px;
    margin-inline: auto;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid,
  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==================================================
   BREAKPOINT · TABLET
   Mobile Navigation & Layout Adaptation
   ≤ 900px
================================================== */
@media (max-width: 900px) {
  .header-content {
    height: 76px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    line-height: 1;
  }

  .header .btn-primary {
    display: none;
  }

  .nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 18px 24px 22px;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav.active {
    display: flex;
  }

  .nav a {
    width: 100%;
    padding: 12px 0;
    font-size: 0.95rem;
  }

  .hero {
    padding: 72px 0 64px;
  }

  .section {
    padding: 84px 0;
  }

  .hero-image img,
  .about-image img {
    height: 520px;
  }

  .team-photo {
    height: 430px;
  }

  .footer-content,
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 38px;
  }
}

/* ==================================================
   BREAKPOINT · MOBILE LARGE
   Enhanced Mobile Experience
   ≤ 768px
================================================== */
@media (max-width: 768px) {
  body {
    font-size: 17px;
    line-height: 1.65;
  }

  .container {
    width: min(100% - 32px, var(--container));
  }

  .section {
    padding: 72px 0;
  }

  .section-heading {
    margin-bottom: 42px;
    text-align: left;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2.8rem, 13vw, 4.15rem);
    line-height: 1.03;
  }

  h2 {
    font-size: clamp(2.25rem, 10vw, 3.25rem);
    line-height: 1.04;
  }

  h3 {
    font-size: 1.35rem;
  }

  .hero-content p,
  .about-content p,
  .team-info p {
    font-size: 1.02rem;
    line-height: 1.55;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .hero-actions .btn,
  .btn {
    width: 100%;
    min-height: 56px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 38px;
    padding-top: 28px;
    text-align: left;
  }

  .stat-item strong {
    font-size: 1.85rem;
  }

  .cards-grid,
  .credentials-grid,
  .course-details {
    grid-template-columns: 1fr;
  }

  .credential-card,
  .service-card,
  .step-card {
    padding: 26px;
  }

  .team-tabs {
    gap: 28px;
    margin-bottom: 36px;
  }

  .expertise-tags {
    gap: 8px;
  }

  .expertise-tags span {
    font-size: 0.62rem;
    padding: 8px 12px;
  }
}

/* ==================================================
   BREAKPOINT · MOBILE
   Core Mobile Layout Adjustments
   ≤ 560px
================================================== */
@media (max-width: 560px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .header-content {
    height: 72px;
  }

  .nav {
    top: 72px;
  }

  .brand {
    gap: 10px;
    font-size: 1.05rem;
  }

  .brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .hero {
    padding: 58px 0 60px;
  }

  .hero-grid,
  .about-grid,
  .team-profile {
    gap: 40px;
  }

  .tag {
    max-width: 100%;
    font-size: 0.62rem;
    letter-spacing: 0.15em;
    padding: 7px 14px;
  }

  .hero-content .tag,
  .about-content .tag {
    margin-bottom: 22px;
  }

  .hero-content h1 {
    margin-bottom: 24px;
  }

  /* Hero Content */
  .hero-content p {
    margin-bottom: 30px;
  }

  /* Responsive Image Containers */
  .hero-image,
  .about-image {
    max-width: 100%;
  }

  /* Responsive Image Elements */
  .hero-image img,
  .about-image img {
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 22px;
  }

  /* Hero Image Decorative Element */
  .hero-image::after {
    width: 86px;
    height: 86px;
    right: -8px;
    bottom: -8px;
  }

  /* About Image Decorative Element */
  .about-image::after {
    left: -10px;
    bottom: -10px;
  }

  /* Team Photo Component */
  .team-photo {
    max-width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    padding: 12px;
  }

  /* Credential Card Typography */
  .credential-card h4 {
    font-size: 1.05rem;
  }

  /* Call-To-Action Section */
  .cta-section {
    padding: 70px 0;
  }

  /* Footer Layout */
  .footer {
    padding: 58px 0 28px;
  }
}

/* ==================================================
   BREAKPOINT · MOBILE COMPACT
   Small Screen Optimizations
   ≤ 390px
================================================== */
@media (max-width: 390px) {
  .container {
    width: min(100% - 24px, var(--container));
  }

  /* Brand Text Overflow Handling */
  .brand span:last-child {
    max-width: 190px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Compact Heading Scale */
  h1 {
    font-size: 2.65rem;
  }

  h2 {
    font-size: 2.15rem;
  }

  /* Compact Button Adjustments */
  .btn {
    padding-inline: 18px;
    font-size: 0.88rem;
  }

  /* Compact Card Spacing */
  .credential-card,
  .service-card,
  .step-card {
    padding: 22px;
  }

  /* Compact Tag Readability */
  .tag {
    letter-spacing: 0.12em;
  }
}