/* ════════════════════════════════════════════════════════════════
   Instagram reel wall — dd-instagram-feed
   All rules are scoped under .hp-insta-section and the load-bearing
   sizing uses !important so the hello-elementor / Elementor parent
   resets (img{max-width:100%}, button appearance, list styles) can't
   shrink the tiles. Uses the site's --dovetail-* tokens.
   ════════════════════════════════════════════════════════════════ */

.hp-insta-section {
  padding-block: 88px;
  background: var(--dovetail-bg);
  color: var(--dovetail-text);
}

/* ── Header: heading left, follow link right ── */
.hp-insta-section .hp-insta-header {
  display: flex;
  align-items: center;            /* heading + right cluster stay parallel */
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 44px;
  flex-wrap: nowrap;              /* never drop the cluster below the heading */
}
.hp-insta-section .hp-insta-heading-group { min-width: 0; }
.hp-insta-section .hp-insta-eyebrow {
  display: block;
  font-family: Roboto, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dovetail-accent);
  margin-bottom: 14px;
}
.hp-insta-section .hp-insta-header h2 { margin: 0; line-height: 1.05; }
.hp-insta-section .hp-insta-h2-cal {
  display: block;
  font-family: "Cal Sans", sans-serif;
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 48px);
  color: var(--dovetail-text);
}
.hp-insta-section .hp-insta-h2-ott {
  display: block;
  font-family: "Old Standard TT", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 3vw, 42px);
  color: var(--dovetail-accent);
}
.hp-insta-section .hp-insta-follow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: Roboto, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dovetail-text);
  text-decoration: none;
  border-bottom: 1px solid var(--dovetail-border);
  padding-bottom: 4px;
  transition: color 0.25s, border-color 0.25s;
}
.hp-insta-section .hp-insta-follow:hover { color: var(--dovetail-accent); border-color: var(--dovetail-accent); }
.hp-insta-section .hp-insta-follow svg { transition: transform 0.25s; }
.hp-insta-section .hp-insta-follow:hover svg { transform: translateX(4px); }

/* ── Header right cluster: follow link + carousel nav arrows ── */
.hp-insta-section .hp-insta-header-right {
  display: flex;
  flex-direction: column;        /* link on line 1, arrows on line 2 */
  align-items: flex-end;
  gap: 14px;
  flex-shrink: 0;
}
.hp-insta-section .hp-insta-nav { display: flex; gap: 8px; }
.hp-insta-section .hp-insta-arrow {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--dovetail-border);
  border-radius: 0;
  background: transparent;
  color: var(--dovetail-text);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.25s, color 0.25s, border-color 0.25s, opacity 0.25s;
}
.hp-insta-section .hp-insta-arrow:hover {
  background: var(--dovetail-dark);
  border-color: var(--dovetail-dark);
  color: var(--dovetail-on-dark);
}
.hp-insta-section .hp-insta-arrow:focus-visible { outline: 3px solid var(--dovetail-accent); outline-offset: 2px; }
.hp-insta-section .hp-insta-arrow:disabled { opacity: 0.3; cursor: default; }
.hp-insta-section .hp-insta-arrow:disabled:hover {
  background: transparent;
  border-color: var(--dovetail-border);
  color: var(--dovetail-text);
}
@media (max-width: 640px) {
  .hp-insta-section .hp-insta-arrow { width: 42px; height: 42px; }
}

/* ── Carousel track: horizontal scroller with snap ── */
.hp-insta-section .hp-insta-track {
  list-style: none !important;
  margin: 0 !important;
  padding: 6px 2px 30px !important;       /* room for hover-lift + shadow */
  display: flex !important;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;                  /* Firefox */
  -ms-overflow-style: none;               /* old Edge */
}
.hp-insta-section .hp-insta-track::-webkit-scrollbar { display: none; }

