/* =========================================================
   Advisers Multipurpose — main.css
   Vanilla CSS. Mobile-first. No framework, no build step
   required (plain CSS custom properties + flex/grid).
   ========================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
	--am-color-primary: #0B5FFF;
	--am-color-secondary: #111827;
	--am-color-text: #1f2430;
	--am-color-muted: #6b7280;
	--am-color-border: #e5e7eb;
	--am-color-bg: #ffffff;
	--am-color-bg-alt: #f7f8fa;
	--am-header-bg: #ffffff;
	--am-header-text: #111827;
	--am-nav-bg: #111827;
	--am-nav-text: #ffffff;

	--am-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--am-font-heading: var(--am-font-body);

	--am-space-1: 0.5rem;
	--am-space-2: 1rem;
	--am-space-3: 1.5rem;
	--am-space-4: 2.5rem;
	--am-space-5: 4rem;

	--am-radius: 8px;
	--am-transition: 150ms ease-in-out;
}

/* ---------- 2. Base ---------- */
body {
	font-family: var(--am-font-body);
	color: var(--am-color-text);
	background-color: var(--am-color-bg);
	line-height: 1.6;
	font-size: 17px;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--am-font-heading);
	color: var(--am-color-secondary);
	line-height: 1.25;
	margin: 0 0 var(--am-space-2);
	font-weight: 700;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

p { margin: 0 0 var(--am-space-2); }

a {
	color: var(--am-color-primary);
	text-decoration: none;
	transition: color var(--am-transition);
}
a:hover, a:focus { color: var(--am-color-secondary); }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link.screen-reader-text:focus {
	position: fixed;
	top: 0; left: 0;
	width: auto; height: auto;
	background: var(--am-color-secondary);
	color: #fff;
	padding: var(--am-space-1) var(--am-space-2);
	z-index: 999999;
}

/* ---------- 3. Containers / layout ---------- */
.container {
	width: 95%;
	margin-inline: auto;
}
body.container-wide .container { width: 97%; }
body.container-fluid .container { width: 100%; padding-inline: var(--am-space-2); }

.layout-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: var(--am-space-4);
	padding-block: var(--am-space-4);
	align-items: flex-start;
}

#primary { flex: 1 1 0%; min-width: 0; }

body.layout-none #primary { flex-basis: 100%; }

body.layout-left .layout-wrap { flex-direction: row-reverse; }

#secondary { flex: 0 0 300px; max-width: 100%; }

/* When a sidebar is present, JS (main.js) caps #primary's visible height to
   #secondary's natural height and makes only the content column scroll —
   so the overall page length tracks the sidebar, not the (often longer)
   main content. Applied only once JS confirms it's actually needed. */
#primary.content-scrollable {
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: var(--am-space-1);
	scrollbar-width: thin;
	scrollbar-color: var(--am-color-border) transparent;
}
#primary.content-scrollable::-webkit-scrollbar { width: 8px; }
#primary.content-scrollable::-webkit-scrollbar-thumb {
	background: var(--am-color-border);
	border-radius: 8px;
}

@media (max-width: 782px) {
	.layout-wrap { flex-direction: column; }
	#secondary { flex-basis: 100%; order: 2; }
	#primary.content-scrollable {
		overflow-y: visible;
		max-height: none !important;
	}
}

/* ---------- 4. Header ---------- */
/* No fixed/sticky header by design — the header scrolls away with the
   page, like the rest of the content. */
.site-header {
	background: var(--am-color-bg);
	position: relative;
}

/* -- 4a. Branding row: logo left / title+tagline centered / CTA right -- */
.header-top {
	border-bottom: 1px solid var(--am-color-border);
	background: var(--am-header-bg, var(--am-color-bg));
}
.header-top-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--am-space-3);
	padding-block: var(--am-space-2);
	flex-wrap: wrap;
}
/* Logo + title/tagline anchored together on the left — the container's own
   edge margin (95% width) already provides a clean, consistent gap from the
   page edge, so nothing here needs absolute positioning or percentage math. */
.header-branding-group {
	display: flex;
	align-items: center;
	gap: var(--am-space-1);
}
.header-branding-center { text-align: left; }
.header-branding-cta { flex-shrink: 0; }

