/* ======================
   BASE
====================== */
* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: #f8f5f2;
  color: #5b5550;
  line-height: 1.75;
}
.container {
  max-width: 1180px;
  margin: auto;
  padding: 0 20px;
}

.section {
  padding: 100px 0;
}

h1, h2, h3 {
  margin-top: 0;
  color: #4a4540;
  font-weight: 500;
  line-height: 1.2;
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 40px;
  text-align: center;
}

/* ======================
   HEADER & BURGER
====================== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  background: rgba(248, 245, 242, 0.9);
  border-bottom: 1px solid #e8dfd8;
}

.nav {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.logo {
  font-size: 24px;
  font-weight: 600;
  color: #4c4641;
}

.menu {
  display: flex;
  gap: 28px;
}

.menu a {
  text-decoration: none;
  color: #6f6761;
  font-size: 15px;
  font-weight: 500;
  transition: 0.3s;
}

.menu a:hover {
  color: #682e95;
}

.burger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1010;
  padding: 0;
}

.burger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #4c4641;
  border-radius: 2px;
  transition: 0.3s ease;
}

.burger-menu.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.burger-menu.active span:nth-child(2) { opacity: 0; }
.burger-menu.active span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

/* ======================
   HERO
====================== */
.hero {
  min-height: auto;
  display: flex;
  align-items: center;
  background: linear-gradient(to bottom, #f6f2ef, #f8f5f2);
  padding: 80px 0 60px 0;
}

.hero-content {
  max-width: 800px;
  text-align: left;
}

.hero-highlight {
  display: inline-block;
  background: #efe5f6;
  color: #682e95;
  padding: 12px 22px;
  border-radius: 30px;
  margin-bottom: 25px;
  font-size: 27px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 2px 10px rgba(104, 46, 149, 0.05);
}

.hero h1 {
  font-size: clamp(38px, 5vw, 56px);
  margin-bottom: 20px;
  line-height: 1.2;
  color: #4a4540;
}

.hero p {
  font-size: clamp(18px, 2vw, 22px);
  color: #7c746d;
  margin-bottom: 40px;
  max-width: 650px;
}

.hero-btn {
  display: inline-block;
  text-decoration: none;
  background: #682e95;
  color: white;
  padding: 18px 38px;
  border-radius: 40px;
  font-weight: 500;
  box-shadow: 0 8px 20px rgba(104, 46, 149, 0.2);
  transition: 0.3s ease;
}

.hero-btn:hover {
  background: #54227b;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(104, 46, 149, 0.35);
}

/* ======================
   ABOUT
====================== */
.about-wrapper { display: flex; align-items: flex-start; gap: 60px; }
.about img {
  width: 100%;
  max-width: 320px;
  border-radius: 30px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);
  position: sticky;
  top: 120px;
}
.about-text { flex: 1; }
.about-text h2 { text-align: left; }
.about-pillars { margin-top: 30px; display: grid; gap: 15px; }
.pillar {
  background: #fffdfc;
  padding: 20px;
  border-radius: 16px;
  border-left: 4px solid #682e95;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

/* ======================
   EDUCATION
====================== */
.education-card {
  background: #fffdfc;
  padding: 50px;
  border-radius: 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.03);
  border: 1px solid #f0e6de;
}
.education-card h2 { text-align: left; margin-bottom: 35px; }
.education-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 30px; }
.edu-block { background: #fdfbfa; padding: 25px; border-radius: 20px; border: 1px solid #f5ebe4; }
.edu-meta { display: flex; gap: 30px; background: #fdf2ff; padding: 20px; border-radius: 16px; color: #7a5f92; flex-wrap: wrap; }
.divider { border: 0; height: 1px; background: #f0e6de; margin: 40px 0; }
.education-list { padding-left: 20px; }
.education-list li { margin-bottom: 12px; }

/* ======================
   CARDS (LECTURES & VIDEOS)
====================== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.info-card {
  background: #fffdfc;
  padding: 40px 30px;
  border-radius: 24px;
  transition: 0.3s ease;
  box-shadow: 0 15px 40px rgba(0,0,0,0.03);
  border: 1px solid #f3ece6;
  display: flex;
  flex-direction: column;
}
.info-card:hover { transform: translateY(-5px); box-shadow: 0 20px 45px rgba(104, 46, 149, 0.08); }
.card-icon { font-size: 36px; margin-bottom: 20px; color: #8b8179; }
.info-card h3 { font-size: 22px; margin-bottom: 15px; }
.info-card p { color: #7c746d; flex-grow: 1; margin-bottom: 25px; }
.card-link { color: #682e95; text-decoration: none; font-weight: 600; font-size: 15px; }

/* ======================
   ARTICLES, SEARCH & SIDEBAR
====================== */
.articles-layout {
  display: grid;
  grid-template-columns: 1fr 380px; /* Существенно расширили сайдбар для вместительности */
  gap: 50px;
  align-items: start;
}

.search-wrapper {
  position: relative;
  max-width: 500px;
  margin: 0 auto 30px auto;
}

#articleSearch {
  width: 100%;
  padding: 14px 20px 14px 45px;
  border-radius: 30px;
  border: 1px solid #dcd1ca;
  background: white;
  font-size: 15px;
  font-family: inherit;
  color: #5b5550;
  transition: 0.3s;
}

#articleSearch:focus {
  outline: none;
  border-color: #682e95;
  box-shadow: 0 0 0 3px rgba(104, 46, 149, 0.1);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #a39890;
  pointer-events: none;
}

.articles { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }

/* Боковой сайдбар публикаций — НОВЫЙ СВЕРХВМЕСТИТЕЛЬНЫЙ ДИЗАЙН */
.sidebar-box {
  background: #fffdfc;
  padding: 30px 24px;
  border-radius: 28px;
  border: 1px solid #eaddd3;
  position: sticky;
  top: 110px;
  box-shadow: 0 15px 45px rgba(104, 46, 149, 0.03);
}

.sidebar-box h3 {
  font-size: 20px;
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #efe5f6;
  color: #4a4540;
}

/* Полный сброс дефолтных отступов списка */
.recent-articles-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  max-height: 520px;         /* Увеличили высоту контейнера под статьи */
  overflow-y: auto;          /* Включаем внутренний скролл */
  padding-right: 10px !important;
}

