/*
Theme Name: Психологический центр «Рядом»
Theme URI: https://your-site.com
Author: Your Name
Description: Тема для психологического центра «Рядом». Профессиональный дизайн, адаптивность, форма обратной связи.
Version: 1.0
License: GPL v2 or later
Text Domain: ryadom
*/

/* === Базовые настройки === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #FEFCF8;
  color: #2C3E2F;
  line-height: 1.5;
  scroll-behavior: smooth;
}

:root {
  --primary: #5A8F7C;
  --primary-dark: #3F6B5B;
  --primary-light: #D9EDE5;
  --accent: #E7B183;
  --accent-dark: #D49C6C;
  --gray-bg: #F8F6F2;
  --text-dark: #1F2E23;
  --text-light: #5B6E5E;
  --shadow-sm: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 20px 25px -12px rgba(0, 0, 0, 0.08);
  --border-radius: 2rem;
  --card-radius: 1.5rem;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === Типографика и утилиты === */
.hidden {
  display: none;
}

button:active {
  transform: scale(0.98);
}

/* === Кнопки === */
.btn-primary,
.btn-outline {
  display: inline-block;
  border-radius: 3rem;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  font-weight: 500;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  font-weight: 600;
  padding: 0.9rem 1.8rem;
  border: none;
  font-size: 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  padding: 0.7rem 1.6rem;
}
.btn-outline:hover {
  background: var(--primary-light);
}

.btn-sm {
  padding: 0.5rem 1.2rem;
  font-size: 0.9rem;
}

/* === Шапка (Header) === */
.site-header {
  background: rgba(254, 252, 248, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(90, 143, 124, 0.15);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  gap: 2rem;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.logo span {
  font-weight: 400;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 1rem;
  list-style: none;
}
.nav-links a {
  text-decoration: none;
  font-weight: 500;
  color: var(--text-dark);
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--primary);
}

.mobile-menu-btn {
  display: none;
  font-size: 1.6rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary-dark);
}

/* === Секции === */
section {
  padding: 5rem 0;
}

.section-title {
  font-size: 2.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
  color: #1F2E23;
}

.section-sub {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem auto;
  color: var(--text-light);
  font-size: 1.1rem;
}

/* === Hero === */
.hero {
  padding: 4rem 0 5rem;
}

.hero-grid {
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.hero-content {
  flex: 1.2;
}
.hero-content h1 {
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #1E3A2F;
}
.hero-content .highlight {
  color: var(--primary);
}

.hero-desc {
  font-size: 1.2rem;
  margin: 1.5rem 0;
  color: var(--text-light);
  max-width: 90%;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.badge {
  background: var(--gray-bg);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.hero-illus {
  flex: 0.8;
  background: #E9F3EF;
  border-radius: 3rem;
  padding: 2rem;
  text-align: center;
}
.hero-illus i {
  font-size: 8rem;
  color: var(--primary);
  opacity: 0.7;
}

/* === Карточки (общий вид) === */
.cards-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.service-card {
  background: white;
  border-radius: var(--card-radius);
  padding: 2rem;
  flex: 1 1 250px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s;
  text-align: center;
  border: 1px solid #f0f0ea;
}

.service-card i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1.2rem;
}

.service-card h3 {
  margin-bottom: 0.75rem;
}

.service-card .card-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
}

.card-excerpt {
  margin-bottom: 1.5rem;
  color: var(--text-light);
  flex-grow: 1;
}

/* === Сетка проблем === */
.problems-grid {
  background: var(--gray-bg);
  border-radius: 2rem;
  padding: 2.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem 2rem;
  list-style: none;
}
.problems-grid li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1rem;
  padding: 0.4rem 0;
}
.problems-grid i {
  color: var(--primary);
  width: 1.5rem;
}

/* === Специалисты (карточки и профиль) === */
.specialists,
.specialists-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.spec-card {
  background: white;
  border-radius: 2rem;
  padding: 1.8rem;
  text-align: center;
  width: 440px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
}
.spec-card:hover {
  transform: translateY(-4px);
}

.spec-price {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 1.2rem;
  margin: 0.8rem 0 1rem;
  background: var(--primary-light);
  display: inline-block;
  padding: 0.3rem 1rem;
  border-radius: 2rem;
}