.custom-logo { max-height: 60px; width: auto; }
.site-logo-fallback { font-size: 1.5rem; font-weight: 700; }

.site-title { margin: 0; font-size: 1.6rem; line-height: 1.2; }
.site-title a { color: var(--am-header-text, var(--am-color-secondary)); }
.site-description { margin: 0.15rem 0 0; font-size: 0.9rem; color: var(--am-header-text, var(--am-color-muted)); opacity: 0.75; }
.site-logo-fallback { color: var(--am-header-text, var(--am-color-secondary)); }

.header-cta-button {
	background: var(--am-color-primary);
	color: #fff !important;
	padding: 0.6rem 1.2rem;
	border-radius: var(--am-radius);
	font-weight: 600;
	white-space: nowrap;
}
.header-cta-button:hover { opacity: 0.9; color: #fff !important; }

/* -- 4b. Navigation bar: full-width professional bar, centered menu -- */
.main-navigation {
	background: var(--am-nav-bg, var(--am-color-secondary));
}
.nav-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}
.main-navigation ul#primary-menu {
	list-style: none;
	display: flex;
	justify-content: center;
	gap: var(--am-space-3);
	margin: 0;
	padding: 0;
	flex-wrap: wrap;
}
.main-navigation a {
	display: block;
	color: var(--am-nav-text, #fff);
	font-weight: 500;
	padding: 0.9rem 0.2rem;
	border-bottom: 2px solid transparent;
	transition: border-color var(--am-transition), color var(--am-transition);
}
.main-navigation a:hover,
.main-navigation a:focus,
.main-navigation .current-menu-item > a {
	color: var(--am-nav-text, #fff);
	border-bottom-color: var(--am-color-primary);
}
.main-navigation ul ul {
	position: absolute;
	background: var(--am-nav-bg, var(--am-color-secondary));
	flex-direction: column;
	padding: 0;
	display: none;
	min-width: 200px;
	box-shadow: 0 12px 24px rgba(0,0,0,0.18);
	z-index: 10;
}
.main-navigation ul ul a { padding: 0.75rem 1rem; border-bottom: none; border-left: 2px solid transparent; }
.main-navigation ul ul a:hover { border-left-color: var(--am-color-primary); }
.main-navigation li { position: relative; }
.main-navigation li:hover > ul,
.main-navigation li:focus-within > ul { display: flex; }

.menu-toggle {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: var(--am-space-2);
	position: absolute;
	left: 0;
}
.menu-toggle-bar {
	display: block;
	width: 24px;
	height: 2px;
	background: var(--am-nav-text, #fff);
	margin: 5px 0;
}

@media (max-width: 782px) {
	.header-top-inner { justify-content: center; text-align: center; }
	.header-branding-group { flex-direction: column; gap: 0.25rem; }
	.header-branding-center { text-align: center; }
	.header-branding-cta { margin-inline: auto; }

	.nav-inner { justify-content: flex-start; padding-block: var(--am-space-1); }
	.menu-toggle { display: block; }
	.main-navigation ul#primary-menu { display: none; width: 100%; flex-direction: column; gap: 0; text-align: left; }
	.main-navigation.is-open ul#primary-menu { display: flex; }
	.main-navigation ul ul { position: static; display: none; box-shadow: none; padding-left: var(--am-space-2); }
	.main-navigation li.menu-item-has-children.is-open > ul { display: flex; }
}

/* ---------- 5. Breadcrumbs ---------- */
.breadcrumbs-wrap { padding-block: var(--am-space-1); font-size: 0.9rem; color: var(--am-color-muted); }
.advisers-multipurpose-breadcrumbs a { color: var(--am-color-muted); }

/* ---------- 6. Entry / content ---------- */
.entry-title { margin-bottom: var(--am-space-1); }
.entry-meta, .byline, .posted-on { color: var(--am-color-muted); font-size: 0.9rem; }
.entry-content { max-width: 100%; }
.entry-content > * + * { margin-top: var(--am-space-2); }
.entry-content img { border-radius: var(--am-radius); }
.page-featured-image, .post-featured-image { margin-bottom: var(--am-space-3); }
.page-featured-image img, .post-featured-image img { border-radius: var(--am-radius); width: 100%; }

/* ---------- 7. Post cards / archive list ---------- */
.post-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: var(--am-space-3);
}
.post-card {
	border: 1px solid var(--am-color-border);
	border-radius: var(--am-radius);
	overflow: hidden;
	background: var(--am-color-bg);
	display: flex;
	flex-direction: column;
}
.post-card-thumb img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.post-card-body { padding: var(--am-space-2); display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.post-card .entry-title { font-size: 1.15rem; margin: 0; }
.read-more { font-weight: 600; margin-top: auto; }

/* ---------- 8. Widgets / sidebar ---------- */
.widget { margin-bottom: var(--am-space-3); }
.widget-title { font-size: 1.1rem; margin-bottom: var(--am-space-1); }

/* ---------- 9. Footer ---------- */
.site-footer {
	background: var(--am-color-bg-alt);
	border-top: 1px solid var(--am-color-border);
	margin-top: var(--am-space-5);
}
.footer-widgets {
	display: grid;
	gap: var(--am-space-3);
	padding-block: var(--am-space-4);
}
.footer-columns-1 { grid-template-columns: 1fr; }
.footer-columns-2 { grid-template-columns: repeat(2, 1fr); }
.footer-columns-3 { grid-template-columns: repeat(3, 1fr); }
.footer-columns-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 782px) {
	.footer-columns-2, .footer-columns-3, .footer-columns-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
	.footer-columns-2, .footer-columns-3, .footer-columns-4 { grid-template-columns: 1fr; }
}
.site-info {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: var(--am-space-1);
	padding-block: var(--am-space-2);
	border-top: 1px solid var(--am-color-border);
	font-size: 0.9rem;
	color: var(--am-color-muted);
}
.footer-navigation ul { list-style: none; display: flex; gap: var(--am-space-2); margin: 0; padding: 0; }
.footer-navigation a { color: var(--am-color-muted); }

/* ---------- 10. Block-pattern sections (page-builder look) ---------- */
.am-hero {
	text-align: center;
	padding: var(--am-space-5) var(--am-space-2);
	background: var(--am-color-bg-alt);
}
.am-section { padding-block: var(--am-space-5); }
.am-cta-band {
	background: var(--am-color-primary);
	color: #fff;
	padding: var(--am-space-4) var(--am-space-2);
	text-align: center;
	border-radius: var(--am-radius);
}
.am-cta-band h2 { color: #fff; }
.am-pricing-card {
	border: 1px solid var(--am-color-border);
	border-radius: var(--am-radius);
	padding: var(--am-space-3);
	text-align: center;
}

.wp-block-button__link {
	background-color: var(--am-color-primary);
	border-radius: var(--am-radius);
}

/* ---------- 11. Forms / comments ---------- */
.search-form { display: flex; gap: 0.5rem; }
.search-field {
	flex: 1;
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--am-color-border);
	border-radius: var(--am-radius);
}
.search-submit {
	background: var(--am-color-primary);
	color: #fff;
	border: none;
	padding: 0.6rem 1rem;
	border-radius: var(--am-radius);
	cursor: pointer;
}
.comment-list { list-style: none; padding: 0; }
.comment-list li { border-top: 1px solid var(--am-color-border); padding-block: var(--am-space-2); }
input, textarea, select {
	font-family: inherit;
	font-size: 1rem;
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--am-color-border);
	border-radius: var(--am-radius);
	width: 100%;
}
button, input[type="submit"] {
	background: var(--am-color-primary);
	color: #fff;
	border: none;
	cursor: pointer;
	width: auto;
}

/* ---------- 12. Full-width / landing templates ---------- */
.full-width-template #primary,
.landing-main { max-width: 100%; }
.landing-main .entry-content { width: 95%; margin-inline: auto; padding-block: var(--am-space-2); }

/* ---------- 13. Accessibility / focus ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
	outline: 2px solid var(--am-color-primary);
	outline-offset: 2px;
}

/* ---------- 14. Print ---------- */
@media print {
	.site-header, .site-footer, .sidebar-right, .sidebar-left { display: none; }
}
