/*
 * Retina Associates — global design tokens (front end + block editor)
 *
 * There is no Figma file for this site. Values are taken from the previous
 * build (Astra settings, the retina-assoc theme's --clr-* variables, Beaver
 * Builder layouts) as rendered at a 1440px viewport, which is the "frame" here:
 * fluid sizes reach their maximum at ~1440px and the maximum is the old value.
 *
 * Provenance tags: (old theme) = retina-assoc style.css variable,
 * (measured) = computed style / screenshot of the old site at 1440px,
 * (not in old site — {contrast}) = new value with its contrast ratio.
 */

:root {
	/* Colours --------------------------------------------------------------------------------------------------------- */
	--clr-brand         : #295381;                   /* headings, links, nav, footer background (old theme --clr-blue) */
	--clr-brand-deep    : #33527D;                   /* dark title band behind condition headings (old theme --clr-blue-title) */
	--clr-brand-ink     : #1D3B5C;                   /* button hover text on accent fill (not in old site — 5.6:1 on #F1A640) */
	--clr-accent        : #F1A640;                   /* button outline, hover fill (old theme --clr-orange) */
	--clr-text          : #4B4F58;                   /* body copy (measured — Astra body colour) — 8.2:1 on white, 7.4:1 on #EBF4FD */
	--clr-text-strong   : #3A3A3A;                   /* accordion headings (old Astra heading colour, measured) — 11.4:1 on white, 10.3:1 on #EBF4FD */
	--clr-text-soft     : #5F6670;                   /* small print, meta lines (not in old site — 5.8:1 on white, 5.2:1 on #EBF4FD) */
	--clr-white         : #FFFFFF;
	--clr-bg-light      : #EBF4FD;                   /* pale blue section background (old theme --clr-bg-light-blue) */
	--clr-bg-card       : #F5FAFF;                   /* doctor / condition card (old theme --clr-bg-filter-blue) */
	--clr-bg-card-hover : #DCEBFB;                   /* card hover (old site used #B8DCFF; softened — brand text 6.5:1) */
	--clr-bg-tag        : #E4E4E4;                   /* specialty tag behind card eyebrow (measured) */
	--clr-line          : #BDD6F2;                   /* card divider, light rules (measured) */
	--clr-line-strong   : #788BA1;                   /* accordion rules, form borders (not in old site — 3.5:1 on white, 3.1:1 on #EBF4FD) */
	--clr-on-brand      : #FFFFFF;                   /* text on --clr-brand (7.9:1) */
	--clr-on-brand-soft : #D6E4F3;                   /* secondary footer text (not in old site — 6.1:1 on #295381) */
	--clr-field-bg      : #FAFAFA;                   /* form inputs (measured — old site's Astra form fill) */
	--clr-field-border  : #CCCCCC;                   /* form input border (measured — old site; 1.6:1 on white, below WCAG's 3:1, kept to match the old forms at the client's request) */
	--clr-field-required: #C02B0A;                   /* required-field asterisk (measured — Gravity Forms default on the old site; 5.6:1 on white) */
	--clr-error         : #A8192E;                   /* form validation (not in old site — 7.4:1 on white) */
	--clr-focus         : var(--clr-accent);

	/* Gradients ------------------------------------------------------------------------------------------------------- */
	/* Image hero: the old home/location heroes fade the photo into grey-blue on the left so the title reads */
	--gradient-hero-fade: linear-gradient(90deg, rgba(235, 240, 246, 0.96) 0%, rgba(235, 240, 246, 0.85) 38%, rgba(235, 240, 246, 0) 72%);
	/* Phone: the fade covers the whole image because the title sits over the middle */
	--gradient-hero-fade-sm: linear-gradient(0deg, rgba(235, 240, 246, 0.94) 0%, rgba(235, 240, 246, 0.8) 100%);
	/* CTA band: photo of an eye on the right, title on the left over a white fade (old RET - Conditions CTA row) */
	--gradient-cta-fade: linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.8) 45%, rgba(255, 255, 255, 0) 75%);

	/* Font families --------------------------------------------------------------------------------------------------- */
	--ff-heading : 'Figtree', system-ui, sans-serif;  /* old Astra headings font */
	--ff-body    : 'Inter', system-ui, sans-serif;    /* old Astra body font */
	--ff-ui      : 'Inter', system-ui, sans-serif;    /* buttons, filters, labels */

	/* Font sizes — max = old site at 1440 ---------------------------------------------------------------------------- */
	--fs-home-title    : clamp(2.5rem, 1.75rem + 3.15vw, 4.5625rem);  /* 73px ÷ 16 (measured old home hero, 73.125px) — 40px min */
	--fs-hero-title    : clamp(2.25rem, 1.2rem + 3vw, 3.75rem);       /* 60px ÷ 16 — doctor names, photo heroes */
	--fs-page-title    : clamp(1.75rem, 1.35rem + 1.2vw, 2.25rem);    /* 36px ÷ 16 (measured title bands) — 28px min */
	--fs-section-title : clamp(1.625rem, 1.3rem + 1vw, 2.125rem);     /* 34px ÷ 16 (measured h2, 33.75px) — 26px min */
	--fs-item-title    : clamp(1.25rem, 1.1rem + 0.45vw, 1.5rem);     /* 24px ÷ 16 (measured card/column h3) — 20px min */
	--fs-lead          : clamp(1.125rem, 1rem + 0.4vw, 1.375rem);     /* 22px ÷ 16 (measured hero intro / "Find a doctor…") */
	--fs-accordion     : clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);   /* 19px ÷ 16 (measured old accordion heading, 18.75px) — 17px min */
	--fs-body          : clamp(1rem, 0.96rem + 0.1vw, 1.0625rem);     /* 17px ÷ 16 (measured, 16.875px) — 16px min */
	--fs-small         : 0.875rem;                                     /* 14px — card meta, footer legal */
	--fs-tiny          : 0.8125rem;                                    /* 13px — tags only, never paragraphs */
	--fs-button        : 0.9375rem;                                    /* 15px (measured) */
	--fs-field         : 0.9375rem;                                    /* 15px (measured old form inputs, radio/checkbox labels) */
	--fs-field-note    : 0.8203rem;                                    /* 13.125px (measured old form sub-labels and hints; 11.97px at ≤921px) */
	--fs-form-section  : 1.625rem;                                     /* 26px (measured old form section titles; 20px at ≤921px — form-card style.css) */

	/* Font weights ---------------------------------------------------------------------------------------------------- */
	--fw-regular  : 400;
	--fw-medium   : 500;
	--fw-semibold : 600;
	--fw-bold     : 700;

	/* Line heights ---------------------------------------------------------------------------------------------------- */
	--lh-tight   : 1.15;    /* hero title */
	--lh-solid   : 1;       /* home hero title (measured, 73px / 73px) */
	--lh-heading : 1.25;    /* Astra h2/h3 were 1.3 */
	--lh-body    : 1.6;     /* 26.25 / 16.875 = 1.556, rounded up for long medical copy */
	--lh-small   : 1.45;

	/* Letter spacing -------------------------------------------------------------------------------------------------- */
	--ls-heading : -0.01em;
	--ls-button  : 0.06em;  /* uppercase buttons (measured ~0.9px at 15px) */
	--ls-eyebrow : 0.08em;

	/* Layout ---------------------------------------------------------------------------------------------------------- */
	--container-width  : 68.75rem;                          /* 1100px (old theme Tailwind container) */
	--container-wide   : 77.5rem;                           /* 1240px (old BB row width) — logo grids, galleries */
	--container-gutter : clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
	--measure          : 46em;                               /* comfortable line length for long copy */

	/* Spacing / sizes ------------------------------------------------------------------------------------------------- */
	--section-padding    : clamp(3rem, 2rem + 3vw, 5rem);   /* 80px ÷ 16 (old py-20) — 48px min */
	--section-padding-sm : clamp(1.75rem, 1.25rem + 1.5vw, 2.5rem);
	--space-2xs : 0.25rem;
	--space-xs  : 0.5rem;
	--space-sm  : 0.75rem;
	--space-md  : 1.25rem;
	--space-lg  : 2rem;
	--space-xl  : clamp(2rem, 1.5rem + 1.5vw, 3rem);
	--space-2xl : clamp(2.5rem, 1.75rem + 2.5vw, 4rem);

	/* Border radius --------------------------------------------------------------------------------------------------- */
	--radius-sm    : 0.25rem;
	--radius-md    : 0.5rem;   /* buttons, cards (measured ~8px) */
	--radius-lg    : 1rem;     /* images marked "rounded" in the old build */
	--radius-round : 999px;

	/* Border widths --------------------------------------------------------------------------------------------------- */
	--bw-button : 2px;         /* old outline buttons */
	--bw-rule   : 1px;
	--bw-card   : 2px;         /* doctor card divider */

	/* Shadows --------------------------------------------------------------------------------------------------------- */
	--shadow-card   : 0 2px 6px rgba(41, 83, 129, 0.10);  /* old cards used Tailwind shadow-md */
	--shadow-raised : 0 8px 24px rgba(41, 83, 129, 0.16);

	/* Motion ---------------------------------------------------------------------------------------------------------- */
	--ease-soft      : cubic-bezier(0.25, 0.1, 0.25, 1);
	--dur-hover      : 250ms;
	--dur-fill       : 400ms;  /* gallery image zoom on hover */
	--dur-accordion  : 350ms;  /* must match ACCORDION_DURATION in blocks/accordion/accordion.js */
	--dur-reveal     : 700ms;
	--dur-filter     : 200ms;  /* doctor / post grid fade while results refresh */
}

