/* ==========================================================================
   THE RESEARCH MINDS - GLOBAL DESIGN SYSTEM
   ========================================================================== */

/* 1. CSS Variables & Tokens */
:root {
  /* Layout */
  --container-max: 1200px;
  --container-px-desktop: 24px;
  --container-px-tablet: 28px;
  --container-px-mobile: 20px;

  /* Spacing Scale (8px based) */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;
  --space-3xl: 96px;
  --space-4xl: 112px;

  /* Section Spacing */
  --section-space-desktop: 96px;
  --section-space-compact-desktop: 64px;
  --section-space-large-desktop: 112px;
  
  --section-space-tablet: 72px;
  --section-space-compact-tablet: 52px;
  
  --section-space-mobile: 56px;
  --section-space-compact-mobile: 40px;

  /* Hero Spacing */
  --hero-space-desktop: 72px;
  --hero-space-tablet: 64px;
  --hero-space-mobile: 48px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-btn: 10px; /* 10-12px */
  --radius-card: 16px; /* 14-16px */
  --radius-lg: 20px; /* 18-20px featured */
  --radius-cta: 20px; /* 20-24px final cta */

  /* Colors */
  --trm-navy: #071A3A;
  --trm-blue: #1A56DB;
  --trm-blue-soft: #EFF4FF;
  --trm-bg-light: #F7F9FD;
  --trm-bg-grey: #FAFBFE;
  --trm-border: #E5EAF2;
  --trm-text: #0B1635; /* 071B3B approximation */
  --trm-text-muted: #475569;
  --trm-white: #FFFFFF;

  /* Shadows */
  --shadow-card: 0 8px 30px rgba(7, 26, 58, 0.05);

  /* Typography */
  --font-primary: 'Plus Jakarta Sans', 'Inter', 'Manrope', sans-serif;
  --text-h1-desktop: clamp(48px, 5vw, 64px);
  --text-h1-tablet: 48px;
  --text-h1-mobile: 38px;

  --text-h2-desktop: 40px;
  --text-h2-tablet: 34px;
  --text-h2-mobile: 30px;

  --text-h3-desktop: 26px;
  --text-h3-mobile: 22px;

  --text-card-title-desktop: 18px;
  --text-card-title-mobile: 17px;

  --text-body-lg: 18px;
  --text-body-desktop: 16px;
  --text-body-mobile: 15px;
  
  --text-small: 14px;
  --text-eyebrow: 12px;
}

/* 2. Global Resets & Typography */
body.trm-sys {
  font-family: var(--font-primary);
  color: var(--trm-text);
  background-color: var(--trm-white);
  -webkit-font-smoothing: antialiased;
}

/* 3. Layout & Containers */
.trm-container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-px-desktop);
  padding-right: var(--container-px-desktop);
  width: 100%;
}

.trm-section {
  padding-top: var(--section-space-desktop);
  padding-bottom: var(--section-space-desktop);
}
.trm-section--compact {
  padding-top: var(--section-space-compact-desktop);
  padding-bottom: var(--section-space-compact-desktop);
}
.trm-section--large {
  padding-top: var(--section-space-large-desktop);
  padding-bottom: var(--section-space-large-desktop);
}

.trm-bg-light { background-color: var(--trm-bg-light); }
.trm-bg-white { background-color: var(--trm-white); }
.trm-bg-grey { background-color: var(--trm-bg-grey); }

/* Section Headers */
.trm-section-header {
  margin-bottom: var(--space-xl);
  max-width: 720px;
}
.trm-section-header--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.trm-eyebrow {
  font-size: var(--text-eyebrow);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--trm-blue);
  margin-bottom: var(--space-sm);
  display: block;
}
.trm-h1 {
  font-size: var(--text-h1-desktop);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--trm-navy);
  margin-bottom: var(--space-sm);
  margin-top: 0;
}
.trm-h2 {
  font-size: var(--text-h2-desktop);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--trm-navy);
  margin-bottom: var(--space-sm);
  margin-top: 0;
}
.trm-h3 {
  font-size: var(--text-h3-desktop);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--trm-navy);
  margin-bottom: var(--space-sm);
  margin-top: 0;
}
.trm-lead {
  font-size: var(--text-body-lg);
  line-height: 1.65;
  color: var(--trm-text-muted);
  max-width: 600px;
  margin-bottom: 0;
}
.trm-section-header--center .trm-lead {
  margin-left: auto;
  margin-right: auto;
}

