/*
 * Page "Місія, бачення та цінності" (page-mission.php).
 * Desktop and tablet from the layout (1920 / 1024); mobile is adapted from the tablet (no mobile layout).
 * Sections use .ab_sec from inner.css; desktop paddings are set only above 1280px.
 */

@media (min-width: 1281px) {
  .ms_quote { --pad: 100px; }
  .ms_who { --pad: 80px; }
  .ms_blocks { --pad: 57px; }
  .ms_values { --pad: 76px; }
  .ms_work { --pad: 73px; }
}

/* ---------- Цитата (банер під шапкою) ---------- */

.ms_quote {
  --aw: 399px;
  background: linear-gradient(90deg, var(--palette-v2-bg) 0%, #003866 100%);
}

.ms_quote_arrow {
  position: absolute;
  top: var(--pad);
  left: calc((100% - var(--cw)) / 2 + 4px);
  z-index: 0;
  width: var(--aw);
  height: auto;
  pointer-events: none;
}

.ms_quote_head {
  max-width: 866px;
  margin-left: calc(var(--aw) + 100px);
}

.ms_quote_title {
  margin: 0;
  font-family: "Nata Sans", sans-serif;
  font-weight: 800;
  font-size: 56px;
  line-height: 64px;
  color: var(--palette-v2-t1);
}

.ms_quote_accent {
  display: block;
  color: var(--palette-v2-br);
}

/* ---------- Хто ми ---------- */

.ms_who_grid {
  display: grid;
  grid-template-columns: minmax(0, 866fr) minmax(0, 804fr);
  column-gap: 50px;
  align-items: center;
}

.ms_who_lead_txt {
  margin-top: 20px;
  font-family: "Nata Sans", sans-serif;
  font-weight: 800;
  font-size: 30px;
  line-height: 42px;
  color: var(--palette-v2-t1);
}

.ms_who_txt {
  margin-top: 24px;
  font-size: 18px;
  line-height: 28px;
  color: var(--palette-v2-t2);
}

.ms_who_txt p,
.ms_value_txt p {
  margin: 0;
}

.ms_who_txt p + p {
  margin-top: 28px;
}

.ms_who_media {
  aspect-ratio: 804 / 452;
}

/* Anchors from the footer menu land below the fixed header */
.main_mission [id] {
  scroll-margin-top: 101px;
}

/* Blocks (Ідеологія, Місія, Бачення, Чого ми прагнемо): shared .hb_* and .sec_tri in inner.css */

/* ---------- Наші цінності ---------- */

.ms_values_grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
  margin-top: 46px;
}

.ms_value_item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  grid-column: span 2;
  padding: 28px;
  border-radius: 24px;
  background: var(--palette-v2-br);
  color: var(--palette-v2-bg);
}

/* rows of three; the last row of two is split in halves, a single last card takes the full row */
.ms_value_item:nth-last-child(2):nth-child(3n + 1),
.ms_value_item:last-child:nth-child(3n + 2) {
  grid-column: span 3;
}

.ms_value_item:last-child:nth-child(3n + 1) {
  grid-column: span 6;
}

.ms_value_item:nth-child(3n + 2) {
  background: var(--palette-v2-d3);
  color: var(--palette-v2-white);
}

.ms_value_item:nth-child(3n + 3) {
  background: var(--palette-v2-d1);
  color: var(--palette-v2-white);
}

.ms_value_icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 24px;
  background: var(--palette-v2-white);
  color: var(--palette-v2-d3);
}

/* Icon from the media library: 24x24, single-color icons take the color of the design */
.ms_value_icon svg,
.ms_value_icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.ms_value_icon svg [stroke]:not([stroke="none"]) {
  stroke: currentColor;
}

.ms_value_icon svg [fill]:not([fill="none"]):not(svg) {
  fill: currentColor;
}

.ms_value_title {
  font-weight: 800;
  font-size: 22px;
  line-height: 30px;
}

.ms_value_txt {
  font-size: 18px;
  line-height: 28px;
}

.ms_value_txt p + p {
  margin-top: 12px;
}

/* ---------- Як ми працюємо ---------- */

.ms_steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
}

/* dotted line through the dots */
.ms_steps::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 15px;
  right: 15px;
  height: 4px;
  background: radial-gradient(circle, var(--palette-v2-bg) 1.6px, transparent 2px) 0 50% / 10px 4px repeat-x;
}

.ms_step_item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.ms_step_dot {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--palette-v2-d3);
}

.ms_step_item:nth-child(4n + 2) .ms_step_dot { background: var(--palette-v2-bg); }
.ms_step_item:nth-child(4n + 3) .ms_step_dot { background: var(--palette-v2-white); }
.ms_step_item:nth-child(4n + 4) .ms_step_dot { background: var(--palette-v2-red-accent); }

