/*
Theme Name: Crrafty
Theme URI: https://crrafty.services
Author: Crrafty
Description: One-page theme for Crrafty AI video ads: premium hero, WhatsApp / Zoom call / Fiverr buttons, 7 categories and 50 video styles with a filterable 9:16 video gallery managed from Ad Videos, a how-it-works section and social links.
Version: 3.2.1
Requires at least: 5.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: crrafty
*/

:root {
  --bg:          #0d1b2a;
  --bg-elev:     #142b40;
  --accent:      #ff6000;
  --accent-soft: rgba(255, 96, 0, 0.16);
  --ink:         #f4f7fb;
  --muted:       #93a8be;
  --line:        rgba(244, 247, 251, 0.10);
  --glass:       rgba(244, 247, 251, 0.045);
  --font-sans:    'Inter', system-ui, sans-serif;
  --font-display: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --font-serif:   'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-mono:    'IBM Plex Mono', monospace;
  --container: 72rem;
  --px: 1.5rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul, ol { list-style: none; }
button { cursor: pointer; font: inherit; background: none; border: none; color: inherit; }
.crrafty-display { font-family: var(--font-display); }
.crrafty-mono { font-family: var(--font-mono); }
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--px); }
.crrafty-section { position: relative; z-index: 1; scroll-margin-top: 4.5rem; }
.screen-reader-text { position: absolute; left: -9999px; }

/* Ambient glow */
.crrafty-ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.crrafty-ambient::before, .crrafty-ambient::after { content: ""; position: absolute; border-radius: 50%; filter: blur(90px); }
.crrafty-ambient::before { width: 520px; height: 520px; background: var(--accent); top: -180px; right: -160px; opacity: 0.18; }
.crrafty-ambient::after  { width: 600px; height: 600px; background: #1f4d73; bottom: -240px; left: -200px; opacity: 0.35; }

/* Small label: a line, then spaced capitals */
.crrafty-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}
.crrafty-eyebrow::before { content: ""; width: 1.6rem; height: 1px; background: var(--accent); flex: none; }

.crrafty-surface {
  background: var(--glass);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(20px);
          backdrop-filter: blur(20px);
  border-radius: 24px;
}

/* Buttons */
.crrafty-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.85rem 1.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  border: none;
  font-family: var(--font-sans);
}
.crrafty-btn-primary { background: var(--accent); color: #0d1b2a; box-shadow: 0 12px 30px -10px rgba(255, 96, 0, 0.55); }
.crrafty-btn-primary:hover, .crrafty-btn-primary:focus-visible { transform: translateY(-2px); box-shadow: 0 16px 36px -8px rgba(255, 96, 0, 0.70); }
.crrafty-btn-outline { border: 1px solid var(--line); color: var(--ink); background: rgba(244, 247, 251, 0.02); }
.crrafty-btn-outline:hover, .crrafty-btn-outline:focus-visible { border-color: rgba(255, 96, 0, 0.5); transform: translateY(-2px); }
.crrafty-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Navigation */
.crrafty-nav {
  position: sticky; top: 0; z-index: 50;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  background: rgba(13, 27, 42, 0.70);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 0.85rem; gap: 1rem; }
.nav-brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; flex-shrink: 0; }
.nav-logo-img { width: 34px; height: 34px; border-radius: 6px; object-fit: contain; }
.nav-brand-text { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.nav-links { display: none; align-items: center; gap: 2rem; }
.crrafty-navlink { color: var(--muted); font-size: 0.85rem; font-weight: 500; text-decoration: none; transition: color 0.2s ease; }
.crrafty-navlink:hover, .crrafty-navlink:focus-visible { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 0.6rem; }
.nav-actions .crrafty-btn { padding: 0.6rem 1.1rem; }
.nav-book { display: none; }

/* Hero */
.hero-wrap { padding-top: 3.5rem; padding-bottom: 2.5rem; }
.crrafty-hero-card { --mx: 50%; --my: 30%; position: relative; }
.crrafty-hero-card::before {
  content: ""; position: absolute; inset: -3rem -1.5rem;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(255, 96, 0, 0.10), transparent 70%);
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; gap: 2.5rem; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 1.6rem; align-items: flex-start; }
.hero-h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.7rem, 6.4vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.hero-accent, .section-h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.hero-accent { font-size: 1.08em; }
.hero-sub { font-size: 1.05rem; line-height: 1.7; color: var(--muted); max-width: 36rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; padding-top: 0.25rem; }
.hero-trust { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.02em; }
.hero-trust b { color: var(--accent); font-weight: 500; }