/* Astra sets html { font-size: 93.75% } (15px rem). Every token here assumes 16px. */
html { font-size: 100%; }

/* Container ---------------------------------------------------------------------------------------------------------- */
.container {
	box-sizing: border-box;
	width: 100%;
	max-width: calc(var(--container-width) + (var(--container-gutter) * 2));
	margin-inline: auto;
	padding-inline: var(--container-gutter);
}

/*
 * Astra's page-builder layout sets max-width: none on every child of a
 * full-width block (.ast-page-builder-template .entry-content[data-ast-blocks-layout]
 * > .alignfull > *, specificity 0,4,0). Put the container width back on block
 * __inner elements. A block with a different width sets --inner-max on its root.
 */
.ast-page-builder-template .entry-content[data-ast-blocks-layout] > .alignfull > [class$="__inner"] {
	max-width: var(--inner-max, calc(var(--container-width) + (var(--container-gutter) * 2)));
}

/* Base type on top of Astra ------------------------------------------------------------------------------------------ */
body,
.editor-styles-wrapper {
	font-family: var(--ff-body);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	color: var(--clr-text);
	background: var(--clr-white);
}

/* Buttons never underline, anywhere — Astra's link settings outrank block CSS on hover/focus */
a[class*="__btn"], a[class*="__btn"]:hover, a[class*="__btn"]:focus,
a[class*="__btn"]:active, a[class*="__btn"]:visited,
.wp-block-button__link, .wp-block-button__link:hover, .wp-block-button__link:focus,
.ast-button, .ast-button:hover, .ast-button:focus {
	text-decoration: none !important;
}

