/* ============================================================
   Go2trip — МАСТЕР-файл патчей (накопительный, полный).
   Правила: вносим правки ТОЛЬКО сюда; релиз = копия под новым
   именем patches-0.9.N.css + обновление enqueue + удаление старой
   версии с сервера. Никогда не выпускать файл только с новыми
   правилами — он затирает предыдущие в кэше браузера.
   Содержит: блоки 1–10 приёмок 0.9.1–0.9.4 + 0.9.5 (тумблеры
   подменю, кнопка «наверх», свежие посты подвала).
   ============================================================ */

/* ——— 1. Мобильное меню: подменю читаемо, не сливается с фоном ——— */
@media (max-width: 860px) {
	.nav-primary__list .sub-menu {
		display: none;
		background: #16405e;
		border-radius: 0 0 10px 10px;
		padding: 6px 0;
	}
	.nav-primary__list li.is-open > .sub-menu { display: block; }
	/* на тач-экранах после тапа остаётся «липкий» :hover — десктопное
	   правило li:hover > .sub-menu держит список открытым и мешает
	   сворачиванию; гасим его на мобильной ширине */
	.nav-primary__list li:hover > .sub-menu { display: none; }
	.nav-primary__list li.is-open:hover > .sub-menu { display: block; }
	.nav-primary__list .sub-menu a {
		color: #b9d6ee;
		padding: 10px 18px 10px 34px;
		font-size: 14px;
	}
	.nav-primary__list .sub-menu a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
	.nav-primary__list > li.is-open > a { background: rgba(255, 255, 255, .08); }
}

/* ——— 2. Выравнивание изображений в контенте (флаг страны и др.) ——— */
.alignleft  { float: left;  margin: 4px 22px 12px 0; }
.alignright { float: right; margin: 4px 0 12px 22px; }
.aligncenter { display: block; margin: 14px auto; }
.g2t-country__body::after,
.g2t-article__body::after,
.g2t-home-body::after,
.g2t-page__body::after { content: ""; display: block; clear: both; }

/* ——— 3. Галереи: горизонтально на десктопе, 2 колонки на мобильных ——— */
.gallery {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
	margin: 22px 0;
}
.gallery-item { margin: 0; }
.gallery img {
	width: 100%;
	display: block;
	border-radius: var(--radius-sm);
}
@media (max-width: 640px) {
	.gallery { grid-template-columns: repeat(2, 1fr); }
}

/* ——— 4. Сайдбар на страницах (flex-раскладка) ——— */
.g2t-layout {
	display: flex;
	gap: 36px;
	align-items: flex-start;
}
.g2t-layout__main { flex: 1 1 auto; min-width: 0; }
.g2t-layout__aside { flex: 0 0 300px; }
@media (max-width: 1000px) {
	.g2t-layout { flex-direction: column; }
	.g2t-layout__aside { flex: 1 1 auto; width: 100%; }
}

/* ——— 5. Подвал: компактные ссылки навигации ——— */
.site-footer .textwidget {
	font-size: 14px;
	line-height: 1.55;
}
.site-footer .textwidget a {
	display: inline-block;
	padding: 1px 0;
	margin: 0;
	line-height: 1.5;
}
.site-footer .widget a { padding: 2px 0; }
.site-footer .widget li { border-bottom: 0; }

/* ——— 6. Выпадающие списки стран: 2 колонки на десктопе ——— */
@media (min-width: 861px) {
	.nav-primary__list .sub-menu {
		min-width: 460px;
		columns: 2;
		column-gap: 8px;
		padding: 10px 0;
	}
	.nav-primary__list .sub-menu li {
		break-inside: avoid;
	}
	.nav-primary__list .sub-menu a {
		padding: 9px 20px;
		font-size: 14px;
	}
	.nav-primary__list > li:last-child .sub-menu,
	.nav-primary__list > li:nth-last-child(2) .sub-menu {
		left: auto;
		right: 0;
	}
}

/* ——— 7. Форма комментариев — в колонке контента (внутри .g2t-layout__main,
	ширина совпадает с постом; отдельно не растягивается) ——— */
