/*
 * «Акварельный альбом» — оформление поверх Twenty Seventeen.
 * Селекторы сверены с разметкой темы 2.2. Порядок: переменные, основа,
 * шапка, меню, записи, фото и галереи, боковая колонка, кнопки, подвал,
 * телефон, сниженная анимация.
 */

:root {
	--paper: #fbf6ee;
	--surface: #ffffff;
	--ink: #3b3a48;
	--ink-muted: #6a6774;
	--peach: #f2b8a2;
	--peach-soft: #fdeee6;
	--sky: #a9cbe0;
	--sky-soft: #eaf3f8;
	--mint: #b9d8b0;
	--help: #b8432f;
	--help-hover: #9a3727;
	--link: #2c5f8f;
	--focus: #2c5f8f;

	--font-head: Lora, Georgia, serif;
	--font-body: Nunito, "Segoe UI", Arial, sans-serif;
	--font-hand: Caveat, "Segoe Print", cursive;

	--radius-card: 14px;
	--radius-pill: 999px;
	--shadow-card: 0 1px 2px rgba(59, 58, 72, 0.06), 0 10px 28px rgba(59, 58, 72, 0.08);
	--shadow-card-hover: 0 2px 4px rgba(59, 58, 72, 0.08), 0 16px 36px rgba(59, 58, 72, 0.12);
	--shadow-photo: 0 2px 4px rgba(59, 58, 72, 0.12), 0 8px 20px rgba(59, 58, 72, 0.14);
	--ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--t: 0.25s;
	--tap: 44px;
}

/* ---------- Основа: бумага, текст, ссылки, фокус ---------- */

body,
.site-content-contain,
.navigation-top,
.site-footer {
	background-color: var(--paper);
}

.site-content-contain {
	background-image: url("assets/paper.svg");
	background-size: 240px 240px;
	overflow-x: clip;
}

body,
button,
input,
select,
textarea {
	color: var(--ink);
	font-family: var(--font-body);
}

/* Родитель задаёт для кириллических языков свои шрифты через html[lang="ru-RU"] —
   перебиваем той же специфичностью. */
html[lang] body,
html[lang] button,
html[lang] input,
html[lang] select,
html[lang] textarea {
	font-family: var(--font-body);
}

html[lang] h1, html[lang] h2, html[lang] h3,
html[lang] h4, html[lang] h5, html[lang] h6 {
	font-family: var(--font-head);
}

h1, h2, h3, h4, h5, h6,
.entry-title,
.page-title {
	color: var(--ink);
	font-family: var(--font-head);
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
}

.entry-content a,
.entry-summary a,
.comment-content a,
.widget a,
.site-info a,
.taxonomy-description a,
#bbpress-forums a {
	box-shadow: none;
	color: var(--link);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

.entry-content a:hover,
.entry-summary a:hover,
.comment-content a:hover,
.widget a:hover,
.site-info a:hover,
#bbpress-forums a:hover {
	box-shadow: none;
	color: var(--link);
	text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

.custom-header a:focus-visible {
	outline-color: #fff;
}

/* ---------- Шапка: закреплённое фото, 70% экрана, тёплое затемнение ---------- */

.has-header-image.home.blog .custom-header,
.has-header-image.twentyseventeen-front-page .custom-header {
	height: 70vh;
}

/* Закреплённое фото родитель растягивает на весь экран и центрирует, а шапка
   занимает 70% — низ снимка (дети, коляска) уходил под меню. Делаем фото
   высотой с шапку и прижимаем к низу: обрезается небо сверху. */
.home.blog.has-header-image .custom-header-media img,
.twentyseventeen-front-page.has-header-image .custom-header-media img {
	height: 70vh;
	min-height: 0; /* родитель держит min-height: 100% — иначе высота не уменьшится */
	object-position: 50% 100%;
}

.custom-header-media:before {
	background: linear-gradient(to bottom, rgba(59, 58, 72, 0) 35%, rgba(59, 58, 72, 0.65) 100%);
}

body.has-header-image .site-title,
body.has-header-image .site-title a {
	color: #fff;
}

.site-title {
	font-family: var(--font-head);
	font-weight: 700;
	letter-spacing: 0.02em;
	text-shadow: 0 2px 12px rgba(59, 58, 72, 0.45);
}

.site-description,
body.has-header-image .site-description {
	color: #fff;
	font-family: var(--font-hand);
	font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.15;
	opacity: 1;
	text-shadow: 0 2px 10px rgba(59, 58, 72, 0.5);
	text-transform: none;
}

