/* ==========================================================================
   Avanzato — responsive behaviour

   The one-screen rule holds on laptops and desktops. Below that, a phone
   simply cannot show a five-column team grid legibly, so the stage releases
   its height and the page scrolls — the luxury language stays, the content
   stops fighting the viewport.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Large desktops — let the type breathe
   -------------------------------------------------------------------------- */

@media (min-width: 1800px) {
	:root {
		--avz-gutter: clamp(60px, 5vw, 120px);
	}
}

/* --------------------------------------------------------------------------
   Short windows (laptops at 1280×720 and below)
   -------------------------------------------------------------------------- */

/* A short window cannot fit five lines of bio in the card, and a box that
   holds four and a half cuts the last one through the middle. */
@media (max-height: 820px) {
	.avz-member__bio {
		-webkit-line-clamp: 4;
		line-clamp: 4;
	}
}

@media (max-height: 760px) {
	:root {
		--avz-header-h: clamp(62px, 9vh, 86px);
		--avz-footer-h: clamp(40px, 6vh, 52px);
	}

	.avz-member__bio {
		font-size: 0.74rem;
		line-height: 1.42;
	}

	.avz-quote__text {
		font-size: 0.78rem;
	}

	/* Short windows leave the service list room to spare once the header and
	   footer shrink, so the rows take some of it back. */
	.avz-service__thumb,
	.avz-service__thumb img {
		height: clamp(56px, 8vh, 68px) !important;
	}
}

/* --------------------------------------------------------------------------
   Tablet landscape and small laptops
   -------------------------------------------------------------------------- */

@media (max-width: 1280px) {
	/* The products carousel stays two-up at every desktop width — the design
	   shows a pair — so only the channel between them narrows. */
	.avz-slider--products .avz-slider__track {
		--avz-card-gap: clamp(20px, 3vw, 48px);
	}

	.avz-service {
		grid-template-columns: auto auto 1fr auto auto;
	}

	/* The thumbnail is the first thing to go when space is tight. */
	.avz-service__thumb {
		display: none;
	}

	/* Without it the row would collapse to the height of its text, so the
	   padding takes over setting the row's height here. */
	.avz-service {
		padding-block: clamp(14px, 2.4vh, 26px);
	}
}

@media (max-width: 1100px) {
	/* The products track sizes its columns from its own gap variable, so it
	   is left to do that. */
	.avz-slider:not(.avz-slider--products) .avz-slider__track {
		grid-auto-columns: 50%;
	}

	.avz-services {
		gap: clamp(12px, 2vw, 24px) !important;
	}

	.avz-hero__copy {
		max-width: 26ch;
	}
}

/* --------------------------------------------------------------------------
   Tablet portrait and below — the page is allowed to scroll
   -------------------------------------------------------------------------- */

