/**
 * responsive.css — breakpoints.
 *
 * The layout is fluid to begin with, so these rules only handle the points
 * where a grid genuinely has to change shape.
 */

/* ------------------------------------------------- Large tablet and below */

@media (max-width: 1100px) {
	.site-footer__grid {
		grid-template-columns: 1fr 1fr;
		gap: var(--space-lg);
	}

	.services__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.service-feature {
		min-height: 320px;
	}

	.process__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--space-lg);
	}

	.process__list::before {
		display: none;
	}
}

/* -------------------------------------------------------- Tablet and below */

@media (max-width: 900px) {
	:root {
		--header-height: 72px;
	}

	/* The nav becomes an off-canvas drawer, opened by the hamburger and closed by the X inside it. */
	.nav-toggle {
		display: inline-flex;
		order: 3;
	}

	.site-nav {
		position: fixed;
		inset: 0 0 0 auto;
		z-index: 95;
		width: min(360px, 88vw);
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 0;
		padding: 0 0 calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
		background: var(--cream);
		box-shadow: var(--shadow-float);
		transform: translateX(100%);
		transition: transform 0.28s ease;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}

	.site-nav.is-open {
		transform: translateX(0);
	}

	/* Top bar with the title and a clearly visible close button. */
	.site-nav__top {
		position: sticky;
		top: 0;
		z-index: 1;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0.9rem var(--space-md);
		background: var(--cream);
		border-bottom: 1px solid var(--line);
	}

	.site-nav__title {
		font-family: var(--font-body);
		font-size: 0.75rem;
		font-weight: 700;
		letter-spacing: 0.22em;
		text-transform: uppercase;
		color: var(--gold);
	}

	.site-nav__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 46px;
		height: 46px;
		padding: 0;
		border: 1px solid var(--gold);
		border-radius: 50%;
		background: var(--white);
		color: var(--ink);
		cursor: pointer;
		transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
	}

	.site-nav__close:hover,
	.site-nav__close:focus-visible {
		background: var(--gold);
		color: #1f1b17;
		transform: rotate(90deg);
	}

	/* Each page is its own card, so Home, About, Services and Contact read as separate choices. */
	.site-nav__list {
		flex-direction: column;
		align-items: stretch;
		gap: 0.65rem;
		background: transparent;
		border-radius: 0;
		padding: var(--space-md);
	}

	.site-nav__list > li {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		background: var(--white);
		border: 1px solid var(--line);
		border-radius: var(--radius-md);
		overflow: hidden;
	}

	.site-nav__list > li > a {
		padding: 1rem 1.15rem;
		border-radius: 0;
		font-size: 1.3rem;
		white-space: normal;
	}

	.site-nav__list > li > a:hover,
	.site-nav__list > li > a:focus-visible {
		background: var(--cream);
	}

	/* The page you are on: a gold bar and a warm background. */
	.site-nav__list > .current-menu-item,
	.site-nav__list > .current_page_item,
	.site-nav__list > .current-menu-ancestor {
		border-color: var(--gold);
		box-shadow: inset 4px 0 0 var(--gold);
	}

	.site-nav__list > .current-menu-item > a,
	.site-nav__list > .current_page_item > a,
	.site-nav__list > .current-menu-ancestor > a {
		background: var(--cream);
	}

	/* A parent such as Services gets a tap target that opens its pages. */
	.submenu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 54px;
		padding: 0;
		border: 0;
		border-left: 1px solid var(--line);
		background: transparent;
		color: var(--gold);
		cursor: pointer;
	}

	.submenu-toggle svg {
		transition: transform 0.25s ease;
	}

	.menu-item.is-expanded > .submenu-toggle svg {
		transform: rotate(180deg);
	}

	.site-nav__list .sub-menu {
		position: static;
		grid-column: 1 / -1;
		display: none;
		min-width: 0;
		margin: 0;
		padding: 0.4rem 0.6rem 0.7rem;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		background: var(--cream);
		border-top: 1px solid var(--line);
		border-radius: 0;
	}

	.site-nav__list .menu-item.is-expanded > .sub-menu {
		display: block;
	}

	.site-nav__list .sub-menu a {
		display: block;
		padding: 0.75rem 0.9rem;
		border-radius: var(--radius-sm);
		font-family: var(--font-body);
		font-size: 0.975rem;
		color: var(--ink);
	}

	.site-nav__list .sub-menu a:hover,
	.site-nav__list .sub-menu a:focus-visible {
		background: var(--white);
	}

	.site-nav__list .sub-menu .current-menu-item > a {
		background: var(--white);
		box-shadow: inset 3px 0 0 var(--gold);
		font-weight: 600;
	}

	.site-nav__list .menu-item--all {
		display: block;
	}

	.site-nav__list .menu-item--all > a {
		font-weight: 700;
		color: var(--gold);
	}

	.site-nav__cta {
		width: auto;
		margin: 0 var(--space-md);
	}

	.hero__inner {
		grid-template-columns: minmax(0, 1fr);
		min-height: 0;
		gap: 0;
	}

	.hero__content {
		padding-block: var(--space-xl) var(--space-lg);
		max-width: none;
		text-align: center;
	}

	.hero__text {
		margin-inline: auto;
	}

	.hero__actions {
		justify-content: center;
	}

	.hero__image {
		max-height: 520px;
		margin-inline: auto;
	}

	.about__grid,
	.enquiry__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.about__media {
		order: -1;
		max-width: 520px;
		margin-inline: auto;
	}

	.services__cards {
		grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	}
}

