/* Section 6: "Start with a tutorial" media cards
   Mobile + tablet: horizontal scrolling with screen-edge spacing (same
   behaviour as Section 2's feature-grid and Section 5's learning paths).
   Laptop + desktop: static 3-column grid, no scrolling.

   Scoped to `#home-tutorials-grid` (unique id already on this grid) so it
   only affects this section and does not touch `.grid-3` usage elsewhere
   on the site.
*/

@media (max-width: 1199px) {
  #home-tutorials-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    width: auto;
    max-width: none;
    margin-inline: -1rem;
    padding: 4px 24px 18px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 24px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--yellow) #10202b;
  }

  #home-tutorials-grid::-webkit-scrollbar { height: 7px; }
  #home-tutorials-grid::-webkit-scrollbar-track { background: #10202b; border-radius: 20px; }
  #home-tutorials-grid::-webkit-scrollbar-thumb { background: var(--yellow); border-radius: 20px; }

  #home-tutorials-grid > .card {
    flex: 0 0 clamp(280px, 42vw, 400px);
    width: clamp(280px, 42vw, 400px);
    max-width: none;
    min-width: 0;
    scroll-snap-align: start;
  }
}

/* Phones: slightly smaller but still clearly visible edge gap */
@media (max-width: 600px) {
  #home-tutorials-grid {
    gap: 12px;
    padding-right: 20px;
    padding-left: 20px;
    scroll-padding-inline: 20px;
  }

  #home-tutorials-grid > .card {
    flex-basis: 86vw;
    width: 86vw;
  }
}

/* Desktop: no horizontal scrolling, back to a normal grid */
@media (min-width: 1200px) {
  #home-tutorials-grid {
    overflow-x: hidden;
    overflow-y: hidden;
  }
}
