/* ============================
   BASE
============================ */

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  overflow: auto;
}

body {
  height: 100%;
  overflow-x: hidden;
}

.contacts-body {
  background-color: #220022;
  padding-top: 60px;                 /* под фиксированный header */
  padding-bottom: 150px;             /* под фиксированный footer */
  min-height: 100vh;
  box-sizing: border-box;
  color: #fff;
}

/* ============================
 TITLES (как index-title)
============================ */

/* Контейнер страницы */
.contacts-content {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 10px;
  box-sizing: border-box;
}

h1 {
  color: #fff;
  text-align: center;
  margin: 18px auto 0 auto;
  max-width: 90%;
  font-size: 28px;
  word-wrap: break-word;
}

h2 {
  color: #fff;
  text-align: center;
  margin: 40px auto 0 auto;
  max-width: 90%;
  font-size: 24px;
  word-wrap: break-word;
}

/* ============================
 CONTACTS LIST
============================ */

.contacts {
  list-style: none;
  padding: 0;
  margin: 30px auto 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  align-items: stretch;
  width: 100%;
}

.contacts li {
  background-color: #330033;
  border-radius: 15px;
  padding: 20px 20px 28px;
  width: 220px;                 /* одинаковая ширина */
  min-height: 220px;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  box-sizing: border-box;
}

.contacts li a {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  flex-shrink: 0;
}

.contacts li img {
  width: 120px;
  height: 120px;
  max-width: 100%;
  object-fit: contain;
}

.contacts li .text {
  color: #fff;
  font-size: 18px;
  min-height: 50px;             /* одинаковая зона под текст */
  display: flex;
  align-items: center;
  justify-content: center;
}

.contacts li img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.contacts li img:hover {
  transform: scale(1.08);
}

/* ============================
 MOBILE ADAPTATION
============================ */

@media (max-width: 768px) {
  .contacts-body {
      height: calc(100vh - 118px);
  }

  .texttop {
      font-size: 32px;
  }

  h1 {
      font-size: 24px;
      margin-top: 30px;
  }

  h2 {
      font-size: 20px;
      margin-top: 30px;
  }

  .contacts {
      gap: 20px;
      align-items: center;
      margin-top: 20px;
  }

  .contacts li {
      width: 85%;
      max-width: 200px;
      height: auto;
      padding: 18px;
  }

  .contacts li .text {
      font-size: 17px;
      min-height: auto;
      margin-bottom: 10px;
  }

  .contacts li img {
      width: 120px;
      height: 120px;
  }
}

@media (max-width: 480px) {
  .contacts-body {
      height: calc(100vh - 135px);
  }

  h1 {
      font-size: 20px;
  }

  h2 {
      font-size: 18px;
  }

  .contacts li {
      max-width: 200px;
      padding: 16px;
  }

  .contacts li .text {
      font-size: 15px;
  }

  .contacts li img {
      width: 110px;
      height: 110px;
  }
}

/* ============================
 FOOTER
============================ */

body {
  --footer-bg: #330033;
  --footer-text: #fff;
  --footer-link: #8F00FF;
}