/* ----------------------------------------------
   Section rhythm + headings (override Material)
   ---------------------------------------------- */

/* Tight rhythm between sections */
.ssr-section{
  /* collapsed gap between sections will be this value */
  margin: clamp(.75rem, 1.4vw, 1rem) 0;
}

/* Material defines `.md-typeset h2{ margin-top:… }`.
   Override it explicitly for our section titles. */
.md-typeset .ssr-section-title{
  margin: 0 0 .45rem !important;  /* kill top margin, keep a tight bottom */
  font-weight: 700;
  letter-spacing: .01em;
}

/* ----------------------------------------------
   Themed panel behind the carousel track
   ---------------------------------------------- */
:root{
  --ssr-panel-bg: rgba(0,0,0,.03);
  --ssr-panel-border: rgba(0,0,0,.06);
}
[data-md-color-scheme="slate"]{
  --ssr-panel-bg: rgba(255,255,255,.04);
  --ssr-panel-border: rgba(255,255,255,.08);
}
.ssr-panel{
  /* trim vertical padding to reduce perceived gap to next title */
  padding: 6px 6px 8px;
  border-radius: 12px;
  background: var(--ssr-panel-bg);
  border: 1px solid var(--ssr-panel-border);
  box-shadow: var(--md-shadow-z1);
}

/* ----------------------------------------------
   Carousel track + cards
   ---------------------------------------------- */

.ssr-carousel{
  display: flex;
  gap: 12px;
  overflow-x: auto;
  /* tighter internal padding; bottom especially */
  padding: 2px 2px 6px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;

  /* edge fade hint */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
}

.ssr-card{
  flex: 0 0 clamp(200px, 26vw, 280px);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  border-radius: 10px;
  overflow: hidden;
  background: var(--md-default-bg-color);
  box-shadow: var(--md-shadow-z1);
  scroll-snap-align: start;
  transition: transform .18s ease, box-shadow .18s ease;
}
.ssr-card:focus-visible{ outline: 2px solid var(--md-accent-fg-color); outline-offset: 2px; }
.ssr-card:hover{ transform: translateY(-2px); box-shadow: var(--md-shadow-z2); }

.ssr-card img{
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform .25s ease;
}
.ssr-card:hover img{ transform: scale(1.02); }

.ssr-card .caption{
  padding: 10px 12px;
  font-weight: 600;
  color: var(--md-typeset-color);
}

/* Optional: make consecutive sections even tighter if needed */
/* .ssr-section + .ssr-section{ margin-top: .65rem; } */

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .ssr-card, .ssr-card img{ transition: none; }
}