@media (max-width: 980px) {
	body.avz {
		overflow: auto;
		overscroll-behavior: auto;
	}

	.wp-site-blocks {
		max-height: none;
		min-height: 100dvh;
		overflow: visible;
	}

	.wp-site-blocks > main {
		overflow: visible;
	}

	.avz-stage {
		height: auto;
		min-height: calc(100dvh - var(--avz-header-h) - var(--avz-footer-h));
		overflow: visible;
		padding-block: clamp(28px, 6vh, 56px);
	}

	/* The fit-guard is for fixed viewports only; never scale on mobile. */
	.avz-stage.is-fitted {
		transform: none;
	}

	.avz-fill {
		flex: 0 1 auto;
	}

	.avz-watermark {
		display: none;
	}

	/* Header: the nav collapses to the core overlay menu, and the three-column
	   grid gives way to a simple row. */
	.avz-header {
		height: auto;
		min-height: var(--avz-header-h);
		padding-block: 12px;
		display: flex;
		flex-wrap: wrap;
		gap: 10px;
	}

	.avz-header--overlay {
		position: relative;
		background: var(--wp--preset--color--ink);
	}

	/* The menu toggle sits beside the logo rather than on its own row. */
	.avz-header {
		flex-wrap: nowrap;
		justify-content: space-between;
	}

	.avz-header__nav {
		order: 2;
		flex: 0 0 auto;
		justify-content: flex-end;
	}

	.avz-header__tools {
		order: 3;
	}

	.avz-nav li + li::before {
		margin-inline: 10px;
	}

	/* Core paints the overlay sheet white; this is a dark site. */
	.wp-block-navigation__responsive-container.is-menu-open {
		background: var(--wp--preset--color--ink);
		padding-top: clamp(70px, 14vh, 120px);
	}

	.wp-block-navigation__responsive-container.is-menu-open,
	.wp-block-navigation__responsive-container.is-menu-open a,
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content,
	.wp-block-navigation__responsive-container-close {
		color: var(--wp--preset--color--champagne);
	}

	.wp-block-navigation__responsive-container.is-menu-open [aria-current="page"] {
		color: var(--wp--preset--color--gold-light);
	}

	/* The overlay menu is the only navigation on a phone, so it is set at
	   reading size rather than at the slim weight the desktop bar carries. */
	.wp-block-navigation__responsive-container.is-menu-open .avz-nav a,
	.wp-block-navigation__responsive-container.is-menu-open a,
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		font-size: 1.15rem;
		letter-spacing: 0.16em;
		padding-block: 0.6em;
	}

	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
		gap: 0.5rem;
	}

	/* The six links sat in the top third with the rest of the sheet empty. */
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
		justify-content: center;
		min-height: 72vh;
	}

	/* Columns stack. */
	.wp-block-columns.avz-team,
	.wp-block-columns.avz-services,
	.wp-block-columns.avz-contact,
	.wp-block-columns.avz-about,
	.wp-block-columns.avz-book {
		flex-wrap: wrap !important;
		gap: clamp(18px, 4vh, 36px) !important;
	}

	/* Two team cards per row. WordPress core stacks every column at 781px
	   with its own !important rule, so this is scoped through .avz-stage to
	   outrank it — core's stylesheet is printed after the theme's. */
	.avz-stage .wp-block-columns.avz-team > .wp-block-column {
		/* Each column gives back HALF the row gap — a full gap each left the
		   pair narrower than the row and the right gutter twice the left. */
		flex-basis: calc(50% - clamp(18px, 4vh, 36px) / 2) !important;
		flex-grow: 0 !important;
	}

	/* "Book An Appointment" no longer fits beside the full nav here, and
	   every page carries the same call to action in its content. The whole
	   tools box goes, not just the button — an empty box still takes a slot
	   in the header row and leaves the menu stranded short of the gutter. */
	.avz-header .avz-header__tools,
	.avz-header .avz-header__cta {
		display: none;
	}

	.avz-header__nav {
		margin-left: auto;
	}

	.wp-block-columns.avz-services > .wp-block-column,
	.wp-block-columns.avz-contact > .wp-block-column,
	.wp-block-columns.avz-about > .wp-block-column,
	.wp-block-columns.avz-book > .wp-block-column {
		flex-basis: 100% !important;
	}

	.avz-contact__spacer {
		display: none;
	}

	/* The desktop panel is nudged below its column's midline; in the stacked
	   layout there is no column to sit below, so it would just add a gap. */
	.avz-appointment {
		translate: none;
	}

	/* The category tabs become a single swipeable strip rather than wrapping
	   into a ragged second row. */
	/* The categories wrap onto as many rows as they need. A no-wrap scroll
	   strip was tried here and widened the page instead: nothing in the
	   stacked column chain gives the strip a definite width to scroll within. */
	.avz-tabs__list {
		flex-wrap: wrap;
		justify-content: flex-start;
		row-gap: 2px !important;
	}

	.avz-tabs__list .avz-tab {
		flex: 0 0 auto;
	}

	.avz-stage--contact .avz-stage__backdrop::after,
	.avz-stage--services .avz-stage__backdrop::after {
		background: rgba(2, 17, 33, 0.86);
	}

	/* The page scrolls here, so a card has no fixed height for the portrait
	   to take a share of — it takes a ratio instead, and the bio sits at its
	   own height rather than being squeezed to a fraction of a line. */
	.avz-member__media {
		flex: 0 0 auto;
		aspect-ratio: 4 / 3;
	}

	.avz-member__bio {
		flex: 0 0 auto;
		-webkit-line-clamp: 4;
		line-clamp: 4;
	}

	/* The portrait stops filling the stage and becomes a plain landscape
	   image above the copy. */
	.avz-about__portrait {
		height: auto;
	}

	.avz-about__portrait img {
		height: auto;
		aspect-ratio: 4 / 3;
	}

	.avz-book__shot {
		height: clamp(260px, 42vh, 420px);
	}

	/* The header is back in the flow here, so the hero must not reserve
	   space for it a second time. */
	.avz-hero-cover .wp-block-cover__inner-container {
		padding-top: clamp(28px, 5vh, 56px);
		gap: clamp(28px, 5vh, 56px);
	}

	.avz-hero-cover {
		min-height: clamp(520px, 72vh, 760px) !important;
	}

	.avz-hero__copy {
		max-width: 100%;
	}
}

/* --------------------------------------------------------------------------
   Phones
   -------------------------------------------------------------------------- */

