/* ---------- Про тебе (page-you.php) ---------- */

.main_you .ab_sec {
  --pad: 80px;
}

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

/* ---------- Вступ під шапкою ---------- */

.yi {
  position: relative;
  z-index: 1;
  overflow: hidden;
  min-height: 364px;
  margin-bottom: -1px; /* overlaps the next section by 1px: no light hairline when the page is scaled (designer review 24.11) */
  padding: 80px 0;
  background-color: var(--palette-v2-bg);
  background-image: radial-gradient(130% 260% at 21% 133%, #011b2b 4%, #012a49 33%, #003866 62%, #004e84 81%, #0064a1 100%);
}

.yi > .container {
  position: relative;
  z-index: 1;
}

.yi {
  /* desktop: arrows up to 490px, smaller on narrower windows (browser zoom 150-175%) so they never reach the text (designer review 24.11) */
  --yd: clamp(200px, calc((100vw - 820px) / 2 - 20px), 490px);
}

.yi_decor {
  position: absolute;
  top: 0;
  z-index: 0;
  width: var(--yd);
  height: auto;
  pointer-events: none;
}

.yi_decor--l {
  left: calc(var(--yd) * -0.256);
}

.yi_decor--r {
  top: auto;
  right: 0;
  bottom: calc(var(--yd) * -0.258); /* at the bottom of the banner on any zoom (Figma 1920: top 0.5, 490 of 364 - designer review 01.12) */
}

.yi_body {
  max-width: 820px;
  margin: 0 auto;
}

.yi_txt,
.yi_strong {
  margin: 0;
  color: var(--palette-v2-white);
}

.yi_txt {
  font-size: 24px;
  line-height: 38px;
}

.yi_strong {
  margin-top: 20px;
  font-family: "Nata Sans", sans-serif;
  font-weight: 800;
  font-size: 28px;
  line-height: 36px;
}

/* line breaks from the field - on tablet and mobile only */
@media (min-width: 1281px) {
  .yi_strong br {
    display: none;
  }
}

@media (max-width: 1280px) {
  .yi {
    min-height: 304px;
    padding: 40px 0;
  }

  /* arrows shrink with the screen so they do not cover the text on narrow tablets (designer review 23.11, iPad mini) */
  .yi {
    --yd: clamp(150px, calc((100vw - 495px) * 0.6), 290px);
  }

  .yi_decor {
    width: var(--yd);
  }

  .yi_decor--l {
    left: calc(var(--yd) * -0.2);
  }

  /* Figma tablet: right arrows in the bottom right corner, partly below the banner edge */
  .yi_decor--r {
    top: auto;
    bottom: calc(var(--yd) * -0.25);
  }

  .yi_body {
    max-width: 495px;
  }

  .yi_txt {
    font-size: 22px;
    line-height: 34px;
  }

  .yi_strong {
    font-size: 26px;
    line-height: 34px;
  }
}

@media (max-width: 600px) {
  .yi {
    min-height: 508px;
    padding: 98px 0 98px;
  }

  .yi_decor {
    width: 140px;
  }

  .yi_decor--l {
    left: -23px;
  }

  .yi_decor--r {
    top: auto;
    bottom: -22px;
  }

  .yi_body {
    max-width: 249px;
  }

  .yi_txt {
    font-size: 17px;
    line-height: 26px;
  }

  .yi_strong {
    margin-top: 10px;
    font-size: 22px;
    line-height: 28px;
  }
}

/* ---------- Blocks "text + photo" ---------- */

.yb_grid {
  display: grid;
  grid-template-columns: minmax(0, 804fr) minmax(0, 820fr);
  gap: 96px;
  align-items: center;
}

.yb--img-right .yb_grid {
  grid-template-columns: minmax(0, 820fr) minmax(0, 804fr);
}

.yb--img-right .yb_media {
  order: 2;
}

.yb--portrait .yb_grid {
  grid-template-columns: minmax(0, 640fr) minmax(0, 984fr);
}

.yb--portrait.yb--img-right .yb_grid {
  grid-template-columns: minmax(0, 984fr) minmax(0, 640fr);
}

.yb_img {
  overflow: hidden;
  aspect-ratio: 804 / 452;
  border-radius: 28px;
  background: var(--palette-v2-d2);
}

.yb--portrait .yb_img {
  aspect-ratio: 640 / 800;
  border-radius: 24px;
}

.ab_sec--cyan .yb_img {
  background: var(--palette-v2-d3);
}

.yb_img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yb_lead,
.yb_txt {
  font-size: 18px;
  line-height: 28px;
}

.yb_lead {
  margin-top: 20px;
  color: var(--palette-v2-t3-tint);
}

.yb_txt {
  margin-top: 20px;
  color: var(--palette-v2-t2);
}

.yb_lead p,
.yb_txt p {
  margin: 0 0 12px;
}

.yb_lead p:last-child,
.yb_txt p:last-child {
  margin-bottom: 0;
}

.ab_sec--cyan .yb_lead {
  color: var(--palette-v2-d2);
}

.ab_sec--cyan .yb_txt {
  color: var(--palette-v2-d1);
}

.ab_sec--cyan .sh_title {
  color: var(--palette-v2-bg);
}

/* ---------- Що ми кажемо саме вам ---------- */

.ys_grid {
  display: grid;
  grid-template-columns: minmax(0, 741fr) minmax(0, 975fr);
  grid-template-areas:
    ". head"
    "media list";
  column-gap: 16px;
  row-gap: 40px;
}

.ys_head {
  grid-area: head;
}

.ys_media {
  position: relative;
  grid-area: media;
  overflow: hidden;
  aspect-ratio: 741 / 560;
  border-radius: 28px;
  background: var(--palette-v2-br);
}

.ys_img {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.ys_img.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease;
}

.ys_img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* the list takes the height of the photo and scrolls inside (contain: size) */
.ys_list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  grid-area: list;
  overflow-y: auto;
  overscroll-behavior: contain;
  contain: size;
  scrollbar-width: none;
}