/* Логотип — фотокарточка */
.custom-logo-link {
	background: var(--surface);
	border-radius: 3px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
	margin-right: 1.25em;
	padding: 6px 6px 18px;
	transform: rotate(-2deg);
	transition: transform var(--t) var(--ease);
}

.custom-logo-link:hover {
	transform: rotate(0deg);
}

.custom-logo-link img {
	border-radius: 2px;
	display: block;
}

/* ---------- Верхнее меню ---------- */

.navigation-top {
	border-bottom: 1px solid rgba(59, 58, 72, 0.1);
	border-top: 1px solid rgba(59, 58, 72, 0.1);
	font-family: var(--font-body);
}

.navigation-top a,
.navigation-top .current-menu-item > a,
.navigation-top .current_page_item > a {
	color: var(--ink);
	font-weight: 700;
}

.navigation-top a:hover,
.main-navigation li li:hover > a,
.main-navigation li li.focus > a {
	color: var(--link);
}

.main-navigation ul ul {
	background: var(--surface);
	border: 1px solid rgba(59, 58, 72, 0.12);
	border-radius: 10px;
	box-shadow: var(--shadow-card);
}

.main-navigation li,
.main-navigation > div > ul {
	border-color: rgba(59, 58, 72, 0.1);
}

.main-navigation .dd-menu-donate > a,
.navigation-top .dd-menu-donate > a,
.navigation-top .dd-menu-donate.current-menu-item > a {
	align-items: center;
	background: var(--help);
	border-radius: var(--radius-pill);
	color: #fff;
	display: inline-flex;
	min-height: var(--tap);
	padding: 0 1.3em;
	transition: background-color var(--t) var(--ease);
}

.navigation-top .dd-menu-donate > a:hover,
.navigation-top .dd-menu-donate > a:focus {
	background: var(--help-hover);
	color: #fff;
}

.menu-toggle {
	border: 2px solid var(--ink);
	border-radius: var(--radius-pill);
	color: var(--ink);
	min-height: var(--tap);
	padding: 0.5em 1.2em;
}

/* ---------- Записи — страницы альбома ---------- */

.site-main > article,
.site-main > .page-header {
	background: var(--surface);
	border-radius: var(--radius-card);
	box-shadow: var(--shadow-card);
	display: flow-root;
	margin-bottom: 2.5rem;
	padding: clamp(1.25rem, 0.9rem + 2vw, 2.5rem);
}

.blog .site-main > article,
.archive .site-main > article,
.search .site-main > article {
	transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.blog .site-main > article:hover,
.archive .site-main > article:hover,
.search .site-main > article:hover {
	box-shadow: var(--shadow-card-hover);
	transform: translateY(-2px);
}

.entry-meta,
.entry-meta a,
.entry-footer .cat-links,
.entry-footer .tags-links {
	color: var(--ink-muted);
	font-family: var(--font-hand);
	font-size: 1.375rem;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
}

.entry-meta a {
	box-shadow: none;
	text-decoration: none;
}

.entry-title,
.entry-title a,
.page .entry-header .entry-title,
.page-header .page-title {
	color: var(--ink);
	font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
	font-weight: 700;
	line-height: 1.25;
}

.entry-title a:hover {
	color: var(--link);
}

.entry-content {
	color: var(--ink);
}

.entry-content blockquote {
	border-left: 4px solid var(--peach);
	color: var(--ink);
	padding-left: 1em;
}

/* Миниатюра записи на акварельном пятне */
.post-thumbnail {
	position: relative;
}

.post-thumbnail::before {
	background: url("assets/wash-sky.svg") center / 100% 100% no-repeat;
	content: "";
	inset: -18px -24px;
	pointer-events: none;
	position: absolute;
	z-index: 0;
}

.post-thumbnail a,
.post-thumbnail img {
	position: relative;
	z-index: 1;
}

/* ---------- Фото в тексте — фотокарточки ---------- */

.entry-content > .wp-block-image img,
.entry-content > p img[class*="wp-image-"] {
	--tilt: -1.5deg;
	background: var(--surface);
	box-shadow: var(--shadow-photo);
	padding: 8px;
	transform: rotate(var(--tilt));
	transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.entry-content > .wp-block-image:nth-of-type(3n + 2) img,
.entry-content > p:nth-of-type(3n + 2) img[class*="wp-image-"] {
	--tilt: 1deg;
}

.entry-content > .wp-block-image:nth-of-type(3n + 3) img,
.entry-content > p:nth-of-type(3n + 3) img[class*="wp-image-"] {
	--tilt: -0.5deg;
}

.entry-content > .wp-block-image img:hover,
.entry-content > p img[class*="wp-image-"]:hover {
	box-shadow: var(--shadow-card-hover);
	transform: rotate(0deg);
}

.entry-content > .wp-block-image figcaption,
.wp-caption .wp-caption-text {
	color: var(--ink-muted);
	font-family: var(--font-hand);
	font-size: 1.25rem;
	font-style: normal;
	margin-top: 0.6em;
	text-align: center;
}

/* ---------- Галереи: ровная сетка 4:3, подписи под фото ---------- */

.entry-content .wp-block-gallery,
.entry-content .wp-block-gallery.has-nested-images {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	list-style: none;
	margin: 1.5em 0;
	padding: 0;
}

.entry-content .wp-block-gallery.columns-3,
.entry-content .wp-block-gallery.columns-4,
.entry-content .wp-block-gallery.columns-5,
.entry-content .wp-block-gallery.columns-6 {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr));
}

