/*
Theme Name: AK Portfolio
Theme URI: https://anaskaraki.com/
Author: Anas Karaki
Description: A block theme for a researcher portfolio: profile, research areas, publications, and media interviews. Visual language derived from the GPL-licensed Communications Agencies theme (League Spartan and Raleway, pill navigation, colour stat cards).
Version: 1.0.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: ak-portfolio
Tags: block-themes, full-site-editing, portfolio, one-column, custom-colors, editor-style, translation-ready

AK Portfolio is distributed under the terms of the GNU GPL v3 or later.
Derived in visual style from Communications Agencies, (C) 2026 Buywptemplates, GPLv3.
Fonts: League Spartan and Raleway, SIL Open Font License 1.1 (see assets/fonts).
*/

/* ---------- Base ---------- */

html {
	-webkit-text-size-adjust: 100%;
}

body {
	-webkit-font-smoothing: antialiased;
	background-color: var(--wp--preset--color--background);
	background-image:
		radial-gradient(45% 600px at 0% 0%, #fde9f0 0%, rgba(253, 233, 240, 0) 100%),
		radial-gradient(40% 520px at 55% 0%, #e7effd 0%, rgba(231, 239, 253, 0) 100%),
		radial-gradient(40% 640px at 100% 8%, #e2f6f3 0%, rgba(226, 246, 243, 0) 100%);
	background-repeat: no-repeat;
}

:where(.wp-site-blocks) > main {
	margin-block-start: 0;
}

img {
	max-width: 100%;
	height: auto;
}

:focus-visible {
	outline: 2px solid var(--wp--preset--color--tertiary);
	outline-offset: 3px;
}

.screen-reader-text:focus {
	clip: auto !important;
}

/* ---------- Header ---------- */

header.wp-block-template-part {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + 12px);
	z-index: 100;
	margin-block-start: 12px;
}

.ak-header {
	background: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--pill);
	box-shadow: var(--wp--custom--shadow--soft);
	padding: 8px 8px 8px 24px;
	gap: 16px;
}

.ak-header .wp-block-site-title {
	margin: 0;
	white-space: nowrap;
}

.ak-header .wp-block-site-title a {
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
}

.ak-nav .wp-block-navigation__container {
	gap: 4px;
}

.ak-nav .wp-block-navigation-item__content {
	padding: 8px 16px;
	border-radius: var(--wp--custom--radius--pill);
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ak-nav .wp-block-navigation-item__content:hover {
	background: var(--wp--preset--color--surface);
}

.ak-nav .current-menu-item > .wp-block-navigation-item__content,
.ak-nav .wp-block-navigation-item__content[aria-current="page"] {
	background: var(--wp--preset--color--tertiary);
	color: var(--wp--preset--color--background);
}

.ak-header-cta .wp-block-button__link {
	white-space: nowrap;
}

@media (max-width: 1100px) {
	.ak-header-cta {
		display: none !important;
	}
}

@media (max-width: 900px) {
	.ak-nav .wp-block-navigation-item__content {
		padding: 8px 10px;
		font-size: 15px;
	}
}

/* Mobile overlay menu */
.ak-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: 24px;
}

.ak-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: 8px;
}

.ak-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 22px;
	padding: 10px 18px;
}

/* ---------- Shared section elements ---------- */

.ak-section {
	padding-block: clamp(40px, 5vw, 64px);
}

.ak-section-head {
	max-width: 720px;
	margin-inline: auto;
	text-align: center;
	margin-block-end: var(--wp--preset--spacing--50) !important;
}

.ak-section-head.is-left {
	margin-inline: 0;
	text-align: left;
}

.ak-kicker {
	color: var(--wp--preset--color--rose);
	font-family: var(--wp--preset--font-family--raleway);
	font-weight: 600;
	font-size: 17px;
	margin-block-end: 0.25rem !important;
}

.ak-kicker + * {
	margin-block-start: 0 !important;
}

.ak-lead {
	color: var(--wp--preset--color--muted);
	font-size: 19px;
}

.ak-muted {
	color: var(--wp--preset--color--muted);
}

/* ---------- Hero ---------- */

.ak-hero {
	padding-block: clamp(48px, 7vw, 96px) clamp(40px, 5vw, 72px);
}