.ys_list::-webkit-scrollbar {
  display: none;
}

.ys_card {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 10px;
  width: 100%;
  padding: 28px 32px;
  border: 0;
  border-radius: 24px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, filter 0.25s ease;
}

.ys_card:hover {
  filter: brightness(1.08);
}

.ys_card:focus-visible {
  outline: 3px solid var(--palette-v2-red-accent);
  outline-offset: 2px;
}

.ys_card--t1 {
  background: var(--palette-v2-d1);
  color: var(--palette-v2-white);
}

.ys_card--t2 {
  background: var(--palette-v2-br);
  color: var(--palette-v2-bg);
}

.ys_card--t3 {
  background: var(--palette-v2-d3);
  color: var(--palette-v2-white);
}

.ys_card--t4 {
  background: var(--palette-v2-t3-tint);
  color: var(--palette-v2-d1);
}

.ys_card.is-active {
  background: var(--palette-v2-bg);
  color: var(--palette-v2-white);
  filter: none;
}

.ys_card_head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ys_card_icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--palette-v2-white);
}

.ys_card_icon svg,
.ys_card_icon img {
  display: block;
  width: 24px;
  height: 24px;
}

.ys_card_title {
  font-family: "Nata Sans", sans-serif;
  font-weight: 800;
  font-size: 22px;
  line-height: 30px;
}

.ys_card--t4:not(.is-active) .ys_card_title {
  color: var(--palette-v2-bg);
}

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

/* ---------- Разом ---------- */

.yc_card {
  display: grid;
  grid-template-columns: minmax(0, 760px) 1fr;
  grid-template-areas:
    "content logo"
    "btn logo";
  align-items: start;
  padding: 56px 72px;
  border-radius: 28px;
  background: var(--palette-v2-d2);
}

.yc_content {
  grid-area: content;
}

.yc_title {
  margin: 0;
  font-weight: 800;
  font-size: 44px;
  line-height: 52px;
  color: var(--palette-v2-t1);
}

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

.yc_logo {
  grid-area: logo;
  align-self: center;
  justify-self: end;
  width: 494px;
  max-width: 100%;
  margin-right: 62px;
}

.yc_logo img {
  display: block;
  width: 100%;
  height: auto;
}

.yc_btn {
  grid-area: btn;
  justify-self: start;
  margin-top: 52px;
}

/* ---------- Laptop ---------- */