.hero-reels { display: none; position: relative; height: 440px; }
.hero-reel {
  position: absolute; top: 50%; left: 50%;
  width: 44%; aspect-ratio: 9 / 16;
  border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--bg-elev) 0%, #0c1822 100%);
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.7);
}
.hero-reel img, .hero-reel video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-reel:nth-child(1) { transform: translate(-102%, -46%) rotate(-7deg); }
.hero-reel:nth-child(2) { transform: translate(-50%, -50%); z-index: 2; }
.hero-reel:nth-child(3) { transform: translate(2%, -46%) rotate(7deg); }

/* Sections */
.section-wrap { padding-block: 4rem; }
.section-head { max-width: 44rem; margin-bottom: 2rem; display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.section-h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.section-h2 em { font-size: 1.08em; }
.section-sub { font-size: 1rem; color: var(--muted); line-height: 1.65; }
.section-divider { border-top: 1px solid var(--line); }

/* How it works */
.process-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; counter-reset: step; }
.process-step {
  padding: 1.6rem 1.5rem 1.7rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--glass);
  display: flex; flex-direction: column; gap: 0.6rem;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.process-step:hover { border-color: rgba(255, 96, 0, 0.45); transform: translateY(-3px); }
.process-num { font-family: var(--font-serif); font-style: italic; font-size: 2.8rem; line-height: 1; color: var(--accent); }
.process-step h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.process-step p { font-size: 0.95rem; color: var(--muted); line-height: 1.65; }

