/**
 * GIROPPONANDO — supplementary styles
 * Layout helpers, header behaviour, language switcher, hover effects.
 * Colors reference the theme.json CSS custom properties (--wp--preset--color--*).
 */

:root {
	--giroppo-transition: 0.3s ease;
}

/* ---------- Base smoothing ---------- */
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ---------- Prevent horizontal overflow on all viewports ---------- */
html,
body {
	max-width: 100%;
	overflow-x: hidden;
}
img,
.wp-block-cover__image-background {
	max-width: 100%;
}

/* ---------- Section eyebrow / label ---------- */
.giroppo-eyebrow {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold);
	/* keep labels readable over photos */
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

/* Thin gold rule used as a decorative divider */
.giroppo-rule {
	display: inline-block;
	width: 56px;
	height: 1px;
	background: var(--wp--preset--color--gold);
}

/* ---------- Header: FIXED, light translucent, overlaps the hero (no gap) ---------- */
.wp-site-blocks {
	position: relative;
}
.wp-site-blocks > header.wp-block-template-part {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	backdrop-filter: saturate(130%) blur(8px);
	-webkit-backdrop-filter: saturate(130%) blur(8px);
	/* same navy colour, just lower opacity (brighter, see-through) */
	background-color: rgba(14, 27, 51, 0.4);
	border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.home .wp-site-blocks > header.wp-block-template-part {
	background-color: rgba(14, 27, 51, 0.24);
}
/* Header CTA must never wrap */
.wp-site-blocks > header .wp-block-button__link {
	white-space: nowrap;
}
/* Pages without a full-bleed hero: push content below the fixed header */
.blog:not(.home) .wp-site-blocks > main,
.search .wp-site-blocks > main {
	padding-top: 5rem;
}

/* ---------- Hero title divider: a simple, slightly transparent white line ---------- */
.giroppo-title-rule {
	width: 84px;
	height: 1px;
	background: rgba(255, 255, 255, 0.5);
	margin: 1.75rem auto 0;
	border: 0;
}

/* ---------- Translucent backing panel behind main photos (editorial framing) ---------- */
.giroppo-photo-panel {
	position: relative;
}
.giroppo-photo-panel::before {
	content: "";
	position: absolute;
	inset: -1.5rem;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 4px;
	z-index: 0;
	pointer-events: none;
}
.giroppo-photo-panel > * {
	position: relative;
	z-index: 1;
}

/* Framed cards: a faint translucent panel so the main content/photos stand out */
.giroppo-framed {
	background: rgba(255, 255, 255, 0.045);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 5px;
	padding: 0.85rem 0.85rem 1.4rem;
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
	transition: background var(--giroppo-transition), transform var(--giroppo-transition), box-shadow var(--giroppo-transition);
}
.giroppo-framed:hover {
	background: rgba(255, 255, 255, 0.07);
}
.giroppo-framed .wp-block-post-featured-image {
	margin-bottom: 0.9rem;
}

/* SNS cards (bordered groups) also get a soft shadow */
.giroppo-card .wp-block-group.has-border-color {
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

/* ---------- Interactive category section ---------- */
.giroppo-cats__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 4.5rem; /* 3× the previous spacing */
}
.giroppo-cat {
	position: relative;
	min-height: 460px;
	border: 0;
	margin: 0;
	padding: 2rem;
	border-radius: 3px;
	overflow: hidden;
	cursor: pointer;
	background-size: cover;
	background-position: center;
	color: var(--wp--preset--color--off-white);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	text-align: left;
	font-family: var(--wp--preset--font-family--sans);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
	transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.giroppo-cat:hover {
	box-shadow: 0 24px 56px rgba(0, 0, 0, 0.5);
}
.giroppo-cat::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(10, 18, 34, 0.45);
	transition: background 0.35s ease;
}
.giroppo-cat:hover::before {
	background: rgba(10, 18, 34, 0.62);
}
.giroppo-cat:hover {
	transform: translateY(-4px);
}
.giroppo-cat > * {
	position: relative;
	z-index: 1;
}
.giroppo-cat__num {
	position: absolute;
	top: 2rem;
	left: 2rem;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold);
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.giroppo-cat__title {
	display: block;
	font-size: 2rem;
	font-weight: 400;
	letter-spacing: -0.01em;
}
.giroppo-cat__desc {
	display: block;
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	color: var(--wp--preset--color--champagne);
	font-size: 0.9rem;
	line-height: 1.6;
	transition: max-height 0.4s ease, opacity 0.35s ease, margin-top 0.35s ease;
}
.giroppo-cat:hover .giroppo-cat__desc,
.giroppo-cat:focus-visible .giroppo-cat__desc {
	max-height: 180px;
	opacity: 1;
	margin-top: 0.9rem;
}

/* Detail (expanded) mode: photo left, content right; others hidden. */
.giroppo-cats__panels {
	display: none;
}
.giroppo-cats.is-detail .giroppo-cats__grid {
	display: none;
}
.giroppo-cats.is-detail .giroppo-cats__panels {
	display: block;
}
.giroppo-panel {
	display: none;
}
.giroppo-panel.is-active {
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: 500px;
	border-radius: 3px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
	animation: giroppoFade 0.4s ease;
}
@keyframes giroppoFade {
	from { opacity: 0; transform: translateX(40px); }
	to { opacity: 1; transform: none; }
}
.giroppo-panel__photo {
	background-size: cover;
	background-position: center;
}
.giroppo-panel__body {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.08);
	padding: clamp(2rem, 5vw, 4rem);
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 1rem;
}
.giroppo-panel__close {
	align-self: flex-start;
	background: none;
	border: 0;
	color: var(--wp--preset--color--muted);
	font-size: 0.85rem;
	letter-spacing: 0.05em;
	cursor: pointer;
	padding: 0;
}
.giroppo-panel__close:hover {
	color: var(--wp--preset--color--gold);
}
.giroppo-panel__title {
	font-size: clamp(2rem, 4vw, 3rem);
	font-weight: 400;
	margin: 0;
}
.giroppo-panel__desc {
	color: var(--wp--preset--color--champagne);
	line-height: 1.8;
	margin: 0;
}
.giroppo-panel__cta {
	color: var(--wp--preset--color--gold);
	text-decoration: none;
	font-size: 0.95rem;
}
.giroppo-panel__cta:hover {
	color: var(--wp--preset--color--champagne);
}
@media (max-width: 781px) {
	.giroppo-cats__grid {
		grid-template-columns: 1fr;
		gap: 3rem;
	}
	.giroppo-cat {
		min-height: 380px;
	}
	.giroppo-panel.is-active {
		grid-template-columns: 1fr;
	}
	.giroppo-panel__photo {
		min-height: 220px;
	}
	/* No hover on touch: show the description by default */
	.giroppo-cat__desc {
		max-height: 200px;
		opacity: 1;
		margin-top: 0.9rem;
	}

	/* Mobile auto-rotation: stack vertically, show one card at a time,
	   JS advances to the next every 2s and loops. */
	.giroppo-cats.is-mobile-auto .giroppo-cats__grid {
		display: block;
	}
	.giroppo-cats.is-mobile-auto .giroppo-cat {
		display: none;
		width: 100%;
		min-height: 440px;
	}
	.giroppo-cats.is-mobile-auto .giroppo-cat.is-shown {
		display: flex;
		animation: giroppoFade 0.5s ease;
	}
}

