/* utility — Контакты, Политика конфиденциальности, результаты поиска, 404.
   Loaded after style.css; every selector is scoped to one of these pages. */

/* =====================================================================
   Контакты  (templates/page-contacts.html -> .contacts-page)
   One left edge: the 75rem grid. Title + lead are a centred unit above it.
   ===================================================================== */

.contacts-intro { padding-bottom: 0; }

.contacts-page {
	padding-top: 0;
	padding-bottom: 0;
	overflow-x: clip; /* the full-bleed form band is 100vw wide */
}

.contacts-page > .wp-block-post-content > * { margin-block: 0; }

.contacts-page > .wp-block-post-content > .lead-paragraph {
	max-width: 46rem;
	margin: 16px auto 0;
	text-align: center;
	text-wrap: balance;
	font-size: 1.3125rem;
	line-height: 1.65;
}

.contacts-page > .wp-block-post-content > .card-grid--info { margin-top: 40px; }
.contacts-page > .wp-block-post-content > .quick-links { margin-top: 24px; }
.contacts-page > .wp-block-post-content > .wide-heading { margin-top: var(--rl-section); }
.contacts-page > .wp-block-post-content > .map-row { margin-top: 24px; }
.contacts-page > .wp-block-post-content > .card-grid--duo { margin-top: 24px; }

/* cards: 24px gaps, readable text */
.contacts-page .card-grid { gap: 24px; }

.contacts-page .card-grid .card { padding: 28px; }

.contacts-page .card h3 {
	margin: 0 0 12px;
	font-size: 1.3125rem;
	line-height: 1.3;
}

.contacts-page .card p {
	margin: 0 0 12px;
	font-size: 1.0625rem;
	line-height: 1.65;
}

.contacts-page .card > :last-child { margin-bottom: 0; }
.contacts-page .card-grid--info .card p { text-wrap: balance; }

/* messengers: four equal tiles on the grid */
.contacts-page .quick-links {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
}

.contacts-page .quick-links > * { margin: 0; }

.contacts-page .quick-links .pill {
	box-sizing: border-box;
	justify-content: center;
	min-height: 52px;
	padding: 10px 20px;
	font-size: 1.0625rem;
	text-align: center;
}

/* map + route: one row, both boxes share top and bottom edges */
.contacts-page .map-row > * { margin: 0; }

.contacts-page .map-row {
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
	align-items: stretch;
	gap: 24px;
	margin-bottom: 0;
}

.contacts-page .map-frame {
	position: relative;
	min-height: 440px;
	border-radius: var(--rl-radius);
}

.contacts-page .map-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	min-height: 0;
}

.contacts-page .route {
	box-sizing: border-box;
	padding: 28px 32px;
	background: #fff;
	border: var(--rl-line);
	border-radius: var(--rl-radius);
}

.contacts-page .route h3 {
	margin: 0 0 12px;
	font-size: 1.3125rem;
	line-height: 1.3;
	color: var(--wp--preset--color--coral);
}

.contacts-page .route h3:not(:first-child) { margin-top: 28px; }

.contacts-page .route li {
	font-size: 1.0625rem;
	line-height: 1.65;
}

.contacts-page .route .checklist { margin: 0; }
.contacts-page .route li + li { margin-top: 10px; }

/* duo cards: title / text / contact lines share three rows (subgrid), so the
   dividers line up and both cards end on the same edge */
.contacts-page .card-grid--duo { row-gap: 0; column-gap: 24px; grid-template-rows: auto 1fr auto; }

.contacts-page .card-grid--duo .card > * {
	max-width: none;
	margin-inline: 0 !important;
}

.contacts-page .contact-lines {
	margin: 20px 0 0 !important;
	padding-top: 16px;
	border-top: var(--rl-line);
}

.contacts-page .card-body > :last-child,
.contacts-page .contact-lines > :last-child { margin-bottom: 0; }

.contacts-page .card-body { margin: 0; }
.contacts-page .contact-lines p { margin: 0; }

/* links in cards keep a 44px-high hit area */
.contacts-page .card p a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	text-underline-offset: 3px;
}

@supports (grid-template-rows: subgrid) {
	.contacts-page .card-grid--duo .card {
		display: grid;
		grid-row: span 3;
		grid-template-rows: subgrid;
		row-gap: 0;
	}
}

@supports not (grid-template-rows: subgrid) {
	.contacts-page .card-grid--duo .card { display: flex; flex-direction: column; }
	.contacts-page .contact-lines { margin-top: auto !important; }
}

/* the form: same band as «Записаться» on program pages (full-bleed, white) */
.contacts-page .contact-band {
	max-width: none;
	margin: var(--rl-section) calc(50% - 50vw) 0 !important;
	padding: clamp(48px, 6vw, 80px) 0;
	background: #fff;
	border-block: var(--rl-line);
}

.contacts-page .contact-signup {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
	gap: clamp(28px, 5vw, 72px);
	align-items: start;
	width: min(var(--rl-wide), 100% - 2 * var(--rl-gutter));
	max-width: none;
	margin-inline: auto !important;
}

