/* =========================================================================
   К СЕБЕ — стили дочерней темы psy-mk-child
   Путь: wp-content/themes/psy-mk-child/assets/ksebe.css

   Первый проход: приводит демо-блоки messia к бренду и чинит вёрстку,
   которая ломается на реальном контенте. Селекторы написаны под разметку,
   снятую с tvoy-psiholog.ru 20.09.2026.
   ========================================================================= */

:root {
	/* Бренд. Тёмный оттенок — для текста и заливок под белым текстом:
	   светлый оранжевый с белым текстом не проходит по контрасту. */
	--ks-orange:       #F0741F;
	--ks-orange-deep:  #C24A0E;
	--ks-orange-soft:  #FDF1E8;

	--ks-ink:          #1A1A19;
	--ks-muted:        #6B6560;
	--ks-line:         #E4DFD8;
	--ks-surface:      #FFFFFF;
	--ks-ground:       #F6F4F1;

	--ks-radius:       16px;
	--ks-radius-sm:    10px;
}


/* -------------------------------------------------------------------------
   1. Кнопки — единый вид вместо трёх разных из демо
   ---------------------------------------------------------------------- */

.card-type .btn-white,
.main-faq-button-row .button,
.text-center .btn-white.all-objects,
.cap-item .phone {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 24px;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

/* Основная кнопка */
.main-faq-button-row .button,
.cap-item .phone {
	background: var(--ks-orange-deep);
	color: #fff;
	border: 1px solid var(--ks-orange-deep);
}

.main-faq-button-row .button:hover,
.main-faq-button-row .button:focus,
.cap-item .phone:hover,
.cap-item .phone:focus {
	background: #A63C09;
	border-color: #A63C09;
	color: #fff;
}

/* Второстепенная кнопка */
.card-type .btn-white,
.text-center .btn-white.all-objects {
	background: var(--ks-surface);
	color: var(--ks-orange-deep);
	border: 1px solid var(--ks-line);
}

.card-type .btn-white:hover,
.card-type .btn-white:focus,
.text-center .btn-white.all-objects:hover,
.text-center .btn-white.all-objects:focus {
	border-color: var(--ks-orange-deep);
	background: var(--ks-orange-soft);
	color: var(--ks-orange-deep);
}

/* Кнопка без текста ломает карточку — прячем до заполнения поля в админке */
.card-type .btn-white:empty {
	display: none;
}

/* Видимый фокус с клавиатуры */
a:focus-visible,
button:focus-visible {
	outline: 2px solid var(--ks-orange-deep);
	outline-offset: 2px;
}


/* -------------------------------------------------------------------------
   2. Первый экран
   ---------------------------------------------------------------------- */

.cap-right .cap-item {
	border-radius: var(--ks-radius);
}

/* Демо-градиент на первом правом блоке — меняем на брендовый фон */
.cap-right .cap-item_type-1 {
	background: var(--ks-orange-deep) !important;
	background-image: none !important;
	color: #fff;
}

.cap-right .cap-item_type-1 .title,
.cap-right .cap-item_type-1 .text {
	color: #fff;
}

.cap-right .cap-item_type-1 .phone {
	background: #fff;
	border-color: #fff;
	color: var(--ks-orange-deep);
	margin-top: 4px;
}

.cap-right .cap-item_type-1 .phone:hover,
.cap-right .cap-item_type-1 .phone:focus {
	background: var(--ks-orange-soft);
	border-color: var(--ks-orange-soft);
	color: var(--ks-orange-deep);
}

.cap-right .cap-item_type-1 .mark_h,
.cap-right .cap-item_type-1 .mark_h a {
	color: rgba(255, 255, 255, .85);
}

.cap-right .cap-item_type-1 .mark_h a {
	text-decoration: underline;
}

/* Второй блок — светлый, без декоративной кляксы из демо */
.cap-right .cap-item_type-3 {
	background: var(--ks-surface) !important;
	background-image: none !important;
	border: 1px solid var(--ks-line);
}

.cap-left .h1 {
	text-wrap: balance;
}

.cap-left .text {
	max-width: 52ch;
	color: var(--ks-muted);
}


/* -------------------------------------------------------------------------
   3. «Почему выбирают К СЕБЕ»
   Было 3 + 1: четвёртая карточка оставалась сиротой во втором ряду.
   ---------------------------------------------------------------------- */

.why .items {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	align-items: stretch;
}

.why .items .item {
	display: flex;
	flex-direction: column;
	gap: 10px;
	height: auto;
	margin: 0;
	padding: 24px;
	background: var(--ks-surface);
	border: 1px solid var(--ks-line);
	border-radius: var(--ks-radius);
	text-align: left;
}

.why .items .item .title {
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	text-align: left;
	color: var(--ks-ink);
}

.why .items .item .text,
.why .items .item .text p {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	text-align: left;
	color: var(--ks-muted);
}

@media (max-width: 1100px) {
	.why .items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
	.why .items { grid-template-columns: 1fr; }
}


/* -------------------------------------------------------------------------
   4. Плитки «С чем помогают» (.card-type-1 … .card-type-6)

   В демо это шесть разных пресетов: синий и фиолетовый градиенты, зелёная
   заливка, абстрактные кляксы фоном. К бренду отношения не имеют.
   !important нужен: фоны заданы в теме высокоспецифичными правилами.
   ---------------------------------------------------------------------- */

.grid.grid-col-2 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 20px;
}

