/* ==========================================================================
   Nhs Robin — layout: containers, sections, header, footer, inner pages.
   Selectors are kept low-specificity so Elementor's per-element styles always win.
   ========================================================================== */

/* ---------- Containers & sections ---------- */
.nhs-container {
	width: min(100% - 2 * var(--gutter), var(--container-width));
	margin-inline: auto;
}
.nhs-container--narrow { width: min(100% - 2 * var(--gutter), 760px); }
.nhs-container--wide { width: min(100% - 2 * var(--gutter), 1320px); }

.nhs-section:not(.e-con) { padding-block: var(--section-space); }
.nhs-section--tight:not(.e-con) { padding-block: clamp(24px, 4vw, 48px); }
.nhs-section--soft { background: var(--color-soft); }

/* Elementor containers carrying .nhs-section follow the theme content width. */
.e-con.nhs-section {
	--container-max-width: var(--container-width);
	--content-width: min(100%, var(--container-width));
}

/* Unified section-inner handling: fallback `.nhs-container` and Elementor `.e-con-inner`. */
.nhs-section-head:not(.e-con) { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 40px; }
.nhs-section-head { margin-bottom: clamp(24px, 3vw, 40px); }
.nhs-section-head > .nhs-desc { flex: 1 1 280px; max-width: 460px; margin: 0; }
.nhs-section-head > .nhs-link-arrow { white-space: nowrap; }
.nhs-section-head > div:first-child { flex: 1 1 280px; }

/* ---------- Header ---------- */
.nhs-header {
	position: relative;
	z-index: 100;
	width: 100%;
	transition: background-color var(--motion-duration) var(--motion-ease), box-shadow var(--motion-duration) var(--motion-ease);
}
.has-sticky-header .nhs-header { position: sticky; top: 0; }
.admin-bar.has-sticky-header .nhs-header { top: 32px; }
.nhs-header--overlay { margin-bottom: calc(var(--header-height) * -1); }

.nhs-header.is-stuck {
	background: color-mix(in srgb, var(--color-background) 92%, transparent);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	box-shadow: 0 1px 0 var(--color-border);
}

.nhs-header__inner {
	display: flex;
	align-items: center;
	gap: 24px;
	height: var(--header-height);
	width: min(100% - 2 * var(--gutter), var(--container-width));
	margin-inline: auto;
}

.nhs-brand {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--color-text);
	font-weight: 700;
	font-size: 1.05rem;
	letter-spacing: -.01em;
	text-decoration: none;
}
.nhs-brand:hover { color: var(--color-text); }
.nhs-brand__mark {
	font-size: 2rem;
	font-weight: 800;
	font-style: italic;
	line-height: 1;
	letter-spacing: -.06em;
	background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	padding-right: .08em;
}
.custom-logo-link { display: inline-flex; align-items: center; }
.custom-logo { width: auto; max-height: calc(var(--header-height) - 28px); }

.nhs-nav {
	display: flex;
	align-items: center;
	margin-inline: auto;
}
.nhs-menu {
	display: flex;
	align-items: center;
	gap: clamp(18px, 3vw, 44px);
	margin: 0;
	padding: 0;
	list-style: none;
}
.nhs-menu li { position: relative; margin: 0; }
.nhs-menu a {
	position: relative;
	display: inline-block;
	padding: 10px 0;
	color: var(--color-text);
	font-size: .875rem;
	font-weight: 500;
	text-decoration: none;
}
.nhs-menu a::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 2px;
	width: 0;
	height: 2px;
	border-radius: 2px;
	background: var(--color-primary);
	transform: translateX(-50%);
	transition: width var(--motion-duration) var(--motion-ease);
}
.nhs-menu a:hover::after,
.nhs-menu a:focus-visible::after,
.nhs-menu .current-menu-item > a::after,
.nhs-menu .current_page_item > a::after,
.nhs-menu a.is-current::after,
.nhs-menu a[aria-current]::after { width: 18px; }
.nhs-menu a:hover { color: var(--color-primary); }

