/* ==========================================================================
 * Surfaces — the site's geometry and depth layer (v1).
 *
 * Moves the interface from hard rectangles to a calm, layered, iOS-informed
 * surface language without touching the palette: every colour below is an
 * existing brand colour at a different opacity.
 *
 * Loaded last (after every component stylesheet), so it can be removed in
 * one step: drop the enqueue in functions.php and the site is unchanged.
 *
 * Principles
 * - One radius scale. Nested shapes are concentric: inner = outer − inset.
 * - The theme's corner marks become arcs that follow the rounded corner.
 * - Depth from two-step soft shadows and a hairline, not from heavy borders.
 * - Glass only where something floats over imagery or content: the header,
 *   the hero quote panel, the mobile booking bar.
 * - Smaller screens get smaller radii, shadows and blur.
 * ======================================================================= */

:root {
	/* Radius scale */
	--r-xs: 6px;    /* tags, tiny controls */
	--r-sm: 10px;   /* buttons, inputs */
	--r-md: 14px;   /* cards, list items */
	--r-lg: 20px;   /* panels, large cards */
	--r-xl: 26px;   /* image plates, feature surfaces */

	/* Hairlines (teal-deep and gold at low opacity) */
	--hair: rgba(31, 68, 66, .10);
	--hair-strong: rgba(31, 68, 66, .16);
	--hair-gold: rgba(180, 146, 79, .30);

	/* Surfaces (paper and ivory with translucency) */
	--surface: rgba(255, 253, 249, .86);
	--surface-solid: #FFFDF9;
	--surface-glass: rgba(250, 247, 242, .72);
	--glass-blur: blur(18px) saturate(1.15);

	/* Elevation — warm-neutral shadows tinted with teal-deep */
	--shadow-1: 0 1px 2px rgba(31, 44, 42, .05), 0 2px 8px rgba(31, 44, 42, .04);
	--shadow-2: 0 1px 2px rgba(31, 44, 42, .05), 0 8px 24px rgba(31, 44, 42, .07);
	--shadow-3: 0 2px 4px rgba(31, 44, 42, .06), 0 18px 48px rgba(31, 44, 42, .12);
	--shadow-dark: 0 2px 4px rgba(16, 34, 33, .18), 0 16px 40px rgba(16, 34, 33, .22);
	--inner-light: inset 0 1px 0 rgba(255, 255, 255, .7);

	/* Motion */
	--ease-ios: cubic-bezier(.32, .72, 0, 1);
	--t-fast: .18s;
	--t-base: .28s;
}

@media (max-width: 768px) {
	:root {
		--r-md: 12px;
		--r-lg: 16px;
		--r-xl: 20px;
		--shadow-2: 0 1px 2px rgba(31, 44, 42, .05), 0 6px 16px rgba(31, 44, 42, .06);
		--shadow-3: 0 2px 4px rgba(31, 44, 42, .06), 0 12px 28px rgba(31, 44, 42, .10);
		--glass-blur: blur(12px) saturate(1.1);
	}
}

/* --------------------------------------------------------------------------
 * Controls
 * ----------------------------------------------------------------------- */

.btn,
.apprx-more,
.hwt-more,
.dplate-btn,
.nav-panel-cta,
.mobile-cta .btn {
	border-radius: var(--r-sm);
	transition: background-color var(--t-fast) ease, color var(--t-fast) ease,
		border-color var(--t-fast) ease, box-shadow var(--t-base) var(--ease-ios),
		transform var(--t-base) var(--ease-ios);
}

.btn::before,
.btn::after {
	border-radius: calc(var(--r-sm) - 3px);
}

.btn:hover,
.apprx-more:hover,
.hwt-more:hover {
	transform: translateY(-1px);
	box-shadow: var(--shadow-2);
}

.btn:active,
.apprx-more:active,
.hwt-more:active {
	transform: translateY(0);
	box-shadow: var(--shadow-1);
	transition-duration: .08s;
}

