/* Agusta Enterprise — component styles not expressible via theme.json/block supports alone. */

/*
 * The homepage is built entirely from flex/grid containers with explicit
 * `gap` values controlling spacing — not default WordPress block-library
 * margins. Without this reset, core's default margin on headings/paragraphs
 * stacks on top of our gap, producing uneven, "distorted" spacing between
 * elements that have a default margin (headings, paragraphs) and elements
 * that don't (raw text, spans, custom markup). This scopes the reset to the
 * homepage only — blog posts (single.php) keep normal reading margins.
 */
.agusta-home p,
.agusta-home h1,
.agusta-home h2,
.agusta-home h3,
.agusta-home h4,
.agusta-home h5,
.agusta-home h6 {
	margin: 0;
}
/*
 * With default margins removed, give stacked content one consistent rhythm:
 * 14px between siblings in normal (flow/constrained) groups, 24px in the hero.
 * Flex/grid containers keep using their own `gap`. Block margins collapse,
 * so explicit larger margins (e.g. a 48px header margin) still win.
 */
.agusta-home .is-layout-flow > * + *,
.agusta-home .is-layout-constrained > * + * {
	margin-top: 14px;
}
.agusta-home .agusta-hero .is-layout-constrained > * + * {
	margin-top: 24px;
}
/* Grid/flex children are spaced by `gap` — a margin here would stagger them. */
.agusta-home .agusta-svc-grid > *,
.agusta-home .agusta-diff-grid > *,
.agusta-home .agusta-prism-grid > *,
.agusta-home .agusta-flagship > *,
.agusta-home .is-layout-flex > *,
.agusta-home .is-layout-grid > * {
	margin-top: 0 !important;
}

/* Headings: tighter leading than body copy, and balanced line breaks (no orphaned last word). */
.agusta-home h1,
.agusta-home h2,
.agusta-home h3 {
	line-height: 1.2;
	text-wrap: balance;
}

/* Logo */
.agusta-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.agusta-logo svg { display: block; flex: none; width: 36px; height: 36px; }
/* Whole-pixel line heights keep the logo on exact pixels (fractional offsets blur its edges). */
.agusta-logo-text { display: flex; flex-direction: column; }
.agusta-logo-wordmark { white-space: nowrap; line-height: 22px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--wp--preset--color--text); }
.agusta-logo-accent { color: #4FA3FF; } /* lighter brand blue: 6.2:1 on the navy header (accent blue is 3.6:1) */
.agusta-logo-tagline { font-family: var(--wp--preset--font-family--mono); line-height: 12px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wp--preset--color--muted); }

