/* ============================================================
   CookeryBites - Styles
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:      #e8274b;
  --red-dark: #c01f3e;
  --green:    #2d8a4e;
  --bg:       #0f0f0f;
  --bg2:      #1a1a1a;
  --bg3:      #242424;
  --border:   #2e2e2e;
  --text:     #f1f1f1;
  --muted:    #aaaaaa;
  --radius:   12px;
  --shadow:   0 4px 24px rgba(0,0,0,.5);
  --header-h: 64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 8px; border: none;
  font-size: .95rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: all .2s; white-space: nowrap;
}
.btn-primary  { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-ghost    { background: transparent; color: var(--text); border: 2px solid var(--border); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-outline  { background: transparent; color: var(--red); border: 2px solid var(--red); }
.btn-outline:hover { background: var(--red); color: #fff; }
.btn-subscribe{ background: var(--red); color: #fff; padding: 8px 16px; font-size: .85rem; }
.btn-subscribe:hover { background: var(--red-dark); }
.btn-sm       { padding: 7px 14px; font-size: .85rem; }

/* ── Header ── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(15,15,15,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 700; }
.logo-emoji { font-size: 1.5rem; }
.main-nav { display: flex; gap: 24px; margin-right: auto; }
.main-nav a { color: var(--muted); font-weight: 500; transition: color .2s; }
.main-nav a:hover { color: var(--text); }
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }

/* ── Hero ── */
.hero {
  padding: calc(var(--header-h) + 64px) 0 80px;
  background: linear-gradient(160deg, #0d1a10 0%, var(--bg) 65%);
}
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.hero-eyebrow {
  display: inline-block; font-size: .85rem; font-weight: 700;
  color: var(--green); background: rgba(45,138,78,.12);
  padding: 4px 14px; border-radius: 100px; margin-bottom: 16px;
  border: 1px solid rgba(45,138,78,.3);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.15; margin-bottom: 16px; }
.text-accent { color: var(--red); }
.hero p { color: var(--muted); font-size: 1.1rem; margin-bottom: 28px; max-width: 480px; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual { display: flex; justify-content: center; }
.hero-emoji-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  font-size: 3rem; background: var(--bg2);
  padding: 32px; border-radius: var(--radius);
  border: 1px solid var(--border);
}
.hero-emoji-grid span { text-align: center; }

/* ── Section header ── */
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: 2rem; margin-bottom: 8px; }
.section-header p { color: var(--muted); }
.section-eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--red);
  margin-bottom: 10px;
}

/* ── Videos section ── */
.videos-section { padding: 80px 0; }

/* ── Controls ── */
.controls-bar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; min-width: 240px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 1rem; pointer-events: none; }
#searchInput {
  width: 100%; padding: 10px 16px 10px 38px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .95rem; outline: none;
}
#searchInput:focus { border-color: var(--red); }

/* ── Category filters ── */
.category-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filter-btn {
  padding: 6px 16px; border-radius: 100px; border: 1px solid var(--border);
  background: var(--bg2); color: var(--muted); font-size: .85rem; cursor: pointer; transition: all .2s;
}
.filter-btn:hover { border-color: var(--red); color: var(--text); }
.filter-btn.active { background: var(--red); color: #fff; border-color: var(--red); }

/* ── Results count ── */
.results-count { color: var(--muted); font-size: .85rem; margin-bottom: 24px; }

/* ── Featured ── */
.featured-section { margin-bottom: 48px; }
.featured-label { font-size: .85rem; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.video-card--large .card-body { padding: 24px; }
.video-card--large .card-title { font-size: 1.4rem; }
.video-card--large .card-thumb { aspect-ratio: 16/7; }

/* ── Video card ── */
.video-card {
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--red); }
.card-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--bg3); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.video-card:hover .card-thumb img { transform: scale(1.04); }
.card-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.35); opacity: 0; transition: opacity .2s;
}
.video-card:hover .card-overlay { opacity: 1; }
.play-btn {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--red); display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: #fff; padding-left: 4px;
}
.badge-new {
  position: absolute; top: 10px; left: 10px;
  background: var(--red); color: #fff; font-size: .7rem; font-weight: 700;
  padding: 2px 8px; border-radius: 100px; text-transform: uppercase; letter-spacing: .06em;
}
.card-body { padding: 16px; }
.category-tag {
  display: inline-block; font-size: .75rem; font-weight: 600;
  color: var(--red); background: rgba(232,39,75,.1);
  padding: 2px 10px; border-radius: 100px; margin-bottom: 8px;
}
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; line-height: 1.3; }
.card-desc { color: var(--muted); font-size: .85rem; line-height: 1.5; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ── Grid ── */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }

