/* =============================================
   CONCEPTS + FORMULA PAGE  (load with base.css + nav.css)
   Header + tabs live in nav.css
   ============================================= */
.cf-main { padding: clamp(36px, 5vw, 56px) var(--pad) clamp(48px, 6vw, 80px); }
.cf-intro {
  font-size: var(--fs-normal);   /* 25.40 / 20 / 18 */
  line-height: 1.5;
  color: #000;
  margin-bottom: clamp(40px, 6vw, 70px);
}

/* ---- Tree diagram ---- */
.cf-diagram {
  position: relative;
  width: 100%;
  aspect-ratio: 1200 / 420;
  container-type: inline-size;
}
/* Static diagram image. Click-to-zoom (Fancybox) is enabled on mobile only —
   see the zoom badge + JS. Desktop stays a plain image (no zoom-in cursor). */
.cf-diagram-img {
  position: relative;
  display: block;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  cursor: default;
}
.cf-diagram-img img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}
/* Search-plus badge: only shown on mobile, signals the tap-to-zoom action */
.cf-diagram-img__zoom { display: none; }
.cf-diagram__lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.cf-diagram__lines path { vector-effect: non-scaling-stroke; }
.cf-diagram__lines--m { display: none; }   /* desktop uses the --d connectors */
.cf-node {
  position: absolute;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: max(6px, 1.25cqw);
  white-space: nowrap;
}
.cf-node__icon {
  width: 5.83cqw;
  height: 5.83cqw;
  flex-shrink: 0;
  margin-left: -2.915cqw;   /* anchor icon centre on the node's left coordinate */
  object-fit: contain;
  display: block;
}
.cf-node__icon--frozen {
  border: 1.6px solid #069de4;
  border-radius: 16%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cf-node__icon--frozen img { width: 64%; height: 64%; display: block; }
.cf-node__label { font-size: max(10px, 1.67cqw); line-height: 1.35; color: var(--black); }
.cf-node__label--wrap { white-space: normal; max-width: max(56px, 8.3cqw); }

/* ---- Coloured icon bar ---- */
.cf-bar-wrap { margin-top: clamp(48px, 7vw, 90px); }
.cf-bar { display: flex; }
.cf-bar__cell {
  flex: 1 1 0;
  aspect-ratio: 119 / 118;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cf-bar__cell img { width: 57%; height: 57%; object-fit: contain; }
.cf-bar__labels { display: flex; background: #d8e3f6; padding: 12px 0; }
.cf-bar__labels span {
  flex: 1 1 0;
  text-align: center;
  font-size: 15px;
  line-height: 1.3;
  color: #0070c0;
  padding: 0 4px;
}

@media (max-width: 760px) {
  /* Mobile: image is tap-to-zoom — show the cursor + a search-plus badge */
  .cf-diagram-img { cursor: zoom-in; }
  .cf-diagram-img__zoom {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    color: #000;
  }
  .cf-diagram-img__zoom svg { width: 22px; height: 22px; display: block; }

  /* Diagram: full-bleed + wider node spread, labels stay BESIDE the icons
     (so they never cross the vertical connector lines). Mobile connector SVG. */
  .cf-diagram {
    margin-left: calc(0 * var(--pad));
    margin-right: calc(-1 * var(--pad));
    aspect-ratio: 1200 / 520;
  }
  .cf-diagram__lines--d { display: none; }
  .cf-diagram__lines--m { display: block; }

  .cf-node__icon { width: 9cqw; height: 9cqw; margin-left: -4.5cqw; }
  .cf-node__label { font-size: 10px; line-height: 1.2; }
  .cf-node__label--wrap { max-width: 70px; }

  /* Wider node positions for mobile (override the desktop inline values).
     Spine sits at 43% so the right-side labels balance the layout. */
  .cf-node--multiorigin { left: 43% !important; top: 11% !important; }
  .cf-node--oocyte      { left: 17% !important; top: 50% !important; }
  .cf-node--art         { left: 43% !important; top: 50% !important; }
  .cf-node--embryo      { left: 69% !important; top: 50% !important; }
  .cf-node--fresh       { left: 7%  !important; top: 89% !important; }
  .cf-node--mixed       { left: 31% !important; top: 89% !important; }
  .cf-node--frozen      { left: 55% !important; top: 89% !important; }
  .cf-node--banking     { left: 79% !important; top: 89% !important; }

  /* Bar scrolls horizontally but the scrollbar is hidden on touch.
     Cells match the homepage art-concerns tiles (5 across the content width,
     square) and the row bleeds off the right edge (no right padding). */
  .cf-bar-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* old Edge */
    margin-right: calc(-1 * var(--pad));   /* bleed to the right edge */
  }
  .cf-bar-wrap::-webkit-scrollbar { display: none; }  /* Chrome/Safari */
  /* size the rows to their content so the labels' background spans every cell */
  .cf-bar, .cf-bar__labels { width: max-content; }
  .cf-bar__cell {
    flex: 0 0 calc((100vw - 2 * var(--pad)) / 5);   /* = homepage tile width */
    aspect-ratio: 1;                                /* match the homepage tiles */
  }
  .cf-bar__labels span { flex: 0 0 calc((100vw - 2 * var(--pad)) / 5); }
}

/* =============================================
   PATIENTS AT THE CORE  (tab 2)
   ============================================= */
.cf-panel[hidden] { display: none; }

/* Three info cards */
.pc-cards { display: flex; gap: 20px; flex-wrap: wrap; }
.pc-card {
  flex: 1 1 0;
  min-width: 200px;
  position: relative;
  background: var(--gray-bg);   /* #f5f5f5 — Figma */
  padding: 28px;                /* Figma 28.5 / 27.75 */
}
.pc-card__title {
  font-size: var(--fs-normal);  /* 20px @1512 — Figma */
  line-height: 1.5;             /* 30 / 20 */
  font-weight: 700;
  color: #006cb5;
  margin-bottom: 18px;          /* Figma title→list gap */
}
.pc-card__list { list-style: none; }
.pc-card__list li {
  position: relative;
  padding-left: 25px;
  font-size: var(--fs-normal);  /* 20px @1512 — Figma */
  line-height: 1.5;             /* 30 / 20 */
  color: #222;                  /* Figma #222222 */
}
.pc-card__list li::before {
  content: "•";
  position: absolute;
  left: 9px;
  color: #333;
}
.pc-card__badges {
  position: absolute;
  top: 26px;
  right: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-right: 10px;
  margin-top: 10px;
}
.pc-card__badges img { width: 34px; height: auto; }

/* Phone mockups */
.pc-phones {
  margin-top: clamp(40px, 6vw, 70px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
      gap: clamp(16px, 5vw, 90px);
  flex-wrap: wrap;
}
.pc-phone { width: clamp(150px, 21vw, 240px); height: auto; flex-shrink: 0; }

/* Light-blue band behind the legend + colored bar (full-bleed) */
.pc-band {
  margin: clamp(48px, 7vw, 90px) calc(-1 * var(--pad)) calc(-1 * clamp(48px, 6vw, 80px));
  padding: clamp(36px, 5vw, 56px) var(--pad);
  background: #EBF2FF;
}

/* Legend */
.pc-legend {
  display: flex;
  max-width: 890px;
  margin: 0 auto;
}
.pc-legend__item {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  line-height: 1.2;
  color: #000;
  min-width: 130px;
}
.pc-legend__item img { width: 44px; height: 44px; flex-shrink: 0; }

/* Colored category bar */
.pc-bar {
  display: flex;
  max-width: 890px;
  margin: 18px auto 0;
}
.pc-bar__cell {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  aspect-ratio: 148 / 147;
  overflow: hidden;
}
.pc-bar__icon,
.pc-bar__text {
  position: absolute;
  inset: 0;
  transition: opacity 0.35s ease;
}
.pc-bar__icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pc-bar__text {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  color: #fff;
  font-size: 18px;
  line-height: 1.2;
  opacity: 0;
}
.pc-bar__cell:hover .pc-bar__icon,
.pc-bar__cell:focus-within .pc-bar__icon { opacity: 0; }
.pc-bar__cell:hover .pc-bar__text,
.pc-bar__cell:focus-within .pc-bar__text { opacity: 1; }

@media (max-width: 760px) {
  .pc-cards { flex-direction: column; }
  .pc-legend { flex-wrap: wrap; justify-content: flex-start; gap: 12px 22px; max-width: none; }
  .pc-legend__item { flex: 0 0 auto; }
  /* Category bar becomes a 3-wide grid on mobile — bigger icons + labels
     that wrap onto their own rows instead of one cramped scrolling line. */
  .pc-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    max-width: none;
  }
  .pc-bar__text { font-size: 15px; }
}

@media (max-width: 468px) {
  /* Smallest phones: match the homepage tiles' 4-across layout */
  .cf-bar__cell,
  .cf-bar__labels span { flex-basis: calc((100vw - 2 * var(--pad)) / 4); }

  .pc-bar__text { font-size: 13px; }
}