@media (max-width: 1600px) {
  .yb_grid {
    gap: 64px;
  }

  .yc_logo {
    width: 420px;
    margin-right: 0;
  }
}

@media (max-width: 1280px) {
  .yb_grid {
    gap: 48px;
  }

  .yc_card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
    padding: 48px;
  }
}

/* «Що ми кажемо саме вам» on large tablets (iPad Pro 13, 1032 px): the stacked tablet layout -
   in two columns the photo got too small (designer review 23.11) */
@media (min-width: 1025px) and (max-width: 1280px) {
  .ys_grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "head"
      "media"
      "list";
    row-gap: 24px;
  }

  .ys_media {
    aspect-ratio: 944 / 600;
  }

  .ys_list {
    gap: 18px;
    height: 546px;
    contain: none;
  }
}

/* ---------- Tablet ---------- */

@media (max-width: 1024px) {
  .main_you .ab_sec {
    --pad: 40px;
  }

  .yb_grid,
  .yb--img-right .yb_grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .yb--img-right .yb_media {
    order: 0;
  }

  .yb--portrait .yb_grid,
  .yb--portrait.yb--img-right .yb_grid {
    grid-template-columns: minmax(0, 416fr) minmax(0, 460fr);
    gap: 67px;
  }

  .yb_lead {
    margin-top: 20px;
  }

  .yb_txt {
    margin-top: 40px;
    font-size: 16px;
    line-height: 26px;
  }

  .yb--portrait .yb_txt {
    margin-top: 20px;
  }

  .ys_grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "head"
      "media"
      "list";
    row-gap: 24px;
  }

  .ys_media {
    aspect-ratio: 944 / 680;
  }

  .ys_list {
    gap: 18px;
    height: 546px;
    contain: none;
  }

  .yc_card {
    grid-template-columns: minmax(0, 400px) 1fr;
    padding: 32px;
  }

  .yc_title {
    font-size: 38px;
    line-height: 46px;
  }

  .yc_txt {
    margin-top: 16px;
    font-size: 16px;
    line-height: 26px;
  }

  .yc_logo {
    width: 456px;
  }

  .yc_btn {
    margin-top: 24px;
  }
}

/* ---------- Small tablet (iPad mini): portrait blocks in one column, the photo above the text (designer review) ---------- */

@media (min-width: 601px) and (max-width: 820px) {
  .yb--portrait .yb_grid,
  .yb--portrait.yb--img-right .yb_grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .yb--portrait .yb_media,
  .yb--portrait.yb--img-right .yb_media {
    order: 0;
  }

  .yb--portrait .yb_img {
    aspect-ratio: 4 / 3;
  }

  .yb--portrait .yb_img img {
    object-position: center 25%;
  }

  /* «Разом»: smaller logo, the text keeps the room */
  .yc_card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 240px);
    column-gap: 32px;
  }

  .yc_logo {
    width: 100%;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
  .yb--portrait .yb_grid,
  .yb--portrait.yb--img-right .yb_grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  /* landscape blocks: text first, the photo after it */
  .yb--landscape .yb_media,
  .yb--landscape.yb--img-right .yb_media {
    order: 2;
  }

  .yb_grid,
  .yb--img-right .yb_grid {
    gap: 24px;
  }

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

  .yb--portrait .yb_img {
    aspect-ratio: 324 / 405;
  }

  .yb_lead,
  .yb_txt {
    font-size: 16px;
    line-height: 26px;
  }

  .yb_lead {
    margin-top: 12px;
  }

  .yb_txt {
    margin-top: 24px;
  }

  .ys_grid {
    row-gap: 24px;
  }

  .ys_media {
    aspect-ratio: 324 / 260;
  }

  .ys_list {
    gap: 12px;
    height: 424px;
  }

  .ys_card {
    padding: 20px;
  }

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

  .yc_card {
    display: flex;
    flex-direction: column;
    padding: 28px;
  }

  .yc_title {
    font-size: 32px;
    line-height: 40px;
  }

  .yc_txt {
    margin-top: 24px;
  }

  .yc_logo {
    align-self: flex-start;
    width: 268px;
    margin-top: 41px;
  }

  .yc_btn {
    justify-content: center;
    width: 100%;
    margin-top: 40px;
  }
}