/* Visible focus everywhere */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--clr-focus);
	outline-offset: 3px;
}

/* Shared button — every block's __btn rule extends this look -------------------------------------------------------- */
/* Hover: every style fades to solid orange (client preferred this to the left-to-right fill). */
.ret-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	min-height: 2.75rem;
	padding: 0.7em 1.5em;
	border: var(--bw-button) solid var(--clr-accent);
	border-radius: var(--radius-md);
	background-color: transparent;
	color: var(--clr-brand);
	font-family: var(--ff-ui);
	font-size: var(--fs-button);
	font-weight: var(--fw-semibold);
	letter-spacing: var(--ls-button);
	line-height: 1.2;
	text-transform: uppercase;
	cursor: pointer;
	transition:
		background-color var(--dur-hover) var(--ease-soft),
		color var(--dur-hover) var(--ease-soft),
		border-color var(--dur-hover) var(--ease-soft);
}
.ret-btn--solid {
	border-color: var(--clr-brand);
	background-color: var(--clr-brand);
	color: var(--clr-white);
}
.ret-btn--light {
	border-color: var(--clr-white);
	color: var(--clr-white);
}
.ret-btn:hover,
.ret-btn:focus-visible {
	border-color: var(--clr-accent);
	background-color: var(--clr-accent);
	color: var(--clr-brand-ink);
}