.btn:focus-visible,
.apprx-more:focus-visible,
.hwt-more:focus-visible {
	outline-offset: 3px;
	border-radius: var(--r-sm);
}

.menu-toggle,
.nav-close {
	border-radius: var(--r-sm);
}

/* Section markers and image ring stay circles; nodes stay round. */

/* --------------------------------------------------------------------------
 * Header — the existing glass bar, refined
 * ----------------------------------------------------------------------- */

.site-header {
	box-shadow: 0 1px 0 var(--hair);
	transition: box-shadow var(--t-base) var(--ease-ios), background-color var(--t-base) ease;
}

body.is-scrolled .site-header {
	box-shadow: 0 1px 0 var(--hair), 0 8px 24px rgba(31, 44, 42, .06);
}

/* Navigation panel: a sheet with rounded leading corners on tablets. */
@media (max-width: 1279px) and (min-width: 601px) {
	.site-nav {
		border-radius: var(--r-xl) 0 0 var(--r-xl);
	}
}

/* --------------------------------------------------------------------------
 * Opening hero — the quote panel floats over the photograph as glass
 * ----------------------------------------------------------------------- */

.photo-placeholder {
	border-radius: var(--r-xl);
	box-shadow: var(--shadow-1);
}

/* Plate (26) → portrait track at 9px inset (17) → photograph at 17px inset (9). */
.photo-placeholder .doctor-portraits {
	border-radius: calc(var(--r-xl) - 9px);
}

.photo-placeholder .hero-photo,
.photo-placeholder .hero-photo img {
	border-radius: calc(var(--r-xl) - 17px);
}

/* Four drafting corners: ::before/::after of the plate sit at the top,
   ::before/::after of .corner at the bottom. Each arc follows its own corner. */
.photo-placeholder::before { border-top-left-radius: calc(var(--r-xl) - 8px); }
.photo-placeholder::after  { border-top-right-radius: calc(var(--r-xl) - 8px); }
.photo-placeholder .corner::before { border-bottom-left-radius: calc(var(--r-xl) - 8px); }
.photo-placeholder .corner::after  { border-bottom-right-radius: calc(var(--r-xl) - 8px); }

.opening-hero__panel {
	border-radius: var(--r-lg);
	border-color: rgba(255, 255, 255, .55);
	background: var(--surface-glass);
	-webkit-backdrop-filter: var(--glass-blur);
	backdrop-filter: var(--glass-blur);
	box-shadow: var(--inner-light), var(--shadow-3);
}

.opening-hero__panel::before { border-top-left-radius: calc(var(--r-lg) - 9px); }
.opening-hero__panel::after  { border-top-right-radius: calc(var(--r-lg) - 9px); }
.opening-hero__corners::before { border-bottom-left-radius: calc(var(--r-lg) - 9px); }
.opening-hero__corners::after  { border-bottom-right-radius: calc(var(--r-lg) - 9px); }

/* --------------------------------------------------------------------------
 * Drafting corner marks that follow the curve
 *
 * Components draw their corner brackets as four straight gradient strokes,
 * which cannot bend. Here the same pseudo-element becomes a full rounded
 * hairline frame, and a mask keeps only a square at each corner — so every
 * bracket is an arc plus two short straight tails, concentric with the
 * surface it sits in. --mark is the size of that corner square: a little
 * more than the inner radius, so the arc always completes.
 * ----------------------------------------------------------------------- */

