/*
Theme Name: Citywoman
Theme URI: https://www.citywoman.info/
Description: Дочерняя тема Twenty Twenty-Five для журнала Citywoman: палитра, шрифты Cormorant Garamond + Manrope, автоматическая тёмная тема.
Template: twentytwentyfive
Version: 1.1.3
Requires at least: 6.7
Requires PHP: 7.4
Text Domain: citywoman
License: GNU General Public License v2 or later
*/

/* ---------- Заголовки: курсив = розовый акцент ---------- */
:where(h1, h2, h3, .wp-block-post-title) em {
	font-style: italic;
	font-weight: 600;
	color: var(--wp--preset--color--accent-3);
}

/* ---------- Стиль изображения «Наклон» ---------- */
.wp-block-image.is-style-cw-tilt img,
.wp-block-post-featured-image.is-style-cw-tilt img {
	transform: rotate(3deg);
	box-shadow: var(--wp--preset--shadow--photo);
	border-radius: var(--wp--custom--radius--l);
	transition: transform 0.5s ease;
}
.wp-block-image.is-style-cw-tilt:hover img,
.wp-block-post-featured-image.is-style-cw-tilt:hover img {
	transform: rotate(0deg);
}

/* ---------- Стиль абзаца «Плашка» (метка «Гид недели» и т. п.) ---------- */
p.is-style-cw-tag {
	display: inline-block;
	width: fit-content;
	margin-block: 0;
	padding: 6px 14px;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--accent-5);
	color: var(--wp--preset--color--accent-3);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 2px;
	text-transform: uppercase;
}

/* ---------- Стиль группы «Карточка» (пудровая, скруглённая) ---------- */
.wp-block-group.is-style-cw-card {
	background: var(--wp--preset--color--accent-2);
	border-radius: var(--wp--custom--radius--l);
	padding: clamp(24px, 3vw, 40px);
}

/* ---------- Стиль группы «Тёмный блок» (опрос, цитата эксперта) ---------- */
.wp-block-group.is-style-cw-dark {
	background: var(--wp--preset--color--inverse);
	color: var(--wp--preset--color--on-inverse);
	border-radius: var(--wp--custom--radius--xl);
	padding: clamp(28px, 4vw, 56px);
}
.wp-block-group.is-style-cw-dark :where(h1, h2, h3, h4, a) {
	color: var(--wp--preset--color--on-inverse);
}

/* ---------- Стиль кнопки «Хэштег» (пилюли тем) ---------- */
.wp-block-button.is-style-cw-pill .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--wp--preset--color--accent-6);
	padding: 12px 24px;
	font-size: 14px;
	font-weight: 600;
}
.wp-block-button.is-style-cw-pill .wp-block-button__link:hover {
	background: var(--wp--preset--color--accent-2);
	color: var(--wp--preset--color--accent-3);
}

/* ---------- Короткая розовая черта под заголовком секции ---------- */
.wp-block-heading.is-style-cw-underline::after {
	content: "";
	display: block;
	width: 80px;
	height: 4px;
	margin-top: 12px;
	background: var(--wp--preset--color--accent-1);
}

/* Карточки статей в Query Loop: заголовок без подчёркивания */
.wp-block-post-template .wp-block-post-title a:hover {
	color: var(--wp--preset--color--accent-3);
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-image.is-style-cw-tilt img,
	.wp-block-post-featured-image.is-style-cw-tilt img {
		transition: none;
	}
}

/* =====================================================================
   Секции и раскладка паттернов
   ===================================================================== */

.cw-section {
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--60);
	margin-block-start: 0 !important;
}
.cw-section-tint { background: var(--wp--preset--color--accent-2); }
.cw-section-alt { background: var(--wp--preset--color--surface-alt); }
.cw-pills {
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--50);
	border-top: 1px solid var(--wp--preset--color--accent-6);
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
}
.cw-section > * { max-width: var(--wp--style--global--wide-size); }
.cw-center { text-align: center; }
.cw-lead {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 300;
	line-height: 1.6;
	color: var(--wp--preset--color--accent-4);
}
.cw-more a {
	font-weight: 700;
	text-decoration: none;
	color: var(--wp--preset--color--accent-1);
}
.cw-welcome-text {
	border-left: 2px solid var(--wp--preset--color--accent-5);
	padding-left: clamp(20px, 4vw, 48px);
}

