/* /internet-advertising/ — Figma "Advertising" (3448:7928), mobile "Advertising_Mob" (3760:10202).
   Also loaded by the child ad pages, so main-page-only rules are scoped by .ads-hero, .ads-formats,
   .ads-pillars, .ads-social, .ads-steps (classes used only in /internet-advertising/index.php). */

/* Hero: breadcrumbs inside the dark block, illustration pinned to the right edge */
@media screen and (min-width: 641px) {
  .ads-hero .index-img {
    justify-content: space-between;
    gap: 40px;
  }

  .ads-hero .index-description {
    flex: 1 1 auto;
    margin-right: 0;
  }

  .ads-hero .index-description .description {
    max-width: 880px;
  }

  .ads-hero .item-index-img {
    flex: 0 1 880px;
    justify-content: flex-end;
  }
}

/* Five Pillars intro: second column of the 3-column mockup grid */
@media screen and (min-width: 1025px) {
  .ads-pillars .pillars-items .pillars-item-empty {
    flex: 0 0 calc((100% - 80px) / 3 + 40px);
  }
}

/* How we have work: 180px cards, 40px padding */
.ads-formats .formats-item-small.item-no-bg p {
  max-width: 461px;
}

@media screen and (min-width: 1025px) {
  .ads-formats .formats-item-small:not(.item-no-bg) {
    min-height: 180px;
  }
}

@media screen and (min-width: 1421px) {
  .ads-formats .formats-item-small:not(.item-no-bg) {
    padding-bottom: 40px;
  }
}

/* Services list: dark rows, hover panel + arrow for rows that link to a child page */
.ads-services {
  padding-bottom: 60px;
}

.ads-services .services-item.ads-services__item {
  position: relative;
  margin: 0;
  padding: 30px 30px 60px;
  border-top: 0;
  transition: background-color 0.2s ease-out;
}

.ads-services .services-item.ads-services__item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--outher-dark-gray);
}

.ads-services .services-logo img {
  width: 80px;
  height: 80px;
}

.ads-services .services-item:hover .services-logo img {
  transform: none;
}

.ads-services .services-title {
  margin-top: 0;
}

.ads-services .services-item:hover .services-title {
  color: inherit;
}

.ads-services .services-more-items {
  justify-content: space-between;
  gap: 40px;
}

.ads-services .ads-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.ads-services .ads-services__item--link:hover,
.ads-services .ads-services__item--link:focus-visible {
  background: var(--outher-dark-gray);
}

.ads-services .ads-services__item--link:hover .ads-arrow,
.ads-services .ads-services__item--link:focus-visible .ads-arrow {
  opacity: 1;
}

/* Social networks: white cards, purple on hover for cards with a child page */
.ads-social {
  padding: 80px 0 120px;
}

.ads-social .wrap_container {
  border-top: 1px solid var(--outher-light-gray);
  padding-top: 30px;
}

.ads-social h2 {
  margin: 0 0 80px;
  font-size: 48px;
  font-weight: 400;
  line-height: 1.4;
}

.ads-social__layout {
  display: flex;
  gap: 40px;
}

/* Mockup grid: 3 columns with 40px gaps, cards start at the second column (same vertical as "How we have work") */
.ads-social__intro {
  flex: 0 0 calc((100% - 80px) / 3);
}

.ads-social__intro p {
  margin: 0;
  color: var(--txt-gray);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
}

.ads-social__list {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 20px;
}

.ads-social__card {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 32px;
  column-gap: 40px;
  padding: 40px;
  background: var(--background-white);
  color: var(--txt-black);
  text-decoration: none;
  transition: background-color 0.2s ease-out, color 0.2s ease-out;
}

.ads-social__icon {
  width: 80px;
  height: 80px;
}

.ads-social__body {
  min-width: 0;
}

.ads-social__body > * {
  max-width: 725px;
}

@media screen and (min-width: 1025px) {
  /* Text column offset from the icon: 189px in the mockup (40px grid gap + 149px) */
  .ads-social__body {
    padding-left: min(149px, 7.8vw);
  }

  /* Customer request: left column stays visible until the end of the section */
  .ads-social__intro {
    position: sticky;
    top: 40px;
    align-self: flex-start;
  }
}

.ads-social__body h3 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.ads-social__body p {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
}

.ads-social__body p:last-child {
  margin-bottom: 0;
}

.ads-social__arrow {
  grid-column: 3;
  width: 32px;
  height: 32px;
  background: url(/img/internet-advertising/arrow-white.svg) no-repeat center / contain;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.ads-social__card--link:hover,
.ads-social__card--link:focus-visible {
  background: var(--purple-normal);
  color: var(--txt-white);
}

.ads-social__card--link:hover .ads-social__arrow,
.ads-social__card--link:focus-visible .ads-social__arrow {
  opacity: 1;
}

.ads-our-works {
  margin-top: 80px;
}

@media screen and (min-width: 750px) {
  .ads-our-works .our-works-last-item .title {
    font-size: 48px;
    line-height: 1.4;
    font-weight: 400;
  }
}

/* Main page: 120px between the last case and the Steps block (40px card margin + 80px) */
@media screen and (min-width: 641px) {
  .ads-social + .ads-our-works .our-works-container {
    padding-bottom: 80px;
    margin-bottom: 0;
  }
}

/* Steps: number at the start of the 2/3 column, title 153px to the right,
   grey line split into segments between the numbers */
.ads-steps {
  overflow: clip;
}

.ads-steps .timeline::before {
  display: none;
}

.ads-steps .steps-item {
  position: relative;
  margin-left: 0;
  padding-left: 153px;
}

.ads-steps .steps-item-title {
  margin-top: 0;
}

.ads-steps .steps-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 87px;
  bottom: -80px;
  left: 14px;
  width: 2px;
  border-radius: 2px;
  background: var(--outher-light-gray);
}

