/* Case-study films, /motion style. Pairs with style/js/case-films.js */

/* ---------- inline: loop card + caption + share pill */
.cf-film { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: start; overflow: visible; scroll-margin-top: 110px; }
.cf-film > * { grid-column: 1 / -1; }
.cf-film > figcaption { grid-column: 1; }
.cf-film > .cf-share { grid-column: 2; margin-top: 0.5rem; }
.cf-media { position: relative; aspect-ratio: 16 / 9; border-radius: var(--jq-radius-lg, 8px); overflow: hidden; background: #0F1213; box-shadow: var(--jq-shadow-md, 0 4px 6px rgba(0,0,0,.05)); cursor: pointer; isolation: isolate; }
.cf-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.cf-media:hover video, .cf-media:focus-visible video { transform: scale(1.025); }
.cf-media:focus-visible { outline: 3px solid var(--jq-accent, #00A89D); outline-offset: 3px; }
.cf-media::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(to top, rgba(8,10,12,.55), rgba(8,10,12,0)); pointer-events: none; }
.cf-badge { position: absolute; left: 18px; bottom: 16px; z-index: 1; display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px; background: rgba(13,17,20,.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #F5F5F0; font: 600 13px/1 var(--jq-font-sans, Inter, sans-serif); letter-spacing: .01em; transition: background .3s; }
.cf-media:hover .cf-badge, .cf-media:focus-visible .cf-badge { background: rgba(0,168,157,.92); }
.cf-badge__dot { width: 26px; height: 26px; border-radius: 50%; background: #F5F5F0; color: #0D1114; display: inline-grid; place-items: center; }
.cf-badge__dot svg { width: 11px; height: 11px; fill: currentColor; margin-left: 2px; }
.cf-badge__t { opacity: .7; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- share menu (inline pill: light) */
.cf-share { position: relative; }
.cf-share__btn { height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--jq-border, #E8E8E3); background: var(--jq-surface, #fff); color: var(--jq-text, #1A1A18); font: 600 13px/1 var(--jq-font-sans, Inter, sans-serif); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; transition: border-color .25s, color .25s; }
.cf-share__btn:hover, .cf-share__btn[aria-expanded="true"] { border-color: var(--jq-accent, #00A89D); color: var(--jq-accent-hover, #008F86); }
.cf-share__btn:focus-visible { outline: 2px solid var(--jq-accent, #00A89D); outline-offset: 2px; }
.cf-share__btn svg { width: 16px; height: 16px; }
.cf-share__pop { position: absolute; right: 0; bottom: calc(100% + 8px); min-width: 180px; padding: 6px; border-radius: 10px; background: var(--jq-surface, #fff); border: 1px solid var(--jq-border, #E8E8E3); box-shadow: 0 10px 25px rgba(0,0,0,.10), 0 4px 10px rgba(0,0,0,.05); display: grid; gap: 2px; z-index: 20; }
.cf-share__pop[hidden] { display: none; }
.cf-share__pop a, .cf-share__pop button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 6px; border: 0; background: transparent; color: var(--jq-text, #1A1A18) !important; font: 500 14px/1.2 var(--jq-font-sans, Inter, sans-serif); text-decoration: none !important; cursor: pointer; }
.cf-share__pop a:hover, .cf-share__pop button:hover, .cf-share__pop a:focus-visible, .cf-share__pop button:focus-visible { background: rgba(0,168,157,.08); }

/* ---------- dark case studies (SHAB, Villa Bel Air brand film) */
.sh-film__frame .cf-media { border-radius: 0; box-shadow: none; }
.sh-film .cf-share { margin-top: 14px; }
.sh-film .cf-share__btn, .villa-film-dark .cf-share__btn { background: transparent; border-color: rgba(245,245,240,.25); color: #F5F5F0; }
.sh-film .cf-share__btn:hover, .sh-film .cf-share__btn[aria-expanded="true"], .villa-film-dark .cf-share__btn:hover, .villa-film-dark .cf-share__btn[aria-expanded="true"] { border-color: #F5F5F0; color: #F5F5F0; }
.sh-film .cf-share__pop, .villa-film-dark .cf-share__pop { background: #1A2025; border-color: rgba(245,245,240,.12); box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.sh-film .cf-share__pop a, .sh-film .cf-share__pop button, .villa-film-dark .cf-share__pop a, .villa-film-dark .cf-share__pop button { color: #F5F5F0 !important; }
.sh-film .cf-share__pop a:hover, .sh-film .cf-share__pop button:hover, .villa-film-dark .cf-share__pop a:hover, .villa-film-dark .cf-share__pop button:hover { background: rgba(245,245,240,.08); }

/* ---------- link to the Client Series on /motion */
.cf-more { margin: 1.5rem 0 0; font: 600 14px/1.4 var(--jq-font-sans, Inter, sans-serif); }
.cf-more a { color: var(--jq-text, #1A1A18) !important; text-decoration: none !important; border-bottom: 1px solid var(--jq-border, #E8E8E3); padding-bottom: 3px; transition: border-color .25s, color .25s; }
.cf-more a:hover, .cf-more a:focus-visible { color: var(--jq-accent-hover, #008F86) !important; border-color: var(--jq-accent, #00A89D); }
.cf-more--dark a { color: #F5F5F0 !important; border-color: rgba(245,245,240,.25); }
.cf-more--dark a:hover, .cf-more--dark a:focus-visible { color: #F5F5F0 !important; border-color: #F5F5F0; }

/* ---------- player (dark cinema overlay, as on /motion) */
.cf-lock, .cf-lock body { overflow: hidden; }
.cf-player { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: rgba(6,8,10,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding: 72px 20px 96px; opacity: 0; transition: opacity .45s cubic-bezier(.2,.7,.2,1); font-family: var(--jq-font-sans, Inter, sans-serif); }
.cf-player[hidden] { display: none; }
.cf-player.is-open { opacity: 1; }
.cf-player__top { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px clamp(16px, 4vw, 40px); color: #F5F5F0; }
.cf-player__title { font: 700 18px/1.2 var(--jq-font-serif, Georgia, serif); margin: 0; color: #F5F5F0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-player__title small { font: 500 12px/1 ui-monospace, Menlo, Consolas, monospace; color: rgba(245,245,240,.45); margin-right: 12px; letter-spacing: .04em; }
.cf-player__acts { display: flex; align-items: center; gap: 12px; flex: none; }
.cf-player .cf-share__btn { height: 46px; padding: 0 18px; border-color: rgba(245,245,240,.22); background: transparent; color: #F5F5F0; }
.cf-player .cf-share__btn:hover, .cf-player .cf-share__btn[aria-expanded="true"] { border-color: #F5F5F0; color: #F5F5F0; }
.cf-player .cf-share__pop { top: calc(100% + 10px); bottom: auto; background: #1A2025; border-color: rgba(245,245,240,.12); box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.cf-player .cf-share__pop a, .cf-player .cf-share__pop button { color: #F5F5F0 !important; }
.cf-player .cf-share__pop a:hover, .cf-player .cf-share__pop button:hover, .cf-player .cf-share__pop a:focus-visible, .cf-player .cf-share__pop button:focus-visible { background: rgba(245,245,240,.08); }
.cf-x { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(245,245,240,.22); background: transparent; color: #F5F5F0; cursor: pointer; position: relative; transition: border-color .3s, transform .5s cubic-bezier(.2,.7,.2,1); }
.cf-x::before, .cf-x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 1.5px; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.cf-x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.cf-x:hover { border-color: #F5F5F0; transform: rotate(90deg); }
.cf-x:focus-visible, .cf-ctl:focus-visible, .cf-bar:focus-visible { outline: 2px solid #00A89D; outline-offset: 3px; }
.cf-player__frame { position: relative; width: min(100%, calc((100svh - 190px) * 16 / 9)); aspect-ratio: 16 / 9; background: #000; border-radius: 6px; overflow: hidden; box-shadow: 0 40px 120px rgba(0,0,0,.6); transform: scale(.96); transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.cf-player.is-open .cf-player__frame { transform: scale(1); }
.cf-player.is-tall .cf-player__frame { width: min(100%, calc((100svh - 190px) * 9 / 16)); aspect-ratio: 9 / 16; }
.cf-player__frame video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #000; }
.cf-player__bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px clamp(16px, 4vw, 40px) 26px; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto auto; gap: 18px; align-items: center; color: #F5F5F0; }
.cf-player.is-single .cf-ctl--prev, .cf-player.is-single .cf-ctl--next { visibility: hidden; }
.cf-ctl { background: none; border: 0; color: #F5F5F0; cursor: pointer; padding: 8px 4px; display: inline-flex; align-items: center; opacity: .85; transition: opacity .3s; }
.cf-ctl:hover { opacity: 1; }
.cf-ctl svg { width: 18px; height: 18px; fill: currentColor; }
.cf-bar { position: relative; height: 22px; cursor: pointer; }
.cf-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: rgba(245,245,240,.18); border-radius: 2px; }
.cf-bar__fill, .cf-bar__buf { position: absolute; left: 0; right: 0; top: 10px; height: 2px; transform-origin: left; transform: scaleX(0); border-radius: 2px; }
.cf-bar__buf { background: rgba(245,245,240,.18); }
.cf-bar__fill { background: linear-gradient(90deg, #00A89D, #0099D6); }
.cf-bar:hover::before, .cf-bar:hover .cf-bar__fill, .cf-bar:hover .cf-bar__buf { height: 4px; top: 9px; }
.cf-player__time { font: 500 13px/1 ui-monospace, Menlo, Consolas, monospace; color: rgba(245,245,240,.66); font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 767px) {
  .cf-share__btn span { display: none; }
  .cf-share__btn { width: 38px; padding: 0; justify-content: center; }
  .cf-player .cf-share__btn { width: 46px; padding: 0; justify-content: center; }
  .cf-badge { left: 10px; bottom: 10px; padding: 6px; font-size: 0; gap: 0; }
  .cf-badge__t { display: none; }
  .cf-player { padding: 64px 0 92px; }
  .cf-player__frame { border-radius: 0; }
  .cf-player__bar { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; }
  .cf-player__bar .cf-ctl--prev, .cf-player__bar .cf-ctl--next { display: none; }
  .cf-player__title { font-size: 15px; }
}
/* Phone sideways: the film fills the screen, the controls float over it and fade (.is-idle, set in case-films.js). */
@media (orientation: landscape) and (max-height: 560px) {
  .cf-player { padding: 0; }
  .cf-player__frame, .cf-player.is-tall .cf-player__frame { width: min(100vw, calc(100svh * 16 / 9)); aspect-ratio: 16 / 9; border-radius: 0; box-shadow: none; }
  .cf-player.is-tall .cf-player__frame { width: calc(100svh * 9 / 16); aspect-ratio: 9 / 16; }
  .cf-player__top, .cf-player__bar { z-index: 5; transition: opacity .4s cubic-bezier(.2,.7,.2,1); }
  .cf-player__top { padding: 10px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left)); background: linear-gradient(180deg, rgba(6,8,10,.7), rgba(6,8,10,0)); }
  .cf-player__bar { padding: 28px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); background: linear-gradient(0deg, rgba(6,8,10,.75), rgba(6,8,10,0)); gap: 14px; }
  .cf-player__title { font-size: 15px; }
  .cf-x, .cf-player .cf-share__btn { width: 40px; height: 40px; }
  .cf-player .cf-share__btn { padding: 0; justify-content: center; }
  .cf-player .cf-share__btn span { display: none; }
  .cf-player.is-idle .cf-player__top, .cf-player.is-idle .cf-player__bar { opacity: 0; pointer-events: none; }
  .cf-player.is-idle { cursor: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-media video, .cf-player, .cf-player__frame, .cf-x { transition: none; }
}
