/*
 * Ekhaa 2026 — the inner pages layer.
 *
 * Loaded LAST, after a11y.css. It exists because the site has twenty-two pages
 * and the first six only needed cards, rows and arches. These are the patterns
 * the remaining sixteen need — section navigation, a document shelf, a people
 * board, an article list, a photograph wall and an article body.
 *
 * Three rules this file keeps to, so it never fights the design system:
 *
 *   1. No colour literal that carries text. Every ink and every ground is a
 *      token from style.css, so the high-contrast switch in a11y.css reaches
 *      this file for free — that switch works by redefining the tokens, and a
 *      hard-coded #5b6477 here would simply ignore it.
 *   2. No `!important`. a11y.css is loaded before this file but its overrides
 *      are flagged; nothing here outranks them.
 *   3. No animation and no transition that is not already cancelled by the
 *      global `:root[data-ekhaa-motion="off"] *` rule at the end of motion.css.
 *      Anything that moves here moves by transition only, so switching motion
 *      off stops it completely rather than shortening it.
 */

/* ==========================================================================
   1. Section navigation
   Twenty-two pages do not fit in one menu bar. The header keeps the eight
   section entrances; each page then shows the siblings inside its own section,
   so nothing on the site is more than two clicks away.
   ========================================================================== */

.ekhaa-subnav {
	background: var(--paper);
	border-bottom: 1px solid var(--line);
}

.ekhaa-subnav ul {
	display: flex;
	flex-wrap: wrap;
	gap: .2rem;
	list-style: none;
	margin: 0;
	padding: .55rem 0;
}

.ekhaa-subnav a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: .4rem .9rem;
	border-radius: var(--radius-sm);
	color: var(--ink);
	font-size: .95rem;
	font-weight: 500;
	text-decoration: none;
}

.ekhaa-subnav a:hover { background: var(--cream); color: var(--clay-deep); }

/* The page you are on is marked by weight and a diamond, never by colour
   alone — WCAG 1.4.1. */
.ekhaa-subnav [aria-current="page"] {
	font-weight: 700;
	color: var(--clay-deep);
	background: var(--cream);
}
.ekhaa-subnav [aria-current="page"]::before {
	content: "";
	width: 8px;
	height: 8px;
	margin-inline-end: .5rem;
	background: var(--gold);
	transform: rotate(45deg);
	flex: none;
}

/* ==========================================================================
   2. A document shelf
   Seventeen initiative files, twelve newsletters, two financial statements.
   Cards at that count become a wall; a row that states its file type and
   weight is what a visitor actually scans.
   ========================================================================== */

.docs { display: grid; gap: .5rem; }

.doc {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.2rem;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}

.doc:hover,
.doc:focus-within { border-color: var(--sand); box-shadow: var(--shadow); }

.doc__icon {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	flex: none;
	border-radius: 11px;
	background: var(--cream);
	color: var(--clay-deep);
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .04em;
}

.doc__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading, "El Messiri", sans-serif);
	font-size: 1.08rem;
	line-height: 1.5;
}

.doc__title a { color: var(--ink); text-decoration: none; }
.doc__title a:hover { color: var(--clay-deep); text-decoration: underline; }

.doc__meta {
	margin: .15rem 0 0;
	color: var(--muted);
	font-size: .88rem;
	max-width: none;
}

/* The affordance on the end of the row. It is decorative: the accessible name
   lives on the link in .doc__title, so this carries aria-hidden and is never
   a second tab stop. */
.doc__get {
	flex: none;
	color: var(--clay-deep);
	font-size: 1.3rem;
	line-height: 1;
}

/* A document with no file attached must say so rather than offer a dead link. */
.doc--nofile { background: var(--paper); }
.doc--nofile .doc__icon { background: #fff; border: 1px solid var(--line); color: var(--muted); }

@media (max-width: 560px) {
	.doc { grid-template-columns: auto 1fr; }
	.doc__get { display: none; }
}

/* ==========================================================================
   3. A people board
   Thirteen trustees. The arch is the house's frame for a photograph, so the
   portraits use a small one rather than the circle the old page pasted in.
   ========================================================================== */

.people {
	display: grid;
	gap: clamp(1.2rem, 2.4vw, 2rem);
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.person { text-align: center; }

.person .arch { aspect-ratio: 1 / 1.12; margin-bottom: .9rem; }

.person__name {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.5;
	color: var(--ink);
}

.person__role {
	display: inline-block;
	margin-top: .45rem;
	color: var(--muted);
	font-size: .9rem;
}

/* A person with no photograph still gets the frame, with their initial letter
   inside it — never an empty box and never a stock face. */
.person__blank {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	background: var(--cream);
	color: var(--clay-deep);
	font-family: var(--wp--preset--font-family--heading, "El Messiri", sans-serif);
	font-size: 2.6rem;
	font-weight: 700;
}

/* The chair and the chief executive are named differently, so their badge is. */
.person--lead .person__role {
	background: var(--cream);
	color: var(--clay-deep);
	font-weight: 700;
	padding: .15rem .8rem;
	border-radius: 999px;
}

/* ==========================================================================
   4. A roster inside a card
   The four board committees: a remit, then the members and what each is on the
   committee as. A definition list is the honest markup for name → seat.
   ========================================================================== */

.roster { margin: 1.1rem 0 0; }

.roster div {
	display: flex;
	flex-wrap: wrap;
	gap: .2rem .6rem;
	align-items: baseline;
	padding: .55rem 0;
	border-top: 1px solid var(--line);
}

.roster dt { margin: 0; font-weight: 600; color: var(--ink); }
.roster dd { margin: 0; color: var(--muted); font-size: .9rem; }

/* ==========================================================================
   5. Articles
   News and the blog share one list. The headline is the link and the whole
   card is clickable through .ekhaa-card__link, which already exists.
   ========================================================================== */

.articles {
	display: grid;
	gap: clamp(1.1rem, 2.2vw, 1.8rem);
	grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}

.article-card { display: flex; flex-direction: column; }

.article-card__media {
	margin: calc(-1 * clamp(1.4rem, 2.3vw, 2.1rem));
	margin-bottom: 1.1rem;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--cream);
}

.article-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.article-card time {
	display: block;
	color: var(--muted);
	font-size: .86rem;
	margin-bottom: .35rem;
}

.article-card h3 { font-size: 1.22rem; margin-bottom: .45rem; }
.article-card h3 a { color: var(--ink); text-decoration: none; }
.article-card h3 a:hover { color: var(--clay-deep); }

/* The lead article on the news page is given the width it had on the old page,
   where it ran as a single banner with the text beside it. */
.article-lead { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }

@media (min-width: 900px) {
	.article-lead { grid-template-columns: .9fr 1.1fr; }
}

/* ==========================================================================
   6. Article body
   singular.php has always asked for `.ekhaa-prose` and for
   `.ekhaa-section--tint`; neither was ever defined, so every page without its
   own template rendered its text full-bleed and unstyled. Defined here.
   ========================================================================== */

.ekhaa-prose { max-width: var(--measure); }
.ekhaa-prose > * { max-width: 100%; }
.ekhaa-prose h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-top: 2em; }
.ekhaa-prose h3 { margin-top: 1.6em; }
.ekhaa-prose p { color: var(--ink); }
.ekhaa-prose ul, .ekhaa-prose ol { padding-inline-start: 1.4rem; color: var(--ink); }
.ekhaa-prose li { margin-bottom: .5em; }
.ekhaa-prose img { border-radius: var(--radius-sm); }

