/*
Theme Name: Smutto
Theme URI:  https://smutto.com
Author:      Smutto
Author URI:  https://smutto.com
Description: Retro home-video theme for amateur clips. Warm paper background, camcorder REC details, polaroid-style tape cards and a viewfinder player.
Version:     1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License:     GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: smutto
Tags:        video, amateur, retro, grid, custom-menu, featured-images, translation-ready
*/

/* =========================================================================
   00. Tokens
   ========================================================================= */
:root {
  --paper:    #f7f2e7;
  --paper-2:  #efe6d4;
  --card:     #fffdf8;
  --ink:      #17130f;
  --ink-soft: #3b332a;
  --muted:    #7d7263;
  --line:     #ded1b9;
  --red:      #e23a2e;
  --red-dk:   #c02a20;
  --display:  "Archivo Black", "Arial Black", sans-serif;
  --mono:     "Space Mono", ui-monospace, Consolas, monospace;
  --body:     "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max:      1440px;
  --pad:      clamp(16px, 3vw, 34px);
}

/* =========================================================================
   01. Base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(226, 58, 46, .06), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }

.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute; white-space: nowrap;
}
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

/* paper grain */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* =========================================================================
   02. Header
   ========================================================================= */
.top {
  position: sticky; top: 0; z-index: 60;
  background: rgba(247, 242, 231, .92);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--ink);
}
.top-inner {
  max-width: var(--max); margin: 0 auto; padding: 10px var(--pad);
  display: flex; align-items: center; gap: clamp(14px, 3vw, 38px);
  min-height: 70px;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mascot { width: 44px; height: 44px; object-fit: contain; }
.brand-name {
  font-family: var(--display);
  font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: -.02em;
  line-height: 1;
  color: var(--ink);
  text-transform: uppercase;
}
.brand-name em { font-style: normal; color: var(--red); }

.nav { margin-left: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: clamp(10px, 1.8vw, 26px); flex-wrap: wrap; }
.nav a {
  font-family: var(--mono);
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft);
  padding: 7px 2px; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav a:hover, .nav .current-menu-item > a { color: var(--red); border-bottom-color: var(--red); text-decoration: none; }

.search-form { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.search-form input[type="search"] {
  width: clamp(130px, 15vw, 200px);
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 2px;
  padding: 8px 10px;
  font-family: var(--mono); font-size: 11px; color: var(--ink);
}
.search-form input[type="search"]::placeholder { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.search-form input[type="search"]:focus { outline: none; border-color: var(--red); }
.search-form .search-submit,
.search-form button {
  background: var(--ink); color: var(--paper); border: 2px solid var(--ink);
  border-radius: 2px; padding: 8px 12px; cursor: pointer;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  -webkit-appearance: none; appearance: none;
}
.search-form .search-submit:hover,
.search-form button:hover { background: var(--red); border-color: var(--red); }

/* REC bar */
.rec-bar {
  background: var(--ink); color: var(--paper);
  border-bottom: 3px solid var(--red);
}
.rec-inner {
  max-width: var(--max); margin: 0 auto; padding: 8px var(--pad);
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  overflow: hidden;
}
.rec-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 8px var(--red); flex-shrink: 0;
  animation: blink 1.6s steps(1) infinite;
}
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: .15; } }
.rec-label { color: var(--red); font-weight: 700; }
.rec-time { color: var(--paper); opacity: .8; }
.rec-sep { opacity: .35; }
.rec-note { opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-fill { flex: 1; }
.rec-count { color: var(--red); font-weight: 700; white-space: nowrap; }

/* =========================================================================
   03. Masthead
   ========================================================================= */
.masthead {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(26px, 4vw, 52px) var(--pad) 0;
}
.kicker {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: .24em; text-transform: uppercase; color: var(--red);
  margin: 0 0 12px;
}
.masthead h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 6.2vw, 4.6rem);
  line-height: .95;
  letter-spacing: -.035em;
  text-transform: uppercase;
  margin: 0 0 16px;
  max-width: 15ch;
}
.masthead h1 em { font-style: normal; color: var(--red); }
.lede {
  color: var(--ink-soft); font-size: clamp(.95rem, 1.6vw, 1.08rem);
  max-width: 56ch; margin: 0 0 20px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: clamp(20px, 3vw, 34px); border-bottom: 2px solid var(--ink); }
