/*
 * Dr Ali Easa — main stylesheet.
 * RTL-first port of the original Tailwind/shadcn design.
 */

:root {
	--radius: 0.625rem;
	--radius-sm: 0.375rem;
	--radius-lg: 0.625rem;
	--radius-xl: 0.875rem;
	--radius-2xl: 1.125rem;
	--background: #ffffff;
	--foreground: #0a0a0a;
	--card: #ffffff;
	--card-foreground: #0a0a0a;
	--primary: #171717;
	--primary-foreground: #fafafa;
	--secondary: #f5f5f5;
	--muted: #f5f5f5;
	--muted-foreground: #737373;
	--border: #e5e5e5;
	--input: #e5e5e5;
	--ring: #a3a3a3;
	--footer-bg: #7b6d43;
	--footer-accent: #ebe3cc;
	--font-sans: "IBM Plex Sans Arabic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
	--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
	--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
	--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
	--shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* ---------- Reset / base ---------- */

*,
*::before,
*::after {
	box-sizing: border-box;
	border-color: var(--border);
}

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

body {
	margin: 0;
	font-family: var(--font-sans);
	background: var(--background);
	color: var(--foreground);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

a {
	color: inherit;
	text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
	margin: 0;
	line-height: 1.3;
	font-weight: 700;
	letter-spacing: -0.015em;
}

p {
	margin: 0;
}

ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

button {
	font-family: inherit;
	cursor: pointer;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.container {
	width: 100%;
	max-width: 1400px;
	margin-inline: auto;
	padding-inline: 1rem;
}

.site-main {
	display: flex;
	flex-direction: column;
	min-height: 60vh;
}

/* ---------- Buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	border-radius: var(--radius-sm);
	border: 1px solid transparent;
	font-size: 0.9rem;
	font-weight: 500;
	padding: 0.55rem 1.1rem;
	transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
	white-space: nowrap;
}

.btn svg {
	flex-shrink: 0;
}

.btn-primary {
	background: var(--primary);
	color: var(--primary-foreground);
	box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
	background: #2e2e2e;
	box-shadow: var(--shadow-xl);
}

.btn-outline {
	background: rgb(255 255 255 / 0.5);
	border-color: var(--border);
	color: var(--foreground);
}

.btn-outline:hover {
	background: #ffffff;
	border-color: var(--ring);
}

.btn-dark {
	background: #0f172a;
	color: #ffffff;
	border-color: rgb(255 255 255 / 0.1);
	position: relative;
}

.btn-dark:hover {
	background: #1e293b;
}

.btn-outline-light {
	background: transparent;
	border-color: rgb(255 255 255 / 0.15);
	color: #ffffff;
}

.btn-outline-light:hover {
	background: rgb(255 255 255 / 0.1);
}

.btn-lg {
	font-size: 1.1rem;
	padding: 0.85rem 2rem;
	border-radius: var(--radius-sm);
}

.btn-block {
	width: 100%;
}

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

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	width: 100%;
	border-bottom: 1px solid var(--border);
	background: rgb(255 255 255 / 0.95);
	backdrop-filter: blur(8px);
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 5rem;
	gap: 1rem;
}

.site-brand {
	display: flex;
	align-items: center;
	gap: 1rem;
	font-weight: 700;
	min-width: 0;
}

.site-logo,
.site-logo img {
	width: 2.5rem;
	height: 2.5rem;
	object-fit: contain;
}

.site-brand-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.site-title {
	font-size: 1.25rem;
	white-space: nowrap;
}

.site-tagline {
	font-size: 0.72rem;
	font-weight: 400;
	color: var(--muted-foreground);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.site-nav {
	display: none;
	flex: 1;
	justify-content: center;
}

.nav-links {
	display: flex;
	align-items: center;
	gap: 1.75rem;
}

.nav-links a {
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--muted-foreground);
	transition: color 0.2s;
}

.nav-links a:hover,
.nav-links .current-menu-item a {
	color: var(--foreground);
}

.nav-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	background: transparent;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--foreground);
}

.nav-toggle .nav-toggle-close {
	display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-open {
	display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-close {
	display: inline-flex;
}

.mobile-nav {
	border-top: 1px solid var(--border);
	background: var(--background);
	padding: 1rem;
}

.mobile-nav-links,
.mobile-nav .nav-links {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.25rem;
}

.mobile-nav-links a,
.mobile-nav .nav-links a {
	display: block;
	padding: 0.65rem 0.75rem;
	border-radius: var(--radius-sm);
	font-weight: 500;
	color: var(--foreground);
}

.mobile-nav-links a:hover,
.mobile-nav .nav-links a:hover {
	background: var(--muted);
}

@media (min-width: 768px) {
	.site-nav {
		display: flex;
	}

	.nav-toggle,
	.mobile-nav {
		display: none !important;
	}
}

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

.hero {
	position: relative;
	display: flex;
	align-items: center;
	overflow: hidden;
	background: #fbfbfb;
}

.hero-bg {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.hero-grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(#e5e7eb 1px, transparent 1px),
		linear-gradient(90deg, #e5e7eb 1px, transparent 1px);
	background-size: 40px 40px;
	opacity: 0.5;
}

.hero-bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, rgb(245 245 244 / 0.5), transparent, rgb(245 245 244 / 0.8));
}

.hero-glow {
	position: absolute;
	border-radius: 9999px;
}

.hero-glow-amber {
	top: 0;
	inset-inline-start: 0;
	width: 800px;
	height: 800px;
	background: rgb(254 243 199 / 0.4);
	filter: blur(120px);
	transform: translate(25%, -50%);
}

.hero-glow-stone {
	bottom: 0;
	inset-inline-end: 0;
	width: 600px;
	height: 600px;
	background: rgb(231 229 228 / 0.4);
	filter: blur(100px);
	transform: translate(-25%, 33%);
}

.hero-inner {
	position: relative;
	z-index: 10;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0;
}

.hero-text {
	width: 100%;
	text-align: center;
	padding-top: 3rem;
	display: flex;
	flex-direction: column;
	gap: 2rem;
	animation: hero-rise 0.8s ease both;
}

.hero-heading {
	font-weight: 700;
	letter-spacing: -0.02em;
}

.hero-welcome {
	display: block;
	font-size: clamp(1.125rem, 2.5vw, 1.875rem);
	color: var(--muted-foreground);
	margin-bottom: 1rem;
}

.hero-title {
	display: block;
	font-size: clamp(1.5rem, 4vw, 3rem);
	font-weight: 800;
	color: var(--primary);
}

.hero-description {
	font-size: clamp(1.125rem, 2vw, 1.5rem);
	color: var(--muted-foreground);
	line-height: 1.8;
	max-width: 42rem;
	margin-inline: auto;
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 1rem;
}

.hero-actions .btn-lg {
	height: 3.5rem;
	padding-inline: 2.5rem;
	font-size: 1.2rem;
}

.hero-actions .btn-outline {
	border-color: rgb(23 23 23 / 0.2);
}

.hero-photo {
	width: 100%;
	display: flex;
	justify-content: center;
	animation: hero-slide 0.8s ease both;
}

.hero-photo img {
	width: 100%;
	max-width: 400px;
}

@media (min-width: 1024px) {
	.hero-inner {
		flex-direction: row;
		gap: 2rem;
	}

	.hero-text {
		width: 50%;
		text-align: start;
		padding-top: 0;
	}

	.hero-description {
		margin-inline: 0;
	}

	.hero-actions {
		justify-content: flex-start;
	}

	.hero-photo {
		width: 50%;
		justify-content: flex-start;
		align-items: flex-end;
	}

	/* Keep the whole hero visible without scrolling: cap the photo to the
	   viewport height minus the sticky header (5rem). */
	.hero-photo img {
		max-width: none;
		width: auto;
		max-height: calc(100vh - 6rem);
	}
}

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

@keyframes hero-slide {
	from {
		opacity: 0;
		transform: translateX(-50px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* ---------- Home sections ---------- */

.home-section {
	padding-block: 5rem;
}

.section-muted {
	background: rgb(245 245 245 / 0.3);
}

.section-border-top {
	border-top: 1px solid var(--border);
}

.section-border-y {
	border-block: 1px solid var(--border);
}

.section-header {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 3rem;
	text-align: center;
}

.section-header-text h2 {
	font-size: 1.875rem;
	letter-spacing: -0.02em;
}

.section-header-text p {
	margin-top: 0.5rem;
	color: var(--muted-foreground);
}

@media (min-width: 768px) {
	.section-header {
		flex-direction: row;
		text-align: start;
	}
}

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

.cards-grid {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: 1fr;
}

@media (min-width: 768px) {
	.cards-grid-3 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.cards-grid-3 {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 640px) {
	.cards-grid-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.cards-grid-4 {
		grid-template-columns: repeat(4, 1fr);
	}
}

.books-grid {
	gap: 2rem;
}

/* ---------- Content card ---------- */

.content-card {
	display: block;
	height: 100%;
}

.card {
	height: 100%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--card);
	border: 1px solid var(--muted);
	border-radius: var(--radius-xl);
	transition: box-shadow 0.25s;
}

.content-card:hover .card {
	box-shadow: var(--shadow-lg);
}

.card-media {
	position: relative;
	aspect-ratio: 16 / 9;
	width: 100%;
	overflow: hidden;
	background: var(--muted);
}

.card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s;
}

.content-card:hover .card-media img {
	transform: scale(1.05);
}

.card-media-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 2.25rem;
	opacity: 0.4;
}

.card-header {
	padding: 1.25rem 1.25rem 0;
}

.card-title {
	font-size: 1.2rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.2s;
}

.content-card:hover .card-title {
	color: var(--primary);
}

.card-meta {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.5rem;
	font-size: 0.75rem;
	color: var(--muted-foreground);
}

.card-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.card-body {
	flex: 1;
	padding: 0.75rem 1.25rem;
}

.card-body p {
	font-size: 0.875rem;
	color: var(--muted-foreground);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.card-footer {
	padding: 0 1.25rem 1.25rem;
}

.card-more {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem;
	width: 100%;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--primary);
	text-underline-offset: 4px;
}

.content-card:hover .card-more {
	text-decoration: underline;
}

/* ---------- Book card ---------- */

.book-card {
	display: block;
}

.book-cover {
	position: relative;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	transition: transform 0.3s, box-shadow 0.3s;
	background: var(--muted);
}

.book-card:hover .book-cover {
	transform: translateY(-0.5rem);
	box-shadow: var(--shadow-xl);
}

.book-cover > img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.book-cover-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	width: 100%;
	height: 100%;
	color: var(--muted-foreground);
}

.book-cover-placeholder svg {
	opacity: 0.2;
}

.book-cover-placeholder span {
	font-size: 0.875rem;
	font-weight: 500;
}

.book-overlay {
	position: absolute;
	inset: 0;
	background: rgb(0 0 0 / 0.6);
	opacity: 0;
	transition: opacity 0.3s;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	text-align: center;
	color: #ffffff;
}

.book-card:hover .book-overlay {
	opacity: 1;
}

.book-overlay h3 {
	font-size: 1.1rem;
	margin-bottom: 0.5rem;
}

.book-overlay p {
	font-size: 0.875rem;
	color: rgb(255 255 255 / 0.8);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-bottom: 1rem;
}

.book-overlay-link {
	font-size: 0.875rem;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.book-card-title {
	margin-top: 1rem;
	text-align: center;
	font-size: 1.1rem;
	font-weight: 600;
	transition: color 0.2s;
}

.book-card:hover .book-card-title {
	color: var(--primary);
}

/* ---------- Consultation CTA ---------- */

.consultation {
	position: relative;
	padding-block: 6rem;
	background: #020617;
	overflow: hidden;
	color: #ffffff;
}

.consultation-bg {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(to left, rgb(128 128 128 / 0.07) 1px, transparent 1px),
		linear-gradient(to bottom, rgb(128 128 128 / 0.07) 1px, transparent 1px);
	background-size: 24px 24px;
}

.consultation-bg::before,
.consultation-bg::after {
	content: "";
	position: absolute;
	width: 24rem;
	height: 24rem;
	border-radius: 9999px;
	filter: blur(100px);
}

.consultation-bg::before {
	inset-inline-start: 0;
	top: 0;
	transform: translate(-50%, -50%);
	background: rgb(99 102 241 / 0.2);
}

.consultation-bg::after {
	inset-inline-end: 0;
	bottom: 0;
	transform: translate(50%, 50%);
	background: rgb(59 130 246 / 0.1);
}

.consultation-inner {
	position: relative;
	z-index: 10;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3rem;
}

.consultation-photo {
	order: 2;
	width: 100%;
	position: relative;
	display: flex;
	justify-content: center;
}

.consultation-photo-glow {
	position: absolute;
	inset: -4px;
	max-width: 408px;
	margin-inline: auto;
	background: linear-gradient(to top left, #6366f1, #3b82f6, #a855f7);
	border-radius: 1rem;
	opacity: 0.75;
	filter: blur(8px);
	animation: pulse-glow 3s ease-in-out infinite;
}

.consultation-photo-frame {
	position: relative;
	aspect-ratio: 4 / 5;
	width: 100%;
	max-width: 400px;
	border-radius: 1rem;
	overflow: hidden;
	border: 1px solid rgb(255 255 255 / 0.1);
	box-shadow: var(--shadow-2xl);
	background: rgb(15 23 42 / 0.5);
}

.consultation-photo-frame > img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top;
}

.consultation-badge {
	position: absolute;
	bottom: 1rem;
	inset-inline: 1rem;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	background: rgb(2 6 23 / 0.8);
	backdrop-filter: blur(12px);
	padding: 0.75rem;
	border-radius: 0.75rem;
	border: 1px solid rgb(255 255 255 / 0.1);
}

.consultation-badge-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 9999px;
	background: rgb(99 102 241 / 0.2);
	color: #818cf8;
	flex-shrink: 0;
}

.consultation-badge-text {
	display: flex;
	flex-direction: column;
}

.consultation-badge-text strong {
	font-size: 0.875rem;
	font-weight: 500;
}

.consultation-badge-text small {
	font-size: 0.75rem;
	color: #94a3b8;
}

.consultation-content {
	order: 1;
	width: 100%;
	text-align: start;
}

.consultation-tag {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.25rem 0.75rem;
	border-radius: 9999px;
	background: rgb(99 102 241 / 0.1);
	border: 1px solid rgb(99 102 241 / 0.2);
	color: #818cf8;
	font-size: 0.875rem;
	font-weight: 500;
	margin-bottom: 1.5rem;
}

.consultation-content h2 {
	font-size: clamp(1.875rem, 4vw, 3rem);
	line-height: 1.25;
	margin-bottom: 1.5rem;
}

.consultation-gradient-text {
	background: linear-gradient(to left, #6366f1, #60a5fa);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.consultation-content > p {
	font-size: 1.125rem;
	color: #cbd5e1;
	max-width: 42rem;
	line-height: 1.8;
	margin-bottom: 2rem;
}

.consultation-features {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	margin-bottom: 2rem;
}

.consultation-features span {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	background: rgb(255 255 255 / 0.05);
	border: 1px solid rgb(255 255 255 / 0.1);
	padding: 1rem;
	border-radius: 0.75rem;
	color: #e2e8f0;
	font-weight: 500;
}

.consultation-actions {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.glow-button-wrap {
	position: relative;
	display: inline-flex;
}

.glow-button-wrap::before {
	content: "";
	position: absolute;
	inset: -4px;
	background: linear-gradient(to top left, #6366f1, #3b82f6, #a855f7);
	border-radius: 0.75rem;
	opacity: 0.75;
	filter: blur(6px);
	animation: pulse-glow 3s ease-in-out infinite;
}

.glow-button-wrap .btn {
	position: relative;
	width: 100%;
}

.consultation-actions .btn-lg {
	height: 3.5rem;
	padding-inline: 2rem;
	font-size: 1.1rem;
}

@media (min-width: 640px) {
	.consultation-features {
		grid-template-columns: repeat(3, 1fr);
	}

	.consultation-actions {
		flex-direction: row;
	}
}

@media (min-width: 1024px) {
	.consultation-inner {
		flex-direction: row;
		gap: 5rem;
	}

	.consultation-photo {
		order: 1;
		width: 33.33%;
	}

	.consultation-content {
		order: 2;
		width: 66.66%;
	}
}

@keyframes pulse-glow {
	0%, 100% {
		opacity: 0.75;
	}
	50% {
		opacity: 0.4;
	}
}

/* ---------- Stats ---------- */

.stats-intro {
	text-align: center;
	margin-bottom: 2rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.stats-intro h2 {
	font-size: clamp(1.875rem, 3vw, 2.25rem);
}

.stats-intro p {
	color: var(--muted-foreground);
	font-size: 1.125rem;
	max-width: 42rem;
	margin-inline: auto;
}

.stats-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
}

@media (min-width: 768px) {
	.stats-grid {
		grid-template-columns: repeat(4, 1fr);
		gap: 2rem;
	}
}

.stat-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 2rem 1rem;
	text-align: center;
	background: rgb(255 255 255 / 0.6);
	border-radius: var(--radius-xl);
	transition: background 0.2s;
}

.stat-card:hover {
	background: #ffffff;
}

.stat-icon {
	display: inline-flex;
	padding: 0.75rem;
	border-radius: 1rem;
	background: rgb(23 23 23 / 0.08);
	color: var(--primary);
	transition: background 0.3s, color 0.3s;
}

.stat-card:hover .stat-icon {
	background: var(--primary);
	color: var(--primary-foreground);
}

.stat-value {
	font-size: 2.25rem;
	letter-spacing: -0.02em;
}

.stat-plus {
	color: var(--primary);
	margin-inline-start: 0.15rem;
}

.stat-card p {
	color: var(--muted-foreground);
	font-weight: 500;
}

/* ---------- Gallery mosaic ---------- */

.gallery-mosaic {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
}

@media (min-width: 768px) {
	.gallery-mosaic {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1024px) {
	.gallery-mosaic {
		grid-template-columns: repeat(4, 1fr);
	}
}

.gallery-tile {
	position: relative;
	overflow: hidden;
	border-radius: var(--radius);
	box-shadow: var(--shadow-md);
	aspect-ratio: 1 / 1;
	background: var(--muted);
	display: block;
}

@media (min-width: 768px) {
	.gallery-tile-wide {
		grid-column: span 2;
		grid-row: span 2;
		aspect-ratio: 16 / 9;
	}
}

.gallery-tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s;
}

.gallery-tile:hover img {
	transform: scale(1.1);
}

.gallery-tile-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--muted-foreground);
	opacity: 0.4;
}

.gallery-tile-caption {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	padding: 1rem;
	background: linear-gradient(to top, rgb(0 0 0 / 0.7), rgb(0 0 0 / 0.2), transparent);
	color: #ffffff;
	font-weight: 500;
	opacity: 0;
	transition: opacity 0.3s;
}

.gallery-tile:hover .gallery-tile-caption {
	opacity: 1;
}

/* ---------- Archive pages ---------- */

.archive-page {
	padding-block: 3rem 5rem;
}

.archive-intro {
	text-align: center;
	margin-bottom: 4rem;
}

.archive-intro h1 {
	font-size: 2.25rem;
	letter-spacing: -0.02em;
	margin-bottom: 1rem;
}

.archive-intro p,
.contact-intro-text {
	font-size: 1.125rem;
	color: var(--muted-foreground);
	max-width: 42rem;
	margin-inline: auto;
}

.archive-empty {
	text-align: center;
	color: var(--muted-foreground);
	padding-block: 3rem;
}

.archive-search {
	max-width: 28rem;
	margin: 2rem auto 0;
}

/* Pagination */

.pagination,
.navigation.pagination {
	margin-top: 3rem;
}

.nav-links.pagination-links,
.navigation.pagination .nav-links {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
}

.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding-inline: 0.75rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: 0.9rem;
	color: var(--foreground);
	transition: background 0.2s;
}

.page-numbers:hover {
	background: var(--muted);
}

.page-numbers.current {
	background: var(--primary);
	color: var(--primary-foreground);
	border-color: var(--primary);
}

.page-numbers.dots {
	border: none;
}

.screen-reader-text + .nav-links {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
}

/* ---------- Single pages ---------- */

.single-narrow {
	max-width: 56rem;
	margin-inline: auto;
}

.single-article,
.single-gallery,
.page-default,
.consult-page {
	padding-block: 2rem 4rem;
}

.breadcrumb {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	font-size: 0.875rem;
	color: var(--muted-foreground);
	margin-bottom: 1.5rem;
}

.breadcrumb a:hover {
	color: var(--foreground);
}

.breadcrumb-current {
	color: var(--foreground);
	max-width: 20rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.single-header {
	text-align: center;
	margin-bottom: 2rem;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.single-date {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	color: var(--muted-foreground);
	font-size: 0.95rem;
}

.single-title {
	font-size: clamp(1.875rem, 4vw, 3.25rem);
	letter-spacing: -0.02em;
}

.single-excerpt {
	max-width: 42rem;
	margin-inline: auto;
	font-size: 1.25rem;
	color: var(--muted-foreground);
	line-height: 1.8;
}

.single-cover {
	position: relative;
	aspect-ratio: 16 / 9;
	width: 100%;
	overflow: hidden;
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-lg);
	margin: 0 0 3rem;
}

.single-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.single-share {
	margin-top: 3rem;
	padding-block: 2rem;
	border-top: 1px solid var(--border);
	display: flex;
	justify-content: center;
}

/* Prose (entry content) */

.prose {
	font-size: 1.06rem;
	line-height: 2;
	color: var(--foreground);
}

.prose p {
	margin-block: 1.1em;
}

.prose h2 {
	font-size: 1.5rem;
	margin-block: 1.6em 0.8em;
}

.prose h3 {
	font-size: 1.25rem;
	margin-block: 1.4em 0.7em;
}

.prose ul,
.prose ol {
	padding-inline-start: 1.5rem;
	margin-block: 1.1em;
}

.prose ul {
	list-style: disc;
}

.prose ol {
	list-style: decimal;
}

.prose img {
	border-radius: var(--radius);
	margin-block: 1.5em;
}

.prose a {
	color: var(--primary);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.prose blockquote {
	border-inline-start: 3px solid var(--border);
	margin-inline: 0;
	padding-inline-start: 1.25rem;
	color: var(--muted-foreground);
}

.prose figure {
	margin-inline: 0;
}

/* Gallery single: style native gallery blocks into a grid */

.gallery-content .wp-block-gallery,
.gallery-content .gallery {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
}

@media (min-width: 768px) {
	.gallery-content .wp-block-gallery,
	.gallery-content .gallery {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1024px) {
	.gallery-content .wp-block-gallery,
	.gallery-content .gallery {
		grid-template-columns: repeat(4, 1fr);
	}
}

.gallery-content .wp-block-gallery figure,
.gallery-content .gallery-item {
	margin: 0;
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}

.gallery-content .wp-block-gallery img,
.gallery-content .gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s;
	margin: 0;
}

.gallery-content .wp-block-gallery figure:hover img,
.gallery-content .gallery-item:hover img {
	transform: scale(1.05);
}

.gallery-content .wp-block-embed {
	margin-block: 1.5rem;
}

.gallery-content iframe {
	width: 100%;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: var(--radius);
}

/* ---------- Single book ---------- */

.book-page {
	padding-block: 3rem 5rem;
}

.single-book-layout {
	display: grid;
	gap: 3rem;
	grid-template-columns: 1fr;
	max-width: 70rem;
	margin-inline: auto;
}

@media (min-width: 1024px) {
	.single-book-layout {
		grid-template-columns: 5fr 7fr;
	}
}

.single-book-cover {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	align-self: start;
	position: sticky;
	top: 6rem;
	max-width: 24rem;
	width: 100%;
	margin-inline: auto;
}

.single-book-cover-frame {
	position: relative;
	aspect-ratio: 2 / 3;
	width: 100%;
	overflow: hidden;
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-2xl);
	transition: transform 0.3s;
	background: var(--muted);
}

.single-book-cover-frame:hover {
	transform: scale(1.02);
}

.single-book-cover-frame img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.single-book-title {
	font-size: clamp(2rem, 4vw, 3rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.25;
	margin-bottom: 1.5rem;
}

.single-book-content .prose {
	color: var(--muted-foreground);
	font-size: 1.15rem;
}

.book-download-btn {
	margin-top: 2rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.book-download-label {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.download-count {
	background: rgb(255 255 255 / 0.15);
	border: 1px solid rgb(255 255 255 / 0.2);
	border-radius: 9999px;
	padding: 0.15rem 0.8rem;
	font-size: 0.85rem;
	font-weight: 400;
	white-space: nowrap;
}

.single-book-meta {
	margin-top: 1.5rem;
	display: flex;
	justify-content: center;
	text-align: center;
	padding: 1.5rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-xl);
	background: var(--card);
	box-shadow: var(--shadow-sm);
}

.single-book-meta-label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	font-size: 0.875rem;
	color: var(--muted-foreground);
	margin-bottom: 0.35rem;
}

.single-book-meta-value {
	font-weight: 600;
}

/* ---------- Single activity ---------- */

.activity-page {
	padding-block: 2rem 4rem;
}

.activity-card-page {
	max-width: 56rem;
	margin-inline: auto;
	overflow: hidden;
	border-radius: var(--radius-2xl);
	background: var(--card);
	border: 1px solid var(--border);
	box-shadow: var(--shadow-xl);
}

.activity-hero {
	margin: 0;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.activity-hero img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.activity-body {
	padding: 2rem;
}

.activity-body .single-title {
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	margin-bottom: 1rem;
}

.activity-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	color: var(--muted-foreground);
	font-size: 0.95rem;
	margin-bottom: 1.5rem;
}

.activity-meta span {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

/* ---------- About / CV page ---------- */

.about-page {
	padding-block: 2rem 4rem;
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.cv-header {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-sm);
	padding: 2rem;
	margin-bottom: 2rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2rem;
}

.cv-header-text {
	min-width: 0;
}

.cv-header-photo {
	flex-shrink: 0;
}

.cv-header-photo img {
	width: 170px;
	height: 170px;
	object-fit: cover;
	object-position: center 22%;
	border-radius: var(--radius-xl);
	border: 1px solid var(--border);
	background: #fbfbfb;
}

@media (max-width: 640px) {
	.cv-header {
		flex-direction: column-reverse;
		align-items: flex-start;
	}
}

.cv-header h1 {
	font-size: 1.875rem;
	color: var(--primary);
	letter-spacing: -0.02em;
}

.cv-subtitle {
	font-size: 1.25rem;
	color: var(--muted-foreground);
	margin-top: 0.5rem;
}

.cv-contact {
	margin-top: 1rem;
	font-size: 0.9rem;
	color: var(--muted-foreground);
}

.cv-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
}

@media (min-width: 768px) {
	.cv-grid {
		grid-template-columns: 2fr 1fr;
		align-items: start;
	}
}

.cv-main,
.cv-side {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	min-width: 0;
}

.cv-card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-sm);
	padding: 1.5rem;
}

.cv-card h2 {
	font-size: 1.15rem;
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--border);
}

