/* ===================================
   FIDUCIAL UNIFIED COLOR SYSTEM
   Overrides all legacy colors with Fiducial brand palette
   Load this LAST in cascade for highest priority
   =================================== */

/* Fiducial Brand Color System */
:root {
  /* Primary Colors - Map all burgundy/wine reds to Fiducial red */
  --primary-deep: #cd2e26;      /* Fiducial red (was #8C1C2A) */
  --primary: #cd2e26;           /* Fiducial red (was #9E1F28) */
  --primary-light: #cd2e26;     /* Fiducial red (was #B8333E) */
  --primary-soft: #E7646A;      /* Keep soft red for subtle accents */
  --primary-subtle: #F5EAEB;    /* Keep subtle red for backgrounds */

  /* Fiducial specific additions */
  --fiducial-red: #cd2e26;      /* Primary Fiducial red */
  --fiducial-red-dark: #be1e2c; /* Dark red for hover states */

  /* Accent Colors - Remove gold/copper, replace with red */
  --accent-gold: #cd2e26;       /* Replace gold with red (was #FDBA4D) */
  --accent-copper: #cd2e26;     /* Replace copper with red (was #D4965E) */
  --accent-bronze: #cd2e26;     /* Replace bronze with red (was #A67C52) */

  /* Neutral Colors - Map to Fiducial gray scale */
  --neutral-ink: #222222;       /* Fiducial dark (was #1F2227) */
  --neutral-slate: #222222;     /* Fiducial dark (was #24344A) */
  --neutral-graphite: #222;     /* Dark gray (was #39465D) */
  --neutral-cool: #5a5a5a;      /* Fiducial gray (was #6A7C94) */
  --neutral-mist: #f1f1f1;      /* Light gray (was #F4F5F7) */
  --neutral-warm: #ffffff;      /* White (was #F9F6F2 beige) */
  --neutral-stone: #ececec;     /* Light gray for borders (was #C9C9CB) */
  --neutral-paper: #ffffff;     /* Pure white */

  /* Fiducial specific additions */
  --fiducial-dark: #222222;     /* Primary dark color */
  --fiducial-gray: #5a5a5a;     /* Medium gray for text */
  --fiducial-light: #ececec;    /* Light gray for backgrounds */
  --fiducial-lighter: #f1f1f1;  /* Lighter gray */
}

/* Font Family Overrides - Fiducial brand fonts */
body {
  font-family: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

h1, h2, h3, h4, h5, h6,
.heading,
.hero-title,
.card-title {
  font-family: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Page Background Override */
body {
  background-color: #ffffff;
}

html,
body {
  overflow-x: hidden;
}

html.has-overlay-scroll,
body.has-overlay-scroll {
  position: relative;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

html.has-overlay-scroll::-webkit-scrollbar,
body.has-overlay-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.has-overlay-scroll .scrollbar-overlay {
  position: fixed;
  top: clamp(1rem, 3vh, 1.75rem);
  right: max(env(safe-area-inset-right, 0px), 0px);
  width: 6px;
  height: calc(100vh - clamp(2rem, 6vh, 3.5rem));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 999;
}

.has-overlay-scroll .scrollbar-overlay.visible {
  opacity: 1;
}

.has-overlay-scroll .scrollbar-overlay .scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  min-height: 32px;
  transform: translateY(0);
  transition: transform 0.1s linear, height 0.1s linear;
}

@media (max-width: 768px) {
  .has-overlay-scroll .scrollbar-overlay {
    display: none;
  }
}

/* Hero Card Background Overrides - Reduced specificity to allow card stacking */
.hero-card-bg-1,
.hero-card-bg-2,
.hero-card-bg-3 {
  /* Removed !important to allow depth system styles to take precedence */
  background: linear-gradient(135deg, #ffffff 0%, #f1f1f1 100%);
}

.hero-card {
  /* Removed !important to allow depth system styles to take precedence */
  background: #ffffff;
  border: 1px solid #ececec;
}

/* Button Color Overrides - Fiducial red */
.cta-primary,
.btn-primary,
button[type="submit"],
.button-primary {
  background-color: #cd2e26 !important;
  border-color: #cd2e26 !important;
}

.cta-primary:hover,
.btn-primary:hover,
button[type="submit"]:hover,
.button-primary:hover {
  background-color: #be1e2c !important;
  border-color: #be1e2c !important;
}

/* Link Hover States */
a:hover {
  color: #cd2e26;
}

/* Form Focus States */
input:focus,
textarea:focus,
select:focus {
  border-color: #cd2e26;
  outline-color: #cd2e26;
}

/* Badge and Accent Overrides */
.badge,
.hero-card-badge,
.stat-badge {
  background-color: #cd2e26 !important;
  color: #ffffff !important;
}

/* Navigation Arrow Overrides */
.card-nav:hover {
  border-color: #cd2e26;
}

.card-nav:hover svg,
.card-nav:hover .arrow {
  color: #cd2e26;
}

/* Indicator Overrides */
.indicator.active,
.carousel-indicator.active,
.dot.active {
  background-color: #cd2e26 !important;
}

/* Text Color Overrides */
h1, h2, h3, h4, h5, h6 {
  color: #222222;
}

body,
p,
.body-text {
  color: #5a5a5a;
}

/* Author Avatar Override */
.author-avatar,
.avatar-gradient {
  background: #cd2e26 !important;
}

/* Remove Gold Accents from Hero Section */
.hero-section::before,
.hero-accent-overlay {
  display: none !important;
}

/* Ensure Stats Use Neutral Backgrounds */
.stat-card,
.metrics-card {
  background: #ffffff;
  border: 1px solid #ececec;
}

.stat-value {
  color: #cd2e26;
}

/* ===================================
   END FIDUCIAL UNIFIED OVERRIDES
   =================================== */
