/*
 * AV-Security — section styles
 * ----------------------------------------------------------------------------
 * Only what theme.json cannot express: the HTML/CSS brand logo, sticky header,
 * responsive navigation collapse, hero background layers with a dark fallback,
 * hover and focus states. Editable business content stays in the block markup
 * (parts / patterns).
 */

:root {
	--av-container: 1180px;
	--av-header-height: 92px;
	--av-ink: #0b1f33;          /* matches theme "contrast" */
	--av-ink-deep: #06111f;     /* hero fallback / overlay base */
	--av-primary: #1a5fb4;      /* matches theme "primary" */
	--av-primary-hover: #12488c;
	--av-accent: #c8102e;       /* logo "V" / restrained accent */
	--av-hairline: rgba(11, 31, 51, 0.12);
	--av-serif: Georgia, "Times New Roman", "PT Serif", "Noto Serif", serif;
}

/* Offset in-page anchor jumps so targets clear the sticky header. */
html {
	scroll-padding-top: calc(var(--av-header-height) + 16px);
}

/* Guard against accidental horizontal overflow from full-bleed sections. */
.wp-site-blocks {
	overflow-x: clip;
}

/* ==========================================================================
   Brand logo — pure HTML/CSS, no image asset, scales with font size
   ========================================================================== */

.av-logo {
	--av-logo-unit: clamp(1.5rem, 1.15rem + 1vw, 1.9rem);
	display: inline-flex;
	align-items: center;
	gap: clamp(0.55rem, 1.4vw, 0.9rem);
	flex: 0 0 auto;
	line-height: 1;
	color: var(--av-ink);
	text-decoration: none;
}

.av-logo:hover,
.av-logo:focus-visible {
	text-decoration: none;
}

/* Boxed AV monogram: dark field, thin inset white frame, serif treatment. */
.av-logo__mark {
	display: inline-flex;
	align-items: baseline;
	justify-content: center;
	padding: 0.3em 0.36em;
	font-family: var(--av-serif);
	font-size: var(--av-logo-unit);
	font-weight: 700;
	letter-spacing: 0.01em;
	background-color: #0a0e14;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.92);
	border-radius: 1px;
}

.av-logo__a { color: #ffffff; }
.av-logo__v { color: var(--av-accent); margin-left: 0.03em; }

/* Wordmark + descriptor stacked to the right of the monogram. */
.av-logo__text {
	display: flex;
	flex-direction: column;
	gap: 0.32em;
}

.av-logo__word {
	font-size: calc(var(--av-logo-unit) * 0.9);
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--av-ink);
	/* compensate trailing letter-spacing so the wordmark aligns left cleanly */
	margin-right: -0.2em;
}

.av-logo__sub {
	font-size: calc(var(--av-logo-unit) * 0.42);
	font-weight: 500;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: rgba(11, 31, 51, 0.62);
	white-space: nowrap;
}

.av-logo:hover .av-logo__word,
.av-logo:focus-visible .av-logo__word {
	color: var(--av-primary);
}

/* ==========================================================================
   Site header
   ========================================================================== */

.av-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: rgba(255, 255, 255, 0.94);
	-webkit-backdrop-filter: saturate(180%) blur(12px);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--av-hairline);
}

.av-header__inner {
	max-width: var(--av-container);
	margin-inline: auto;
	gap: clamp(1rem, 3vw, 2.5rem);
	min-height: var(--av-header-height);
}

/* Primary navigation */
.av-header__nav {
	flex: 1 1 auto;
	min-width: 0;
}

.av-header__nav .wp-block-navigation__container {
	gap: clamp(1.25rem, 2.6vw, 2.5rem);
}

.av-header__nav .wp-block-navigation-item__content {
	position: relative;
	padding-block: 0.5rem;
	color: var(--av-ink);
	font-size: 0.95rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	text-decoration: none;
}

.av-header__nav .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: var(--av-primary);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.2s ease;
}

.av-header__nav .wp-block-navigation-item__content:hover {
	color: var(--av-primary);
	text-decoration: none;
}