.cv-card ul {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	list-style: none;
	padding: 0;
	color: var(--muted-foreground);
	font-size: 0.95rem;
}

.cv-card ul li::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 9999px;
	background: var(--primary);
	margin-inline-end: 0.6rem;
	vertical-align: 2px;
}

.cv-timeline li {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem;
	justify-content: space-between;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--border);
	color: var(--foreground);
}

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

.cv-card ul.cv-timeline li::before {
	display: none;
}

.cv-timeline small {
	color: var(--muted-foreground);
}

.cv-badge {
	display: inline-block;
	border: 1px solid var(--border);
	border-radius: 9999px;
	padding: 0.1rem 0.7rem;
	font-size: 0.78rem;
	color: var(--foreground);
	white-space: nowrap;
}

.cv-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.cv-badges span {
	background: var(--secondary);
	border-radius: 9999px;
	padding: 0.25rem 0.8rem;
	font-size: 0.8rem;
	font-weight: 500;
}

/* ---------- Contact page / forms ---------- */

.contact-page {
	padding-block: 2rem 5rem;
}

.contact-page .archive-intro {
	margin-bottom: 2rem;
}

.contact-form {
	max-width: 42rem;
	margin-inline: auto;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.form-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
}

@media (min-width: 640px) {
	.form-row {
		grid-template-columns: repeat(2, 1fr);
	}
}