/* Шапка */
.cw-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--wp--preset--color--base);
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
	padding-top: 14px;
	padding-bottom: 14px;
}
.admin-bar .cw-header { top: var(--wp-admin--admin-bar--height, 32px); }
.cw-header .wp-block-button__link { padding: 10px 22px; font-size: 14px; }
.cw-header .wp-block-search__button {
	border-radius: 999px;
	background: var(--wp--preset--color--accent-2);
	color: var(--wp--preset--color--contrast);
	border: 0;
}

/* Футер */
.cw-footer {
	background: var(--wp--preset--color--inverse);
	color: #9CA3AF;
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--40);
	font-size: 14px;
}
.cw-footer .wp-block-site-title a { color: #F472B6; }
.cw-footer h4 { color: var(--wp--preset--color--on-inverse); }
.cw-footer a { color: #9CA3AF; text-decoration: none; }
.cw-footer a:hover { color: var(--wp--preset--color--on-inverse); }
.cw-footer-bottom {
	margin-top: var(--wp--preset--spacing--50);
	padding-top: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 12px;
}

/* Списки */
ul.cw-plain, ol.cw-plain { list-style: none; padding-left: 0; display: grid; gap: 12px; }
ul.cw-plain a, .is-style-cw-card a { text-decoration: none; color: inherit; }
ul.cw-plain a:hover { color: var(--wp--preset--color--accent-3); }

ol.cw-numbered { list-style: none; counter-reset: cw; padding-left: 0; display: grid; gap: 14px; }
ol.cw-numbered li {
	counter-increment: cw;
	display: flex;
	align-items: center;
	gap: 18px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
	font-weight: 600;
}
ol.cw-numbered li::before {
	content: counter(cw, decimal-leading-zero);
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	display: grid;
	place-items: center;
	border-radius: 14px;
	background: var(--wp--preset--color--accent-5);
	color: var(--wp--preset--color--accent-3);
	font-family: var(--wp--preset--font-family--cormorant);
	font-size: 22px;
	font-weight: 700;
}
ol.cw-numbered a { text-decoration: none; color: inherit; }

/* Карточки записей в Query Loop */
.wp-block-post-template .wp-block-post-featured-image img { border-radius: var(--wp--custom--radius--m); }
.wp-block-post-template .wp-block-post-title { font-size: var(--wp--preset--font-size--x-large); margin-top: 8px; }
.wp-block-post-template .wp-block-post-title a { text-decoration: none; }

/* Бенто «Самое читаемое»: первая запись — большая плитка 2×2 */
.cw-bento .wp-block-post-template {
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	grid-auto-rows: 250px;
	gap: 24px;
}
.cw-bento .wp-block-post {
	position: relative;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--l);
	background: #3F1D2E;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 24px;
	min-height: 0;
}
.cw-bento .wp-block-post:first-child { grid-column: span 2; grid-row: span 2; padding: 36px; }
.cw-bento .wp-block-post:last-child { grid-column: span 2; }
.cw-bento .wp-block-post-featured-image {
	position: absolute;
	inset: 0;
	margin: 0;
	height: 100%;
}
.cw-bento .wp-block-post-featured-image a,
.cw-bento .wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	transition: transform 0.7s ease;
}
.cw-bento .wp-block-post:hover .wp-block-post-featured-image img { transform: scale(1.06); }
.cw-bento .wp-block-post::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(17, 24, 39, 0.85), rgba(17, 24, 39, 0) 65%);
	pointer-events: none;
}
.cw-bento .wp-block-post > :not(.wp-block-post-featured-image) { position: relative; z-index: 1; }
.cw-bento .wp-block-post-terms a { color: #F9A8D4; }
.cw-bento .wp-block-post-title { margin: 6px 0 0; font-size: 22px; }
.cw-bento .wp-block-post:first-child .wp-block-post-title { font-size: clamp(28px, 3vw, 40px); }
.cw-bento .wp-block-post-title a { color: #FFFFFF; }

/* Эксперт и цитаты */
.wp-block-image.is-style-cw-avatar img {
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 50%;
	border: 8px solid var(--wp--preset--color--base);
	box-shadow: var(--wp--preset--shadow--card);
}
.cw-quote-text {
	font-family: var(--wp--preset--font-family--cormorant);
	font-style: italic;
	font-weight: 600;
	font-size: clamp(24px, 2.6vw, 34px);
	line-height: 1.35;
	color: var(--wp--preset--color--contrast);
}
.is-style-cw-dark .cw-quote-text { color: var(--wp--preset--color--on-inverse); }
.cw-quote-cite { font-size: 14px; color: var(--wp--preset--color--accent-3); }
.is-style-cw-dark .is-style-cw-tag { background: rgba(249, 168, 212, 0.16); color: #F9A8D4; }

/* Партнёрский блок */
.cw-affiliate {
	border: 1px solid var(--wp--preset--color--accent-5);
	border-radius: var(--wp--custom--radius--l);
	padding: 20px 24px;
}
.cw-affiliate .cw-thumb img { border-radius: var(--wp--custom--radius--s); aspect-ratio: 1; object-fit: cover; }
.cw-ad-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-3);
	margin-bottom: 4px;
}

/* Статья: подпись автора */
.cw-byline { gap: 12px; font-size: 14px; }
.cw-byline .wp-block-avatar img, .is-style-cw-card .wp-block-avatar img { border-radius: 50%; }
.cw-handle { font-size: 14px; font-weight: 600; color: var(--wp--preset--color--accent-3); margin-top: 0; }

/* =====================================================================
   Мобильная версия
   ===================================================================== */
@media (max-width: 781px) {
	.cw-welcome-text { border-left: 0; padding-left: 0; }
	.cw-bento .wp-block-post-template {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		grid-auto-rows: 170px;
		gap: 12px;
	}
	.cw-bento .wp-block-post { padding: 16px; }
	.cw-bento .wp-block-post:first-child { grid-column: span 2; grid-row: span 2; padding: 24px; }
	.cw-bento .wp-block-post:last-child { grid-column: span 1; }
	.cw-bento .wp-block-post-title { font-size: 16px; }
	.cw-header .wp-block-site-title { font-size: 20px !important; letter-spacing: 1px !important; }
	.cw-header .wp-block-button__link { padding: 8px 14px; font-size: 12px; }
	.wp-block-image.is-style-cw-tilt img { transform: rotate(2deg); }
}

@media (max-width: 781px) {
	.cw-section .wp-block-group.is-layout-grid { grid-template-columns: 1fr !important; }
	.cw-footer .wp-block-group.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}


/* ---------- Ширина секций: контент на всю «широкую» ширину (1280px) ---------- */
.cw-section.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)),
.cw-header.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)),
.cw-footer.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
	max-width: var(--wp--style--global--wide-size);
}
.cw-header-inner { flex-wrap: nowrap; gap: 24px; }
.cw-header-inner > .wp-block-navigation { flex: 1 1 auto; justify-content: center; }


/* ---------- Ссылки в заголовках и видимые рамки пилюль ---------- */
:where(h1, h2, h3).wp-block-heading a { color: inherit; text-decoration: none; }
:where(h1, h2, h3).wp-block-heading a:hover { color: var(--wp--preset--color--accent-3); }
.wp-block-button.is-style-cw-pill .wp-block-button__link { border-color: var(--wp--preset--color--accent-5); background: var(--wp--preset--color--base); }


/* ---------- Отрывок в шапке статьи: максимум 3 строки ---------- */
.cw-section-tint .wp-block-post-excerpt__excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}


/* ---------- Мобильная шапка в одну строку ---------- */
@media (max-width: 781px) {
	.cw-header { padding-top: 10px; padding-bottom: 10px; }
	.cw-header-inner { gap: 8px; }
	.cw-header .is-layout-flex { flex-wrap: nowrap; gap: 6px; }
	.cw-header-inner > .wp-block-navigation { flex: 0 0 auto; order: -1; }
	.cw-header-inner > .wp-block-site-title { flex: 1 1 auto; }
	.cw-header .wp-block-search__button { width: 38px; height: 38px; padding: 0; }
}