.contacts-page .contact-signup > .wp-block-heading {
	grid-column: 1;
	margin: 0;
	font-size: clamp(1.6rem, 3vw, 2.2rem);
	line-height: 1.2;
}

.contacts-page .contact-signup > .wpcf7 { grid-column: 2; grid-row: 1; }

.contact-signup .wpcf7-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 20px;
	max-width: none;
	margin: 0;
}

.contact-signup .wpcf7-form > fieldset.hidden-fields-container { display: none; }
.contact-signup .wpcf7-form > p:nth-of-type(n+3),
.contact-signup .wpcf7-form > .wpcf7-response-output { grid-column: 1 / -1; }

.contact-signup .wpcf7-form p { margin: 0 0 20px; }
.contact-signup .wpcf7-form p > br:first-child { display: none; }

.contact-signup .wpcf7-form label {
	margin: 0;
	font-size: 1.0625rem;
	line-height: 1.4;
}

.contact-signup .wpcf7-form-control.wpcf7-text,
.contact-signup .wpcf7-form-control.wpcf7-textarea {
	box-sizing: border-box;
	padding: 13px 16px;
	min-height: 48px;
	background: var(--wp--preset--color--base);
	border: 1px solid rgba(43, 43, 43, 0.18);
	border-radius: 14px;
	font-size: 1.0625rem;
	line-height: 1.4;
}

.contact-signup .wpcf7-form-control.wpcf7-textarea { min-height: 132px; height: 132px; }

.contact-signup .wpcf7-form-control.wpcf7-text:focus,
.contact-signup .wpcf7-form-control.wpcf7-textarea:focus {
	border-color: var(--wp--preset--color--coral);
	box-shadow: 0 0 0 3px rgba(155, 3, 35, 0.12);
}

.contact-signup .wpcf7-form-control.wpcf7-submit {
	min-height: 48px;
	padding: 12px 36px;
}

.contact-signup .wpcf7-not-valid-tip { font-size: 0.9375rem; }

.contact-signup .wpcf7-response-output {
	margin: 0;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--gold, #AC7F58);
	font-size: 1.0625rem;
	line-height: 1.5;
}

.contact-signup .wpcf7-form.invalid .wpcf7-response-output,
.contact-signup .wpcf7-form.failed .wpcf7-response-output,
.contact-signup .wpcf7-form.unaccepted .wpcf7-response-output {
	background: #fff5f6;
	border-color: var(--wp--preset--color--coral);
}