/* ---------- Navigation underline animation ---------- */
.wp-block-navigation .wp-block-navigation-item__content {
	position: relative;
	padding-bottom: 2px;
}
.wp-block-navigation .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -2px;
	width: 0;
	height: 1px;
	background: var(--wp--preset--color--gold);
	transition: width var(--giroppo-transition);
}
.wp-block-navigation .wp-block-navigation-item__content:hover::after {
	width: 100%;
}

/* ---------- Language switcher ---------- */
.giroppo-lang-switcher {
	display: flex;
	gap: 0.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.giroppo-lang-switcher li {
	margin: 0;
}
.giroppo-lang-switcher a,
.giroppo-lang-switcher .lang-item span {
	color: var(--wp--preset--color--muted);
	text-decoration: none;
	transition: color var(--giroppo-transition);
}
.giroppo-lang-switcher a:hover {
	color: var(--wp--preset--color--gold);
}
.giroppo-lang-switcher .current-lang a,
.giroppo-lang-switcher .current-lang span {
	color: var(--wp--preset--color--off-white);
	font-weight: 600;
}

/* ---------- Cards (categories / posts) hover lift ---------- */
.giroppo-card {
	transition: transform var(--giroppo-transition), box-shadow var(--giroppo-transition);
	will-change: transform;
}
.giroppo-card:hover {
	transform: translateY(-6px);
}

/* Zoom image inside cover/image blocks marked as cards */
.giroppo-card .wp-block-image img,
.giroppo-card .wp-block-cover__image-background {
	transition: transform 0.6s ease;
}
.giroppo-card:hover .wp-block-image img,
.giroppo-card:hover .wp-block-cover__image-background {
	transform: scale(1.06);
}
.giroppo-card .wp-block-image,
.giroppo-card .wp-block-cover {
	overflow: hidden;
}

/* ---------- Hero spacing on small screens ---------- */
@media (max-width: 781px) {
	.wp-site-blocks > header.wp-block-template-part {
		/* IMPORTANT: backdrop-filter makes the header a containing block for
		   position:fixed descendants, which traps the mobile navigation overlay
		   inside the header height. Disable it on mobile so the menu can open
		   full-screen. */
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
	}
	/* Header row on phones: logo left, hamburger pinned to the right */
	.wp-site-blocks > header .wp-block-group.alignwide {
		flex-wrap: nowrap;
		justify-content: space-between;
	}
	.wp-site-blocks > header .wp-block-navigation {
		margin-left: auto;
	}

	/* Mobile slide-out menu: centred, comfortable spacing (override core's
	   32px gap + right alignment with !important). */
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
		flex: 1 1 auto;
		justify-content: center !important;
		align-items: center !important;
		width: 100%;
	}
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
		gap: 1rem !important;
		width: 100% !important;
		align-items: center !important;
		justify-content: center !important;
		text-align: center;
		padding-right: 0 !important;
	}
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
		width: 100% !important;
		justify-content: center !important;
		text-align: center !important;
	}
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		margin: 0 auto !important;
	}
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		font-size: 1.3rem;
		letter-spacing: 0.05em;
	}
}