.grid .card-type,
.grid .card-type-1,
.grid .card-type-2,
.grid .card-type-3,
.grid .card-type-4,
.grid .card-type-5,
.grid .card-type-6 {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	min-height: 0;
	padding: 28px;
	background: var(--ks-surface) !important;
	background-image: none !important;
	border: 1px solid var(--ks-line);
	border-radius: var(--ks-radius);
	color: var(--ks-ink);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.grid .card-type:hover {
	border-color: var(--ks-orange);
	box-shadow: 0 6px 20px rgba(26, 26, 25, .06);
}

.grid .card-type .title {
	font-size: 20px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--ks-ink) !important;
	text-wrap: balance;
}

.grid .card-type .text {
	flex-grow: 1;
	font-size: 15px;
	line-height: 1.55;
	color: var(--ks-muted) !important;
}

/* Первая плитка — единственный акцент в секции */
.grid .card-type-1 {
	background: var(--ks-orange-soft) !important;
	border-color: #F2D9C6;
}


/* -------------------------------------------------------------------------
   5. FAQ
   ---------------------------------------------------------------------- */

.main-faq-button-row.row {
	display: flex;
	justify-content: center;
	margin-top: 24px;
}

#faq .spoiler .title {
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
}


/* -------------------------------------------------------------------------
   6. Статьи
   Слайдер на три колонки с одной статьёй растягивал карточку в полосу.
   ---------------------------------------------------------------------- */

.articles-home .slider-articles.slider-3-item:not(.slick-initialized) {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
}

.articles-home .slider-articles .item {
	padding: 20px;
	background: var(--ks-surface);
	border: 1px solid var(--ks-line);
	border-radius: var(--ks-radius);
}

.articles-home .slider-articles .item .title a {
	font-size: 17px;
	font-weight: 600;
	color: var(--ks-ink);
	text-decoration: none;
}

.articles-home .slider-articles .item .btn-read {
	display: inline-block;
	margin-top: 12px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ks-orange-deep);
	text-decoration: none;
}

.articles-home .slider-articles .item .btn-read:hover {
	text-decoration: underline;
}


/* -------------------------------------------------------------------------
   7. «Когда стоит обратиться к психологу»
   Пока нет картинки — колонка текста не должна растягиваться на всю ширину.
   ---------------------------------------------------------------------- */

.home-description .flex {
	display: flex;
	flex-wrap: wrap;
	gap: 40px;
	align-items: flex-start;
}

.home-description .flex .left {
	flex: 1 1 420px;
	max-width: 68ch;
}

.home-description .flex .left .title {
	margin-bottom: 16px;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.2;
	text-wrap: balance;
}

.home-description .flex .left .text {
	font-size: 16px;
	line-height: 1.65;
	color: var(--ks-muted);
}


/* -------------------------------------------------------------------------
   8. Перелинковка
   ---------------------------------------------------------------------- */

.home-filters .bg-white.p40 {
	border: 1px solid var(--ks-line);
	border-radius: var(--ks-radius);
}

/* Пустая вкладка без категорий — скрываем контейнер, чтобы не зияла рамка.
   Удалите это правило, когда заведёте категории и появятся ссылки. */
.home-filters .tab-content .tab-pane .tab-content:empty {
	display: none;
}


/* -------------------------------------------------------------------------
   9. Мелочи
   ---------------------------------------------------------------------- */

.section .h2-title {
	text-wrap: balance;
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		animation: none !important;
	}
}
/* FAQ: кнопка по содержимому, а не во всю ширину */
.main-faq-button-row.row .button {
	flex: 0 0 auto;
	width: auto;
	max-width: 100%;
	align-self: center;
}