/* =========================================================
   KEYS99 - REELS (reels.html): a full-screen vertical feed in the
   style of Instagram Reels. One slide per video; the feed snaps from
   one to the next. js/reels.js plays the slide in view.
========================================================= */

body.reels-on{ overflow:hidden; }
body.reels-on #footer{ display:none; }
/* The reels use the whole screen: no site header (the back arrow and the bottom bar get you around). */
body.reels-on header.header{ display:none; }

.reels-wrap{
  position:fixed;
  left:0; right:0;
  top:var(--reels-top, 64px);
  bottom:var(--reels-bottom, 76px);
  background:#0b1512;
  z-index:5;
}

.reels-feed{
  padding:0;
  margin:0;
  height:100%;
  overflow-y:auto;
  scroll-snap-type:y mandatory;
  overscroll-behavior:contain;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
.reels-feed::-webkit-scrollbar{ display:none; }
.reels-feed:focus{ outline:none; }

.reel-slide{
  height:100%;
  scroll-snap-align:start;
  scroll-snap-stop:always;
  display:flex;
  justify-content:center;
  align-items:center;
}

.reel-stage{
  position:relative;
  width:100%;
  height:100%;
  background:#000;
  overflow:hidden;
  color:#fff;
}

.reel-video,
.reel-poster,
.reel-stage iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
  object-fit:cover;
  background:#000;
}
.reel-video.is-wide{ object-fit:contain; }

.reel-shade{
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.18) 34%, rgba(0,0,0,0) 55%),
             linear-gradient(to bottom, rgba(0,0,0,.28) 0%, rgba(0,0,0,0) 16%);
}

