/* ============================================================
   SAF OUR PROJECTS — SECTION 06 RELATIONSHIP NETWORK
   Semantic Target: #saf_work_project_map (Page ID: 37912)
   Design System: SAF Warm White / Deep Teal / Warm Gold
   ============================================================ */

#saf_work_project_map {
  position: relative !important;
  background-color: #FAFAF7 !important;
  padding: 112px 24px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  overflow: hidden !important;
  color: #263238 !important;
}

.saf-relnet-widget {
  width: 100%;
  box-sizing: border-box;
}

.saf-relnet-container {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------
   SECTION HEADER
   ------------------------------------------------------------ */
.saf-relnet-header {
  margin-bottom: 56px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
}

.saf-relnet-eyebrow {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.saf-relnet-eyebrow-line {
  width: 24px;
  height: 2px;
  background-color: #F4B400;
  display: inline-block;
  flex-shrink: 0;
}

.saf-relnet-eyebrow-text {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #00695C;
  line-height: 1.2;
}

.saf-relnet-heading {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 52px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: #004D43;
  margin: 0 0 16px 0;
}

.saf-relnet-desc {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  color: #455A64;
  margin: 0;
  max-width: 640px;
}

/* ------------------------------------------------------------
   DESKTOP RELATIONSHIP NETWORK (>= 768px)
   ------------------------------------------------------------ */
.saf-relnet-desktop {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
  margin-top: 16px;
}

.saf-relnet-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.saf-relnet-path {
  fill: none;
  stroke: #E3E7E9;
  stroke-width: 1.75px;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.28s ease, stroke-width 0.28s ease, opacity 0.28s ease;
}

.saf-relnet-path.is-active {
  stroke: #00695C;
  stroke-width: 2.75px;
  opacity: 1;
}

.saf-relnet-path.is-dimmed {
  opacity: 0.16;
  stroke-width: 1.25px;
}

/* Column Structure */
.saf-relnet-col {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

.saf-relnet-col-focus {
  width: 38%;
}

.saf-relnet-col-projects {
  width: 50%;
}

.saf-relnet-col-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #E3E7E9;
}

.saf-relnet-col-label-text {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #78909C;
}

.saf-relnet-col-count {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #B0BEC5;
}

.saf-relnet-nodes-list {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
}

/* ------------------------------------------------------------
   EDITORIAL NODES (Focus Areas & Projects)
   ------------------------------------------------------------ */
.saf-relnet-node {
  position: relative;
  background-color: #FFFFFF;
  border: 1.5px solid #E3E7E9;
  border-radius: 8px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  cursor: pointer;
  outline: none;
  user-select: none;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.28s ease;
}

/* Focus Area Node (Left Column) */
.saf-relnet-focus-node {
  padding: 18px 24px;
  gap: 18px;
}

.saf-relnet-focus-node .saf-relnet-node-num {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #F4B400;
  flex-shrink: 0;
  line-height: 1;
}

.saf-relnet-focus-node .saf-relnet-node-title {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #004D43;
  line-height: 1.25;
  transition: color 0.28s ease;
}

/* Project Node (Right Column) */
.saf-relnet-project-node {
  padding: 13px 20px;
  gap: 14px;
}

.saf-relnet-project-node .saf-relnet-node-num {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #78909C;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.28s ease;
}

.saf-relnet-project-node .saf-relnet-node-title {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #263238;
  line-height: 1.25;
  transition: color 0.28s ease;
}

/* Anchors (Visual port dots for SVG connection paths) */
.saf-relnet-anchor {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #CFD8DC;
  border: 2px solid #FFFFFF;
  box-sizing: border-box;
  transform: translateY(-50%);
  pointer-events: none;
  transition: background-color 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
}

.saf-relnet-anchor-right {
  right: -5px;
}

.saf-relnet-anchor-left {
  left: -5px;
}

/* ------------------------------------------------------------
   HOVER & ACTIVE BIDIRECTIONAL INTERACTIONS
   ------------------------------------------------------------ */
/* Active Primary Node (Hovered or Focused) */
.saf-relnet-node.is-active {
  border-color: #00695C;
  background-color: #E6F0EE;
  box-shadow: 0 4px 16px rgba(0, 77, 67, 0.08);
  transform: scale(1.015);
  z-index: 5;
}

.saf-relnet-node.is-active .saf-relnet-node-num {
  color: #F4B400;
}

.saf-relnet-node.is-active .saf-relnet-node-title {
  color: #004D43;
}

.saf-relnet-node.is-active .saf-relnet-anchor {
  background-color: #00695C;
  box-shadow: 0 0 0 3px rgba(0, 105, 92, 0.22);
}

/* Related Node (Connected via relationship) */
.saf-relnet-node.is-active-related {
  border-color: #00695C;
  background-color: #F4F8F7;
  box-shadow: 0 2px 10px rgba(0, 77, 67, 0.06);
  z-index: 4;
}

.saf-relnet-node.is-active-related .saf-relnet-node-num {
  color: #F4B400;
}

.saf-relnet-node.is-active-related .saf-relnet-node-title {
  color: #004D43;
}

.saf-relnet-node.is-active-related .saf-relnet-anchor {
  background-color: #00695C;
}

/* Unrelated Dimmed Nodes */
.saf-relnet-node.is-dimmed {
  opacity: 0.36;
}

/* Keyboard Focus */
.saf-relnet-node:focus-visible {
  outline: 2px solid #F4B400;
  outline-offset: 3px;
  border-color: #00695C;
}

/* ------------------------------------------------------------
   TABLET RESPONSIVE (768px – 1024px)
   ------------------------------------------------------------ */
@media (max-width: 1024px) and (min-width: 768px) {
  #saf_work_project_map {
    padding: 88px 24px !important;
  }

  .saf-relnet-header {
    margin-bottom: 44px;
  }

  .saf-relnet-heading {
    font-size: 44px;
  }

  .saf-relnet-col-focus {
    width: 40%;
  }

  .saf-relnet-col-projects {
    width: 52%;
  }

  .saf-relnet-focus-node {
    padding: 15px 18px;
    gap: 14px;
  }

  .saf-relnet-focus-node .saf-relnet-node-title {
    font-size: 15px;
  }

  .saf-relnet-project-node {
    padding: 11px 16px;
    gap: 12px;
  }

  .saf-relnet-project-node .saf-relnet-node-title {
    font-size: 13.5px;
  }
}

/* ------------------------------------------------------------
   MOBILE ACCORDION VIEW (<= 767px)
   ------------------------------------------------------------ */
.saf-relnet-mobile {
  display: none;
  width: 100%;
}

@media (max-width: 767px) {
  #saf_work_project_map {
    padding: 64px 16px !important;
  }

  .saf-relnet-header {
    margin-bottom: 36px;
  }

  .saf-relnet-heading {
    font-size: 36px;
    line-height: 1.08;
    margin-bottom: 14px;
  }

  .saf-relnet-desc {
    font-size: 15px;
    line-height: 1.6;
  }

  /* Switch Views */
  .saf-relnet-desktop {
    display: none !important;
  }

  .saf-relnet-mobile {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
  }

  .saf-relnet-mobile-intro-badge {
    display: inline-flex;
    align-items: center;
    background-color: #E6F0EE;
    border: 1px solid #CFE2DE;
    border-radius: 6px;
    padding: 8px 14px;
    margin-bottom: 8px;
  }

  .saf-relnet-mobile-intro-badge span {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #00695C;
    text-transform: uppercase;
  }

  .saf-relnet-mobile-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .saf-relnet-m-group {
    background-color: #FFFFFF;
    border: 1.5px solid #E3E7E9;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.28s ease, box-shadow 0.28s ease;
  }

  .saf-relnet-m-group.is-expanded {
    border-color: #00695C;
    box-shadow: 0 4px 16px rgba(0, 77, 67, 0.08);
  }

  /* Header button */
  .saf-relnet-m-header {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px 18px !important;
    background-color: #FFFFFF !important;
    background: #FFFFFF !important;
    border: none !important;
    cursor: pointer !important;
    text-align: left !important;
    outline: none !important;
    gap: 12px !important;
    box-shadow: none !important;
    color: #004D43 !important;
  }

  .saf-relnet-m-group.is-expanded .saf-relnet-m-header {
    background-color: #F4F8F7 !important;
    background: #F4F8F7 !important;
  }

  .saf-relnet-m-header:focus-visible {
    outline: 2px solid #F4B400;
    outline-offset: -2px;
  }

  .saf-relnet-m-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
  }

  .saf-relnet-m-num {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #F4B400;
    flex-shrink: 0;
  }

  .saf-relnet-m-title {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 15.5px !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    color: #004D43 !important;
    line-height: 1.25 !important;
  }

  .saf-relnet-m-header-right {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
  }

  .saf-relnet-m-count {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #00695C !important;
    background-color: #E6F0EE !important;
    padding: 4px 9px !important;
    border-radius: 4px !important;
    letter-spacing: 0.04em !important;
    line-height: 1 !important;
  }

  .saf-relnet-m-toggle-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #F4F8F7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00695C;
    transition: transform 0.28s ease, background-color 0.28s ease, color 0.28s ease;
  }

  .saf-relnet-m-group.is-expanded .saf-relnet-m-toggle-icon {
    transform: rotate(180deg);
    background-color: #00695C;
    color: #FFFFFF;
  }

  /* Body & Tree list */
  .saf-relnet-m-body {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    background-color: #FAFAF7;
    border-top: 1px solid transparent;
  }

  .saf-relnet-m-group.is-expanded .saf-relnet-m-body {
    max-height: 500px;
    opacity: 1;
    border-top: 1px solid #E6F0EE;
  }

  .saf-relnet-m-tree {
    position: relative;
    padding: 16px 18px 20px 24px;
  }

  .saf-relnet-m-branch-line {
    position: absolute;
    left: 24px;
    top: 16px;
    bottom: 28px;
    width: 2px;
    background: linear-gradient(180deg, #F4B400 0%, #00695C 100%);
    pointer-events: none;
  }

  .saf-relnet-m-projects {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 20px;
  }

  .saf-relnet-m-project-item {
    position: relative;
    display: flex;
    align-items: center;
  }

  .saf-relnet-m-project-connector {
    position: absolute;
    left: -20px;
    top: 50%;
    width: 14px;
    height: 2px;
    background-color: #00695C;
  }

  .saf-relnet-m-project-pill {
    background-color: #FFFFFF;
    border: 1px solid #CFE2DE;
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .saf-relnet-m-project-num {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 800;
    color: #F4B400;
    flex-shrink: 0;
  }

  .saf-relnet-m-project-title {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #004D43;
    line-height: 1.25;
  }
}

/* ------------------------------------------------------------
   CRITICAL 320PX BREAKPOINT
   ------------------------------------------------------------ */
@media (max-width: 360px) {
  #saf_work_project_map {
    padding: 56px 12px !important;
  }

  .saf-relnet-heading {
    font-size: 28px !important;
  }

  .saf-relnet-m-header {
    padding: 12px 10px !important;
    gap: 8px !important;
  }

  .saf-relnet-m-header-left {
    gap: 8px !important;
  }

  .saf-relnet-m-num {
    font-size: 13px !important;
  }

  .saf-relnet-m-title {
    font-size: 12.5px !important;
    hyphens: none !important;
    word-break: normal !important;
    line-height: 1.2 !important;
  }

  .saf-relnet-m-count {
    font-size: 10px !important;
    padding: 3px 6px !important;
  }

  .saf-relnet-m-toggle-icon {
    width: 20px !important;
    height: 20px !important;
  }

  .saf-relnet-m-tree {
    padding: 12px 10px 14px 14px !important;
  }

  .saf-relnet-m-branch-line {
    left: 14px !important;
  }

  .saf-relnet-m-projects {
    padding-left: 14px !important;
  }

  .saf-relnet-m-project-connector {
    left: -14px !important;
    width: 10px !important;
  }

  .saf-relnet-m-project-pill {
    padding: 8px 10px !important;
  }

  .saf-relnet-m-project-title {
    font-size: 12px !important;
  }
}

/* ------------------------------------------------------------
   ACCESSIBILITY & PREFERS-REDUCED-MOTION
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  #saf_work_project_map *,
  #saf_work_project_map *::before,
  #saf_work_project_map *::after {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