.ms_step_txt {
  flex: 1 1 auto;
  min-height: 170px;
  padding: 28px;
  border-radius: 24px;
  background: var(--palette-v2-t1);
  font-family: "Nata Sans", sans-serif;
  font-weight: 800;
  font-size: 24px;
  line-height: 34px;
  color: var(--palette-v2-d1);
}

.ms_work .slogan_cta_card {
  margin-top: 40px;
}

/* ---------- 1280 ---------- */

@media (max-width: 1280px) {
  .ms_who_grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 40px;
  }

  .ms_who_lead_txt {
    font-size: 26px;
    line-height: 36px;
  }

  .ms_step_txt {
    font-size: 22px;
    line-height: 30px;
  }
}

/* ---------- 1024 (tablet) ---------- */

@media (max-width: 1024px) {
  .ms_who_grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 40px;
  }

  .ms_who_lead_txt,
  .ms_who_txt {
    margin-top: 40px;
  }

  .ms_who_txt {
    font-size: 16px;
    line-height: 26px;
  }

  .ms_who_media {
    aspect-ratio: 944 / 531;
  }

  .ms_values_grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 24px;
  }

  .ms_value_item,
  .ms_value_item:nth-last-child(2):nth-child(3n + 1),
  .ms_value_item:last-child:nth-child(3n + 2),
  .ms_value_item:last-child:nth-child(3n + 1) {
    grid-column: auto;
  }

  .ms_value_item:last-child:nth-child(odd) {
    grid-column: span 2;
  }

  .ms_value_txt {
    font-size: 16px;
    line-height: 26px;
  }

  .ms_steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-top: 40px;
  }

  .ms_steps::before {
    top: 44px;
    bottom: 44px;
    left: 13px;
    right: auto;
    width: 4px;
    height: auto;
    background: radial-gradient(circle, var(--palette-v2-bg) 1.6px, transparent 2px) 50% 0 / 4px 10px repeat-y;
  }

  .ms_step_item {
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }

  .ms_step_dot {
    flex-shrink: 0;
  }

  .ms_step_txt {
    min-height: 88px;
    padding: 30px 28px;
    font-size: 22px;
    line-height: 28px;
  }
}

/* ---------- 600 (mobile, adapted from tablet) ---------- */

@media (max-width: 600px) {
  .ms_who_grid {
    row-gap: 24px;
  }

  /* Blocks: text first, text part at least 300px, photo 324x182 across the block */
  .ms_hb {
    --hb-gap: 16px;
  }

  .ms_hb .hb_text {
    justify-content: flex-start;
    min-height: 300px;
    padding: 20px;
  }

  .ms_hb .hb_title {
    margin-bottom: 12px;
  }

  .ms_hb .hb_txt p + p {
    margin-top: 12px;
  }

  .ms_hb .hb_media {
    aspect-ratio: 324 / 182;
    padding: 0;
  }

  .ms_hb .hb_media .hb_img {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    aspect-ratio: auto;
    border-radius: 0;
  }

  .ms_who_lead_txt {
    margin-top: 20px;
    font-size: 24px;
    line-height: 34px;
  }

  .ms_who_txt {
    margin-top: 24px;
  }

  .ms_who_media {
    aspect-ratio: 324 / 182;
  }

  .ms_values_grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: 20px;
  }

  .ms_value_item:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .ms_value_item {
    min-height: 376px;
  }

  .ms_value_title {
    font-size: 20px;
    line-height: 28px;
  }

  .ms_value_txt {
    font-size: 16px;
    line-height: 26px;
  }

  .ms_steps {
    gap: 16px;
    margin-top: 20px;
  }

  .ms_step_item {
    gap: 14px;
  }

  .ms_step_txt {
    display: flex;
    align-items: center;
    min-height: 144px;
    padding: 20px;
    font-size: 18px;
    line-height: 26px;
  }

  .ms_steps::before {
    top: 72px; /* from the first dot to the last one (cards 144px) */
    bottom: 72px;
  }

  .ms_work .slogan_cta_card {
    margin-top: 36px;
  }
}

/* ---------- Цитата: планшет і мобільний ---------- */

@media (max-width: 1280px) {
  .ms_quote {
    --pad: 56px;
    --aw: 315px;
  }

  .ms_quote_arrow {
    left: -33.5px;
  }

  .ms_quote_head {
    max-width: 760px;
    margin-left: calc(318.5px - var(--cpad));
    gap: 20px;
  }

  .ms_quote_title {
    font-size: 44px;
    line-height: 52px;
  }
}

@media (max-width: 600px) {
  .ms_quote {
    --aw: 238px;
    padding: 36px 0 157px;
  }

  .ms_quote_arrow {
    top: auto;
    bottom: -109px;
    left: auto;
    right: 44px;
  }

  .ms_quote_head {
    margin-left: 0;
  }

  .ms_quote_title {
    font-size: 34px;
    line-height: 42px;
  }
}