/* 4. Grids */
.trm-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
.trm-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
.trm-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }

/* 5. Components: Cards */
.trm-card {
  background: var(--trm-white);
  padding: 28px;
  border-radius: var(--radius-card);
  border: 1px solid var(--trm-border);
  box-shadow: var(--shadow-card);
}
.trm-card--compact {
  padding: 24px;
  border-radius: 14px;
}
.trm-card--featured {
  padding: 36px;
  border-radius: var(--radius-lg);
}

.trm-card-icon {
  width: 48px;
  height: 48px;
  color: var(--trm-blue);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.trm-card-icon--bg {
  background: var(--trm-bg-light);
  border-radius: var(--radius-sm);
  justify-content: center;
}
.trm-card-icon svg { width: 24px; height: 24px; }
.trm-card-icon--large { width: 60px; height: 60px; }
.trm-card-icon--large svg { width: 32px; height: 32px; }

.trm-card h3 {
  font-size: var(--text-card-title-desktop);
  font-weight: 600;
  line-height: 1.3;
  color: var(--trm-navy);
  margin-bottom: var(--space-xs);
  margin-top: 0;
}
.trm-card p {
  font-size: var(--text-small);
  line-height: 1.55;
  color: var(--trm-text-muted);
  margin-bottom: 0;
}

/* 6. Components: Buttons */
.trm-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  background-color: var(--trm-blue);
  color: var(--trm-white);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-btn);
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}
.trm-btn-primary:hover, .trm-btn-primary:focus {
  background-color: var(--trm-navy);
  color: var(--trm-white);
}
.trm-btn-hero {
  height: 52px;
  padding: 0 28px;
}
.trm-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  background-color: transparent;
  color: var(--trm-navy);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-btn);
  border: 1px solid var(--trm-border);
  text-decoration: none;
  transition: all 0.2s ease;
}
.trm-btn-outline:hover, .trm-btn-outline:focus {
  background-color: var(--trm-bg-light);
  border-color: var(--trm-navy);
}
.trm-btn-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--trm-blue);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.trm-btn-text:hover, .trm-btn-text:focus { color: var(--trm-navy); }
.trm-btn-group { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* 7. Components: Final CTA Banner */
.trm-cta-banner-wrapper {
  padding-bottom: 80px;
  background-color: var(--trm-white);
}
.trm-cta-banner {
  background-color: var(--trm-navy);
  border-radius: var(--radius-cta);
  padding: var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  position: relative;
  overflow: hidden;
}
.trm-cta-banner::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.trm-cta-banner-content { flex: 1; position: relative; z-index: 2; }
.trm-cta-banner-action { flex-shrink: 0; position: relative; z-index: 2; }

.trm-cta-banner .trm-eyebrow { color: #60A5FA; }
.trm-cta-banner h2 {
  font-size: 36px;
  font-weight: 800;
  color: var(--trm-white);
  line-height: 1.2;
  margin-bottom: var(--space-sm);
  margin-top: 0;
}
.trm-cta-banner p {
  font-size: var(--text-body-desktop);
  color: #CBD5E1;
  max-width: 500px;
  margin-bottom: 0;
}

/* 8. Split Layouts */
.trm-split {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}
.trm-split-50-50 > div { flex: 1; }
.trm-split-45-55 > div:first-child { flex: 0 0 45%; }
.trm-split-45-55 > div:last-child { flex: 0 0 55%; }

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .trm-container { padding-left: var(--container-px-tablet); padding-right: var(--container-px-tablet); }
  .trm-section { padding-top: var(--section-space-tablet); padding-bottom: var(--section-space-tablet); }
  .trm-section--compact { padding-top: var(--section-space-compact-tablet); padding-bottom: var(--section-space-compact-tablet); }
  
  .trm-h1 { font-size: var(--text-h1-tablet); }
  .trm-h2 { font-size: var(--text-h2-tablet); }
  .trm-h3 { font-size: var(--text-h3-tablet); }
  
  .trm-grid-3, .trm-grid-4 { grid-template-columns: repeat(2, 1fr); }
  
  .trm-split { flex-direction: column; text-align: center; gap: var(--space-xl); }
  .trm-split > div { flex: 1 1 auto; width: 100%; }
  .trm-section-header--split { text-align: center; margin-left: auto; margin-right: auto; }
  .trm-btn-group { justify-content: center; }
  
  .trm-cta-banner { flex-direction: column; text-align: center; }
}

@media (max-width: 768px) {
  .trm-container { padding-left: var(--container-px-mobile); padding-right: var(--container-px-mobile); }
  .trm-section { padding-top: var(--section-space-mobile); padding-bottom: var(--section-space-mobile); }
  .trm-section--compact { padding-top: var(--section-space-compact-mobile); padding-bottom: var(--section-space-compact-mobile); }
  
  .trm-h1 { font-size: var(--text-h1-mobile); }
  .trm-h2 { font-size: var(--text-h2-mobile); }
  .trm-h3 { font-size: var(--text-h3-mobile); }
  .trm-lead, body.trm-sys p { font-size: var(--text-body-mobile); }
  .trm-card h3 { font-size: var(--text-card-title-mobile); }
  
  .trm-grid-2, .trm-grid-3, .trm-grid-4 { grid-template-columns: 1fr; gap: var(--space-sm); }
  .trm-card { padding: 20px 24px; }
  
  .trm-btn-group { flex-direction: column; align-items: stretch; gap: 10px; }
  .trm-btn-primary, .trm-btn-outline { width: 100%; justify-content: center; }
  
  .trm-cta-banner h2 { font-size: 30px; }
}

@media (max-width: 374px) {
  .trm-container { padding-left: 16px; padding-right: 16px; }
}

/* ==========================================================================
   BREADCRUMB COMPONENT
   ========================================================================== */

.trm-breadcrumb {
  width: 100%;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.trm-breadcrumb ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.trm-breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trm-breadcrumb li:not(:last-child)::after {
  content: "›";
  color: #94A3B8;
}

.trm-breadcrumb a {
  color: #64748B;
  text-decoration: none;
  transition: color 0.2s ease;
}

.trm-breadcrumb a:hover {
  color: var(--trm-blue);
}

.trm-breadcrumb [aria-current="page"] {
  color: #334155;
  font-weight: 500;
}

/* Dark Hero Variation */
.trm-bg-dark .trm-breadcrumb a {
  color: rgba(255, 255, 255, 0.68);
}

.trm-bg-dark .trm-breadcrumb a:hover {
  color: #ffffff;
}

.trm-bg-dark .trm-breadcrumb li:not(:last-child)::after {
  color: rgba(255, 255, 255, 0.4);
}

.trm-bg-dark .trm-breadcrumb [aria-current="page"] {
  color: rgba(255, 255, 255, 0.92);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .trm-breadcrumb {
    font-size: 12px;
  }
}

/* ==========================================================================
   LEGACY CLASS COMPATIBILITY LAYER
   Normalizes the pre-design-system markup (nori theme `.button`, utility
   classes, legacy component classes) to the token system. This file is
   linked LAST on every page, so these rules win the cascade.
   ========================================================================== */

/* 9. Legacy: Buttons */
.button {
  min-height: 48px;
  padding: 0 24px;
  background-color: var(--trm-blue);
  border-radius: var(--radius-btn);
  box-shadow: none;
  font-weight: 600;
}

.button:hover {
  background-color: var(--trm-navy);
  box-shadow: none;
  transform: translateY(-2px);
}

/* Theme utility combos used across legacy markup (nori style.min.css) */
.button.bg_primary,
.button.bg_hr_primary {
  background-color: var(--trm-blue);
  color: #fff;
}

.button.bg_hr_primary:hover {
  background-color: var(--trm-navy);
}

.trm-topbar-cta {
  background: var(--trm-blue) !important;
}

.radius25 {
  border-radius: var(--radius-btn) !important;
}

.button-small {
  min-height: 42px;
  padding: 0 18px;
  font-size: 14px !important;
}