/* Dropdowns (depth 2) — keyboard reachable via :focus-within */
.nhs-menu .sub-menu {
	position: absolute;
	left: -12px;
	top: 100%;
	min-width: 200px;
	margin: 0;
	padding: 8px;
	list-style: none;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 12px;
	box-shadow: var(--shadow-md);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity var(--motion-duration) var(--motion-ease), transform var(--motion-duration) var(--motion-ease), visibility 0s linear var(--motion-duration);
}
.nhs-menu li:hover > .sub-menu,
.nhs-menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}
.nhs-menu .sub-menu a { display: block; padding: 8px 12px; border-radius: 8px; }
.nhs-menu .sub-menu a::after { display: none; }
.nhs-menu .sub-menu a:hover { background: var(--color-soft); }

.nhs-btn.nhs-nav__cta { display: none; }

.nhs-header__actions {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
}
.nhs-nav + .nhs-header__actions { margin-left: 0; }

.nhs-icon-btn {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--color-text);
	cursor: pointer;
	transition: background-color var(--motion-duration) var(--motion-ease), color var(--motion-duration) var(--motion-ease);
}
.nhs-icon-btn:hover { background: var(--color-soft); color: var(--color-primary); }
.nhs-icon-btn .nhs-icon { width: 18px; height: 18px; }

.nhs-menu-toggle { display: none; }
.nhs-menu-toggle__close { display: none; }
.nhs-menu-toggle[aria-expanded="true"] .nhs-menu-toggle__open { display: none; }
.nhs-menu-toggle[aria-expanded="true"] .nhs-menu-toggle__close { display: inline-flex; }

.nhs-theme-toggle__moon { display: none; }
:root[data-theme="dark"] .nhs-theme-toggle__sun { display: none; }
:root[data-theme="dark"] .nhs-theme-toggle__moon { display: inline-flex; }

.nhs-search {
	border-top: 1px solid var(--color-border);
	background: var(--color-surface);
	box-shadow: var(--shadow-md);
}
.nhs-search__inner { width: min(100% - 2 * var(--gutter), 720px); margin: 0 auto; padding: 16px 0; }
.nhs-searchform { display: flex; gap: 10px; }
.nhs-searchform .nhs-form__input { flex: 1; }

/* Optional "hide built-in" switches (Customizer) */
.nhs-hide-header .nhs-header,
.nhs-hide-footer .nhs-footer { display: none; }

/* ---------- Footer ---------- */
.nhs-footer {
	border-top: 1px solid var(--color-border);
	background: var(--color-background);
	padding-top: clamp(40px, 5vw, 64px);
}
.nhs-footer__main {
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr 1fr;
	gap: 32px 40px;
}
.nhs-footer__tagline { margin: 10px 0 6px; color: var(--color-primary); font-size: .8125rem; font-weight: 600; }
.nhs-footer__text { max-width: 36ch; margin: 0 0 16px; color: var(--color-muted); font-size: .875rem; }
.nhs-footer__heading { margin: 0 0 14px; font-size: .875rem; letter-spacing: 0; }
.nhs-footer__list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.nhs-footer__list a { color: var(--color-muted); font-size: .875rem; text-decoration: none; }
.nhs-footer__list a:hover { color: var(--color-primary); }
.nhs-footer__list .nhs-menu { display: grid; gap: 8px; }
.nhs-footer .nhs-menu a { color: var(--color-muted); }
.nhs-footer .nhs-menu a::after { display: none; }
.nhs-footer__bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 24px;
	margin-top: clamp(28px, 4vw, 48px);
	padding-block: 20px;
	border-top: 1px solid var(--color-border);
	color: var(--color-muted);
	font-size: .8125rem;
}
.nhs-footer__bar p { margin: 0; }
.nhs-footer__heart { color: #e5365f; fill: currentColor; }

.nhs-to-top {
	position: fixed;
	left: clamp(14px, 2vw, 28px);
	bottom: clamp(14px, 2vw, 28px);
	z-index: 90;
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--color-navy);
	color: var(--color-background);
	box-shadow: var(--shadow-md);
	text-decoration: none;
	transition: transform var(--motion-duration) var(--motion-ease), background-color var(--motion-duration) var(--motion-ease);
}
.nhs-to-top[hidden] { display: none; }
.nhs-to-top:hover { background: var(--color-primary); color: #fff; transform: translateY(-2px); }
.nhs-to-top .nhs-icon { width: 18px; height: 18px; }
.nhs-to-top__label { display: none; }

/* ---------- Inner pages ---------- */
.nhs-main { min-height: 50vh; }
.nhs-page-head {
	padding: calc(var(--header-height) + clamp(28px, 4vw, 56px)) 0 clamp(28px, 4vw, 48px);
	background: linear-gradient(180deg, var(--color-soft), var(--color-background));
	border-bottom: 1px solid var(--color-border);
}
.nhs-page-head__title { max-width: 20ch; margin: 8px 0 12px; font-size: clamp(2rem, 3.6vw + .5rem, 3.25rem); }
.nhs-page-head__lead { max-width: 60ch; margin: 0; color: var(--color-muted); font-size: 1.0625rem; }
.nhs-page-head__search { max-width: 520px; margin-top: 16px; }
.nhs-page-head--post .nhs-page-head__title { max-width: 24ch; }

.nhs-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 8px; padding: 0; list-style: none; color: var(--color-muted); font-size: .8125rem; }
.nhs-breadcrumbs li + li::before { content: "/"; margin-right: 8px; opacity: .5; }
.nhs-breadcrumbs a { color: inherit; }

