/* =========================================================
   8FLiX — SlickNick Pill (global)
   For Download Monitor template: slicknick-pill-only
   Markup classes: .efx-scr-placeholder, .efx-pill, etc.
   Scope: .ef-dlm-btn-row
   ========================================================= */

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-scr-placeholder,
:is(.ef-dlm-btn-row, .efx-prevnext) .efx-scr-placeholder *,
:is(.ef-dlm-btn-row, .efx-prevnext) .efx-scr-placeholder *::before,
:is(.ef-dlm-btn-row, .efx-prevnext) .efx-scr-placeholder *::after {
  box-sizing: border-box;
}

/* Wrapper block (the “card”) */
:is(.ef-dlm-btn-row, .efx-prevnext) .efx-scr-placeholder {
  --efx-accent: #D3239A;
  --efx-warm:   #FF6A00;
  --efx-br:     14px;

  position: relative;
  padding: 1rem 1rem 1.25rem 1.25rem;
  border: 1px solid rgba(211,35,154,.22);
  border-radius: var(--efx-br);
  background: linear-gradient(90deg, rgba(211,35,154,.06), transparent 55%);
  color: #222;
}

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-scr-placeholder::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 10px;
  background: linear-gradient(180deg, var(--efx-accent), var(--efx-warm));
  border-radius: var(--efx-br) 0 0 var(--efx-br);
}

/* Status header inside wrapper */
:is(.ef-dlm-btn-row, .efx-prevnext) .efx-st5-status {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: .25rem;
}

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-st5-status svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-st5-status strong {
  font-family: 'Roboto', Open Sans, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #222;
  overflow-wrap: anywhere;
}

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-st5-sub {
  font-family: 'Roboto', Open Sans, serif;
  font-size: .9rem;
  opacity: .85;
  overflow-wrap: anywhere;
}

/* Grid wrapper (even though we only have 1 pill) */
:is(.ef-dlm-btn-row, .efx-prevnext) .efx-lang-grid {
  display: grid;
  gap: .75rem;
  margin-top: .85rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* The pill itself */
:is(.ef-dlm-btn-row, .efx-prevnext) .efx-pill {
  font-family: 'Roboto', Open Sans, serif;
  width: 100%;
  padding: .85rem .95rem;
  border-radius: 12px;
  border: 1px dashed rgba(211,35,154,.45);
  background: linear-gradient(90deg, rgba(211,35,154,.05), rgba(211,35,154,.08));
  color: #222;

  display: flex;
  flex-direction: column;
  gap: .35rem;
  text-align: left;
  text-decoration: none;

  position: relative;
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-pill[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .65;
}

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-pill--active {
  border-style: solid;
  cursor: pointer;
  background: linear-gradient(90deg, rgba(211,35,154,.08), rgba(255,106,0,.10));
}

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-pill--active:hover {
  transform: translateY(-1px);
  border-color: rgba(211,35,154,.60);
  box-shadow: 0 10px 22px rgba(0,0,0,.12);
}

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-pill--active:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(0,0,0,.10);
}

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-pill--active:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(211,35,154,.35),
    0 10px 22px rgba(0,0,0,.12);
}

