/* ================================================================
   NDS SAFETY CULTURE — SCOPED STYLES
   All classes prefixed .nds-infographic-wrapper or .nds-*
   Desktop → Tablet (768px) → Mobile (540px) → XS (380px)
   Every element explicitly overridden — nothing bleeds from desktop
================================================================ */

/* ---------- WRAPPER ---------- */
.nds-infographic-wrapper {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #2d3748;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 10px 5px;
  box-sizing: border-box;
  line-height: 1.5;
  overflow-x: hidden;
}

.nds-infographic-wrapper * {
  box-sizing: border-box;
  max-width: 100%;
}

/* ---------- MAIN HEADER ---------- */
.nds-main-header {
  margin-bottom: 28px;
  margin-top: 10px;
}

.nds-main-title {
  font-size: 52px;
  font-weight: 900;
  font-style: italic;
  color: #1c8acb;
  line-height: 1.08;
  letter-spacing: -1.2px;
  margin: 0 0 14px 0;
  font-family: 'Poppins', sans-serif;
  word-break: break-word;
  overflow-wrap: break-word;
}

.nds-main-subtitle {
  font-size: 16px;
  font-weight: 400;
  color: #334155;
  line-height: 1.5;
  margin: 0;
}

/* ---------- STATS BANNER ---------- */
.nds-stats-banner {
  background: linear-gradient(135deg, #0c71c3 0%, #1c8acb 100%);
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  padding: 24px 10px;
  margin-bottom: 35px;
  box-shadow: 0 4px 16px rgba(12, 113, 195, 0.15);
}

.nds-stat-item {
  flex: 1 1 30%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 10px 24px;
  position: relative;
}

.nds-stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 15%;
  height: 70%;
  width: 1px;
  background: rgba(255, 255, 255, 0.25);
}

.nds-stat-number {
  font-size: 54px;
  font-weight: 800;
  color: #ffffff;
  line-height: 0.9;
  font-family: 'Poppins', sans-serif;
  flex-shrink: 0;
}

.nds-stat-text {
  font-size: 13.5px;
  color: #ffffff;
  line-height: 1.45;
  font-weight: 400;
}

.nds-stat-text strong {
  font-weight: 700;
  color: #ffffff;
}

/* ---------- SECTION HEADERS ---------- */
.nds-section-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 24px;
  margin-top: 10px;
}

.nds-section-title {
  font-size: 26px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.5px;
  margin: 0;
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
}

.nds-section-line {
  flex-grow: 1;
  min-width: 30px;
  height: 3px;
  background-color: #87b940;
  border-radius: 2px;
}

.nds-section-desc {
  font-size: 14.5px;
  color: #4b5563;
  margin-top: -14px;
  margin-bottom: 24px;
  line-height: 1.5;
  word-break: break-word;
}

/* ---------- TEN EXAMPLES GRID ---------- */
.nds-examples-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.nds-example-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  word-break: break-word;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nds-example-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.nds-example-card.nds-card-highlight {
  background: linear-gradient(145deg, #0c71c3 0%, #1c8acb 100%);
  border: none;
  box-shadow: 0 6px 20px rgba(12, 113, 195, 0.25);
}

.nds-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.nds-card-num {
  font-size: 26px;
  font-weight: 800;
  color: #87b940;
  line-height: 1;
  flex-shrink: 0;
}

.nds-card-highlight .nds-card-num {
  color: #7cda24;
}

.nds-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 4px;
  color: #ffffff;
  display: inline-block;
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
}

