/* Athar theme — Design System v2. Square corners everywhere; Lemon only on one button per screen. */

/* Arabic: switch the font roles, no letter-spacing, more line height. */
html:lang(ar) body,
html:lang(ar) .editor-styles-wrapper,
.editor-styles-wrapper:lang(ar) {
	--wp--preset--font-family--body: "IBM Plex Sans Arabic", "Noto Naskh Arabic", system-ui, sans-serif;
	--wp--preset--font-family--heading: "IBM Plex Sans Arabic", "Noto Naskh Arabic", system-ui, sans-serif;
	--wp--preset--font-family--display: "Thmanyah Serif Display", "Noto Naskh Arabic", serif;
}
html:lang(ar) body, html:lang(ar) body * { letter-spacing: 0 !important; }
html:lang(ar) body { line-height: 1.8; }
html:lang(ar) :where(h1, h2, h3, h4) { line-height: 1.45; }
html:lang(ar) .athar-display, html:lang(ar) .wp-block-quote, html:lang(ar) .wp-block-pullquote { font-weight: 700; line-height: 1.5; }
html:lang(ar) .wp-block-button__link { font-weight: 700; }

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(img) { max-width: 100%; height: auto; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
.wp-site-blocks > main { margin-block: 0; }
::selection { background: var(--wp--preset--color--lemon); color: var(--wp--preset--color--ink); }
:focus-visible { outline: 2px solid var(--wp--preset--color--lemon); outline-offset: 3px; }

/* Editorial type is kept for big moments only. */
.athar-display { font-family: var(--wp--preset--font-family--display) !important; font-weight: 500; letter-spacing: -0.025em; line-height: 1.04; text-wrap: balance; }
.athar-hero-title { font-size: var(--wp--preset--font-size--display) !important; margin: 0; }
.athar-page-title { font-size: var(--wp--preset--font-size--display); margin: 0; color: var(--wp--preset--color--white); }
.athar-lede { font-size: var(--wp--preset--font-size--large); line-height: 1.65; max-width: 600px; }
.athar-lede--wide { max-width: 760px; }
.athar-eyebrow, .athar-eyebrow a { font-size: 13px !important; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wp--preset--color--slate); text-decoration: none; margin: 0; }
html:lang(ar) .athar-eyebrow, html:lang(ar) .athar-eyebrow a { text-transform: none; font-size: 15px !important; font-weight: 500; }
.athar-note { font-size: 15px; color: var(--wp--preset--color--muted); margin: 0; }
.athar-center { text-align: center; }
.athar-muted { color: var(--wp--preset--color--muted); }
.athar-more { margin: 0; }
.athar-more a { font-weight: 600; font-size: 15px; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.athar-h-small { font-size: 24px !important; }
.athar-h-medium { font-size: clamp(26px, 2.6vw, 30px) !important; }
.athar-placeholder-text { color: var(--wp--preset--color--muted); border: 1px dashed var(--wp--preset--color--silver); padding: 16px 18px; }

/* Sections */
.athar-section { padding-block: clamp(64px, 8vw, 96px); margin-block: 0 !important; }
.athar-section--tight { padding-block: clamp(40px, 5vw, 64px); }
.athar-section--intro { padding-block: clamp(48px, 6vw, 80px); }
.athar-section--white { background: var(--wp--preset--color--white); border-block: 1px solid var(--wp--preset--color--stone); }
.athar-section--white + .athar-section--white { border-top: 0; }
.athar-section--ink { background: var(--wp--preset--color--ink); color: rgba(255, 255, 255, 0.82); }
.athar-section--ink :where(h1, h2, h3, h4, strong, .athar-stat__num) { color: var(--wp--preset--color--white); }
.athar-section--ink a:where(:not(.wp-block-button__link)) { color: var(--wp--preset--color--white); }
.athar-section--ink .athar-eyebrow, .athar-eyebrow--light { color: rgba(255, 255, 255, 0.7) !important; }
.athar-section--ink .athar-note { color: rgba(255, 255, 255, 0.75); }
.athar-section--ink .athar-lede { color: rgba(255, 255, 255, 0.82); }
.athar-section--hero { padding-block: clamp(48px, 6vw, 72px) clamp(64px, 8vw, 96px); position: relative; overflow: hidden; }
.athar-sections > .athar-section:first-child.athar-section--ink { border-top: 0; }
.athar-rule-above { border-top: 1px solid var(--wp--preset--color--stone); }
.athar-page-intro { padding-block: clamp(48px, 6vw, 80px) !important; margin-block: 0 !important; }
.athar-page-intro .athar-lede, .athar-page-intro .wp-block-post-excerpt { color: rgba(255, 255, 255, 0.82); }
.athar-archive-intro { margin-top: 16px; }
.wp-block-query-title.athar-display { margin: 0; }

/* Brand pattern: one cluster, hero only. */
.athar-section--hero::before {
	content: "";
	position: absolute;
	inset-inline-start: -80px;
	bottom: -80px;
	width: 480px;
	max-width: 50%;
	aspect-ratio: 4 / 3;
	background: url("../images/pattern-slate.svg") no-repeat center / contain;
	pointer-events: none;
}
html[dir="rtl"] .athar-section--hero::before { transform: scaleX(-1); }
.athar-section--hero > * { position: relative; }

/* Section heads: title left, text right, silver rule. */
.athar-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 48px; border-bottom: 1px solid var(--wp--preset--color--silver); padding-bottom: 24px; margin-bottom: 40px !important; }
.athar-section--ink .athar-section-head { border-color: rgba(255, 255, 255, 0.2); }
.athar-section-head__title { display: flex; flex-direction: column; gap: 12px; }
.athar-section-head__title > * { margin: 0 !important; }
.athar-section-head h2 { margin: 0; }
.athar-section-head__text { max-width: 520px; margin: 0 !important; color: var(--wp--preset--color--muted); }
.athar-section--ink .athar-section-head__text { color: rgba(255, 255, 255, 0.8); }
.athar-row-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; }
.athar-row-between > * { margin: 0 !important; }
.athar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 40px !important; }
.athar-row > * { margin: 0 !important; }
.athar-rule-below { border-bottom: 1px solid var(--wp--preset--color--silver); padding-bottom: 20px; margin-bottom: 24px !important; }