.ads-steps .timeline-status {
  left: 14px;
  z-index: 1;
}

/* The number box hides the progress line 20px above and below the digit */
.ads-steps .timeline-container::before {
  left: 0;
  width: 31px;
  margin-top: -20px;
  padding: 20px 0;
  text-align: center;
  z-index: 2;
}

@media screen and (min-width: 1025px) {
  .ads-steps .steps-descr {
    flex: 0 0 calc((100% - 80px) / 3 + 40px);
    box-sizing: border-box;
    margin-right: 0;
    padding-right: 40px;
    position: sticky;
    top: 40px;
    align-self: flex-start;
  }

  .ads-steps .steps-descr p {
    max-width: 461px;
  }

  .ads-steps .steps-descr p:first-child {
    margin-top: 0;
  }

  .ads-steps .steps-items {
    flex: 1 1 auto;
  }
}

/* Mobile mockup replaces the hover arrow with an outline "Read More" button */
.ads-read-more {
  display: none;
  margin-top: 30px;
  padding: 10px 30px;
  border: 1px solid currentColor;
  border-radius: 43px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
}

.ads-social .ads-read-more {
  border-color: var(--purple-normal);
  color: var(--purple-normal);
}

@media screen and (max-width: 1024px) {
  .ads-steps .steps-item {
    padding-left: 80px;
  }

  .ads-services .services-item.ads-services__item {
    margin: 0;
    padding: 30px 0 60px;
  }

  .ads-services .services-item.ads-services__item::before {
    left: 0;
    right: 0;
  }

  .ads-services .ads-services__item--link:hover {
    background: none;
  }

  .ads-services .services-item-empty {
    display: block;
  }

  .ads-services .services-items {
    flex-direction: column-reverse;
    gap: 30px;
  }

  .ads-social__layout {
    flex-direction: column;
  }

  .ads-social__intro,
  .ads-social__list {
    flex-basis: auto;
  }
}

@media screen and (min-width: 769px) {
  .ads-pillars__progress {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  /* Global rule leaves a white gap before the dark services block */
  .pillars-block {
    margin-bottom: 0;
  }

  /* Mobile mockup: horizontal slider (Swiper, js/custom.js) with a progress bar, no intro text */
  .ads-pillars.pillars-block {
    padding: 60px 0;
  }

  .ads-pillars.pillars-block h2 {
    margin-bottom: 40px;
  }

  .ads-pillars .pillars-items {
    display: none;
  }

  .ads-pillars .pillars-container {
    flex-wrap: nowrap;
    width: auto;
    margin: 0;
  }

  .ads-pillars .pillars-item {
    flex-shrink: 0;
    justify-content: flex-start;
    gap: 120px;
    width: 327px;
    max-width: calc(100vw - 48px);
    height: auto;
    margin: 0;
    padding: 24px;
  }

  .ads-pillars .pillars-item-img img {
    display: block;
    width: 80px;
    height: 80px;
  }

  .ads-pillars .pillars-item .title {
    padding-bottom: 8px;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.02em;
  }

  .ads-pillars .pillars-item .description {
    font-size: 16px;
    line-height: 1.6;
  }

  .ads-pillars .ads-pillars__progress {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: 2px;
    margin-top: 24px;
    background: var(--outher-light-gray);
  }

  .ads-pillars .ads-pillars__progress .swiper-pagination-progressbar-fill {
    background: var(--purple-normal);
  }
}

@media screen and (max-width: 890px) {
  .ads-social h2 {
    margin-bottom: 60px;
    font-size: 32px;
  }
}

@media screen and (max-width: 640px) {
  .ads-steps .steps-item {
    padding-left: 44px;
  }

  .ads-steps .steps-item:not(:last-child)::after {
    top: 55px;
    bottom: -90px;
    left: 11px;
  }

  .ads-steps .timeline-status {
    left: 11px;
  }

  .ads-steps .timeline-container::before {
    width: 24px;
    margin-top: -10px;
    padding: 10px 0;
  }

  .ads-services .services-logo img {
    width: 60px;
    height: 60px;
  }

  .ads-services .ads-arrow {
    display: none;
  }

  .ads-social {
    padding: 60px 0 80px;
  }

  .ads-social__intro p {
    font-size: 16px;
    line-height: 1.6;
  }

  .ads-social__card {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 20px;
    padding: 24px 20px;
  }

  .ads-social__icon {
    width: 60px;
    height: 60px;
  }

  .ads-social__body {
    grid-column: 1 / -1;
  }

  .ads-social__body h3 {
    font-size: 22px;
  }

  .ads-social__arrow {
    display: none;
  }

  .ads-read-more {
    display: block;
  }
}