.chip {
  display: inline-block; padding: 7px 12px;
  border: 2px solid var(--ink); border-radius: 2px;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  background: var(--card); color: var(--ink);
  transition: all .16s;
}
.chip:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* =========================================================================
   04. Grid head + cards
   ========================================================================= */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

.grid-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 24px 0 16px;
}
.grid-head h2 {
  font-family: var(--display); font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  text-transform: uppercase; letter-spacing: -.02em; margin: 0;
}
.grid-head h2::before {
  content: "▶"; color: var(--red); font-size: .7em; margin-right: 10px; vertical-align: 2px;
}
.grid-count {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: clamp(14px, 2.2vw, 26px);
  padding-bottom: 10px;
}

.tape {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 9px 9px 12px;
  box-shadow: 0 2px 0 rgba(23,19,15,.07), 0 12px 28px rgba(23,19,15,.07);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tape:hover {
  transform: translateY(-4px) rotate(-.5deg);
  box-shadow: 0 3px 0 rgba(23,19,15,.1), 0 20px 40px rgba(23,19,15,.12);
  border-color: var(--ink);
}

.tape-frame {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 16 / 9; border-radius: 3px; background: #0d0b09;
}
.tape-frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease, filter .3s; filter: saturate(.95) contrast(1.03); }
.tape:hover .tape-frame img { transform: scale(1.05); }

/* scanlines on hover */
.tape-frame::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.22) 0 1px, transparent 1px 3px);
  opacity: 0; transition: opacity .25s;
}
.tape:hover .tape-frame::after { opacity: .5; }

.rec-tag {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--red); color: #fff;
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .14em;
  padding: 3px 7px; border-radius: 2px; text-transform: uppercase;
}
.rec-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }

.dur-tag {
  position: absolute; bottom: 8px; right: 8px; z-index: 3;
  background: rgba(13,11,9,.82); color: #fff;
  font-family: var(--mono); font-size: 10px; letter-spacing: .05em;
  padding: 3px 7px; border-radius: 2px;
}

.tape-body { padding: 11px 4px 0; }
.tape-cat {
  display: block; font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--red);
  margin-bottom: 5px;
}
.tape-title {
  margin: 0; font-family: var(--display);
  font-size: clamp(.85rem, 1.2vw, .98rem);
  line-height: 1.18; letter-spacing: -.01em;
  color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tape:hover .tape-title { color: var(--red-dk); }
.tape-meta {
  margin-top: 7px; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .06em; color: var(--muted); text-transform: uppercase;
}

/* =========================================================================
   05. Pagination
   ========================================================================= */
.pager { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 36px 0 10px; }
.pager .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 10px;
  border: 2px solid var(--ink); border-radius: 2px; background: var(--card);
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--ink);
  transition: all .16s;
}
.pager .page-numbers:hover, .pager .page-numbers.current { background: var(--ink); color: var(--paper); }

/* =========================================================================
   06. Single
   ========================================================================= */
.clip { max-width: var(--max); margin: 0 auto; padding: 22px var(--pad) 0; }

.crumbs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); padding-bottom: 16px;
}
.crumbs a:hover { color: var(--red); }

.viewfinder {
  position: relative;
  background: #0d0b09;
  border: 3px solid var(--ink);
  border-radius: 6px;
  padding: 10px;
  box-shadow: 0 3px 0 rgba(23,19,15,.15), 0 22px 50px rgba(23,19,15,.18);
}
.vf-bar {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--paper); padding: 2px 2px 9px;
}
.vf-rec { display: inline-flex; align-items: center; gap: 6px; color: var(--red); }
.vf-rec::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blink 1.6s steps(1) infinite; }
.vf-fill { flex: 1; }
.vf-tc { color: var(--paper); opacity: .75; }
.viewfinder video { width: 100%; display: block; border-radius: 3px; background: #000; aspect-ratio: 16/9; }

.clip-head { padding: 26px 0 0; }
.clip-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.clip-cats a {
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--red);
  border: 2px solid var(--red); padding: 3px 8px; border-radius: 2px;
}
.clip-cats a:hover { background: var(--red); color: #fff; }
.clip-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.6vw, 3rem);
  line-height: 1.0; letter-spacing: -.03em;
  text-transform: uppercase;
  margin: 0 0 20px; max-width: 24ch;
}

.tape-label {
  display: flex; flex-wrap: wrap;
  border: 2px solid var(--ink); border-radius: 4px;
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 2px 0 rgba(23,19,15,.08);
  margin-bottom: 26px;
}
.tape-label > div {
  padding: 11px 20px; border-right: 2px solid var(--ink);
}
.tape-label > div:last-child { border-right: 0; }
.tape-label dt {
  font-family: var(--mono); font-size: 8.5px; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 3px;
}
.tape-label dd { margin: 0; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--ink); }

