/* ==========================================================================
   Site Menu
   Desktop (1025px and up): links in a row; Destinations opens a frosted
   glass panel with region headings and blue country pills.
   Phone/tablet (1024px and down): menu button -> full-screen menu over a
   dark see-through backdrop; Destinations expands inside it.
   The header decides the link color (white over photos) through "color".
   ========================================================================== */

/* Hidden text that screen readers still read out ("Open menu" etc.). */
.watg-menu .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.watg-menu button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0.25em;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.watg-menu ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.watg-menu__list {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.watg-menu__row {
	display: flex;
	align-items: center;
}

/* Top links: underline grows in on hover (like Kadence). */
.watg-menu__link {
	position: relative;
	display: block;
	padding: 0.3em 0.6em;
	color: inherit;
	text-decoration: none;
}

.watg-menu__link::after {
	content: "";
	position: absolute;
	left: 0.6em;
	right: 0.6em;
	bottom: 0;
	height: 2px;
	background: currentColor;
	transform: scaleX(0);
	transition: transform 0.2s ease;
}

a.watg-menu__link:hover,
a.watg-menu__link:focus-visible,
.has-mega:hover > .watg-menu__row > .watg-menu__link {
	color: var(--wp--preset--color--theme-palette-1, #5fa6e0);
}

a.watg-menu__link:hover::after,
a.watg-menu__link:focus-visible::after,
a.watg-menu__link[aria-current="page"]::after {
	transform: scaleX(1);
}

.watg-menu__expand svg {
	transition: transform 0.2s ease;
}

.has-mega.is-open .watg-menu__expand svg {
	transform: rotate(180deg);
}

/* The phone-only buttons are hidden on desktop. */
.watg-menu__toggle,
.watg-menu__close {
	display: none !important;
}


/* --------------------------------------------------------------------------
   The Destinations panel
   -------------------------------------------------------------------------- */
.watg-menu__item {
	position: relative;
}

.watg-mega {
	display: none;
}

.watg-mega__inner {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.25rem 1.5rem;
	padding: 1rem 1.25rem 1.5rem;
	border-radius: 20px;
	background-color: rgba(255, 248, 243, 0.2);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.watg-mega__region.is-wide {
	grid-column: 1 / -1; /* Asia spans the full width. */
}

/* Region headings: white, heading font, soft shadow. */
.watg-mega__heading {
	margin: 0 0 0.5rem;
	font-family: var(--wp--preset--font-family--heading, cursive);
	font-size: 30px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--wp--preset--color--theme-palette-9, #fff);
	text-shadow: 3px 3px 7px rgba(0, 0, 0, 0.5);
}

.watg-mega__heading-link {
	color: inherit;
	text-decoration: none;
}

a.watg-mega__heading-link:hover {
	text-decoration: underline;
}

/* Country pills: 2 columns, 4 in the wide (Asia) section. */
.watg-mega__countries {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.watg-mega__region.is-wide .watg-mega__countries {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.watg-mega__country {
	display: flex;
	align-items: center;
	gap: 0.4em;
	height: 48px;
	box-sizing: border-box;
	padding: 4px 10px 4px 4px;
	border-radius: 100rem;
	background-color: var(--wp--preset--color--theme-palette-1, #5fa6e0);
	color: var(--wp--preset--color--theme-palette-9, #fff);
	font-family: var(--wp--preset--font-family--airplanes, cursive);
	font-size: 17px;
	line-height: 1.1;
	text-decoration: none;
	box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
	transition: transform 0.4s ease, background-color 0.3s ease;
}

a.watg-mega__country:hover,
a.watg-mega__country:focus-visible,
a.watg-mega__country[aria-current="page"] {
	background-color: var(--wp--preset--color--theme-palette-2, #7fbc5e);
	color: var(--wp--preset--color--theme-palette-9, #fff);
	transform: scale(1.05);
}

/* Round photo. Empty = placeholder circle until an image is chosen in Appearance > Menus. */
.watg-mega__image {
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	overflow: hidden;
	background-color: rgba(255, 255, 255, 0.35);
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.watg-mega__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.watg-mega__name {
	flex: 1;
	min-width: 0;
	text-align: center;
	overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
	.watg-mega__country,
	a.watg-mega__country:hover,
	a.watg-mega__country:focus-visible {
		transition: none;
		transform: none;
	}
}


/* --------------------------------------------------------------------------
   Desktop: the panel drops down under Destinations.
   -------------------------------------------------------------------------- */
@media (min-width: 1025px) {
	.watg-mega {
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 200;
		width: 680px;
		max-width: calc(100vw - 2rem);
		padding-top: 12px; /* Invisible bridge, so the panel stays open while the mouse moves down to it. */
		/* Hidden but animatable (see the panel below). */
		display: block;
		visibility: hidden;
		pointer-events: none;
		transition: visibility 0s linear 0.35s;
	}

	.has-mega:hover > .watg-mega,
	.has-mega.is-open > .watg-mega {
		visibility: visible;
		pointer-events: auto;
		transition-delay: 0s;
	}

	/* The panel unrolls downward (clip-path) while fading in. Animated on the
	   panel itself, not its parent, so the frosted-glass blur keeps working.
	   The negative side/bottom insets leave room for the shadow. */
	.watg-mega__inner {
		opacity: 0;
		clip-path: inset(0 -40px 100% -40px);
		transform: translateY(-6px);
		transition: clip-path 0.35s ease, opacity 0.25s ease, transform 0.35s ease;
	}

	.has-mega:hover > .watg-mega > .watg-mega__inner,
	.has-mega.is-open > .watg-mega > .watg-mega__inner {
		opacity: 1;
		clip-path: inset(0 -40px -40px -40px);
		transform: none;
	}
}

@media (min-width: 1025px) and (prefers-reduced-motion: reduce) {
	.watg-mega,
	.watg-mega__inner {
		transition: none;
	}
}


/* --------------------------------------------------------------------------
   Phone/tablet: full-screen menu.
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.watg-menu__toggle {
		display: inline-flex !important;
	}

	.watg-menu__panel {
		display: none;
	}

	.watg-menu.is-open .watg-menu__panel {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 1000;
		overflow-y: auto;
		padding: 4.5rem 1.5rem 2.5rem;
		background-color: rgba(45, 55, 72, 0.6);
		-webkit-backdrop-filter: blur(8px);
		backdrop-filter: blur(8px);
		color: var(--wp--preset--color--theme-palette-9, #fff);
	}

	.watg-menu__close {
		display: inline-flex !important;
		position: absolute;
		top: 1rem;
		right: 1rem;
	}

	.watg-menu__list {
		display: block;
	}

	.watg-menu__item {
		border-bottom: 1px solid rgba(255, 255, 255, 0.15);
	}

	.watg-menu__row {
		justify-content: space-between;
	}

	.watg-menu__link {
		padding: 0.6em 0;
		font-size: 1.1em;
	}

	.watg-menu__link::after {
		display: none;
	}

	.watg-menu__expand {
		width: 44px;
		height: 44px;
		border-left: 1px solid rgba(255, 255, 255, 0.15) !important;
	}

	.has-mega.is-open > .watg-mega {
		display: block;
		padding-bottom: 1.25rem;
	}

	.watg-mega__inner {
		grid-template-columns: 1fr;
		padding: 1rem;
	}

	.watg-mega__region.is-wide .watg-mega__countries {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.watg-mega__country {
		height: 52px;
		font-size: 18px;
	}

	/* Page behind the open menu doesn't scroll. */
	body.watg-menu-is-open {
		overflow: hidden;
	}
}