/* Ширину и отступы ячеек блочные стили WordPress задают через calc() по числу
   колонок, у новых галерей — селектором с :not(#id). В сетке они не нужны,
   перебить такую специфичность можно только !important. */
.entry-content .wp-block-gallery .blocks-gallery-item,
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image {
	background: var(--surface);
	border-radius: 4px;
	box-shadow: var(--shadow-photo);
	margin: 0 !important;
	padding: 6px;
	width: auto !important;
}

.entry-content .wp-block-gallery .blocks-gallery-item figure,
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image {
	display: block;
	height: auto;
	margin: 0;
}

.entry-content .wp-block-gallery .blocks-gallery-item img,
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image img {
	aspect-ratio: 4 / 3;
	display: block;
	height: auto;
	object-fit: cover;
	width: 100%;
}

.entry-content .wp-block-gallery .blocks-gallery-item figcaption,
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	background: none;
	bottom: auto;
	color: var(--ink);
	font-family: var(--font-hand);
	font-size: 1.15rem;
	line-height: 1.2;
	max-height: none;
	overflow: visible;
	padding: 0.35em 0.2em 0.1em;
	position: static;
	text-align: center;
	text-shadow: none;
}

/* ---------- Боковая колонка: карточки на бумаге ---------- */

.widget-area .widget {
	background: var(--surface);
	border-radius: var(--radius-card);
	box-shadow: var(--shadow-card);
	margin-bottom: 1.75rem;
	padding: 1.25rem 1.5rem 1.5rem;
}

html[lang] h2.widget-title,
.widget-title {
	background: url("assets/wash-stroke-peach.svg") center bottom / 100% 70% no-repeat;
	color: var(--ink);
	display: inline-block;
	font-family: var(--font-hand);
	font-size: 26px;
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.2;
	margin-bottom: 0.6em;
	padding: 0.15em 0.7em 0.25em;
	text-transform: none;
}

/* Полноценные пятна — только у двух первых заголовков: не больше двух на экран */
.widget-area .widget:nth-child(1 of :has(> .widget-title)) > .widget-title {
	background: url("assets/wash-peach.svg") center / 100% 100% no-repeat;
	padding: 0.35em 0.9em;
}

.widget-area .widget:nth-child(2 of :has(> .widget-title)) > .widget-title {
	background: url("assets/wash-mint.svg") center / 100% 100% no-repeat;
	padding: 0.35em 0.9em;
}

.widget ul li,
.widget ol li {
	border-color: rgba(59, 58, 72, 0.1);
}

.widget .post-date,
.widget_rss .rss-date {
	color: var(--ink-muted);
}

/* ---------- Кнопки ---------- */

button,
input[type="button"],
input[type="submit"],
.button,
.wp-block-button__link,
#bbpress-forums .button {
	align-items: center;
	background: transparent;
	border: 2px solid var(--ink);
	border-radius: var(--radius-pill);
	box-shadow: none;
	color: var(--ink);
	font-family: var(--font-body);
	font-weight: 700;
	justify-content: center;
	min-height: var(--tap);
	padding: 0.55em 1.4em;
	transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
.button:hover,
.wp-block-button__link:hover,
#bbpress-forums .button:hover {
	background: var(--ink);
	color: var(--paper);
}