.nds-badge-osha   { background-color: #0c71c3; }
.nds-badge-culture { background-color: #1f2937; }
.nds-badge-twh    { background-color: #87b940; }
.nds-badge-access { background-color: #7cda24; color: #0f172a; }

.nds-card-title {
  font-size: 17px;
  font-weight: 700;
  color: #0c71c3;
  margin: 0 0 8px 0;
  line-height: 1.35;
  word-break: break-word;
}

.nds-card-highlight .nds-card-title { color: #ffffff; }

.nds-card-body {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
  margin: 0;
  word-break: break-word;
}

.nds-card-highlight .nds-card-body { color: #f1f5f9; }

/* ---------- LEGEND ROW ---------- */
.nds-legend-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 10px;
  margin-bottom: 45px;
  padding-left: 5px;
  flex-wrap: wrap;
}

.nds-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #4b5563;
  font-weight: 500;
}

.nds-legend-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.nds-dot-osha    { background-color: #0c71c3; }
.nds-dot-twh     { background-color: #87b940; }
.nds-dot-culture { background-color: #1f2937; }

/* ---------- HIERARCHY BARS ---------- */
.nds-hierarchy-section {
  margin-bottom: 45px;
}

.nds-hierarchy-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
  margin-bottom: 12px;
  width: 100%;
}

.nds-hbar {
  border-radius: 8px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 14px;
  transition: transform 0.2s ease;
  overflow: hidden;
}

.nds-hbar:hover { transform: translateX(4px); }

.nds-hbar-num {
  font-size: 15px;
  font-weight: 800;
  width: 20px;
  flex-shrink: 0;
}

.nds-hbar-title {
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.nds-hbar-desc {
  font-size: 13.5px;
  font-weight: 400;
  margin-left: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nds-hbar-1 { width: 100%; background-color: #0c71c3; color: #ffffff; }
.nds-hbar-2 { width: 90%;  background-color: #1c8acb; color: #ffffff; }
.nds-hbar-3 { width: 80%;  background-color: #87b940; color: #ffffff; }
.nds-hbar-4 { width: 70%;  background-color: #e2e8f0; color: #1e293b; }
.nds-hbar-4 .nds-hbar-desc { color: #475569; }
.nds-hbar-5 { width: 60%;  background-color: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.nds-hbar-5 .nds-hbar-desc { color: #64748b; }

.nds-hierarchy-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 10px;
  padding: 0 4px;
  flex-wrap: wrap;
  gap: 8px;
}

.nds-label-effective { color: #0c71c3; }
.nds-label-least     { color: #64748b; }

/* ---------- HOW TO START ---------- */
.nds-how-to-start {
  background-color: #131b26;
  border-radius: 14px;
  padding: 36px 36px 30px;
  color: #ffffff;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 36px;
  align-items: center;
  margin-bottom: 35px;
  box-shadow: 0 8px 24px rgba(19, 27, 38, 0.2);
}

.nds-hts-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: #7cda24;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.nds-hts-title {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 12px 0;
  letter-spacing: -0.3px;
  line-height: 1.25;
  word-break: break-word;
}

.nds-hts-desc {
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 14px;
  word-break: break-word;
}

.nds-hts-quote {
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  border-left: 2px solid #87b940;
  padding-left: 10px;
  font-style: italic;
  margin: 0;
  word-break: break-word;
}

.nds-hts-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nds-hts-step-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.nds-hts-num {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
}

.nds-hts-num-1 { background-color: #0c71c3; }
.nds-hts-num-2 { background-color: #87b940; }

.nds-hts-step-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nds-hts-step-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  word-break: break-word;
}

.nds-hts-step-sub {
  font-size: 12px;
  color: #94a3b8;
  word-break: break-word;
}

.nds-hts-flow {
  font-size: 12px;
  font-weight: 700;
  color: #7cda24;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  text-align: center;
  margin-top: 6px;
  word-break: break-word;
  white-space: normal;
}

/* ---------- CTA BANNER ---------- */
.nds-cta-banner {
  background-color: #f0f7fc;
  border: 1px solid #d0e7f7;
  border-radius: 12px;
  padding: 24px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.nds-cta-content {
  flex: 1;
  min-width: 0;
}

.nds-cta-title {
  font-size: 20px;
  font-weight: 800;
  color: #0c71c3;
  margin: 0 0 6px 0;
  word-break: break-word;
}

.nds-cta-desc {
  font-size: 13.5px;
  color: #334155;
  line-height: 1.5;
  margin: 0;
}

.nds-cta-btn {
  background-color: #87b940;
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

.nds-cta-btn:hover {
  background-color: #76a635;
  transform: translateY(-2px);
}

/* ================================================================
   TABLET  ≤ 768px
   Override: layout columns, hbar widths, font reductions
================================================================ */
@media screen and (max-width: 768px) {

  .nds-infographic-wrapper {
    padding: 10px 8px;
    overflow-x: hidden;
  }

  /* Header */
  .nds-main-title {
    font-size: 38px;
    letter-spacing: -0.8px;
    line-height: 1.1;
  }
  .nds-main-subtitle { font-size: 14.5px; }

  /* Stats banner — stack vertically */
  .nds-stats-banner {
    flex-direction: column;
    gap: 0;
    padding: 16px;
  }
  .nds-stat-item {
    width: 100%;
    flex: none;
    padding: 14px 0;
    gap: 10px;
  }
  .nds-stat-item:not(:last-child)::after { display: none; }
  .nds-stat-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 14px;
  }
  .nds-stat-number { font-size: 42px; }
  .nds-stat-text   { font-size: 13px; }

  /* Section headers */
  .nds-section-title { font-size: 22px; }
  .nds-section-desc  { font-size: 13.5px; }

  /* Examples grid — single column */
  .nds-examples-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Hierarchy bars — ALL 100% wide on tablet, no overflow */
  .nds-hbar-1,
  .nds-hbar-2,
  .nds-hbar-3,
  .nds-hbar-4,
  .nds-hbar-5 { width: 100% !important; }

  .nds-hbar-desc {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* How to start — single column */
  .nds-how-to-start {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 22px;
  }

  /* CTA — stack */
  .nds-cta-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px;
  }
  .nds-cta-btn {
    width: 100%;
    text-align: center;
    white-space: normal;
    padding: 13px 16px;
    flex-shrink: unset;
  }
}

/* ================================================================
   MOBILE  ≤ 540px
   Override: every element's font, padding, spacing — explicit
================================================================ */
@media screen and (max-width: 540px) {

  .nds-infographic-wrapper {
    padding: 5px 4px;
    overflow-x: hidden;
  }

  /* Header */
  .nds-main-header  { margin-bottom: 20px; margin-top: 6px; }
  .nds-main-title   { font-size: 30px; letter-spacing: -0.5px; line-height: 1.12; margin-bottom: 10px; }
  .nds-main-subtitle { font-size: 13.5px; line-height: 1.45; }

  /* Stats banner */
  .nds-stats-banner { border-radius: 10px; padding: 12px 12px; margin-bottom: 24px; }
  .nds-stat-item    { padding: 10px 0; gap: 8px; }
  .nds-stat-number  { font-size: 36px; line-height: 1; }
  .nds-stat-text    { font-size: 12.5px; line-height: 1.4; }

  /* Section headers */
  .nds-section-title-wrap { gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
  .nds-section-title      { font-size: 18px; letter-spacing: -0.2px; white-space: normal; word-break: break-word; }
  .nds-section-line       { height: 2px; min-width: 20px; flex-grow: 1; }
  .nds-section-desc       { font-size: 12.5px; line-height: 1.45; margin-top: -6px; margin-bottom: 16px; }

  /* Example cards */
  .nds-example-card  { padding: 14px 16px; border-radius: 10px; }
  .nds-card-header   { margin-bottom: 8px; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
  .nds-card-num      { font-size: 20px; }
  .nds-badge         { font-size: 8.5px; padding: 3px 7px; letter-spacing: 0.3px; white-space: normal; word-break: break-word; }
  .nds-card-title    { font-size: 14.5px; margin-bottom: 6px; line-height: 1.35; }
  .nds-card-body     { font-size: 12.5px; line-height: 1.45; }

  /* Legend */
  .nds-legend-row  { gap: 8px 14px; margin-top: 4px; margin-bottom: 28px; padding-left: 2px; }
  .nds-legend-item { font-size: 11px; }
  .nds-legend-dot  { width: 8px; height: 8px; min-width: 8px; }

  /* Hierarchy bars */
  .nds-hierarchy-section { margin-bottom: 28px; }
  .nds-hierarchy-bars    { gap: 7px; margin-top: 10px; margin-bottom: 10px; }

  .nds-hbar {
    width: 100% !important;
    padding: 8px 10px;
    gap: 6px;
    border-radius: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .nds-hbar-1,
  .nds-hbar-2,
  .nds-hbar-3,
  .nds-hbar-4,
  .nds-hbar-5 { width: 100% !important; }

  .nds-hbar-num   { font-size: 12px; width: 14px; min-width: 14px; flex-shrink: 0; }
  .nds-hbar-title { font-size: 12px; flex-shrink: 0; }
  .nds-hbar-desc  { font-size: 11px; margin-left: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0; }

  .nds-hierarchy-labels {
    font-size: 9.5px;
    letter-spacing: 0.3px;
    margin-top: 10px;
    padding: 0 2px;
    gap: 6px;
    align-items: flex-start;
  }
  .nds-label-effective { max-width: 60%; line-height: 1.3; white-space: normal; }
  .nds-label-least     { white-space: normal; text-align: right; line-height: 1.3; }

  /* How to start */
  .nds-how-to-start {
    grid-template-columns: 1fr;
    gap: 18px;
    border-radius: 10px;
    padding: 20px 14px;
    margin-bottom: 22px;
  }
  .nds-hts-tag        { font-size: 10px; letter-spacing: 0.8px; margin-bottom: 6px; }
  .nds-hts-title      { font-size: 20px; margin-bottom: 10px; letter-spacing: -0.2px; }
  .nds-hts-desc       { font-size: 12.5px; line-height: 1.5; margin-bottom: 10px; }
  .nds-hts-quote      { font-size: 12px; padding-left: 8px; }
  .nds-hts-right      { gap: 10px; }
  .nds-hts-step-card  { padding: 10px 12px; gap: 10px; border-radius: 8px; }
  .nds-hts-num        { width: 28px; height: 28px; min-width: 28px; font-size: 13px; }
  .nds-hts-step-title { font-size: 13px; }
  .nds-hts-step-sub   { font-size: 11px; }
  .nds-hts-flow       { font-size: 10px; letter-spacing: 0.2px; margin-top: 4px; white-space: normal; word-break: break-word; }

  /* CTA banner */
  .nds-cta-banner  { border-radius: 10px; padding: 16px 14px; gap: 12px; flex-direction: column; align-items: stretch; }
  .nds-cta-title   { font-size: 16px; line-height: 1.3; word-break: break-word; }
  .nds-cta-desc    { font-size: 12.5px; line-height: 1.45; }
  .nds-cta-btn     { font-size: 13px; padding: 12px 16px; width: 100%; text-align: center; white-space: normal; }
}

/* ================================================================
   XS  ≤ 380px  (iPhone SE, Galaxy Fold)
   Final reduction pass — every element re-stated explicitly
================================================================ */
@media screen and (max-width: 380px) {

  .nds-infographic-wrapper { padding: 4px 2px; }

  .nds-main-title    { font-size: 24px; letter-spacing: -0.3px; }
  .nds-main-subtitle { font-size: 12.5px; }

  .nds-stat-number { font-size: 30px; }
  .nds-stat-text   { font-size: 12px; }

  .nds-section-title { font-size: 16px; }
  .nds-section-desc  { font-size: 12px; }

  .nds-card-num   { font-size: 18px; }
  .nds-badge      { font-size: 8px; padding: 2px 6px; }
  .nds-card-title { font-size: 13.5px; }
  .nds-card-body  { font-size: 12px; }

  .nds-hbar       { padding: 7px 8px; gap: 5px; width: 100% !important; }
  .nds-hbar-1, .nds-hbar-2, .nds-hbar-3, .nds-hbar-4, .nds-hbar-5 { width: 100% !important; }
  .nds-hbar-num   { font-size: 11px; width: 12px; min-width: 12px; }
  .nds-hbar-title { font-size: 11px; }
  .nds-hbar-desc  { font-size: 10px; }

  .nds-hierarchy-labels { font-size: 9px; }

  .nds-hts-title  { font-size: 18px; }
  .nds-hts-desc   { font-size: 12px; }
  .nds-hts-flow   { font-size: 9.5px; letter-spacing: 0.1px; }

  .nds-cta-title { font-size: 15px; }
  .nds-cta-desc  { font-size: 12px; }
  .nds-cta-btn   { font-size: 12.5px; padding: 11px 14px; }
}