/* Tour CTA inside the mobile menu overlay — only visible when the menu is open */
.giroppo-menu-cta {
	display: none;
}
.wp-block-navigation__responsive-container.is-menu-open .giroppo-menu-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 2.25rem;
	padding: 0.95rem 2.6rem;
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: 2px;
	white-space: nowrap;
	transition: background 0.3s ease;
}
.wp-block-navigation__responsive-container.is-menu-open .giroppo-menu-cta:hover {
	background: var(--wp--preset--color--champagne);
}

/* On phones, hide the redundant header CTA (the menu + hero CTA cover it),
   which is what caused the header to overflow horizontally. */
@media (max-width: 600px) {
	.wp-site-blocks > header .wp-block-buttons {
		display: none;
	}
	.wp-block-site-title {
		letter-spacing: 0.06em;
	}

	/* ROOT FIX: inner content of covers/sections sets max-width up to 760–920px
	   (the constrained contentSize). On phones that exceeds the viewport, so long
	   lines never wrap and get clipped. Force everything inside to fit the screen. */
	.wp-block-cover__inner-container *,
	.wp-block-group.is-layout-constrained > * {
		max-width: 100% !important;
	}
	.wp-block-cover__inner-container,
	.wp-block-group.is-layout-constrained {
		max-width: 100%;
	}

	/* Full-bleed FIX: cover blocks are display:flex, so the negative-margin
	   full-width trick does NOT expand their width (they stayed 32px short on the
	   right, shifting content left). Force true full-viewport width, centered. */
	.wp-block-cover.alignfull,
	.wp-block-group.alignfull {
		width: 100vw !important;
		max-width: 100vw !important;
		margin-left: calc(50% - 50vw) !important;
		margin-right: calc(50% - 50vw) !important;
		box-sizing: border-box;
	}

	/* Display headings: scale down so they wrap nicely instead of overflowing. */
	.has-huge-font-size {
		font-size: 2.3rem !important;
		line-height: 1.1 !important;
	}
	.has-xx-large-font-size {
		font-size: 1.85rem !important;
	}
	.has-x-large-font-size {
		font-size: 1.5rem !important;
	}
	.has-large-font-size {
		font-size: 1.15rem !important;
	}

	/* Let any long word break rather than push the layout wider. */
	h1, h2, h3, p, a, li {
		overflow-wrap: break-word;
	}
}

