/* ============================================================
   Team TararBari - Themes 2-6 Mobile Hero Buttons FIX V13.2

   Fixes ONLY these themes:
   - Command Deck
   - Galaxy Atelier
   - Cyber Matrix
   - Aurora Studio
   - Executive Blue

   Mars Motion is untouched.
   ============================================================ */

@media (max-width: 900px) {

  /* Give themes 2-6 enough Hero height so CTA never gets cut
     or covered by the following section. */
  body:is(
    .theme-command-deck,
    .theme-galaxy-atelier,
    .theme-cyber-matrix,
    .theme-aurora-studio,
    .theme-executive-blue
  ) .block-hero {
    min-height: 390px !important;
    height: auto !important;
    overflow: hidden !important;
  }

  /* Keep the editable Hero text area inside the image */
  body:is(
    .theme-command-deck,
    .theme-galaxy-atelier,
    .theme-cyber-matrix,
    .theme-aurora-studio,
    .theme-executive-blue
  ) .block-hero .hero-grid > div:first-child {
    top: 14% !important;
    left: 6% !important;
    width: 68% !important;
    max-width: 68% !important;
    padding: 12px 13px !important;
    box-sizing: border-box !important;
  }

  /* Two buttons = exactly one row */
  body:is(
    .theme-command-deck,
    .theme-galaxy-atelier,
    .theme-cyber-matrix,
    .theme-aurora-studio,
    .theme-executive-blue
  ) .block-hero .hero-grid .actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1.44fr) minmax(0, 1fr) !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    gap: 5px !important;
    margin: 13px 0 0 !important;
    padding: 0 !important;

    position: relative !important;
    z-index: 50 !important;

    align-items: stretch !important;
    justify-content: stretch !important;

    overflow: visible !important;
  }

  body:is(
    .theme-command-deck,
    .theme-galaxy-atelier,
    .theme-cyber-matrix,
    .theme-aurora-studio,
    .theme-executive-blue
  ) .block-hero .hero-grid .actions > .btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    height: 34px !important;
    min-height: 34px !important;

    margin: 0 !important;
    padding: 0 5px !important;

    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;

    font-size: clamp(6.9px, 2.25vw, 9.3px) !important;
    line-height: 1 !important;
    letter-spacing: -0.025em !important;

    overflow: hidden !important;
    text-overflow: clip !important;

    box-sizing: border-box !important;
  }

  body:is(
    .theme-command-deck,
    .theme-galaxy-atelier,
    .theme-cyber-matrix,
    .theme-aurora-studio,
    .theme-executive-blue
  ) .block-hero .hero-grid .actions > .btn:first-child {
    grid-column: 1 !important;
  }

  body:is(
    .theme-command-deck,
    .theme-galaxy-atelier,
    .theme-cyber-matrix,
    .theme-aurora-studio,
    .theme-executive-blue
  ) .block-hero .hero-grid .actions > .btn:nth-child(2) {
    grid-column: 2 !important;
  }

  /* Prevent the following Home block from moving on top of Hero CTA */
  body:is(
    .theme-command-deck,
    .theme-galaxy-atelier,
    .theme-cyber-matrix,
    .theme-aurora-studio,
    .theme-executive-blue
  ) .block-hero + section {
    margin-top: 0 !important;
  }
}

@media (max-width: 560px) {

  body:is(
    .theme-command-deck,
    .theme-galaxy-atelier,
    .theme-cyber-matrix,
    .theme-aurora-studio,
    .theme-executive-blue
  ) .block-hero {
    min-height: 330px !important;
  }

  body:is(
    .theme-command-deck,
    .theme-galaxy-atelier,
    .theme-cyber-matrix,
    .theme-aurora-studio,
    .theme-executive-blue
  ) .block-hero .hero-grid > div:first-child {
    top: 12% !important;
    left: 6% !important;
    width: 72% !important;
    max-width: 72% !important;
    padding: 10px 11px !important;
  }

  body:is(
    .theme-command-deck,
    .theme-galaxy-atelier,
    .theme-cyber-matrix,
    .theme-aurora-studio,
    .theme-executive-blue
  ) .block-hero .hero-grid .actions {
    grid-template-columns: minmax(0, 1.48fr) minmax(0, .98fr) !important;
    gap: 4px !important;
    margin-top: 10px !important;
  }

  body:is(
    .theme-command-deck,
    .theme-galaxy-atelier,
    .theme-cyber-matrix,
    .theme-aurora-studio,
    .theme-executive-blue
  ) .block-hero .hero-grid .actions > .btn {
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 3px !important;

    font-size: clamp(6.3px, 2.15vw, 8.6px) !important;
    border-radius: 5px !important;
  }
}

@media (max-width: 390px) {

  body:is(
    .theme-command-deck,
    .theme-galaxy-atelier,
    .theme-cyber-matrix,
    .theme-aurora-studio,
    .theme-executive-blue
  ) .block-hero {
    min-height: 310px !important;
  }

  body:is(
    .theme-command-deck,
    .theme-galaxy-atelier,
    .theme-cyber-matrix,
    .theme-aurora-studio,
    .theme-executive-blue
  ) .block-hero .hero-grid > div:first-child {
    width: 74% !important;
    max-width: 74% !important;
  }

  body:is(
    .theme-command-deck,
    .theme-galaxy-atelier,
    .theme-cyber-matrix,
    .theme-aurora-studio,
    .theme-executive-blue
  ) .block-hero .hero-grid .actions > .btn {
    font-size: 6.5px !important;
    padding: 0 2px !important;
  }
}