.dd-btn-help,
.is-style-help .wp-block-button__link,
a.wp-block-button__link[href*="page_id=87"] {
	background: var(--help);
	border-color: var(--help);
	color: #fff;
}

.dd-btn-help:hover,
.is-style-help .wp-block-button__link:hover,
a.wp-block-button__link[href*="page_id=87"]:hover {
	background: var(--help-hover);
	border-color: var(--help-hover);
	color: #fff;
}

/* Служебная кнопка темы (раскрыть подменю на телефоне) — без рамки-таблетки */
.main-navigation .dropdown-toggle,
.main-navigation .dropdown-toggle:hover {
	background: transparent;
	border: 0;
	border-radius: 0;
	color: var(--ink);
	min-height: 0;
	padding: 0.5em 1em;
}

/* Поиск: поле-таблетка, кнопка с иконкой внутри него */
.search-form .search-field {
	border: 2px solid rgba(59, 58, 72, 0.25);
	border-radius: var(--radius-pill);
	min-height: var(--tap);
	padding: 0.5em 3.5em 0.5em 1.1em;
}

.search-form .search-submit {
	background: transparent;
	border: 0;
	color: var(--ink);
	min-height: 0;
	padding: 0.5em 1em;
}

.search-form .search-submit:hover {
	background: var(--sky-soft);
	color: var(--ink);
}

.pagination .page-numbers,
.comment-navigation a,
.post-navigation a {
	border-radius: var(--radius-pill);
}

.pagination .page-numbers {
	line-height: var(--tap);
	min-height: var(--tap);
	min-width: var(--tap);
	padding: 0 0.8em;
	text-align: center;
}

.pagination .page-numbers.current {
	background: var(--sky-soft);
	color: var(--ink);
}

/* ---------- Подвал: пятно в углу ---------- */

.site-footer {
	border-top: 1px solid rgba(59, 58, 72, 0.1);
	position: relative;
}

.site-footer::before {
	background: url("assets/wash-sky.svg") center / contain no-repeat;
	bottom: -40px;
	content: "";
	height: 240px;
	pointer-events: none;
	position: absolute;
	right: -50px;
	width: 360px;
	z-index: 0;
}

.site-footer .wrap {
	position: relative;
	z-index: 1;
}

.site-info,
.site-info a {
	color: var(--ink-muted);
}

.social-navigation a {
	background-color: var(--ink);
	height: var(--tap);
	width: var(--tap);
}

.social-navigation a:hover,
.social-navigation a:focus {
	background-color: var(--link);
}

.social-navigation .icon {
	top: 10px;
}

/* ---------- Компьютер: шапка 70% экрана (родитель ставит 100vh) ---------- */

@media screen and (min-width: 48em) {
	.home.blog.has-header-image .custom-header-media,
	.twentyseventeen-front-page.has-header-image .custom-header-media {
		height: 70vh;
	}

	.admin-bar.home.blog.has-header-image .custom-header-media,
	.admin-bar.twentyseventeen-front-page.has-header-image .custom-header-media {
		height: calc(70vh - 32px);
	}

	.navigation-top .dd-menu-donate {
		margin-left: 0.5em;
	}

	/* Меню лежит поверх низа шапки — поднимаем нижний край фото до меню */
	.home.blog.has-header-image .custom-header-media img,
	.twentyseventeen-front-page.has-header-image .custom-header-media img {
		height: calc(70vh - 72px);
	}
}

/* ---------- Телефон: без поворотов, без горизонтальной прокрутки ---------- */

@media screen and (max-width: 47.99em) {
	.custom-logo-link,
	.entry-content > .wp-block-image img,
	.entry-content > p img[class*="wp-image-"] {
		transform: none;
	}

	.main-navigation .dd-menu-donate > a {
		margin: 0.6em 0;
	}

	/* Узкий кадр: ребёнок в коляске — в левой трети снимка */
	.home.blog.has-header-image .custom-header-media img,
	.twentyseventeen-front-page.has-header-image .custom-header-media img {
		object-position: 30% 100%;
	}

	.site-footer::before {
		height: 170px;
		right: -70px;
		width: 260px;
	}

	.post-thumbnail::before {
		inset: -10px -8px;
	}
}

/* ---------- Сниженная анимация ---------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}

	.blog .site-main > article:hover,
	.archive .site-main > article:hover,
	.search .site-main > article:hover {
		transform: none;
	}
}
