/*
 * MD Black MBA – Responsive Stylesheet
 *
 * Breakpoints (mobile-first where practical, max-width for overrides):
 *   --bp-xl   : 1280px   (large desktop)
 *   --bp-lg   : 1024px   (desktop / landscape tablet)
 *   --bp-md   : 768px    (tablet portrait)
 *   --bp-sm   : 480px    (large phone)
 *   --bp-xs   : 360px    (small phone)
 *
 * Strategy: desktop styles live in style.css & hero-slider.css.
 * This file ONLY contains overrides that adjust for smaller screens.
 * Specificity is kept low — selectors match exactly what's in the
 * base files so nothing needs !important except where the base does.
 */

/* ============================================================
   SHARED SPACING TOKENS (used across all sections)
   ============================================================ */
:root {
  --px-desktop : 72px;
  --px-tablet  : 40px;
  --px-mobile  : 20px;
  --py-section : var(--section-padding, 100px);
}

/* ============================================================
   LARGE DESKTOP  ≤ 1280px
   (wide containers, slight padding reduction)
   ============================================================ */
@media (max-width: 1280px) {
  .programs-grid { grid-template-columns: repeat(3, 1fr); }

  .events-card-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   DESKTOP / LANDSCAPE TABLET  ≤ 1024px
   ============================================================ */
@media (max-width: 1024px) {

  /* ── Horizontal padding ── */
  .hero-section,
  .mission-strip,
  .about-content,
  .programs-section,
  .events-section,
  .membership-banner,
  .pillars-section,
  .leadership-section,
  .partners-section,
  .events-archive,
  .site-footer { padding-left: var(--px-tablet); padding-right: var(--px-tablet); }

  /* ── Programs grid → 2 columns ── */
  .programs-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── Pillars → 2 columns ── */
  .pillars-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }

  /* ── Leadership → 2 columns ── */
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }

  /* ── Events cards → 2 columns ── */
  .events-card-grid { grid-template-columns: repeat(2, 1fr); }
  .event-card--featured { grid-template-columns: 1fr; }
  .event-card--featured .event-card-img-wrap { min-height: 280px; }

  /* ── Footer → 2×2 grid ── */
  .footer-grid--cols-4 { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-grid--cols-3 { grid-template-columns: 1fr 1fr; gap: 40px; }

  /* ── Membership banner → stack ── */
  .membership-banner { grid-template-columns: 1fr; gap: 32px; }
  .membership-actions { flex-direction: row; }

  /* ── Section headings ── */
  .programs-header h2,
  .events-archive-header h1 { font-size: 36px; }

  /* ── Hero slider arrows ── */
  .hs-arrows { left: var(--px-tablet); }
  .hs-counter { right: var(--px-tablet); }
}

/* ============================================================
   TABLET PORTRAIT  ≤ 768px
   ============================================================ */
