/*
Theme Name: CaughtTapes
Theme URI: https://caughttapes.com
Description: Viral video theme for CaughtTapes: daily video feed, video pages with next videos, trending, ad slots and video submissions.
Version: 1.3.0
Author: CaughtTapes
Text Domain: caughttapes
*/

@font-face { font-family: "Anton"; src: url("assets/fonts/Anton-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Barlow Condensed"; font-weight: 900; src: url("assets/fonts/BarlowCondensed-Black.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #0b0b0d; --bg2: #141418; --bg3: #1d1d23; --line: #2a2a32;
  --text: #f3f3f5; --muted: #9a9aa6; --yel: #ffd400; --red: #e5162b;
  --head: "Anton", Impact, "Arial Narrow", sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --r: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); }
a { color: inherit; text-decoration: none; }
img, video, iframe { display: block; max-width: 100%; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.sr { position: absolute; left: -9999px; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 50; background: rgba(11,11,13,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 20px; height: 68px; }
.logo img { height: 40px; width: auto; }
.search { flex: 1; max-width: 420px; margin-left: auto; }
.search input { width: 100%; background: var(--bg3); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 10px 18px; font-size: 14px; outline: none; }
.search input:focus { border-color: var(--yel); }
.btn-submit { display: inline-flex; align-items: center; gap: 8px; background: var(--yel); color: #000; font: 18px/1 var(--cond); font-weight: 900; text-transform: uppercase; letter-spacing: .04em; padding: 11px 18px; border-radius: 999px; white-space: nowrap; transition: transform .15s; }
.btn-submit:hover { transform: translateY(-1px); }
.btn-submit .dot, .rec { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(229,22,43,.25); animation: rec 1.4s infinite; }
@keyframes rec { 50% { opacity: .35; } }
.cats { border-top: 1px solid var(--line); }
.cats .wrap { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-top: 8px; padding-bottom: 8px; }
.cats .wrap::-webkit-scrollbar { display: none; }
.cats a { font: 17px/1 var(--cond); font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
.cats a:hover { color: var(--text); background: var(--bg3); }
.cats a.on { color: #000; background: var(--yel); }

.site-main { padding: 24px 0 60px; min-height: 60vh; }

/* Cards */
.card { min-width: 0; }
.thumb { position: relative; display: block; aspect-ratio: 16/9; border-radius: var(--r); overflow: hidden; background: var(--bg3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.thumb .ph { position: absolute; inset: 0; background: linear-gradient(135deg, #1d1d23, #101014); }
.card:hover .thumb img { transform: scale(1.05); }
.play { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(0,0,0,.55); border: 2px solid rgba(255,255,255,.85); opacity: 0; transition: opacity .2s; }
.play::after { content: ""; position: absolute; left: 21px; top: 15px; border-left: 16px solid #fff; border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.card:hover .play { opacity: 1; }
.dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.8); color: #fff; font: 12px/1 var(--body); font-weight: 700; padding: 4px 6px; border-radius: 4px; }
.new { position: absolute; left: 8px; top: 8px; background: var(--red); color: #fff; font: 13px/1 var(--cond); font-weight: 900; letter-spacing: .06em; padding: 4px 7px; border-radius: 4px; }
.title { margin: 10px 0 4px; font-size: 15px; line-height: 1.35; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.title a:hover { color: var(--yel); }
.hook { display: inline; color: var(--yel); font-family: var(--head); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; margin-right: 6px; }
.meta { display: flex; gap: 12px; color: var(--muted); font-size: 13px; }
.eye::before { content: ""; display: inline-block; width: 14px; height: 9px; margin-right: 5px; border: 2px solid currentColor; border-radius: 50% / 60%; vertical-align: 0; box-sizing: border-box; }

/* Home hero */
.hero { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 18px; margin-bottom: 34px; }
.hero .big { grid-row: span 2; }
.hero:has(.card:only-child) { grid-template-columns: 1fr; grid-template-rows: auto; max-width: 900px; }
.hero .big .title { font-size: 26px; -webkit-line-clamp: 3; margin-top: 14px; }
.hero .side .title { font-size: 16px; }
.hero .big .play { opacity: 1; width: 76px; height: 76px; margin: -38px 0 0 -38px; }
.hero .big .play::after { left: 29px; top: 21px; border-left-width: 22px; border-top-width: 14px; border-bottom-width: 14px; }

/* Day sections */
.day { margin-bottom: 34px; }
.day-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--line); margin-bottom: 18px; padding-bottom: 8px; }
.day-head h2 { margin: 0; font: 32px/1 var(--head); font-weight: 400; letter-spacing: .02em; }
.day-head h2::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--red); margin-right: 10px; vertical-align: 6px; }
.day-head span { color: var(--muted); font: 16px var(--cond); font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px 18px; }
.page-title { font: 40px/1.1 var(--head); font-weight: 400; margin: 0 0 22px; letter-spacing: .01em; }

.pager { display: flex; justify-content: center; gap: 12px; margin-top: 10px; }
.pager a, .btn { display: inline-block; background: var(--bg3); border: 1px solid var(--line); color: var(--text); font: 18px/1 var(--cond); font-weight: 900; text-transform: uppercase; letter-spacing: .05em; padding: 14px 26px; border-radius: 999px; cursor: pointer; }
.pager a:hover, .btn:hover { border-color: var(--yel); color: var(--yel); }

/* Single */
.vid-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 30px; }
.player { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--r); overflow: hidden; }
.player video, .player iframe, .player img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; background: #000; }
.vid-head { padding: 18px 0 8px; border-bottom: 1px solid var(--line); }
.cat-pill { display: inline-block; background: var(--red); color: #fff; font: 14px/1 var(--cond); font-weight: 900; text-transform: uppercase; letter-spacing: .06em; padding: 6px 10px; border-radius: 4px; }
.vid-head h1 { font-size: 28px; line-height: 1.25; margin: 12px 0 10px; }
.vid-head h1 .hook { display: block; font-size: 40px; line-height: 1.05; margin-bottom: 6px; }
.vid-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 14px; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 10px; }
.share a, .share button { margin: 0; box-sizing: border-box; display: inline-flex; align-items: center; height: 38px; font: 15px/1 var(--cond); font-weight: 900; text-transform: uppercase; letter-spacing: .05em; padding: 10px 16px; border-radius: 999px; border: 0; cursor: pointer; color: #fff; }
.share .fb { background: #1877f2; } .share .x { background: #000; border: 1px solid #333; } .share .wa { background: #25d366; color: #000; } .share .copy { background: var(--bg3); }
.content { font-size: 16px; line-height: 1.7; color: #d8d8de; padding: 16px 0; }
.content a { color: var(--yel); }
.next { margin-top: 20px; }
.next .grid { grid-template-columns: repeat(3, 1fr); }
.side-col { min-width: 0; }
.trend { position: sticky; top: 130px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.trend h2 { margin: 0 0 12px; font: 26px/1 var(--head); font-weight: 400; }
.trend h2::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--red); margin-right: 8px; vertical-align: 4px; }
.trend-item { display: grid; grid-template-columns: 22px 110px 1fr; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.trend-item .rank { font: 24px/1 var(--head); color: var(--yel); }
.t-thumb { position: relative; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: var(--bg3); }
.t-thumb img { width: 100%; height: 100%; object-fit: cover; }
.t-title { font-size: 13px; line-height: 1.3; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.t-title b { color: var(--yel); font-family: var(--head); font-weight: 400; text-transform: uppercase; }
.trend-item:hover .t-title { color: var(--yel); }

/* Ads */
.ad { margin: 18px auto; text-align: center; }
.ad-slot { display: flex; justify-content: center; }

/* Pages & submit */
.pg .content h2 { font-family: var(--head); font-weight: 400; }
.lead { font-size: 18px; color: #c9c9d1; }
.submit .page-title { display: flex; align-items: center; gap: 14px; }
.submit .rec { width: 16px; height: 16px; }
.sub-form { display: grid; gap: 16px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; margin-top: 20px; }
.sub-form label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.sub-form small { color: var(--muted); font-weight: 400; }
.sub-form input[type=text], .sub-form input[type=email], .sub-form input[type=url], .sub-form textarea { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 12px 14px; font: 15px var(--body); }
.sub-form input:focus, .sub-form textarea:focus { outline: none; border-color: var(--yel); }
.sub-form .chk { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: #c9c9d1; }
.sub-form .chk input { margin-top: 4px; accent-color: var(--yel); }
.sub-form .btn { background: var(--yel); color: #000; border: 0; justify-self: start; }
.hp { position: absolute; left: -9999px; }
.note { padding: 14px 16px; border-radius: 8px; margin-top: 16px; font-weight: 600; }
.note.ok { background: rgba(255,212,0,.12); border: 1px solid var(--yel); }
.note.err { background: rgba(229,22,43,.12); border: 1px solid var(--red); }
.empty { text-align: center; padding: 80px 0; }
.empty h1 { font: 44px/1.1 var(--head); font-weight: 400; }
.empty a { color: var(--yel); }

/* Footer */
.site-foot { border-top: 1px solid var(--line); background: var(--bg2); padding: 34px 0 20px; }
.foot-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.site-foot .tag { color: var(--muted); margin: 10px 0 0; font: 17px var(--cond); font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links a { color: var(--muted); font-weight: 600; }
.foot-links a:hover { color: var(--yel); }
.copyright { color: #666; font-size: 13px; margin-top: 24px; }

/* Responsive */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .vid-layout { grid-template-columns: 1fr; }
  .trend { position: static; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 14px; }
  .head-row { height: 58px; gap: 10px; }
  .logo img { height: 30px; }
  .search { display: none; }
  .btn-submit { margin-left: auto; font-size: 15px; padding: 9px 13px; }
  .hero { grid-template-columns: 1fr; grid-template-rows: none; gap: 20px; }
  .hero .big { grid-row: auto; }
  .hero .big .title { font-size: 21px; }
  .grid, .next .grid { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
  .title { font-size: 14px; }
  .day-head h2 { font-size: 26px; }
  .vid-head h1 { font-size: 21px; }
  .vid-head h1 .hook { font-size: 30px; }
}
@media (max-width: 420px) {
  .grid, .next .grid { grid-template-columns: 1fr; }
}

/* ===== v1.1: trending row, discover, reactions, comments, up next, mini player ===== */
.cats a.hot { color: #ff6b3d; }
.cats a.hot.on { color: #000; }
.trend-row { margin: -6px 0 34px; }
.trend-row .day-head .more { margin-left: auto; color: var(--yel); font: 16px var(--cond); font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
.row-scroll .tr-card { position: relative; scroll-snap-align: start; }
.row-scroll .tr-rank { position: absolute; z-index: 2; left: -4px; top: -10px; font: 52px/1 var(--head); color: var(--yel); -webkit-text-stroke: 2px #000; text-shadow: 0 3px 8px rgba(0,0,0,.6); pointer-events: none; }
.cmt::before { content: ""; display: inline-block; width: 12px; height: 9px; margin-right: 5px; border: 2px solid currentColor; border-radius: 3px; vertical-align: 0; box-sizing: border-box; }
.cat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cat-tile { display: flex; flex-direction: column; justify-content: flex-end; min-height: 120px; padding: 16px; border-radius: var(--r); background: linear-gradient(135deg, #1d1d23, #2a1215); border: 1px solid var(--line); }
.cat-tile span { font: 30px/1 var(--head); }
.cat-tile small { color: var(--muted); margin-top: 6px; }
.cat-tile:hover { border-color: var(--yel); }
.cat-tile:hover span { color: var(--yel); }

.reacts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 0 4px; }
.r-label { color: var(--muted); font: 16px var(--cond); font-weight: 900; text-transform: uppercase; letter-spacing: .05em; margin-right: 4px; }
.react { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border-radius: 999px; background: var(--bg3); border: 1px solid var(--line); color: var(--text); cursor: pointer; font-weight: 700; }
.react .e { font-size: 22px; line-height: 1; }
.react:hover { border-color: var(--yel); }
.react.on { background: rgba(255,212,0,.14); border-color: var(--yel); }
.react.pop .e { animation: pop .4s ease; }
@keyframes pop { 50% { transform: scale(1.5); } }

.comments { margin-top: 26px; }
.comments .day-head span { color: var(--muted); font-size: 22px; margin-left: 6px; }
.c-list { list-style: none; margin: 0 0 20px; padding: 0; }
.c-list .comment { padding: 14px 0; border-bottom: 1px solid var(--line); }
.c-list .children { list-style: none; padding-left: 28px; }
.c-list .comment-author { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.c-list .comment-author img { border-radius: 50%; }
.c-list .says { display: none; }
.c-list .comment-meta { font-size: 12px; color: var(--muted); margin: 2px 0 6px 46px; }
.c-list .comment-meta a { color: var(--muted); }
.c-list .comment-content { margin-left: 46px; color: #d8d8de; }
.c-list .reply a { margin-left: 46px; font-size: 13px; color: var(--yel); }
.c-empty { color: var(--muted); }
.comment-respond { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.comment-reply-title { font: 26px var(--head); font-weight: 400; margin: 0 0 12px; }
.comment-respond textarea, .comment-respond input[type=text], .comment-respond input[type=email] { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 12px; font: 15px var(--body); }
.comment-respond textarea:focus, .comment-respond input:focus { outline: none; border-color: var(--yel); }
.comment-respond label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.comment-form-author, .comment-form-email { display: inline-block; width: calc(50% - 6px); vertical-align: top; }
.comment-form-author { margin-right: 8px; }
.comment-respond .submit { background: var(--yel); color: #000; border: 0; border-radius: 999px; padding: 12px 24px; font: 18px var(--cond); font-weight: 900; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; }

.upnext { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.78); }
.upnext[hidden] { display: none; }
.un-box { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 80%; text-align: center; }
.un-label { font: 22px var(--cond); font-weight: 900; letter-spacing: .08em; color: var(--muted); }
.un-label b { color: var(--yel); }
.un-title { font: 28px/1.15 var(--head); }
.un-btns { display: flex; gap: 10px; margin-top: 6px; }
.un-go { background: var(--yel); color: #000; border-radius: 999px; padding: 10px 22px; font: 18px var(--cond); font-weight: 900; text-transform: uppercase; }
.un-cancel { background: transparent; color: var(--text); border: 1px solid #555; border-radius: 999px; padding: 10px 22px; cursor: pointer; font: 18px var(--cond); font-weight: 900; text-transform: uppercase; }
.player-wrap { position: relative; }
.mini-close { display: none; }
.player.mini { position: fixed; right: 20px; bottom: 20px; width: 400px; z-index: 60; box-shadow: 0 12px 40px rgba(0,0,0,.6); border: 2px solid var(--yel); }
.player.mini .mini-close { display: block; position: absolute; top: -14px; right: -14px; z-index: 6; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--yel); color: #000; font-size: 20px; line-height: 1; cursor: pointer; }
.pager.loading::after { content: "Loading more videos..."; color: var(--muted); }

@media (max-width: 1100px) { .cat-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .row-scroll { grid-auto-columns: 70%; }
  .comment-form-author, .comment-form-email { display: block; width: 100%; margin: 0; }
  .un-title { font-size: 20px; }
}

/* ===== v1.2: ad slots ===== */
.ad { display: flex; flex-direction: column; align-items: center; margin: 18px auto; }
.ad-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #6b6b75; margin-bottom: 4px; }
.ad-top { min-height: 50px; margin: 12px auto 0; }
.ad-frame { display: block; border: 0; max-width: 100%; }
.ad-native { align-items: stretch; margin: 14px 0; }
.ad-native > div { width: 100%; }
.side-col .ad-box { margin-top: 0; margin-bottom: 18px; }

/* ===== v1.2.2: pre-roll ad ===== */
.preroll { position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: radial-gradient(circle at 50% 40%, #1b1b20, #000 75%); }
.pre-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #8a8a95; }
.pre-ad { width: 300px; min-height: 250px; display: flex; justify-content: center; }
.player .pre-ad iframe { position: static; inset: auto; width: 300px; height: 250px; max-width: 100%; }
.pre-skip { position: absolute; right: 14px; bottom: 14px; background: rgba(0,0,0,.75); color: #ddd; border: 1px solid #555; border-radius: 6px; padding: 10px 16px; font: 17px/1 var(--cond); font-weight: 900; text-transform: uppercase; letter-spacing: .05em; cursor: default; }
.pre-skip b { color: var(--yel); }
.pre-skip.ready { background: var(--yel); color: #000; border-color: var(--yel); cursor: pointer; animation: preGlow 1.2s infinite; }
@keyframes preGlow { 0%,100% { box-shadow: 0 0 0 0 rgba(255,212,0,.55); } 50% { box-shadow: 0 0 0 8px rgba(255,212,0,0); } }
@media (max-width: 600px) {
  .player.pre-on { aspect-ratio: auto; height: 370px; }
  .pre-skip { position: static; margin-top: 4px; }
}

/* ===== v1.3: sticky mobile ad ===== */
.ad-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: flex; justify-content: center; align-items: center; min-height: 54px; padding-top: 2px; background: rgba(11,11,13,.96); border-top: 1px solid #222; }
.ad-sticky-x { position: absolute; right: 6px; top: -22px; width: 26px; height: 22px; border: 0; border-radius: 6px 6px 0 0; background: rgba(11,11,13,.96); color: #aaa; font-size: 18px; line-height: 1; cursor: pointer; }
@media (min-width: 760px) { .ad-sticky { display: none; } }
@media (max-width: 759px) { body { padding-bottom: 56px; } }