/* ---------- Footer link rows ---------- */
.giroppo-sns-links {
	display: flex;
	gap: 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
	flex-wrap: wrap;
}
.giroppo-sns-links li {
	margin: 0;
}

/* ---------- Buttons: equal height (filled + outline) ---------- */
/* Give every button a 1px border (transparent on the filled one) so the
   outline variant's border doesn't make it taller. Flex-center the label. */
.wp-block-button__link {
	border: 1px solid transparent;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}
.wp-block-buttons.is-layout-flex {
	align-items: stretch;
}
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--off-white);
	border: 1px solid var(--wp--preset--color--gold);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
}

/* ---------- Contact Form 7 styling to match theme ---------- */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="date"],
.wpcf7 input[type="number"],
.wpcf7 select,
.wpcf7 textarea {
	width: 100%;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(201, 168, 106, 0.35);
	border-radius: 2px;
	color: var(--wp--preset--color--off-white);
	padding: 0.85rem 1rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 1rem;
	margin-top: 0.35rem;
}
.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--gold);
	background: rgba(255, 255, 255, 0.07);
}
.wpcf7 label {
	display: block;
	font-size: 0.85rem;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--champagne);
	margin-bottom: 1.1rem;
}
.wpcf7 input[type="submit"] {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
	border: none;
	border-radius: 2px;
	padding: 0.9rem 2.5rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background var(--giroppo-transition);
}
.wpcf7 input[type="submit"]:hover {
	background: var(--wp--preset--color--champagne);
}

/* ---------- Custom (plugin-free) tour request form ---------- */
.giroppo-form {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}
.giroppo-form .giroppo-field {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}
.giroppo-form .giroppo-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.25rem;
}
@media (max-width: 600px) {
	.giroppo-form .giroppo-field-row {
		grid-template-columns: 1fr;
	}
}
.giroppo-form label {
	font-size: 0.8rem;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--champagne);
}
.giroppo-form label .req {
	color: var(--wp--preset--color--gold);
}
.giroppo-form input[type="text"],
.giroppo-form input[type="email"],
.giroppo-form input[type="number"],
.giroppo-form textarea {
	width: 100%;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(201, 168, 106, 0.35);
	border-radius: 2px;
	color: var(--wp--preset--color--off-white);
	padding: 0.85rem 1rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 1rem;
}
.giroppo-form input:focus,
.giroppo-form textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--gold);
	background: rgba(255, 255, 255, 0.07);
}
.giroppo-form .giroppo-submit {
	margin: 0.5rem 0 0;
}
.giroppo-form button[type="submit"] {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
	border: none;
	border-radius: 2px;
	padding: 0.95rem 2.75rem;
	font-family: var(--wp--preset--font-family--sans);
	font-weight: 600;
	font-size: 0.8rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background var(--giroppo-transition);
}
.giroppo-form button[type="submit"]:hover {
	background: var(--wp--preset--color--champagne);
}
/* Honeypot — visually hidden from humans */
.giroppo-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
/* Notices */
.giroppo-form-notice {
	border-radius: 2px;
	padding: 1rem 1.25rem;
	margin-bottom: 1.5rem;
	font-size: 0.95rem;
	line-height: 1.6;
}
.giroppo-form-notice.is-success {
	background: rgba(201, 168, 106, 0.12);
	border: 1px solid var(--wp--preset--color--gold);
	color: var(--wp--preset--color--champagne);
}
.giroppo-form-notice.is-error {
	background: rgba(235, 0, 27, 0.10);
	border: 1px solid #e0746a;
	color: #f0b8b2;
}
