/*
 * Персональные страницы педагогов: стабильная сетка херо и точная геометрия футера.
 * Селекторы намеренно ограничены шаблонами gpp/gg, чтобы не менять старые страницы сайта.
 */

.g7-program__cards article {
  position: relative;
}

.gdtpp-program-page-link {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
}

.gdtpp-program-page-link:focus-visible {
  outline: 4px solid #155745;
  outline-offset: 4px;
}

@media (hover: hover) {
  .g7-program__cards article:has(.gdtpp-program-page-link) {
    transition: transform 180ms ease;
  }

  .g7-program__cards article:has(.gdtpp-program-page-link):hover {
    transform: translateY(-5px);
  }
}

@media (min-width: 821px) {
  .gpp-hero__grid {
    align-items: start !important;
  }

  .gpp-hero__copy {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "back"
      "badge"
      "title"
      "intro"
      "facts"
      "primary";
    align-items: start;
  }

  .gpp-back {
    grid-area: back;
    justify-self: start;
    margin: 0 0 18px !important;
  }

  .gpp-badge {
    grid-area: badge;
    justify-self: start;
    margin: 0 0 34px !important;
    white-space: nowrap;
  }

  .gpp-hero h1 { grid-area: title; }
  .gpp-intro { grid-area: intro; }
  .gpp-facts { grid-area: facts; }
  .gpp-primary { grid-area: primary; }
}

@media (max-width: 820px) {
  .gpp-hero__grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    column-gap: 0 !important;
    row-gap: 0 !important;
  }

  .gpp-hero__copy { display: contents !important; }

  .gpp-portrait {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
    margin-bottom: 34px !important;
  }

  .gpp-back {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    align-self: center !important;
    justify-self: start !important;
    margin: 0 0 18px !important;
  }

  .gpp-badge {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    align-self: center !important;
    justify-self: start !important;
    margin: 0 0 24px !important;
    white-space: nowrap;
  }

  .gpp-hero h1,
  .gpp-intro,
  .gpp-facts,
  .gpp-primary {
    grid-column: 1 / -1 !important;
  }

  .gpp-hero h1 { grid-row: 3 !important; margin-bottom: 28px !important; }
  .gpp-intro { grid-row: 5 !important; margin-top: 0 !important; }
  .gpp-facts { grid-row: 6 !important; }
  .gpp-primary { grid-row: 7 !important; }
}

@media (max-width: 480px) {
  .gpp-back { gap: 9px !important; font-size: 9px !important; }
  .gpp-back span { width: 38px !important; height: 38px !important; }
  .gpp-badge { gap: 8px !important; padding: 10px 14px !important; font-size: 8px !important; }
}

body.gdtpp-hide-story .gpp-story,
body.gdtpp-hide-approach .gpp-approach,
body.gdtpp-hide-cta .gpp-cta {
  display: none !important;
}

/* Футер: круги не растягиваются, SVG всегда имеет одну геометрию и оптический центр. */
.gg-footer__project {
  grid-template-columns: 46px minmax(0, 1fr) 46px !important;
  align-items: center !important;
}

.gg-footer__project > .gg-footer__project-icon,
.gg-footer__project > i {
  box-sizing: border-box !important;
  width: 46px !important;
  min-width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center !important;
  align-self: center !important;
  justify-self: center !important;
  border-radius: 50% !important;
  line-height: 0 !important;
  transform: none !important;
}

.gg-footer__project > .gg-footer__project-icon svg {
  display: block !important;
  width: 25px !important;
  height: 25px !important;
  margin: 0 !important;
  transform: none !important;
}

.gg-footer__project > i svg {
  display: block !important;
  width: 23px !important;
  height: 23px !important;
  margin: 0 !important;
  transform: translateX(1px) !important;
}

.gg-footer__project > span:nth-child(2) {
  min-width: 0 !important;
  align-self: center !important;
}

@media (max-width: 700px) {
  .gg-footer__project {
    grid-template-columns: 42px minmax(0, 1fr) 42px !important;
    column-gap: 12px !important;
  }

  .gg-footer__project > .gg-footer__project-icon,
  .gg-footer__project > i {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
  }

  .gg-footer__project > .gg-footer__project-icon svg,
  .gg-footer__project > i svg {
    width: 22px !important;
    height: 22px !important;
  }
}