/* Shared rich text — WYSIWYG output inside any block ---------------------------------------------------------------- */
.ret-prose > * { margin: 0; }
.ret-prose > * + * { margin-top: 0.85em; }
.ret-prose :is(h2, h3, h4) {
	font-family: var(--ff-heading);
	line-height: var(--lh-heading);
	color: var(--clr-brand);
	font-weight: var(--fw-semibold);
}
.ret-prose > :is(h2, h3, h4) { margin-top: 1.4em; }
.ret-prose > :is(h2, h3, h4):first-child { margin-top: 0; }
.ret-prose h3 { font-size: 1.25em; }
.ret-prose h4 { font-size: 1.1em; }
.ret-prose :is(p, li) {
	font-size: inherit;
	line-height: var(--lh-body);
	color: inherit;
}
.ret-prose :is(ul, ol) { padding-left: 1.4em; margin-left: 0; }
.ret-prose ul { list-style: none; }
.ret-prose ul > li { position: relative; }
.ret-prose ul > li::before {
	content: "";
	position: absolute;
	left: -1.05em;
	top: 0.68em;
	width: 0.36em;
	height: 0.36em;
	border-radius: 50%;
	background: var(--clr-brand);
}
.ret-prose ol > li::marker { color: var(--clr-brand); font-weight: var(--fw-semibold); }
.ret-prose li + li { margin-top: 0.4em; }
.ret-prose li > :is(ul, ol) { margin-top: 0.4em; }
.ret-prose a {
	color: var(--clr-brand);
	font-weight: var(--fw-semibold);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	text-decoration-color: var(--clr-line-strong);
	transition: text-decoration-color var(--dur-hover) var(--ease-soft), text-decoration-thickness var(--dur-hover) var(--ease-soft);
}
.ret-prose a:hover,
.ret-prose a:focus-visible {
	text-decoration-color: currentColor;
	text-decoration-thickness: 2px;
}
.ret-prose strong { color: var(--clr-brand); font-weight: var(--fw-semibold); }
/* Bold subtitle on its own line (see theme_mark_subheads()). Larger on location pages only, as on the old site (1.5rem = 22.5px) */
.single-location .ret-prose .ret-subhead { font-size: var(--fs-lead); line-height: var(--lh-heading); }
.ret-prose img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.ret-prose table { width: 100%; border-collapse: collapse; font-size: 0.95em; }
.ret-prose :is(th, td) { padding: 0.5em 0.75em; border-bottom: var(--bw-rule) solid var(--clr-line); text-align: left; }

/*
 * Header navigation: colours and size as the old site. Its theme forced every link to --clr-blue (= --clr-brand) with
 * !important, so the menu stayed navy on hover, in dropdowns and on the current page; Astra alone gives #0170B9 and
 * a grey hover. Its 93.75% root made the menu 15px (here it would inherit the 17px body). The mobile menu was grey.
 */
.site-header .main-header-menu .menu-link,
.site-header .main-header-menu .menu-link:is(:hover, :focus),
.site-header .main-header-menu .menu-item:is(:hover, .current-menu-item, .current-menu-ancestor) > .menu-link {
	color: var(--clr-brand);
	font-size: var(--fs-button);   /* 15px (measured old menu) */
}
#ast-mobile-header .main-header-menu .menu-link,
#ast-mobile-header .main-header-menu .menu-link:is(:hover, :focus),
#ast-mobile-header .main-header-menu .menu-item:is(:hover, .current-menu-item, .current-menu-ancestor) > .menu-link {
	color: var(--clr-text);        /* old mobile menu: Astra body grey */
}
.site-header .ast-header-search { font-size: var(--fs-button); }   /* Astra's icon is 1.3em: 19.5px, as the old site */
.site-header .ast-search-icon .astra-search-icon { color: var(--clr-brand); }

/* Header: phone icon on menu items with the class "menu-item-phone" (replaces the Menu Icons plugin) ---------------- */
.menu-item .ret-menu-icon {
	display: inline-block;
	width: 1.1em;
	height: 1.1em;
	vertical-align: -0.18em;
	margin-right: 0.4em;
}
.menu-item .ret-menu-icon--only { margin-right: 0; }
.screen-reader-text-inline {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
	}
}
