/* =========================================
   SERVICES PAGE - FINAL STYLES
   Guidebook: Montserrat, 2% spacing, Abstract Purple palette
   ========================================= */

:root {
  --color-abstract-purple: #322242;
  --color-astronomist: #52366E;
  --color-lavender: #C7B6D8;
  --color-grey: #E7E7E7;
  --color-white: #FFFFFF;
  --font-primary: 'Montserrat', sans-serif;
  --radius: 6px;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}


/* === Services-Page === */
.services-page .hero-section {
  background-color: var(--color-abstract-purple); /* #322242 */
  position: relative;
  min-height: 500px; /* минимальная высота */
  display: flex;
  align-items: center;
}

.services-page .hero-content {
    position: relative;
    margin: 0 auto;
    max-width: 900px;
    text-align: center;
}

.services-page .hero-content::before {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}


.services-page .hero-title {
  font-family: var(--font-primary);
  font-weight: 400; /* Regular per Guidebook */
  font-size: 4rem; /* 4X per Guidebook */
  letter-spacing: 0.02em; /* 2% spacing */
  color: var(--color-white); /* #FFFFFF */
  margin: 0;
  line-height: 1.2;
}

.services-page .hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 16px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.2); /* полупрозрачная белая линия */
  width: 100%;
  max-width: 1200px;
}

.service-tag {
  font-family: var(--font-primary);
  font-weight: 300; /* Light per Guidebook */
  font-size: 0.875rem;
  letter-spacing: 0.02em; /* 2% spacing */
  color: var(--color-white); /* БЕЛЫЙ текст для контраста */
  text-decoration: none;
  padding: 8px 20px;
  border: 1px solid rgba(199, 182, 216, 0.6); /* полупрозрачный Lavender */
  border-radius: 30px; /* более округлые pill-shaped */
  background: rgba(255, 255, 255, 0.05); /* лёгкий белый фон */
  backdrop-filter: blur(4px); /* эффект матового стекла */
  transition: 
    color 0.25s ease, 
    border-color 0.25s ease, 
    background 0.25s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.service-tag:hover,
.service-tag:focus-visible {
  color: var(--color-abstract-purple); /* тёмный текст при hover */
  border-color: var(--color-lavender); /* #C7B6D8 */
  background: var(--color-white); /* белый фон */
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(199, 182, 216, 0.3);
}

.service-tag:active {
  transform: translateY(0);
}

/* Активный тег */
.service-tag.is-active {
  color: var(--color-abstract-purple);
  border-color: var(--color-lavender);
  background: var(--color-white);
  font-weight: 400; /* Regular для акцента */
}

/* Адаптив */
@media (max-width: 768px) {
  .hero-section {
    padding: 80px 0 60px 0;
    min-height: 400px;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-tags {
    gap: 10px;
    margin-top: 32px;
    padding-top: 24px;
  }
  
  .service-tag {
    font-size: 0.8rem;
    padding: 6px 16px;
  }
}


.services-block {
  font-family: var(--font-primary);
  color: var(--color-abstract-purple);
  max-width: 1140px;
  margin: 0 auto 64px auto;
  padding: 0 24px;
}

.services-block__title {
  font-weight: 400; /* Regular per Guidebook */
  font-size: 2.25rem;
  letter-spacing: 0.02em;
  margin: 0 0 32px 0;
  line-height: 1.2;
}

/* Обёртка списка + кнопка над ним */
.services-list-wrapper {
  margin-bottom: 40px;
}

.services-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  margin: 20px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.services-toggle::before,
.services-toggle::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--color-astronomist);
  border-bottom: 2px solid var(--color-astronomist);
  transform: rotate(45deg);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}
.services-toggle::before { top: 10px; }
.services-toggle::after { top: 16px; }

/* Состояние: раскрыто (стрелка вверх) */
.services-toggle[aria-expanded="true"]::before,
.services-toggle[aria-expanded="true"]::after {
  transform: rotate(-135deg);
}

/* Hover */
.services-toggle:hover {
  border-color: var(--color-abstract-purple);
  background: rgba(50, 34, 66, 0.03);
}
.services-toggle:hover::before,
.services-toggle:hover::after {
  border-color: var(--color-abstract-purple);
}

/* Скрытый список с плавным раскрытием */
.services-list {
  list-style: none;
  margin: 0;
  padding: 24px 28px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 32px;
  background: var(--color-white);
  border: 1px solid var(--color-grey);
  border-radius: var(--radius);
}

.services-list li {
  font-weight: 300; /* Light per Guidebook */
  font-size: 1rem;
  letter-spacing: 0.02em;
  line-height: 1.6;
  position: relative;
  padding-left: 18px;
}

.services-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--color-lavender);
  border-radius: 50%;
}

/* Карточки постов */
.services-posts {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-post-card {
  position: relative;
  padding: 4px;
  background: #ffffff; /* Принудительно белый, чтобы тема не подмешивала фон */
  transition: transform 0.25s var(--transition-smooth), 
              border-color 0.25s ease, 
              box-shadow 0.25s ease;
}

.service-post-card__link-overlay {
  position: absolute;
  inset: 0;           /* Растягивается на всю карточку */
  z-index: 2;         /* Поверх контента */
  text-decoration: none;
}

.service-post-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-lavender);
  /* Более чёткая, менее "размытая" тень */
  box-shadow: 0 6px 20px rgba(50, 34, 66, 0.07); 
}
.service-post-card__date {
  display: block;
  font-weight: 300; /* Light */
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--color-astronomist);
  margin-bottom: 6px;
}

.service-post-card__title {
  font-weight: 400; /* Regular */
  font-size: 1.125rem;
  margin: 0 0 8px 0;
  line-height: 1.3;
  color: var(--color-abstract-purple);
}

.service-post-card__excerpt {
  font-weight: 300; /* Light */
  font-size: 0.9rem;
  color: var(--color-astronomist);
  margin: 0;
  line-height: 1.5;
}

/* Спойлер постов */
.services-posts__spoiler {
  display: none;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.services-posts__spoiler[data-state="visible"] {
  display: flex;
  animation: fadeSlideIn 0.4s var(--transition-smooth) forwards;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Адаптив */
@media (max-width: 768px) {
  .services-list {
    grid-template-columns: 1fr;
    gap: 10px 0;
  }
  .services-block__title {
    font-size: 1.75rem;
    margin-bottom: 24px;
  }
  .service-post-card {
    padding: 20px;
  }
}

/* Ретина-оптимизация границ */
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
  .service-post-card,
  .services-list.services-list--expanded {
    border-width: 0.5px;
  }
}