.avatar {
  width: 110px;
  height: 110px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 3rem;
  color: var(--primary-dark);
  overflow: hidden;
}
.spec-card .avatar {
  width: 120px;
  height: 120px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spec-excerpt {
  margin-bottom: 1.5rem;
  color: var(--text-light);
  flex-grow: 1;
}

/* Профиль специалиста */
.specialist-profile {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-top: 2rem;
}

.specialist-avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.specialist-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Отдельная услуга */
.single-service .service-detail {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-top: 2rem;
}

.service-icon-large {
  font-size: 5rem;
  color: var(--primary);
  flex-shrink: 0;
}

/* Ограничение ширины текста */
.page-content .entry-content,
.single-post .entry-content,
.single-service .entry-content,
.single-specialist .entry-content {
  max-width: 760px;
  margin: 0 auto;
}

.page-content .entry-header,
.single-post .entry-header,
.page-content .breadcrumbs,
.single-post .breadcrumbs {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* === Форма и контакты === */
.contact-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  background: white;
  border-radius: 2rem;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.contact-info {
  flex: 1;
  background: #F6F9F4;
  padding: 2.5rem;
}
.contact-form {
  flex: 1;
  padding: 2.5rem;
}

.info-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}
.info-item i {
  font-size: 1.4rem;
  color: var(--primary);
  margin-top: 0.2rem;
}

.messenger-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.mess-btn {
  background: white;
  border-radius: 3rem;
  padding: 0.5rem 1.2rem;
  border: 1px solid #ddd8ce;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: 0.2s;
}
.mess-btn i {
  font-size: 1.2rem;
}

.form-group {
  margin-bottom: 1.2rem;
}

input,
textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid #e2e0da;
  font-family: inherit;
  transition: 0.2s;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(90,143,124,0.2);
}

.form-message {
  margin-top: 1rem;
  font-weight: 500;
  display: none;
  text-align: center;
}
.form-message.success {
  color: #2e7d32;
  display: block;
}
.form-message.error {
  color: #c62828;
  display: block;
}

/* === Чекбокс согласия === */
.privacy-check {
  margin: 1.2rem 0;
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-dark);
  position: relative;
  padding-left: 28px;
  user-select: none;
}
.custom-checkbox input {
  position: absolute;
  opacity: 0;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  left: 0;
  top: 2px;
  height: 18px;
  width: 18px;
  background-color: #fff;
  border: 1.5px solid var(--primary);
  border-radius: 4px;
  transition: all 0.2s;
}
.custom-checkbox:hover input ~ .checkmark {
  border-color: var(--primary-dark);
}
.custom-checkbox input:checked ~ .checkmark {
  background-color: var(--primary);
  border-color: var(--primary);
}
.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}
.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}
.custom-checkbox .checkmark:after {
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.privacy-check a {
  color: var(--primary);
  text-decoration: underline;
}
.privacy-check a:hover {
  color: var(--primary-dark);
}

/* === Cookie-баннер === */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #1F2E23;
  color: #eee;
  z-index: 9999;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
  padding: 1rem 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.cookie-banner__content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cookie-banner__content a {
  color: var(--accent);
  text-decoration: underline;
}

.cookie-banner__btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.6rem 1.6rem;
  border-radius: 2rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  font-family: inherit;
  font-size: 0.9rem;
}
.cookie-banner__btn:hover {
  background: var(--primary-dark);
}

/* === Футер === */
.site-footer {
  background: #1F2E23;
  color: #ccc;
  padding: 3rem 0 2rem;
  font-size: 0.9rem;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col {
  flex: 1 1 250px;
}
.footer-info p {
  margin-bottom: 0.5rem;
}
.footer-links ul {
  list-style: none;
  padding: 0;
}
.footer-links li {
  margin-bottom: 0.5rem;
}
.footer-links a {
  color: #ccc;
  text-decoration: underline;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
}
.footer-bottom p {
  margin-bottom: 0.5rem;
}

/* === Блог и страницы === */
.entry-title,
.archive-title {
  font-size: 2.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1F2E23;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  color: var(--text-light);
  font-size: 0.9rem;
}
.entry-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.featured-image {
  margin-bottom: 2rem;
  border-radius: var(--card-radius);
  overflow: hidden;
}
.featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.entry-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-dark);
}
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}
.entry-content p {
  margin-bottom: 1.5rem;
}
.entry-content ul,
.entry-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.entry-content a {
  color: var(--primary);
  text-decoration: underline;
}

.entry-tags {
  margin-top: 2rem;
  padding: 1rem 0;
  border-top: 1px solid #e0e0da;
  color: var(--text-light);
}
.entry-tags a {
  color: var(--primary);
  text-decoration: none;
}

.post-navigation {
  margin-top: 3rem;
  display: flex;
  justify-content: space-between;
}
.post-navigation a {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border: 1.5px solid var(--primary);
  border-radius: 3rem;
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  transition: 0.2s;
}
.post-navigation a:hover {
  background: var(--primary-light);
}

/* === Хлебные крошки === */
.breadcrumbs {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}
.breadcrumbs a {
  color: var(--primary);
  text-decoration: none;
}
.breadcrumbs a:hover {
  text-decoration: underline;
}
.breadcrumb-sep {
  color: #ccc;
  margin: 0 0.4rem;
}

/* === Архив записей === */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.post-card {
  background: white;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
  border: 1px solid #f0f0ea;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  transform: translateY(-4px);
}

