/* ==========================================================================
   Elite Dental Clinic — components.css
   Header, menu, buttons, hero, sections, footer, cards, content.
   Mobile-first.
   ========================================================================== */

/* Header ------------------------------------------------------------------ */

/* Scroll sentinel: when it leaves the viewport the header gains its backdrop. */
.header-sentinel {
	position: absolute;
	top: 0;
	left: 0;
	width: 1px;
	height: 8rem;
	pointer-events: none;
}

.site-header {
	position: fixed;
	inset: 0 0 auto;
	z-index: 50;
	color: var(--edc-text);
	transition: color var(--duration-normal) var(--ease-standard);
}

.admin-bar {
	--admin-offset: var(--wp-admin--admin-bar--height, 32px); /* fixed header and sticky elements sit below the bar */
}

.admin-bar .site-header {
	top: var(--admin-offset);
}

/* Backdrop lives on a pseudo-element: a filter on the header itself would trap the fixed menu. */
.site-header::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: var(--header-height);
	background: var(--edc-overlay);
	-webkit-backdrop-filter: blur(5px);
	backdrop-filter: blur(5px);
	opacity: 0;
	transition: opacity var(--duration-normal) var(--ease-standard);
}

.has-dark-hero .site-header,
.site-header.is-scrolled,
.site-header.is-open {
	color: var(--edc-on-dark);
}

.site-header.is-scrolled::before {
	opacity: 1;
}

.site-header__bar {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-xs);
	min-height: var(--header-height);
}

.site-header__brand {
	min-width: 0;
}

/* Wordmark fallback stays on one line; long names truncate (upload a logo for real branding). */
.site-brand {
	display: block;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-family: var(--font-display);
	font-size: clamp(1.125rem, 0.9rem + 0.9vw, 1.5rem);
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0;
	text-transform: uppercase;
	text-decoration: none;
}

.custom-logo {
	width: auto;
	max-height: 2rem;
}

/* Phones: a shorter line on the header button leaves room for the full wordmark. */
.button.site-header__cta {
	--button-line: 1.5rem;
	white-space: nowrap;
}

.site-header__actions {
	display: flex;
	align-items: center;
	gap: var(--space-xs);
}

/* Inline navigation: shown on wide screens only (responsive.css). */
.site-nav {
	display: none;
}

.site-nav__list,
.site-menu__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-nav__list {
	display: flex;
	gap: var(--space-xs);
}

.site-nav a,
.site-menu__list a {
	position: relative;
	display: inline-block;
	font-family: var(--font-display);
	font-size: var(--text-label);
	font-weight: 500;
	line-height: 1;
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	text-decoration: none;
	padding-block: var(--space-2xs);
}

/* Hairline underline that draws in from the left. */
.site-nav a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: right;
	transition: transform var(--duration-normal) var(--ease-editorial);
}

.site-nav a:hover::after,
.site-nav .current-menu-item > a::after,
.site-nav .current-menu-parent > a::after,
.site-nav .current_page_parent > a::after {
	transform: scaleX(1);
	transform-origin: left;
}

/* Menu toggle: two hairlines that cross into an X. */
.menu-toggle {
	position: relative;
	width: 2.75rem;
	height: 2.75rem;
	margin-right: calc(var(--space-2xs) * -1);
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.menu-toggle__line {
	position: absolute;
	right: 0.5rem;
	width: 1.75rem;
	height: 1px;
	background: currentColor;
	transition: transform var(--duration-normal) var(--ease-editorial), width var(--duration-normal) var(--ease-editorial);
}

.menu-toggle__line:first-of-type {
	top: calc(50% - 4px);
}

.menu-toggle__line:last-of-type {
	top: calc(50% + 3px);
	width: 1.5rem;
}

.is-open .menu-toggle__line:first-of-type {
	transform: translateY(3.5px) rotate(45deg);
}

.is-open .menu-toggle__line:last-of-type {
	width: 1.75rem;
	transform: translateY(-3.5px) rotate(-45deg);
}

/* Full-screen menu. visibility keeps it out of the tab order while closed. */
.site-menu {
	position: fixed;
	inset: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--space-l);
	padding: calc(var(--header-height) + var(--space-l)) var(--gutter) var(--space-xl);
	background: var(--edc-overlay);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	color: var(--edc-on-dark);
	overflow-y: auto;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity var(--duration-normal) var(--ease-standard),
		visibility 0s linear var(--duration-normal);
}

.is-open .site-menu {
	opacity: 1;
	visibility: visible;
	transition: opacity var(--duration-normal) var(--ease-standard);
}

.site-menu__list {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-2xs);
	text-align: center;
}

