/*
Theme Name: Analyst Portfolio
Description: Bilingual (Arabic and English) portfolio theme for a disaster-risk and strategic analyst. One stylesheet serves both directions through CSS logical properties.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: analyst-portfolio
License: GPL-2.0-or-later
*/

/* ---------- fonts (self-hosted, SIL Open Font License) ---------- */
@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap; src: url("assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Sans"; font-weight: 500; font-display: swap; src: url("assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-display: swap; src: url("assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Serif"; font-weight: 600; font-display: swap; src: url("assets/fonts/ibm-plex-serif-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("assets/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("assets/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("assets/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url("assets/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

/* ---------- tokens ---------- */
:root {
	--ink: #13252b;
	--body: #2f4149;
	--muted: #5d6e75;
	--paper: #fffdf8;
	--tint: #f5f0e4;
	--line: #e3dccb;
	--teal: #0d4a52;
	--teal-deep: #08343a;
	--teal-soft: #dcebe9;
	--amber: #b4621b;
	--amber-soft: #f6e6d3;
	--white: #ffffff;

	--font-body: "Plex Sans", "Plex Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
	--font-head: "Plex Serif", "Plex Arabic", Georgia, serif;

	--wrap: 72rem;
	--gutter: clamp(1rem, 4vw, 2rem);
	--radius: 14px;
	--shadow: 0 1px 2px rgba(19, 37, 43, .05), 0 10px 30px rgba(19, 37, 43, .07);
	--shadow-hi: 0 2px 4px rgba(19, 37, 43, .06), 0 18px 40px rgba(19, 37, 43, .12);
	--ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--body);
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.7;
	overflow-wrap: break-word;
}
[dir="rtl"] body { line-height: 1.95; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--amber); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { color: var(--ink); font-family: var(--font-head); font-weight: 600; line-height: 1.2; margin: 0 0 .6em; text-wrap: balance; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 { font-weight: 700; line-height: 1.45; }
p { margin: 0 0 1.1em; }
ul, ol { padding-inline-start: 1.3em; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: var(--white); padding: .6rem 1rem; border-radius: 6px; }
.skip-link:focus { top: 1rem; color: var(--white); }
.arrow { display: inline-block; margin-inline-start: .35em; }
[dir="rtl"] .arrow--dir, [dir="rtl"] .arrow--back { transform: scaleX(-1); }
.arrow--back { margin-inline: 0 .35em; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 253, 248, .94); backdrop-filter: blur(8px); border-block-end: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; min-width: 0; }
[dir="rtl"] .brand { font-weight: 700; }
.brand:hover { color: var(--teal); }
.brand__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand__mark { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 10px; background: var(--teal); color: var(--white); font: 600 .9rem/1 var(--font-body); letter-spacing: .04em; white-space: nowrap; }
[dir="rtl"] .brand__mark { letter-spacing: 0; font-size: .8rem; }

.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; flex: none; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); cursor: pointer; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 1.2rem; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; inset-inline-start: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

.nav { display: none; position: absolute; inset-inline: 0; top: 100%; background: var(--paper); border-block-end: 1px solid var(--line); box-shadow: var(--shadow); padding: .5rem var(--gutter) 1rem; }
.nav.is-open { display: block; }
.nav__list { list-style: none; margin: 0; padding: 0; }
.nav__list a { display: block; padding: .7rem .25rem; color: var(--ink); text-decoration: none; font-weight: 500; border-block-end: 1px solid var(--line); }
.nav__list a:hover { color: var(--teal); }
.nav__list a[aria-current="page"], .nav__list .current-menu-item > a { color: var(--teal); font-weight: 600; }
.lang-switch { display: inline-flex; align-items: center; margin-block-start: .9rem; padding: .45rem 1rem; min-height: 2.5rem; border: 1px solid var(--teal); border-radius: 999px; color: var(--teal); text-decoration: none; font-weight: 600; font-size: .95rem; font-family: var(--font-body); }
.lang-switch:hover { background: var(--teal); color: var(--white); }

@media (min-width: 60rem) {
	.nav-toggle { display: none; }
	.nav { display: flex; align-items: center; gap: 1.25rem; position: static; padding: 0; background: none; border: 0; box-shadow: none; }
	.nav__list { display: flex; gap: .15rem; }
	.nav__list a { padding: .45rem .7rem; border: 0; border-radius: 6px; font-size: .97rem; white-space: nowrap; }
	.nav__list a { position: relative; color: var(--body); font-weight: 500; }
	.nav__list a::after { content: ""; position: absolute; inset-inline: .7rem; bottom: .15rem; height: 2px; background: var(--amber); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
	[dir="rtl"] .nav__list a::after { transform-origin: right; }
	.nav__list a:hover { color: var(--ink); background: none; }
	.nav__list a:hover::after, .nav__list a[aria-current="page"]::after, .nav__list .current-menu-item > a::after { transform: scaleX(1); }
	.nav__list a[aria-current="page"], .nav__list .current-menu-item > a { background: none; color: var(--ink); }
	.lang-switch { margin: 0; }
}

/* ---------- buttons, tags ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 3rem; padding: .65rem 1.4rem; border-radius: 999px; border: 1px solid transparent; font-weight: 500; font-size: 1rem; text-decoration: none; transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn .ico { transition: transform .2s var(--ease); }
.btn:hover .ico.flip { transform: translateX(3px); }
[dir="rtl"] .btn:hover .ico.flip { transform: scaleX(-1) translateX(3px); }
.btn--primary { background: var(--teal); color: var(--white); box-shadow: 0 6px 18px rgba(13, 74, 82, .25); }
.btn--primary:hover { background: var(--teal-deep); color: var(--white); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: var(--white); }
.btn--ghost:hover { border-color: var(--teal); color: var(--teal); background: var(--white); }
.btn--light { background: var(--white); color: var(--teal-deep); }
.btn--light:hover { background: var(--amber-soft); color: var(--teal-deep); }
.btn--outline-light { border-color: rgba(255, 255, 255, .55); color: var(--white); }
.btn--outline-light:hover { background: rgba(255, 255, 255, .12); color: var(--white); }
.btn--block { display: flex; width: 100%; margin-block-start: .6rem; }
.tag { display: inline-block; padding: .1rem .6rem; border-radius: 999px; background: var(--amber-soft); color: #7a3f0c; font-size: .8rem; font-weight: 600; line-height: 1.7; }
.eyebrow { margin: 0 0 .8rem; color: var(--amber); font-weight: 600; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow--line { display: flex; align-items: center; gap: .6rem; }
.eyebrow--line::before { content: ""; flex: none; width: 1.75rem; height: 2px; background: currentColor; }
[dir="rtl"] .eyebrow { letter-spacing: 0; font-size: 1.05rem; }

/* ---------- hero ---------- */
.hero { position: relative; background: var(--paper); }
.hero__inner { position: relative; z-index: 1; display: grid; gap: 2rem; padding-block: clamp(2.5rem, 7vw, 5.5rem); }
.hero__name { font-size: clamp(2.1rem, 6.2vw, 3.9rem); margin-block-end: .35em; letter-spacing: -.01em; }
[dir="rtl"] .hero__name { letter-spacing: 0; line-height: 1.35; }
.hero__lead { max-width: 38rem; font-size: clamp(1.08rem, 1.6vw, 1.22rem); color: var(--body); }
.hero__lead > :last-child { margin-block-end: 0; }
.hero__tags { list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; max-width: 40rem; }
.hero__tags li { padding: .2rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--teal-deep); font-size: .88rem; font-weight: 500; line-height: 1.7; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 0; }
.hero__photo { position: relative; width: min(78%, 20rem); margin-inline: auto; margin-block-end: 1.5rem; }
.hero__photo::before { content: ""; position: absolute; inset: 1.25rem -1.25rem -1.25rem 1.25rem; border-radius: 22px; background: var(--teal-soft); border: 1px solid #cfe2df; }
[dir="rtl"] .hero__photo::before { inset: 1.25rem 1.25rem -1.25rem -1.25rem; }
.hero__photo img { position: relative; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 22px; box-shadow: var(--shadow-hi); background: var(--tint); }
.hero__badge { position: absolute; inset-inline-start: -1.25rem; bottom: 1.5rem; display: flex; align-items: center; gap: .75rem; max-width: 15rem; margin: 0; padding: .75rem 1rem; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-hi); font-size: .85rem; line-height: 1.35; color: var(--muted); }
.hero__badge .ico { width: 2.4rem; height: 2.4rem; padding: .5rem; border-radius: 10px; background: var(--amber-soft); color: var(--amber); }
.hero__badge b { display: block; font: 600 1.45rem/1.1 var(--font-head); color: var(--ink); direction: ltr; unicode-bidi: isolate; text-align: start; }
[dir="rtl"] .hero__badge b { text-align: end; }
.hero__inner--photo .hero__photo { order: -1; }
@media (min-width: 52rem) {
	.hero__inner--photo { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: center; }
	.hero__inner--photo .hero__photo { order: 0; }
	.hero__photo { justify-self: end; max-width: 23rem; width: 100%; margin: 0 1.5rem 1.5rem 0; }
	[dir="rtl"] .hero__photo { margin: 0 0 1.5rem 1.5rem; }
	.hero__badge { inset-inline-start: -2rem; bottom: 2rem; }
}

/* ---------- stats ---------- */
.stats { background: var(--teal-deep); color: var(--white); }
.stats__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; }
.stats__grid--1 { grid-template-columns: 1fr; }
.stats__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { display: flex; align-items: flex-start; gap: .85rem; padding: 1.4rem 1rem; border-color: rgba(255, 255, 255, .12); border-style: solid; border-width: 0; }
.stat__body { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.stat__icon { width: 1.5rem; height: 1.5rem; margin-block-start: .45rem; color: #f0b27a; }
.stats__grid--2 .stat:nth-child(odd), .stats__grid--4 .stat:nth-child(odd), .stats__grid--3 .stat:not(:last-child) { border-inline-end-width: 1px; }
.stats__grid--4 .stat:nth-child(-n+2) { border-block-end-width: 1px; }
.stat__num { margin: 0; font-family: var(--font-head); font-size: clamp(1.8rem, 5vw, 2.5rem); font-weight: 600; line-height: 1.15; direction: ltr; unicode-bidi: isolate; text-align: start; }
[dir="rtl"] .stat__num { text-align: end; }
[dir="rtl"] .stat__num { font-weight: 700; }
.stat__text { margin-block-start: .3rem; font-size: clamp(.85rem, 1.5vw, .98rem); color: rgba(255, 255, 255, .86); line-height: 1.45; }
@media (min-width: 46rem) {
	.stats__grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.stats__grid--4 .stat { border-block-end-width: 0 !important; border-inline-end-width: 1px; padding-block: 2rem; }
	.stats__grid--4 .stat:last-child { border-inline-end-width: 0; }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--tint { background: var(--tint); border-block: 1px solid var(--line); }
.section--flush { padding-block-start: clamp(1.5rem, 4vw, 2.5rem); }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .5rem 1.5rem; margin-block-end: 2rem; }
.section__title { font-size: clamp(1.45rem, 3.2vw, 2rem); margin: 0; }
.more { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.75rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.more .ico { transition: transform .2s var(--ease); }
.more:hover .ico { transform: translateX(3px); }
[dir="rtl"] .more:hover .ico { transform: scaleX(-1) translateX(3px); }
.empty { color: var(--muted); }

/* ---------- publications ---------- */
.pubs { list-style: none; margin: 0; padding: 0; border-block-start: 1px solid var(--line); }
.pub { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); gap: 1rem; padding-block: 1.25rem; padding-inline: .5rem; border-block-end: 1px solid var(--line); transition: background .2s; }
.pub:hover { background: rgba(13, 74, 82, .035); }
.pubs--plain { border-block-start: 0; }
.pubs--plain .pub { grid-template-columns: minmax(0, 1fr); }
.pubs--plain .pub:last-child { border-block-end: 0; }
.pub[hidden] { display: none; }
.pub__year { font-family: var(--font-head); font-weight: 600; color: var(--teal); font-size: 1.05rem; padding-block-start: .15rem; }
.pub__title { font-family: var(--font-body); font-size: 1.1rem; font-weight: 600; line-height: 1.45; margin: .35rem 0 .3rem; }
[dir="rtl"] .pub__title { line-height: 1.7; }
.pub__title a { color: var(--ink); text-decoration: none; }
.pub__title a:hover { color: var(--teal); text-decoration: underline; }
.pub__meta { margin: 0; color: var(--muted); font-size: .95rem; display: flex; flex-wrap: wrap; gap: .1rem .9rem; }
.pub__venue { font-style: italic; }
[dir="rtl"] .pub__venue { font-style: normal; }
.pub__links { margin: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-weight: 600; font-size: .95rem; }
.pub__links a { text-decoration: none; display: inline-flex; align-items: center; min-height: 2rem; }
.pub__links a:hover { text-decoration: underline; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-block-end: 1.75rem; }
.chip { min-height: 2.5rem; padding: .3rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--body); font: inherit; font-size: .93rem; font-weight: 500; cursor: pointer; }
.chip:hover { border-color: var(--teal); color: var(--teal); }
.chip[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: var(--white); }

.year-group { display: grid; gap: .25rem 2rem; padding-block: .75rem; border-block-start: 1px solid var(--line); }
.year-group:last-of-type { border-block-end: 1px solid var(--line); }
.year-group[hidden] { display: none; }
.year-group__year { font-size: 1.5rem; color: var(--teal); margin: 0 0 .5rem; }
@media (min-width: 46rem) {
	.year-group { grid-template-columns: 6rem minmax(0, 1fr); }
	.year-group__year { padding-block-start: 1rem; }
}

/* ---------- cards ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40rem) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 62rem) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { position: relative; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s var(--ease), border-color .2s; }
.card:hover { box-shadow: var(--shadow-hi); transform: translateY(-2px); border-color: transparent; }
.card--link .card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card__media { overflow: hidden; }
.card__media img { transition: transform .4s var(--ease); }
.card:hover .card__media img { transform: scale(1.03); }
.card__body { display: flex; flex-direction: column; flex: 1; }
.card__text { flex: 1; color: var(--muted); }
.card__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .4rem; }
.tag--plain { display: inline-flex; align-items: center; gap: .3rem; background: var(--tint); color: var(--muted); font-weight: 500; }
.tag .ico { width: .95em; height: .95em; }
.card__go { display: inline-flex; align-items: center; gap: .4rem; margin-block-start: 1rem; color: var(--teal); font-weight: 500; font-size: .95rem; }
.card__go .ico { transition: transform .2s var(--ease); }
.card:hover .card__go .ico { transform: translateX(3px); }
[dir="rtl"] .card:hover .card__go .ico { transform: scaleX(-1) translateX(3px); }
.card__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card__body { padding: 1.25rem 1.35rem 1.4rem; }
.card--post { border-block-start: 1px solid var(--line); }
.card__title { font-size: 1.18rem; margin: .5rem 0 .35rem; line-height: 1.35; }
[dir="rtl"] .card__title { line-height: 1.6; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--teal); }
.card__meta, .card__date { display: block; margin: 0 0 .6rem; color: var(--muted); font-size: .9rem; }
.card__date { display: flex; align-items: center; gap: .4rem; }
.card__text { margin: 0; font-size: .98rem; }

/* ---------- inner page heads ---------- */
.page-head { background: var(--tint); border-block-end: 1px solid var(--line); padding-block: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 2.5rem); }
.page-head__title { font-size: clamp(1.9rem, 5vw, 3rem); margin: 0; }
.page-head__title--long { font-size: clamp(1.5rem, 3.6vw, 2.3rem); max-width: 52rem; }
.page-head__intro { margin: .8rem 0 0; max-width: 42rem; color: var(--muted); font-size: 1.1rem; }
.back { display: inline-flex; align-items: center; min-height: 2.25rem; margin-block-end: .6rem; font-weight: 600; font-size: .95rem; text-decoration: none; }
.back:hover { text-decoration: underline; }

/* ---------- prose (page and post content) ---------- */
.prose { max-width: 46rem; padding-block: clamp(1.75rem, 5vw, 3rem) clamp(2.5rem, 6vw, 4rem); }
.prose > * { margin-block: 0 1.2em; }
.prose h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); margin-block: 2em .6em; padding-block-end: .35em; border-block-end: 2px solid var(--line); }
.prose h2:first-child { margin-block-start: 0; }
.prose h3 { font-size: 1.2rem; margin-block: 1.6em .4em; }
.prose li { margin-block-end: .4em; }
.prose blockquote { margin-inline: 0; padding: .25rem 1.25rem; border-inline-start: 4px solid var(--amber); background: var(--tint); border-radius: 0 var(--radius) var(--radius) 0; }
[dir="rtl"] .prose blockquote { border-radius: var(--radius) 0 0 var(--radius); }
.prose figure { margin-inline: 0; }
.prose img { border-radius: var(--radius); }
.prose figcaption { color: var(--muted); font-size: .9rem; margin-block-start: .4rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: .97rem; }
.prose th, .prose td { text-align: start; padding: .6rem .75rem; border-block-end: 1px solid var(--line); }
.prose .wp-block-table { overflow-x: auto; }
.prose .alignwide { max-width: none; }
.ap-notice { padding: 1.25rem 1.5rem; border: 1px dashed var(--teal); border-radius: var(--radius); background: var(--teal-soft); color: var(--teal-deep); }