@media (max-width: 768px) {

  /* ── Horizontal padding ── */
  .hero-section,
  .mission-strip,
  .about-content,
  .programs-section,
  .events-section,
  .membership-banner,
  .pillars-section,
  .leadership-section,
  .partners-section,
  .events-archive,
  .site-footer { padding-left: var(--px-mobile); padding-right: var(--px-mobile); }

  /* ── Vertical padding for sections ── */
  .programs-section,
  .events-section,
  .pillars-section,
  .leadership-section,
  .partners-section,
  .membership-banner { padding-top: 64px; padding-bottom: 64px; }

  .events-archive { padding-top: 100px; padding-bottom: 60px; }

  /* ── Header ── */
  .site-header { padding: 0 var(--px-mobile); }
  .logo-text .site-name { font-size: 12px; }
  .logo-text .site-chapter { display: none; }

  /* ── Hero slider ── */
  #hero-slider { min-height: 100svh; }
  .hs-slide { padding: 0 var(--px-mobile) 72px; }
  .hs-slide.is-active .hs-bg { transform: scale(1.02); } /* less Ken Burns on mobile */
  .hs-overlay {
    /* stronger overlay on mobile so text always reads */
    background:
      linear-gradient(to right, rgba(13,13,13,0.96) 0%, rgba(13,13,13,0.88) 100%),
      linear-gradient(to top, rgba(13,13,13,0.7) 0%, transparent 60%);
  }
  .hs-title { font-size: clamp(28px, 6vw, 44px); }
  .hs-default-heading { font-size: clamp(36px, 8vw, 56px); }
  .hs-excerpt { font-size: 14px; -webkit-line-clamp: 2; }
  .hs-calendar { display: none; }
  .hs-stats { display: none; }
  .hs-arrows { left: var(--px-mobile); bottom: 72px; }
  .hs-counter { right: var(--px-mobile); }
  .hs-meta { flex-direction: column; gap: 8px; }
  .hs-meta-pill { font-size: 12px; padding: 7px 14px; }
  .hs-buttons { flex-direction: column; gap: 10px; width: 100%; }
  .hs-buttons .btn-primary,
  .hs-buttons .btn-outline { text-align: center; width: 100%; padding: 14px 24px; font-size: 13px; }
  .hs-eyebrow { font-size: 10px; }
  .hs-event-badge { font-size: 10px; padding: 5px 12px; }

  /* ── Mission strip → stack ── */
  .mission-strip { flex-direction: column; align-items: flex-start; gap: 12px; padding-top: 28px; padding-bottom: 28px; }
  .mission-divider { width: 40px; height: 1px; }
  .mission-text { font-size: 15px; }

  /* ── About section → stack ── */
  .about-section { grid-template-columns: 1fr; }
  .about-visual { height: 260px; }
  .about-medallion { width: 180px; height: 180px; }
  .medallion-text { font-size: 48px; }
  .about-content { padding: 48px var(--px-mobile); }
  .about-content h2 { font-size: 28px; }
  .about-content p { font-size: 15px; }

  /* ── Programs ── */
  .programs-grid { grid-template-columns: 1fr; gap: 2px; }
  .program-card { padding: 36px 24px; }
  .programs-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .programs-header h2 { font-size: 30px; }

  /* ── Events list ── */
  .event-row { grid-template-columns: 72px 1px 1fr; gap: 16px; padding: 20px var(--px-mobile); }
  .event-badge { display: none; }
  .event-day { font-size: 28px; }
  .event-details h4 { font-size: 15px; }
  .event-details p { font-size: 12px; }

  /* ── Events archive ── */
  .events-archive-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .events-archive-header h1 { font-size: 32px; }
  .events-card-grid { grid-template-columns: 1fr; }
  .event-card--featured { grid-template-columns: 1fr; }
  .events-filter-bar { gap: 6px; }
  .events-filter-btn { font-size: 11px; padding: 7px 14px; }

  /* ── Membership banner ── */
  .membership-banner { gap: 28px; }
  .membership-banner h2 { font-size: 32px; }
  .membership-banner p { font-size: 14px; }
  .membership-actions { flex-direction: column; gap: 10px; }
  .membership-actions .btn-primary,
  .membership-actions .btn-outline { text-align: center; width: 100%; }

  /* ── Pillars ── */
  .pillars-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .pillars-section h2 { font-size: 28px; margin-bottom: 36px; }

  /* ── Leadership ── */
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .leadership-header { flex-direction: column; gap: 12px; }
  .leadership-header h2 { font-size: 28px; }

  /* ── Partners ── */
  .partners-logos { gap: 28px; }
  .partner-name { font-size: 13px; }

  /* ── Footer ── */
  .footer-grid--cols-4,
  .footer-grid--cols-3,
  .footer-grid--cols-2 { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-about { grid-column: 1 / -1; }
  .site-footer { padding: 56px var(--px-mobile) 32px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  /* ── Back to top ── */
  .mdm-back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }

  /* ── Search panel ── */
  .header-search-panel { padding: 16px var(--px-mobile); }
  .header-search-form input[type="search"] { font-size: 16px; }
}

/* ============================================================
   LARGE PHONE  ≤ 480px
   ============================================================ */
@media (max-width: 480px) {

  /* ── Hero ── */
  .hs-title { font-size: clamp(24px, 7vw, 36px); }
  .hs-default-heading { font-size: clamp(30px, 9vw, 44px); }
  .hs-dots { gap: 6px; }
  .hs-dot { width: 7px; height: 7px; }
  .hs-arrow { width: 40px; height: 40px; }
  .hs-arrow svg { width: 16px; height: 16px; }

  /* ── Programs ── */
  .program-card { padding: 28px 20px; }
  .program-number { font-size: 36px; }

  /* ── Pillars → single column ── */
  .pillars-grid { grid-template-columns: 1fr; }

  /* ── Leadership → single column ── */
  .team-grid { grid-template-columns: 1fr; }

  /* ── Events section ── */
  .events-section h2 { font-size: 26px; }

  /* ── About ── */
  .about-section { min-height: auto; }

  /* ── Footer → single column ── */
  .footer-grid--cols-4,
  .footer-grid--cols-3,
  .footer-grid--cols-2 { grid-template-columns: 1fr; }

  /* ── Buttons full-width ── */
  .hero-buttons .btn-primary,
  .hero-buttons .btn-outline { width: 100%; text-align: center; }

  /* ── Section headings ── */
  .programs-header h2,
  .pillars-section h2,
  .leadership-header h2 { font-size: 26px; }
}

/* ============================================================
   SMALL PHONE  ≤ 360px
   ============================================================ */
@media (max-width: 360px) {
  .logo-badge { width: 34px; height: 34px; font-size: 12px; }
  .logo-text .site-name { font-size: 11px; }
  .site-header { padding: 0 14px; }
  .header-cta { padding: 8px 14px; font-size: 11px; }

  .hs-slide { padding: 0 14px 64px; }
  .hs-title { font-size: 24px; }

  .about-content { padding: 36px 14px; }
  .about-content h2 { font-size: 24px; }

  .membership-banner h2 { font-size: 26px; }

  .events-section,
  .programs-section,
  .pillars-section,
  .leadership-section { padding-left: 14px; padding-right: 14px; }
}

/* ============================================================
   TOUCH DEVICE UTILITIES
   ============================================================ */
@media (hover: none) {
  /* Remove hover-dependent effects that don't work on touch */
  .program-card::before { display: none; }
  .hs-slide.is-active .hs-bg { transform: scale(1); } /* skip Ken Burns on touch */

  /* Ensure tap targets are at least 44×44px */
  .hs-arrow { width: 44px; height: 44px; }
  .hs-dot { width: 10px; height: 10px; padding: 4px; }
  .nav-toggle { width: 44px; height: 44px; }
  .header-search-toggle { width: 44px; height: 44px; }
  .footer-social-link { width: 44px; height: 44px; }

  /* Show LinkedIn icon on touch (no hover state) */
  .program-card:hover::before { transform: scaleX(0); }
}

/* ============================================================
   LANDSCAPE PHONE
   (short viewport — hero needs special treatment)
   ============================================================ */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
  #hero-slider { min-height: 100svh; }
  .hs-slide { padding: 0 var(--px-mobile) 56px; justify-content: center; }
  .hs-title { font-size: 24px; }
  .hs-excerpt { display: none; }
  .hs-meta { display: none; }
  .hs-arrows { bottom: 56px; }
  .hs-dots { bottom: 16px; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header,
  .mdm-back-to-top,
  .hs-arrows,
  .hs-dots,
  .hs-counter,
  .header-actions,
  .hero-buttons,
  .membership-actions,
  .events-filter-bar,
  #mdm-preloader { display: none !important; }

  body { padding-top: 0 !important; color: #000; background: #fff; }

  .hs-slide { position: relative; opacity: 1; pointer-events: auto; min-height: auto; padding: 40px 24px; }
  .hs-bg { display: none; }
  .hs-overlay { display: none; }
  .hs-title,
  .hs-eyebrow,
  .hs-excerpt { color: #000; }

  .about-section { display: block; }
  .about-visual { display: none; }
  .programs-grid,
  .pillars-grid,
  .team-grid { grid-template-columns: repeat(2, 1fr); }

  a { color: #000; text-decoration: underline; }
  .site-footer { background: #fff; color: #000; border-top: 1px solid #ccc; }
  .footer-col ul a { color: #000; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hs-bg { transition: none; transform: scale(1) !important; }
  .hs-slide { transition: none; }
  .program-card,
  .event-row,
  .pillar-item,
  .team-card,
  .event-card { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   HIGH CONTRAST / FORCED COLORS
   ============================================================ */
@media (forced-colors: active) {
  .logo-badge,
  .event-card-date-badge,
  .hero-event-badge { forced-color-adjust: none; }

  .btn-primary,
  .btn-outline,
  .header-cta { border: 2px solid ButtonText; }
}

/* ============================================================
   HEADER / NAV RESPONSIVE
   (These must live here because the base styles define
    the desktop state in style.css)
   ============================================================ */

/* ── Tablet and below: show hamburger, hide desktop nav ── */
@media (max-width: 768px) {
  .site-header { padding: 0 var(--px-mobile); gap: 8px; }
  .nav-toggle { display: flex; }

  .main-navigation {
    position: fixed;
    top: var(--header-height, 72px);
    left: 0; right: 0; bottom: 0;
    background: rgba(13,13,13,0.99);
    z-index: 998;
    padding: 28px var(--px-mobile);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .main-navigation.is-open { transform: translateX(0); }
  .main-navigation ul {
    flex-direction: column;
    gap: 0;
    list-style: none;
  }
  .main-navigation ul li {
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  .main-navigation ul a {
    display: block;
    padding: 18px 0;
    font-size: 20px;
    letter-spacing: 0.03em;
    color: rgba(255,255,255,0.85);
  }
  .main-navigation ul a:hover { color: var(--gold); }

  /* Hide CTA 2 on mobile — keep CTA 1 only */
  .header-cta-2 { display: none; }

  /* Shrink CTA 1 on mobile */
  .header-cta-1 { padding: 8px 16px; font-size: 11px; }
}

/* ── Small phone: only show logo badge, hide text ── */
@media (max-width: 380px) {
  .header-cta-1 { display: none; }
}
