/* Стили для .hero */
.landing .hero {
  height: 100vh;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-bottom: 60px;
  background-image: url('assets/background.svg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white; /* Белый текст всегда */
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.landing .hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 64, 175, 0.5);
  z-index: 1;
}

.landing .hero > * {
  position: relative;
  z-index: 2;
}

.landing .hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  color: #fff;
}

.landing .hero .subtitle {
  font-size: 1.2rem;
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: 2rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Контейнер для круга и стрелки */
.arrow-container {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.arrow-link {
  text-decoration: none;
}

/* Круг */
.arrow-circle {
  width: 50px;
  height: 50px;
  border: 2px solid white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: pulse 2s infinite;
}

/* Стрелка внутри круга */
.arrow-down {
  width: 16px;
  height: 16px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
  animation: bounce 1.5s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: rotate(45deg) translateY(0);
  }
  40% {
    transform: rotate(45deg) translateY(-5px);
  }
  60% {
    transform: rotate(45deg) translateY(-3px);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

body:has(.landing) {
  background-size: 16px 16px;
  background-position: center;
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1.5px, transparent 1.5px);
  background-color: #212121;
}

body[data-md-color-scheme="default"]:has(.landing) {
  background-image: radial-gradient(rgba(0, 0, 0, 0.12) 1.5px, transparent 1.5px);
  background-color: #ffffff;
}

/* Make content background transparent on homepage to show body background */
body:has(.landing) .md-main__inner {
    background-color: transparent !important;
}

.dotted-section {
  padding: 60px 20px;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  box-sizing: border-box;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

/* Стили для .sections */
.sections {
  font-weight: bold;
  color: #fff;
  text-align: center;
}

.sections h2 {
  font-size: 1.8rem;
}

/* Убираем влияние .md-typeset h2 на заголовок "Розділи" только на главной */
.landing .sections h2 {
  line-height: inherit;
  margin: 0;
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  color: #fff;
}

/* Стили для карточек */
.cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-top: 50px;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  width: 250px;
  border-radius: 15px;
  background: rgba(40, 43, 54, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  border-color: rgba(59, 130, 246, 0.6);
}

/* Обертка для изображения */
.img-container {
  width: 100%;
  height: 170px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  transition: transform 0.35s ease-out;
}

.card:hover img {
  transform: scale(1.05);
}

.card p {
  font-size: 0.9rem;
  margin: 15px 10px 15px 10px;
  color: #fff;
  font-weight: 500;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* Стили для превью контента */
.preview-content {
  padding: 8px;
  background: #f9f9f9;
  border-top: 1px solid #eee;
  width: 100%;
  text-align: left;
  font-size: 0.85rem;
  color: #555;
}

.preview-content small {
  display: block;
  padding: 4px;
}

.tags-list {
  padding: 8px;
  background: #f5f5f5;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #555;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Стили для блока "Про проект" */
.about {
  text-align: center;
  color: #fff;
}

.about h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.about p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 10px 0;
}

/* Центрируем admonition */
.tip-center {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

.admonition {
  margin: 0;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #4CAF50;
  background: #2e7d32; /* Зелёный фон */
  width: 100%;
  text-align: left;
  color: white; /* Белый текст */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.9);
}

.admonition-title {
  font-weight: bold;
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  color: white; /* Белый заголовок */
}

.admonition p {
  margin: 0;
  color: white; /* Белый текст */
}

/* Адаптивность под мобильные */
@media (max-width: 576px) {
  .cards {
    flex-direction: column;
    align-items: center;
  }

  .card {
    width: 100%;
  }

  .landing .hero h1 {
    font-size: 2rem;
  }
}

/* Адаптация под светлую тему */
[data-md-color-scheme="default"] .sections,
[data-md-color-scheme="default"] .about {
  color: #000; /* Чёрный текст */
}

[data-md-color-scheme="default"] .sections h2,
[data-md-color-scheme="default"] .about h2,
[data-md-color-scheme="default"] .about p {
  color: #000; /* Чёрный текст */
}

[data-md-color-scheme="default"] .card p {
  color: #000; /* Чёрный текст в карточках */
}

/* Адаптируем фон карточек под светлую тему */
[data-md-color-scheme="default"] .card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-md-color-scheme="default"] .card:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-color: rgba(59, 130, 246, 0.7);
}

/* Адаптируем .preview-content */
[data-md-color-scheme="default"] .preview-content {
  background: #e0e0e0;
  border-top: 1px solid #ccc;
  color: #333;
}

[data-md-color-scheme="default"] .preview-content small {
  color: #333;
}

/* Адаптируем .tags-list */
[data-md-color-scheme="default"] .tags-list {
  background: #e0e0e0;
  color: #333;
}

/* Адаптируем .admonition */
[data-md-color-scheme="default"] .admonition {
  color: #000; /* Чёрный текст */
}

[data-md-color-scheme="default"] .admonition-title,
[data-md-color-scheme="default"] .admonition p {
  color: #000; /* Чёрный текст */
}

/* Center footer copyright */
.md-footer-meta__inner.md-grid {
  justify-content: center;
}
.md-footer-meta__copyright,
.md-copyright {
  display: flex;
  justify-content: center;
  width: 100%;
  text-align: center;
}