/* Theory of Transformation — interactive triangle + case study modals (client page) */

/* Wrap image + labels + hotspots so % positions match the bitmap bounds */
.tot-triangle-frame {
  position: relative;
  display: block;
  width: 100%;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  container-type: inline-size;
}

.tot-triangle-img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.tot-triangle-labels {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
}

.tot-triangle-label {
  position: absolute;
  margin: 0;
  border: 0;
  font-family: 'AmericanTypewriter', serif !important;
  font-weight: 400;
  font-size: 1.60rem;
  letter-spacing: 0.02em;
  color: #111;
  line-height: 1.15;
  white-space: nowrap;
  background: transparent;
  padding: 0.35em 0.75em;
  border-radius: 4px;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tot-triangle-label:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.tot-triangle-label:focus {
  outline: none;
}

.tot-triangle-label:focus-visible {
  outline: 3px solid #f58220;
  outline-offset: 2px;
}

/*
 * Label anchors (% of .tot-triangle-frame, scales with image).
 * Process: above top vertex. People / Position: below bottom vertices.
 * Strategy: center of inner circle.
 */
.tot-triangle-label--process {
  left: 50%;
  top: 1%;
  transform: translate(-50%, 0);
}

.tot-triangle-label--people {
  left: 13.5%;
  top: 91.5%;
  transform: translate(-50%, 0);
}

.tot-triangle-label--position {
  left: 85.5%;
  top: 91.5%;
  transform: translate(-50%, 0);
}

.tot-triangle-label--strategy {
  left: 50%;
  top: 63%;
  transform: translate(-50%, -50%);
}

/* Modals */
.tot-modal .modal-content {
  border: none;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.tot-modal__dialog--pillars {
  max-width: 38%;
  min-width: 320px;
  width: calc(100% - 2rem);
  max-height: calc(100vh - 3.5rem);
}

.tot-modal__dialog--detail {
  max-width: 720px;
  width: calc(100% - 1.5rem);
}

.tot-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e5e5e5;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tot-modal__close:hover {
  background: #f7f7f7;
}

/* Pillars modal — stage height follows glass content; bg fills stage */
.tot-modal-pillars {
  position: relative;
  padding: 0;
  max-height: calc(100vh - 3.5rem);
  overflow-x: hidden;
  overflow-y: auto;
}

.client_modal_pillars {
  width: 100%;
}

.tot-modal-pillars .tot-modal__close {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.tot-modal-pillars .tot-modal__close:hover {
  background: rgba(255, 255, 255, 0.96);
}

.tot-modal-pillars__stage {
  position: relative;
  width: 100%;
}

.tot-modal-pillars__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.tot-modal-pillars__glass {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 56px 36px 44px;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.389) 0%,
    rgba(0, 0, 0, 0.375) 50%,
    rgba(0, 0, 0, 0.521) 100%
  );
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.tot-modal-pillars__content {
  position: relative;
  z-index: 1;
}

.tot-modal-pillars__quote {
  font-family: 'AmericanTypewriter', serif !important;
  font-size: 1.35rem;
  line-height: 1.45;
  color: #fff;
  margin-bottom: 24px;
  padding-right: 28px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.tot-modal-pillars__feedback {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.82);
}

.tot-modal-pillars__feedback--error {
  color: #ffb4a8;
}

.tot-pillar-list li + li {
  margin-top: 14px;
  font-size: 1.35rem !important;
}

.tot-pillar-item {
  display: flex;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 6px 0;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.35rem;
}

.tot-pillar-item:hover .tot-pillar-item__text {
  color: #f58220;
}

.tot-pillar-bullet {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-right: 14px;
  margin-top: 4px;
  position: relative;
}

.tot-pillar-bullet::before,
.tot-pillar-bullet::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.tot-pillar-bullet::before {
  width: 22px;
  height: 22px;
}

.tot-pillar-bullet::after {
  width: 14px;
  height: 14px;
}

.tot-pillar-bullet span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  background: #f58220;
  transform: translate(-50%, -50%) rotate(45deg);
  z-index: 1;
}

/* Detail modal */
.tot-modal-detail {
  position: relative;
  padding: 0;
}

.tot-modal-detail__inner {
  padding: 44px 32px 32px;
}

.tot-modal-detail__title {
  font-family: 'AmericanTypewriter', serif !important;
  font-size: 1.60rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 8px;
  padding-right: 36px;
}

.tot-modal-detail__title--sm {
  font-size: 1.35rem;
  margin-top: 24px;
}

.tot-modal-detail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.tot-modal-detail__location {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: #444;
}

.tot-modal-detail__pin {
  flex-shrink: 0;
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.tot-modal-detail__region {
  color: #777;
}

.tot-modal-detail__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(245, 130, 32, 0.12);
  color: orange;
  font-weight: 600;
  font-size: 0.85rem;
  margin-left: auto;
}

.tot-modal-detail__feedback {
  font-size: 0.95rem;
  color: #666;
  margin-top: 12px;
}

.tot-modal-detail__feedback--error {
  color: #c0392b;
}

.tot-modal-detail__body {
  margin-top: 20px;
}

.tot-detail-sections {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.tot-detail-section__label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 10px;
  line-height: 1.35;
}

.tot-detail-text {
  white-space: pre-wrap;
  font-size: 1rem;
  line-height: 1.55;
  color: #333;
}

/* Inline case study card (Impact Across Africa) */
.tot-modal-detail--inline {
  border-radius: 20px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.06);
  background: #fff;
  overflow: hidden;
}