.condx-card::after,
.facx-card::after,
.apprx-card::after,
.pst-card::after,
.faq-item::after,
.edu-doors::after,
.edu-media::after,
.dplate::after,
.sixd-panel::before,
.team-content::before,
.ed-plate::after {
	--mark: 20px;
	/* !important: the component stylesheets are inlined in the templates and
	   load after this file; without it their straight strokes stay under the arc. */
	background: none !important;
	border: 1px solid var(--gold);
	-webkit-mask:
		linear-gradient(#000, #000) left top / var(--mark) var(--mark) no-repeat,
		linear-gradient(#000, #000) right top / var(--mark) var(--mark) no-repeat,
		linear-gradient(#000, #000) left bottom / var(--mark) var(--mark) no-repeat,
		linear-gradient(#000, #000) right bottom / var(--mark) var(--mark) no-repeat;
	mask:
		linear-gradient(#000, #000) left top / var(--mark) var(--mark) no-repeat,
		linear-gradient(#000, #000) right top / var(--mark) var(--mark) no-repeat,
		linear-gradient(#000, #000) left bottom / var(--mark) var(--mark) no-repeat,
		linear-gradient(#000, #000) right bottom / var(--mark) var(--mark) no-repeat;
}

/* Marks that were partly sketch-grey keep gold throughout: one hairline. */

/* Per-surface mark size, from the inner radius each frame already has. */
.condx-card::after,
.apprx-card::after,
.pst-card::after,
.faq-item::after,
.edu-doors::after,
.ed-plate::after { --mark: 18px; }     /* inner radius 8  */

.edu-media::after { --mark: 14px; border-radius: 4px; }

.facx-card::after,
.dplate::after,
.sixd-panel::before,
.team-content::before { --mark: 22px; } /* inner radius 12–13 */

.facx-clinic .dplate::after { --mark: 28px; } /* inner radius 19 */

/* --------------------------------------------------------------------------
 * Cards — one family, concentric inner frames
 * ----------------------------------------------------------------------- */

.condx-card,
.apprx-card,
.pst-card,
.faq-item {
	border-radius: var(--r-md);
	box-shadow: var(--inner-light), var(--shadow-1);
	transition: box-shadow var(--t-base) var(--ease-ios), transform var(--t-base) var(--ease-ios),
		border-color var(--t-fast) ease;
}

.condx-card::after,
.apprx-card::after,
.pst-card::after,
.faq-item::after {
	border-radius: calc(var(--r-md) - 6px);
}

/* Cards that are links lift on hover; static cards do not move. */
a.condx-card:hover,
.condx-card:has(> a:hover),
.condx-card:focus-within,
.pst-card:has(a:hover),
.pst-card:focus-within {
	transform: translateY(-2px);
	box-shadow: var(--inner-light), var(--shadow-2);
}

.faq-item:hover {
	box-shadow: var(--inner-light), var(--shadow-2);
}

.faq-mark,
.faq-mark * {
	border-radius: calc(var(--r-md) - 6px);
}

/* The photo sits 15px inside a 14px card: concentric radius ≈ 0, so it gets
 * the smallest step instead. */
.pst-media,
.pst-media img {
	border-radius: 4px;
}

.pst-media {
	overflow: hidden;
}

/* Facility plates — larger cards, so one step up the scale; the mounted
 * print sits 14px inside and keeps the concentric remainder. */
.facx-card {
	border-radius: var(--r-lg);
	box-shadow: var(--inner-light), var(--shadow-1);
	transition: box-shadow var(--t-base) var(--ease-ios), transform var(--t-base) var(--ease-ios),
		border-color var(--t-fast) ease;
}

.facx-card::after {
	border-radius: calc(var(--r-lg) - 7px);
}

.facx-card .facx-link {
	border-radius: var(--r-lg);
}

.facx-plate {
	border-radius: calc(var(--r-lg) - 14px);
	overflow: hidden;
}

.facx-card:has(> a:hover),
.facx-card:focus-within {
	transform: translateY(-2px);
	box-shadow: var(--inner-light), var(--shadow-2);
}

/* The clinic plate is a feature surface: the photograph field follows the
 * outer radius on its own side because the plate clips it. */
.facx-clinic .dplate {
	border-radius: var(--r-xl);
	box-shadow: var(--shadow-dark);
}

.facx-clinic .dplate::after {
	border-radius: calc(var(--r-xl) - 7px);
}

/* --------------------------------------------------------------------------
 * Panels — large surfaces
 * ----------------------------------------------------------------------- */

.sixd-panel,
.hwt-panel,
.team-content {
	border-radius: var(--r-lg);
	box-shadow: var(--inner-light), var(--shadow-1);
}

.sixd-panel::before,
.team-content::before {
	border-radius: calc(var(--r-lg) - 8px);
}

.team-content::after {
	border-bottom-left-radius: 3px;
}

.edu-doors {
	border-radius: var(--r-md);
	overflow: hidden;
}

.edu-doors::after {
	border-radius: calc(var(--r-md) - 6px);
}

/* Image plates: plate, frame and photograph nest concentrically. */
.team-photo-plate {
	border-radius: var(--r-xl);
	box-shadow: var(--shadow-1);
}

.team-photo-plate::before { border-top-left-radius: calc(var(--r-xl) - 8px); }
.team-photo-plate::after  { border-bottom-right-radius: calc(var(--r-xl) - 8px); }

.team-photo,
.team-photo img {
	border-radius: calc(var(--r-xl) - 14px);
	overflow: hidden;
}

.edu-media {
	border-radius: var(--r-lg);
	overflow: hidden;
}

.edu-media img {
	border-radius: calc(var(--r-lg) - 6px);
}

/* --------------------------------------------------------------------------
 * Editorial pages (.ed)
 * ----------------------------------------------------------------------- */

/* Profile: photograph and dark card form one rounded surface. */
.ed-profile {
	border-radius: var(--r-xl);
	overflow: hidden;
	box-shadow: var(--shadow-dark);
}

.ed-disclosure {
	border-radius: var(--r-md);
	box-shadow: var(--inner-light), var(--shadow-1);
	transition: box-shadow var(--t-base) var(--ease-ios);
}

.ed-disclosure[open],
.ed-disclosure:hover {
	box-shadow: var(--inner-light), var(--shadow-2);
}

.ed-disclosure summary {
	border-radius: var(--r-md);
}

/* Photograph plates and holding copy. The field sits 12px inside a 14px
 * plate: concentric radius ≈ 0, so it gets the smallest step instead. */
.ed-plate {
	border-radius: var(--r-md);
	box-shadow: var(--inner-light), var(--shadow-1);
}

.ed-plate::after {
	border-radius: calc(var(--r-md) - 6px);
}

.ed-plate-field {
	border-radius: 4px;
}

.ed-pending {
	border-radius: var(--r-sm);
}

/* --------------------------------------------------------------------------
 * Dark bands — deep teal surfaces get the same geometry, darker elevation
 * ----------------------------------------------------------------------- */

.apprx-quote,
.hwt-close {
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-dark);
}

.apprx-quote::after,
.hwt-close::after {
	border-radius: calc(var(--r-lg) - 7px);
}

/* --------------------------------------------------------------------------
 * Mobile booking bar — a floating glass bar
 * ----------------------------------------------------------------------- */

@media (max-width: 768px) {
	.mobile-cta {
		background: var(--surface-glass);
		-webkit-backdrop-filter: var(--glass-blur);
		backdrop-filter: var(--glass-blur);
		border-top: 1px solid var(--hair);
	}
}

/* --------------------------------------------------------------------------
 * Accessibility and motion
 * ----------------------------------------------------------------------- */

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.opening-hero__panel,
	.mobile-cta {
		background: rgba(250, 247, 242, .96);
	}
}

@media (prefers-reduced-motion: reduce) {
	.btn,
	.apprx-more,
	.hwt-more,
	.condx-card,
	.facx-card,
	.apprx-card,
	.pst-card,
	.faq-item,
	.ed-disclosure {
		transition: none;
	}

	.btn:hover,
	.apprx-more:hover,
	.hwt-more:hover,
	.condx-card:has(> a:hover),
	.condx-card:focus-within,
	.facx-card:has(> a:hover),
	.facx-card:focus-within,
	.pst-card:has(a:hover),
	.pst-card:focus-within {
		transform: none;
	}
}