/* Top row (title + PDF chip) */
:is(.ef-dlm-btn-row, .efx-prevnext) .efx-pill__top {
  display: flex;
  align-items: center;
  gap: .6rem;
}

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-pill__lang {
  font-weight: 700;
  font-size: clamp(15px, 1.1vw, 18px);
  letter-spacing: .05em;
  text-transform: uppercase;

  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-tag {
  margin-left: auto;
  flex: 0 0 auto;

  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;

  padding: 6px 10px;
  border-radius: 999px;
  line-height: 1;

  color: #fff;
  background: #D3239A;
  border: 1px solid rgba(211,35,154,.55);
}

/* Bottom row */
:is(.ef-dlm-btn-row, .efx-prevnext) .efx-pill__bottom {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  opacity: .92;
}

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-state {
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* Optional download icon */
:is(.ef-dlm-btn-row, .efx-prevnext) .efx-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-block;
}

/* Shimmer text + bar */
@keyframes efx_shimmer {
  to { background-position: -200% 0; }
}

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-shimmer-text {
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 12px;

  background: linear-gradient(90deg, rgba(0,0,0,.35), #000, rgba(0,0,0,.35));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

  background-size: 200% 100%;
  animation: efx_shimmer 2.2s linear infinite;
}

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-shimmer {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  background-size: 200% 100%;
  animation: efx_shimmer 2.8s linear infinite;
}

/* Filesize badge (shows on hover/focus) */
:is(.ef-dlm-btn-row, .efx-prevnext) .efx-pill[data-size]::after {
  content: attr(data-size);
  position: absolute;
  top: .55rem;
  right: .65rem;

  font-size: .72rem;
  line-height: 1;
  padding: .28rem .4rem;

  border-radius: 6px;
  border: 1px solid rgba(0,0,0,.15);
  background: rgba(255,255,255,.88);
  color: #111;

  opacity: 0;
  transform: translateY(-2px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}

:is(.ef-dlm-btn-row, .efx-prevnext) .efx-pill--active:hover[data-size]::after,
:is(.ef-dlm-btn-row, .efx-prevnext) .efx-pill--active:focus-visible[data-size]::after {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile + reduced motion */
@media (max-width: 520px) {
  :is(.ef-dlm-btn-row, .efx-prevnext) .efx-lang-grid { grid-template-columns: 1fr; }
  :is(.ef-dlm-btn-row, .efx-prevnext) .efx-shimmer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  :is(.ef-dlm-btn-row, .efx-prevnext) .efx-shimmer,
  :is(.ef-dlm-btn-row, .efx-prevnext) .efx-shimmer-text {
    animation: none;
  }
  :is(.ef-dlm-btn-row, .efx-prevnext) .efx-pill[data-size]::after {
    transition: none;
  }
}
/* =========================================
   Spinner clamp (DLM / WP admin spinner)
   Put at bottom of efx-pills.css
   ========================================= */

.ef-dlm-btn-row img[src*="spinner.gif"],
.ef-dlm-btn-row img[src*="spinner"],
.ef-dlm-btn-row .dlm-buttons-button img,
.ef-dlm-btn-row a img[src*="spinner"] {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  display: inline-block !important;
  vertical-align: middle !important;
  margin-left: .45rem !important;
}

/* 2) If spinner is the WP-style .spinner element (background-image) */
.ef-dlm-btn-row .spinner,
.ef-dlm-btn-row .spinner.is-active {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  background-size: 18px 18px !important;
  vertical-align: middle !important;
  margin-left: .45rem !important;
  float: none !important;
}

/* 3) If spinner is applied as a background on a "loading" link/button */
.ef-dlm-btn-row a.loading,
.ef-dlm-btn-row .dlm-buttons-button.loading {
  background-size: 18px 18px !important;
  background-position: right .65rem center !important;
  background-repeat: no-repeat !important;
  padding-right: 2.2rem !important;
}
/* Screenplay Preview Frame */
.fl-col.efx-scr-preview{
  --efx-accent:#D3239A;
  --efx-warm:#FF6A00;
  --efx-br:14px;
  --efx-spine:10px;

  position:relative;
  overflow:hidden;

  border:1px solid rgba(211,35,154,.22);
  border-radius:var(--efx-br);
  color:#222;

  /* layered backgrounds: 1) vertical spine 2) subtle left wash */
  background:
    linear-gradient(180deg, var(--efx-accent), var(--efx-warm)) left / var(--efx-spine) 100% no-repeat,
    linear-gradient(90deg, rgba(211,35,154,.06), transparent 55%);

  /* keep spine inside border visually */
  background-clip: padding-box;

  /* spine never overlaps the first thumbnail */
  padding: 1rem 1rem 1.25rem calc(1.25rem + var(--efx-spine));
}

/* tighten BB column content spacing */
.fl-col.efx-scr-preview > .fl-col-content{
  padding: 10px;
}

/* poster-like thumbs */
.fl-col.efx-scr-preview .uabb-gallery-img{
  display:block;
  width:100%;
  height:auto;
  border-radius:1px;
  border:1px solid rgba(211,35,154,.14);
  box-shadow:0 6px 18px rgba(0,0,0,.10);
  transform: translateZ(0);
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}

/* zoom-in vibe */
.fl-col.efx-scr-preview .uabb-photo-gallery.zoom-in a:hover .uabb-gallery-img{
  transform:scale(1.04);
  box-shadow:0 10px 26px rgba(0,0,0,.14);
  filter:saturate(1.05) contrast(1.02);
}

p.uabb-caption {
	padding: 5px;
}

/* Preview note inside the screenplay preview frame */
.fl-col.efx-scr-preview .efx-scr-preview-note{
  max-width: 980px;
  margin: 0 auto 14px auto;
  padding: .7rem .85rem;
  border-radius: 12px;

  border: 1px solid rgba(211,35,154,.16);
  background: rgba(255,255,255,.70);

  font-size: .95rem;
  line-height: 1.25;
}

.fl-col.efx-scr-preview .efx-scr-preview-note strong{
  font-weight: 800;
}

.fl-col.efx-scr-preview .efx-scr-preview-note__link{
  font-weight: 800;
  text-decoration: none;

  background: linear-gradient(90deg, #D3239A, #FF6A00);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  border-bottom: 1px solid rgba(211,35,154,.35);
  padding-bottom: 1px;
  margin-left: .25rem;
}

.fl-col.efx-scr-preview .efx-scr-preview-note__link:hover{
  border-bottom-color: rgba(255,106,0,.55);
}
/* Always 3 columns for the screenplay preview gallery */
.fl-col.efx-scr-preview .uabb-photo-gallery.uabb-gallery-grid3{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* Kill any responsive overrides that try to stack it */
@media (max-width: 900px){
  .fl-col.efx-scr-preview .uabb-photo-gallery.uabb-gallery-grid3{
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 560px){
  .fl-col.efx-scr-preview .uabb-photo-gallery.uabb-gallery-grid3{
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 560px){
  .fl-col.efx-scr-preview .uabb-photo-gallery.uabb-gallery-grid3{
    gap: 8px !important;
  }
  .fl-col.efx-scr-preview .uabb-gallery-img{
    border-radius: 8px;
  }
}
/* Make the 3-up preview thumbnails BIG (force items to stretch) */
.fl-col.efx-scr-preview .uabb-module-content.uabb-photo-gallery.uabb-gallery-grid3{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;

  /* tweak these to taste */
  gap: clamp(14px, 2vw, 34px) !important;
  max-width: 1240px;          /* bump this up if you want even bigger */
  margin: 0 auto !important;

  justify-items: stretch;
  align-items: start;
}

/* Kill UABB fixed sizing so each cell can fill the column */
.fl-col.efx-scr-preview .uabb-photo-gallery-item{
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  float: none !important;
}

/* Make inner wrappers full-width */
.fl-col.efx-scr-preview .uabb-photo-gallery-content,
.fl-col.efx-scr-preview .uabb-photo-gallery-content a{
  display: block;
  width: 100% !important;
}

/* Make the image actually fill the card */
.fl-col.efx-scr-preview img.uabb-gallery-img{
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
}
@media (max-width: 560px){
  .fl-col.efx-scr-preview .uabb-module-content.uabb-photo-gallery.uabb-gallery-grid3{
    grid-template-columns: repeat(3, 170px) !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    max-width: 100% !important;
  }
}
@media (max-width: 560px){
  .fl-col.efx-scr-preview .uabb-module-content.uabb-photo-gallery.uabb-gallery-grid3{
    scroll-snap-type: x mandatory;
    scroll-padding-left: 12px;
  }

  .fl-col.efx-scr-preview .uabb-photo-gallery-item{
    scroll-snap-align: start;
  }
}
/* =========================================================
   Prev/Next (efx-prevnext) addon styles
   Lives here to avoid MIME/404 issues
   ========================================================= */

/* Layout wrapper */
.efx-prevnext{
  display:grid;
  gap: 14px;
  margin: 22px auto 34px;   /* bottom space above footer */
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
}

/* Two-up grid */
.efx-prevnext--grid{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 820px){
  .efx-prevnext--grid{ grid-template-columns: 1fr; }
}

/* If you ever use layout="stack" */
.efx-prevnext--stack{
  grid-template-columns: 1fr;
}

/* Remove the arrow chip (the pink bubble) */
.efx-prevnext .efx-tag{
  display:none !important;
}

/* Make the pill handle a poster/thumb nicely without touching your pill styling */
.efx-prevnext-pill__thumb{
  display:block;
  overflow:hidden;
  border-radius: 12px;
  margin: -0.8rem -0.95rem .75rem -0.95rem; /* bleed to pill edges */
}

.efx-prevnext-pill__img{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Title + description tweaks (light touch) */
.efx-prevnext-pill__title{
  font-weight: 900;
}

.efx-prevnext-pill__desc{
  margin-top: .45rem;
  font-size: .9rem;
  line-height: 1.35;
  opacity: .9;
}

/* Override that entry-content max-width nuker, if it hits */
.entry-content .efx-prevnext{
  max-width: 1200px !important;
}
.efx-prevnext{ margin-bottom: 0 !important; }

.efx-prevnext::after{
  content:"";
  display:block;
  height:34px;
  grid-column:1 / -1;
}
/* Prev/Next: shimmer the label */
.efx-prevnext .efx-pill__lang{
  font-weight: 800;
  background: linear-gradient(90deg, rgba(0,0,0,.35), #000, rgba(0,0,0,.35));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: efx-shimmer 2.2s infinite linear;
}

@media (prefers-reduced-motion: reduce){
  .efx-prevnext .efx-pill__lang{ animation: none; }
}
/* --- Shimmer fix for Prev/Next --- */

/* Alias keyframes, so both names work (dash + underscore) */
@keyframes efx-shimmer { to { background-position: -200% 0; } }

/* Make the Prev/Next label actually shimmer */
.efx-prevnext .efx-pill__lang{
  font-weight: 800;
  background: linear-gradient(90deg, rgba(0,0,0,.25), #000, rgba(0,0,0,.25));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

  background-size: 200% 100%;
  background-position: 200% 0;
  animation: efx_shimmer 2.2s linear infinite; /* uses your existing keyframes */
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce){
  .efx-prevnext .efx-pill__lang{ animation: none; }
}
.efx-prevnext-pill__desc{
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* ============================
   EFX Content Grid (shortcode)
   ============================ */

.efx-grid {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.efx-grid__inner {
  display: grid;
  gap: 16px;
}

.efx-grid--cols-1 .efx-grid__inner { grid-template-columns: 1fr; }
.efx-grid--cols-2 .efx-grid__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.efx-grid--cols-3 .efx-grid__inner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.efx-grid--cols-4 .efx-grid__inner { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.efx-grid--cols-5 .efx-grid__inner { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.efx-grid--cols-6 .efx-grid__inner { grid-template-columns: repeat(6, minmax(0, 1fr)); }

@media (max-width: 1024px) {
  .efx-grid--cols-4 .efx-grid__inner,
  .efx-grid--cols-5 .efx-grid__inner,
  .efx-grid--cols-6 .efx-grid__inner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .efx-grid__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .efx-grid__inner { grid-template-columns: 1fr; }
}

/* Force 2 cols for tablets and down (<=1024px) even when grid is set to 3+ */
@media (max-width: 1024px){
  .efx-grid--cols-3 .efx-grid__inner,
  .efx-grid--cols-4 .efx-grid__inner,
  .efx-grid--cols-5 .efx-grid__inner,
  .efx-grid--cols-6 .efx-grid__inner{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile stays 1 col (you already have this, but keeping here for clarity) */
@media (max-width: 520px){
  .efx-grid__inner{ grid-template-columns: 1fr; }
}

.efx-grid__thumb {
  display: block;
  margin: -0.8rem -0.95rem .65rem -0.95rem; /* bleed to pill edges */
  border-radius: 14px;
  overflow: hidden;
}

.efx-grid__img {
  width: 100%;
  height: auto;
  display: block;
}

.efx-grid__desc {
  margin-top: 10px;
  font-size: 0.95rem;
  line-height: 1.35;
  opacity: 0.9;
}

.efx-grid__more {
  width: 100%;
  margin-top: 16px;
  cursor: pointer;
}

.efx-grid__open{
  opacity: .85;
}
.efx-grid__card:hover .efx-grid__open{
  opacity: 1;
}

/* -------------------------------------------------------
   SlickNick Pill thumbnails too small (grid override fix)
   ------------------------------------------------------- */

/* Try all likely thumb wrappers (covers DLM + builder variants) */
.efx-dlm-btn-row .efx-pill__thumb,
.efx-dlm-btn-row .efx-dlm-thumb,
.efx-dlm-btn-row .dlm-download-thumbnail,
.efx-dlm-btn-row .download-thumbnail {
  width: 100% !important;
  display: block !important;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  margin: 0 0 .85rem 0;
  position: relative;
  background: linear-gradient(90deg, rgba(211,35,154,.08), rgba(255,106,0,.08));
}

/* Force the image to actually fill the container */
.efx-dlm-btn-row .efx-pill__thumb img,
.efx-dlm-btn-row .efx-dlm-thumb img,
.efx-dlm-btn-row .dlm-download-thumbnail img,
.efx-dlm-btn-row .download-thumbnail img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  display: block !important;
  object-fit: cover;
}

/* Optional: subtle “8FLiX shimmer sweep” over the thumb on hover */
.efx-dlm-btn-row .efx-pill__thumb::after,
.efx-dlm-btn-row .efx-dlm-thumb::after,
.efx-dlm-btn-row .dlm-download-thumbnail::after,
.efx-dlm-btn-row .download-thumbnail::after {
  content: "";
  position: absolute;
  inset: -40% -30%;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 40%,
    rgba(255,255,255,.35) 50%,
    transparent 60%
  );
  transform: translateX(-65%);
}

.efx-dlm-btn-row a:hover .efx-pill__thumb::after,
.efx-dlm-btn-row a:hover .efx-dlm-thumb::after,
.efx-dlm-btn-row a:hover .dlm-download-thumbnail::after,
.efx-dlm-btn-row a:hover .download-thumbnail::after {
  opacity: .85;
  animation: efxThumbSweep 1.35s ease-in-out infinite;
}

@keyframes efxThumbSweep {
  0%   { transform: translateX(-65%); }
  100% { transform: translateX(65%); }
  
  /* Text shimmer (only on hover so it stays classy) */
.efx-dlm-btn-row a:hover .efx-shimmer-text {
  background: linear-gradient(90deg, #D3239A, #FF6A00, #D3239A);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: efxTextShimmer 1.9s linear infinite;
}

@keyframes efxTextShimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}