/* =========================================================
   AIDT homepage — mobile-only rules (loaded after css/home.css).
   The desktop hero (>=980px, and the 700-979px tablet tier) is defined
   entirely in home.css and is NOT touched here. Everything below only
   takes effect at max-width:767px, plus the small always-on base rules
   needed to keep new mobile-only elements hidden above that width.
   ========================================================= */

/* ---------- Mobile utility bar: hidden by default, shown on phone ---------- */
.mobile-utility-bar {
  display: none;
}

/* Defensive, always-on icon lock: the root cause of the giant-icon bug was
   this stylesheet not being linked in index.html at all, so these inline
   SVGs (no width/height attributes) fell back to the browser's default
   replaced-element size (~300x150px). Constrained unconditionally, not just
   inside the phone media query, so a future cascade issue can't repeat it. */
.mobile-utility-bar svg,
.mobile-utility-bar__icon {
  display: block;
  width: 22px;
  height: 22px;
  min-width: 22px;
  max-width: 22px;
  min-height: 22px;
  max-height: 22px;
  flex: 0 0 22px;
}

/* ---------- New mobile-only hero text: hidden by default, shown on phone ---------- */
.hero-eyebrow-mobile,
.hero-intro-mobile,
.hero-actions-mobile {
  display: none;
}