/* ── Card (li) = a fixed-width carousel slide (4 / 3 / ~1.3 per view) ── */
.hp-insta-section .hp-insta-card {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 calc((100% - 3 * 18px) / 4) !important;
  min-width: 0;
  scroll-snap-align: start;
}
.hp-insta-section .hp-insta-card::marker { content: "" !important; }
@media (max-width: 1024px) {
  .hp-insta-section .hp-insta-card { flex-basis: calc((100% - 2 * 18px) / 3) !important; }
}
@media (max-width: 640px) {
  .hp-insta-section { padding-block: 54px; }
  .hp-insta-section .hp-insta-header { margin-bottom: 28px; gap: 14px; }
  .hp-insta-section .hp-insta-header-right { gap: 10px; }
  .hp-insta-section .hp-insta-follow { font-size: 11px; gap: 6px; }
  .hp-insta-section .hp-insta-arrow { width: 40px; height: 40px; }
  .hp-insta-section .hp-insta-track { gap: 12px; padding: 4px 2px 20px !important; }
  .hp-insta-section .hp-insta-card { flex-basis: 66% !important; }
  /* Shorter tiles on phones (9:16 is too tall) — poster still crops to fill */
  .hp-insta-section .hp-insta-play { aspect-ratio: 3 / 4; }
  .hp-insta-section .hp-insta-badge { width: 46px; height: 46px; }
  .hp-insta-section .hp-insta-cap { font-size: 12px; bottom: 12px; }
}
@media (max-width: 400px) {
  .hp-insta-section .hp-insta-card { flex-basis: 72% !important; }
}

/* ── Button = the clickable 9:16 tile ── */
.hp-insta-section .hp-insta-play {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  aspect-ratio: 9 / 16;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--dovetail-border) !important;
  border-radius: 0 !important;
  background: var(--dovetail-dark) !important;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 18, 15, 0.06);
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s;
}
/* Fallback for engines without aspect-ratio support */
@supports not (aspect-ratio: 1 / 1) {
  .hp-insta-section .hp-insta-play { height: 0; padding-bottom: 177.78% !important; }
}
.hp-insta-section .hp-insta-play:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(20, 18, 15, 0.18);
}
/* Active/focus ring drawn INSIDE the tile (as an overlay) so the carousel's
   overflow can't clip it — an offset outline gets cut at the edges. */
.hp-insta-section .hp-insta-play::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 0 solid var(--dovetail-green-950);
  pointer-events: none;
  z-index: 3;
  transition: border-width 0.15s ease;
}
.hp-insta-section .hp-insta-play:focus { outline: none; }
.hp-insta-section .hp-insta-play:focus::after { border-width: 3px; }

/* ── Poster fills the tile (defeats img{max-width:100%;height:auto}) ── */
.hp-insta-section .hp-insta-poster {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  display: block !important;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.hp-insta-section .hp-insta-play:hover .hp-insta-poster { transform: scale(1.06); }

/* ── Gradient for caption legibility ── */
.hp-insta-section .hp-insta-overlay {
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(to top, rgba(20,18,15,0.82) 0%, rgba(20,18,15,0.05) 42%, rgba(20,18,15,0.16) 100%);
  pointer-events: none;
}

/* ── Reel tag (top-left) ── */
.hp-insta-section .hp-insta-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  font-family: Roboto, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dovetail-on-dark);
  background: rgba(20, 18, 15, 0.42);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* ── Centered play badge ── */
.hp-insta-section .hp-insta-badge {
  position: absolute !important;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  background: rgba(252, 250, 245, 0.94);
  color: var(--dovetail-accent-strong);
  box-shadow: 0 4px 14px rgba(20, 18, 15, 0.28);
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s;
}
.hp-insta-section .hp-insta-badge svg { margin-left: 2px; } /* optical-center the triangle */
.hp-insta-section .hp-insta-play:hover .hp-insta-badge {
  transform: translate(-50%, -50%) scale(1.12);
  background: #fff;
}

/* ── Caption (bottom) ── */
.hp-insta-section .hp-insta-cap {
  position: absolute !important;
  left: 14px;
  right: 14px;
  bottom: 14px;
  color: var(--dovetail-on-dark);
  font-family: Roboto, sans-serif;
  font-size: 12.5px;
  line-height: 1.45;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  pointer-events: none;
}

/* ════════════ Lightbox ════════════ */
.hp-insta-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 18, 15, 0.92);
  padding: 24px;
}
.hp-insta-modal.is-open { display: flex; }
.hp-insta-modal-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 400px;
  width: 100%;
}
.hp-insta-modal .hp-insta-video {
  width: 100%;
  max-height: 80vh;
  background: #000;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  display: block;
}
.hp-insta-modal-link {
  color: var(--dovetail-on-dark);
  font-family: Roboto, sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  opacity: 0.85;
}
.hp-insta-modal-link:hover { opacity: 1; color: var(--dovetail-accent-soft); }
.hp-insta-modal-close {
  position: absolute;
  top: -46px;
  right: 0;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--dovetail-on-dark);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}
.hp-insta-modal-close:hover { color: var(--dovetail-accent-soft); }
