/*
Theme Name: MyTrivia
Theme URI: https://mytrivia.online
Author: David Friend
Description: Clean, modern theme for MyTrivia.online. Navy and gold look, "Tonight" registration bar, and a full-screen TV template. Built to sit alongside the MyTrivia game plugin ([mytrivia_signup], [mytrivia_host], [mytrivia_display], [mytrivia_suggest]).
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: mytrivia
*/

:root {
  --mt-navy: #0E1330;
  --mt-gold: #FFB020;
  --mt-blue: #2A47E0;
  --mt-blue-hover: #1A2FA8;
  --mt-bg: #F6F7FB;
  --mt-surface: #FFFFFF;
  --mt-surface-soft: #F3F5FB;
  --mt-border: #E3E6F0;
  --mt-input-border: #C9CEDE;
  --mt-text: #0E1330;
  --mt-text-body: #3A4160;
  --mt-text-muted: #545B78;
  --mt-text-on-dark: #C9CEE6;
  --mt-correct-bg: #E3F7EC;
  --mt-correct-border: #1E9E5A;
  --mt-correct-text: #0B5D33;
  --mt-wrong-bg: #FDECEC;
  --mt-wrong-border: #D64545;
  --mt-wrong-text: #8A1C1C;
  --mt-font-display: 'Space Grotesk', system-ui, sans-serif;
  --mt-font-body: 'Inter', system-ui, sans-serif;
  --mt-radius-pill: 999px;
  --mt-radius-card: 18px;
  --mt-radius-panel: 28px;
  --mt-radius-control: 12px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--mt-bg);
  color: var(--mt-text);
  font-family: var(--mt-font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--mt-blue); }
a:hover { color: var(--mt-blue-hover); }
h1, h2, h3, h4 { font-family: var(--mt-font-display); font-weight: 700; line-height: 1.15; }
:focus-visible { outline: 3px solid var(--mt-blue); outline-offset: 2px; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
  clip: auto; width: auto; height: auto; z-index: 1000; top: 8px; left: 8px;
  background: #fff; color: var(--mt-navy); padding: 12px 16px; border-radius: 8px;
}

.mt-wrap { max-width: 1180px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* ---------- Buttons ---------- */
.mt-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 14px 26px; border-radius: var(--mt-radius-pill);
  font-family: var(--mt-font-body); font-weight: 600; font-size: 16px; line-height: 1.2;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
}
.mt-btn--accent { background: var(--mt-gold); color: var(--mt-navy); }
.mt-btn--accent:hover { color: var(--mt-navy); filter: brightness(1.05); }
.mt-btn--dark { background: var(--mt-navy); color: #fff; }
.mt-btn--dark:hover { color: #fff; background: #1b2350; }
.mt-btn--light { background: #fff; color: var(--mt-navy); }
.mt-btn--light:hover { color: var(--mt-navy); }
.mt-btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.3); }
.mt-btn--ghost:hover { color: #fff; border-color: #fff; }

/* ---------- Tonight bar ---------- */
.mt-bar { background: var(--mt-gold); color: var(--mt-navy); }
.mt-bar[hidden] { display: none; }
.mt-bar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding-top: 18px; padding-bottom: 18px; }
.mt-bar__tag {
  display: inline-flex; align-items: center; gap: 10px; background: var(--mt-navy); color: #fff;
  font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 8px 14px; border-radius: var(--mt-radius-pill);
}
.mt-bar__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mt-gold); animation: mtPulse 1.6s infinite; }
@keyframes mtPulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.6); }
  70% { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
@media (prefers-reduced-motion: reduce) { .mt-bar__dot { animation: none; } html { scroll-behavior: auto; } }
.mt-bar__text { flex: 1 1 320px; min-width: 0; }
.mt-bar__title { margin: 0; font-family: var(--mt-font-display); font-weight: 700; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.15; }
.mt-bar__meta { margin: 4px 0 0; font-size: 15px; font-weight: 500; }
.mt-bar__actions { display: flex; align-items: center; gap: 10px; }
.mt-bar__close {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(14,19,48,0.35);
  background: transparent; color: var(--mt-navy); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Header ---------- */
.mt-header { background: var(--mt-navy); color: #fff; }
.mt-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.mt-logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.mt-logo:hover { color: #fff; }
.mt-logo__mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--mt-gold); color: var(--mt-navy);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mt-font-display); font-weight: 700; font-size: 20px;
}
.mt-logo__text { font-family: var(--mt-font-display); font-weight: 700; font-size: 20px; }
.mt-logo__text span { color: var(--mt-gold); }
.mt-logo img { max-height: 40px; width: auto; }
.mt-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.mt-nav a { color: var(--mt-text-on-dark); text-decoration: none; font-size: 15px; }
.mt-nav a:hover, .mt-nav .current-menu-item > a { color: #fff; }
.mt-nav .mt-nav__cta a, .mt-nav__cta-link {
  background: #fff; color: var(--mt-navy); font-weight: 600; padding: 11px 18px; border-radius: var(--mt-radius-pill);
  display: inline-flex; min-height: 44px; align-items: center;
}
.mt-nav .mt-nav__cta a:hover { color: var(--mt-navy); }

/* ---------- Hero ---------- */
.mt-hero { background: var(--mt-navy); color: #fff; padding: 56px 0 96px; }
.mt-hero__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; }
.mt-hero__copy { flex: 1 1 460px; min-width: 0; }
.mt-pill-dark {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.08);
  border-radius: var(--mt-radius-pill); padding: 8px 14px; font-size: 14px; color: #DDE1F2;
}
.mt-pill-dark::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mt-gold); }
.mt-hero h1 { font-size: clamp(40px, 6vw, 68px); line-height: 1.02; letter-spacing: -0.02em; margin: 22px 0 20px; }
.mt-hero h1 em { font-style: normal; color: var(--mt-gold); }
.mt-hero__sub { font-size: 19px; color: var(--mt-text-on-dark); margin: 0 0 32px; max-width: 520px; }
.mt-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Sample question card */
.mt-qcard {
  flex: 1 1 380px; min-width: 0; max-width: 460px; background: #fff; color: var(--mt-navy);
  border-radius: 20px; padding: 28px; box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}