@media (max-width: 767px) {
  body {
    overflow-x: hidden;
  }

  /* ---------- Utility bar ---------- */
  .mobile-utility-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: var(--header-height);
    background: var(--navy-deep);
    border-bottom: 1px solid rgba(229, 199, 119, 0.22);
  }

  .mobile-utility-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 58px;
    padding: 0 10px;
    color: var(--white);
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.01em;
  }

  .mobile-utility-bar a:first-child {
    border-right: 1px solid rgba(255, 255, 255, 0.14);
  }

  .mobile-utility-bar a:active {
    background: rgba(255, 255, 255, 0.06);
  }

  .mobile-utility-bar svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--gold-light);
  }

  .mobile-utility-bar a:last-child svg {
    color: var(--red);
  }

  /* ---------- Hero: clean, premium, image-led mobile presentation ----------
     The dedicated portrait asset preserves the building, entrance, and AIDT
     identity without forcing a desktop-image crop on phone screens. */
  .hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-top: 0;
    min-height: 620px;
    min-height: min(620px, 78svh);
    background:
      linear-gradient(180deg, rgba(4, 14, 34, 0.32) 0%, rgba(4, 14, 34, 0.2) 26%, rgba(2, 8, 18, 0.58) 56%, rgba(2, 8, 18, 0.93) 84%, rgba(2, 8, 18, 0.97) 100%),
      radial-gradient(120% 60% at 72% 12%, rgba(229, 199, 119, 0.12), transparent 60%),
      url("../assets/images/aidt-campus-hero-phone.png");
    background-size: cover, cover, cover;
        background-position: center, center, center 48%;
    background-repeat: no-repeat, no-repeat, no-repeat;
  }

  .hero::before {
    display: none;
  }

  .hero-grid {
    width: 100%;
    padding-inline: 20px;
    padding-top: 0;
    padding-bottom: 40px;
  }

  .hero-grid::before {
    display: none;
  }

  .hero-visual,
  .trust-strip,
  .hero-tagline {
    display: none;
  }

  .hero-copy {
    max-width: 340px;
  }

  .hero-copy > .eyebrow {
    display: none;
  }

  .hero-intro {
    display: none;
  }

  .hero-copy > .hero-actions {
    display: none;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(2.6rem, 10vw, 3.25rem);
    line-height: 0.98;
    text-wrap: balance;
  }

  .hero-eyebrow-mobile {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 0;
    color: var(--gold-light);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .hero-eyebrow-mobile::before {
    content: "";
    width: 22px;
    height: 2px;
    background: linear-gradient(90deg, var(--red), var(--gold));
  }

  .hero-intro-mobile {
    display: block;
    max-width: 32ch;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1rem;
    line-height: 1.5;
  }

  .hero-actions-mobile {
    display: flex;
    margin-top: 22px;
  }

  .hero-actions-mobile .btn {
    width: 100%;
    min-height: 52px;
    border-radius: var(--radius-sm);
    box-shadow: none;
  }

  .hero-actions-mobile .btn-primary {
    background: var(--red);
    border-color: rgba(229, 199, 119, 0.35);
  }

  .hero-actions-mobile .btn:hover,
  .hero-actions-mobile .btn:active {
    transform: none;
  }

  /* ---------- AIDT for You: edge-to-edge stacked image bands, UCR-inspired.
     .container is width-constrained (not padded), so the grid breaks out
     to the full viewport width using the standard negative-margin
     technique: no cream margins, no rounded cards, one continuous strip. */
  .audience-mosaic {
    overflow-x: hidden;
  }

  .mosaic-grid {
    grid-template-columns: 1fr;
    gap: 2px;
    width: calc(100% + 40px);
    margin-left: -20px;
  }

  .mosaic-tile {
    grid-column: auto !important;
    min-height: 250px;
    border-radius: 0;
  }

  .mosaic-tile:nth-child(even) .mosaic-tile-overlay {
    background: linear-gradient(190deg, rgba(7, 20, 41, 0.1) 0%, rgba(7, 20, 41, 0.6) 54%, rgba(2, 8, 18, 0.92) 100%);
  }

  .mosaic-tile:nth-child(odd) .mosaic-tile-overlay {
    background: linear-gradient(190deg, rgba(2, 8, 18, 0.1) 0%, rgba(38, 12, 22, 0.56) 54%, rgba(2, 8, 18, 0.92) 100%);
  }

  .mosaic-tile-content {
    padding: 16px 20px 18px;
  }

  .mosaic-tile-title {
    font-size: 1.1rem;
  }

  .mosaic-tile-desc {
    display: none;
  }

  .mosaic-tile-arrow {
    margin-top: -16px;
  }

  /* ---------- Course Portfolio gateway: one full image panel ---------- */
  .course-gateway {
    min-height: 400px;
  }

  .course-gateway-media {
    background-position: 78% 50%;
  }

  .course-gateway-overlay {
    background:
      linear-gradient(200deg, rgba(2, 8, 18, 0.2) 0%, rgba(2, 8, 18, 0.72) 55%, rgba(2, 8, 18, 0.95) 100%),
      linear-gradient(90deg, rgba(2, 8, 18, 0.5) 0%, rgba(2, 8, 18, 0.15) 100%);
  }

  .course-gateway-copy {
    max-width: none;
    padding-block: 32px 34px;
  }

  .course-gateway-copy h2 {
    max-width: none;
    font-size: clamp(1.55rem, 6.4vw, 1.95rem);
  }

  .course-gateway-copy .btn {
    width: 100%;
  }

  /* ---------- Islamic Studies gateway: one full image panel ---------- */
  .islamic-gateway {
    min-height: 440px;
  }

  .islamic-gateway-media img {
    object-fit: cover;
    object-position: center center;
  }

  .islamic-gateway-overlay {
    background:
      linear-gradient(200deg, rgba(2, 20, 16, 0.2) 0%, rgba(2, 20, 16, 0.74) 55%, rgba(2, 20, 16, 0.96) 100%),
      linear-gradient(90deg, rgba(2, 20, 16, 0.5) 0%, rgba(2, 20, 16, 0.15) 100%);
  }

  .islamic-gateway-copy {
    max-width: none;
    padding-block: 30px 34px;
  }

  .islamic-gateway-copy h2 {
    max-width: none;
    font-size: clamp(1.5rem, 6.4vw, 1.85rem);
  }

  .islamic-gateway-btn {
    width: 100%;
  }

  /* ---------- China Business School gateway: one full image panel ---------- */
  .china-gateway {
    min-height: 460px;
  }

  .china-gateway-media {
    background-image: url("../assets/images/china-business-school-hero-mobile.jpg");
    background-size: cover;
    background-position: 62% center;
  }

  .china-gateway-overlay {
    background:
      linear-gradient(200deg, rgba(2, 8, 18, 0.16) 0%, rgba(2, 8, 18, 0.62) 48%, rgba(2, 8, 18, 0.96) 100%),
      linear-gradient(90deg, rgba(2, 8, 18, 0.82) 0%, rgba(2, 8, 18, 0.3) 66%, rgba(2, 8, 18, 0.08) 100%);
  }

  .china-gateway-copy {
    max-width: none;
    padding-block: 30px 34px;
  }

  .china-gateway-copy h2 {
    max-width: none;
    font-size: clamp(1.55rem, 6.4vw, 1.95rem);
  }

  .china-gateway-copy .btn {
    width: 100%;
  }

  /* ---------- Contact CTA ---------- */
  .home-contact-cta-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding-block: 36px;
  }

  .home-contact-cta-action {
    width: 100%;
    align-items: stretch;
    gap: 12px;
    padding-left: 0;
    border-left: 0;
    text-align: left;
  }

  .home-contact-cta-action .btn {
    width: 100%;
    min-height: 52px;
  }

  .home-contact-cta-email {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .mosaic-tile {
    min-height: 230px;
  }

  .mobile-utility-bar a {
    font-size: 0.8rem;
    padding: 0 6px;
  }
}