.clip-desc { color: var(--ink-soft); font-size: .98rem; line-height: 1.75; max-width: 78ch; }
.clip-desc p { margin: 0 0 1em; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; padding: 18px 0 6px; }
.tags a {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft);
  background: var(--paper-2); border: 1px solid var(--line);
  padding: 5px 9px; border-radius: 2px;
}
.tags a:hover { background: var(--red); border-color: var(--red); color: #fff; }

.rule {
  display: flex; align-items: center; gap: 12px;
  margin: 38px 0 16px;
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}
.rule::after { content: ""; flex: 1; height: 2px; background: var(--ink); }

/* =========================================================================
   07. Pages / 404 / empty
   ========================================================================= */
.page-wrap { max-width: 800px; margin: 0 auto; padding: 36px var(--pad) 80px; }
.page-wrap h1 {
  font-family: var(--display); font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  text-transform: uppercase; letter-spacing: -.025em; line-height: 1.02; margin: 0 0 22px;
}
.entry-content { color: var(--ink-soft); font-size: .98rem; line-height: 1.75; }
.entry-content h2, .entry-content h3 { font-family: var(--display); text-transform: uppercase; letter-spacing: -.01em; margin: 1.9em 0 .5em; }
.entry-content h2 { font-size: 1.25rem; }
.entry-content a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.entry-content code { background: var(--paper-2); border: 1px solid var(--line); padding: 2px 6px; font-family: var(--mono); font-size: .85em; }
.entry-content blockquote { border-left: 4px solid var(--red); margin: 1.4em 0; padding: 2px 0 2px 16px; color: var(--muted); }

.empty { padding: 80px var(--pad); text-align: center; }
.empty h2 { font-family: var(--display); text-transform: uppercase; margin: 0 0 8px; }
.empty p { color: var(--muted); margin: 0 0 22px; }
.btn {
  display: inline-block; background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 13px 20px; border-radius: 2px;
}
.btn:hover { background: var(--red); }

.err { max-width: var(--max); margin: 0 auto; padding: 60px var(--pad) 100px; }
.err-num {
  font-family: var(--display); font-size: clamp(5rem, 16vw, 11rem);
  line-height: .85; margin: 0; color: var(--ink); letter-spacing: -.05em;
}
.err-num span { color: var(--red); }
.err p { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 12px 0 26px; }

/* =========================================================================
   08. Footer
   ========================================================================= */
.footer { border-top: 3px solid var(--ink); margin-top: 56px; background: var(--paper-2); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 36px var(--pad) 46px; }
.footer-mark {
  font-family: var(--display); font-size: clamp(2.4rem, 8vw, 5.4rem);
  line-height: .9; letter-spacing: -.04em; text-transform: uppercase;
  margin: 0 0 26px; color: var(--ink);
}
.footer-mark em { font-style: normal; color: var(--red); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 28px; padding-top: 22px; border-top: 2px solid var(--ink); }
.footer-grid h4 { font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.footer-grid a { color: var(--ink-soft); font-size: .88rem; }
.footer-grid a:hover { color: var(--red); }
.footer-note { color: var(--muted); font-size: .78rem; line-height: 1.7; margin: 0; }
.age-badge {
  display: inline-flex; align-items: center; gap: 7px;
  border: 2px solid var(--ink); background: var(--card);
  padding: 4px 10px; border-radius: 2px;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  margin-top: 14px;
}

/* =========================================================================
   09. Responsive
   ========================================================================= */
@media (max-width: 900px) {
  .top-inner { flex-wrap: wrap; row-gap: 8px; }
  .nav { order: 3; width: 100%; margin-left: 0; }
  .nav ul { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nav ul::-webkit-scrollbar { display: none; }
  .search-form { margin-left: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .search-form { width: 100%; order: 4; }
  .search-form input[type="search"] { width: 100%; }
  .grid { gap: 12px; }
  .tape { padding: 7px 7px 10px; }
  .masthead h1 { font-size: clamp(1.9rem, 11vw, 3rem); }
  .tape-label > div { padding: 9px 14px; }
  .footer-grid { grid-template-columns: 1fr; }
  .rec-note { display: none; }
}

@media (min-width: 1600px) {
  :root { --max: 1580px; }
}