/* Hero */
.athar-hero-columns { gap: 48px !important; align-items: stretch !important; }
.athar-hero-columns > .wp-block-column:first-child { display: flex; flex-direction: column; justify-content: center; gap: 26px; }
.athar-hero-columns > .wp-block-column:first-child > * { margin: 0; }
.athar-hero-image { margin: 0; height: 100%; display: flex; flex-direction: column; gap: 12px; }
.athar-hero-image img { width: 100%; height: 100% !important; min-height: 520px; object-fit: cover; flex: 1; }
.athar-hero-image figcaption { color: rgba(255, 255, 255, 0.7); margin: 0; text-align: start; }
@media (max-width: 781px) { .athar-hero-image img { min-height: 320px; } }

/* Buttons: square, Lemon reserved for the main action. */
.wp-block-button .wp-block-button__link { border-radius: 0; min-height: 52px; display: inline-flex; align-items: center; box-sizing: border-box; border: 1px solid transparent; }
.wp-block-button.is-style-lemon .wp-block-button__link { background: var(--wp--preset--color--lemon); color: var(--wp--preset--color--ink); }
.wp-block-button.is-style-lemon .wp-block-button__link:hover { background: var(--wp--preset--color--lemon-hover); color: var(--wp--preset--color--ink); }
.wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--wp--preset--color--ink); border-color: var(--wp--preset--color--ink); padding-block: 14px; }
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--white); }
.athar-section--ink .wp-block-button.is-style-outline .wp-block-button__link { color: var(--wp--preset--color--white); border-color: rgba(255, 255, 255, 0.35); }
.athar-section--ink .wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink); }
.wp-block-button.is-style-text-link .wp-block-button__link { background: transparent; color: var(--wp--preset--color--ink); padding-inline: 4px; text-decoration: underline; text-underline-offset: 5px; }
.wp-block-buttons { gap: 14px; }

/* Image treatments (Image direction board): Natural + light Ink, and Ink print. */
.is-style-natural-ink { position: relative; }
.is-style-natural-ink:is(figure, .wp-block-post-featured-image) { overflow: hidden; }
.wp-block-image.is-style-natural-ink > img, .wp-block-post-featured-image.is-style-natural-ink img { display: block; }
.wp-block-image.is-style-natural-ink::after,
.wp-block-post-featured-image.is-style-natural-ink::after,
.wp-block-cover.is-style-natural-ink::after { content: ""; position: absolute; inset: 0; background: var(--wp--preset--color--ink); mix-blend-mode: color; opacity: 0.2; pointer-events: none; }
.wp-block-image.is-style-natural-ink:has(figcaption)::after { bottom: auto; height: calc(100% - 2.6em); }
.is-style-ink-print { background: var(--wp--preset--color--slate); }
.is-style-ink-print img, .wp-block-cover.is-style-ink-print .wp-block-cover__image-background { filter: grayscale(1) contrast(1.1); mix-blend-mode: luminosity; }
.athar-fill-image { margin: 0; height: 100%; }
.athar-fill-image img { width: 100%; height: 100% !important; min-height: 460px; object-fit: cover; }