.form-field {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0;
}

.form-field label {
	font-size: 0.9rem;
	font-weight: 500;
}

.form-field input,
.form-field textarea,
.search-form input[type="search"] {
	width: 100%;
	font-family: inherit;
	font-size: 0.95rem;
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--input);
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--foreground);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field input:focus,
.form-field textarea:focus,
.search-form input[type="search"]:focus {
	outline: none;
	border-color: var(--ring);
	box-shadow: 0 0 0 3px rgb(163 163 163 / 0.3);
}

.form-field textarea {
	resize: none;
	min-height: 150px;
}

.form-honeypot {
	position: absolute;
	inset-inline-start: -9999px;
	margin: 0;
}

.form-notice {
	max-width: 42rem;
	margin: 0 auto 1.5rem;
	padding: 1.25rem 1.5rem;
	border-radius: var(--radius);
	text-align: center;
}

.form-notice-success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #15803d;
}

.form-notice-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
}

.search-form {
	display: flex;
	gap: 0.5rem;
}

/* ---------- Consult page ---------- */

.consult-cta {
	display: flex;
	justify-content: center;
	margin-top: 2.5rem;
}

/* ---------- 404 ---------- */

.error-404 {
	padding-block: 6rem;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.5rem;
}

.error-404 h1 {
	font-size: 5rem;
	color: var(--primary);
}

