/* =============================================================================
   BASE — CineVerse Asia
   CSS Variables, Reset, Typography, Utilities
   ============================================================================= */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens — LOCKED)
   -------------------------------------------------------------------------- */
:root {
  /* Brand Colors */
  --cv-accent:        #d94841;
  --cv-accent-hover:  #bb3f39;
  --cv-gold:          #e5b96b;
  --cv-gold-hover:    #cf9f4a;
  --cv-rose:          #e97f7d;
  --cv-plum:          #5d2c47;
  --cv-sky:           #86a7d8;

  /* Dark Mode (Default) */
  --cv-bg:            #100c0d;
  --cv-surface:       #181214;
  --cv-surface-2:     #241a1d;
  --cv-border:        rgba(255,246,240,0.11);
  --cv-text:          #f7f2ee;
  --cv-text-muted:    #c9beb6;
  --cv-overlay:       rgba(16,12,13,0.82);

  /* Spacing Scale (8px base) */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-6: 48px;
  --sp-8: 64px;
  --sp-12: 96px;

  /* Typography */
  --font-base: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --fs-h1: clamp(32px, 5vw, 48px);
  --fs-h2: clamp(26px, 3.5vw, 36px);
  --fs-h3: clamp(22px, 2.8vw, 28px);
  --fs-h4: clamp(18px, 2.2vw, 22px);
  --fs-body: 18px;
  --fs-small: 14px;
  --lh-heading: 1.2;
  --lh-body: 1.7;
  --ls-heading: -0.02em;

  /* Layout */
  --container: 1200px;
  --container-wide: 1600px;
  --content-width: 800px;

  /* Transitions */
  --transition: 250ms ease;
  --transition-slow: 400ms ease;

  /* Z-index */
  --z-header: 1000;
  --z-modal: 2000;
  --z-overlay: 500;

  /* Radius */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;

  /* Shadows */
  --shadow-card: 0 12px 34px rgba(6,4,4,0.34);
  --shadow-card-hover: 0 18px 54px rgba(6,4,4,0.52);
  --shadow-header: 0 10px 30px rgba(4,3,3,0.45);
}

/* --------------------------------------------------------------------------
   Light Mode Override
   -------------------------------------------------------------------------- */
[data-theme="light"] {
  --cv-bg:         #f6f1eb;
  --cv-surface:    #fffaf5;
  --cv-surface-2:  #f1e8df;
  --cv-border:     rgba(70,42,27,0.14);
  --cv-text:       #231612;
  --cv-text-muted: #745e52;
  --cv-overlay:    rgba(255,248,240,0.9);
  --shadow-card: 0 12px 26px rgba(78,43,26,0.12);
  --shadow-card-hover: 0 18px 40px rgba(78,43,26,0.18);
  --shadow-header: 0 10px 24px rgba(78,43,26,0.12);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-base);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  background-color: var(--cv-bg);
  background-image:
    radial-gradient(circle at 12% -10%, rgba(233, 127, 125, 0.16), transparent 38%),
    radial-gradient(circle at 88% 6%, rgba(133, 167, 216, 0.14), transparent 35%),
    radial-gradient(circle at 50% 120%, rgba(229, 185, 107, 0.10), transparent 44%);
  color: var(--cv-text);
  transition: background-color var(--transition), color var(--transition);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

ul, ol { list-style: none; }

button, input, textarea, select {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

button { line-height: 1; }

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: -0.01em;
  color: var(--cv-text);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p { margin-bottom: var(--sp-2); }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 700; }
em, i { font-style: italic; }

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--sp-3);
  padding-right: var(--sp-3);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--content {
  max-width: var(--content-width);
}

.text-muted { color: var(--cv-text-muted); }
.text-accent { color: var(--cv-accent); }
.text-gold { color: var(--cv-gold); }

.no-scroll { overflow: hidden; }

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--cv-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   WordPress Alignment Classes
   -------------------------------------------------------------------------- */
.alignleft {
  float: left;
  margin-right: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.alignright {
  float: right;
  margin-left: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.alignwide {
  max-width: var(--container-wide);
  margin-left: auto;
  margin-right: auto;
}

.alignfull {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Screen reader text */
.screen-reader-text {
  border: 0;
  clip: rect(1px,1px,1px,1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--cv-surface);
  clip: auto !important;
  clip-path: none;
  color: var(--cv-text);
  display: block;
  font-size: var(--fs-small);
  font-weight: 700;
  height: auto;
  left: var(--sp-1);
  padding: var(--sp-2) var(--sp-3);
  top: var(--sp-1);
  width: auto;
  z-index: calc(var(--z-header) + 1);
}

/* --------------------------------------------------------------------------
   Skip Link
   -------------------------------------------------------------------------- */
#skip-to-content {
  position: absolute;
  top: -100%;
  left: var(--sp-2);
  background: var(--cv-accent);
  color: #fff;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: calc(var(--z-header) + 10);
  transition: top var(--transition);
}

#skip-to-content:focus {
  top: var(--sp-2);
}

/* --------------------------------------------------------------------------
   Loading / Skeleton Pulse
   -------------------------------------------------------------------------- */
@keyframes cv-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.cv-skeleton {
  background: var(--cv-surface-2);
  border-radius: var(--radius);
  animation: cv-pulse 1.5s ease infinite;
}

/* --------------------------------------------------------------------------
   Scrollbar Styling
   -------------------------------------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--cv-bg); }
::-webkit-scrollbar-thumb {
  background: var(--cv-surface-2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--cv-accent); }