/* Cards */
.athar-cards { display: grid; gap: 24px; }
.athar-cards--3 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.athar-cards > * { margin: 0 !important; }
.wp-block-group.is-style-card { background: var(--wp--preset--color--white); border: 1px solid var(--wp--preset--color--stone); padding: 32px; display: flex; flex-direction: column; gap: 14px; transition: box-shadow 0.2s; }
.wp-block-group.is-style-card > * { margin: 0 !important; }
.wp-block-group.is-style-card:hover { box-shadow: 0 20px 40px -12px rgba(14, 29, 45, 0.22); }
.wp-block-group.is-style-card h3 { font-size: 26px; line-height: 1.2; }
html:lang(ar) .wp-block-group.is-style-card h3 { line-height: 1.5; }
.athar-card-text { flex: 1; font-size: 16px; }
.athar-section--white .is-style-card { background: var(--wp--preset--color--white-smoke); }
.athar-post-card { padding: 0 0 24px !important; gap: 10px !important; height: 100%; box-sizing: border-box; }
.athar-post-card .wp-block-post-featured-image { margin: 0 !important; }
.athar-post-card .athar-card-pad { padding-inline: 24px; margin: 0; }
.athar-post-card .wp-block-post-title { font-size: 20px !important; line-height: 1.3; }
.athar-post-card .wp-block-post-title a { text-decoration: none; }
.wp-block-post-template.is-layout-grid { gap: 24px; }

/* Impact numbers */
.athar-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 32px; margin-bottom: 32px !important; }
.athar-stats > * { margin: 0 !important; }
.wp-block-group.is-style-stat { border-top: 2px solid var(--wp--preset--color--ink); padding-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.wp-block-group.is-style-stat > * { margin: 0 !important; }
.athar-stat__num { font-family: var(--wp--preset--font-family--display); font-weight: 500; font-size: var(--wp--preset--font-size--number); line-height: 1; letter-spacing: -0.03em; color: var(--wp--preset--color--ink); }
html:lang(ar) .athar-stat__num { font-weight: 700; line-height: 1.2; }
.athar-stat__label { font-size: 16px; color: var(--wp--preset--color--muted); }
.athar-section--ink .wp-block-group.is-style-stat { border-color: var(--wp--preset--color--lemon); }

/* Founder story / feature */
.athar-feature { background: var(--wp--preset--color--white); border: 1px solid var(--wp--preset--color--stone); gap: 0 !important; }
.athar-feature > .wp-block-column:last-child { padding: clamp(32px, 4vw, 56px) clamp(24px, 4vw, 48px); display: flex; flex-direction: column; gap: 22px; justify-content: center; }
.athar-feature > .wp-block-column:last-child > * { margin: 0; }
.athar-founder-quote { border: 0 !important; padding: 0 !important; margin: 0; }
.athar-founder-quote p { font-family: var(--wp--preset--font-family--display); font-size: clamp(30px, 3vw, 42px); line-height: 1.2; color: var(--wp--preset--color--ink); margin: 0 0 22px; }
.athar-founder-quote cite { display: block; font-family: var(--wp--preset--font-family--body); font-style: normal; font-size: 16px; color: var(--wp--preset--color--charcoal); border-top: 1px solid var(--wp--preset--color--silver); padding-top: 18px; max-width: 420px; }

/* Along the Nile */
.athar-where { gap: 56px !important; }
.athar-where > .wp-block-column:first-child > * { margin-block: 0 16px; }
.athar-nile { list-style: none; margin: 0; padding: 8px 0; position: relative; display: flex; flex-direction: column; gap: 44px; }
.athar-nile::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 9px; width: 3px; background: var(--wp--preset--color--ink); }
.athar-nile li { position: relative; padding-inline-start: 44px; font-size: 16px; color: var(--wp--preset--color--charcoal); }
.athar-nile li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.35em; width: 20px; height: 20px; background: var(--wp--preset--color--ink); box-sizing: border-box; }
.athar-nile li:first-child::before { background: var(--wp--preset--color--white); border: 3px solid var(--wp--preset--color--ink); }
.athar-nile strong { display: block; font-family: var(--wp--preset--font-family--heading); font-size: 19px; color: var(--wp--preset--color--ink); }