.ak-hero-columns {
	align-items: center !important;
	gap: clamp(32px, 5vw, 72px) !important;
}

.ak-hero-title {
	font-size: var(--wp--preset--font-size--huge) !important;
	line-height: 1.02 !important;
	letter-spacing: -0.015em;
	margin-block: 0 0.5rem !important;
}

.ak-hero-role {
	font-family: var(--wp--preset--font-family--league-spartan);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 500;
	line-height: 1.35;
	margin-block-start: 0 !important;
}

.ak-hero-lead {
	color: var(--wp--preset--color--muted);
	font-size: 19px;
	max-width: 34em;
}

.ak-hero-visual {
	position: relative;
	max-width: 460px;
	margin-inline: auto;
	padding: 0 28px 28px 0;
}

.ak-portrait {
	position: relative;
	margin: 0;
}

.ak-portrait::before {
	content: "";
	position: absolute;
	inset: 28px -28px -28px 28px;
	background: var(--wp--preset--color--primary);
	border-radius: 240px 240px 32px 32px;
	z-index: 0;
}

.ak-portrait img {
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	border-radius: 240px 240px 32px 32px;
}

.ak-chip {
	position: absolute;
	z-index: 2;
	margin: 0 !important;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	box-shadow: var(--wp--custom--shadow--soft);
	padding: 12px 18px;
	font-family: var(--wp--preset--font-family--league-spartan);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
}

.ak-chip::before {
	content: "";
	width: 12px;
	height: 12px;
	border-radius: 50%;
	flex: none;
	background: var(--wp--preset--color--tertiary);
}

.ak-chip--1 { top: 14%; left: -12%; }
.ak-chip--2 { top: 48%; right: -6%; }
.ak-chip--3 { bottom: 10%; left: -6%; }
.ak-chip--1::before { background: var(--wp--preset--color--tertiary); }
.ak-chip--2::before { background: var(--wp--preset--color--accent); }
.ak-chip--3::before { background: var(--wp--preset--color--secondary); }

@media (max-width: 781px) {
	.ak-hero-visual {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 10px;
		padding: 0 28px 0 0;
		max-width: 380px;
	}
	.ak-portrait {
		width: 100%;
		margin-block-end: 40px !important;
	}
	.ak-chip {
		position: static;
		font-size: 15px;
		padding: 10px 14px;
	}
}

/* ---------- Stat cards ---------- */

.ak-stats {
	gap: 20px !important;
	margin-block-start: clamp(40px, 5vw, 64px) !important;
}

.ak-stat {
	border-radius: 20px;
	padding: 28px 26px !important;
	color: var(--wp--preset--color--background);
}

.ak-stat p {
	margin: 0;
	color: inherit;
}

.ak-stat .ak-stat-number {
	font-family: var(--wp--preset--font-family--league-spartan);
	font-size: clamp(36px, 4vw, 48px);
	font-weight: 700;
	line-height: 1;
	margin-block-end: 8px;
}

.ak-stat .ak-stat-label {
	font-family: var(--wp--preset--font-family--league-spartan);
	font-size: 19px;
	font-weight: 700;
	line-height: 1.25;
}

@media (max-width: 1023px) {
	.ak-stats {
		flex-wrap: wrap !important;
	}
	.ak-stats > .wp-block-column {
		flex-basis: calc(50% - 10px) !important;
		flex-grow: 1 !important;
	}
}

/* ---------- Cards ---------- */

.ak-card-grid {
	gap: 20px !important;
}

.ak-card {
	position: relative;
	background: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--card);
	padding: 32px 28px 28px !important;
	height: 100%;
}

.ak-card::before {
	content: "";
	display: block;
	width: 44px;
	height: 44px;
	border-radius: 14px;
	margin-block-end: 20px;
	background: var(--wp--preset--color--tertiary);
}

.ak-card--orange::before { background: var(--wp--preset--color--primary); }
.ak-card--teal::before { background: var(--wp--preset--color--secondary); }
.ak-card--pink::before { background: var(--wp--preset--color--accent); }

.ak-card h3 {
	margin-block: 0 10px;
}

