/**
 * ICpEP-Qatar internal page template (page.php) — the front page's design
 * language applied to every other page: dot-grid mesh header band, the
 * shared fluid type scale/shadows/tokens from css/components.css, and the
 * same restrained Cyan/Secondary/Maroon/Navy palette. Enqueued only for
 * is_page() && ! is_front_page() (see inc/scripts.php).
 *
 * Prose (`.icpep-page-content`) is capped at a ~65ch reading width per the
 * ui-ux-pro-max skill, rather than the front page's full-bleed sections —
 * these pages are read, not browsed.
 */

:root {
	--icpep-page-prose-max-width: 720px;
}

/*
 * Full-bleed header/content bands. Same root cause and fix as the front
 * page (see css/front-page.css): Hello Elementor's parent theme.css boxes
 * `.site-main` to a Bootstrap-style responsive max-width whenever the
 * <body> lacks an `elementor-page-*` class, which page.php never gets.
 * `.icpep-page-content` (below) supplies the actual reading-width cap, so
 * the bands themselves need to reach the true viewport edges.
 */
body:not( [class*='elementor-page-'] ) .icpep-page {
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
}

/* ==========================================================
   Page header band
   ========================================================== */

.icpep-page-header {
	position: relative;
	background-color: #ffffff;
	/* The header is position:fixed sitewide (css/header-footer.css) and
	   out of document flow, so this band — the first thing in <main> —
	   needs its own clearance or the fixed header overlaps its title on
	   load. */
	padding-top: calc( var( --icpep-header-height, 76px ) + clamp( 3.5rem, 9vw, 5.5rem ) );
	padding-bottom: clamp( 2.5rem, 6vw, 3.5rem );
	text-align: center;
	overflow: hidden;
}