/* Numbered steps and roadmap */
.athar-numbered { list-style: none; counter-reset: athar; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); column-gap: 32px; }
.athar-numbered li { counter-increment: athar; border-top: 1px solid var(--wp--preset--color--stone); padding: 22px 0 22px 44px; position: relative; font-size: 16px; color: var(--wp--preset--color--muted); }
html[dir="rtl"] .athar-numbered li { padding: 22px 44px 22px 0; }
.athar-numbered li::before { content: counter(athar, decimal-leading-zero); position: absolute; inset-inline-start: 0; top: 24px; font: 600 15px/1.4 Inter, system-ui, sans-serif; color: var(--wp--preset--color--slate); }
.athar-numbered strong { display: block; font-family: var(--wp--preset--font-family--heading); font-size: 19px; color: var(--wp--preset--color--ink); margin-bottom: 4px; }
.athar-roadmap { list-style: none; counter-reset: road; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 0; }
.athar-roadmap li { counter-increment: road; border-top: 6px solid var(--wp--preset--color--stone); padding: 18px 20px 0 0; font-size: 15px; color: var(--wp--preset--color--muted); }
html[dir="rtl"] .athar-roadmap li { padding: 18px 0 0 20px; }
.athar-roadmap li:first-child { border-color: var(--wp--preset--color--ink); }
.athar-roadmap li::before { content: counter(road, decimal-leading-zero); display: block; font: 600 13px/1.4 Inter, system-ui, sans-serif; color: var(--wp--preset--color--slate); margin-bottom: 6px; }
.athar-roadmap strong { display: block; font-family: var(--wp--preset--font-family--heading); font-size: 20px; color: var(--wp--preset--color--ink); margin-bottom: 4px; }

/* Statement */
.athar-section--statement { text-align: center; }
.athar-statement { font-family: var(--wp--preset--font-family--display); font-weight: 500; font-size: clamp(36px, 4.6vw, 64px); line-height: 1.12; letter-spacing: -0.02em; color: var(--wp--preset--color--ink); max-width: 1000px; margin-inline: auto !important; text-wrap: balance; }
html:lang(ar) .athar-statement { font-weight: 700; line-height: 1.5; }

/* Partners */
.athar-partners { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 12px; align-items: center; }
.athar-partners > * { margin: 0 !important; }
.athar-partner-logo { height: 80px; display: flex; align-items: center; justify-content: center; padding: 12px; box-sizing: border-box; }
.athar-partner-logo img { max-height: 48px !important; width: auto !important; max-width: 100%; object-fit: contain; filter: grayscale(1); opacity: 0.6; transition: filter 0.2s, opacity 0.2s; }
.athar-partner-logo:hover img { filter: none; opacity: 1; }

/* Newsletter & split layouts */
.athar-newsletter, .athar-split { gap: 48px !important; align-items: end !important; }
.athar-split { align-items: start !important; }
.athar-newsletter h2 { margin-bottom: 10px; }

/* Programme page content */
.athar-block-gap > * + * { margin-top: 0; }
.athar-faq { margin-top: clamp(56px, 6vw, 88px) !important; max-width: 760px; }
.athar-faq h2 { margin-bottom: 24px; }
.wp-block-details { border-top: 1px solid var(--wp--preset--color--stone); padding-block: 16px; margin: 0 !important; }
.wp-block-details:last-child { border-bottom: 1px solid var(--wp--preset--color--stone); }
.wp-block-details summary { font-size: 17px; font-weight: 500; color: var(--wp--preset--color--ink); cursor: pointer; }
.wp-block-details p { margin: 12px 0 0; }
.athar-delivered { margin-top: clamp(56px, 6vw, 88px) !important; border-top: 1px solid var(--wp--preset--color--silver); padding-top: 20px; }
.athar-section--check .athar-check__result { background: var(--wp--preset--color--white-smoke); }
.athar-project-facts .athar-facts { margin-bottom: 0; }

/* Single article */
.athar-meta-row { gap: 12px; align-items: baseline; }
.athar-meta-row > * { margin: 0 !important; }
.wp-block-post-excerpt.athar-lede p { margin: 0; }

