/**
 * Responsive layer for Location, Service, Bridal, About, Pricing templates.
 * Loaded after each template’s base CSS. Mobile-first → tablet → desktop.
 */

@supports (padding: max(0px)) {
	main.nm-subpage {
		padding-left: max(0px, env(safe-area-inset-left));
		padding-right: max(0px, env(safe-area-inset-right));
	}
}

/* Shell is full-bleed in each template CSS (same pattern as homepage). */

/* Admin bar: keep pricing toolbar below WP bar */
@media screen and (max-width: 782px) {
	body.admin-bar .nm-pricing .pricing-toolbar {
		top: 102px;
	}
}

@media screen and (min-width: 783px) {
	body.admin-bar .nm-pricing .pricing-toolbar {
		top: 88px;
	}
}

/* ── Hero CTAs: side-by-side from small tablet; stack on narrow phones ─ */
@media (max-width: 479px) {
	.nm-subpage .hero-ctas {
		flex-direction: column;
	}

	.nm-subpage .hero-ctas .btn-primary,
	.nm-subpage .hero-ctas .btn-secondary {
		flex: none;
		width: 100%;
	}
}

@media (min-width: 480px) {
	.nm-subpage .hero-ctas {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
		max-width: 100%;
		width: 100%;
		box-sizing: border-box;
	}

	.nm-subpage .hero-ctas .btn-primary,
	.nm-subpage .hero-ctas .btn-secondary {
		flex: unset;
		min-width: 0;
		text-align: center;
		white-space: nowrap;
		padding-left: 12px;
		padding-right: 12px;
	}
}

/* ── Desktop hero: readable measure, left-aligned to content shell ─── */
@media (min-width: 900px) {
	/*
	 * Hero text is left-aligned, so it only needs the big gutter on the left.
	 * With the gutter on both sides plus border-box, wide screens (1600px+)
	 * squeezed the text to one word per line. Content-box keeps the max-width
	 * as the text measure, whatever the gutter is.
	 */
	.nm-subpage .hero-title,
	.nm-subpage .hero-sub,
	.nm-subpage .hero-intro {
		box-sizing: content-box;
		padding-right: var(--pad-x, clamp(20px, 4vw, 48px));
	}

	.nm-subpage .hero-sub,
	.nm-subpage .hero-intro {
		max-width: 36em;
	}

	.nm-subpage .hero-ctas {
		display: grid;
		grid-template-columns: auto auto;
		width: fit-content;
		max-width: 100%;
		gap: 12px;
	}

	.nm-subpage .hero-ctas .btn-primary,
	.nm-subpage .hero-ctas .btn-secondary {
		flex: unset;
		min-width: unset;
	}
}

/* Location hero: full content width for longer one-line labels */
@media (min-width: 480px) {
	.nm-location .hero-ctas {
		max-width: min(var(--section-max, 1200px), 100%);
	}
}

/* ── Typography: comfortable line length on large screens ───────────── */
@media (min-width: 900px) {
	.nm-subpage .section-body,
	.nm-subpage .body-text,
	.nm-subpage .header-body {
		max-width: 42em;
	}

	/* Team intro: allow full width within section padding (longer salon copy) */
	.nm-location .team-section > .section-body {
		max-width: none;
	}
}

/* ── Location: info strip stacks on very narrow phones ──────────────── */
@media (max-width: 380px) {
	.nm-location .info-strip {
		grid-template-columns: 1fr;
	}

	.nm-location .info-item {
		border-right: none;
		border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	}

	.nm-location .info-item:last-child {
		border-bottom: none;
	}
}

/* ── Location: team → grid on tablet+ ─────────────────────────────── */
@media (min-width: 768px) {
	.nm-location .team-scroll {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 12px;
		overflow-x: visible;
		padding-left: var(--gutter);
		padding-right: var(--gutter);
		padding-bottom: 8px;
		scroll-snap-type: none;
	}

	.nm-location .team-card {
		flex: initial;
		scroll-snap-align: unset;
	}
}