/* -------------------------------------------------------- Phone and below */

@media (max-width: 640px) {
	.topbar__inner {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25rem;
		text-align: left;
	}

	.content-with-sidebar {
		grid-template-columns: minmax(0, 1fr);
	}

	.btn {
		padding: 0.95rem 1.6rem;
		letter-spacing: 0.16em;
	}

	.hero__actions .btn,
	.cta-band__actions .btn {
		width: 100%;
	}

	.stats__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--space-lg) var(--space-md);
	}

	.process__list {
		grid-template-columns: minmax(0, 1fr);
	}

	.services__cards {
		grid-template-columns: minmax(0, 1fr);
	}

	.enquiry-form__row {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
		margin-bottom: 0;
	}

	.enquiry-form__row .field {
		margin-bottom: 1.6rem;
	}

	.site-footer__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.site-footer__bottom {
		margin-top: var(--space-lg);
	}

	.search-form {
		flex-direction: column;
	}
}

/* ------------------------------------------------------------ Phone layout */

@media (max-width: 900px) {
	/*
	 * Every section that pairs text with a picture reads the same way on a phone:
	 * label, title, picture, then the content. The text column is dissolved
	 * (display: contents) so its title can sit above the picture and the rest below it.
	 */
	.page-intro__grid,
	.concerns__grid,
	.dentist__grid,
	.about__grid {
		display: flex;
		flex-direction: column;
		gap: var(--space-md);
	}

	.page-intro__content,
	.concerns__panel,
	.dentist__content,
	.about__content {
		display: contents;
	}

	.page-intro__content > *,
	.concerns__panel > *,
	.dentist__content > *,
	.about__content > * {
		order: 4;
		margin-block: 0;
	}

	.page-intro__content > .pill,
	.page-intro__content > .eyebrow,
	.concerns__panel > .pill,
	.dentist__content > .pill,
	.about__content > .pill,
	.about__content > .eyebrow {
		order: 1;
		align-self: flex-start;
		margin-bottom: 0;
	}

	.page-intro__content > .page-intro__title,
	.concerns__panel > .concerns__title,
	.dentist__content > .dentist__title,
	.about__content > .section-title {
		order: 2;
	}

	.page-intro__media,
	.concerns__media,
	.dentist__media,
	.about__media {
		order: 3;
	}

	.page-intro__content > .btn,
	.about__content > .btn {
		align-self: flex-start;
	}

	/* Pictures keep a sensible height instead of filling the screen. */
	.page-intro__media .page-intro__image,
	.page-intro--cream .page-intro__media .page-intro__image {
		width: 100%;
		height: auto;
		max-height: 420px;
		object-fit: cover;
	}

	.concerns__media .concerns__image {
		width: 100%;
		height: auto;
		max-height: 340px;
		object-fit: cover;
	}

	.dentist__media .dentist__image {
		max-height: 420px;
	}

	.about__media .about__image {
		width: 100%;
		max-height: 460px;
		object-fit: cover;
		object-position: top;
	}

	/*
	 * The band under the Home banner scrolls sideways with a swipe. (Visitors who ask for less motion
	 * got the items stacked in a column before; now they get the same swipeable row.)
	 */
	.ticker__viewport {
		overflow-x: auto;
		overflow-y: hidden;
		overscroll-behavior-x: contain;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.ticker__viewport::-webkit-scrollbar {
		display: none;
	}

	.ticker__track {
		animation: none;
		width: max-content;
		justify-content: flex-start;
	}

	.ticker__list {
		flex-wrap: nowrap;
		justify-content: flex-start;
		padding: 1.1rem 1rem 1.1rem 0;
	}
}

/* ----------------------------------------------------------------- Print */

@media print {
	.site-header,
	.site-footer,
	.ticker,
	.nav-toggle,
	.skip-link,
	.enquiry__card {
		display: none !important;
	}

	body {
		color: #000;
		background: #fff;
	}
}
