﻿/* ---------- "All solutions" (Views/Shared/_SolutionOverview.cshtml): the line's categories and their solutions as a tree ----------
   The whole tree starts open and each category folds on a click (user, 06/11). Desktops draw it left to right: the service,
   its categories on a dashed wire, each category's solutions on a solid one. Tablets and phones stand it upright (below).
   Calm palette (user, 06/11): one accent, the service; categories white with a cyan edge; solutions white rows with an
   arrow (user, 20/11); wires a light cyan; hover a pale cyan. */
.sov-tree {
  --sov-ink: #0e2a38;
  --sov-accent: #00c2cb;
  --sov-cyan: #9fe3e7;
  --sov-line: #d4eff1;
  --sov-gap: 4rem;
  --sov-half: calc(var(--sov-gap) / 2);
  /* No frame (user, 06/11): the tree sits on the section's own background, the head's own margin above it */
}
.sov-tree__root {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  border-radius: 1.2rem;
  border: 2px solid var(--sov-accent);
  background: #ffffff;
  font-weight: 800;
  line-height: 1.3;
  color: var(--sov-ink);
  /* The icon and the service's name on one row, the name on one line (user, 06/11) */
  white-space: nowrap;
}
.sov-tree__icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 0.8rem;
  background: var(--sov-accent);
  color: #ffffff;
}
/* A category's head: a click folds or unfolds its solutions */
.sov-node__head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 4.6rem;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--sov-line);
  border-radius: 1.2rem;
  background: #ffffff;
  box-shadow: inset 3px 0 0 var(--sov-accent);
  font: inherit;
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  color: var(--sov-ink);
  cursor: pointer;
  scroll-margin-top: 14rem;
  transition: border-color 0.2s, background-color 0.2s;
}
.sov-node__head:hover,
.sov-node__head:focus-visible {
  border-color: #b9e6e9;
  background: #e6f9fa;
}
.sov-node__chevron {
  display: flex;
  flex: none;
  color: #00a3ab;
  transition: transform 0.2s;
}
/* Its chevron points down while it is open */
.sov-node.is-open .sov-node__chevron {
  transform: rotate(90deg);
}
/* Names on two or three lines split evenly ("Gia công / dự án", not "Gia công dự / án"); the line count stays the same */
.sov-node__name {
  text-wrap: balance;
}
/* A few words under the category's name (category.yaml: tagline) */
.sov-node__tagline {
  display: block;
  margin-top: 0.2rem;
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a9ca6;
}
html[lang=ja] .sov-node__tagline {
  letter-spacing: 0.02em;
}
/* Its solutions: every row as wide as the longest, so their arrows line up */
.sov-leaves {
  display: none;
  flex-direction: column;
  align-items: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sov-node.is-open .sov-leaves {
  display: flex;
}
.sov-leaves li {
  position: relative;
  max-width: 100%;
}
/* Its stub in from the wire */
.sov-leaves li::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  width: calc(var(--sov-half) + 1px);
  border-top: 2px solid var(--sov-cyan);
}
/* A link to the solution's page. User, 20/11: the teal text alone did not read as a link, so each solution is a white row
   with a thin border, its name in navy and an arrow in a pale circle at its end. On hover the border turns cyan and the
   arrow nudges right; the circle stays pale, so the row is not mistaken for the estimator's .est-link (white pill, solid
   cyan circle). */