/* Header */
.agusta-header { position: sticky; top: 0; z-index: 50; background: rgba(2,32,67,0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--wp--preset--color--border); }
.agusta-header-inner { max-width: 1280px; margin: 0 auto; margin-left: max(0px, round(down, (100% - 1344px) / 2, 1px)); /* 1280px content + 2x32px padding */ padding: 18px 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.agusta-primary-nav-wrap { display: flex; }
.agusta-primary-nav { list-style: none; display: flex; align-items: center; gap: 28px; margin: 0; padding: 0; font-size: 14px; font-weight: 500; }
.agusta-primary-nav a { color: var(--wp--preset--color--muted); text-decoration: none; }
.agusta-primary-nav a:hover { color: var(--wp--preset--color--pop); }

/* Buttons */
.agusta-btn-primary, .agusta-btn-secondary {
	display: inline-block;
	font-family: var(--wp--preset--font-family--sans);
	font-weight: 600;
	font-size: 14px;
	padding: 10px 20px;
	line-height: 20px;
	border-radius: 6px;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}
.agusta-btn-primary { background: var(--wp--preset--color--accent); color: #fff; border: none; }
.agusta-btn-primary:hover { filter: brightness(1.08); color: #fff; }
.agusta-btn-secondary { background: transparent; color: var(--wp--preset--color--text); border: 1px solid var(--wp--preset--color--border); }
.agusta-btn-secondary:hover { border-color: var(--wp--preset--color--pop); color: var(--wp--preset--color--pop); }

/* Footer */
.agusta-footer { background: var(--wp--preset--color--bg); color: var(--wp--preset--color--muted); padding: 64px 32px 32px; }
.agusta-footer-inner { max-width: 1280px; margin: 0 auto; }
.agusta-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 32px; padding-bottom: 40px; border-bottom: 1px solid var(--wp--preset--color--border); }
.agusta-footer-grid h4, .agusta-footer-grid h5 { color: var(--wp--preset--color--text); margin: 0 0 10px; font-size: 14px; }
.agusta-footer-grid a { color: var(--wp--preset--color--muted); text-decoration: none; display: block; margin-bottom: 8px; font-size: 13.5px; }
.agusta-footer-grid a:hover { color: var(--wp--preset--color--text); }
.agusta-footer-legal { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; font-size: 12.5px; flex-wrap: wrap; gap: 10px; }
.agusta-footer-legal a { color: var(--wp--preset--color--muted); margin-left: 18px; text-decoration: none; }

/* Page/content wrapper for classic templates */
.agusta-content-wrap { max-width: 1280px; margin: 0 auto; padding: var(--wp--preset--spacing--70, 88px) 32px; }

/* Eyebrow tag (mono label used above section headings) */
.agusta-eyebrow { font-family: var(--wp--preset--font-family--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wp--preset--color--pop); }
.agusta-eyebrow.is-on-light { color: var(--wp--preset--color--accent-deep); }


/* Hero */
.agusta-hero { position: relative; background:
	radial-gradient(circle at 15% 20%, rgba(8,117,225,0.20), transparent 40%),
	radial-gradient(circle at 85% 0%, rgba(252,91,5,0.12), transparent 45%),
	radial-gradient(rgba(174,195,219,0.14) 1px, transparent 1px) 0 0/24px 24px,
	var(--wp--preset--color--bg);
}
.agusta-hero-badge { border: 1px solid var(--wp--preset--color--border); padding: 6px 12px; border-radius: 20px; display: inline-block; }
.agusta-fact-chip { border: 1px solid var(--wp--preset--color--border); background: var(--wp--preset--color--surface); border-radius: 8px; padding: 10px 16px; font-size: 13px; color: var(--wp--preset--color--muted); display: inline-block; }

/* Card grids */
.agusta-svc-grid, .agusta-diff-grid, .agusta-insight-grid, .agusta-prism-grid { display: grid; gap: 20px; }
.agusta-svc-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.agusta-diff-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.agusta-insight-grid, .agusta-prism-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }

.agusta-card { border: 1px solid var(--wp--preset--color--border); background: var(--wp--preset--color--surface); border-radius: 10px; padding: 32px; transition: transform .15s ease, border-color .15s ease; }
.agusta-card:hover { border-color: var(--wp--preset--color--pop); }
.agusta-svc-card:hover { transform: translateY(-2px); }

.agusta-diff-card { border: 1px solid var(--wp--preset--color--border); border-radius: 10px; padding: 24px; background: var(--wp--preset--color--surface); }
.agusta-diff-number { font-size: 26px; font-weight: 700; color: var(--wp--preset--color--accent); }

.agusta-flagship { border: 1px solid var(--wp--preset--color--border); background: linear-gradient(135deg, var(--wp--preset--color--raised), var(--wp--preset--color--surface)); border-radius: 12px; padding: 32px; display: flex; align-items: center; gap: 28px; }

/* Prism product browser-chrome preview */
.agusta-chrome { border: 1px solid var(--wp--preset--color--border); background: var(--wp--preset--color--bg); border-radius: 14px; overflow: hidden; }
.agusta-chrome-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--wp--preset--color--border); background: var(--wp--preset--color--raised); }
.agusta-chrome-dot { width: 9px; height: 9px; border-radius: 50%; background: #8A96A6; opacity: 0.5; display: inline-block; }
.agusta-stat-label { font-size: 12.5px; color: var(--wp--preset--color--muted); }
.agusta-stat-value { font-size: 24px; font-weight: 600; color: var(--wp--preset--color--text); margin-top: 4px; }
.agusta-status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.agusta-status-good { color: #0ca30c; } .agusta-status-good .agusta-status-dot { background: #0ca30c; }
.agusta-status-warning { color: #fab219; } .agusta-status-warning .agusta-status-dot { background: #fab219; }

/* Case-study placeholder */
.agusta-placeholder-card { border: 1px dashed var(--wp--preset--color--border); border-radius: 12px; padding: 32px; }

/* CTA band */
.agusta-cta-band { background:
	radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px) 0 0/24px 24px,
	linear-gradient(135deg, var(--wp--preset--color--raised), var(--wp--preset--color--surface));
}

/*
 * Alignment: sections use WordPress's "constrained" layout, which centers
 * every child — including narrower heading blocks (max-width 620-720px).
 * That pushed section headings ~370px right of the cards beneath them.
 * Pin any narrower child to the left edge of the 1280px content column
 * instead, so headings and cards share one left edge.
 */
.agusta-home .is-layout-constrained:not(.agusta-center) > [style*="max-width"]:not(.agusta-center) {
	margin-left: max(0px, calc((100% - var(--wp--style--global--content-size, 1280px)) / 2)) !important;
	margin-right: auto !important;
}

/*
 * Layout rule for the whole page: section intros (eyebrow, heading, intro
 * line), the hero, and the closing call-to-action are centered; card and
 * column body text stays left-aligned for readability. Elements opt in with
 * the .agusta-center class so the rule is explicit and editable.
 */
.agusta-home .agusta-center { text-align: center; }
.agusta-home .is-layout-constrained > .agusta-center,
.agusta-home .agusta-center:not(.is-layout-flex):not(.wp-block-buttons) > * {
	margin-left: auto !important;
	margin-right: auto !important;
}
.agusta-home .agusta-center.is-layout-flex,
.agusta-home .agusta-center .is-layout-flex,
.agusta-home .agusta-center.wp-block-buttons,
.agusta-home .agusta-center .wp-block-buttons {
	justify-content: center;
}


/* Prism preview table: override WordPress's default table styling (white borders, 3px header rule). */
.agusta-chrome .wp-block-table { margin: 0; overflow-x: auto; }
.agusta-chrome .wp-block-table table { border-collapse: collapse; width: 100%; font-size: 13px; }
.agusta-chrome .wp-block-table thead { border-bottom: 0; background: var(--wp--preset--color--surface); }
.agusta-chrome .wp-block-table th,
.agusta-chrome .wp-block-table td { border: 0; border-top: 1px solid var(--wp--preset--color--border); padding: 10px 14px; text-align: left; white-space: nowrap; }
.agusta-chrome .wp-block-table th { border-top: 0; color: var(--wp--preset--color--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.agusta-chrome .wp-block-table td:nth-child(3),
.agusta-chrome .wp-block-table th:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }
.agusta-chrome .wp-block-table figure, .agusta-chrome figure.wp-block-table { border: 1px solid var(--wp--preset--color--border); border-radius: 8px; }

/* Footer: plain-text items (phones, "coming soon") match link sizing. */
.agusta-footer-grid span { display: block; margin-bottom: 8px; font-size: 13.5px; }
.agusta-footer-grid a, .agusta-footer-grid span { overflow-wrap: anywhere; }

/* Icons inside cards */
.agusta-icon { display: block; line-height: 0; }

/* ---------- Accessibility & usability ---------- */

/* Skip link: hidden until focused by keyboard. */
.agusta-skip-link {
	position: absolute; left: 16px; top: -100px; z-index: 100;
	background: #fff; color: #022043; padding: 10px 16px; border-radius: 6px;
	font-weight: 600; text-decoration: none;
}
.agusta-skip-link:focus { top: 12px; }
main[tabindex="-1"]:focus { outline: none; }

/* One clear, high-contrast focus ring for every interactive element. */
a:focus-visible,
button:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 3px;
	border-radius: 4px;
}
.agusta-home #approach a:focus-visible { outline-color: #022043; }

.agusta-nav-cta { display: none; }

/* Mobile menu button (shown only on small screens). */
.agusta-menu-toggle {
	display: none; align-items: center; gap: 8px;
	min-height: 44px; padding: 0 12px;
	background: transparent; color: var(--wp--preset--color--text);
	border: 1px solid var(--wp--preset--color--border); border-radius: 6px;
	font: 600 14px var(--wp--preset--font-family--sans); cursor: pointer;
}
.agusta-menu-toggle-bars,
.agusta-menu-toggle-bars::before,
.agusta-menu-toggle-bars::after {
	display: block; width: 16px; height: 2px; background: currentColor; position: relative;
}
.agusta-menu-toggle-bars::before,
.agusta-menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
.agusta-menu-toggle-bars::before { top: -5px; }
.agusta-menu-toggle-bars::after { top: 5px; }

/* In-page links: land below the sticky header instead of underneath it. */
.agusta-home section[id],
main#main { scroll-margin-top: 84px; }
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
	.agusta-card, .agusta-svc-card { transition: none; }
	.agusta-svc-card:hover { transform: none; }
}

/* Footer headings (h2 for a correct outline, styled small) and notes. */
.agusta-footer-grid .agusta-footer-heading { color: var(--wp--preset--color--text); margin: 0 0 10px; font-size: 14px; line-height: 1.4; }
.agusta-footer-note { color: var(--wp--preset--color--muted); font-style: italic; }


/* Responsive */
@media (max-width: 900px) {
	.agusta-header-inner { flex-wrap: wrap; }
	.agusta-menu-toggle { display: inline-flex; order: 2; margin-left: auto; }
	.agusta-header-cta { display: none !important; }
	.agusta-primary-nav-wrap .agusta-nav-cta { display: block; text-align: center; margin: 8px 0 12px; padding: 12px 16px; font-size: 15px; }
	.agusta-primary-nav-wrap { display: none; order: 4; width: 100%; }
	.agusta-primary-nav-wrap.is-open { display: block; }
	.agusta-primary-nav-wrap .agusta-primary-nav { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0; }
	.agusta-primary-nav-wrap .agusta-primary-nav a { display: block; padding: 12px 4px; font-size: 16px; border-top: 1px solid var(--wp--preset--color--border); }
	.agusta-chrome .wp-block-table th:nth-child(2),
	.agusta-chrome .wp-block-table td:nth-child(2) { display: none; }
	.agusta-chrome .wp-block-table th,
	.agusta-chrome .wp-block-table td { padding: 8px 10px; }
	.agusta-chrome .wp-block-table { overflow-x: visible; }
	.agusta-chrome > .wp-block-group:last-child { padding: 16px !important; }
	.agusta-svc-grid, .agusta-diff-grid, .agusta-insight-grid, .agusta-prism-grid { grid-template-columns: 1fr !important; }
	.agusta-flagship { flex-direction: column !important; align-items: flex-start !important; }
	.agusta-home .agusta-hero-title { font-size: 40px !important; }
	.agusta-home .wp-block-columns { flex-wrap: wrap !important; }
	.agusta-chrome .is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
	.agusta-footer-grid { grid-template-columns: 1fr !important; gap: 24px; }
	.agusta-footer-legal { flex-direction: column; align-items: flex-start; }
	.agusta-footer-legal a { margin-left: 0; margin-right: 18px; }
	.agusta-header-inner { padding: 14px 16px; }
	.agusta-logo-tagline { display: none; }
	.agusta-home .agusta-hero p.has-large-font-size { font-size: 17px !important; line-height: 1.5; }
	.agusta-home h2.has-x-large-font-size { font-size: 28px !important; }
}