.mt-qcard__top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mt-text-muted); }
.mt-qcard__q { font-family: var(--mt-font-display); font-weight: 700; font-size: 24px; line-height: 1.25; margin: 16px 0 22px; }
.mt-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 380px) { .mt-answers { grid-template-columns: 1fr; } }
.mt-answer {
  font-family: var(--mt-font-body); font-size: 16px; font-weight: 600; text-align: left;
  padding: 14px 16px; min-height: 50px; border-radius: var(--mt-radius-control); cursor: pointer;
  background: var(--mt-surface-soft); color: var(--mt-navy); border: 1px solid var(--mt-border);
}
.mt-answer.is-correct { background: var(--mt-correct-bg); color: var(--mt-correct-text); border: 2px solid var(--mt-correct-border); }
.mt-answer.is-wrong { background: var(--mt-wrong-bg); color: var(--mt-wrong-text); border: 2px solid var(--mt-wrong-border); }
.mt-answer.is-correct::after { content: " \2713"; }
.mt-answer.is-wrong::after { content: " \2715"; }
.mt-qcard__feedback { margin: 18px 0 0; font-size: 15px; color: var(--mt-text-muted); min-height: 22px; }

/* ---------- Sections ---------- */
.mt-section { padding: 72px 0; }
.mt-label { margin: 0 0 8px; font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mt-blue); }
.mt-h2 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.01em; margin: 0; }
.mt-section__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 32px; }
.mt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