/* Closing call to action */
.cta-card { padding: 3rem 1.5rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.cta-card .section-h2 { max-width: 34rem; }
.cta-card .section-sub { max-width: 34rem; }
.cta-card .hero-ctas { justify-content: center; }

/* Social icons */
.social-links { display: flex; gap: 0.6rem; }
.social-links--center { justify-content: center; padding-top: 0.5rem; }
.social-link {
  width: 2.6rem; height: 2.6rem; border-radius: 999px;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.social-link:hover, .social-link:focus-visible { color: var(--ink); border-color: rgba(255, 96, 0, 0.6); transform: translateY(-2px); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 1.75rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.75rem; color: var(--muted); }

/* Floating WhatsApp */
.wa-float {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 60;
  width: 3.4rem; height: 3.4rem; border-radius: 999px;
  background: #25d366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px -8px rgba(37, 211, 102, 0.55);
  transition: transform 0.2s ease;
}
.wa-float:hover { transform: scale(1.08); }

@media (max-width: 639px) {
  .hero-ctas .crrafty-btn { width: 100%; justify-content: center; }
}
@media (min-width: 640px) {
  .nav-book { display: inline-flex; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-card { padding: 4rem 2.5rem; }
}
@media (min-width: 900px) {
  .nav-links { display: flex; }
  .hero-wrap { padding-top: 4.5rem; padding-bottom: 3rem; }
  .hero-grid { grid-template-columns: 1.3fr 0.7fr; gap: 2rem; }
  .hero-grid.no-reels { grid-template-columns: 1fr; }
  .hero-reels { display: block; }
  .process-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ================================================================
   Video gallery (vg-*)
   ================================================================ */
.vg-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.vg-filters {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}
.vg-filters::-webkit-scrollbar { display: none; }
.vg-chip {
  flex: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.vg-chip:hover { color: var(--ink); border-color: rgba(244, 247, 251, 0.25); }
.vg-chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #0d1b2a;
}
.vg-chip:focus-visible,
.vg-card:focus-visible,
.vg-lightbox button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.vg-count { color: var(--muted); font-size: 0.75rem; }

.vg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.vg-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 0;
  text-align: left;
  color: var(--ink);
  background:
    radial-gradient(120% 100% at 15% 0%, rgba(255, 96, 0, 0.20), transparent 55%),
    linear-gradient(160deg, var(--bg-elev) 0%, #0c1822 100%);
  transition: border-color 0.25s ease;
}
button.vg-card:hover { border-color: rgba(255, 96, 0, 0.55); }
.vg-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vg-thumb:not([src]) { visibility: hidden; }
.vg-card::after {            /* readable caption over any thumbnail */
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to top, rgba(7, 14, 22, 0.88), transparent);
  pointer-events: none;
}
.vg-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3rem;
  height: 3rem;
  margin: -1.5rem 0 0 -1.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: #0d1b2a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2px;
  box-shadow: 0 10px 28px -8px rgba(255, 96, 0, 0.70);
  transition: transform 0.2s ease;
  z-index: 1;
}
button.vg-card:hover .vg-play { transform: scale(1.1); }
.vg-cap {
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.8rem;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.vg-title { font-family: var(--font-display); font-size: 0.98rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.vg-niche { font-size: 0.75rem; color: var(--muted); }

.vg-card.is-empty { border-style: dashed; }
.vg-card.is-empty .vg-title { color: var(--muted); font-weight: 500; }

.vg-more { display: flex; justify-content: center; margin-top: 2rem; }
.vg-more[hidden] { display: none; }

.vg-cta {
  margin-top: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}
.vg-cta-text { font-size: 1.25rem; font-weight: 600; }

/* Lightbox */
body.vg-lock { overflow: hidden; }
.vg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(5, 10, 16, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
}
.vg-lightbox[hidden] { display: none; }
.vg-lightbox-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  height: 100%;
  padding: 3.5rem 0.75rem 1.5rem;
}
.vg-lb-frame {
  position: relative;
  height: 100%;
  max-height: 880px;
  aspect-ratio: 9 / 16;
  max-width: calc(100% - 6rem);
}
.vg-lb-frame iframe,
.vg-lb-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 14px;
  background: #000;
}
.vg-lb-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.10);
}
.vg-lb-nav {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.10);
}
.vg-lb-nav[hidden] { display: none; }
.vg-lb-close:hover, .vg-lb-nav:hover { background: rgba(255, 255, 255, 0.22); }

@media (min-width: 640px) {
  .vg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .vg-toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
}
@media (min-width: 900px) {
  .vg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .vg-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 479px) {
  .vg-lb-nav { display: none; }
  .vg-lb-frame { max-width: 100%; }
}

.vg-lb-frame iframe[hidden],
.vg-lb-frame video[hidden] { display: none; }

/* WordPress extras */
.vg-card[hidden] { display: none; }
body.admin-bar .crrafty-nav { top: 32px; }
@media (max-width: 782px) { body.admin-bar .crrafty-nav { top: 46px; } }

/* Category + format panel */
.vg-panel { padding: 1.15rem 1.25rem; display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 1rem; border-radius: 22px; }
.vg-row { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.vg-row-label { flex: none; width: 5.4rem; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em; }
.vg-chips {
  display: flex; gap: 0.5rem; min-width: 0; flex: 1;
  overflow-x: auto; scrollbar-width: none; padding: 0.2rem 1.5rem 0.2rem 0.1rem;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
}
.vg-chips::-webkit-scrollbar { display: none; }
.vg-chip { white-space: nowrap; }
.vg-chip[hidden] { display: none; }
.vg-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.25rem; }
.vg-cat-note { color: var(--muted); font-size: 0.9rem; }
.vg-empty { padding: 2.5rem 1.5rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }
.vg-empty[hidden] { display: none; }
.vg-empty-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
@media (max-width: 639px) {
  .vg-row { flex-direction: column; align-items: stretch; gap: 0.4rem; }
  .vg-chips { width: 100%; flex: none; }
  .vg-panel { overflow: hidden; }
}