/* Timeline pattern: degrees, posts held, teaching. */
.ap-timeline { list-style: none; margin: 0 0 1.5em; padding: 0; border-inline-start: 2px solid var(--line); }
.ap-timeline > li { position: relative; margin: 0; padding: 0 0 1.4rem; padding-inline-start: 1.4rem; }
.ap-timeline > li::before { content: ""; position: absolute; inset-inline-start: -7px; top: .65em; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--teal); }
.ap-timeline > li:last-child { padding-block-end: 0; }
.ap-timeline strong { color: var(--ink); }

/* Contact page links pattern. */
.ap-contact-list { list-style: none; padding: 0; display: grid; gap: .75rem; }
.ap-contact-list li { margin: 0; padding: 1rem 1.25rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- ready-made sections (inc/patterns.php) ---------- */
.wp-block-button__link { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: .6rem 1.35rem; border-radius: 8px; background: var(--teal); color: var(--white); font-weight: 600; text-decoration: none; }
.wp-block-button__link:hover { background: var(--teal-deep); color: var(--white); }
.wp-block-button.is-style-outline .wp-block-button__link { background: transparent; border: 1.5px solid var(--teal); color: var(--teal); }

.ap-cta { margin-block: 2rem; padding: clamp(1.5rem, 4vw, 2.5rem); border-radius: var(--radius); background: var(--teal-deep); color: rgba(255, 255, 255, .88); }
.ap-cta h2, .ap-cta h3 { color: var(--white); border: 0; margin-block: 0 .5rem; padding: 0; }
.ap-cta .wp-block-button__link { background: var(--white); color: var(--teal-deep); }
.ap-cta .wp-block-button__link:hover { background: var(--amber-soft); color: var(--teal-deep); }

.prose .ap-quote, .ap-quote { margin-block: 2rem; padding: 1.25rem 1.5rem; background: var(--tint); border-inline-start: 4px solid var(--amber); border-radius: 0 var(--radius) var(--radius) 0; }
[dir="rtl"] .ap-quote { border-radius: var(--radius) 0 0 var(--radius); }
.ap-quote p { font-family: var(--font-head); font-size: clamp(1.2rem, 2.4vw, 1.45rem); line-height: 1.5; color: var(--ink); margin: 0 0 .6rem; }
[dir="rtl"] .ap-quote p { line-height: 1.8; }
.ap-quote cite { font-style: normal; font-size: .95rem; color: var(--muted); }

.ap-media-text { gap: 0; margin-block: 2rem; align-items: center; }
.ap-media-text .wp-block-media-text__media img { border-radius: var(--radius); }
.ap-media-text .wp-block-media-text__content { padding-inline: clamp(1rem, 4vw, 2.5rem); }
.ap-media-text h3 { margin-top: 0; }
@media (max-width: 600px) { .ap-media-text .wp-block-media-text__content { padding: 1.25rem 0 0; } }

.ap-faq { margin-block: 0 .75rem; padding: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.ap-faq summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 600; color: var(--ink); list-style-position: inside; }
.ap-faq summary:hover { color: var(--teal); }
.ap-faq[open] summary { border-block-end: 1px solid var(--line); }
.ap-faq > :not(summary) { padding-inline: 1.25rem; }
.ap-faq > p:last-child { padding-block-end: 1rem; margin-bottom: 0; }

.ap-gallery img { border-radius: var(--radius); }
.ap-columns { gap: clamp(1.25rem, 4vw, 2.5rem); margin-block: 2rem; }
.ap-columns h3 { margin-top: 0; }
.wp-block-embed { margin-block: 1.5rem; }
.wp-block-embed iframe { border-radius: var(--radius); }

/* Blocks added between the home page sections. */
.home-extra { padding-block: clamp(2rem, 5vw, 3.5rem); }
.home-extra__inner { max-width: none; padding-block: 0; }
.home-extra__inner > * { max-width: 52rem; }
.home-extra__inner > .wp-block-columns, .home-extra__inner > .wp-block-media-text, .home-extra__inner > .wp-block-gallery, .home-extra__inner > .ap-cta { max-width: none; }

/* ---------- detail pages (single publication / project) ---------- */
.detail { display: grid; gap: 0 3rem; }
.detail__side { padding-block-start: clamp(1.75rem, 5vw, 3rem); }
.detail__image { margin: 0 0 1.5rem; }
.facts { margin: 0 0 1rem; padding: 1.1rem 1.25rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.facts > div { padding-block: .55rem; border-block-end: 1px solid var(--line); }
.facts > div:first-child { padding-block-start: 0; }
.facts > div:last-child { border: 0; padding-block-end: 0; }
.facts dt { font-size: .82rem; font-weight: 600; color: var(--muted); }
.facts dd { margin: 0; color: var(--ink); font-weight: 500; }
@media (min-width: 56rem) {
	.detail { grid-template-columns: 17rem minmax(0, 1fr); align-items: start; }
	.detail__side { position: sticky; top: 5rem; padding-block-end: 2rem; }
	.detail__side:only-child, .detail__main:only-child { grid-column: 1 / -1; }
}

/* ---------- contact band ---------- */
.contact-band { color: var(--white); padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.contact-band__inner { position: relative; overflow: hidden; display: grid; gap: 1.5rem; align-items: center; background: var(--ink); border-radius: 22px; padding: clamp(1.75rem, 5vw, 3.25rem); }
.contact-band__inner::after { content: ""; position: absolute; inset-inline-end: -6rem; top: -6rem; width: 18rem; height: 18rem; border-radius: 50%; border: 40px solid rgba(240, 178, 122, .08); pointer-events: none; }
.contact-band__inner > * { position: relative; z-index: 1; }
.contact-band .btn--light { background: #f0b27a; color: var(--ink); }
.contact-band .btn--light:hover { background: #f5c497; color: var(--ink); }
.contact-band__title { color: var(--white); font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 .3rem; }
.contact-band__text { margin: 0; color: rgba(255, 255, 255, .85); max-width: 34rem; }
.contact-band__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; }
@media (min-width: 56rem) { .contact-band__inner { grid-template-columns: minmax(0, 1fr) auto; } }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, .78); font-size: .95rem; }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--white); }
.site-footer__inner { display: grid; gap: 1.5rem; padding-block: 2.5rem 1.5rem; }
.site-footer__name { margin: 0 0 .4rem; color: var(--white); font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; }
.site-footer__note { margin: 0; max-width: 34rem; }
.site-footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; align-content: start; }
.site-footer__links a { display: inline-flex; align-items: center; min-height: 2.5rem; font-weight: 500; }
.site-footer__base { padding-block: 1rem 1.5rem; border-block-start: 1px solid rgba(255, 255, 255, .14); font-size: .88rem; }
@media (min-width: 46rem) { .site-footer__inner { grid-template-columns: minmax(0, 1fr) auto; } }

