/* ==========================================================================
   Video library (/videos/) and vertical feed (/video/{slug}/)
   ========================================================================== */

/* ---------- library ---------- */
.cfv-library{padding:32px 0 64px}
.cfv-library-head{max-width:720px;margin-bottom:22px}
.cfv-eyebrow{font-size:11px;letter-spacing:.22em;color:var(--red,#9c3935);margin:0 0 10px;font-family:var(--sans)}
.cfv-library-head h1{font-family:var(--serif);font-size:38px;line-height:1.35;margin:0 0 10px;letter-spacing:-.02em}
.cfv-lead{font-size:16px;color:#7d766b;margin:0}

.cfv-filter{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 26px;padding-bottom:18px;border-bottom:1px solid var(--line,#ddd7ce)}
.cfv-chip{display:inline-flex;align-items:center;gap:6px;padding:7px 15px;border:1px solid var(--line,#ddd7ce);border-radius:999px;font-size:13px;color:#6f6a62;text-decoration:none;transition:.15s;background:#fff}
.cfv-chip span{font-size:11px;color:#a49d92}
.cfv-chip:hover{border-color:var(--red,#9c3935);color:var(--red,#9c3935)}
.cfv-chip.is-active{background:var(--red,#9c3935);border-color:var(--red,#9c3935);color:#fff}
.cfv-chip.is-active span{color:#fff;opacity:.8}

.cfv-grid-public{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:22px 18px}
.cfv-card-public{display:block;text-decoration:none;color:inherit;min-width:0}
.cfv-cover{position:relative;display:block;aspect-ratio:3/4;border-radius:6px;overflow:hidden;background:#ece8e1}
.cfv-cover img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .3s}
.cfv-card-public:hover .cfv-cover img{transform:scale(1.04)}
.cfv-cover-fallback{display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:12px;font-size:13px;color:#9a938a;text-align:center;line-height:1.5}
.cfv-play{position:absolute;inset:auto auto 50% 50%;transform:translate(50%,50%);width:46px;height:46px;border-radius:50%;background:#0006;backdrop-filter:blur(2px);pointer-events:none}
.cfv-play::after{content:'';position:absolute;left:50%;top:50%;transform:translate(-38%,-50%);border-style:solid;border-width:9px 0 9px 15px;border-color:transparent transparent transparent #fff}
.cfv-duration{position:absolute;right:8px;bottom:8px;padding:1px 7px;border-radius:3px;background:#0009;color:#fff;font-size:11px}
.cfv-card-title{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:9px 0 4px;font-size:14px;line-height:1.55;color:#33302b}
.cfv-card-meta{display:block;font-size:12px;color:#a49d92}
.cfv-empty-public{padding:56px 20px;text-align:center;border:1px dashed var(--line,#ddd7ce);border-radius:8px;background:#fffdfa;color:#7d766b}

/* ---------- vertical feed ---------- */
body.page-video-detail{background:#0b0b0c;overflow:hidden}
body.page-video-detail .site-header,
body.page-video-detail .site-footer,
body.page-video-detail .bottom-bar{display:none!important}
body.page-video-detail .skip-link{color:#fff}

.cfv-feed{position:fixed;inset:0;overflow:hidden;background:#0b0b0c}
.cfv-slide{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
.cfv-stage{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:#000;overflow:hidden}
.cfv-video{display:block;background:#000;object-fit:contain;width:100%;height:100%;max-width:100%;max-height:100%}
@media(min-width:901px){
  /* Portrait clips: fill the available height, keep the aspect ratio, never crop. */
  .cfv-video{width:auto;height:100%;max-height:100vh;max-width:100%}
}

.cfv-overlay{position:absolute;left:0;right:0;bottom:0;top:0;display:flex;flex-direction:column;justify-content:flex-end;padding:0 0 26px;background:linear-gradient(#0000 0%,#0000 45%,#000000b3 78%,#000000e0 100%);pointer-events:none}
.cfv-overlay-head{position:absolute;top:0;left:0;right:0;padding:18px 20px;display:flex;align-items:center;gap:12px;pointer-events:none;background:linear-gradient(#000000a6,transparent);z-index:4}
/* Only the interactive children inside the strip capture taps. */
.cfv-overlay-head>*{pointer-events:auto}
.cfv-back{color:#fff;text-decoration:none;font-size:14px;padding:7px 14px;border-radius:999px;background:#00000073;backdrop-filter:blur(6px);white-space:nowrap}
.cfv-back:hover{background:#ffffff33;color:#fff}
.cfv-tag{padding:4px 12px;border-radius:999px;background:#ffffff1f;color:#fff;font-size:12px;backdrop-filter:blur(4px)}
.cfv-overlay-body{position:relative;max-width:640px;padding:0 22px;color:#fff;pointer-events:auto;max-height:52vh;overflow-y:auto;scrollbar-width:thin}
.cfv-title{font-family:var(--serif);font-size:22px;line-height:1.45;margin:0 0 8px;color:#fff}
.cfv-intro{font-size:14px;line-height:1.75;color:#e6e3de;margin:0 0 8px;white-space:pre-line}
.cfv-stats{font-size:12px;color:#b9b4ad;margin:0 0 14px}
.cfv-cta{display:flex;gap:10px;flex-wrap:wrap;padding-bottom:4px}
.cfv-cta .button{min-height:40px;font-size:13px;padding:8px 16px}
.cfv-cta .button.primary{background:var(--red,#9c3935);border-color:var(--red,#9c3935);color:#fff}
.cfv-cta .button.outline{border-color:#ffffff59;color:#fff;background:transparent}
.cfv-cta .button.outline:hover{background:#ffffff1f;color:#fff}

.cfv-volume{position:absolute;top:18px;right:18px;z-index:6;display:flex;flex-direction:column;align-items:center;gap:8px}
.cfv-mute{width:42px;height:42px;border-radius:50%;border:0;background:#00000073;color:#fff;font-size:17px;cursor:pointer;backdrop-filter:blur(4px);transition:background .15s}
.cfv-mute:hover,.cfv-mute:focus-visible{background:#000000a6}
.cfv-mute:focus-visible{outline:2px solid #fff;outline-offset:2px}

/* Volume slider: vertical, opens on hover/focus or via right-click. */
.cfv-volume-panel{display:flex;flex-direction:column;align-items:center;gap:6px;padding:10px 6px 8px;border-radius:22px;background:#000000b3;backdrop-filter:blur(6px)}
.cfv-volume-panel[hidden]{display:none}
.cfv-volume-panel{overflow:visible}
.cfv-volume-panel input[type=range]{-webkit-appearance:none;appearance:none;
  width:96px;height:6px;background:transparent;cursor:pointer;margin:0;
  transform:rotate(-90deg);transform-origin:center center}
/* Reserve the rotated footprint so the panel keeps its size. */
.cfv-volume-panel .cfv-volume-slider-slot{width:6px;height:96px;display:flex;align-items:center;justify-content:center}
.cfv-volume-panel input[type=range]::-webkit-slider-runnable-track{width:100%;height:6px;border-radius:3px;background:#ffffff4d}
.cfv-volume-panel input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;margin-top:-5px;border-radius:50%;background:#fff;border:0}
.cfv-volume-panel input[type=range]::-moz-range-track{width:100%;height:6px;border-radius:3px;background:#ffffff4d}
.cfv-volume-panel input[type=range]::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background:#fff;border:0}
.cfv-volume-panel input[type=range]:focus-visible{outline:2px solid #fff;outline-offset:4px}
.cfv-volume-value{font-size:11px;color:#d8d4cf;font-variant-numeric:tabular-nums;line-height:1}

@media(hover:none){
  /* Touch devices have no hover, so the slider is opened by tapping the button
     instead (see app-side handler). It must stay in the layout, not be force-hidden. */
  .cfv-volume-panel{display:flex}
  .cfv-volume-panel[hidden]{display:none}
  .cfv-volume-panel{padding:12px 8px 10px;border-radius:24px}
  .cfv-volume-panel input[type=range]{width:120px}
}

.cfv-rail{position:absolute;right:16px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:10px;z-index:3}
.cfv-rail-btn{display:flex;flex-direction:column;align-items:center;gap:2px;width:56px;padding:10px 4px;border-radius:12px;background:#ffffff14;color:#fff;text-decoration:none;backdrop-filter:blur(6px);transition:.15s}
.cfv-rail-btn span{font-size:15px;line-height:1}
.cfv-rail-btn small{font-size:10px;color:#d8d4cf;white-space:nowrap}
.cfv-rail-btn:hover{background:#ffffff2b;color:#fff}
.cfv-rail-btn.is-disabled{opacity:.32;cursor:default}

.cfv-hint{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);padding:8px 18px;border-radius:999px;background:#000000cc;color:#fff;font-size:13px;letter-spacing:.04em;z-index:6;transition:opacity .5s;pointer-events:none}
.cfv-hint.is-hidden{opacity:0}

@media(max-width:1100px){
  .cfv-grid-public{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:760px){
  .cfv-library{padding:22px 0 40px}
  .cfv-library-head h1{font-size:27px}
  .cfv-lead{font-size:15px}
  .cfv-filter{gap:8px;margin-bottom:18px;padding-bottom:14px;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
  .cfv-filter::-webkit-scrollbar{display:none}
  .cfv-chip{flex:0 0 auto;font-size:12px;padding:6px 12px}
  .cfv-grid-public{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px}
  .cfv-card-title{font-size:13px}
  .cfv-rail{right:8px;gap:8px}
  .cfv-rail-btn{width:46px;padding:8px 2px}
  .cfv-rail-btn small{font-size:9px}
  .cfv-overlay{padding-bottom:18px}
  .cfv-overlay-head{padding:12px 14px}
  .cfv-overlay-body{padding:0 16px;max-height:56vh}
  .cfv-title{font-size:18px}
  .cfv-intro{font-size:13px}
  .cfv-volume{top:12px;right:12px}
  .cfv-mute{width:38px;height:38px}
}
