/*
 * Afghanistan service-grid layout — native CSS geometry.
 * Replaces the former JavaScript-driven 1037 x 900 scaled package.
 */

.afg-section .afg-services {
  container: afg-services / inline-size;
}

.afg-section .why-choose-one {
  --why-bg: #f3f9fd;
  --why-title: #17324a;
  --why-copy: #5a7185;
  --why-line-rgb: 84, 111, 132;
  --why-shared-line-width: 2px;
  --why-counter: rgb(23 50 74 / 12%);
  --why-font: "IRANSansX", "IRANYekanX", Tahoma, Arial, sans-serif;
  --why-cross-y: 47.5%;

  width: 100%;
  margin-top: clamp(14px, 1.2vw, 20px);
  overflow: hidden;
  background: var(--why-bg);
  color: var(--why-title);
  font-family: var(--why-font);
  direction: ltr;
}

.afg-section .why-choose-one,
.afg-section .why-choose-one *,
.afg-section .why-choose-one *::before,
.afg-section .why-choose-one *::after {
  box-sizing: border-box;
}

.afg-section .why-choose-one__stage {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1037 / 900;
  margin-inline: auto;
  overflow: hidden;
  isolation: isolate;
  background: var(--why-bg);
}

.afg-section .why-choose-one__grid-wrap {
  position: absolute;
  inset: 8% 4.0501% 0.8889% 4.7252%;
}

.afg-section .why-choose-one__grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: var(--why-cross-y) calc(100% - var(--why-cross-y));
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: why-item;
}

.afg-section .why-choose-one__item {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  counter-increment: why-item;
}

.afg-section .why-choose-one__single {
  position: absolute;
  inset: 0;
}

.afg-section .why-choose-one__copy {
  position: absolute;
  width: 77.59%;
  direction: rtl;
}

.afg-section .why-choose-one__item--left .why-choose-one__copy {
  right: 16.07%;
}

.afg-section .why-choose-one__item--right .why-choose-one__copy {
  left: 15.86%;
}

.afg-section .why-choose-one__item--top .why-choose-one__copy {
  top: 7.19%;
}

.afg-section .why-choose-one__item--bottom .why-choose-one__copy {
  top: 16.72%;
}

.afg-section .why-choose-one__title {
  margin: 0;
  color: var(--why-title);
  font-family: var(--why-font);
  font-size: clamp(17px, 3.086cqi, 32px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-align: right;
  direction: rtl;
}

.afg-section .why-choose-one__text {
  width: 100%;
  margin: clamp(14px, 2.411cqi, 25px) 0 0;
  color: var(--why-copy);
  font-size: clamp(14.5px, 2.7cqi, 28px);
  font-weight: 400;
  line-height: clamp(23px, 4.05cqi, 42px);
  letter-spacing: -0.008em;
  text-align: justify;
  text-align-last: right;
  direction: rtl;
}

.afg-section .why-choose-one__count {
  display: none;
}

.afg-section .why-choose-one__count::before {
  content: counter(why-item, decimal-leading-zero);
}

.afg-section .why-choose-one__divider {
  position: absolute;
  z-index: 5;
  display: block;
  pointer-events: none;
}

.afg-section .why-choose-one__divider--vertical {
  left: calc(50% - (var(--why-shared-line-width) / 2));
  top: 0;
  width: var(--why-shared-line-width);
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(var(--why-line-rgb), 0) 0%,
    rgba(var(--why-line-rgb), 0.5) 33.333%,
    rgba(var(--why-line-rgb), 0.5) 66.666%,
    rgba(var(--why-line-rgb), 0) 100%
  );
}

.afg-section .why-choose-one__divider--horizontal {
  left: 0;
  top: calc(var(--why-cross-y) - (var(--why-shared-line-width) / 2));
  width: 100%;
  height: var(--why-shared-line-width);
  background: linear-gradient(
    to left,
    rgba(var(--why-line-rgb), 0) 0%,
    rgba(var(--why-line-rgb), 0.5) 33.333%,
    rgba(var(--why-line-rgb), 0.5) 66.666%,
    rgba(var(--why-line-rgb), 0) 100%
  );
}

