/*
 * Ratahome editorial diagrams — scoped, semantic, and dependency-free.
 * Visual language: ink, terracotta, ruled paper, and connected decisions.
 * Load after sourcing-hubs.css. No form, booking, or checkout selectors.
 */

.rh-hub .rh-hub-visual {
  padding-block: clamp(36px, 5vw, 64px);
  background: var(--rh-hub-paper, #fcf7f3);
}

.rh-hub .rh-viz {
  --rh-viz-ink: #2b2c27;
  --rh-viz-muted: #54564e;
  --rh-viz-orange: #98440d;
  --rh-viz-orange-light: #efb58b;
  --rh-viz-line: #c6a48a;
  --rh-viz-rule: #ded5cb;
  --rh-viz-paper: #fffcf8;
  --rh-viz-gap: 28px;
  width: 100%;
  min-width: 0;
  margin: 0;
  color: var(--rh-viz-ink);
  border-top: 3px solid var(--rh-viz-orange);
  background: var(--rh-viz-paper);
  isolation: isolate;
}

.rh-hub .rh-viz__heading {
  display: block;
  padding: clamp(24px, 3.4vw, 42px) clamp(20px, 3.8vw, 48px) 26px;
  color: var(--rh-viz-ink);
  background: var(--rh-viz-paper);
}

.rh-hub .rh-viz__heading .rh-hub-kicker {
  margin: 0 0 14px;
  color: var(--rh-viz-orange);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: .15em;
}

.rh-hub .rh-viz__heading h2 {
  max-width: 30ch;
  margin: 0;
  color: var(--rh-viz-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(27px, 3.1vw, 39px);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.rh-hub .rh-viz p.rh-viz__intro {
  max-width: 75ch;
  margin: 15px 0 0;
  color: var(--rh-viz-muted);
  font-size: 15px;
  line-height: 1.7;
}

.rh-hub .rh-viz__canvas {
  min-width: 0;
  padding: clamp(24px, 3.8vw, 48px);
  border-top: 1px solid var(--rh-viz-rule);
  border-bottom: 1px solid var(--rh-viz-rule);
}

.rh-hub .rh-viz :is(h3, p, a, span, th, td) {
  overflow-wrap: anywhere;
}

.rh-hub .rh-viz :is(h3, p) {
  margin: 0;
}

.rh-hub .rh-viz h3 {
  color: var(--rh-viz-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(19px, 1.65vw, 23px);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.rh-hub .rh-viz h3 a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: #b79376;
  text-decoration-thickness: 1px;
  text-underline-offset: .19em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.rh-hub .rh-viz h3 a:hover {
  color: var(--rh-viz-orange);
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
}

.rh-hub .rh-viz a:focus-visible {
  outline: 3px solid var(--rh-viz-orange);
  outline-offset: 5px;
  border-radius: 0;
  text-decoration-color: currentColor;
}

.rh-hub .rh-viz__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--rh-viz-orange);
}

.rh-hub .rh-viz__icon svg {
  display: block;
  width: 26px;
  height: 26px;
  max-width: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rh-hub .rh-viz__node,
.rh-hub .rh-viz__step,
.rh-hub .rh-viz__center {
  position: relative;
  min-width: 0;
}

.rh-hub .rh-viz :is(.rh-viz__node, .rh-viz__step, .rh-viz__center) > p {
  margin-top: 10px;
  color: var(--rh-viz-muted);
  font-size: 14px;
  line-height: 1.6;
  text-wrap: pretty;
}

.rh-hub .rh-viz__center {
  padding: 27px 24px;
  color: #fff;
  background: var(--rh-viz-ink);
}

.rh-hub .rh-viz__center .rh-viz__icon {
  margin-bottom: 15px;
  color: var(--rh-viz-orange-light);
}

.rh-hub .rh-viz__center h3 {
  color: #fff;
  font-size: clamp(23px, 2.2vw, 29px);
}

.rh-hub .rh-viz .rh-viz__center > p {
  color: #e0dfd6;
}

.rh-hub .rh-viz__center h3 a {
  color: #fff;
  text-decoration-color: var(--rh-viz-orange-light);
}

.rh-hub .rh-viz__center h3 a:hover {
  color: var(--rh-viz-orange-light);
}

.rh-hub .rh-viz__center a:focus-visible {
  outline-color: var(--rh-viz-orange-light);
}

.rh-hub .rh-viz__tag {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  color: #77350c;
  border: 1px solid #e3c6ae;
  background: #f5e5d7;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.rh-hub .rh-viz p.rh-viz__takeaway {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px 24px;
  margin: 0;
  padding: 22px clamp(20px, 3.8vw, 48px);
  border-bottom: 1px solid var(--rh-viz-rule);
  background: #f5ebdf;
  font-size: 14px;
  line-height: 1.65;
}

.rh-hub .rh-viz__takeaway > strong {
  padding-top: 3px;
  color: var(--rh-viz-orange);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.rh-hub .rh-viz__takeaway > span {
  color: var(--rh-viz-ink);
}

.rh-hub .rh-viz p.rh-viz__caption {
  margin: 0;
  padding: 16px clamp(20px, 3.8vw, 48px) 20px;
  color: var(--rh-viz-muted);
  font-size: 12px;
  line-height: 1.65;
}

/* Mind map: two branches on either side of a single central decision. */
.rh-hub .rh-viz--map .rh-viz__canvas {
  background-color: #f8f4ed;
  background-image:
    linear-gradient(to right, #e8e0d666 1px, transparent 1px),
    linear-gradient(to bottom, #e8e0d666 1px, transparent 1px);
  background-size: 24px 24px;
}

.rh-hub .rh-viz__map {
  --rh-map-column-gap: 54px;
  --rh-map-row-gap: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(175px, .9fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--rh-map-row-gap) var(--rh-map-column-gap);
  align-items: stretch;
  min-width: 0;
}

.rh-hub .rh-viz__map > .rh-viz__center {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: center;
  z-index: 1;
  border-top: 3px solid var(--rh-viz-orange);
}

.rh-hub .rh-viz__branches {
  display: contents;
  padding: 0;
  margin: 0;
  list-style: none;
}

.rh-hub .rh-viz__map .rh-viz__node {
  padding: 21px 19px 23px;
  margin: 0;
  border: 1px solid var(--rh-viz-rule);
  border-top: 2px solid var(--rh-viz-line);
  background: var(--rh-viz-paper);
  list-style: none;
}

.rh-hub .rh-viz__map .rh-viz__node > .rh-viz__icon {
  margin-bottom: 13px;
}

.rh-hub .rh-viz__map .rh-viz__node:nth-child(1) { grid-area: 1 / 1; }
.rh-hub .rh-viz__map .rh-viz__node:nth-child(2) { grid-area: 2 / 1; }
.rh-hub .rh-viz__map .rh-viz__node:nth-child(3) { grid-area: 1 / 3; }
.rh-hub .rh-viz__map .rh-viz__node:nth-child(4) { grid-area: 2 / 3; }

/* The elbow starts at each node centre and meets the central root's midline. */
.rh-hub .rh-viz__map .rh-viz__node::before,
.rh-hub .rh-viz__map .rh-viz__node::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.rh-hub .rh-viz__map .rh-viz__node::before {
  width: calc(var(--rh-map-column-gap) / 2);
  height: calc(50% + var(--rh-map-row-gap) / 2 + 1px);
}

.rh-hub .rh-viz__map .rh-viz__node:nth-child(-n + 2)::before {
  left: 100%;
  border-right: 2px solid var(--rh-viz-line);
}

.rh-hub .rh-viz__map .rh-viz__node:nth-child(n + 3)::before {
  right: 100%;
  border-left: 2px solid var(--rh-viz-line);
}

.rh-hub .rh-viz__map .rh-viz__node:nth-child(odd)::before {
  top: 50%;
  border-top: 2px solid var(--rh-viz-line);
}

.rh-hub .rh-viz__map .rh-viz__node:nth-child(even)::before {
  bottom: 50%;
  border-bottom: 2px solid var(--rh-viz-line);
}

.rh-hub .rh-viz__map .rh-viz__node:nth-child(odd)::after {
  top: calc(100% + var(--rh-map-row-gap) / 2);
  width: calc(var(--rh-map-column-gap) / 2 + 1px);
  height: 2px;
  background: var(--rh-viz-line);
}

.rh-hub .rh-viz__map .rh-viz__node:nth-child(1)::after {
  left: calc(100% + var(--rh-map-column-gap) / 2);
}

.rh-hub .rh-viz__map .rh-viz__node:nth-child(3)::after {
  right: calc(100% + var(--rh-map-column-gap) / 2);
}

/* Process: a numbered horizontal rail with real continuity, not separate tiles. */
.rh-hub .rh-viz--flow .rh-viz__canvas {
  background: #f4ecdf;
}

.rh-hub .rh-viz__flow {
  --rh-flow-gap: 25px;
  display: grid;
  grid-template-columns: repeat(var(--rh-viz-count, 4), minmax(0, 1fr));
  gap: var(--rh-flow-gap);
  padding: 0;
  margin: 0;
  list-style: none;
}

.rh-hub .rh-viz__flow > .rh-viz__step {
  padding: 0;
  margin: 0;
  list-style: none;
}

.rh-hub .rh-viz__flow > .rh-viz__step:not(:last-child)::before {
  position: absolute;
  top: 17px;
  left: 36px;
  width: calc(100% + var(--rh-flow-gap) - 36px);
  height: 2px;
  background: var(--rh-viz-line);
  pointer-events: none;
  content: "";
}

.rh-hub .rh-viz__number {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--rh-viz-orange);
  border: 1px solid var(--rh-viz-orange);
  border-radius: 50%;
  background: #f4ecdf;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.rh-hub .rh-viz__step:first-child > .rh-viz__number {
  color: #fff;
  border-color: var(--rh-viz-orange);
  background: var(--rh-viz-orange);
}

.rh-hub .rh-viz__step > .rh-viz__icon {
  display: flex;
  margin: 24px 0 14px;
}

.rh-hub .rh-viz__step > .rh-viz__tag {
  margin-top: 15px;
}

/* Lanes: one comparison surface, with native table headings retained. */
.rh-hub .rh-viz--lanes .rh-viz__canvas {
  padding: 0;
  background: #fff;
}

.rh-hub .rh-viz__table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--rh-viz-ink);
  font-size: 14px;
  line-height: 1.65;
  text-align: left;
}

.rh-hub .rh-viz__table :is(th, td) {
  padding: 22px clamp(14px, 2.1vw, 28px);
  border: 0;
  border-right: 1px solid var(--rh-viz-rule);
  border-bottom: 1px solid var(--rh-viz-rule);
  vertical-align: top;
  text-align: left;
}

.rh-hub .rh-viz__table thead th {
  padding-block: 18px;
  color: #fff;
  border-right-color: #57594f;
  border-bottom: 0;
  background: var(--rh-viz-ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .065em;
  text-transform: uppercase;
}

.rh-hub .rh-viz__table thead th:first-child {
  width: 24%;
  color: var(--rh-viz-orange-light);
}

.rh-hub .rh-viz__table tbody th {
  color: var(--rh-viz-ink);
  background: #f5eee5;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

.rh-hub .rh-viz__table tbody th > .rh-viz__icon {
  display: flex;
  margin-bottom: 10px;
}

.rh-hub .rh-viz__table tbody th > span:last-child {
  display: block;
}

.rh-hub .rh-viz__table tbody td {
  color: var(--rh-viz-muted);
  background: #fffcf8;
}

.rh-hub .rh-viz__table tbody tr:nth-child(even) td {
  background: #f7f4ee;
}

.rh-hub .rh-viz__table tr > :last-child { border-right: 0; }
.rh-hub .rh-viz__table tbody tr:last-child > * { border-bottom: 0; }
.rh-hub .rh-viz__cell-label { display: none; }

/* Three-way decision: one question, one shared trunk, three conditional paths. */
.rh-hub .rh-viz--decision .rh-viz__canvas {
  background: #f7f3ed;
}

.rh-hub .rh-viz__decision-root {
  width: min(100%, 510px);
  margin-inline: auto;
  text-align: center;
}

.rh-hub .rh-viz__decision-root > .rh-viz__icon {
  display: flex;
  margin-inline: auto;
}

.rh-hub .rh-viz__decision-root::after {
  position: absolute;
  top: 100%;
  left: calc(50% - 1px);
  width: 2px;
  height: 24px;
  background: var(--rh-viz-line);
  pointer-events: none;
  content: "";
}

.rh-hub .rh-viz__decision-branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--rh-viz-gap);
  padding: 0;
  margin: 48px 0 0;
  list-style: none;
}

.rh-hub .rh-viz__decision-branches::before {
  position: absolute;
  top: -24px;
  left: calc((100% - 2 * var(--rh-viz-gap)) / 6);
  right: calc((100% - 2 * var(--rh-viz-gap)) / 6);
  height: 2px;
  background: var(--rh-viz-line);
  pointer-events: none;
  content: "";
}

.rh-hub .rh-viz__decision-branches > .rh-viz__node {
  padding: 22px;
  margin: 0;
  border-top: 3px solid var(--rh-viz-orange);
  border-bottom: 1px solid var(--rh-viz-rule);
  background: var(--rh-viz-paper);
  list-style: none;
}

.rh-hub .rh-viz__decision-branches > .rh-viz__node::before {
  position: absolute;
  top: -27px;
  left: calc(50% - 1px);
  width: 2px;
  height: 24px;
  background: var(--rh-viz-line);
  pointer-events: none;
  content: "";
}

.rh-hub .rh-viz__decision-branches .rh-viz__tag {
  display: table;
  margin-bottom: 17px;
}

.rh-hub .rh-viz__decision-branches .rh-viz__icon {
  display: flex;
  margin-bottom: 12px;
}

/* Tablet: the map becomes a readable vertical tree instead of cramped columns. */
@media (max-width: 980px) {
  .rh-hub .rh-viz__map {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .rh-hub .rh-viz__map > .rh-viz__center {
    width: 100%;
    align-self: stretch;
  }

  .rh-hub .rh-viz__map > .rh-viz__center::after {
    position: absolute;
    top: 100%;
    left: 12px;
    width: 2px;
    height: 24px;
    background: var(--rh-viz-line);
    content: "";
  }

  .rh-hub .rh-viz__map .rh-viz__node {
    margin-left: 30px;
    padding: 20px;
  }

  .rh-hub .rh-viz__map .rh-viz__node:nth-child(n)::before {
    top: -24px;
    right: auto;
    bottom: -24px;
    left: -19px;
    width: 2px;
    height: auto;
    border: 0;
    background: var(--rh-viz-line);
  }

  .rh-hub .rh-viz__map .rh-viz__node:last-child::before {
    bottom: auto;
    height: 57px;
  }

  .rh-hub .rh-viz__map .rh-viz__node:nth-child(n)::after {
    top: 31px;
    right: auto;
    left: -19px;
    width: 19px;
    height: 2px;
    border: 0;
    background: var(--rh-viz-line);
  }
}

@media (max-width: 820px) {
  .rh-hub .rh-viz__flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }

  .rh-hub .rh-viz__flow > .rh-viz__step {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    column-gap: 21px;
    align-content: start;
  }

  .rh-hub .rh-viz__flow > .rh-viz__step:not(:last-child)::before {
    top: 36px;
    right: auto;
    bottom: -30px;
    left: 17px;
    width: 2px;
    height: auto;
  }

  .rh-hub .rh-viz__step > .rh-viz__number {
    grid-column: 1;
    grid-row: 1 / 5;
  }

  .rh-hub .rh-viz__step > .rh-viz__icon {
    grid-column: 2;
    grid-row: 1;
    margin: 2px 0 12px;
  }

  .rh-hub .rh-viz__step > h3 { grid-column: 2; grid-row: 2; }
  .rh-hub .rh-viz__step > p { grid-column: 2; grid-row: 3; }
  .rh-hub .rh-viz__step > .rh-viz__tag { grid-column: 2; grid-row: 4; }

  .rh-hub .rh-viz__decision-root {
    width: 100%;
    text-align: left;
  }

  .rh-hub .rh-viz__decision-root > .rh-viz__icon {
    margin-left: 0;
  }

  .rh-hub .rh-viz__decision-root::after {
    left: 12px;
  }

  .rh-hub .rh-viz__decision-branches {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin-top: 24px;
    padding-left: 30px;
  }

  .rh-hub .rh-viz__decision-branches::before { display: none; }

  .rh-hub .rh-viz__decision-branches > .rh-viz__node::before {
    top: -27px;
    bottom: -27px;
    left: -18px;
    width: 2px;
    height: auto;
  }

  .rh-hub .rh-viz__decision-branches > .rh-viz__node:last-child::before {
    bottom: auto;
    height: 61px;
  }

  .rh-hub .rh-viz__decision-branches > .rh-viz__node::after {
    position: absolute;
    top: 32px;
    left: -18px;
    width: 18px;
    height: 2px;
    background: var(--rh-viz-line);
    pointer-events: none;
    content: "";
  }
}

/* Table-to-row cards: all cell content remains visible and labelled. */
@media (max-width: 760px) {
  .rh-hub .rh-viz__table,
  .rh-hub .rh-viz__table tbody {
    display: block;
    width: 100%;
  }

  .rh-hub .rh-viz__table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .rh-hub .rh-viz__table tbody tr {
    display: block;
    margin: 0;
    border-bottom: 1px solid var(--rh-viz-rule);
  }

  .rh-hub .rh-viz__table tbody tr:last-child { border-bottom: 0; }

  .rh-hub .rh-viz__table tbody th {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 17px 20px;
    border: 0;
    color: #fff;
    background: var(--rh-viz-ink);
    font-size: 17px;
  }

  .rh-hub .rh-viz__table tbody th > .rh-viz__icon {
    width: 26px;
    height: 26px;
    margin: 0;
    color: var(--rh-viz-orange-light);
  }

  .rh-hub .rh-viz__table tbody td {
    display: grid;
    grid-template-columns: minmax(68px, .38fr) minmax(0, 1fr);
    gap: 16px;
    padding: 16px 20px;
    border: 0;
    border-bottom: 1px solid var(--rh-viz-rule);
    font-size: 14px;
  }

  .rh-hub .rh-viz__table tbody tr:last-child > td {
    border-bottom: 1px solid var(--rh-viz-rule);
  }

  .rh-hub .rh-viz__table tbody tr > td:last-child { border-bottom: 0; }

  .rh-hub .rh-viz__table .rh-viz__cell-label {
    display: block;
    padding-top: 2px;
    color: var(--rh-viz-orange);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.55;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
}

@media (max-width: 480px) {
  .rh-hub .rh-hub-visual { padding-block: 30px; }
  .rh-hub .rh-viz__heading { padding: 25px 20px 22px; }
  .rh-hub .rh-viz__heading h2 { font-size: 28px; }
  .rh-hub .rh-viz__canvas { padding: 25px 20px; }
  .rh-hub .rh-viz--lanes .rh-viz__canvas { padding: 0; }
  .rh-hub .rh-viz__center { padding: 24px 20px; }
  .rh-hub .rh-viz__center h3 { font-size: 25px; }
  .rh-hub .rh-viz h3 { text-wrap: pretty; }
  .rh-hub .rh-viz__map .rh-viz__node { padding: 18px 16px 20px; }
  .rh-hub .rh-viz__decision-branches > .rh-viz__node { padding: 20px 16px; }
  .rh-hub .rh-viz__flow > .rh-viz__step { column-gap: 16px; }
  .rh-hub .rh-viz p.rh-viz__takeaway { grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 19px 20px; }
  .rh-hub .rh-viz p.rh-viz__caption { padding: 14px 20px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .rh-hub .rh-viz h3 a { transition: none; }
}

@media (forced-colors: active) {
  .rh-hub .rh-viz :is(.rh-viz__node, .rh-viz__center, .rh-viz__tag, .rh-viz__number) {
    border: 1px solid CanvasText;
  }
  .rh-hub .rh-viz :is(.rh-viz__node, .rh-viz__step, .rh-viz__decision-root, .rh-viz__decision-branches)::before,
  .rh-hub .rh-viz :is(.rh-viz__node, .rh-viz__center)::after {
    border-color: CanvasText;
    background-color: CanvasText;
  }
}

@media print {
  .rh-hub .rh-hub-visual { padding-block: 18px; }
  .rh-hub .rh-viz { break-inside: avoid; border-top-width: 2px; }
  .rh-hub .rh-viz__heading { padding: 18px 20px; }
  .rh-hub .rh-viz__heading h2 { font-size: 22pt; }
  .rh-hub .rh-viz__canvas { padding: 20px; }
  .rh-hub .rh-viz--lanes .rh-viz__canvas { padding: 0; }
  .rh-hub .rh-viz__center,
  .rh-hub .rh-viz__table thead th,
  .rh-hub .rh-viz__table tbody th { border: 1px solid #999; background: #fff; }
  .rh-hub .rh-viz :is(h2, h3, p, th, td, .rh-viz__icon, .rh-viz__tag) { color: #000; }
  .rh-hub .rh-viz .rh-viz__center > p { color: #000; }
}
