/* AL RYUM — phone layout (screens under 768px; desktop is untouched).
   On a phone the desktop rows stacked into one tall block after another, so these turn
   them into swipeable rows: the Global Reach country cards and the projects showcase.
   What we do becomes a compact grid so every card is seen whole. The next card peeks in from the right so the swipe is obvious. Works in both
   the light and the dark theme. Scroll lengths for the hero, the 3D field and the films
   are shortened in their scripts (al-ryum-hero.js, al-ryum-cinema.js,
   al-ryum-project-films.js). */
@media (max-width: 767px) {
  /* shared: a horizontal row that snaps card by card */
  .country-cards,
  .ar-showcase__grid {
    display: flex !important;
    gap: 14px !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 24px;
    padding-inline: 24px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .country-cards::-webkit-scrollbar,
  .ar-showcase__grid::-webkit-scrollbar { display: none; }

  /* Global Reach: the country cards side by side */
  .country-cards {
    margin-inline: -24px;
    background: none !important;
    border: 0 !important;
  }
  .country-card {
    flex: 0 0 84%;
    scroll-snap-align: start;
    border: 1px solid rgba(236, 255, 252, .16);
  }
  .country-card:last-child { width: auto; }
  .country-card { min-height: 0; padding: 1.4rem 1.3rem; }
  .country-card h3 { margin: 1rem 0 .7rem; font-size: 2rem; }
  .country-card p { font-size: .92rem; line-height: 1.55; }
  .country-card small { margin-top: 1.1rem; }
  /* "Operating across the GCC." ran past the right edge; let it wrap */
  .intro-panel h1, .intro-title { white-space: normal !important; max-width: 100% !important; }


  /* Projects showcase: each group is one swipeable row of shorter cards */
  .ar-showcase__grid {
    margin-inline: -24px;
    padding-bottom: 6px;
  }
  .ar-showcase__grid .ar-showcase-card {
    flex: 0 0 84%;
    width: auto;
    scroll-snap-align: start;
    grid-template-rows: auto 11rem;
  }
  .ar-showcase-card__desc { -webkit-line-clamp: 3; }
}

/* Very narrow phones (e.g. a Galaxy Fold cover screen, ~344px): tighten the header so the
   theme switch no longer sits on the wordmark. */
@media (max-width: 380px) {
  header nav { padding-left: 18px !important; padding-right: 18px !important; }
  header nav > div > a.flex-shrink-0 { padding-right: 0 !important; }
  header nav a span[style*="font-weight: 700"],
  header nav a span.text-2xl,
  header nav a span.text-3xl { font-size: 15px !important; }
  .ar-theme-toggle { right: 66px !important; }
}
@media (max-width: 340px) {
  header nav a span[style*="font-weight: 700"],
  header nav a span.text-2xl,
  header nav a span.text-3xl { font-size: 13.5px !important; }
}

/* What we do, phones and tablets: a swipe row only ever showed one card and a sliver of the
   next, and from 768px the desktop strip squeezed seven columns until the titles broke
   mid-word. Below 1024px the seven cards sit in a compact grid instead, all fully visible:
   two across on phones, three across on tablets and the Galaxy Fold's inner screen. */
@media (max-width: 1023.98px) {
  #solutions .hidden.md\:flex.h-\[560px\] { display: none !important; }
  #solutions .md\:hidden.space-y-6 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-inline: 20px !important;
  }
  #solutions .md\:hidden.space-y-6 > * {
    height: auto !important;
    min-height: 212px;
    margin: 0 !important;
    border-radius: 22px !important;
  }
  #solutions .md\:hidden.space-y-6 > :last-child { grid-column: 1 / -1; min-height: 168px; }
  #solutions .md\:hidden.space-y-6 > * > .relative.h-full { padding: 16px 15px 18px; }
  #solutions .md\:hidden.space-y-6 .mb-6 { margin-bottom: 12px; }
  #solutions .md\:hidden.space-y-6 .mb-6 svg { width: 26px; height: 26px; }
  #solutions .md\:hidden.space-y-6 h3 {
    font-size: 16px !important;
    line-height: 1.25 !important;
    max-width: none !important;
    margin-bottom: 6px;
  }
  #solutions .md\:hidden.space-y-6 p {
    font-size: 12px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }
  #solutions .md\:hidden.space-y-6 .mt-auto { font-size: 12.5px; padding-top: 10px; }
}
@media (min-width: 768px) and (max-width: 1023.98px) {
  #solutions .md\:hidden.space-y-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding-inline: 32px !important;
  }
  #solutions .md\:hidden.space-y-6 > * { min-height: 250px; }
  #solutions .md\:hidden.space-y-6 > :last-child { min-height: 190px; }
  #solutions .md\:hidden.space-y-6 > * > .relative.h-full { padding: 22px 20px 22px; }
  #solutions .md\:hidden.space-y-6 h3 { font-size: 19px !important; }
  #solutions .md\:hidden.space-y-6 p { font-size: 13px; }
}