/* Tap anywhere on the video to pause / play (Instagram/Facebook: to open the player). */
.reel-tap{
  position:absolute;
  inset:0 64px 150px 0;
  width:auto; height:auto;
  background:none;
  border:0;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.reel-slide.has-embed-player .reel-tap{ display:none; }

.reel-flash{
  position:absolute;
  top:50%; left:50%;
  width:76px; height:76px;
  margin:-38px 0 0 -38px;
  border-radius:50%;
  background:rgba(0,0,0,.45);
  opacity:0;
  pointer-events:none;
  display:grid;
  place-items:center;
  font-size:30px;
}
.reel-flash.is-pause::before{ content:"❚❚"; font-size:24px; letter-spacing:-2px; }
.reel-flash.is-play::before{ content:"▶"; padding-left:5px; }
.reel-flash.show{ animation:reelFlash .6s ease-out; }
@keyframes reelFlash{ 0%{ opacity:.95; transform:scale(.8); } 100%{ opacity:0; transform:scale(1.25); } }

.reel-burst{
  position:absolute;
  top:42%; left:50%;
  font-size:96px;
  line-height:1;
  color:#ff3b5c;
  transform:translate(-50%,-50%) scale(0);
  opacity:0;
  pointer-events:none;
  filter:drop-shadow(0 4px 14px rgba(0,0,0,.4));
}
.reel-burst.show{ animation:reelBurst .8s ease-out; }
@keyframes reelBurst{
  0%{ transform:translate(-50%,-50%) scale(.2); opacity:0; }
  25%{ transform:translate(-50%,-50%) scale(1.15); opacity:1; }
  70%{ transform:translate(-50%,-60%) scale(1); opacity:1; }
  100%{ transform:translate(-50%,-80%) scale(1); opacity:0; }
}

/* Poster-only slides (Instagram, Facebook) show a play button until tapped. */
.reel-slide[data-platform="instagram"] .reel-tap::after,
.reel-slide[data-platform="facebook"] .reel-tap::after{
  content:"▶";
  position:absolute;
  top:50%; left:50%;
  width:72px; height:72px;
  margin:-36px 0 0 -36px;
  border-radius:50%;
  background:rgba(0,0,0,.5);
  display:grid;
  place-items:center;
  font-size:28px;
  padding-left:5px;
  box-sizing:border-box;
}

.reel-info{
  position:absolute;
  left:0; right:78px;
  bottom:0;
  padding:0 16px 22px 16px;
  display:grid;
  gap:6px;
  justify-items:start;
  text-shadow:0 1px 6px rgba(0,0,0,.5);
}
.reel-tag{
  font-size:11px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
  background:rgba(255,255,255,.2);
  backdrop-filter:blur(6px);
  padding:3px 9px;
  border-radius:99px;
  text-shadow:none;
}
.reel-title{
  font-size:16px;
  line-height:1.3;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.reel-project{
  color:#fff;
  font-size:13.5px;
  opacity:.92;
  text-decoration:none;
}
.reel-cta{
  margin-top:4px;
  background:#00866e;
  color:#fff;
  font-weight:800;
  font-size:13.5px;
  padding:9px 16px;
  border-radius:99px;
  text-decoration:none;
  text-shadow:none;
  box-shadow:0 4px 14px rgba(0,0,0,.3);
}

.reel-actions{
  position:absolute;
  right:10px;
  bottom:26px;
  display:grid;
  gap:14px;
  justify-items:center;
}
.reel-actions .fav,
.reel-btn{
  position:static;
  width:46px; height:46px;
  border:0;
  border-radius:50%;
  background:rgba(0,0,0,.4);
  backdrop-filter:blur(6px);
  color:#fff;
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow:none;
  padding:0;
}
.reel-actions .fav::before{ width:26px; height:26px; }
.reel-actions .fav.active{ color:#ff3b5c; }
.reel-btn svg{ width:24px; height:24px; }
.reel-sound .reel-wave{ display:none; }
.reel-sound[aria-pressed="true"] .reel-wave{ display:block; }
.reel-sound[aria-pressed="true"] .reel-mute{ display:none; }

.reel-progress{
  position:absolute;
  left:0; right:0; bottom:0;
  height:3px;
  background:rgba(255,255,255,.22);
}
.reel-progress i{
  display:block;
  height:100%;
  width:0;
  background:#fff;
}

.reels-nav{ display:none; }

.reels-empty{ padding:40px 16px; }

/* Desktop: a phone-shaped column in the middle, with up / down buttons. */
@media (min-width:768px){
  .reels-wrap{ display:flex; justify-content:center; background:#0b1512; }
  .reels-feed{ width:min(440px, 100%); }
  .reel-slide{ padding:12px 0; box-sizing:border-box; }
  .reel-stage{ border-radius:18px; }
  .reels-nav{
    display:grid;
    gap:12px;
    align-content:center;
    margin-left:18px;
  }
  .reels-nav button{
    width:48px; height:48px;
    border-radius:50%;
    border:0;
    background:rgba(255,255,255,.14);
    color:#fff;
    font-size:22px;
    cursor:pointer;
  }
  .reels-nav button:hover{ background:rgba(255,255,255,.26); }
}

@media (prefers-reduced-motion:reduce){
  .reel-flash.show,.reel-burst.show{ animation-duration:.01s; }
}

/* ---------- Filters ---------- */
.reels-col{ position:relative; width:100%; height:100%; }
.reels-col .reels-feed{ width:100%; }
.reel-slide[hidden]{ display:none; }

.reels-filter-btn{
  position:absolute;
  top:calc(12px + env(safe-area-inset-top, 0px)); left:60px;
  z-index:8;
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:9px 14px;
  border:0;
  border-radius:99px;
  background:rgba(0,0,0,.45);
  backdrop-filter:blur(6px);
  color:#fff;
  font:inherit;
  font-weight:800;
  font-size:13.5px;
  cursor:pointer;
}
.reels-filter-btn[hidden]{ display:none; }
.reels-filter-btn svg{ width:16px; height:16px; }
.reels-filter-btn.is-on{ background:#00866e; }
.reels-filter-badge{
  min-width:18px; height:18px;
  padding:0 5px;
  border-radius:99px;
  background:#fff;
  color:#00533f;
  font-size:11.5px;
  line-height:18px;
  text-align:center;
}

.reels-none{
  position:absolute;
  left:50%; top:50%;
  transform:translate(-50%,-50%);
  width:min(86%, 320px);
  margin:0;
  padding:22px;
  border-radius:16px;
  background:#fff;
  color:#12312a;
  text-align:center;
  font-weight:600;
  z-index:7;
}
.reels-none[hidden]{ display:none; }
.reels-none button{
  display:block;
  margin:12px auto 0;
  padding:9px 18px;
  border:0;
  border-radius:99px;
  background:#00866e;
  color:#fff;
  font:inherit;
  font-weight:800;
  cursor:pointer;
}

.reels-sheet{ position:fixed; inset:0; z-index:80; display:flex; align-items:flex-end; justify-content:center; }
.reels-sheet[hidden]{ display:none; }
.reels-sheet-back{ position:absolute; inset:0; background:rgba(0,0,0,.55); }
.reels-sheet-panel{
  position:relative;
  width:100%;
  max-width:520px;
  max-height:82vh;
  display:flex;
  flex-direction:column;
  background:#fff;
  color:#12312a;
  border-radius:20px 20px 0 0;
  animation:rfUp .22s ease-out;
}
@keyframes rfUp{ from{ transform:translateY(40px); opacity:0; } to{ transform:none; opacity:1; } }
.reels-sheet-head{ display:flex; justify-content:space-between; align-items:center; padding:16px 18px 8px; }
.reels-sheet-head h2{ margin:0; font-size:18px; }
.reels-sheet-x{ border:0; background:#eef2f1; width:34px; height:34px; border-radius:50%; font-size:15px; cursor:pointer; }
.reels-sheet-body{ overflow-y:auto; padding:4px 18px 12px; }
.rf-group{ margin:0 0 14px; }
.rf-group[hidden]{ display:none; }
.rf-group h3{ margin:0 0 8px; font-size:13px; text-transform:uppercase; letter-spacing:.05em; color:#5b706a; }
.rf-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.rf-chip{
  padding:8px 13px;
  border:1.5px solid #cfe0db;
  border-radius:99px;
  background:#fff;
  color:#12312a;
  font:inherit;
  font-weight:700;
  font-size:13.5px;
  cursor:pointer;
}
.rf-chip.is-on{ background:#00866e; border-color:#00866e; color:#fff; }
.reels-sheet-foot{ display:flex; gap:10px; padding:12px 18px 18px; border-top:1px solid #e3ece9; }
.rf-clear{ flex:0 0 auto; padding:12px 18px; border:1.5px solid #cfe0db; border-radius:12px; background:#fff; font:inherit; font-weight:800; cursor:pointer; }
.rf-apply{ flex:1; padding:12px 18px; border:0; border-radius:12px; background:#00866e; color:#fff; font:inherit; font-weight:800; cursor:pointer; }
.rf-apply:disabled{ opacity:.45; cursor:default; }

@media (min-width:768px){
  .reels-col{ width:min(440px,100%); }
  .reels-sheet{ align-items:center; }
  .reels-sheet-panel{ border-radius:20px; }
}

.reels-back{
  position:absolute;
  top:calc(12px + env(safe-area-inset-top, 0px)); left:12px;
  z-index:8;
  width:40px; height:40px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:rgba(0,0,0,.45);
  backdrop-filter:blur(6px);
  color:#fff;
}
.reels-back svg{ width:22px; height:22px; }

.reels-auto{
  position:absolute;
  top:calc(12px + env(safe-area-inset-top, 0px)); right:12px;
  z-index:8;
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:9px 13px;
  border:0;
  border-radius:99px;
  background:rgba(0,0,0,.45);
  backdrop-filter:blur(6px);
  color:#fff;
  font:inherit;
  font-weight:800;
  font-size:12.5px;
  cursor:pointer;
}
.reels-auto svg{ width:15px; height:15px; }
.reels-auto.is-on{ background:#00866e; }