.nhs-archive__body { padding-block: clamp(32px, 5vw, 64px); }
.nhs-single__image { margin-top: clamp(20px, 3vw, 32px); }
.nhs-single__image img { width: 100%; border-radius: var(--radius-card); aspect-ratio: 16 / 9; object-fit: cover; }
.nhs-single__footer { padding-block: 32px 64px; }

.nhs-prose { padding-block: clamp(28px, 4vw, 56px); font-size: 1.0625rem; line-height: 1.75; }
.nhs-prose > * { max-width: 760px; margin-inline: auto; }
.nhs-prose h2 { margin-top: 2em; }
.nhs-prose h3 { margin-top: 1.6em; font-size: 1.3rem; }
.nhs-prose img { border-radius: var(--radius-media); }
.nhs-prose blockquote { margin: 1.5em auto; padding: .4em 0 .4em 1.2em; border-left: 3px solid var(--color-primary); color: var(--color-muted); }
.nhs-prose pre { overflow-x: auto; padding: 16px; border-radius: 12px; background: var(--color-soft); font-size: .9rem; }
.nhs-prose .alignwide { max-width: 1100px; }
.nhs-prose .alignfull { max-width: none; }

.nhs-article--builder { margin: 0; }
.nhs-404__inner { display: grid; gap: 14px; justify-items: start; padding-block: calc(var(--header-height) + 48px) 96px; }

.nhs-tags a { text-decoration: none; }
.post-navigation .nav-links { display: flex; justify-content: space-between; gap: 16px; margin-top: 24px; }
.post-navigation a { color: var(--color-text); font-weight: 600; text-decoration: none; }
.post-navigation a:hover { color: var(--color-primary); }

.navigation.pagination { margin-top: 40px; }
.navigation.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--color-border);
	border-radius: 10px;
	color: var(--color-text);
	font-size: .875rem;
	text-decoration: none;
}
.page-numbers.current, .page-numbers:hover { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }

/* Comments */
.nhs-comments { margin-top: 40px; }
.nhs-comments__list { padding-left: 1.2em; }
.nhs-comments input[type="text"], .nhs-comments input[type="email"], .nhs-comments input[type="url"], .nhs-comments textarea {
	width: 100%; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface); color: var(--color-text); font: inherit;
}
.nhs-comments .submit { padding: 12px 22px; border: 0; border-radius: var(--radius-button); background: var(--color-primary); color: #fff; font-weight: 600; cursor: pointer; }

/* Elementor: buttons inside a section head keep their natural width instead of filling the row. */
.nhs-section-head > .elementor-widget-button { width: auto; flex: none; }