.sov-leaf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.6rem 0.6rem 1.4rem;
  border: 1px solid var(--sov-line);
  border-radius: 1rem;
  background: #ffffff;
  /* Large enough to read at a glance (user, 06/11: the solutions were too small) */
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.35;
  color: var(--sov-ink);
  text-decoration: none;
  transition: border-color 0.2s;
}
.sov-leaf__name {
  flex: 1;
  min-width: 0;
  /* Long tokens may break on the narrowest phones */
  overflow-wrap: anywhere;
}
.sov-leaf__go {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: #e6f9fa;
  color: #008c94;
  transition: transform 0.2s;
}
.sov-leaf:hover,
.sov-leaf:focus-visible {
  border-color: var(--sov-accent);
}
.sov-leaf:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--sov-accent);
}
.sov-leaf:hover .sov-leaf__go,
.sov-leaf:focus-visible .sov-leaf__go {
  transform: translateX(2px);
}
html[lang=ja] .sov-tree :is(.sov-tree__root, .sov-node__head, .sov-leaf__name) {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* Desktops: left to right. The service in the first column, centred on the whole tree; each category a row of the second
   column, its head centred on its solutions. Every branch draws its own piece of the wire it hangs from (the first from
   its middle down, the last from the top to its middle), so each wire runs from its first branch to its last, whatever is
   open; a head's line out meets it. The tree is as wide as its branches, centred in its frame. */
@media (min-width: 1024px) {
  .sov-tree {
    /* Wide enough that every category name fits on two lines in all three languages (the solutions' column beside it
       left room for it on 06/11), so the heads share one height */
    --sov-cat-w: 24rem;
    /* A category's room above and below, and a solution's */
    --sov-node-pad: 1.2rem;
    --sov-leaf-pad: 0.5rem;
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    column-gap: var(--sov-gap);
    /* The first category's solutions and the last branch reach the tree's edges with that room still around them: taken back
       here, so the head's 4.8rem above and the section's 9.6rem below are the space that shows */
    margin: calc(-1 * (var(--sov-node-pad) + var(--sov-leaf-pad))) 0 calc(-1 * var(--sov-node-pad));
  }
  .sov-tree__root {
    grid-column: 1;
    grid-row: 1 / span var(--sov-rows);
    align-self: center;
    justify-self: end;
    padding: 0.7rem 1.4rem 0.7rem 0.7rem;
    font-size: var(--fs-body);
  }
  /* Its line out to the categories' wire */
  .sov-tree__root::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    width: var(--sov-half);
    border-top: 1.5px dashed var(--sov-cyan);
  }
  /* A category: its head, then its solutions */
  .sov-node {
    position: relative;
    grid-column: 2;
    grid-row: var(--sov-row);
    display: flex;
    align-items: center;
    min-width: 0;
    padding: var(--sov-node-pad) 0;
  }
  /* Its piece of the dashed wire from the service */
  .sov-node::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(-1 * var(--sov-half));
    border-left: 1.5px dashed var(--sov-cyan);
  }
  .sov-node:first-of-type::before {
    top: 50%;
  }
  .sov-node:last-of-type::before {
    bottom: 50%;
  }
  .sov-node:only-of-type::before {
    display: none;
  }
  .sov-node__head {
    flex: 0 0 var(--sov-cat-w);
    min-height: 5.6rem;
    font-size: var(--fs-small);
  }
  /* Japanese category names break only at "・": a size that keeps "コンサルティング・" on one line */
  html[lang=ja] .sov-node__head {
    font-size: var(--fs-small);
  }
  /* Its line in from the wire, and out to its solutions when open */
  .sov-node__head::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    width: calc(var(--sov-half) + 1px);
    border-top: 1.5px dashed var(--sov-cyan);
  }
  .sov-node.is-open .sov-node__head::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    width: calc(var(--sov-half) + 1px);
    border-top: 2px solid var(--sov-cyan);
  }
  .sov-node.is-open .sov-leaves {
    flex: 1;
    min-width: 0;
    margin-left: var(--sov-gap);
  }
  /* Each solution: its piece of the category's wire and its stub */
  .sov-leaves li {
    padding: var(--sov-leaf-pad) 0;
  }
  .sov-leaves li::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(-1 * var(--sov-half) - 1px);
    border-left: 2px solid var(--sov-cyan);
  }
  .sov-leaves li:first-child::after {
    top: 50%;
  }
  .sov-leaves li:last-child::after {
    bottom: 50%;
  }
  .sov-leaves li:only-child::after {
    display: none;
  }
}
@media (min-width: 1200px) {
  .sov-tree {
    --sov-gap: 4.8rem;
    --sov-node-pad: 1.4rem;
  }
  .sov-tree__root {
    font-size: var(--fs-body);
  }
  .sov-tree__icon {
    width: 3.6rem;
    height: 3.6rem;
  }
  .sov-tree__icon svg {
    width: 2rem;
    height: 2rem;
  }
  .sov-node__head {
    gap: 1rem;
    min-height: 6.6rem;
    padding: 1rem 1.6rem;
    border-radius: 1.6rem;
    font-size: var(--fs-body);
  }
  html[lang=ja] .sov-node__head {
    font-size: var(--fs-body);
  }
  .sov-node__chevron svg {
    width: 1.8rem;
    height: 1.8rem;
  }
  .sov-leaf {
    font-size: var(--fs-body);
  }
}

