@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,200;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

* {
  --title-font: "Montserrat", Helvetica, Arial, sans-serif;
  --title-font-weight: bold;
}

h1,h2,h3,h4,h5,h6{
	font-weight: bold;
}

p.lead{
	font-weight: 400;
}

/* =============================================
   Стили для HTML-контента из WYSIWYG-редактора
   (TinyMCE) — блог-посты, проекты, спецпредложения
   ============================================= */

/* Общий контейнер контента */
.blog-read .post-text,
.col-lg-7 .rich-content,
.post-text {
	font-size: 16px;
	line-height: 1.8;
	color: #333;
}

/* Заголовки внутри контента */
.post-text h2,
.post-text h3,
.post-text h4 {
	margin-top: 32px;
	margin-bottom: 16px;
	line-height: 1.4;
}

.post-text h2 {
	font-size: 24px;
}

.post-text h3 {
	font-size: 20px;
}

/* Параграфы */
.post-text p {
	margin-bottom: 16px;
}

/* Изображения — базовые стили */
.post-text img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

/*
 * TinyMCE оборачивает картинки в <p>. Плавающий <img> внутри <p> не вызывает
 * обтекание текста в СЛЕДУЮЩИХ блоках, потому что <p> — блочный контейнер.
 * display: contents убирает <p>-обёртку из layout, и <img> становится прямым
 * потомком .post-text — float работает корректно.
 */
.post-text p:has(> img[style*="float"]:only-child) {
	display: contents;
}

/* Обтекание текстом — img с inline-стилями или классами TinyMCE */
.post-text img[style*="float: left"],
.post-text img[style*="float:left"],
.post-text img.align-left {
	float: left !important;
	margin: 4px 24px 16px 0 !important;
	max-width: 50%;
}

.post-text img[style*="float: right"],
.post-text img[style*="float:right"],
.post-text img.align-right {
	float: right !important;
	margin: 4px 0 16px 24px !important;
	max-width: 50%;
}

.post-text img[style*="margin-left: auto"][style*="margin-right: auto"],
.post-text img.align-center {
	display: block;
	margin: 20px auto;
}

/* Обтекание текстом — figure (TinyMCE оборачивает картинки с подписью) */
.post-text figure[style*="float: left"],
.post-text figure[style*="float:left"],
.post-text figure.align-left {
	float: left !important;
	margin: 4px 24px 16px 0 !important;
	max-width: 50%;
	text-align: left;
}

.post-text figure[style*="float: right"],
.post-text figure[style*="float:right"],
.post-text figure.align-right {
	float: right !important;
	margin: 4px 0 16px 24px !important;
	max-width: 50%;
	text-align: left;
}

.post-text figure.align-center {
	display: block;
	margin: 20px auto;
	text-align: center;
}

/* Внутри плавающей figure — img не центрировать, а растягивать на ширину figure */
.post-text figure[style*="float"] img,
.post-text figure.align-left img,
.post-text figure.align-right img {
	display: block;
	margin: 0;
	width: 100%;
}

/* Clearfix для обтекаемых изображений */
.post-text::after {
	content: "";
	display: table;
	clear: both;
}

/* Списки */
.post-text ul,
.post-text ol {
	margin-bottom: 16px;
	padding-left: 24px;
}

.post-text li {
	margin-bottom: 8px;
	line-height: 1.7;
}

/* Цитаты */
.post-text blockquote {
	border-left: 4px solid var(--primary-color, #c9a868);
	margin: 24px 0;
	padding: 16px 24px;
	background: rgba(0, 0, 0, 0.02);
	border-radius: 0 8px 8px 0;
	font-style: italic;
}

.post-text blockquote p:last-child {
	margin-bottom: 0;
}

/* Разделители */
.post-text hr {
	border: none;
	border-top: 2px solid #eee;
	margin: 32px 0;
}

/* Таблицы */
.post-text table {
	width: 100%;
	border-collapse: collapse;
	margin: 20px 0;
}

.post-text th,
.post-text td {
	border: 1px solid #ddd;
	padding: 10px 14px;
	text-align: left;
}

.post-text th {
	background: #f5f5f5;
	font-weight: 600;
}

/* Ссылки внутри контента */
.post-text a {
	color: var(--primary-color, #c9a868);
	text-decoration: underline;
	transition: color 0.2s;
}

.post-text a:hover {
	color: var(--primary-color-dark, #a88b4e);
}

/* Код */
.post-text pre {
	background: #f4f4f4;
	padding: 16px;
	border-radius: 8px;
	overflow-x: auto;
	margin: 20px 0;
}

.post-text code {
	background: #f4f4f4;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 14px;
}

/* Подписи к изображениям (TinyMCE caption) — только для НЕ-плавающих figure */
.post-text figure:not([style*="float"]):not(.align-left):not(.align-right) {
	margin: 20px 0;
	text-align: center;
}

.post-text figure:not([style*="float"]):not(.align-left):not(.align-right) img {
	display: block;
	margin: 0 auto;
}

.post-text figcaption {
	font-size: 14px;
	color: #888;
	margin-top: 8px;
	font-style: italic;
}

/* Адаптив для мобильных — отключаем float, картинки на полную ширину */
@media (max-width: 768px) {
	.post-text img[style*="float: left"],
	.post-text img[style*="float: right"],
	.post-text img[style*="float:left"],
	.post-text img[style*="float:right"],
	.post-text img.align-left,
	.post-text img.align-right {
		float: none !important;
		display: block;
		margin: 16px auto !important;
		max-width: 100%;
	}

	.post-text figure[style*="float: left"],
	.post-text figure[style*="float: right"],
	.post-text figure[style*="float:left"],
	.post-text figure[style*="float:right"],
	.post-text figure.align-left,
	.post-text figure.align-right {
		float: none !important;
		display: block;
		margin: 16px auto !important;
		max-width: 100%;
	}
}