.icpep-page-header__mesh {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background-image:
		radial-gradient( circle at 12% 15%, rgba( 0, 163, 224, 0.14 ) 0%, rgba( 0, 163, 224, 0 ) 45% ),
		radial-gradient( circle at 88% 20%, rgba( 138, 21, 56, 0.08 ) 0%, rgba( 138, 21, 56, 0 ) 40% ),
		radial-gradient( circle at 1.5px 1.5px, rgba( 11, 19, 43, 0.07 ) 1.5px, transparent 0 );
	background-size: auto, auto, 28px 28px;
	background-repeat: no-repeat, no-repeat, repeat;
	-webkit-mask-image: linear-gradient( to bottom, #000 0%, #000 55%, transparent 100% );
	mask-image: linear-gradient( to bottom, #000 0%, #000 55%, transparent 100% );
}

.icpep-page-header__inner {
	position: relative;
	z-index: 1;
	max-width: 720px;
	margin-inline: auto;
	padding-inline: clamp( 1.25rem, 4vw, 3rem );
}

.icpep-page-header__eyebrow {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	font-family: var( --e-global-typography-text-font-family, 'Inter' ), sans-serif;
	font-weight: 600;
	font-size: var( --icpep-fs-xs );
	letter-spacing: 0.05em;
	text-transform: uppercase;
	/* cyan-deep, not raw Secondary — text on this glass badge only clears
	   2.87:1. */
	color: var( --icpep-cyan-deep );
	background-color: rgba( 255, 255, 255, 0.55 );
	backdrop-filter: blur( 10px ) saturate( 180% );
	-webkit-backdrop-filter: blur( 10px ) saturate( 180% );
	border: 1px solid rgba( 255, 255, 255, 0.7 );
	border-radius: 999px;
	padding: 0.35em 1em;
	margin-bottom: 1.25rem;
	box-shadow: var( --icpep-shadow-sm );
}

@media ( prefers-reduced-transparency: reduce ) {
	.icpep-page-header__eyebrow {
		background-color: #ffffff;
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
		border-color: var( --icpep-card-border );
	}
}

.icpep-page-header__title {
	font-family: var( --e-global-typography-primary-font-family, 'Plus Jakarta Sans' ), sans-serif;
	font-weight: 700;
	/* Between the front page's --icpep-fs-lg (section headings) and
	   --icpep-fs-xl (hero) — a page title should read as more important
	   than a section heading but shouldn't compete with the homepage hero. */
	font-size: clamp( 2rem, 1.6rem + 2vw, 2.75rem );
	line-height: 1.1;
	letter-spacing: -0.015em;
	color: var( --e-global-color-primary, #0b132b );
	margin: 0;
}

/* Optional — only rendered when a caller passes 'subtitle' through
   get_template_part()'s $args (see template-parts/page-header.php).
   Sits on the same mesh background as the eyebrow/title, not in a
   separate section below the hero. */
.icpep-page-header__subtitle {
	max-width: 560px;
	margin: 1rem auto 0;
	font-family: var( --e-global-typography-text-font-family, 'Inter' ), sans-serif;
	font-size: var( --icpep-fs-base );
	line-height: 1.6;
	color: #64748b;
}

/* ==========================================================
   Prose content
   ========================================================== */

.icpep-page-content-wrap {
	position: relative;
	background-color: #ffffff;
	border-top: 1px solid var( --icpep-card-border );
}

.icpep-page-content {
	max-width: var( --icpep-page-prose-max-width );
	margin-inline: auto;
	padding: clamp( 3rem, 7vw, 4.5rem ) clamp( 1.25rem, 4vw, 2rem ) clamp( 4rem, 9vw, 6rem );
}

.icpep-page-content h2 {
	font-family: var( --e-global-typography-primary-font-family, 'Plus Jakarta Sans' ), sans-serif;
	font-weight: 700;
	font-size: clamp( 1.35rem, 1.1rem + 1vw, 1.75rem );
	letter-spacing: -0.01em;
	line-height: 1.25;
	color: var( --e-global-color-primary, #0b132b );
	margin: 2.5rem 0 1rem;
}

.icpep-page-content h2:first-child {
	margin-top: 0;
}

.icpep-page-content h3 {
	font-family: var( --e-global-typography-primary-font-family, 'Plus Jakarta Sans' ), sans-serif;
	font-weight: 700;
	font-size: clamp( 1.1rem, 1rem + 0.4vw, 1.3rem );
	line-height: 1.3;
	color: var( --e-global-color-primary, #0b132b );
	margin: 2rem 0 0.75rem;
}

.icpep-page-content p,
.icpep-page-content li {
	font-family: var( --e-global-typography-text-font-family, 'Inter' ), sans-serif;
	font-size: var( --icpep-fs-base );
	line-height: 1.7;
	color: var( --e-global-color-text, #1f2937 );
}

.icpep-page-content p {
	margin: 0 0 1.25rem;
}

.icpep-page-content ul,
.icpep-page-content ol {
	margin: 0 0 1.5rem;
	padding-left: 1.35rem;
}

.icpep-page-content li {
	margin-bottom: 0.6rem;
}

.icpep-page-content li:last-child {
	margin-bottom: 0;
}

.icpep-page-content li > ul,
.icpep-page-content li > ol {
	margin-top: 0.6rem;
	margin-bottom: 0;
}

.icpep-page-content a {
	/* cyan-deep, not raw Secondary — link text on white only clears 2.87:1. */
	color: var( --icpep-cyan-deep );
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	transition: color 0.15s ease;
}

.icpep-page-content a:hover,
.icpep-page-content a:focus-visible {
	color: var( --e-global-color-accent, #8a1538 );
}

.icpep-page-content a:focus-visible {
	outline: 2px solid var( --icpep-cyan-deep );
	outline-offset: 3px;
	border-radius: 2px;
}

.icpep-page-content strong {
	color: var( --e-global-color-primary, #0b132b );
	font-weight: 600;
}

.icpep-page-content blockquote {
	margin: 2rem 0;
	padding: 1.5rem 1.75rem;
	background-color: var( --icpep-mist );
	border-left: 3px solid var( --e-global-color-secondary, #00a3e0 );
	border-radius: 12px;
	font-style: italic;
	color: var( --e-global-color-primary, #0b132b );
}

.icpep-page-content blockquote p:last-child {
	margin-bottom: 0;
}

@media ( prefers-reduced-motion: reduce ) {
	.icpep-page-content a {
		transition: none;
	}
}

/* ==========================================================
   Elementor Container/widget content — shared generic defaults
   ========================================================== */

/*
 * Every page built from real Elementor Container/widget content (About
 * Us, Leadership, Membership, Events Archive, News — see each page's
 * wp-content/migrations/build-{slug}-page.php and its matching
 * css/{slug}.css) needs these same base rules, so they live here rather
 * than being duplicated per page. Page-specific id-targeted rules layer
 * on top from each page's own stylesheet, loaded after this one.
 *
 * Every selector below is prefixed `#content` as load-order insurance
 * against Elementor's own generated CSS, which enqueues after this file
 * and ties several of these rules on class-only specificity otherwise
 * (e.g. Elementor's own `.elementor-widget:not(:last-child){margin-
 * block-end:var(--kit-widget-spacing,20px)}`) — see css/home.css's
 * header comment for the full explanation.
 */

/* Reset Elementor's own inter-widget margin — each page's section-inner
   containers use flex `gap` for spacing instead, so leaving both in
   would double it up. */
#content .icpep-page-elementor-content .elementor-widget {
	margin-block-end: 0;
}

#content .icpep-page-elementor-content .elementor-widget-text-editor p {
	font-family: var( --e-global-typography-text-font-family, 'Inter' ), sans-serif;
	font-size: var( --icpep-fs-base );
	line-height: 1.7;
	color: var( --e-global-color-text, #1f2937 );
	margin: 0 0 1rem;
}

#content .icpep-page-elementor-content .elementor-widget-text-editor p:last-child {
	margin-bottom: 0;
}

#content .icpep-page-elementor-content .elementor-widget-text-editor strong {
	color: var( --e-global-color-primary, #0b132b );
	font-weight: 600;
}

#content .icpep-page-elementor-content .elementor-icon-list-items {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
}

#content .icpep-page-elementor-content .elementor-icon-list-item {
	display: flex;
	align-items: flex-start;
	gap: 0.85rem;
}

#content .icpep-page-elementor-content .elementor-icon-list-icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin-top: 0.15rem;
	border-radius: 10px;
	background-color: #ffffff;
	box-shadow: var( --icpep-shadow-sm );
	/* cyan-deep, not raw Secondary — the icon sits on a white circle,
	   where #00A3E0 clears only 2.87:1 against the 3:1 non-text minimum. */
	color: var( --icpep-cyan-deep );
	font-size: 0.8rem;
}

/*
 * Elementor renders these icons as inline SVGs and its own generated
 * per-widget CSS sets `fill` directly (`.elementor-widget-icon-list
 * .elementor-icon-list-icon svg { fill: var(--e-global-color-primary); }`)
 * — setting `color` above has no effect on SVG fill on its own, since SVGs
 * don't default to `fill: currentColor`. Same specificity (0,2,1) as
 * Elementor's rule; wins on source order since this file loads after
 * Elementor's generated post CSS.
 */
#content .icpep-page-elementor-content .elementor-icon-list-icon svg {
	fill: var( --icpep-cyan-deep );
}

#content .icpep-page-elementor-content .elementor-icon-list-text {
	font-family: var( --e-global-typography-text-font-family, 'Inter' ), sans-serif;
	font-size: var( --icpep-fs-base );
	line-height: 1.65;
	color: var( --e-global-color-text, #1f2937 );
}