.error-404 p {
	color: var(--muted-foreground);
	font-size: 1.125rem;
}

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

.site-footer {
	position: relative;
	overflow: hidden;
	background: var(--footer-bg);
	color: #ffffff;
	padding-block: 3rem 2rem;
}

.footer-grid-pattern {
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0.075;
	background-image:
		linear-gradient(to left, #ffffff 1px, transparent 1px),
		linear-gradient(to bottom, #ffffff 1px, transparent 1px);
	background-size: 45px 45px;
	-webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
	mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.footer-inner {
	position: relative;
	z-index: 10;
}

.footer-columns {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	margin-bottom: 4rem;
}

@media (min-width: 768px) {
	.footer-columns {
		grid-template-columns: 5fr 3fr 3fr;
		gap: 3rem;
	}
}

.footer-brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.footer-logo {
	background: rgb(255 255 255 / 0.1);
	padding: 0.5rem;
	border-radius: 0.75rem;
	backdrop-filter: blur(4px);
	border: 1px solid rgb(255 255 255 / 0.1);
	margin-bottom: 1rem;
}

.footer-logo img {
	width: 3rem;
	height: 3rem;
	filter: invert(1) brightness(100);
}

@media (min-width: 768px) {
	.footer-logo img {
		width: 4rem;
		height: 4rem;
	}
}

.footer-site-name {
	font-weight: 700;
	font-size: 1.5rem;
}

@media (min-width: 768px) {
	.footer-site-name {
		font-size: 1.875rem;
	}
}

.footer-description {
	color: rgb(255 255 255 / 0.9);
	font-size: 0.875rem;
	line-height: 1.8;
	max-width: 32rem;
	margin-top: 1rem;
}

.footer-socials {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1rem;
}

.footer-socials a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border: 1px solid rgb(255 255 255 / 0.3);
	border-radius: var(--radius-sm);
	background: rgb(255 255 255 / 0.05);
	color: #ffffff;
	transition: background 0.2s, transform 0.2s;
}

.footer-socials a:hover {
	background: rgb(255 255 255 / 0.1);
	transform: scale(1.05);
}

.footer-links h3 {
	font-size: 1.25rem;
	margin-bottom: 1.5rem;
	position: relative;
	display: inline-block;
	color: var(--footer-accent);
	padding-bottom: 0.5rem;
}

.footer-links h3::after {
	content: "";
	position: absolute;
	bottom: 0;
	inset-inline-start: 0;
	width: 50%;
	height: 2px;
	border-radius: 9999px;
	background: rgb(235 227 204 / 0.5);
}

.footer-menu {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.footer-menu a {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.875rem;
	color: rgb(255 255 255 / 0.8);
	transition: color 0.2s;
}

.footer-menu a::before {
	content: "";
	width: 4px;
	height: 4px;
	border-radius: 9999px;
	background: var(--footer-accent);
	opacity: 0.5;
	transition: opacity 0.2s;
	flex-shrink: 0;
}

.footer-menu a:hover {
	color: #ffffff;
}

.footer-menu a:hover::before {
	opacity: 1;
}

.footer-divider {
	height: 1px;
	width: 100%;
	background: rgb(255 255 255 / 0.5);
	margin-bottom: 2rem;
}

.footer-bottom {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	font-size: 0.875rem;
}

@media (min-width: 768px) {
	.footer-bottom {
		flex-direction: row;
	}
}

.footer-credit a {
	color: rgb(255 255 255 / 0.8);
	transition: color 0.2s;
	text-underline-offset: 4px;
}

.footer-credit a:hover {
	color: #ffffff;
	text-decoration: underline;
	text-decoration-color: rgb(255 255 255 / 0.3);
}

/* ---------- WordPress core helpers ---------- */

.alignwide {
	max-width: 1200px;
	margin-inline: auto;
}

.alignfull {
	width: 100%;
}

.wp-caption {
	max-width: 100%;
}

.wp-caption-text,
figcaption {
	font-size: 0.85rem;
	color: var(--muted-foreground);
	text-align: center;
	margin-top: 0.5rem;
}
