/* === Ocean Instagram Posts: plugin stylesheet === */

/* ------------------ Grid & cards ------------------ */
.ofr-ig-wrap{max-width:1280px;margin:auto;padding:0 32px}
.ofr-ig-wrap .ofr-ig-grid{
  display:grid !important;
  gap:24px !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
}
@media (max-width:1023.98px){
  .ofr-ig-wrap .ofr-ig-grid{ grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
}
@media (max-width:639.98px){
  .ofr-ig-wrap .ofr-ig-grid{ gap:16px !important; grid-template-columns:1fr !important; }
}
/* Neutralise theme/builder widths */
.ofr-ig-wrap .ofr-ig-grid > *{
  width:auto !important; max-width:none !important; min-width:0 !important; flex:none !important;
}

.ofr-ig-card{
  background:#fff;border-radius:20px;overflow:hidden;
  box-shadow:0 8px 24px rgba(0,0,0,.06);
  display:flex;flex-direction:column;
}

.ofr-ig-head{padding:16px 16px 0 16px}
.ofr-ig-head h3{margin:0 0 6px 0;font-size:1.06rem;line-height:1.25}

/* ------------------ Media well (9:16) ------------------ */
.ofr-ig-media{
  position:relative !important; /* stacking context */
  background:#000;aspect-ratio:9/16;
  overflow:hidden;border-radius:16px;margin:12px 16px 8px 16px;
}

/* ------------------ Poster state layers ------------------ */
.ofr-ig-thumb{
  position:absolute !important; inset:0 !important;
  width:100% !important; height:100% !important; object-fit:cover !important;
  z-index:1 !important;
}
.ofr-ig-overlay{
  position:absolute !important; inset:0 !important;
  z-index:2 !important; pointer-events:none !important;
  background:linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,.1) 60%, transparent);
}
/* Footer meta (avatar + username left, IG glyph right) */
.ofr-ig-meta{
  position:absolute !important; left:0 !important; right:0 !important; bottom:0 !important;
  z-index:3 !important; pointer-events:auto !important; color:#fff;
  display:flex; align-items:center; justify-content:space-between; padding:12px 14px;
}
.ofr-ig-meta-left{display:flex;align-items:center;gap:10px;min-width:0}
.ofr-ig-avatar{width:54px;height:54px;border-radius:50%;object-fit:cover;background:#111;border:2px solid rgba(255,255,255,.2);flex:none}
.ofr-ig-username{font-weight:700;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ofr-ig-meta a.ofr-ig-meta-link{color:inherit;text-decoration:none}
.ofr-ig-meta a.ofr-ig-meta-link:hover{text-decoration:underline}
.ofr-ig-igmark{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;background:rgba(0,0,0,.35);flex:none}
.ofr-ig-igmark svg{width:18px;height:18px;stroke:#fff;fill:none}

/* Play glyph (center) */
.ofr-ig-play{
  position:absolute !important; left:50% !important; top:50% !important; transform:translate(-50%,-50%) !important;
  z-index:4 !important;
  width:60px !important; height:60px !important;
  padding:0 !important; border:0 !important; border-radius:50% !important;
  background:rgba(0,0,0,.48) !important;
  box-shadow:0 3px 14px rgba(0,0,0,.28) !important;
  display:grid !important; place-items:center !important;
  color:#fff !important; text-decoration:none !important;
}
.ofr-ig-play span{ display:none !important; }
.ofr-ig-play svg{ width:40px !important; height:40px !important; fill:currentColor !important; margin-left:-2px; }
@media (hover:hover){ .ofr-ig-play:hover{ background:rgba(0,0,0,.62) !important; } }
.ofr-ig-play:active{ transform:translate(-50%,-50%) scale(.98) !important; }
.ofr-ig-play:focus{ outline:0 !important; box-shadow:0 0 0 3px rgba(255,255,255,.9), 0 3px 14px rgba(0,0,0,.28) !important; }

/* ------------------ Playing layers ------------------ */
.ofr-ig-video{
  position:absolute !important; inset:0 !important;
  width:100% !important; height:100% !important; display:block !important;
  object-fit:var(--ofr-video-fit, cover) !important;
  z-index:3 !important; background:#000 !important;
}
.ofr-ig-embed{position:absolute !important; inset:0 !important; z-index:3 !important}
.ofr-ig-embed iframe{position:absolute !important; inset:0 !important; width:100% !important; height:100% !important; border:0 !important}

/* ------------------ Plyr integration ------------------ */
.ofr-ig-media .plyr{
  position:absolute !important; inset:0 !important;
  width:100% !important; height:100% !important; z-index:3 !important;
}
.ofr-ig-media .plyr__video-wrapper{ width:100% !important; height:100% !important; }
.ofr-ig-media .plyr video{
  width:100% !important; height:100% !important;
  object-fit:var(--ofr-video-fit, cover) !important; display:block !important; background:#000 !important;
}
/* Plyr controls: visible and above overlays */
.ofr-ig-media .plyr__controls{
  position:absolute !important; left:0 !important; right:0 !important; bottom:0 !important;
  z-index:6 !important; opacity:1 !important; pointer-events:auto !important;
}
/* Hide unwanted Plyr buttons (PiP/AirPlay/Fullscreen) */
.ofr-ig-media .plyr__control[data-plyr="pip"],
.ofr-ig-media .plyr__control[data-plyr="airplay"],
.ofr-ig-media .plyr__control[data-plyr="fullscreen"]{ display:none !important; }

/* ------------------ Our overlay controls ------------------ */
.ofr-ig-ctrls,
.ofr-ig-close{ position:absolute !important; z-index:5 !important; }

.ofr-ig-ctrls{
  left:0; right:0; bottom:0;
  padding:8px 10px;
  display:flex; gap:8px; justify-content:flex-end; align-items:center;
  background:linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0));
  opacity:0; transition:opacity .18s ease; pointer-events:none;
}
.ofr-ig-media:hover .ofr-ig-ctrls,
.ofr-ig-media:focus-within .ofr-ig-ctrls{ opacity:1; pointer-events:auto; }
.ofr-ig-ctrls[hidden]{ display:none !important; }

/* Close (top-right) */
.ofr-ig-close{ top:10px; right:10px; opacity:0; pointer-events:none; transition:opacity .18s ease; z-index:7 !important; }
.ofr-ig-media:hover .ofr-ig-close,
.ofr-ig-media:focus-within .ofr-ig-close{ opacity:1; pointer-events:auto; }
.ofr-ig-close[hidden]{ display:none !important; }

/* Hide our minimal bar when using Plyr (avoid double controls) */
.ofr-ig-media[data-controls="plyr"] .ofr-ig-ctrls{ display:none !important; }

/* ------------------ Footer link behaviour ------------------ */
.ofr-ig-foot{
  display:flex;gap:12px;align-items:center;justify-content:space-between;
  padding:10px 16px 16px 16px
}
.ofr-ig-card.is-playing .ofr-ig-foot{ display:none !important; }

/* ------------------ Fit mode toggle ------------------ */
.ofr-ig-wrap{ --ofr-video-fit: cover; }

/* ------------------ Safety: hide accidental native controls (WebKit) ------------------ */
.ofr-ig-media video::-webkit-media-controls{ display:none !important; opacity:0 !important; }

/* === Controls styled like .ofr-ig-igmark === */
.ofr-ig-media{
  --ofr-ui-bg: rgba(0,0,0,.35);
  --ofr-ui-bg-hover: rgba(0,0,0,.55);
  --ofr-ui-radius: 8px;
  --ofr-ui-size: 36px;
  --ofr-ui-shadow: 0 2px 8px rgba(0,0,0,.25);
  --plyr-color-main: #fff;
}

/* Minimal bar buttons */
.ofr-ig-ctrls .ofr-btn{
  width:var(--ofr-ui-size) !important;
  height:var(--ofr-ui-size) !important;
  padding:0 !important;
  border:0 !important;
  border-radius:var(--ofr-ui-radius) !important;
  background:var(--ofr-ui-bg) !important;
  box-shadow:var(--ofr-ui-shadow) !important;
  color:#fff !important;
  display:inline-grid !important; place-items:center !important;
  font-size:18px !important; line-height:1 !important; text-decoration:none !important;
}
.ofr-ig-ctrls .ofr-btn:hover{ background:var(--ofr-ui-bg-hover) !important; }
.ofr-ig-ctrls .ofr-btn:focus{ outline:0 !important; box-shadow:0 0 0 2px #fff, var(--ofr-ui-shadow) !important; }
.ofr-ig-ctrls{ gap:10px !important; padding:10px 12px !important; }

/* Close button tile */
.ofr-ig-close .ofr-btn{
  width:calc(var(--ofr-ui-size) + 4px) !important;
  height:calc(var(--ofr-ui-size) + 4px) !important;
  background:var(--ofr-ui-bg) !important;
  border-radius:var(--ofr-ui-radius) !important;
  color:#fff !important;
  font-size:20px !important;
  box-shadow:var(--ofr-ui-shadow) !important;
}
.ofr-ig-close .ofr-btn:hover{ background:var(--ofr-ui-bg-hover) !important; }
.ofr-ig-close .ofr-btn:focus{ outline:0 !important; box-shadow:0 0 0 2px #fff, var(--ofr-ui-shadow) !important; }

/* Plyr controls bar styled to match */
.ofr-ig-media .plyr__controls{
  position:absolute !important; left:0 !important; right:0 !important; bottom:0 !important;
  z-index:6 !important;
  display:flex !important; align-items:center !important; gap:10px !important;
  padding:10px 12px !important;
  background:linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0)) !important;
}
.ofr-ig-media .plyr__controls .plyr__control{
  min-width:var(--ofr-ui-size) !important;
  height:var(--ofr-ui-size) !important;
  padding:0 !important;
  border-radius:var(--ofr-ui-radius) !important;
  background:var(--ofr-ui-bg) !important;
  box-shadow:var(--ofr-ui-shadow) !important;
  color:#fff !important;
  display:inline-grid !important; place-items:center !important;
}
.ofr-ig-media .plyr__controls .plyr__control:hover{ background:var(--ofr-ui-bg-hover) !important; }
.ofr-ig-media .plyr__controls .plyr__control svg{ width:18px !important; height:18px !important; }
.ofr-ig-media .plyr__progress{ flex:1 1 auto !important; }
.ofr-ig-media .plyr__progress input[type="range"]{ height:6px !important; }
.ofr-ig-media .plyr__time, .ofr-ig-media .plyr__volume{ color:#fff !important; }

/* Compact card variant (we use media-only tiles) */
.ofr-ig-card.is-compact{ background:transparent; box-shadow:none; border-radius:0; }
.ofr-ig-card.is-compact .ofr-ig-head,
.ofr-ig-card.is-compact .ofr-ig-foot{ display:none !important; }
.ofr-ig-card.is-compact .ofr-ig-media{ margin:0; border-radius:20px; box-shadow:0 8px 24px rgba(0,0,0,.06); }

/* Neutralize native button look for the play glyph */
.ofr-ig-play{ appearance:none; -webkit-appearance:none; }

/* Force Plyr controls visible while our ofr-showing class is present */
.ofr-ig-media .plyr.ofr-showing .plyr__controls{
  opacity:1 !important;
  pointer-events:auto !important;
  transform:none !important; /* guard in case a theme animates controls */
}

/* Minimal bar linger (force visible when class is added by JS) */
.ofr-ig-media.ofr-ctrls-show .ofr-ig-ctrls{
  opacity:1 !important;
  pointer-events:auto !important;
}

