/**
 * IEC Portal Chapter — base chrome.
 * Members UI styling remains in portal/billing plugin CSS.
 * Tokens adapted from iecportal-marketing.
 */

:root {
	--iec-ch-bg: #f7f8fa;
	--iec-ch-surface: #ffffff;
	--iec-ch-text: #1a1f2e;
	--iec-ch-muted: #5c6478;
	--iec-ch-line: #dfe3eb;
	--iec-ch-brand: #1e4fd6;
	--iec-ch-brand-dark: #163ea8;
	--iec-ch-brand-soft: #e8eefb;
	--iec-ch-radius: 12px;
	--iec-ch-font: "DM Sans", system-ui, sans-serif;
	--iec-ch-header-h: 56px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	margin: 0;
}

body.iecportal-chapter {
	margin: 0;
	min-height: 100vh;
	font-family: var(--iec-ch-font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--iec-ch-text);
	background: var(--iec-ch-bg);
	-webkit-font-smoothing: antialiased;
}

body.iecportal-chapter.iec-chapter-chrome-off {
	background: var(--iec-ch-bg);
}

.iec-chapter-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	padding: 0.5rem 0.75rem;
	background: var(--iec-ch-brand);
	color: #fff;
	text-decoration: none;
}

.iec-chapter-skip:focus {
	left: 0.75rem;
	top: 0.75rem;
}

/* Members / generic chrome */
.iec-chapter-header {
	position: sticky;
	top: 0;
	z-index: 40;
	background: var(--iec-ch-surface);
	border-bottom: 1px solid var(--iec-ch-line);
}

.iec-chapter-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: var(--iec-ch-header-h);
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1.25rem;
}

.iec-chapter-logo {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	line-height: 0;
}

.iec-chapter-logo img {
	display: block;
	height: 32px;
	width: auto;
	max-width: 160px;
}

.iec-chapter-header__meta {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	min-width: 0;
}

.iec-chapter-header__site {
	font-size: 13px;
	font-weight: 600;
	color: var(--iec-ch-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 14rem;
}

.iec-chapter-nav__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.iec-chapter-nav__list a {
	font-size: 14px;
	font-weight: 500;
	color: var(--iec-ch-text);
	text-decoration: none;
}

.iec-chapter-nav__list a:hover {
	color: var(--iec-ch-brand);
}

.iec-chapter-main {
	min-height: calc(100vh - var(--iec-ch-header-h) - 52px);
}

body.iec-chapter-chrome-off .iec-chapter-main {
	min-height: 100vh;
}

.iec-chapter-footer {
	border-top: 1px solid var(--iec-ch-line);
	background: var(--iec-ch-surface);
}

.iec-chapter-footer__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0.85rem 1.25rem;
}

.iec-chapter-footer__copy {
	margin: 0;
	font-size: 12px;
	color: var(--iec-ch-muted);
}

/* Page shells */
.iec-chapter-page {
	max-width: 1200px;
	margin: 0 auto;
	padding: 1.25rem 1.25rem 2.5rem;
}

.iec-chapter-page--narrow {
	max-width: 40rem;
}

.iec-chapter-page--members {
	/* Let membership layout breathe; plugin CSS owns the UI. */
	max-width: none;
	padding: 1rem 1.25rem 2rem;
}

.iec-chapter-page--admin {
	max-width: none;
	padding: 0;
	margin: 0;
}

.iec-chapter-page__title {
	margin: 0 0 1rem;
}

.iec-chapter-page__title h1,
.iec-chapter-page__title a {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--iec-ch-text);
	text-decoration: none;
}

.iec-chapter-login-wrap {
	min-height: 100vh;
}

.iec-chapter-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.55rem 1rem;
	border-radius: 8px;
	background: var(--iec-ch-brand);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}

.iec-chapter-btn:hover {
	background: var(--iec-ch-brand-dark);
	color: #fff;
}

/* Members: hide WP page title noise; keep plugin heading */
body.iec-chapter-surface-members .entry-header,
body.iec-chapter-surface-members .page-title,
body.iec-chapter-surface-members .breadcrumb,
body.iec-chapter-surface-members .breadcrumbs {
	display: none !important;
}

/* Chapter Admin: edge-to-edge for plugin app shell */
body.iec-chapter-surface-admin .iec-chapter-main,
body.iec-chapter-surface-admin .iec-chapter-page--admin {
	background: var(--iec-ch-bg);
}

body.iec-chapter-surface-admin .iec-ca-app {
	min-height: 100vh;
	margin: 0;
	border: 0;
	border-radius: 0;
}

/* Align portal login panel with theme tokens */
body.iec-chapter-surface-login .iec-ap-portal-login {
	background: var(--iec-ch-bg);
	min-height: 100vh;
}

body.iec-chapter-surface-login .iec-ap-portal-login__product {
	color: var(--iec-ch-brand);
}

body.iec-chapter-surface-login .iec-ap-member-login-form-wrap #iec_ap_wp_submit {
	background: var(--iec-ch-brand);
}

body.iec-chapter-surface-login .iec-ap-member-login-form-wrap #iec_ap_wp_submit:hover {
	background: var(--iec-ch-brand-dark);
}

@media (max-width: 720px) {
	.iec-chapter-header__site {
		display: none;
	}

	.iec-chapter-page--members {
		padding-left: 0.75rem;
		padding-right: 0.75rem;
	}
}