/* ---------- pagination ---------- */
.pagination { margin-block-start: 2rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 2.6rem; min-height: 2.6rem; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--white); text-decoration: none; font-weight: 600; }
.pagination .page-numbers.current { background: var(--teal); border-color: var(--teal); color: var(--white); }

/* ---------- icons ---------- */
.ico { width: 1.2em; height: 1.2em; flex: none; display: inline-block; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
[dir="rtl"] .ico.flip { transform: scaleX(-1); }

/* ---------- areas of expertise ---------- */
.skills { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.skill { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.25rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 500; line-height: 1.45; transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.skill:hover { transform: translateY(-2px); border-color: #c9dcd9; box-shadow: var(--shadow); }
.skill .ico { width: 2.5rem; height: 2.5rem; padding: .55rem; border-radius: 10px; background: var(--teal-soft); color: var(--teal); }

/* ---------- the top of the home page comes in once, on load ---------- */
@media (prefers-reduced-motion: no-preference) {
	.hero__text > * { animation: ap-up .7s var(--ease) both; }
	.hero__text > :nth-child(2) { animation-delay: .08s; }
	.hero__text > :nth-child(3) { animation-delay: .16s; }
	.hero__text > :nth-child(4) { animation-delay: .24s; }
	.hero__text > :nth-child(5) { animation-delay: .32s; }
	.hero__photo { animation: ap-up .9s .2s var(--ease) both; }
	@keyframes ap-up { from { opacity: 0; transform: translateY(14px); } }
}
/* The editor's live preview shows the finished state. */
.ap-section-preview .hero__text > *, .ap-section-preview .hero__photo { animation: none; }

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

@media print {
	.site-header, .site-footer, .contact-band, .filters, .hero__badge, .hero__actions { display: none !important; }
	body { background: #fff; font-size: 11pt; }
}