.afg-section .why-choose-one__counter {
  --why-counter-size: clamp(74px, 12.729cqi, 132px);
  --why-piece-size: calc(var(--why-counter-size) * 0.462121);
  --why-led-size: clamp(8px, 1.35cqi, 14px);

  position: absolute;
  z-index: 4;
  left: calc(50% - (var(--why-counter-size) / 2));
  top: calc(var(--why-cross-y) - (var(--why-counter-size) / 2));
  width: var(--why-counter-size);
  height: var(--why-counter-size);
  pointer-events: none;
}

.afg-section .why-choose-one__counter-piece {
  position: absolute;
  display: block;
  width: var(--why-piece-size);
  height: var(--why-piece-size);
  background: var(--why-counter);
}

.afg-section .why-choose-one__counter-piece::after {
  content: "";
  position: absolute;
  left: calc(50% - (var(--why-led-size) / 2));
  top: calc(50% - (var(--why-led-size) / 2));
  width: var(--why-led-size);
  aspect-ratio: 1;
  border: 2px solid var(--afg-surface);
  border-radius: 50%;
  background: var(--afg-accent);
  box-shadow: 0 0 0 1px rgb(var(--afg-shadow-rgb) / 18%);
}

.afg-section .why-choose-one__counter-piece--tl {
  left: 0;
  top: 0;
  border-radius: var(--why-piece-size) 0 0 0;
}

.afg-section .why-choose-one__counter-piece--tr {
  right: 0;
  top: 0;
  border-radius: 0 var(--why-piece-size) 0 0;
}

.afg-section .why-choose-one__counter-piece--bl {
  left: 0;
  bottom: 0;
  border-radius: 0 0 0 var(--why-piece-size);
}

.afg-section .why-choose-one__counter-piece--br {
  right: 0;
  bottom: 0;
  border-radius: 0 0 var(--why-piece-size) 0;
}

@container afg-services (min-width: 500px) and (max-width: 640px) {
  .afg-section .why-choose-one__title {
    white-space: normal;
    text-wrap: balance;
  }
}

@container afg-services (min-width: 500px) and (max-width: 575px) {
  .afg-section .why-choose-one__stage {
    aspect-ratio: 1037 / 980;
  }
}

@media (max-width: 575px) {
  .afg-section .why-choose-one {
    --why-mobile-edge: clamp(18px, 5cqi, 24px);
    --why-mobile-block: clamp(24px, 6cqi, 30px);
  }

  .afg-section .why-choose-one__stage {
    height: auto;
    min-height: 0;
    aspect-ratio: auto;
    overflow: visible;
  }

  .afg-section .why-choose-one__grid-wrap {
    position: relative;
    inset: auto;
    padding: clamp(24px, 6.5cqi, 32px) var(--why-mobile-edge);
  }

  .afg-section .why-choose-one__grid {
    position: relative;
    inset: auto;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    height: auto;
  }

  .afg-section .why-choose-one__item {
    min-height: 0;
    border-bottom: 1px solid rgba(var(--why-line-rgb), 0.32);
  }

  .afg-section .why-choose-one__item:last-child {
    border-bottom: 0;
  }

  .afg-section .why-choose-one__single {
    position: relative;
    inset: auto;
    min-height: 0;
    padding: var(--why-mobile-block) clamp(40px, 11cqi, 54px) var(--why-mobile-block) 0;
  }

  .afg-section .why-choose-one__item .why-choose-one__copy {
    position: static;
    width: auto;
  }

  .afg-section .why-choose-one__title {
    font-size: clamp(18px, 4.2cqi, 21px);
    line-height: 1.35;
    white-space: normal;
    text-wrap: balance;
  }

  .afg-section .why-choose-one__text {
    margin-top: clamp(12px, 3.25cqi, 16px);
    font-size: clamp(14.5px, 3.45cqi, 16px);
    line-height: 1.85;
  }

  .afg-section .why-choose-one__count {
    position: absolute;
    right: 0;
    top: var(--why-mobile-block);
    display: block;
    color: rgb(23 50 74 / 46%);
    font-size: clamp(14px, 3.5cqi, 16px);
    font-weight: 800;
    line-height: 1;
  }

  .afg-section .why-choose-one__divider,
  .afg-section .why-choose-one__counter {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .afg-section .afg-statement__led {
    animation: none !important;
  }
}