.av-header__nav .wp-block-navigation-item__content:hover::after,
.av-header__nav .wp-block-navigation-item__content:focus-visible::after {
	transform: scaleX(1);
}

/* Right-side actions */
.av-header__actions {
	flex: 0 0 auto;
	gap: clamp(0.85rem, 2vw, 1.6rem);
}

.av-header__phone {
	margin: 0;
	font-weight: 600;
	font-size: 0.95rem;
	letter-spacing: 0.02em;
	color: var(--av-ink);
	white-space: nowrap;
}

.av-header__cta .wp-block-button__link {
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	transition: background-color 0.18s ease, transform 0.18s ease;
}

.av-header__cta .wp-block-button__link:hover {
	background-color: var(--av-primary-hover) !important;
}

.av-header__cta .wp-block-button__link:active {
	transform: translateY(1px);
}

/* Visible focus states across all header controls */
.av-header a:focus-visible,
.av-header button:focus-visible,
.av-header .wp-block-button__link:focus-visible {
	outline: 2px solid var(--av-primary);
	outline-offset: 3px;
	border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Responsive navigation
   Core shows the overlay toggle only below 600px. Force it below 900px so the
   full bar never crowds on laptops / tablets, and keep the toggle on the right.
   -------------------------------------------------------------------------- */
@media (max-width: 899.98px) {
	.av-header__nav {
		flex: 0 0 auto;
		margin-inline-start: auto;
	}
}

@media (min-width: 600px) and (max-width: 899.98px) {
	.av-header__nav .wp-block-navigation__responsive-container:not(.is-menu-open) {
		display: none !important;
	}

	.av-header__nav .wp-block-navigation__responsive-container-open {
		display: flex !important;
	}
}

/* Hamburger / close icons */
.av-header__nav .wp-block-navigation__responsive-container-open,
.av-header__nav .wp-block-navigation__responsive-container-close {
	color: var(--av-ink);
}

.av-header__nav .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--av-ink);
	padding: clamp(1.5rem, 8vw, 4rem);
}

.av-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	color: #fff;
	font-size: 1.25rem;
}

.av-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content::after {
	display: none;
}

.av-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	color: #fff;
}

@media (max-width: 1024px) {
	:root {
		--av-header-height: 76px;
	}
}

@media (max-width: 600px) {
	.av-logo {
		--av-logo-unit: 1.3rem;
		gap: 0.45rem;
	}

	.av-logo__word {
		letter-spacing: 0.12em;
		margin-right: -0.12em;
	}

	.av-header__phone {
		display: none;
	}

	.av-header__cta .wp-block-button__link {
		font-size: 0.85rem;
		padding-inline: 1rem !important;
	}
}

@media (max-width: 460px) {
	.av-logo {
		--av-logo-unit: 1.15rem;
	}

	.av-logo__sub {
		display: none;
	}
}

@media (max-width: 380px) {
	/* Simplify to the framed monogram; it still reads as "AV". */
	.av-logo__word {
		display: none;
	}

	.av-header__inner {
		gap: 0.5rem;
	}
}

/* ==========================================================================
   Homepage hero
   ========================================================================== */

.av-hero {
	display: flex;
	align-items: center;
	min-height: clamp(600px, 84vh, 880px);
	padding-block: clamp(4.5rem, 13vh, 10rem);
	color: #fff;
	background-color: var(--av-ink-deep);
	/* Layered depth, fallback-safe:
	   1) cool blue glow, top-right
	   2) left-to-right readability shade — strong behind the text, clears toward the right
	   3) light bottom grounding for the buttons
	   4) photograph.
	   If hero-security.png is absent, layers 1-3 render as an intentional
	   dark field — no broken-image behaviour. */
	background-image:
		radial-gradient(115% 85% at 85% -5%, rgba(26, 95, 180, 0.18) 0%, rgba(6, 17, 31, 0) 58%),
		linear-gradient(90deg, rgba(6, 17, 31, 0.8) 0%, rgba(6, 17, 31, 0.62) 24%, rgba(6, 17, 31, 0.3) 52%, rgba(6, 17, 31, 0.1) 78%, rgba(6, 17, 31, 0.03) 100%),
		linear-gradient(180deg, rgba(6, 17, 31, 0) 55%, rgba(6, 17, 31, 0.22) 100%),
		url("../images/hero-security.png");
	background-repeat: no-repeat;
	background-position: center;
	background-size: cover;
}

