/* 
  =============================================================================
  FTH Skills - Master Mobile & Tablet Responsive Engine (2026 Tier-1 Edition)
  Engineered for ultra-smooth responsiveness, fluid typography, touch ergonomics,
  glassmorphism bottom action dock, and native-app aesthetic across all devices.
  =============================================================================
*/

/* --- 1. GLOBAL MOBILE SAFETY & OVERFLOW PREVENTION --- */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
}

*, *::before, *::after {
  box-sizing: border-box;
}

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

/* Touch-friendly inputs: 16px prevents iOS Safari from automatically zooming on focus */
input, select, textarea, button {
  font-size: 16px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Visibility Switches for Desktop vs Mobile Flow */
.desktop-only-content {
  display: block;
}

div.desktop-only-content.hero-seals-grid {
  display: grid;
}

.mobile-only-content {
  display: none !important;
}

/* Base Campus Grid Default Desktop */
.campus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

/* --- 2. TABLET & SMALL DESKTOP (<= 1024px) --- */
@media (max-width: 1024px) {
  .container {
    padding: 0 1.25rem;
  }

  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem;
  }

  .ceo-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem;
  }

  .what-we-offer-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem;
  }

  .seals-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .stat-item:not(:last-child)::after {
    display: none;
  }

  .collab-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1rem;
  }

  .campus-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  .courses-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }

  .affiliate-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }
}

/* --- 3. MOBILE LANDSCAPE & TABLETS (<= 992px) --- */
@media (max-width: 992px) {
  .main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: 0 4px 20px rgba(11, 19, 43, 0.08);
  }

  .nav-container {
    height: auto !important;
    padding: 0.65rem 1rem !important;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: space-between;
    align-items: center;
  }

  .nav-logo {
    margin-right: 0 !important;
  }

  .nav-logo img {
    height: 52px !important;
    width: auto;
  }

  .nav-actions {
    display: flex;
    gap: 0.5rem;
  }

  .nav-actions .btn {
    font-size: 0.8rem !important;
    padding: 0.45rem 0.85rem !important;
    border-radius: 8px !important;
  }

  /* Edge-to-edge horizontal pill scroll navigation */
  .nav-menu {
    display: flex;
    overflow-x: auto;
    width: calc(100% + 2rem);
    margin: 0 -1rem;
    padding: 0.45rem 1rem 0.55rem 1rem;
    gap: 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
  }

  .nav-menu::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .nav-link {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    white-space: nowrap;
    padding: 0.4rem 0.9rem !important;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 99px !important;
    flex-shrink: 0;
    color: #1E293B !important;
    transition: all 0.2s ease;
  }

  .nav-link:hover, .nav-link:active {
    background: #0066FF;
    color: #FFFFFF !important;
    border-color: #0066FF;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
  }

  .nav-link::after {
    display: none !important;
  }

  .hero-section {
    padding: 2.2rem 0 3.2rem 0 !important;
  }

  .hero-left-col h1 {
    font-size: clamp(1.85rem, 5.5vw, 2.4rem) !important;
    line-height: 1.2 !important;
    letter-spacing: -0.6px !important;
    margin-bottom: 1rem !important;
  }

  .hero-left-col p {
    font-size: 0.98rem !important;
    line-height: 1.65 !important;
    margin-bottom: 1.8rem !important;
  }

  /* Switch Visibility for Mobile View */
  .desktop-only-content {
    display: none !important;
  }

  .mobile-only-content {
    display: block !important;
  }

  div.mobile-only-content.hero-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
    padding-top: 1.2rem !important;
    border-top: 1px solid rgba(226, 232, 240, 0.8) !important;
    margin-bottom: 0.5rem !important;
  }

  .seals-overlap-bar {
    margin-top: 0 !important;
    padding: 1.2rem 1rem !important;
    margin-bottom: 1.5rem !important;
  }

  .seals-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .enablers-hero-card {
    min-height: 340px !important;
    border-radius: 20px !important;
  }

  .enablers-card-content {
    padding: 2rem 1.6rem 1.6rem 1.6rem !important;
  }

  .enablers-card-title-super {
    font-size: 0.95rem !important;
  }

  .enablers-card-title-main {
    font-size: 1.6rem !important;
    margin-bottom: 1.5rem !important;
  }
}