.post-thumbnail-link {
  display: block;
  overflow: hidden;
}
.post-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.post-card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.post-card-title {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
.post-card-title a {
  color: var(--text-dark);
  text-decoration: none;
}
.post-card-title a:hover {
  color: var(--primary);
}

.post-card-meta {
  color: var(--text-light);
  font-size: 0.8rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
}

.post-card-excerpt {
  margin-bottom: 1.5rem;
  color: var(--text-light);
  flex-grow: 1;
}

.faq {
  text-align: center;
  max-width:760px;
  margin: auto;
}

.faq h2 {
  margin-bottom: 1.2rem;
}

.faq p, details {
  margin-bottom: 1.2rem;
}

.faq p {
  text-align: left;
}

.faq details {
  font-size: 1.2rem;
}


/* ===== АДАПТИВНОСТЬ (медиазапросы) — ИСПРАВЛЕННАЯ ВЕРСИЯ ===== */

/* --- Планшеты и маленькие ноутбуки (до 860px) --- */
@media (max-width: 860px) {
  /* 1. Мобильное меню */
  .nav-links {
    display: flex;
    flex-direction: column;
    background: white;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-radius: 0 0 1.5rem 1.5rem;
    gap: 0.8rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 99;
    border-top: 1px solid rgba(90, 143, 124, 0.2);
  }
  .nav-links.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-links li {
    margin: 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0ea;
  }
  .nav-links li:last-child {
    border-bottom: none;
  }
  .nav-links a {
    font-size: 1.1rem;
    padding: 0.5rem 0;
    display: block;
  }
  .mobile-menu-btn {
    display: block;
    z-index: 100;
  }

  /* 2. Hero секция */
  .hero-grid {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  .hero-content h1 {
    font-size: 2.6rem;
  }
  .hero-desc {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  .hero-illus {
    flex: 0 0 auto;
    width: 100%;
    padding: 2rem 1rem;
  }
  .hero-badges {
    justify-content: center;
  }
  .hero-content .btn-outline {
    margin-left: 0.5rem !important;
  }

  /* 3. Сетка проблем */
  .problems-grid {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }

  /* 4. Контейнер */
  .container {
    padding: 0 20px;
  }

  /* 5. Контакты */
  .contact-wrap {
    flex-direction: column;
  }
}

/* --- Планшеты (до 768px) --- */
@media (max-width: 768px) {
  .entry-title,
  .archive-title {
    font-size: 1.8rem;
  }
  .posts-grid {
    grid-template-columns: 1fr;
  }

  /* Страницы услуг и специалистов */
  .single-service .service-detail,
  .specialist-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .service-icon-large {
    margin-bottom: 1rem;
  }
  .single-service .entry-content,
  .single-specialist .entry-content {
    max-width: none;
    margin: 0;
  }
  .post-navigation {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  .post-navigation a {
    width: 100%;
    text-align: center;
  }
}

/* --- Маленькие планшеты и большие телефоны (до 600px) --- */
@media (max-width: 600px) {
  .cookie-banner {
    font-size: 0.8rem;
    padding: 0.8rem 0;
    max-height: 40vh;
    overflow-y: auto;
  }
  .cookie-banner__content {
    flex-direction: column;
    text-align: center;
    gap: 0.8rem;
  }
  .cookie-banner__btn {
    width: 100%;
    padding: 0.6rem 1rem;
  }
  .footer-grid {
    flex-direction: column;
    text-align: center;
  }
  .footer-links li {
    margin-bottom: 0.8rem;
  }
  .site-footer a {
    color: #ddd;
    text-decoration: underline;
    padding: 0.2rem 0;
    display: inline-block;
  }
  .hero-content h1 {
    font-size: 2.2rem;
  }
}

/* --- Телефоны (до 580px) --- */
@media (max-width: 580px) {
  section {
    padding: 3rem 0;
  }
  .hero-badges {
    justify-content: center;
  }
}

/* --- Очень маленькие телефоны (до 400px) --- */
@media (max-width: 400px) {
  .hero-content h1 {
    font-size: 1.8rem;
  }
  .section-title {
    font-size: 1.6rem;
  }
  .hero-desc {
    font-size: 1rem;
  }
  .container {
    padding: 0 15px;
  }
  section {
    padding: 2.5rem 0;
  }
  .btn-primary,
  .btn-outline {
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
    min-height: 44px; /* Удобство для тапа */
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
  }
  .spec-card {
    padding: 1.2rem;
  }
  .problems-grid {
    padding: 1rem;
    gap: 0.5rem;
  }
  .problems-grid li {
    font-size: 0.9rem;
  }
  .contact-info,
  .contact-form {
    padding: 1.5rem;
  }
  .mess-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .nav-links a,
  .breadcrumbs a {
    padding: 0.5rem 0;
  }
}

/* --- Для экранов шире 861px: фиксируем ширину иллюстрации в Hero --- */
@media (min-width: 861px) {
  .hero-illus {
    flex: 0 0 300px;
  }
}

/* --- Улучшение изображений в карточках --- */
.post-thumbnail {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.service-card .card-thumbnail img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
}