.av-hero__content {
	max-width: 640px;
	margin-inline-start: 0;
}

.av-hero__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.85rem;
	margin: 0 0 1.4rem;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.74);
}

.av-hero__eyebrow::before {
	content: "";
	width: 2.25rem;
	height: 2px;
	background: var(--av-accent);
	flex: 0 0 auto;
}

.av-hero__title {
	margin: 0;
	font-weight: 700;
	line-height: 1.06;
	letter-spacing: -0.02em;
	color: #fff;
	text-wrap: balance;
}

.av-hero__subtitle {
	margin: 0.9rem 0 0;
	font-weight: 400;
	line-height: 1.3;
	color: rgba(255, 255, 255, 0.9);
}

.av-hero__text {
	margin: 1.9rem 0 0;
	max-width: 48ch;
	font-size: 1.05rem;
	line-height: 1.65;
	color: rgba(255, 255, 255, 0.78);
}

.av-hero__actions {
	margin-top: 2.75rem;
}

.av-hero__actions .wp-block-button__link {
	font-weight: 600;
	letter-spacing: 0.01em;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.av-hero__cta-primary .wp-block-button__link:hover {
	background-color: var(--av-primary-hover) !important;
}

.av-hero__cta-secondary .wp-block-button__link {
	border-color: rgba(255, 255, 255, 0.55);
	color: #fff;
}

.av-hero__cta-secondary .wp-block-button__link:hover {
	background-color: rgba(255, 255, 255, 0.1);
	border-color: #fff;
}

.av-hero a:focus-visible,
.av-hero .wp-block-button__link:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
	border-radius: 2px;
}

@media (max-width: 768px) {
	.av-hero {
		min-height: clamp(520px, 80vh, 720px);
		padding-block: clamp(3.5rem, 11vh, 6.5rem);
	}

	.av-hero__content {
		max-width: 100%;
	}

	.av-hero__text {
		max-width: none;
	}

	.av-hero__actions {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		width: 100%;
	}

	.av-hero__actions .wp-block-button {
		width: 100%;
	}

	.av-hero__actions .wp-block-button__link {
		display: block;
		width: 100%;
		text-align: center;
	}
}

@media (min-width: 769px) {
	/* Desktop composition: line the hero content's left edge up with the
	   header logo. Reuse the header's own container metrics — the 1180px
	   --av-container and the spacing-50 side padding used by .av-header__inner —
	   resolved from the section width rather than a fixed pixel margin.
	   .av-hero is full-bleed, so 100% here is the viewport content width and
	   (100% - container) / 2 is the gutter the header container is centred by;
	   the spacing-50 term adds the header's inner padding. The max() floor of
	   two × spacing-50 keeps the alignment correct once the viewport is
	   narrower than the container (matching .wp-site-blocks + inner padding). */
	.av-hero__content {
		padding-inline: 0 !important;
		margin-inline-start: max(
			calc(var(--wp--preset--spacing--50) * 2),
			calc((100% - var(--av-container)) / 2 + var(--wp--preset--spacing--50))
		) !important;
		margin-inline-end: auto !important;
	}

	.av-hero__text,
	.av-hero__actions {
		margin-inline-start: 0 !important;
		margin-inline-end: auto !important;
	}
}

@media (max-width: 390px) {
	.av-hero__eyebrow {
		letter-spacing: 0.16em;
	}

	.av-hero__eyebrow::before {
		width: 1.5rem;
	}

	.av-hero__subtitle {
		font-size: 1.05rem;
	}

	.av-hero__text {
		font-size: 1rem;
	}
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
	.av-header__nav .wp-block-navigation-item__content::after,
	.av-header__cta .wp-block-button__link,
	.av-hero__actions .wp-block-button__link {
		transition: none;
	}
}