/* Game cards */
.mt-game {
  background: #fff; border: 1px solid var(--mt-border); border-radius: var(--mt-radius-card);
  padding: 26px; display: flex; flex-direction: column; gap: 14px;
}
.mt-game__top { display: flex; align-items: center; gap: 14px; }
.mt-date {
  width: 60px; height: 60px; flex: 0 0 60px; border-radius: 14px; background: var(--mt-navy); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--mt-font-display);
}
.mt-date__mon { font-size: 12px; font-weight: 500; color: var(--mt-text-on-dark); text-transform: uppercase; }
.mt-date__day { font-size: 22px; font-weight: 700; line-height: 1.1; }
.mt-game h3 { margin: 0; font-size: 20px; }
.mt-game__time { margin: 4px 0 0; font-size: 15px; color: var(--mt-text-muted); }
.mt-game__venue { margin: 0; font-size: 15px; color: var(--mt-text-body); }
.mt-tag { align-self: flex-start; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: var(--mt-radius-pill); background: #EEF1FF; color: var(--mt-blue); }
.mt-tag--gold { background: #FFF4DB; color: #7A4F00; }
.mt-empty { background: #fff; border: 1px dashed var(--mt-input-border); border-radius: var(--mt-radius-card); padding: 32px; color: var(--mt-text-body); }

/* Steps */
.mt-step { display: flex; flex-direction: column; gap: 12px; padding: 8px 0; }
.mt-step__num { font-family: var(--mt-font-display); font-weight: 700; font-size: 48px; color: #C9D2FF; line-height: 1; }
.mt-step h3 { margin: 0; font-size: 22px; }
.mt-step p { margin: 0; color: var(--mt-text-body); }

/* Panels */
.mt-panel {
  border-radius: var(--mt-radius-panel); padding: clamp(32px, 5vw, 64px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px;
}
.mt-panel--light { background: #fff; border: 1px solid var(--mt-border); }
.mt-panel--dark { background: var(--mt-navy); color: #fff; }
.mt-panel__copy { flex: 1 1 420px; min-width: 0; }
.mt-panel h2 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.01em; margin: 0 0 14px; }
.mt-panel p { margin: 0; font-size: 18px; max-width: 560px; }
.mt-panel--dark p { color: var(--mt-text-on-dark); }
.mt-panel--light p { color: var(--mt-text-body); }
.mt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.mt-chip { font-size: 14px; font-weight: 500; color: var(--mt-navy); background: var(--mt-surface-soft); border: 1px solid var(--mt-border); border-radius: var(--mt-radius-pill); padding: 10px 14px; }

/* ---------- Regular pages (sign-up, host, suggest, blog) ---------- */
.mt-page-head { background: var(--mt-navy); color: #fff; padding: 48px 0 56px; }
.mt-page-head h1 { margin: 0; font-size: clamp(32px, 5vw, 52px); letter-spacing: -0.02em; }
.mt-page-body { padding: 48px 0 88px; }
.mt-content { background: #fff; border: 1px solid var(--mt-border); border-radius: var(--mt-radius-panel); padding: clamp(24px, 4vw, 48px); }
.mt-content > *:first-child { margin-top: 0; }
.mt-content > *:last-child { margin-bottom: 0; }
.mt-content input[type="text"], .mt-content input[type="email"], .mt-content input[type="tel"],
.mt-content input[type="number"], .mt-content input[type="password"], .mt-content select, .mt-content textarea {
  font-family: var(--mt-font-body); font-size: 16px; padding: 14px 16px; width: 100%; max-width: 560px;
  border: 1px solid var(--mt-input-border); border-radius: var(--mt-radius-control); background: #fff; color: var(--mt-navy);
}
.mt-content label { font-weight: 600; font-size: 15px; }
.mt-content button, .mt-content input[type="submit"] {
  font-family: var(--mt-font-body); background: var(--mt-navy); color: #fff; font-weight: 600; font-size: 16px;
  padding: 15px 28px; min-height: 50px; border: none; border-radius: var(--mt-radius-pill); cursor: pointer;
}
.mt-post + .mt-post { margin-top: 32px; padding-top: 32px; border-top: 1px solid var(--mt-border); }
.mt-post h2 { margin: 0 0 8px; }

/* ---------- Footer ---------- */
.mt-footer { border-top: 1px solid var(--mt-border); padding: 28px 0; }
.mt-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--mt-text-muted); }
.mt-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ---------- TV display template ---------- */
body.mt-tv-body { background: var(--mt-navy); color: #fff; min-height: 100vh; overflow: hidden; }
.mt-tv { min-height: 100vh; display: flex; flex-direction: column; }
.mt-tv__main { flex: 1; display: flex; flex-direction: column; }
.mt-tv__main > * { flex: 1; }
.mt-tv__brand {
  position: fixed; left: 2.5vw; bottom: 2.5vh; display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mt-font-display); font-weight: 700; font-size: clamp(16px, 1.4vw, 28px); opacity: 0.85;
}
.mt-tv__brand .mt-logo__mark { width: 1.8em; height: 1.8em; font-size: 1em; }
.mt-tv__brand span span { color: var(--mt-gold); }
.mt-tv__fs {
  position: fixed; top: 16px; right: 16px; z-index: 50; min-height: 44px; padding: 10px 16px;
  border-radius: var(--mt-radius-pill); border: 1px solid rgba(255,255,255,0.3); background: rgba(14,19,48,0.8);
  color: #fff; font-family: var(--mt-font-body); font-weight: 600; cursor: pointer; transition: opacity 0.3s;
}
.mt-tv.is-idle .mt-tv__fs { opacity: 0; pointer-events: none; }
.mt-tv.is-idle { cursor: none; }
