/* ============================================================
   DANIEL FORTUNE — Token Overrides (Core App)
   Loaded LAST — highest specificity in cascade
   tokens.css → style.css → token-overrides.css

   Stories: 1.0–1.5, 2.1–2.4
   ============================================================ */

/* ── ROOT — Jobie variable remap (Story 1.0) ── */
:root {
  --primary:           #221986;
  --secondary:         #722c94;
  --primary-hover:     #1a1268;
  --gradient:          linear-gradient(135deg, #221986 0%, #722c94 50%, #ff0086 100%);
  --rgba-primary-1:    rgba(34, 25, 134, 0.1);
  --rgba-primary-2:    rgba(34, 25, 134, 0.2);
  --rgba-primary-3:    rgba(34, 25, 134, 0.3);
  --rgba-primary-4:    rgba(34, 25, 134, 0.4);
  --rgba-primary-5:    rgba(34, 25, 134, 0.5);
  --rgba-primary-6:    rgba(34, 25, 134, 0.6);
  --rgba-primary-7:    rgba(34, 25, 134, 0.7);
  --rgba-primary-8:    rgba(34, 25, 134, 0.8);
  --rgba-primary-9:    rgba(34, 25, 134, 0.9);
  --color-accent-pink: #ff0086;
  --color-accent-orange: #ff8429;
  --text-heading:      #383838;
  --action-primary:    #221986;
  --bs-border-color:   #dee2e6;
}

/* ── Color classes (Story 1.1) ── */
.text-primary { color: var(--primary) !important; }
a.text-primary:hover { color: var(--primary-hover) !important; }

/* ── HEADINGS — Oswald + color (Story 1.2) ── */
h1, h2, h3, .h1, .h2, .h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: var(--text-heading);
}
h4, h5, h6, .h4, .h5, .h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: var(--text-heading);
}
.dz-title {
  font-family: 'Montserrat', sans-serif;
}

/* ── BUTTONS — Gradient (Story 1.3) ── */
.btn-primary {
  background: var(--gradient) !important;
  border: none !important;
  color: #fff !important;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.btn-primary.light {
  background: rgba(34, 25, 134, 0.1) !important;
  color: var(--action-primary) !important;
  border: none !important;
}
.btn-primary:hover,
.btn-primary:focus {
  filter: brightness(1.1);
  transform: translateY(-1px);
  background: var(--gradient) !important;
  border: none !important;
}
.btn-primary.light:hover,
.btn-primary.light:focus {
  background: rgba(34, 25, 134, 0.15) !important;
  filter: none;
  transform: none;
}

/* ── BADGES ── */
.badge.bg-primary,
.bg-primary:not(.light) {
  background-color: var(--action-primary) !important;
}
.bg-primary.light {
  background-color: rgba(34, 25, 134, 0.1) !important;
  color: var(--action-primary) !important;
}

/* ── SIDEBAR — Gradiente (Story 1.4) ── */
.sidebar {
  background: var(--gradient) !important;
}
.sidebar .author-box {
  background: rgba(0,0,0,0.2);
}
.sidebar .nav-label {
  color: rgba(255,255,255,0.6) !important;
  border-top-color: rgba(255,255,255,0.15) !important;
}
.sidebar a,
.sidebar .nav-text,
.sidebar span:not(.badge) {
  color: rgba(255,255,255,0.85) !important;
}
.sidebar a:hover,
.sidebar a.active,
.sidebar .nav-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.12);
}
.sidebar .dz-icon {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
}
.sidebar .dz-icon svg path,
.sidebar .dz-icon svg {
  fill: #fff !important;
  color: #fff !important;
}
.sidebar .badge {
  background: var(--color-accent-pink, #ff0086) !important;
  color: #fff !important;
}

/* ── CARDS — Sombra + hover (Story 1.5) ── */
.card {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-radius: 12px;
  border: 1px solid var(--bs-border-color);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

/* Platform image cards — uniform 1:1 squares (Destaques do Dia / Semana) */
.card.card-bx.card-content {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  height: auto !important;
}
.card.card-bx.card-content:hover {
  box-shadow: none !important;
  transform: scale(1.03);
}
.card.card-bx.card-content > .card-body {
  width: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card.card-bx.card-content .card-body > a,
.card.card-bx.card-content .card-body > div {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}
.card.card-bx.card-content .card-body > div > a {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}
.card.card-bx.card-content img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

/* Card titles — Oswald */
.card-title {
  font-family: 'Montserrat', sans-serif;
}

/* ── FORMS — Input focus (Story 2.1) ── */
.form-control,
.form-select {
  border-color: var(--bs-border-color);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--action-primary) !important;
  box-shadow: 0 0 0 3px rgba(34,25,134,0.15) !important;
}

/* ── Input DDI prefix (+55) — match input border ── */
.input-ddi-prefix {
  border-radius: 50px 0 0 50px !important;
  border-color: var(--bs-border-color) !important;
  background: transparent !important;
}

/* ── list-check icons (Story 2.2) ── */
ul.list-check li:after {
  color: var(--secondary) !important;
}

/* ── ACCORDION / FAQ (Story 2.3) ── */
.accordion-button:not(.collapsed) {
  color: var(--primary) !important;
  background-color: rgba(34,25,134,0.06) !important;
}
.accordion-button:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(34,25,134,0.15) !important;
}
.accordion-item:has(.accordion-button:not(.collapsed)) {
  border-left: 3px solid var(--primary);
}
.accordion-header {
  font-family: 'Montserrat', sans-serif;
}

/* ── PRELOADER (Story 2.4) ── */
.spinner,
.loader,
#preloader .spinner {
  border-top-color: var(--primary) !important;
}

/* ── TRANSITIONS — Global (Story 2.4) ── */
a {
  transition: color 0.15s ease;
}
.btn {
  transition: filter 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.nav-link {
  transition: color 0.15s ease, background 0.15s ease;
}

/* ── ACCESSIBILITY ── */
:focus-visible {
  outline: 2px solid var(--action-primary);
  outline-offset: 2px;
}

/* ── Safe bottom clearance for the fixed menubar (69px nav + 21px breathing room + iOS safe-area) ──
   Rendered in-flow alongside .menubar-area inside core/partials/menu_bar.html, so the document
   gains real height instead of relying on per-page paddings or :has() (older WebViews). */
.menubar-spacer {
  width: 100%;
  height: calc(90px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  flex-shrink: 0;
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *:not(.spinner):not(.loader):not(#preloader *),
  *:not(.spinner):not(.loader):not(#preloader *)::before,
  *:not(.spinner):not(.loader):not(#preloader *)::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