.ak-card p {
	color: var(--wp--preset--color--muted);
	margin: 0;
}

/* ---------- Panels (about, research, contact) ---------- */

.ak-panel {
	background: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--panel);
	padding: clamp(28px, 4vw, 48px) !important;
}

.ak-panel > :first-child {
	margin-block-start: 0;
}

.ak-timeline {
	list-style: none;
	padding-left: 0;
	margin: 0;
	border-left: 2px solid var(--wp--preset--color--border);
}

.ak-timeline li {
	position: relative;
	padding: 0 0 22px 26px;
}

.ak-timeline li::before {
	content: "";
	position: absolute;
	left: -8px;
	top: 7px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--wp--preset--color--tertiary);
	box-shadow: 0 0 0 4px var(--wp--preset--color--background);
}

.ak-timeline li:last-child {
	padding-bottom: 0;
}

.ak-research-block {
	border-top: 1px solid var(--wp--preset--color--border);
	padding-block: var(--wp--preset--spacing--60) !important;
}

/* ---------- Page header ---------- */

.ak-page-head {
	padding-block: clamp(48px, 7vw, 96px) clamp(16px, 3vw, 32px) !important;
}

.ak-page-head .wp-block-post-title,
.ak-page-head h1 {
	font-size: clamp(40px, 5vw, 64px);
	line-height: 1.05;
	margin: 0;
}

.ak-page-head .ak-lead {
	max-width: 46em;
}

/* ---------- Publications ---------- */

.ak-filter-row {
	gap: 8px !important;
	margin-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50) !important;
}

.ak-filter-row p,
.ak-filter {
	margin: 0 !important;
}

.ak-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	padding: 0;
}

.ak-filter-all a,
.ak-filter li a {
	display: inline-block;
	padding: 6px 16px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--foreground);
	font-family: var(--wp--preset--font-family--league-spartan);
	font-weight: 500;
	text-decoration: none;
}

.ak-filter li.current-cat a,
.ak-filter-all a:hover,
.ak-filter li a:hover {
	background: var(--wp--preset--color--tertiary);
	border-color: var(--wp--preset--color--tertiary);
	color: var(--wp--preset--color--background);
}

.ak-pub-list {
	gap: 0 !important;
}

.ak-pub {
	padding-block: 26px !important;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.ak-pub-list > li:first-child .ak-pub {
	border-top: 1px solid var(--wp--preset--color--border);
}

.ak-pub-meta {
	gap: 12px !important;
	margin-block-end: 8px !important;
}

.ak-pub-meta > * {
	margin: 0 !important;
}

.ak-pub-type a,
.ak-pub-type {
	font-family: var(--wp--preset--font-family--league-spartan);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.ak-pub-type a {
	display: inline-block;
	padding: 3px 12px;
	border-radius: var(--wp--custom--radius--pill);
	background: #e7effd;
	color: var(--wp--preset--color--tertiary);
}

.ak-pub .wp-block-post-title {
	font-size: clamp(19px, 1.8vw, 22px);
	font-weight: 600;
	line-height: 1.3;
	margin-block: 0 8px;
}

.ak-pub .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

.ak-pub .wp-block-post-content > * {
	margin-block: 0 6px;
}

.ak-pub-authors {
	color: var(--wp--preset--color--foreground);
}

.ak-pub-venue {
	color: var(--wp--preset--color--muted);
	font-style: italic;
}

.ak-pub .wp-block-buttons,
.ak-pub-links {
	margin-block-start: 12px !important;
	gap: 8px;
}

.ak-pub .wp-block-button__link {
	padding: 7px 18px;
	font-size: 15px;
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--tertiary);
	border: 2px solid currentColor;
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--tertiary);
	border-color: var(--wp--preset--color--tertiary);
	color: var(--wp--preset--color--background);
}

/* Hide empty buttons left in a publication entry without a link */
.ak-pub .wp-block-button__link:not([href]) {
	display: none;
}

/* ---------- Media interviews ---------- */

.ak-video-grid {
	gap: 24px !important;
}

.ak-video-card {
	background: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--card);
	padding: 14px 14px 22px !important;
	height: 100%;
}

.ak-video-card .wp-block-post-content > * {
	margin-block: 0 10px;
}