.g2t-article__comments {
	padding: 0;
	margin: 34px 0 0;
}
.comment-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.comment-form p { margin: 0; }
.comment-form label { font-size: 14px; color: var(--c-muted); display: block; margin-bottom: 4px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--c-border);
	border-radius: var(--radius-sm);
	font-size: 15px;
	font-family: var(--font);
	background: #fff;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--c-primary); outline: none; }
.comment-form .submit {
	align-self: flex-start;
	background: var(--c-primary);
	color: #fff;
	border: 0;
	border-radius: var(--radius-sm);
	padding: 12px 26px;
	font-size: 15px;
	cursor: pointer;
}
.comment-form .submit:hover { background: var(--c-primary-dark); }
.comment-form-cookies-consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}
.comment-form-cookies-consent input { margin-top: 3px; }
.comment-form-cookies-consent label { margin: 0; font-size: 13px; }
.comment-form p.comment-form-url { display: none; }

/* ——— 8. Contact Form 7 под дизайн сайта ——— */
.wpcf7-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-width: 560px;
}
.wpcf7-form p { margin: 0; }
.wpcf7-form label,
.wpcf7-form .wpcf7-form-control-wrap {
	display: block;
}
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="date"],
.wpcf7-form textarea,
.wpcf7-form select {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--c-border);
	border-radius: var(--radius-sm);
	font-size: 15px;
	font-family: var(--font);
	color: var(--c-text);
	background: #fff;
}
.wpcf7-form input:focus,
.wpcf7-form textarea:focus,
.wpcf7-form select:focus {
	border-color: var(--c-primary);
	outline: none;
	box-shadow: 0 0 0 3px rgba(11, 114, 185, .12);
}
.wpcf7-form input[type="submit"],
.wpcf7-form button[type="submit"] {
	align-self: flex-start;
	background: var(--c-primary);
	color: #fff;
	border: 0;
	border-radius: var(--radius-sm);
	padding: 13px 30px;
	font-size: 15px;
	cursor: pointer;
	transition: background .18s ease;
}
.wpcf7-form input[type="submit"]:hover,
.wpcf7-form button[type="submit"]:hover { background: var(--c-primary-dark); }
.wpcf7-not-valid-tip { font-size: 13px; color: #d64545; margin-top: 4px; }
.wpcf7 form .wpcf7-response-output {
	border: 1px solid var(--c-border);
	border-radius: var(--radius-sm);
	padding: 14px 18px;
	margin: 14px 0 0;
	font-size: 14px;
}

/* ——— 9. Лайтбокс для картинок в контенте ——— */
.g2t-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(10, 22, 32, .92);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10000;
	cursor: zoom-out;
	padding: 24px;
}
.g2t-lightbox img {
	max-width: 92vw;
	max-height: 90vh;
	border-radius: var(--radius);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.g2t-lightbox__close {
	position: absolute;
	top: 18px;
	right: 22px;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	font-size: 22px;
	cursor: pointer;
	line-height: 1;
}
.g2t-lightbox__close:hover { background: rgba(255, 255, 255, .25); }
.g2t-country__body .gallery img,
.g2t-article__body img:not(.g2t-nozoom) {
	cursor: zoom-in;
}

/* ——— 10. Ссылки «Куда поехать на море…» компактнее ——— */
.g2t-season a,
.g2t-season p a {
	display: block;
	margin: 2px 0;
	padding: 0;
	line-height: 1.45;
	font-size: 15px;
}
.g2t-season p {
	margin: 0;
	line-height: 1.45;
}

/* ——— 11. (0.9.5) Мобильное меню: видимые кнопки раскрытия подменю ——— */
.submenu-toggle { display: none; }

@media (max-width: 860px) {
	.submenu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		right: 6px;
		/* привязка к строке ссылки-родителя, НЕ к середине li:
		   при раскрытии подменю li растёт и top:50% уводил кнопку вниз */
		top: 6px;
		transform: none;
		width: 38px;
		height: 38px;
		border: 1px solid rgba(255, 255, 255, .25);
		border-radius: 8px;
		background: rgba(255, 255, 255, .08);
		color: #fff;
		cursor: pointer;
		padding: 0;
		z-index: 2;
	}
	.submenu-toggle:hover { background: rgba(255, 255, 255, .18); }
	.submenu-toggle__icon {
		position: relative;
		width: 12px;
		height: 12px;
		display: block;
	}
	.submenu-toggle__icon::before,
	.submenu-toggle__icon::after {
		content: "";
		position: absolute;
		background: currentColor;
		border-radius: 1px;
	}
	.submenu-toggle__icon::before {
		left: 0;
		right: 0;
		top: 5px;
		height: 2px;
	}
	.submenu-toggle__icon::after {
		top: 0;
		bottom: 0;
		left: 5px;
		width: 2px;
		transition: opacity .15s ease;
	}
	li.is-open > .submenu-toggle .submenu-toggle__icon::after { opacity: 0; }
	li.is-open > .submenu-toggle { border-color: rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .16); }

	.nav-primary__list li.menu-item-has-children {
		position: relative;
	}

	.nav-primary__list li.menu-item-has-children > a {
		padding-right: 56px;
	}

	.nav-primary__list .sub-menu {
		max-height: 60vh;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}

	.nav-primary__list li.menu-item-has-children.is-open > a {
		padding-right: 56px;
	}
}