/* Tablets and phones: upright. The service's box on top (one compact row, user 06/11; tablets only, phones drop it below),
   its categories down a dashed wire that starts under its icon, each category's solutions hanging under it on a solid wire. */
@media (max-width: 1023px) {
  .sov-tree {
    --sov-half: 1.8rem;
    /* Where the categories' wire runs: under the middle of the service's icon */
    --sov-trunk: 2.2rem;
    --sov-stub: 1.4rem;
  }
  .sov-tree__root {
    display: flex;
    width: max-content;
    max-width: 100%;
    padding: 0.6rem 1.4rem 0.6rem 0.6rem;
    font-size: var(--fs-body);
  }
  .sov-tree__icon {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 0.7rem;
  }
  .sov-node {
    position: relative;
    margin-left: calc(var(--sov-trunk) - 1px);
    padding: 1rem 0 0 var(--sov-stub);
  }
  /* Each category draws its piece of the dashed wire: the whole category, but the last one only down to its head's
     middle, so the wire ends at the last category; a stub runs into each head */
  .sov-node:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-left: 1.5px dashed var(--sov-cyan);
  }
  .sov-node:last-child .sov-node__head::after {
    content: "";
    position: absolute;
    top: calc(-1rem - 1px);
    bottom: 50%;
    left: calc(-1 * var(--sov-stub) - 1px);
    border-left: 1.5px dashed var(--sov-cyan);
  }
  .sov-node__head::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    width: calc(var(--sov-stub) + 1px);
    border-top: 1.5px dashed var(--sov-cyan);
  }
  .sov-node.is-open .sov-leaves {
    gap: 0.8rem;
    margin: 0.8rem 0 0.4rem 1.4rem;
    padding-left: var(--sov-half);
  }
  /* Each solution draws its piece of the wire (through the gap under it), the first from the category's head down, the
     last only to its middle, so the wire ends at the last solution */
  .sov-leaves li::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: -0.8rem;
    left: calc(-1 * var(--sov-half));
    border-left: 2px solid var(--sov-cyan);
  }
  .sov-leaves li:first-child::after {
    top: -0.8rem;
  }
  .sov-leaves li:last-child::after {
    bottom: 50%;
  }
}
@media (max-width: 767px) {
  /* Phones: no service's box (user, 20/11). The page's title and the breadcrumb above already name the service, and the
     box cost every row the indent of the categories' wire (35px), so solution names wrapped. Each category starts at the
     left edge with its solutions on their own wire under it; no dashed wire joins the categories. */
  .sov-tree__root {
    display: none;
  }
  .sov-node {
    margin-left: 0;
    padding-left: 0;
  }
  .sov-node:first-of-type {
    padding-top: 0;
  }
  .sov-node:not(:last-child)::before,
  .sov-node:last-child .sov-node__head::after,
  .sov-node__head::before {
    content: none;
  }
  .sov-node__head {
    min-height: 4.4rem;
    font-size: var(--fs-small);
  }
  .sov-node.is-open .sov-leaves {
    margin-left: 1rem;
  }
  .sov-leaf {
    font-size: var(--fs-body);
  }
}