@media (min-width: 901px) {
	.contacts-page .card-grid--duo { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

@media (max-width: 900px) {
	.contacts-page .map-row { grid-template-columns: minmax(0, 1fr); }
	.contacts-page .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
	.contacts-page .map-frame { min-height: 360px; }
	.contacts-page .contact-signup { grid-template-columns: minmax(0, 1fr); gap: 24px; }
	.contacts-page .contact-signup > .wp-block-heading,
	.contacts-page .contact-signup > .wpcf7 { grid-column: 1; }
	.contacts-page .contact-signup > .wpcf7 { grid-row: 2; }
}

@media (max-width: 782px) {
	.contacts-page .card-grid--duo { row-gap: 24px; grid-template-rows: none; }
	.contacts-page .card-grid--duo .card { display: block; grid-row: auto; }
}

@media (max-width: 600px) {
	.contacts-page > .wp-block-post-content > .lead-paragraph { font-size: 1.1875rem; }
	.contacts-page .quick-links { grid-template-columns: minmax(0, 1fr); }
	.contacts-page .card-grid .card,
	.contacts-page .route { padding: 22px 20px; }
	.contacts-page .map-frame { min-height: 320px; }
	.contact-signup .wpcf7-form { grid-template-columns: minmax(0, 1fr); }
	.contact-signup .wpcf7-form > p:nth-of-type(n+3) { grid-column: auto; }
	.contact-signup .wpcf7-form-control.wpcf7-submit { width: 100%; }
}

/* =====================================================================
   Политика конфиденциальности, cookie, оферта  (templates/page-privacy-policy.html, page-cookie-policy.html, page-oferta.html)
   ===================================================================== */

.privacy-page { padding-top: 24px; }

.privacy-page > .wp-block-post-content p {
	margin: 0 0 16px;
	font-size: 1.125rem;
	line-height: 1.7;
}

.privacy-page > .wp-block-post-content > p:first-child {
	margin-bottom: 8px;
	font-size: 1.25rem;
	line-height: 1.7;
}

.privacy-page > .wp-block-post-content > h2 {
	margin: 56px 0 20px;
	padding-top: 32px;
	border-top: var(--rl-line);
	font-size: clamp(1.4rem, 2.4vw, 1.75rem);
	line-height: 1.25;
}

/* paragraphs that are only a bold lead-in act as sub-headings */
.privacy-page > .wp-block-post-content > p:has(> strong:only-child) {
	margin-top: 28px;
	font-size: 1.1875rem;
}

.privacy-page > .wp-block-post-content > p:has(> strong:only-child) + p { margin-top: 0; }

.privacy-page > .wp-block-post-content a {
	color: var(--wp--preset--color--coral);
	text-underline-offset: 3px;
}

/* h3 and bullet lists in the long legal texts (privacy policy, cookie policy, offer) */
.privacy-page > .wp-block-post-content > h3 {
	margin: 32px 0 12px;
	font-size: 1.25rem;
	line-height: 1.3;
}

.privacy-page > .wp-block-post-content > ul {
	margin: 0 0 20px;
	padding-left: 1.4em;
	font-size: 1.125rem;
	line-height: 1.7;
}

.privacy-page > .wp-block-post-content > ul li { margin-bottom: 6px; }

@media (max-width: 600px) {
	.privacy-page > .wp-block-post-content > h2 { margin-top: 40px; padding-top: 24px; }
}

/* =====================================================================
   Результаты поиска  (templates/search.html -> .search-results)
   ===================================================================== */

.search-results { padding-top: 24px; }

.search-results__form { margin: 0 0 40px; }

.search-results__form .wp-block-search__inside-wrapper {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 6px 6px 24px;
	border: 1px solid rgba(43, 43, 43, 0.18);
	border-radius: 999px;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-results__form .wp-block-search__inside-wrapper:focus-within {
	border-color: var(--wp--preset--color--coral);
	box-shadow: 0 0 0 3px rgba(155, 3, 35, 0.12);
}

.search-results__form .wp-block-search__input {
	flex: 1;
	min-width: 0;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: none;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1.125rem;
	color: var(--wp--preset--color--contrast);
	outline: none;
}

.search-results__form .wp-block-search__input::placeholder { color: rgba(43, 43, 43, 0.55); }

.search-results__form .wp-block-search__button {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 48px;
	height: 48px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--coral);
	color: var(--wp--preset--color--base);
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.search-results__form .wp-block-search__button:hover { background: #7c021c; }
.search-results__form .wp-block-search__button svg { width: 22px; height: 22px; fill: currentColor; }


.search-results .search-results__list {
	display: grid;
	gap: 16px;
	max-width: none;
	margin: 0;
	padding: 0;
	list-style: none;
}

.search-results .search-results__list > li { margin: 0; }

.search-results .search-result {
	position: relative; /* the title link stretches over the whole row */
	padding: 24px 28px;
	background: #fff;
	border: var(--rl-line);
	border-radius: var(--rl-radius);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-results .search-result:hover,
.search-results .search-result:focus-within {
	border-color: rgba(155, 3, 35, 0.4);
	box-shadow: 0 6px 20px rgba(43, 43, 43, 0.06);
}

.search-results .search-result > * { max-width: none; }

.search-results .search-result .wp-block-post-title {
	margin: 0 0 8px;
	font-size: 1.4rem;
	line-height: 1.3;
}

.search-results .search-result .wp-block-post-title a {
	display: inline-block;
	padding-block: 9px;
	margin-block: -9px;
}

.search-results .search-result .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: var(--rl-radius);
}

.search-results .search-result .wp-block-post-title a:focus-visible { outline: none; }
.search-results .search-result:has(a:focus-visible) { outline: 2px solid var(--wp--preset--color--coral); outline-offset: 2px; }

.search-results .search-result .wp-block-post-excerpt { margin: 0; opacity: 1; }

.search-results .search-result .wp-block-post-excerpt__excerpt {
	margin: 0;
	font-size: 1.0625rem;
	line-height: 1.65;
	color: var(--rl-muted);
}

.search-results .search-results__empty {
	max-width: none;
	margin: 0;
	padding: 24px 28px;
	background: #fff;
	border: var(--rl-line);
	border-radius: var(--rl-radius);
	font-size: 1.125rem;
	line-height: 1.65;
}

.search-results .search-results__empty a { text-underline-offset: 3px; }

@media (max-width: 600px) {
	.search-results .search-result,
	.search-results .search-results__empty { padding: 20px; }
	.search-results__form { margin-bottom: 28px; }
}

/* =====================================================================
   404  (templates/404.html -> .error-404)
   ===================================================================== */

.error-404 { padding-top: clamp(72px, 12vw, 140px); padding-bottom: clamp(88px, 12vw, 140px); }

.error-404 .error-404__code {
	font-size: clamp(4.5rem, 14vw, 8rem);
	color: var(--wp--preset--color--coral);
}

.error-404 .error-404__title { margin: 12px 0 16px; }

.error-404 .error-404__lead {
	margin-bottom: 32px;
	font-size: 1.1875rem;
	line-height: 1.6;
	opacity: 1;
	color: var(--rl-muted);
}

.error-404 .error-404__link {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	padding: 10px 24px;
	font-size: 1.0625rem;
}

.error-404 .error-404__search-form {
	max-width: 520px;
	margin-top: 40px;
	padding: 6px 6px 6px 24px;
}

.error-404 .error-404__search-input { min-width: 0; min-height: 44px; font-size: 1.125rem; }
.error-404 .error-404__search-submit { width: 48px; height: 48px; }
.error-404 .error-404__search-submit svg { width: 22px; height: 22px; }