/* ——— 12. (0.9.5) Кнопка «наверх» ——— */
.g2t-to-top {
	position: fixed;
	right: 18px;
	bottom: 18px;
	width: 46px;
	height: 46px;
	border: 0;
	border-radius: 50%;
	background: var(--c-primary);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(11, 114, 185, .35);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity .25s ease, transform .25s ease, visibility .25s;
	z-index: 900;
}
.g2t-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.g2t-to-top:hover { background: var(--c-primary-dark); }
.g2t-to-top:focus-visible { outline: 2px solid var(--c-navy); outline-offset: 2px; }

/* ——— 13. (0.9.5) Свежие посты в подвале (замена Mini Loops) ——— */
.site-footer .g2t-widget-recent { list-style: none; margin: 0; }
.site-footer .g2t-recent {
	margin: 0;
	padding: 0;
	list-style: none;
}
.site-footer .g2t-recent li {
	border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.site-footer .g2t-recent a {
	display: block;
	padding: 7px 0;
	font-size: 14px;
	line-height: 1.5;
	color: #fff;
	text-decoration: none;
}
.site-footer .g2t-recent a:hover { text-decoration: underline; }
.site-footer .g2t-recent time {
	display: block;
	font-size: 12px;
	color: #9db4c4;
}
@media (min-width: 641px) {
	.site-footer__widgets { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

/* ——— 14. (0.9.9) Бургер ↔ крестик при открытом меню ——— */
.menu-toggle__close { display: none; }
@media (max-width: 960px) {
	.nav-open .menu-toggle__open { display: none; }
	.nav-open .menu-toggle__close { display: block; }
}

/* ——— 15. (1.0) Хлебные крошки ——— */
.g2t-breadcrumbs {
	font-size: 13px;
	margin: 0 0 10px;
	color: var(--c-muted);
}
.g2t-breadcrumbs ol {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
}
.g2t-breadcrumbs li { display: flex; align-items: center; gap: 8px; }
.g2t-breadcrumbs li + li::before { content: "\203A"; color: var(--c-muted); }
.g2t-breadcrumbs a { color: var(--c-primary); text-decoration: none; }
.g2t-breadcrumbs a:hover { text-decoration: underline; }

/* ——— 16. (1.0) Похожие статьи под записью ——— */
.g2t-related {
	margin: 30px 0 8px;
	padding-top: 22px;
	border-top: 1px solid var(--c-border);
}
.g2t-related__title {
	font-size: 20px;
	margin: 0 0 12px;
}
.g2t-related__list { list-style: none; margin: 0; padding: 0; }
.g2t-related__list li {
	padding: 9px 0;
	border-bottom: 1px solid var(--c-border);
}
.g2t-related__list li:last-child { border-bottom: 0; }
.g2t-related__list a {
	color: var(--c-text);
	text-decoration: none;
	font-weight: 600;
}
.g2t-related__list a:hover { color: var(--c-primary); }
.g2t-related__list time {
	display: block;
	font-size: 12px;
	color: var(--c-muted);
	margin-top: 2px;
}

/* ——— 17. (1.0) Страница 404 с полезными ссылками ——— */
.g2t-404__search { max-width: 480px; margin: 18px 0 28px; }
/* форма поиска на 404 — в дизайн-системе сайта
	(get_search_form даёт стандартную разметку: .search-field + .search-submit) */
.g2t-404 .search-form {
	display: flex;
	gap: 10px;
}
.g2t-404 .search-form label { flex: 1 1 auto; display: flex; }
.g2t-404 .search-form .search-field {
	flex: 1 1 auto;
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--c-border);
	border-radius: var(--radius-sm);
	font-size: 15px;
	font-family: var(--font);
	background: #fff;
}
.g2t-404 .search-form .search-field:focus {
	border-color: var(--c-primary);
	outline: none;
	box-shadow: 0 0 0 3px rgba(11, 114, 185, .12);
}
.g2t-404 .search-form .search-submit {
	background: var(--c-primary);
	color: #fff;
	border: 0;
	border-radius: var(--radius-sm);
	padding: 12px 22px;
	font-size: 15px;
	cursor: pointer;
}
.g2t-404 .search-form .search-submit:hover { background: var(--c-primary-dark); }

/* ——— 18. (1.0) Карты локаций Leaflet/OSM (замена MapListPro) ——— */
.g2t-map {
	margin: 26px 0;
	position: relative;
}
.g2t-map__search {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--c-border);
	border-radius: var(--radius-sm);
	font-size: 14px;
	font-family: var(--font);
	margin-bottom: 10px;
}
.g2t-map__search:focus { border-color: var(--c-primary); outline: none; }
.g2t-map__canvas {
	height: 400px;
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
	z-index: 1;
}
@media (max-width: 640px) {
	.g2t-map__canvas { height: 300px; }
}
.g2t-map .leaflet-container { font: inherit; }
.g2t-map__addr { color: var(--c-muted); font-size: 13px; }
.g2t-map .leaflet-popup-content a { color: var(--c-primary); }
.g2t-404__cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 28px;
	margin: 0 0 26px;
}
.g2t-404__col h2 {
	font-size: 18px;
	margin: 0 0 10px;
}
.g2t-404__col ul { list-style: none; margin: 0; padding: 0; }
.g2t-404__col li { padding: 5px 0; border-bottom: 1px solid var(--c-border); }
.g2t-404__col a { color: var(--c-primary); text-decoration: none; }
.g2t-404__col a:hover { text-decoration: underline; }

/* ——— 19. (1.0) Сезонные плитки месяцев на главной ——— */
.g2t-season p { display: flex; flex-direction: column; gap: 6px; }
.g2t-season a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 14px;
	border-radius: 10px;
	background: rgba(255, 255, 255, .72);
	border: 1px solid var(--c-border);
	color: var(--c-text);
	text-decoration: none;
	font-size: 14px;
	line-height: 1.35;
	transition: border-color .15s ease, transform .15s ease;
}
.g2t-season a:hover {
	border-color: var(--c-primary);
	transform: translateX(2px);
}
.g2t-season__month {
	flex: 0 0 auto;
	min-width: 74px;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--c-primary);
	color: #fff;
	font-size: 12.5px;
	font-weight: 600;
	text-align: center;
}
.g2t-season--orange .g2t-season__month { background: #e8871e; }
.g2t-season--sandy .g2t-season__month { background: #c99a3c; }
.g2t-season--blue .g2t-season__month { background: #2e7fbe; }
.g2t-season--vista .g2t-season__month { background: #47a05c; }