/* Query pagination */
.wp-block-query-pagination { margin-top: 40px; }
.wp-block-query-pagination a, .wp-block-query-pagination .page-numbers { text-decoration: none; padding: 8px 12px; }
.wp-block-query-pagination .page-numbers.current { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--white); }

/* Search block */
.wp-block-search__input { border-radius: 0; border: 1px solid var(--wp--preset--color--silver); min-height: 48px; }
.wp-block-search__button { border-radius: 0; background: var(--wp--preset--color--lemon); color: var(--wp--preset--color--ink); border: 0; }

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}

/* Sections whose block has nothing to show (e.g. no eligibility check on a closed call) collapse. */
.athar-section:not(:has(> *)),
.athar-section:has(> .wp-block-post-content:empty) { display: none; }

/* Narrow text inside wide sections starts where the content starts (not centred). */
.is-layout-constrained > :is(.athar-lede, .athar-archive-intro) {
	margin-inline-start: max(0px, calc((100% - 1240px) / 2)) !important;
	margin-inline-end: auto !important;
}
.athar-placeholder-text { box-sizing: border-box; }

/* Partnership areas (on Ink) */
.athar-areas { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.athar-areas li { border-top: 1px solid rgba(255, 255, 255, 0.18); padding: 14px 0 14px 28px; position: relative; font-size: 17px; color: var(--wp--preset--color--white); }
html[dir="rtl"] .athar-areas li { padding: 14px 28px 14px 0; }
.athar-areas li::before { content: "—"; position: absolute; inset-inline-start: 0; color: var(--wp--preset--color--lemon); }
.athar-split > .wp-block-column > * + * { margin-top: 18px; }

/* Mission and vision, team numbers, alumni cards */
.athar-mv h3 { margin: 0 0 4px; }
.athar-mv p { margin: 0; font-size: 17px; line-height: 1.7; }
.athar-why { margin-top: 48px !important; color: var(--wp--preset--color--charcoal); }
.athar-stats--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0 !important; }
.athar-alumni-card .athar-eyebrow .athar-chip { font-size: 12px; }
.athar-alumni-card h3 span[lang="en"] { font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; }

/* Partner logo with a required credit line (e.g. Drosos: "Strategic partner") */
.athar-partner-logo:has(figcaption) { flex-direction: column; gap: 4px; }
.athar-partner-logo figcaption { margin: 0 !important; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--wp--preset--color--muted, #5B626C); text-align: center; }
.athar-partner-logo:has(figcaption) img { max-height: 36px !important; }

/* v2 copy: award line, proof statement, light list, numbered list on ink */
.athar-award { font-size: 14px; font-weight: 600; color: var(--wp--preset--color--ink); margin-top: 24px !important; margin-bottom: 8px !important; padding-inline-start: 14px; border-inline-start: 3px solid var(--wp--preset--color--lemon); }
.athar-award a { color: inherit; }
.athar-award--light, .athar-section--ink .athar-award { color: var(--wp--preset--color--white); }
.athar-statement--proof { font-size: clamp(24px, 3vw, 38px) !important; line-height: 1.25 !important; max-width: 1240px !important; text-align: start !important; text-wrap: pretty; }
.athar-section--ink .athar-statement { color: var(--wp--preset--color--white); }
.athar-statement--proof + .athar-row-between { margin-top: 28px !important; }
.athar-areas--light { list-style: none; margin: 0; border-bottom: 0; }
.athar-areas--light li { padding-block: 16px; border-top: 0; border-bottom: 1px solid var(--wp--preset--color--stone); color: var(--wp--preset--color--charcoal); }
.athar-areas--light li strong { color: var(--wp--preset--color--ink); }
.athar-section--ink .athar-numbered li, .athar-section--ink .athar-numbered li::before { color: rgba(255, 255, 255, 0.85); border-color: rgba(255, 255, 255, 0.2); }
.athar-block-gap { margin-top: 48px !important; }
.athar-section--ink .athar-numbered strong { color: var(--wp--preset--color--white); }

/* Six figures read best as 3 + 3 */
@media (min-width: 782px) { .athar-stats:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, 1fr); } }
.athar-areas--light li::before { color: var(--wp--preset--color--slate); }
/* Long figures in dense grids (5 per row) shrink so "17,900+" fits its column */
@media (min-width: 1100px) { .athar-stats:has(> :nth-child(7)) .athar-stat__num { font-size: clamp(44px, 4.2vw, 60px); } }
.athar-stat__num { overflow-wrap: normal; white-space: nowrap; }
