/**
 * ChinaTravelMag Global Header and Footer V2.
 *
 * All selectors are scoped to the global shell. Design System variables remain
 * the token source; fallback values keep the shell safe if the plugin is off.
 */

.ctm-global-shell {
	margin: 0;
}

.ctm-global-shell.ctm-global-nav-open {
	overflow: hidden;
}

.ctm-global-skip-link {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 100000;
	padding: 10px 14px;
	border-radius: var(--ctm-radius-control, 9px);
	background: var(--ctm-surface, #fffdf9);
	color: var(--ctm-forest-dark, #0b342d);
	font: 700 0.9rem/1.2 var(--ctm-font-sans, "Segoe UI", sans-serif);
	transform: translateY(-160%);
	transition: transform var(--ctm-duration-brief, 150ms) ease;
}

.ctm-global-skip-link:focus {
	outline: 3px solid var(--ctm-terracotta-dark, #ab351f);
	outline-offset: 2px;
	transform: translateY(0);
}

.ctm-global-header,
.ctm-global-footer {
	box-sizing: border-box;
	font-family: var(--ctm-font-sans, "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif);
}

.ctm-global-header *,
.ctm-global-header *::before,
.ctm-global-header *::after,
.ctm-global-footer *,
.ctm-global-footer *::before,
.ctm-global-footer *::after {
	box-sizing: border-box;
}

.ctm-global-header a,
.ctm-global-footer a {
	text-decoration: none;
}

.ctm-global-header button,
.ctm-global-footer button {
	font: inherit;
}

/*
 * Transitional compatibility for legacy plugin-rendered site navigation.
 * The markup remains owned by those plugins until their dedicated migration;
 * hiding it here prevents a second visible/accessible Global Header now.
 */
body.ctm-global-shell .ctm-faq-site-nav,
body.ctm-global-shell.single-post .ctm-article-site-nav {
	display: none !important;
}

.ctm-global-header {
	position: relative;
	z-index: 9990;
	min-height: var(--ctm-header-height, 76px);
	border-bottom: 1px solid var(--ctm-border-header, rgba(222, 216, 205, 0.7));
	background: var(--ctm-surface-header, rgba(255, 253, 249, 0.96));
	box-shadow: var(--ctm-shadow-site-header, 0 4px 20px rgba(65, 52, 42, 0.04));
	color: var(--ctm-text, #0d2e29);
}

.ctm-global-header__inner {
	display: grid;
	grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
	align-items: center;
	width: min(calc(100% - (2 * var(--ctm-gutter, 24px))), var(--ctm-content-width, 1380px));
	min-height: var(--ctm-header-height, 76px);
	margin: 0 auto;
	gap: 24px;
}

body.ctm-design-system .ctm-global-brand,
.ctm-global-brand {
	display: inline-flex;
	align-items: center;
	justify-self: start;
	width: fit-content;
	gap: 10px;
	color: var(--ctm-forest-dark, #0b342d);
}

.ctm-global-brand__seal {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 4px;
	border-radius: 50%;
	background: var(--ctm-terracotta-action, #cf452a);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
	color: #fff;
	font-family: var(--ctm-font-serif, Georgia, serif);
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1;
}

.ctm-global-brand__logo {
	display: block;
	width: auto;
	max-width: 48px;
	height: 40px;
	object-fit: contain;
}

.ctm-global-brand__name {
	font-family: var(--ctm-font-serif, Georgia, serif);
	font-size: clamp(1.1rem, 1.5vw, 1.35rem);
	font-weight: 700;
	letter-spacing: -0.025em;
	white-space: nowrap;
}

.ctm-global-nav {
	align-self: stretch;
}

.ctm-global-nav__drawer-header,
.ctm-global-nav .ctm-global-nav__drawer-cta {
	display: none;
}

.ctm-global-nav__list,
.ctm-global-nav__list ul,
.ctm-global-footer__links,
.ctm-global-footer__legal {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ctm-global-nav__list {
	display: flex;
	align-items: stretch;
	height: 100%;
	gap: clamp(12px, 1.65vw, 27px);
}

.ctm-global-nav__list > li {
	position: relative;
	display: flex;
	align-items: center;
}

.ctm-global-nav__list > li > a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--ctm-forest, #174b3e);
	font-size: clamp(0.76rem, 1vw, 0.91rem);
	font-weight: 700;
	white-space: nowrap;
}

.ctm-global-nav__list > li > a::after {
	position: absolute;
	right: 0;
	bottom: -1px;
	left: 0;
	height: 2px;
	background: var(--ctm-terracotta, #d3482b);
	content: "";
	transform: scaleX(0);
	transition: transform var(--ctm-duration-base, 180ms) ease;
}

.ctm-global-nav__list > li:hover > a::after,
.ctm-global-nav__list > li:focus-within > a::after,
.ctm-global-nav__list > li.current-menu-item > a::after,
.ctm-global-nav__list > li.current-menu-ancestor > a::after {
	transform: scaleX(1);
}

.ctm-global-nav__submenu-toggle {
	display: inline-grid;
	place-items: center;
	width: 30px;
	height: 44px;
	margin-left: -4px;
	border: 0;
	background: transparent;
	color: var(--ctm-forest, #174b3e);
	cursor: pointer;
}

.ctm-global-nav__submenu-toggle::before {
	width: 7px;
	height: 7px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	content: "";
	transform: translateY(-2px) rotate(45deg);
	transition: transform var(--ctm-duration-brief, 150ms) ease;
}

.ctm-global-nav__submenu-toggle[aria-expanded="true"]::before {
	transform: translateY(2px) rotate(225deg);
}

.ctm-global-nav .sub-menu {
	position: absolute;
	top: calc(100% - 8px);
	left: 50%;
	z-index: 2;
	visibility: hidden;
	width: max-content;
	min-width: 230px;
	max-width: 320px;
	padding: 10px;
	border: 1px solid var(--ctm-border, #ded8cd);
	border-radius: var(--ctm-radius-md, 10px);
	background: var(--ctm-surface, #fffdf9);
	box-shadow: var(--ctm-shadow-float, 0 18px 50px rgba(7, 38, 31, 0.15));
	opacity: 0;
	transform: translate(-50%, 8px);
	transition: opacity var(--ctm-duration-base, 180ms) ease, transform var(--ctm-duration-base, 180ms) ease, visibility 0s linear var(--ctm-duration-base, 180ms);
}

.ctm-global-nav .sub-menu li {
	position: relative;
}

.ctm-global-nav .sub-menu a {
	display: block;
	padding: 11px 12px;
	border-radius: var(--ctm-radius-sm, 6px);
	color: var(--ctm-text, #0d2e29);
	font-size: 0.88rem;
	font-weight: 600;
	line-height: 1.35;
}

.ctm-global-nav .sub-menu a:hover,
.ctm-global-nav .sub-menu a:focus-visible {
	background: var(--ctm-surface-muted, #f3ede2);
	color: var(--ctm-terracotta-dark, #ab351f);
}

.ctm-global-nav .menu-item-has-children:hover > .sub-menu,
.ctm-global-nav .menu-item-has-children:focus-within > .sub-menu,
.ctm-global-nav .menu-item-has-children.is-open > .sub-menu {
	visibility: visible;
	opacity: 1;
	transform: translate(-50%, 0);
	transition-delay: 0s;
}

.ctm-global-header__actions {
	display: flex;
	align-items: center;
	justify-self: end;
	gap: 10px;
}

.ctm-global-header__search,
.ctm-global-header__menu-toggle,
.ctm-global-nav__close {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ctm-forest, #174b3e);
	cursor: pointer;
}

.ctm-global-header__search:hover,
.ctm-global-header__menu-toggle:hover,
.ctm-global-nav__close:hover {
	background: var(--ctm-surface-muted, #f3ede2);
}

.ctm-global-header__search svg {
	width: 21px;
	height: 21px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-width: 1.75;
}

.ctm-global-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 11px 18px;
	border-radius: var(--ctm-radius-full, 999px);
	font-size: 0.84rem;
	font-weight: 800;
	line-height: 1.1;
}

body.ctm-design-system .ctm-global-header .ctm-global-button--accent,
.ctm-global-button--accent {
	background: var(--ctm-terracotta-action, #cf452a);
	box-shadow: 0 9px 22px rgba(182, 84, 59, 0.2);
	color: #fff;
}

body.ctm-design-system .ctm-global-header .ctm-global-button--accent:hover,
.ctm-global-button--accent:hover {
	background: var(--ctm-terracotta-dark, #ab351f);
	color: #fff;
}

.ctm-global-header__menu-toggle,
.ctm-global-nav__backdrop {
	display: none;
}

.ctm-global-header a:focus-visible,
.ctm-global-header button:focus-visible,
.ctm-global-footer a:focus-visible,
.ctm-global-footer button:focus-visible {
	outline: 3px solid var(--ctm-terracotta-dark, #ab351f);
	outline-offset: 3px;
}

.ctm-global-trust {
	border-top: 1px solid var(--ctm-border, #ded8cd);
	border-bottom: 1px solid var(--ctm-border, #ded8cd);
	background: var(--ctm-surface-muted, #f3ede2);
	color: var(--ctm-text, #0d2e29);
}

.ctm-global-trust__inner {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	width: min(calc(100% - (2 * var(--ctm-gutter, 24px))), var(--ctm-content-width, 1380px));
	margin: 0 auto;
}

.ctm-global-trust__item {
	position: relative;
	min-width: 0;
	padding: 25px 24px 25px 48px;
	border-right: 1px solid var(--ctm-border, #ded8cd);
}

.ctm-global-trust__item:first-child {
	border-left: 1px solid var(--ctm-border, #ded8cd);
}

.ctm-global-trust__item > span {
	position: absolute;
	top: 26px;
	left: 22px;
	color: var(--ctm-terracotta, #d3482b);
	font-weight: 900;
}

.ctm-global-trust__item strong {
	display: block;
	font-family: var(--ctm-font-serif, Georgia, serif);
	font-size: 0.97rem;
	line-height: 1.25;
}

body.ctm-design-system .ctm-global-trust__item p,
.ctm-global-trust__item p {
	margin: 5px 0 0;
	color: var(--ctm-text-muted, #5f6d69);
	font-size: 0.77rem;
	line-height: 1.45;
}

.ctm-global-footer__surface {
	background: var(--ctm-forest-dark, #0b342d);
	color: rgba(255, 255, 255, 0.82);
}

.ctm-global-footer__inner {
	display: grid;
	grid-template-columns: minmax(260px, 1.35fr) repeat(4, minmax(130px, 0.75fr));
	width: min(calc(100% - (2 * var(--ctm-gutter, 24px))), var(--ctm-content-width, 1380px));
	margin: 0 auto;
	padding: 64px 0 58px;
	gap: clamp(28px, 3vw, 50px);
}

body.ctm-design-system .ctm-global-footer .ctm-global-brand,
.ctm-global-footer .ctm-global-brand {
	color: #fff;
}

body.ctm-design-system .ctm-global-footer__brand > p,
.ctm-global-footer__brand > p {
	max-width: 330px;
	margin: 20px 0 0;
	color: rgba(255, 255, 255, 0.74);
	font-size: 0.91rem;
	line-height: 1.7;
}

.ctm-global-footer__contact {
	display: flex;
	flex-wrap: wrap;
	margin-top: 17px;
	gap: 8px 17px;
}

.ctm-global-footer__contact a,
.ctm-global-footer__cta a {
	color: #fff;
	font-size: 0.8rem;
	font-weight: 750;
}

.ctm-global-footer__contact a:hover,
.ctm-global-footer__cta a:hover {
	color: #ffc1b2;
}

.ctm-global-footer__cta {
	max-width: 350px;
	margin-top: 24px;
	padding: 20px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: var(--ctm-radius-md, 10px);
	background: rgba(255, 255, 255, 0.06);
}

.ctm-global-footer__cta strong {
	display: block;
	color: #fff;
	font-family: var(--ctm-font-serif, Georgia, serif);
	font-size: 1.05rem;
}

body.ctm-design-system .ctm-global-footer__cta p,
.ctm-global-footer__cta p {
	margin: 8px 0 13px;
	color: rgba(255, 255, 255, 0.72);
	font-size: 0.8rem;
	line-height: 1.5;
}

.ctm-global-footer__menu h2 {
	margin: 4px 0 20px;
	color: #fff;
	font-family: var(--ctm-font-serif, Georgia, serif);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.25;
}

.ctm-global-footer__links li + li {
	margin-top: 11px;
}

.ctm-global-footer__links a {
	display: inline-block;
	padding: 3px 0;
	color: rgba(255, 255, 255, 0.72);
	font-size: 0.81rem;
	line-height: 1.4;
}

.ctm-global-footer__links a:hover {
	color: #fff;
}

.ctm-global-footer__bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: min(calc(100% - (2 * var(--ctm-gutter, 24px))), var(--ctm-content-width, 1380px));
	min-height: 72px;
	margin: 0 auto;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
	gap: 24px;
}

body.ctm-design-system .ctm-global-footer__bottom p,
.ctm-global-footer__bottom p {
	margin: 0;
	color: rgba(255, 255, 255, 0.58);
	font-size: 0.72rem;
	line-height: 1.5;
}

.ctm-global-footer__legal {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 9px 20px;
}

.ctm-global-footer__legal a {
	color: rgba(255, 255, 255, 0.62);
	font-size: 0.72rem;
}

.ctm-global-footer__legal a:hover {
	color: #fff;
}

@media (max-width: 1180px) {
	.ctm-global-header__inner {
		grid-template-columns: auto 1fr auto;
		gap: 16px;
	}

	.ctm-global-nav__list {
		justify-content: center;
		gap: 12px;
	}

	.ctm-global-brand__name {
		font-size: 1.08rem;
	}

	.ctm-global-footer__inner {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.ctm-global-footer__brand {
		display: grid;
		grid-column: 1 / -1;
		grid-template-columns: 1fr 1fr;
		align-items: start;
		gap: 10px 32px;
	}

	.ctm-global-footer__brand > p,
	.ctm-global-footer__contact {
		grid-column: 1;
	}

	.ctm-global-footer__cta {
		grid-row: 1 / span 3;
		grid-column: 2;
		margin-top: 0;
	}
}

@media (max-width: 1024px) {
	.ctm-global-header,
	.ctm-global-header__inner {
		min-height: var(--ctm-header-height-compact, 64px);
	}

	.ctm-global-header__inner {
		grid-template-columns: auto 1fr auto;
		width: min(calc(100% - (2 * var(--ctm-gutter-tablet, 18px))), var(--ctm-content-width, 1380px));
	}

	.ctm-global-header__menu-toggle {
		grid-column: 3;
		grid-row: 1;
		justify-self: end;
	}

	.ctm-global-header__actions {
		grid-column: 2;
		grid-row: 1;
	}

	.ctm-global-header__menu-icon {
		display: grid;
		width: 21px;
		gap: 4px;
	}

	.ctm-global-header__menu-icon span {
		display: block;
		height: 1.5px;
		background: currentColor;
	}

	.ctm-global-nav {
		grid-column: 1 / -1;
		width: 100%;
	}

	.ctm-global-nav__list {
		flex-wrap: wrap;
		justify-content: flex-start;
		height: auto;
		padding: 12px 0 18px;
	}

	.ctm-global-shell-js .ctm-global-header__menu-toggle {
		display: inline-grid;
	}

	.ctm-global-shell-js .ctm-global-nav {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 4;
		display: flex;
		visibility: hidden;
		width: min(430px, calc(100vw - 36px));
		padding: 0 24px 28px;
		background: var(--ctm-surface-drawer, #fbfaf6);
		box-shadow: var(--ctm-shadow-drawer, -24px 0 64px rgba(10, 31, 25, 0.22));
		opacity: 0;
		transform: translateX(104%);
		transition: transform var(--ctm-duration-panel-transform, 320ms) var(--ctm-ease-emphasized, ease), opacity var(--ctm-duration-medium, 240ms) ease, visibility 0s linear var(--ctm-duration-panel-transform, 320ms);
		flex-direction: column;
		overflow-y: auto;
	}

	.ctm-global-shell-js .ctm-global-header.is-nav-open .ctm-global-nav {
		visibility: visible;
		opacity: 1;
		transform: translateX(0);
		transition-delay: 0s;
	}

	.ctm-global-shell-js .ctm-global-nav__drawer-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		min-height: 76px;
		border-bottom: 1px solid var(--ctm-border, #ded8cd);
		color: var(--ctm-forest-dark, #0b342d);
	}

	.ctm-global-nav__drawer-header strong {
		font-family: var(--ctm-font-serif, Georgia, serif);
	}

	.ctm-global-shell-js .ctm-global-nav__list {
		display: block;
		padding: 18px 0;
	}

	.ctm-global-shell-js .ctm-global-nav__list > li {
		display: grid;
		grid-template-columns: 1fr auto;
		border-bottom: 1px solid var(--ctm-border-subtle, #eee8df);
	}

	.ctm-global-shell-js .ctm-global-nav__list > li > a {
		min-height: 54px;
		font-size: 0.98rem;
	}

	.ctm-global-shell-js .ctm-global-nav__list > li > a::after {
		display: none;
	}

	.ctm-global-shell-js .ctm-global-nav__submenu-toggle {
		width: 48px;
		height: 54px;
		margin: 0;
	}

	.ctm-global-shell-js .ctm-global-nav .sub-menu {
		position: static;
		grid-column: 1 / -1;
		display: none;
		visibility: visible;
		width: auto;
		min-width: 0;
		max-width: none;
		padding: 0 0 12px 12px;
		border: 0;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
		opacity: 1;
		transform: none;
		transition: none;
	}

	.ctm-global-shell-js .ctm-global-nav .menu-item-has-children.is-open > .sub-menu {
		display: block;
		transform: none;
	}

	.ctm-global-shell-js .ctm-global-nav .sub-menu a {
		min-height: 44px;
		padding: 11px 12px;
	}

	.ctm-global-shell-js .ctm-global-nav .ctm-global-nav__drawer-cta {
		display: none;
		width: 100%;
		margin-top: auto;
	}

	.ctm-global-shell-js .ctm-global-nav__backdrop {
		position: fixed;
		inset: 0;
		z-index: 3;
		display: block;
		visibility: hidden;
		width: 100%;
		height: 100%;
		padding: 0;
		border: 0;
		background: rgba(5, 30, 25, 0.5);
		opacity: 0;
		transition: opacity var(--ctm-duration-drawer-backdrop, 210ms) ease, visibility 0s linear var(--ctm-duration-drawer-backdrop, 210ms);
	}

	.ctm-global-shell-js .ctm-global-header.is-nav-open .ctm-global-nav__backdrop {
		visibility: visible;
		opacity: 1;
		transition-delay: 0s;
	}

	.ctm-global-trust__inner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ctm-global-trust__item:nth-child(2) {
		border-right: 1px solid var(--ctm-border, #ded8cd);
	}

	.ctm-global-trust__item:nth-child(-n + 2) {
		border-bottom: 1px solid var(--ctm-border, #ded8cd);
	}

	.ctm-global-footer__inner,
	.ctm-global-footer__bottom,
	.ctm-global-trust__inner {
		width: min(calc(100% - (2 * var(--ctm-gutter-tablet, 18px))), var(--ctm-content-width, 1380px));
	}
}

@media (max-width: 768px) {
	.ctm-global-header__inner {
		gap: 8px;
	}

	.ctm-global-header__actions {
		gap: 3px;
	}

	.ctm-global-header__cta {
		display: none;
	}

	.ctm-global-shell-js .ctm-global-nav .ctm-global-nav__drawer-cta {
		display: inline-flex;
	}

	.ctm-global-footer__inner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		padding: 50px 0 44px;
		gap: 34px 24px;
	}

	.ctm-global-footer__brand {
		display: block;
		grid-column: 1 / -1;
	}

	.ctm-global-footer__brand > p {
		max-width: 460px;
	}

	.ctm-global-footer__cta {
		max-width: none;
		margin-top: 24px;
	}

	.ctm-global-footer__bottom {
		display: grid;
		padding: 20px 0 24px;
	}

	.ctm-global-footer__legal {
		justify-content: flex-start;
	}
}

@media (max-width: 560px) {
	.ctm-global-header__inner {
		grid-template-columns: minmax(0, 1fr) auto auto;
	}

	.ctm-global-header .ctm-global-brand {
		min-width: 0;
		max-width: 100%;
	}

	.ctm-global-header .ctm-global-brand__name {
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.ctm-global-header__inner,
	.ctm-global-footer__inner,
	.ctm-global-footer__bottom,
	.ctm-global-trust__inner {
		width: calc(100% - (2 * var(--ctm-gutter-mobile, 14px)));
	}

	.ctm-global-brand__seal {
		width: 34px;
		height: 34px;
	}

	.ctm-global-brand__name {
		font-size: 1rem;
	}

	.ctm-global-trust__inner,
	.ctm-global-footer__inner {
		grid-template-columns: 1fr;
	}

	.ctm-global-trust__item,
	.ctm-global-trust__item:first-child,
	.ctm-global-trust__item:nth-child(2),
	.ctm-global-trust__item:nth-child(-n + 2) {
		padding: 18px 14px 18px 40px;
		border-right: 0;
		border-bottom: 1px solid var(--ctm-border, #ded8cd);
		border-left: 0;
	}

	.ctm-global-trust__item:last-child {
		border-bottom: 0;
	}

	.ctm-global-trust__item > span {
		top: 19px;
		left: 14px;
	}

	.ctm-global-footer__brand,
	.ctm-global-footer__menu {
		grid-column: 1;
	}

	.ctm-global-footer__menu {
		padding-top: 4px;
		border-top: 1px solid rgba(255, 255, 255, 0.12);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ctm-global-header *,
	.ctm-global-header *::before,
	.ctm-global-header *::after,
	.ctm-global-footer *,
	.ctm-global-footer *::before,
	.ctm-global-footer *::after {
		scroll-behavior: auto !important;
		transition-duration: 1ms !important;
	}
}
