/* sixm/home-instagram — ported from sections/s6m-reels.liquid <style>. */

.s6m-reels {
  padding: 40px 0 30px;
  background: #fff;
}

.s6m-reels__head {
  padding: 0 18px 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
@media (min-width: 768px) {
  .s6m-reels__head { padding: 0 48px 20px; }
}

.s6m-reels__eyebrow { color: var(--6m-muted); }

.s6m-reels__head .s6m-section-head__title { margin: 0; }

.s6m-reels__follow {
  font-family: var(--6m-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--6m-signal);
  text-decoration: none;
  font-weight: 700;
}
.s6m-reels__follow:hover { text-decoration: underline; }

.s6m-reels__slider { position: relative; }

.s6m-reels__row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding: 0 18px;
  scroll-padding-left: 18px;
  margin: 0;
  list-style: none;
}
.s6m-reels__row::-webkit-scrollbar { display: none; }
@media (min-width: 768px) {
  .s6m-reels__row { padding: 0 48px; scroll-padding-left: 48px; }
}

.s6m-reels__tile {
  flex: 0 0 auto;
  /* Uniform row height; width derives from each post's natural aspect ratio. */
  height: clamp(300px, 46vw, 420px);
  width: auto;
  aspect-ratio: 4 / 5;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  display: block;
  background: #1a1a1a;
  border-radius: 2px;
}
.s6m-reels__tile img,
.s6m-reels__tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.s6m-reels__tile:hover img { transform: scale(1.04); }

.s6m-reels__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.45));
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Play badge — live drew it on every tile whose post type was `video`
   (sections/s6m-reels.liquid), a 46px white disc centred on the tile. */
.s6m-reels__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--6m-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.2s ease;
}
.s6m-reels__play svg {
  width: 21px;
  height: 21px;
  margin-left: 2px;
}
.s6m-reels__tile:hover .s6m-reels__play { transform: translate(-50%, -50%) scale(1.08); }

.s6m-reels__caption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  font-family: var(--6m-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #fff;
  z-index: 2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Placeholder tiles — shown until an Instagram feed plugin is connected.
   Same geometry as a real tile so the section height never changes. */
.s6m-reels__tile--placeholder {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.s6m-reels__tile-icon { color: rgba(255, 255, 255, 0.35); }
.s6m-reels__tile--placeholder:hover .s6m-reels__tile-icon { color: var(--6m-signal); }

/* Third-party feed markup: let it use the rail's gutters. */
.s6m-reels__embed { padding: 0 18px; }
@media (min-width: 768px) {
  .s6m-reels__embed { padding: 0 48px; }
}

/* Arrows */
.s6m-reels__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: none;
  cursor: pointer;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  padding: 0;
}
.s6m-reels__arrow svg { width: 20px; height: 20px; }
.s6m-reels__arrow[hidden] { display: none; }
.s6m-reels__arrow--prev { left: 8px; }
.s6m-reels__arrow--next { right: 8px; }
@media (min-width: 768px) {
  .s6m-reels__arrow--prev { left: 22px; }
  .s6m-reels__arrow--next { right: 22px; }
}
.s6m-reels__slider:hover .s6m-reels__arrow { opacity: 1; }
.s6m-reels__arrow:focus-visible { opacity: 1; }
.s6m-reels__arrow:hover { background: #fff; }
@media (hover: none) {
  .s6m-reels__arrow { display: none; } /* touch -> swipe instead */
}