.site-menu__list li,
.site-menu > .button {
	opacity: 0;
	transform: translate3d(0, 1rem, 0);
	transition: opacity var(--duration-normal) var(--ease-editorial), transform var(--duration-normal) var(--ease-editorial);
}

.is-open .site-menu__list li,
.is-open .site-menu > .button {
	opacity: 1;
	transform: none;
	transition-delay: calc(var(--i, 0) * var(--stagger) + 100ms);
}

.site-menu__list a {
	padding-block: 0.875rem;
}

.site-menu :focus-visible,
.site-footer :focus-visible,
.hero :focus-visible {
	outline-color: var(--edc-on-dark);
}

.is-open .site-header__cta {
	visibility: hidden;
}

/* No JS: the toggle can't work, so expose the inline list instead. */
.no-js .menu-toggle,
.no-js .site-menu {
	display: none;
}

.no-js .site-nav {
	display: block;
}

.no-js .site-header__bar {
	flex-wrap: wrap;
}

/* Lock page scroll behind the open menu. */
.menu-open {
	overflow: hidden;
}

/* Buttons ----------------------------------------------------------------- */

.button {
	--button-line: 2rem;
	--button-line-gap: 0.625rem;
	display: inline-flex;
	align-items: center;
	gap: var(--button-line-gap);
	min-height: 2.5rem;
	padding: 0.5rem 0.75rem;
	border: var(--border-width) solid color-mix(in srgb, currentColor 60%, transparent);
	border-radius: var(--radius-button);
	background: transparent;
	font-family: var(--font-display);
	font-size: var(--text-label);
	font-weight: 500;
	line-height: 1;
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	text-decoration: none;
	max-width: 100%; /* long (translated) labels wrap inside the frame instead of widening the page */
	cursor: pointer;
	transition:
		background-color var(--duration-normal) var(--ease-standard),
		border-color var(--duration-normal) var(--ease-standard),
		color var(--duration-normal) var(--ease-standard);
}

.button:hover {
	border-color: currentColor;
}

/* The line slides out to the right while a twin enters from the left. */
/* Wrapped labels get line spacing; the negative margin keeps a single line exactly as tall as before. */
.button__label {
	line-height: 1.2;
	margin-block: -0.1em;
}

.button__line {
	position: relative;
	flex: none;
	width: var(--button-line);
	height: 1px;
	overflow: hidden;
}

.button__line::before,
.button__line::after {
	content: "";
	position: absolute;
	inset: 0;
	background: currentColor;
	transition: transform var(--duration-normal) var(--ease-editorial);
}

.button__line::after {
	transform: translateX(calc(-100% - var(--button-line-gap)));
}

.button:hover .button__line::before,
.button:focus-visible .button__line::before {
	transform: translateX(calc(100% + var(--button-line-gap)));
}

.button:hover .button__line::after,
.button:focus-visible .button__line::after {
	transform: none;
}

.button--solid {
	border-color: var(--edc-button-bg);
	background: var(--edc-button-bg);
	color: var(--edc-button-text);
}

.button--solid:hover {
	border-color: var(--edc-button-hover);
	background: var(--edc-button-hover);
}

.button--text {
	min-height: 0;
	padding: 0;
	border: 0;
}

@media (pointer: coarse) {
	.button:not(.button--text) {
		min-height: 2.75rem;
	}
}

/* Page heroes (interior pages) ------------------------------------------- */

.page-hero {
	display: grid;
	gap: var(--space-xs);
	padding-top: 16rem; /* reference: 256px at every width */
	padding-bottom: var(--space-xl);
}

.page-hero__lede {
	max-width: 24rem;
	color: var(--edc-text-soft);
}

/* Cards ------------------------------------------------------------------- */

/* Entry content ----------------------------------------------------------- */

/* Forms ------------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="url"],
textarea,
select {
	width: 100%;
	min-height: 3rem;
	padding: 0.6875rem 1rem; /* 48px tall with the 1px border (reference) */
	border: var(--border-width) solid var(--edc-border-strong);
	border-radius: var(--radius-control);
	background: var(--edc-surface);
	transition: border-color var(--duration-fast) var(--ease-standard);
}

input:hover,
textarea:hover,
select:hover {
	border-color: var(--edc-text);
}

.search-form {
	display: flex;
	gap: var(--space-2xs);
	max-width: 32rem;
	margin-bottom: var(--space-m);
}

.search-form label {
	flex: 1;
}

.search-submit {
	padding-inline: var(--space-s);
	border: 0;
	background: var(--edc-button-bg);
	color: var(--edc-button-text);
	font-family: var(--font-display);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	cursor: pointer;
}

/* Pagination -------------------------------------------------------------- */

.pagination {
	margin-top: var(--space-xl);
}

.pagination .nav-links {
	display: flex;
	gap: var(--space-xs);
	font-family: var(--font-display);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
}