/* ── Location: areas grid ──────────────────────────────────────────── */
@media (min-width: 520px) {
	.nm-location .areas-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 900px) {
	.nm-location .areas-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* ── Location: directions → 2×2 then row of 4 ──────────────────────── */
@media (min-width: 520px) {
	.nm-location .directions-grid {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 2px;
	}
}

@media (min-width: 900px) {
	.nm-location .directions-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* ── Location: reviews → 2 columns ─────────────────────────────────── */
@media (min-width: 768px) {
	.nm-location .review-cards {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 12px;
		align-items: stretch;
	}
}

@media (max-width: 480px) {
	.nm-location .google-summary {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}
}

/* ── Location: other location pills → row on wide ──────────────────── */
@media (min-width: 768px) {
	.nm-location .location-pills {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 2px;
	}
}

/* ── Location: gallery stays centred in wide shell ─────────────────── */
@media (min-width: 900px) {
	.nm-location .gallery-section .gallery-grid {
		margin-left: auto;
		margin-right: auto;
		max-width: min(100%, 56rem);
	}
}

/* ── Service: intro stats don’t crush on tiny screens ──────────────── */
@media (max-width: 360px) {
	.nm-service .intro-stats {
		grid-template-columns: 1fr;
		gap: 8px;
	}
}

@media (min-width: 768px) {
	.nm-service .intro-stats {
		max-width: 28rem;
		margin-left: auto;
		margin-right: auto;
	}
}

/* ── Service: method detail grid ───────────────────────────────────── */
@media (max-width: 420px) {
	.nm-service .method-detail-grid {
		grid-template-columns: 1fr;
	}
}

/* ── Service: gallery mosaic + Instagram bar share the same edges ── */
@media (min-width: 900px) {
	.nm-service .gallery-mosaic {
		margin-left: max(var(--gutter), calc((100% - 56rem) / 2));
		margin-right: max(var(--gutter), calc((100% - 56rem) / 2));
	}

	.nm-service .gallery-footer {
		padding-left: max(var(--gutter), calc((100% - 56rem) / 2));
		padding-right: max(var(--gutter), calc((100% - 56rem) / 2));
	}
}

/* ── Service / shared: FAQ & review columns ────────────────────────── */
@media (min-width: 768px) {
	.nm-service .review-cards,
	.nm-service .faq-list {
		max-width: 48rem;
		margin-left: auto;
		margin-right: auto;
	}
}

/* ── Bridal: two-col form rows stack on narrow ────────────────────── */
@media (max-width: 480px) {
	.nm-bridal .form-row.two-col {
		grid-template-columns: 1fr;
	}
}

@media (min-width: 768px) {
	.nm-bridal .planning-form {
		max-width: none;
		margin-left: 0;
		margin-right: 0;
	}
}

/* ── About: numbers grid → flexible columns ───────────────────────── */
@media (min-width: 768px) {
	.nm-about .numbers-grid {
		grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
		gap: 12px;
	}
}

@media (min-width: 768px) {
	.nm-about .press-grid {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: 2px;
	}
}

/* About: Neil portrait + bio side-by-side on desktop */
@media (min-width: 768px) {
	.nm-about .neil-section {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(280px, min(42vw, 480px));
		column-gap: clamp(32px, 5vw, 64px);
		align-items: center;
		padding: 72px var(--gutter);
	}

	.nm-about .neil-content {
		grid-column: 1;
		grid-row: 1;
		padding: 0;
	}

	.nm-about .neil-img {
		grid-column: 2;
		grid-row: 1;
		width: 100%;
		max-width: 480px;
		justify-self: end;
		aspect-ratio: 4 / 5;
		max-height: min(88vh, 640px);
		align-self: center;
	}

	.nm-about .neil-img img {
		display: block;
	}
}

@media (min-width: 1024px) {
	.nm-about .neil-section {
		padding: 88px var(--gutter);
		column-gap: 64px;
	}
}

@media (min-width: 768px) {
	.nm-location .services-section-actions {
		flex-direction: row;
		flex-wrap: wrap;
		max-width: 32rem;
	}

	.nm-location .service-book-cta,
	.nm-location .service-pricing-link {
		flex: 1 1 200px;
	}

	.nm-service .pricing-section-actions {
		flex-direction: row;
		flex-wrap: wrap;
		max-width: 32rem;
	}

	.nm-service .pricing-cta,
	.nm-service .pricing-link {
		flex: 1 1 200px;
	}
}

/* ── Pricing: scale content on tablet / desktop ───────────────────── */
@media (min-width: 768px) {
	.nm-pricing .price-section-header,
	.nm-pricing .price-section-note,
	.nm-pricing .price-list,
	.nm-pricing .section-cta {
		width: min(100%, 48rem);
		margin-left: auto;
		margin-right: auto;
	}

	.nm-pricing .price-row {
		padding-left: 28px;
		padding-right: 28px;
		gap: 20px;
	}

	.nm-pricing .price-row-name {
		font-size: 17px;
	}

	.nm-pricing .price-amount {
		font-size: 20px;
	}

	.nm-pricing .tier-cards,
	.nm-pricing .included-grid {
		max-width: 48rem;
		margin-left: auto;
		margin-right: auto;
	}

	.nm-pricing .callout-btns {
		flex-direction: row;
		flex-wrap: wrap;
		max-width: 32rem;
		gap: 10px;
	}

	.nm-pricing .callout-btn-primary,
	.nm-pricing .callout-btn-secondary {
		flex: 1 1 200px;
	}

	.nm-pricing .faq-section .faq-list,
	.nm-pricing .faq-section .section-title,
	.nm-pricing .faq-section > .eyebrow {
		max-width: 48rem;
		margin-left: auto;
		margin-right: auto;
	}
}

@media (min-width: 1024px) {
	.nm-pricing .pricing-controls-inner {
		width: min(100%, var(--section-max));
		margin-left: auto;
		margin-right: auto;
	}

	.nm-pricing .page-header .header-body,
	.nm-pricing .page-header .header-note {
		max-width: 36rem;
	}

	.nm-pricing .price-section-header,
	.nm-pricing .price-section-note,
	.nm-pricing .price-list,
	.nm-pricing .section-cta {
		width: min(100%, var(--section-max));
	}

	.nm-pricing .price-row {
		padding: 18px 40px;
		gap: 32px;
	}

	.nm-pricing .price-row-name {
		font-size: 19px;
	}

	.nm-pricing .price-row-detail {
		font-size: 11px;
		max-width: 36em;
	}

	.nm-pricing .price-amount {
		font-size: 24px;
	}

	.nm-pricing .price-qualifier {
		font-size: 9px;
	}

	.nm-pricing .faq-section .faq-list,
	.nm-pricing .faq-section .section-title,
	.nm-pricing .faq-section > .eyebrow {
		max-width: var(--section-max);
	}
}

@media (min-width: 1200px) {
	.nm-pricing .price-list {
		border-left: 1px solid var(--ltgrey);
		border-right: 1px solid var(--ltgrey);
	}

	.nm-pricing .price-row-right {
		min-width: 7rem;
	}
}

/* ── Contact: readable measure + stacked form on narrow ─────────── */
@media (max-width: 599px) {
	.nm-contact .salon-grid {
		grid-template-columns: 1fr;
	}
}

@media (min-width: 900px) {
	.nm-contact .contact-lead {
		max-width: 38rem;
	}

	.nm-contact .contact-form-intro {
		max-width: none;
	}
}

@media (min-width: 960px) and (max-width: 1099px) {
	.nm-contact .contact-form-section .contact-section-title {
		font-size: 1.45rem;
	}
}

/* ── Block editor content: images & embeds ─────────────────────────── */
.nm-subpage .entry-content img,
.nm-subpage .entry-content video,
.nm-subpage .entry-content iframe {
	max-width: 100%;
	height: auto;
}

.nm-subpage .entry-content .wp-block-embed__wrapper {
	position: relative;
	width: 100%;
}