.ekhaa-prose blockquote {
	margin: 1.8em 0;
	padding: .2rem 1.4rem;
	border-inline-start: 3px solid var(--gold);
	color: var(--ink);
	font-family: var(--wp--preset--font-family--heading, "El Messiri", sans-serif);
	font-size: 1.15rem;
}

.ekhaa-prose figcaption,
.ekhaa-prose .wp-caption-text { color: var(--muted); font-size: .9rem; }

/* The tint singular.php names. Same ground as the cream section, under the
   name the template already uses. */
.ekhaa-section--tint { background: var(--cream); }

.ekhaa-pagelinks { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 2rem; }
.ekhaa-pagelinks a, .ekhaa-pagelinks > span {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: .4rem .9rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	color: var(--ink);
	text-decoration: none;
}

/* ==========================================================================
   7. A chip
   a11y.css has a rule for `.ekhaa-chip` — it thickens its border in high
   contrast — but the class was never defined anywhere. Defined here, so that
   rule finally has something to act on.
   ========================================================================== */

.ekhaa-chip {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .3rem .85rem;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--ink);
	font-size: .86rem;
	font-weight: 600;
}

/* ==========================================================================
   8. The photograph wall
   Nine photographs from Ekhaa's own events. Each opens its full-size file in
   a new tab, which is what the live page does, so the behaviour is unchanged
   and only the frame is ours.
   ========================================================================== */

.wall {
	display: grid;
	gap: clamp(.8rem, 1.8vw, 1.4rem);
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.wall a {
	display: block;
	border-radius: var(--radius-sm);
	overflow: hidden;
	background: var(--cream);
	aspect-ratio: 4 / 3;
}

.wall img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .5s var(--ease);
}

.wall a:hover img,
.wall a:focus-visible img { transform: scale(1.04); }

/* ==========================================================================
   9. A numbered objective
   Seven statutory objectives. The number is the ordinal from the regulation,
   so it belongs in the text, not in a ::before counter a screen reader would
   skip.
   ========================================================================== */

.objective { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }

.objective__num {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	flex: none;
	border-radius: 12px;
	background: var(--cream);
	color: var(--clay-deep);
	font-family: var(--wp--preset--font-family--heading, "El Messiri", sans-serif);
	font-weight: 700;
	font-size: 1.1rem;
}

.objective p { margin: 0; color: var(--muted); }

/* ==========================================================================
   10. A portal invitation
   The two self-service pages are a door, not a page of content. One card, one
   action, and an honest line about where the door leads.
   ========================================================================== */

.portal {
	display: grid;
	gap: 1.4rem;
	max-width: 46rem;
	padding: clamp(1.6rem, 3vw, 2.6rem);
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.portal ul { margin: 0; padding-inline-start: 1.3rem; color: var(--muted); }
.portal li { margin-bottom: .4rem; }

/* ==========================================================================
   11. Honest empty states
   Where the foundation has not published anything yet, the page says so in
   Arabic rather than inventing a placeholder programme.
   ========================================================================== */

.empty {
	padding: clamp(1.4rem, 3vw, 2.2rem);
	background: var(--paper);
	border: 1px dashed var(--sand);
	border-radius: var(--radius);
	color: var(--muted);
	max-width: var(--measure);
}

.empty p { margin: 0; color: var(--muted); }
.empty p + p { margin-top: .6rem; }

/* ==========================================================================
   12. A fact row
   Contract number, contracting authority, beneficiary count: the figures on
   the housing-project page, each with its source named beside it.
   ========================================================================== */

.facts {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.facts > li {
	padding: 1.1rem 1.3rem;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
}

.facts dt { color: var(--muted); font-size: .86rem; font-weight: 700; margin-bottom: .2rem; }
.facts dd {
	margin: 0;
	color: var(--ink);
	font-family: var(--wp--preset--font-family--heading, "El Messiri", sans-serif);
	font-size: 1.15rem;
	font-weight: 700;
}