.tot-modal-detail__inner--flush {
  padding: 32px 28px 28px;
}

.tot-impact-africa__heading {
  letter-spacing: -0.02em;
}

.tot-impact-africa__sub {
  max-width: 640px;
}

.tot-impact-africa__grid {
  align-items: stretch;
}

.tot-case-detail__header {
  margin-top: 8px;
}

.tot-case-detail__lead {
  font-size: 1.05rem;
  line-height: 1.5;
  color: #555;
  margin: 0 0 0;
  max-width: 100%;
}

.tot-modal-detail__badge--with-icon {
  margin-left: auto;
}

.tot-modal-detail__badge-icon {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.tot-detail-section__icon {
  display: block;
  width: auto;
  max-width: 120px;
  height: auto;
  max-height: 48px;
  margin: 0 0 12px;
  object-fit: contain;
}

.africa-map-interactive-shell .map-region {
  cursor: pointer;
}

.africa-map-interactive-shell .map-region:focus {
  outline: none;
}

.africa-map-interactive-shell .map-region:focus-visible {
  outline: 3px solid #f58220;
  outline-offset: 2px;
}

.africa-map-interactive-shell .map-region.is-selected path,
.africa-map-interactive-shell .map-region-visual.is-selected path {
  filter: brightness(0.97) saturate(1.15);
}

.full-map-block {
  width: 100%;
}

.africa-map-svg--full {
  display: block;
  width: 100%;
  height: auto;
}

.africa-map-svg--full .full-map__visual,
.africa-map-svg--full .full-map__visual path,
.africa-map-svg--full > g:not(.full-map__hits) path {
  pointer-events: none;
}

.africa-map-svg--full .full-map__hits {
  pointer-events: none;
}

.africa-map-svg--full .full-map__hits .map-region {
  pointer-events: all;
  cursor: pointer;
}

.africa-map-svg--full .full-map__hits .map-region path {
  pointer-events: all;
}

.full-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin-top: 20px;
  justify-content: center;
}

.full-map-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #333;
}

.full-map-legend__swatch {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.full-map-legend__swatch--yellow {
  background-color: #f6d980;
}

.full-map-legend__swatch--green {
  background-color: #d0e18c;
}

@media (max-width: 1199px) {
  .tot-modal__dialog--pillars {
    max-width: 48%;
  }
}

@media (max-width: 991px) {
  .tot-modal__dialog--pillars {
    max-width: 72%;
  }
}

@media (max-width: 767px) {
  .tot-modal__dialog--pillars {
    max-width: calc(100% - 1.5rem);
    min-width: 0;
  }

  .tot-modal-pillars__glass {
    padding: 48px 22px 28px;
  }

  .tot-modal-pillars__quote {
    font-size: 1.15rem;
    margin-bottom: 20px;
    padding-right: 24px;
  }

  .tot-pillar-list li + li {
    margin-top: 10px;
  }

  .tot-pillar-item {
    font-size: 1.1rem;
  }

  .tot-modal-detail__inner {
    padding: 40px 18px 22px;
  }

  .tot-detail-sections {
    gap: 18px;
  }

  .tot-detail-section__label {
    font-size: 1rem;
    margin-bottom: 8px;
  }

  .tot-modal-detail__inner--flush {
    padding: 24px 18px 20px;
  }
}