/* --- 4. PHONES & PHABLETS (<= 768px) --- */
@media (max-width: 768px) {
  /* Floating Action Buttons */
  .floating-actions {
    display: flex !important;
    right: 14px !important;
    bottom: 14px !important;
    gap: 0.6rem !important;
    z-index: 990;
  }

  .float-btn {
    width: 48px !important;
    height: 48px !important;
  }

  .float-btn svg {
    width: 24px !important;
    height: 24px !important;
  }

  .top-bar {
    padding: 0.45rem 0.8rem !important;
  }

  .top-bar-flex {
    justify-content: center !important;
    text-align: center;
  }

  .top-bar-contacts {
    font-size: 0.82rem !important;
    justify-content: center;
  }

  .section-padding {
    padding: 2.8rem 0 !important;
  }

  .section-header {
    margin-bottom: 2.2rem !important;
  }

  .section-header h2 {
    font-size: clamp(1.5rem, 4.8vw, 1.95rem) !important;
    line-height: 1.25 !important;
  }

  .section-header p {
    font-size: 0.925rem !important;
    line-height: 1.6 !important;
  }

  /* Collaborations 2-column grid */
  .collab-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .collab-card {
    padding: 1.1rem 0.75rem !important;
    border-radius: 12px !important;
  }

  .collab-card img {
    height: 48px !important;
  }

  .collab-card h4 {
    font-size: 0.8rem !important;
  }

  .collab-role {
    font-size: 0.68rem !important;
    padding: 0.15rem 0.4rem !important;
  }

  /* Single Column Cards */
  .courses-grid, 
  .services-grid, 
  .affiliate-grid {
    grid-template-columns: 1fr !important;
    gap: 1.4rem !important;
  }

  /* Course Category Tabs Horizontal Scroll */
  #courseCategoryTabs {
    display: flex !important;
    overflow-x: auto !important;
    width: calc(100% + 2rem) !important;
    margin: 1.4rem -1rem 0 -1rem !important;
    padding: 0.2rem 1rem 0.6rem 1rem !important;
    gap: 0.5rem !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    justify-content: flex-start !important;
  }

  #courseCategoryTabs::-webkit-scrollbar {
    display: none !important;
  }

  .course-tab-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 0.8rem !important;
    padding: 0.45rem 0.9rem !important;
    border-radius: 99px !important;
  }

  /* Course Card Mobile Polish */
  .course-card {
    border-radius: 16px !important;
  }

  .course-card-top {
    padding: 1.5rem 1.25rem 1.2rem 1.25rem !important;
  }

  .course-title-text {
    font-size: 1.3rem !important;
  }

  .course-subtitle-text {
    font-size: 0.85rem !important;
  }

  .course-card-body {
    padding: 1.25rem !important;
  }

  .course-metrics-strip {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.65rem 0.8rem;
  }

  .metric-pill {
    font-size: 0.75rem !important;
  }

  /* Services Card Mobile Polish */
  .service-card {
    padding: 1.6rem 1.3rem !important;
    border-radius: 16px !important;
  }

  .service-title {
    font-size: 1.22rem !important;
  }

  .service-desc {
    font-size: 0.875rem !important;
  }

  /* Affiliate / Partnership Benefit Cards */
  .affiliate-benefit-card {
    padding: 1.5rem 1.25rem !important;
    border-radius: 16px !important;
  }

  /* CEO Section Mobile */
  .ceo-mission-section {
    padding: 2.8rem 0 !important;
  }

  .ceo-image-wrapper {
    max-height: 380px !important;
    border-radius: 18px !important;
  }

  .ceo-quote-box {
    padding: 1.2rem 1rem !important;
    border-radius: 12px !important;
    margin: 1.2rem 0 !important;
  }

  .ceo-quote-text {
    font-size: 0.95rem !important;
  }

  .ceo-bio-text {
    font-size: 0.925rem !important;
    line-height: 1.65 !important;
  }

  .ceo-stats-pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
    margin-top: 1.5rem !important;
  }

  .ceo-pillar-item {
    padding: 0.75rem 0.4rem !important;
    border-radius: 10px !important;
  }

  .ceo-pillar-val {
    font-size: 1.2rem !important;
  }

  .ceo-pillar-lbl {
    font-size: 0.65rem !important;
  }

  /* Campus Location & Demo Class Box */
  .campus-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* Footer Mobile */
  .site-footer {
    padding: 3.5rem 0 1.5rem 0 !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
    font-size: 0.825rem !important;
  }

  /* Modals Mobile Ergonomics */
  .modal-overlay {
    padding: 0.75rem !important;
    align-items: flex-end !important;
  }

  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88vh !important;
    border-radius: 20px 20px 14px 14px !important;
    margin: 0 !important;
    overflow-y: auto !important;
  }

  .modal-header {
    padding: 1.1rem 1.2rem !important;
  }

  .modal-header h3 {
    font-size: 1.15rem !important;
  }

  .modal-body {
    padding: 1.2rem 1rem !important;
  }

  .form-box-card {
    padding: 1.1rem 0.9rem !important;
    margin-bottom: 1.1rem !important;
    border-radius: 14px !important;
  }

  .form-box-header h4 {
    font-size: 1.02rem !important;
  }

  .form-grid-2col {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .form-group {
    margin-bottom: 0.85rem !important;
  }

  .form-group label {
    font-size: 0.82rem !important;
  }

  .form-control {
    font-size: 16px !important;
    padding: 0.75rem 0.9rem !important;
    border-radius: 8px !important;
  }
}

/* --- 5. ULTRA-COMPACT SMARTPHONES (<= 480px) --- */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .hero-left-col h1 {
    font-size: 1.75rem !important;
    line-height: 1.22 !important;
    letter-spacing: -0.4px !important;
  }

  .hero-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.55rem !important;
  }

  .stat-card {
    padding: 0.75rem 0.6rem !important;
    border-radius: 10px !important;
  }

  .stat-card-number {
    font-size: 1.4rem !important;
  }

  .stat-card-label {
    font-size: 0.65rem !important;
  }

  .seals-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.55rem !important;
  }

  .seal-item {
    padding: 0.65rem 0.5rem !important;
    border-radius: 10px !important;
  }

  .seal-icon-circle {
    width: 26px !important;
    height: 26px !important;
  }

  .seal-icon-circle svg {
    width: 13px !important;
    height: 13px !important;
  }

  .seal-main-title {
    font-size: 0.64rem !important;
  }

  .seal-sub-title {
    font-size: 0.54rem !important;
  }

  .seal-year-pill {
    font-size: 0.52rem !important;
    padding: 0.1rem 0.35rem !important;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.85rem !important;
  }

  .stat-number {
    font-size: 1.85rem !important;
  }

  .stat-label {
    font-size: 0.75rem !important;
  }

  .btn {
    padding: 0.75rem 1.4rem !important;
    font-size: 0.92rem !important;
  }

  .nav-logo img {
    height: 44px !important;
  }

  .nav-actions .btn {
    font-size: 0.74rem !important;
    padding: 0.4rem 0.7rem !important;
  }

  .course-tab-btn {
    font-size: 0.75rem !important;
    padding: 0.4rem 0.75rem !important;
  }
}
