.tfw-instagram, .tfw-instagram *{ box-sizing:border-box; }
.tfw-instagram a{ color:inherit; text-decoration:none; }
.tfw-instagram button{ font-family:inherit; cursor:pointer; background:none; border:none; color:inherit; }
.tfw-instagram{ font-family: 'Bricolage Grotesque','Inter',sans-serif; }

.tfw-instagram .container{ max-width:1440px; margin:0 auto; padding:0 40px; }
.tfw-instagram .section-head{
  display:flex; align-items:flex-end; justify-content:space-between; gap:20px;
  margin-bottom: 22px;
}
.tfw-instagram .section-head h2{ font-family:'Playfair Display',Georgia,serif; font-size: clamp(26px,3vw,34px); font-weight:600; margin:0; }
.tfw-instagram .section-head em{ color: #C99E43; font-style: italic; font-weight:600; }
.tfw-instagram .ig-pill{
  border:1px solid #C99E43; border-radius:999px; padding:9px 18px;
  display:inline-flex; align-items:center; gap:8px; font-size:13px; color: #0F0F0F; flex-shrink:0;
  transition: background .2s ease;
}
.tfw-instagram .ig-pill:hover{ background: rgba(201,158,66,.1); }

.tfw-instagram .reel-grid{
  display:grid; grid-template-columns: repeat(4,1fr); gap:24px; margin-top: 30px;
}
.tfw-instagram .reel-card{
  position:relative; border-radius:16px; overflow:hidden; aspect-ratio: 322/492;
  min-height: 380px;
  background:#111; cursor:pointer;
}
.tfw-instagram .reel-card video,
.tfw-instagram .reel-card img.reel-poster{
  width:100%; height:100%; object-fit:cover; position:absolute; top:0; left:0; right:0; bottom:0;
}
.tfw-instagram .reel-scrim{ position:absolute; top:0; left:0; right:0; bottom:0; background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.7) 100%); pointer-events:none; }
.tfw-instagram .reel-actions{
  position:absolute; right:12px; bottom:33px;
  z-index:2; display:flex; flex-direction:column; gap:14px; align-items:center;
}
.tfw-instagram .reel-icon-btn{ color:#fff; display:flex; flex-direction:column; align-items:center; gap:3px; transition: transform .15s ease; }
.tfw-instagram .reel-icon-btn:hover{ transform: scale(1.12); }
.tfw-instagram .reel-icon-btn span{ font-size:10px; font-weight:600; }
.tfw-instagram .like-btn.liked{ color:#E0554F; }
.tfw-instagram .like-btn.liked svg{ fill:#E0554F; stroke:#E0554F; }
.tfw-instagram .reel-footer{
  position:absolute; left:12px; right:44px; bottom: 34px; z-index:2;
  display:flex; align-items:center; gap:9px;
}
.tfw-instagram .reel-avatar{
  width:32px; height:32px; border-radius:50%; background:rgba(255,255,255,.25);
  display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0; overflow:hidden;
}
.tfw-instagram .reel-avatar img{ width:100%; height:100%; object-fit:cover; }
.tfw-instagram .reel-meta{ min-width:0; }
.tfw-instagram .reel-user{ color:#fff; font-size:12px; font-weight:500; display:flex; align-items:center; gap:8px; }
.tfw-instagram .follow-btn{
  border:0.75px solid #fff; color:#fff; font-size:11px; padding:4px 8px; border-radius:6px; font-weight:300;
  transition: background .2s ease;
}
.tfw-instagram .follow-btn:hover, .tfw-instagram .follow-btn.following{ background:#fff; color:#111; }
.tfw-instagram .reel-track{ color: #fff; font-size:12px; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:300; }
.tfw-instagram .reel-caption{
  position:absolute; left:12px; bottom:12px; right:44px; z-index:2;
  color:#fff; font-size:13px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* Muted / sound badge shown top-right on each card like Instagram */
.tfw-instagram .reel-sound-badge{
  position:absolute; top:12px; right:12px; z-index:2;
  padding:7px; border-radius:50%; background:rgba(0,0,0,.45);
  display:flex; align-items:center; justify-content:center; color:#fff;
}
/* Wraps the views badge and/or the "View Product" button, top-left of the
   card — a flex column so either one shows on its own, or both stack
   cleanly on top of each other when a card has real view counts (Auto
   source mode) *and* a manual product link. */
.tfw-instagram .reel-topleft{
  position:absolute; top:12px; left:12px; z-index:2;
  display:flex; flex-direction:column; align-items:flex-start; gap:8px;
}
.tfw-instagram .reel-views-badge{
  color:#fff; font-size:11px; font-weight:600;
  display:flex; align-items:center; gap:4px; text-shadow:0 1px 3px rgba(0,0,0,.5);
}

/* "View Product" button — manually linked per video (see the Product Link
   field on each video, and the Product Button content/style sections).
   Same transparent + white-outline treatment as the Follow button lower
   down on this same card (.follow-btn), so it reads as "part of the same
   family" of overlay controls; fills gold on hover instead of white. */
.tfw-instagram .reel-product-btn{
  display:inline-flex; align-items:center; gap:6px;
  background:transparent; color:#FFFEFB; border:1px solid #FFFEFB;
  padding:7px 12px; border-radius:999px;
  font-size:11px; font-weight:500; letter-spacing:.02em; white-space:nowrap;
  text-shadow:0 1px 3px rgba(0,0,0,.35);
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .15s ease;
}
.tfw-instagram .reel-product-btn:hover{
  background:#C99E43; border-color:#C99E43; color:#FFFEFB; transform:translateY(-1px);
}
.tfw-instagram .reel-product-btn svg{ width:13px; height:13px; flex-shrink:0; }

/* Modal / lightbox for unmuted playback */
.tfw-instagram .reel-modal{
  position:fixed; inset:0; z-index:9999; background:rgba(10,8,6,.92);
  display:none; align-items:center; justify-content:center; padding:30px;
}
.tfw-instagram .reel-modal.open{ display:flex; }
.tfw-instagram .reel-modal-inner{
  position:relative; width:min(420px, 90vw); aspect-ratio:322/492; max-height:90vh;
  border-radius:16px; overflow:hidden; background:#000;
}
.tfw-instagram .reel-modal-inner video{ width:100%; height:100%; object-fit:cover; }
.tfw-instagram .reel-modal-close{
  position:absolute; top:-46px; right:0; color:#fff; font-size:30px; line-height:1;
  background:none; border:none; cursor:pointer;
}
@media (max-width:480px){
  .tfw-instagram .reel-modal-close{ top:10px; right:10px; z-index:3; }
}

@media (max-width: 980px){
  .tfw-instagram .reel-grid{ grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 720px){
  /* One reel at a time on mobile, swipe to the next — matches Instagram's
     own mobile feed. A horizontal scroll-snap row rather than a JS
     carousel library: native touch swipe, no extra dependency, and the
     existing IntersectionObserver autoplay logic in instagram.js already
     "just works" here since only one card can ever cross the 60%
     visibility threshold at a time in a one-per-screen row. */
  .tfw-instagram .reel-grid{
    display:flex; grid-template-columns:none; flex-wrap:nowrap;
    gap:14px; margin-top:20px;
    overflow-x:auto; overscroll-behavior-x:contain;
    scroll-snap-type:x mandatory; scroll-padding-left:20px;
    padding:0 20px 6px; margin-left:-20px; margin-right:-20px; width:calc(100% + 40px);
    -ms-overflow-style:none; scrollbar-width:none;
  }
  .tfw-instagram .reel-grid::-webkit-scrollbar{ display:none; }
  .tfw-instagram .reel-card{
    flex:0 0 calc(100% - 40px); scroll-snap-align:start; scroll-snap-stop:always;
    min-height:0; aspect-ratio: 322/492;
  }
  .tfw-instagram .reel-slider-dots{
    display:flex; justify-content:center; align-items:center; gap:7px; margin-top:16px;
  }
  .tfw-instagram .reel-slider-dots button{
    width:6px; height:6px; border-radius:50%; padding:0; background:#E9E0D2; transition: all .2s ease;
  }
  .tfw-instagram .reel-slider-dots button.active{ background:#C99E43; width:18px; border-radius:4px; }
}
@media (min-width: 721px){
  .tfw-instagram .reel-slider-dots{ display:none; }
}