@media (max-width: 680px) {
	:root {
		--avz-gutter: 20px;
		/* The logo takes its height from this, so the bar carries it. */
		--avz-header-h: 78px;
		--avz-footer-h: auto;
	}

	.avz-header__brand img,
	.avz-header__brand .custom-logo {
		width: auto;
	}

	/* With the CTA hidden the tools box holds nothing, and space-between then
	   parked the menu button in the middle of the bar. */
	.avz-header .avz-header__tools {
		display: none;
	}

	.avz-header__nav {
		margin-left: auto;
	}

	/* Three lines is what a phone card has room for. */
	.avz-member__bio {
		-webkit-line-clamp: 3;
		line-clamp: 3;
	}

	/* The header CTA is the one thing that must stay reachable. */
	.avz-header__tools {
		gap: 10px;
	}

	.avz-header__cta .wp-block-button__link {
		padding: 0.7em 1.1em;
		font-size: 0.66rem;
		white-space: nowrap;
	}

	.wp-block-columns.avz-team > .wp-block-column {
		flex-basis: 100% !important;
	}

	.avz-member {
		max-width: 420px;
		margin-inline: auto;
	}

	.avz-member__media {
		aspect-ratio: 16 / 10;
	}

	.avz-slider__track {
		grid-auto-columns: 86%;
		gap: 14px;
	}

	/* One product fills the view here. The desktop track is capped at 520px
	   at its narrowest, which is wider than the phone, and an 86% column left
	   a sliver of the next card under the cart button. */
	.avz-slider--products .avz-slider__track {
		max-width: none;
		grid-auto-columns: 100%;
		gap: 14px;
	}

	/* The desktop card crops into the bottle to fill a short panel; at this
	   width the card is tall enough to show the shot as it is. */
	.avz-slider--products .avz-product__media img {
		scale: 1;
	}

	/* Contact centres on a phone — left-aligned it left half the screen empty.
	   Each icon row stays an inline block so its icon keeps its own left edge
	   while the stack as a whole sits on the centre line. */
	.avz-stage--contact .avz-page-head,
	.avz-stage--contact .avz-lede,
	.avz-stage--contact .avz-contact__details,
	.avz-stage--contact .avz-contact__hours-title {
		text-align: center;
	}

	.avz-stage--contact .avz-lede {
		margin-inline: auto;
	}

	.avz-stage--contact .avz-contact__row,
	.avz-stage--contact .avz-hours {
		display: inline-block;
		text-align: left;
	}

	.avz-stage--contact .is-style-avz-rule {
		margin-inline: auto;
	}

	.avz-quote {
		border-left: 0;
	}

	.avz-slider__arrow {
		display: none;
	}

	.avz-hero__title {
		font-size: clamp(1.9rem, 9vw, 2.8rem);
	}

	.avz-hero__actions,
	.avz-about__actions,
	.avz-book__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.avz-hero__actions .wp-block-button,
	.avz-about__actions .wp-block-button,
	.avz-book__actions .wp-block-button {
		width: 100%;
	}

	.avz-hero__actions .wp-block-button__link,
	.avz-about__actions .wp-block-button__link,
	.avz-book__actions .wp-block-button__link {
		display: block;
		text-align: center;
	}

	/* The service row becomes a two-line card. */
	.avz-service {
		grid-template-columns: auto 1fr auto;
		grid-template-areas:
			"mark name  price"
			"mark meta  action";
		row-gap: 6px !important;
		padding: 10px 12px;
	}

	.avz-service::before   { grid-area: mark; }
	.avz-service__name     { grid-area: name; }
	.avz-service__meta     { grid-area: meta; }
	.avz-service__price    { grid-area: price; border-left: 0; padding-left: 0; text-align: right; }
	.avz-service__action   { grid-area: action; justify-self: end; }

	.avz-tabs__list {
		justify-content: flex-start;
	}

	.avz-tab--brand {
		padding-inline: 18px;
	}

	/* Footer stacks into a centred column. */
	.avz-footer {
		height: auto;
		/* Back to a single centred column; the desktop footer is a grid. */
		display: flex;
		flex-direction: column;
		gap: 10px;
		padding-block: 16px;
		text-align: center;
	}

	.avz-footer__motto::before,
	.avz-footer__motto::after {
		width: 20px;
	}

	.avz-search-panel {
		right: 0;
		left: 0;
		width: auto;
		margin-inline: var(--avz-gutter);
	}

	.avz-search-form {
		flex-direction: column;
	}

	.avz-splash-logo {
		width: min(62vw, 240px);
	}
}

/* --------------------------------------------------------------------------
   Small phones
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
	/* "Book An Appointment" cannot fit beside the logo and the menu here,
	   and the hero carries the same call to action just below.
	   Scoped to .avz-header to outrank WordPress's own layout styles,
	   which are printed after the theme's stylesheets. */
	.avz-header .avz-header__cta {
		display: none;
	}

	.avz-hero__title {
		font-size: clamp(1.7rem, 8.4vw, 2.3rem);
	}

	.avz-page-head__title {
		font-size: clamp(1.6rem, 8vw, 2.2rem);
	}
}

/* --------------------------------------------------------------------------
   Touch devices — hover effects should not stick
   -------------------------------------------------------------------------- */

@media (hover: none) {
	.avz-member:hover {
		transform: none;
	}

	.avz-member:hover .avz-member__media img {
		transform: none;
	}

	.avz-cta::after {
		display: none;
	}
}

/* --------------------------------------------------------------------------
   Print — a plain, readable fallback
   -------------------------------------------------------------------------- */

@media print {
	body.avz,
	.wp-site-blocks,
	.avz-stage {
		overflow: visible;
		height: auto;
		max-height: none;
		background: #fff;
		color: #000;
	}

	.avz-header__tools,
	.avz-slider__arrow,
	.avz-slider__dots,
	.avz-watermark,
	.avz-stage__backdrop {
		display: none;
	}
}