.ak-video-card .wp-block-post-content p {
	color: var(--wp--preset--color--muted);
	padding-inline: 8px;
}

.ak-video-card .wp-block-embed,
.ak-video-card .wp-block-embed iframe {
	border-radius: 16px;
	overflow: hidden;
}

.ak-video-card .wp-block-post-title,
.ak-video-card .wp-block-post-date {
	padding-inline: 8px;
}

.ak-video-card .wp-block-post-title {
	font-size: 20px;
	margin-block: 6px 4px;
}

.ak-video-card .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

@media (max-width: 781px) {
	.ak-video-grid {
		grid-template-columns: 1fr !important;
	}
}

/* ---------- Call to action ---------- */

.ak-cta {
	background: var(--wp--preset--color--tertiary);
	border-radius: var(--wp--custom--radius--panel);
	padding: clamp(36px, 5vw, 64px) !important;
	color: var(--wp--preset--color--background);
	text-align: center;
}

.ak-cta h2,
.ak-cta p {
	color: inherit;
}

.ak-cta p {
	max-width: 40em;
	margin-inline: auto;
	opacity: 0.92;
}

.ak-cta .wp-block-button__link {
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--tertiary);
}

.ak-cta .wp-block-button__link:hover {
	background: var(--wp--preset--color--foreground);
	color: var(--wp--preset--color--background);
}

/* ---------- Profile links ---------- */

.ak-links .wp-block-button {
	width: 100%;
}

.ak-links .wp-block-button__link {
	display: flex;
	justify-content: space-between;
	width: 100%;
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--foreground);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	text-align: left;
}

.ak-links .wp-block-button__link:hover {
	background: var(--wp--preset--color--tertiary);
	border-color: var(--wp--preset--color--tertiary);
	color: var(--wp--preset--color--background);
}

/* ---------- Footer ---------- */

.ak-footer {
	background: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--panel) var(--wp--custom--radius--panel) 0 0;
	padding-block: clamp(48px, 6vw, 72px) 28px !important;
	margin-block-start: var(--wp--preset--spacing--60) !important;
}

.ak-footer h2 {
	font-size: 18px;
	margin-block-end: 12px;
}

.ak-footer .ak-footer-name {
	font-size: 26px;
	font-weight: 700;
}

.ak-footer-links {
	list-style: none;
	padding: 0;
	margin: 0;
}

.ak-footer-links li {
	margin-block-end: 6px;
}

.ak-footer-links a,
.ak-footer-bottom a {
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
}

.ak-footer-links a:hover,
.ak-footer-bottom a:hover {
	color: var(--wp--preset--color--tertiary);
	text-decoration: underline;
}

.ak-footer-bottom {
	border-top: 1px solid var(--wp--preset--color--border);
	padding-top: 22px !important;
	margin-block-start: var(--wp--preset--spacing--50) !important;
	color: var(--wp--preset--color--muted);
	font-size: 15px;
}

.ak-footer-bottom p {
	margin: 0;
}

/* ---------- Posts and pagination ---------- */

.wp-block-query-pagination {
	margin-block-start: var(--wp--preset--spacing--50) !important;
	gap: 8px;
}

.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
	font-family: var(--wp--preset--font-family--league-spartan);
	text-decoration: none;
	padding: 6px 12px;
	border-radius: var(--wp--custom--radius--pill);
}

.wp-block-query-pagination .page-numbers.current {
	background: var(--wp--preset--color--tertiary);
	color: var(--wp--preset--color--background);
}

.ak-post-card {
	background: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--card);
	padding: 28px !important;
	height: 100%;
}

.ak-post-card .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

.ak-empty {
	color: var(--wp--preset--color--muted);
	border: 1px dashed var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--card);
	padding: 28px;
	text-align: center;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
	.ak-hero .ak-portrait,
	.ak-hero .ak-chip {
		animation: ak-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
	}
	.ak-hero .ak-chip--1 { animation-delay: 0.25s; }
	.ak-hero .ak-chip--2 { animation-delay: 0.4s; }
	.ak-hero .ak-chip--3 { animation-delay: 0.55s; }
}

@keyframes ak-rise {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: none; }
}

.ak-links {
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
}