/* ── No results ── */
.no-results { text-align: center; padding: 60px 20px; color: var(--muted); font-size: 1.1rem; }

/* ── Load more ── */
.load-more-wrap { text-align: center; margin-top: 40px; }

/* ── Philosophy section ── */
.philosophy-section {
  padding: 96px 0;
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.philosophy-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start;
}
.philosophy-text p {
  color: var(--muted); margin-bottom: 16px; font-size: 1.05rem; line-height: 1.75;
}
.philosophy-text p strong { color: var(--text); }

/* Quote block */
.philosophy-quote {
  position: relative;
  background: var(--bg3);
  border-left: 4px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 28px 28px 28px 40px;
  margin-bottom: 32px;
}
.quote-mark {
  position: absolute; top: 12px; left: 16px;
  font-size: 3rem; line-height: 1; color: var(--red); font-family: Georgia, serif;
  opacity: .6;
}
.philosophy-quote p {
  font-size: 1.25rem; font-weight: 700; font-style: italic;
  color: var(--text); line-height: 1.5; margin-bottom: 12px;
}
.philosophy-quote cite {
  font-size: .85rem; color: var(--muted); font-style: normal;
}

/* Pledge list */
.pledge-list { display: flex; flex-direction: column; gap: 16px; }
.pledge-item {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  transition: border-color .2s;
}
.pledge-item:hover { border-color: var(--green); }
.pledge-icon { font-size: 1.75rem; flex-shrink: 0; }
.pledge-item strong { display: block; margin-bottom: 4px; }
.pledge-item p { color: var(--muted); font-size: .875rem; margin: 0; }

/* ── About section ── */
.about-section { padding: 80px 0; background: var(--bg2); }
.about-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.about-text h2 { font-size: 2rem; margin-bottom: 16px; }
.about-text p { color: var(--muted); margin-bottom: 12px; }
.about-text .btn { margin-top: 12px; }
.about-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.stat-card {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 16px; text-align: center;
}
.stat-num { display: block; font-size: 2.2rem; font-weight: 800; color: var(--red); margin-bottom: 4px; }
.stat-label { font-size: .85rem; color: var(--muted); }

/* ── Footer ── */
.site-footer { padding: 40px 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.footer-nav a { color: var(--muted); margin: 0 12px; font-size: .9rem; }
.footer-nav a:hover { color: var(--red); }
.copyright { color: var(--muted); font-size: .8rem; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 860px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal-topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 12px;
}
.modal-title { font-size: 1.1rem; font-weight: 700; flex: 1; }
.modal-close-btn { background: none; border: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; padding: 4px; line-height: 1; flex-shrink: 0; }
.modal-close-btn:hover { color: var(--text); }
.modal-embed { aspect-ratio: 16/9; background: #000; }
.modal-embed iframe { width: 100%; height: 100%; border: none; }
.modal-info { padding: 16px 20px; }
.modal-desc { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.modal-actions-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ── Back to top ── */
.back-to-top {
  position: fixed; bottom: 24px; right: 24px; z-index: 50;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--red); color: #fff; border: none;
  font-size: 1.3rem; cursor: pointer; box-shadow: var(--shadow);
  transition: opacity .2s, transform .2s;
}
.back-to-top[hidden] { display: none; }
.back-to-top:hover { transform: translateY(-2px); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero-inner         { grid-template-columns: 1fr; }
  .hero-visual        { display: none; }
  .philosophy-inner   { grid-template-columns: 1fr; gap: 40px; }
  .about-inner        { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 640px) {
  .main-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; background: var(--bg2);
    border-bottom: 1px solid var(--border); padding: 16px 20px; gap: 12px;
  }
  .main-nav.open { display: flex; }
  .hamburger { display: flex; }
  .site-header .btn-subscribe { display: none; }
  .video-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: repeat(2, 1fr); }
}