/* The last branch, for what the tree does not list (user, 18/11): a category's head on a dashed frame with a +, and a line
   saying what to send; one link to the line's form. Desktops put the line beside the head, where solutions would hang;
   tablets and phones under it. */
.sov-other {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.8rem;
  color: inherit;
  text-decoration: none;
}
.sov-tree .sov-other__head {
  border: 1.5px dashed var(--sov-accent);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.7);
}
.sov-other:hover .sov-other__head,
.sov-other:focus-visible .sov-other__head {
  border-style: solid;
  background: #e6f9fa;
}
.sov-other:focus-visible {
  outline: none;
}
.sov-other:focus-visible .sov-other__head {
  box-shadow: 0 0 0 2px var(--sov-accent);
}
.sov-other__plus {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: #e6f9fa;
  color: #00a3ab;
  transition: background-color 0.2s, color 0.2s;
}
.sov-other:hover .sov-other__plus,
.sov-other:focus-visible .sov-other__plus {
  background: var(--sov-accent);
  color: #ffffff;
}
.sov-other__text {
  display: block;
  font-size: var(--fs-small);
  line-height: 1.55;
  color: #3e5662;
}
/* What the branch covers (SOV_OTHER_TAGS), above its line */
.sov-other__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}
.sov-other__cta {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  font-weight: 700;
  color: #005c63;
}
.sov-other:hover .sov-other__cta,
.sov-other:focus-visible .sov-other__cta {
  text-decoration: underline;
  text-decoration-color: var(--sov-cyan);
  text-underline-offset: 0.3rem;
}
@media (min-width: 1024px) {
  .sov-other {
    flex-direction: row;
    align-items: center;
    gap: var(--sov-gap);
  }
  .sov-other__text {
    max-width: 38rem;
  }
}
@media (max-width: 1023px) {
  .sov-other .sov-other__head {
    width: 100%;
  }
  /* Under the head, where its first solution would start */
  .sov-other__text {
    margin-left: calc(1.4rem + var(--sov-half));
  }
}
@media (max-width: 767px) {
  .sov-other__text {
    margin-left: calc(1rem + var(--sov-half));
  }
}

/* Dedicated Teams, under the tree: the languages with their flags, then the AI tools */
.sov-extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.2rem;
  margin-top: 2.4rem;
  padding: 1.8rem 2.4rem;
  border: 1px solid #d4eff1;
  border-radius: 1.6rem;
  background: #ffffff;
}
.sov-extra__label {
  font-size: var(--fs-label);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5a7380;
}
html[lang=ja] .sov-extra__label {
  letter-spacing: 0.02em;
}
/* A language's flag before its name, in its tag (.tag, main.css) */
.sov-extra__flag {
  flex: none;
  width: 2rem;
  margin-right: 0.8rem;
  height: 1.4rem;
  border-radius: 0.3rem;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(14, 42, 56, 0.12);
}
.sov-extra__ai {
  flex: 1 1 28rem;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: #3e5662;
}
@media (min-width: 768px) {
  .sov-extra__ai {
    padding-left: 1.6rem;
    border-left: 1px solid #e3eef0;
  }
}
@media (max-width: 767px) {
  .sov-extra {
    padding: 1.6rem;
  }
  .sov-extra__label {
    flex-basis: 100%;
  }
}

/* What a category covers (category.yaml: summary, scope), the first row of its branch: plain text and scope tags, no
   stub from the wire and no link (since 24/11/2026) */
.sov-leaves li.sov-brief {
  margin-bottom: 0.4rem;
}
.sov-leaves li.sov-brief::before {
  display: none;
}
.sov-brief__text {
  margin: 0 0 0.8rem;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: #5a7380;
}
.sov-brief__scope {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