/* Красивый кастомный скроллбар */
.recent-articles-list::-webkit-scrollbar {
  width: 6px;
}
.recent-articles-list::-webkit-scrollbar-track {
  background: #fdfaf7;
  border-radius: 10px;
}
.recent-articles-list::-webkit-scrollbar-thumb {
  background: #dcd1ca;
  border-radius: 10px;
}
.recent-articles-list::-webkit-scrollbar-thumb:hover {
  background: #682e95;
}

.recent-item {
  margin: 0 0 10px 0 !important;
  padding: 0 0 10px 0 !important;
  border-bottom: 1px solid #f3ece6;
  list-style-type: none !important; /* Убираем любые маркеры */
}

.recent-item:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none;
}

.recent-item a {
  text-decoration: none;
  color: #5b5550;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.5;
  display: block;
  transition: all 0.25s ease;
  padding: 6px 8px;
  border-radius: 8px;
}

/* Подсветка при наведении, как в полноценных меню */
.recent-item a:hover {
  color: #682e95;
  background: #fdf2ff;
  padding-left: 12px;
}
.recent-skeleton { color: #8b8179; font-size: 14px; }
.intro-card {
  background: #ffffff;
  padding: 40px;
  border-radius: 32px;
  border: 1px solid #f2ece7;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.02);
}

.intro-card h3 {
  font-size: 24px;
  margin-bottom: 20px;
  color: #2b2521;
}

.intro-card p {
  color: #7c746d;
  margin-bottom: 20px;
  line-height: 1.6;
}

.intro-card .more-link {
  color: #682e95;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
}

/* ======================
   CONSULTATION FORM
====================== */
.consultation { background: #f2edf4; }
.form-wrapper { max-width: 650px; margin: 0 auto; text-align: center; }
.consultation-form { text-align: left; }
.consultation-form input, .consultation-form textarea, .consultation-form select {
  width: 100%; margin-bottom: 20px; padding: 18px; border-radius: 14px; border: 1px solid #dcd1ca; background: white; font-size: 15px; font-family: inherit; color: #5b5550; transition: 0.3s;
}
.consultation-form input:focus, .consultation-form textarea:focus, .consultation-form select:focus { outline: none; border-color: #682e95; box-shadow: 0 0 0 3px rgba(104, 46, 149, 0.15); }
.consultation-form textarea { min-height: 150px; resize: vertical; }
.consultation-form button { width: 100%; background: #682e95; color: white; border: none; padding: 18px; border-radius: 40px; font-size: 16px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 15px rgba(104, 46, 149, 0.2); transition: 0.3s; }
.consultation-form button:hover { background: #54227b; }

/* ======================
   CONTACTS WITH BRAND HOVERS
====================== */
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 20px; }
.contact-item { background: white; padding: 30px 20px; border-radius: 20px; text-decoration: none; color: inherit; display: flex; flex-direction: column; align-items: center; transition: 0.3s; border: 1px solid #ede4dc; }
.contact-item .contact-icon { color: #8b8179; margin-bottom: 12px; transition: color 0.3s ease, transform 0.3s ease; }
.contact-item strong { margin-bottom: 6px; color: #4a4540; }
.contact-item span:last-child { font-size: 14px; color: #8b8179; word-break: break-all; }

.contact-mail:hover { border-color: #4a4540; }
.contact-mail:hover .contact-icon { color: #4a4540; transform: scale(1.1); }
.contact-tg:hover { border-color: #0088cc; }
.contact-tg:hover .contact-icon { color: #0088cc; transform: scale(1.1); }
.contact-insta:hover { border-color: #e1306c; }
.contact-insta:hover .contact-icon { color: #e1306c; transform: scale(1.1); }
.contact-yt:hover { border-color: #ff0000; }
.contact-yt:hover .contact-icon { color: #ff0000; transform: scale(1.1); }

/* ======================
   FOOTER & UTILS
====================== */
.nonedecoration { text-decoration: none; }
.footer { background: #eee6e0; padding: 35px 0; text-align: center; color: #8b8179; font-size: 15px; }

/* ======================
   ANIMATIONS
====================== */
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.fade-in.show { opacity: 1; transform: translateY(0); }

/* ======================
   УЛЬТИМАТИВНЫЙ АДАПТИВ
   ====================== */
@media (min-width: 1200px) { .container { max-width: 1140px; padding: 0; } }
@media (max-width: 1199px) { .container { max-width: 960px; padding: 0 24px; } .about-wrapper { gap: 40px; } .education-card { padding: 40px; } }

@media (max-width: 992px) {
  .section { padding: 80px 0; }
  .burger-menu { display: flex; }

  .menu {
    position: fixed; top: 80px; left: 0; width: 100%; background: #f8f5f2; flex-direction: column; align-items: center; padding: 40px 0; gap: 24px; border-bottom: 1px solid #e8dfd8; transform: translateY(-150%); transition: 0.4s ease; opacity: 0; box-shadow: 0 15px 30px rgba(0,0,0,0.05);
  }
  .menu.active { transform: translateY(0); opacity: 1; }

  .articles-layout { grid-template-columns: 1fr; gap: 40px; }
  .sidebar-box { position: static; }
  .recent-articles-list { max-height: none; padding-right: 0 !important; }

  .education-grid { grid-template-columns: 1fr; gap: 24px; }
  .about-wrapper { flex-direction: column; align-items: center; text-align: center; }
  .about-text h2 { text-align: center; }
  .about img { position: static; max-width: 280px; margin-bottom: 20px; }
  .pillar { text-align: left; }
}

@media (max-width: 768px) {
  .section { padding: 60px 0; }
  h1 { font-size: 36px !important; }
  h2 { font-size: 28px !important; margin-bottom: 30px; }

  .hero { padding: 40px 0; }
  .hero-content { padding-left: 0; padding-right: 0; }

  .education-card { padding: 30px 20px; border-radius: 20px; }
  .edu-meta { flex-direction: column; gap: 12px; }
  .cards-grid { grid-template-columns: 1fr; gap: 20px; }
  .articles { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 576px) {
  .container { padding: 0 16px; }
  .logo { font-size: 20px; }
  .hero-highlight { font-size: 14px; padding: 10px 16px; line-height: 1.4; }
  .hero-btn, .consultation-form button { width: 100%; padding: 16px 20px; font-size: 15px; }
  .consultation-form input, .consultation-form textarea, .consultation-form select { padding: 14px; font-size: 14px; border-radius: 10px; }
  .contacts-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .contact-item { padding: 20px 10px; }
}

@media (max-width: 360px) { .contacts-grid { grid-template-columns: 1fr; } }


/* ==========================================================================
   БЛОК: СТАТЬИ, КНОПКА ПОДГРУЗКИ И ПОП-АП
   ========================================================================== */

#articles .article {
  background: #fffdfc;
  padding: 35px;
  border-radius: 24px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.03);
  border: 1px solid #f3ece6;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;

  flex-direction: column;
}

#articles .article:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 45px rgba(104, 46, 149, 0.08);
  border-color: #682e95;
}

#articles .article p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 20px;
  color: #7c746d;
}

.article-more-link {
  margin-top: auto;
  color: #682e95;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}

.load-more-container {
  text-align: center;
  margin-top: 40px;
  width: 100%;
}

.load-more-btn {
  background: transparent;
  color: #682e95;
  border: 2px solid #682e95;
  padding: 12px 32px;
  border-radius: 40px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}

.load-more-btn:hover {
  background: #682e95;
  color: white;
  box-shadow: 0 6px 15px rgba(104, 46, 149, 0.15);
}

.load-more-btn:disabled {
  display: none;
}

/* ВСПЛЫВАЮЩЕЕ ОКНО (ПОП-АП) */
.article-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.article-modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(74, 69, 64, 0.55);
  backdrop-filter: blur(5px);
}

.modal-content-wrapper {
  position: relative;
  background: #fffdfc;
  width: 100%;
  max-width: 780px;
  max-height: 85vh;
  border-radius: 28px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  z-index: 2001;
  animation: modalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-inner-body {
  padding: 45px;
  overflow-y: auto;
}

.modal-inner-body h2 {
  text-align: left;
  font-size: 32px;
  margin-bottom: 20px;
  color: #4a4540;
}

.modal-inner-body .modal-text {
  font-size: 16px;
  line-height: 1.8;
  color: #5b5550;
  white-space: pre-wrap;
}

.modal-close-btn {
  position: absolute;
  top: 25px;
  right: 25px;
  background: #f6f2ef;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 26px;
  color: #8b8179;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  z-index: 2002;
}

.modal-close-btn:hover {
  background: #efe5f6;
  color: #682e95;
}

body.modal-open {
  overflow: hidden;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 576px) {
  .modal-inner-body { padding: 30px 20px; }
  .modal-inner-body h2 { font-size: 24px; padding-right: 30px; }
  .modal-close-btn { top: 15px; right: 15px; width: 34px; height: 34px; font-size: 22px; }
}

/* ==========================================================================
   НОВЫЕ СТИЛИ ДЛЯ ВЫВОДА КАРТИНОК В СТАТЬЯХ
   ========================================================================== */

/* Обложка на главной карточке статьи */
.article-cover-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 20px;
  background: #eee;
}

/* Обложка внутри всплывающего поп-апа (сверху текста) */
.modal-cover-img {
  width: 100%;
  height: auto;
  max-height: 550px;
  object-fit: contain;
  border-radius: 18px;
  margin-bottom: 25px;
  background: transparent;
  display: block;
}

/* Картинка, которую ты сможешь вставить прямо внутрь текста статьи */
.modal-inner-body .inner-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 25px auto;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.04);
}

/* Фикс высоты обложки на мобильных устройствах */
@media (max-width: 576px) {
  .modal-cover-img {
    max-height: 280px;
  }
}