/* all things good — Instagram reel cards (tap-to-load). Cards are arched jharokha windows. */

.reels { margin-top: 96px; }
.reels .reels-foot {
  text-align: center;
  margin-top: 34px;
  color: var(--ink-muted);
  font-size: 0.9rem;
}
.reels .reels-foot a { color: var(--rose-deep); font-weight: 700; text-decoration: none; }
.reels .reels-foot a:hover { text-decoration: underline; }

.reel-grid {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 34px 26px;
  margin-top: 40px;
}
.reel-item { width: 208px; }

.reel-card {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  cursor: pointer;
  text-align: center;
  transition: transform 0.4s var(--ease);
}
.reel-card:hover { transform: translateY(-6px); }
.reel-card:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 6px; border-radius: 22px; }

/* the arched window */
.reel-art {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  aspect-ratio: 9 / 16;
  border-radius: 999px 999px 14px 14px;
  border: 2px solid var(--gold);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.4s var(--ease);
}
.reel-card:hover .reel-art { box-shadow: var(--shadow-hover); }
/* moti-dot ring just inside the border */
.reel-art::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 999px 999px 8px 8px;
  border: 1.5px dotted rgba(185, 143, 83, 0.85);
  pointer-events: none;
}
.reel-art img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* a real thumbnail: gentle vignette so the play button reads on any frame */
.reel-art.has-cover::before {
  content: '';
  position: absolute; inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(74, 50, 44, 0.10) 0%, rgba(74, 50, 44, 0) 35%, rgba(74, 50, 44, 0.32) 100%);
  pointer-events: none;
}
.reel-art.has-cover .reel-play { width: 64px; height: 64px; background: rgba(255, 253, 246, 0.92); }

.tone-0 .reel-art { background: linear-gradient(170deg, #F6DDD0, #E7BCAE); }
.tone-1 .reel-art { background: linear-gradient(170deg, #F1EBD0, #D8C49E); }
.tone-2 .reel-art { background: linear-gradient(170deg, #E9ECD3, #B9BF8E); }
.tone-3 .reel-art { background: linear-gradient(170deg, #EFDCDA, #D9B4B3); }
.tone-4 .reel-art { background: linear-gradient(170deg, #E3ECF0, #B7C9D6); }

.reel-play {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  padding-left: 4px;                 /* optically centre the triangle */
  border-radius: 50%;
  background: var(--surface);
  color: var(--rose-deep);
  font-size: 1.15rem;
  border: 1.5px solid var(--gold);
  box-shadow: 0 8px 20px rgba(74, 50, 44, 0.18);
  transition: transform 0.35s var(--ease);
}
.reel-card:hover .reel-play { transform: scale(1.1); }

.reel-num {
  position: relative;
  z-index: 1;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(74, 50, 44, 0.62);
}

.reel-meta { display: block; padding-top: 14px; }
.reel-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--ink);
}

/* a lone reel (postcards page) gets a little more presence */
.reel-grid.is-single .reel-item { width: min(250px, 70vw); }

/* ---------- the carousel: 3 across on desktop, 1 on phones ---------- */
.reel-carousel {
  --gap: 28px;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 776px) auto;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 40px;
}
.reel-carousel.is-static { grid-template-columns: minmax(0, 776px); }
.reel-carousel.is-static .reel-arrow { display: none; }

/* overflow hides the off-screen cards; the padding keeps the hover lift and shadow from being clipped */
.reel-viewport {
  overflow: hidden;
  padding: 14px 0 28px;
  margin: -14px 0 -28px;
  touch-action: pan-y;                /* vertical scroll stays native; horizontal swipes are ours */
}
.reel-track {
  list-style: none;
  display: flex;
  gap: var(--gap);
  will-change: transform;
}
.reel-track .reel-item {
  flex: 0 0 calc((100% - var(--gap) * (var(--per, 3) - 1)) / var(--per, 3));
  width: auto;
}

/* a shadow that stays inside the clip area (no sideways spread), so no faint edge shows */
.reel-viewport .reel-art { box-shadow: 0 12px 14px -10px rgba(74, 50, 44, 0.22); }
.reel-viewport .reel-card:hover .reel-art { box-shadow: 0 16px 16px -10px rgba(74, 50, 44, 0.30); }

.reel-arrow {
  all: unset;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  cursor: pointer;
  background: var(--surface);
  color: var(--rose-deep);
  border: 1.5px solid var(--gold);
  box-shadow: var(--shadow-soft);
  transition: background 0.25s, color 0.25s, transform 0.25s var(--ease);
}
.reel-arrow:hover { background: var(--rose-deep); color: #fff; transform: scale(1.06); }
.reel-arrow:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 3px; }

@media (max-width: 759px) {
  .reel-carousel {
    --gap: 18px;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }
  .reel-carousel.is-static { grid-template-columns: minmax(0, 1fr); }
  .reel-viewport { width: min(100%, 250px); }
  /* one reel fills the screen, so the arrows sit over the card edges */
  .reel-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 40px; height: 40px;
    margin-top: -20px;
    background: rgba(255, 253, 246, 0.94);
  }
  .reel-arrow:hover { transform: none; }
  .reel-prev { left: 0; }
  .reel-next { right: 0; }
}

/* ---------- the pop-up player ---------- */
.reel-dialog {
  margin: auto;                      /* the site's * reset would pin it top-left */
  padding: 0;
  border: none;
  background: transparent;
  max-width: none;
  max-height: none;
  overflow: visible;
}
.reel-dialog::backdrop { background: rgba(74, 50, 44, 0.58); backdrop-filter: blur(4px); }
body:has(.reel-dialog[open]) { overflow: hidden; }

/* The full Instagram card: account name, follow button, caption, likes. Sized so it also fits
   a phone with the ✕ (which overhangs the corner) still on screen. */
.reel-shell {
  position: relative;
  width: min(calc(100vw - 48px), 380px);
  padding: 12px 12px 8px;
  background: var(--surface);
  border: 1.5px solid var(--gold);
  border-radius: 22px;
  outline: 1.5px dotted rgba(185, 143, 83, 0.85);
  outline-offset: 5px;
  box-shadow: 0 30px 70px rgba(74, 50, 44, 0.35);
}
.reel-stage iframe {
  display: block;
  width: 100%;
  height: min(calc(100dvh - 170px), 680px);
  border: 0;
  border-radius: 12px;
  background: #fff;
}
.reel-close {
  position: absolute;
  top: -16px; right: -16px;
  z-index: 2;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(74, 50, 44, 0.22);
}
.reel-close:hover { color: var(--rose-deep); }
.reel-close:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 2px; }
.reel-ig {
  display: block;
  text-align: center;
  padding: 10px 0 4px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--rose-deep);
  text-decoration: none;
}
.reel-ig:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .reel-card, .reel-art, .reel-play, .reel-arrow { transition: none; }
  .reel-arrow:hover { transform: none; }
  .reel-card:hover { transform: none; }
}
