/* ==========================================================================
   İslâmi Davet · Risale-i Nur — main stylesheet
   01 fonts · 02 tokens · 03 base · 04 header (top bar, banner, nav) · 05 overlays
   06 home (books, notice) · 07 pages · 08 footer · 09 motion & print
   Visual language shared with the İslâmi Davet theme: warm paper, crimson accent,
   serif headlines (Newsreader), sans text (Inter), midnight footer.
   ========================================================================== */

/* ---------- 01 · Fonts (self-hosted, Turkish subsets; SIL OFL) ---------- */

@font-face {
	font-family: "Newsreader";
	src: url("../fonts/newsreader-tr.woff2") format("woff2");
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0020-007E, U+00A0-00FF, U+0100-0101, U+011E-011F, U+012A-012B, U+0130-0131, U+0152-0153, U+015E-015F, U+016A-016B, U+018F, U+0259, U+02BE-02BF, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2032-2033, U+2039-203A, U+20AC, U+20BA, U+2122, U+2190-2193, U+2197, U+2212;
}

@font-face {
	font-family: "Inter";
	src: url("../fonts/inter-tr.woff2") format("woff2");
	font-weight: 400 800;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0020-007E, U+00A0-00FF, U+0100-0101, U+011E-011F, U+012A-012B, U+0130-0131, U+0152-0153, U+015E-015F, U+016A-016B, U+018F, U+0259, U+02BE-02BF, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2032-2033, U+2039-203A, U+20AC, U+20BA, U+2122, U+2190-2193, U+2197, U+2212;
}

/* ---------- 02 · Design tokens ---------- */

:root {
	--paper: #f8f5ef;
	--surface: #ffffff;
	--surface-2: #f1ece3;
	--surface-3: #e8e0d3;
	--sand: #f3ebdd;
	--ink: #1b1814;
	--ink-2: #4a433b;
	--ink-3: #6b6359;
	--line: #e3dcd0;
	--line-2: #d2c8b8;
	--brand: #a3191f;
	--brand-2: #861318;
	--brand-soft: #f7e6e3;
	--gold: #85611e;
	--gold-2: #c9a55c;
	--gold-3: #efdcaa;
	--emerald: #0b6b4f;
	--night: #12181f;
	--on-night: #f0ebe3;
	--on-night-2: #aeb6bf;
	--focus: #a3191f;
	--pattern-ink: rgb(27 24 20 / 0.055);
	--shadow-1: 0 1px 2px rgb(27 24 20 / 0.05), 0 4px 14px rgb(27 24 20 / 0.06);
	--shadow-2: 0 18px 50px rgb(27 24 20 / 0.16), 0 2px 6px rgb(27 24 20 / 0.06);

	--font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
	--font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-arabic: "Geeza Pro", "Noto Naskh Arabic", "Traditional Arabic", "Times New Roman", serif;

	--container: 1180px;
	--gutter: 16px;
	--radius-s: 6px;
	--radius: 10px;
	--radius-l: 16px;
	--navbar-h: 56px;
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);

	/* Eight-point lattice, used as a mask for the subtle pattern. */
	--pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Crect x='20' y='20' width='24' height='24'/%3E%3Crect x='20' y='20' width='24' height='24' transform='rotate(45 32 32)'/%3E%3Cpath d='M0 32h15M49 32h15M32 0v15M32 49v15M0 0l12 12M64 0 52 12M0 64l12-12M64 64 52 52'/%3E%3C/g%3E%3C/svg%3E");

	color-scheme: light;
}

@media (min-width: 768px) {
	:root {
		--gutter: 24px;
	}
}

@media (min-width: 1280px) {
	:root {
		--gutter: 32px;
	}
}

/* ---------- 03 · Base ---------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--navbar-h) + 12px);
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 1rem/1.6 var(--font-sans);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-wrap: break-word;
}

body.is-locked {
	overflow: hidden;
}

img,
svg,
video {
	max-width: 100%;
}

img {
	height: auto;
}

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

h1,
h2,
h3,
h4 {
	margin: 0;
	font-family: var(--font-serif);
	line-height: 1.15;
	text-wrap: balance;
}

p {
	margin: 0 0 1em;
}

ul,
ol {
	padding-left: 1.2em;
}

button,
input {
	font: inherit;
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
	border-radius: 3px;
}

::selection {
	background: var(--brand);
	color: #fff;
}

/* Subtle lattice behind everything. */
.site {
	position: relative;
	isolation: isolate;
}

.site::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: var(--pattern-ink);
	-webkit-mask: var(--pattern) 0 0 / 64px 64px repeat;
	mask: var(--pattern) 0 0 / 64px 64px repeat;
}

/* Utilities */

.container {
	width: 100%;
	max-width: calc(var(--container) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.container--narrow {
	max-width: calc(820px + 2 * var(--gutter));
}

.sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	top: 0;
	left: 1rem;
	z-index: 200;
	padding: 0.65rem 1rem;
	background: var(--ink);
	color: #fff;
	border-radius: 0 0 var(--radius-s) var(--radius-s);
	transform: translateY(-120%);
	transition: transform 0.2s;
}

.skip-link:focus {
	transform: none;
}

.icon {
	width: 1.1em;
	height: 1.1em;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.nowrap {
	white-space: nowrap;
}

.eyebrow {
	margin: 0 0 0.6rem;
	font: 700 0.7rem/1.2 var(--font-sans);
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--gold);
}

.eyebrow a:hover {
	color: var(--brand);
}

.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ink);
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}

.icon-btn .icon {
	width: 1.35rem;
	height: 1.35rem;
}

.icon-btn:hover {
	background: var(--surface-2);
	color: var(--brand);
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.3rem;
	border-radius: 999px;
	background: var(--brand);
	color: #fff;
	font-weight: 600;
	transition: background-color 0.2s, transform 0.2s;
}

.btn:hover {
	background: var(--brand-2);
	transform: translateY(-1px);
}

/* ---------- 04 · Header ---------- */

/* Top bar (desktop only) */

.topbar {
	display: none;
	border-bottom: 1px solid var(--line);
	background: color-mix(in srgb, var(--paper) 86%, #fff);
	font-size: 0.78rem;
}

@media (min-width: 1024px) {
	.topbar {
		display: block;
	}
}

.topbar__inner {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	min-height: 40px;
}

.dateline {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin: 0;
	color: var(--ink-2);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.dateline .icon {
	width: 0.95rem;
	height: 0.95rem;
	color: var(--brand);
}

.dateline__sep {
	color: var(--line-2);
}

[data-hijri] {
	color: var(--gold);
	font-weight: 500;
}

[data-hijri]:empty,
[data-hijri]:empty + * {
	display: none;
}

.dateline:has([data-hijri]:empty) .dateline__sep {
	display: none;
}

.topbar__end {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-left: auto;
}

.topbar__link {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.35rem 0.7rem;
	border-radius: 999px;
	color: var(--ink-2);
	font-weight: 600;
	transition: background-color 0.2s, color 0.2s;
}

.topbar__link .icon {
	width: 0.85rem;
	height: 0.85rem;
}

.topbar__link:hover {
	background: var(--surface-2);
	color: var(--brand);
}

.social {
	display: flex;
	align-items: center;
	gap: 0.15rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.social__link {
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	color: var(--ink-2);
	transition: background-color 0.2s, color 0.2s;
}

.social__link .icon {
	width: 1rem;
	height: 1rem;
}

.social__link:hover {
	background: var(--surface-2);
	color: var(--brand);
}

/* "Sitelerimiz" dropdown (details/summary — works without JS) */

.dropdown {
	position: relative;
}

.dropdown > summary {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	color: var(--ink-2);
	font-weight: 600;
	cursor: pointer;
	list-style: none;
	transition: background-color 0.2s, color 0.2s;
}

.dropdown > summary::-webkit-details-marker {
	display: none;
}

.dropdown > summary .icon {
	width: 0.95rem;
	height: 0.95rem;
}

.dropdown__chev {
	transition: transform 0.2s;
}

.dropdown > summary:hover,
.dropdown[open] > summary {
	background: var(--surface-2);
	color: var(--brand);
}

.dropdown[open] .dropdown__chev {
	transform: rotate(180deg);
}

.dropdown__panel {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 70;
	width: min(640px, 92vw);
	padding: 0.75rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-l);
	background: var(--surface);
	box-shadow: var(--shadow-2);
	animation: idr-pop 0.18s var(--ease);
}

.dropdown__main {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	margin-bottom: 0.6rem;
	padding: 0.7rem 0.9rem;
	border-radius: var(--radius);
	background: var(--ink);
	color: #fff;
	font: 700 0.95rem/1.2 var(--font-serif);
}

.dropdown__main small {
	font: 400 0.76rem var(--font-sans);
	color: var(--on-night-2);
}

.dropdown__main .icon {
	align-self: center;
	margin-left: auto;
	width: 1rem;
	height: 1rem;
}

.dropdown__main:hover {
	background: var(--brand);
}

.dropdown__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.5rem;
}

@keyframes idr-pop {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}

/* Site cards (dropdown, drawer, footer) */

.site-card {
	--c: var(--gold);
	display: flex;
	align-items: center;
	gap: 0.8rem;
	min-width: 0;
	padding: 0.65rem 0.8rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--ink);
	transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}

.site-card__icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 2.4rem;
	height: 2.4rem;
	border-radius: 0.6rem;
	background: color-mix(in srgb, var(--c) 14%, transparent);
	color: var(--c);
}

.site-card__icon .icon {
	width: 1.2rem;
	height: 1.2rem;
}

.site-card__text {
	display: grid;
	gap: 0.1rem;
	min-width: 0;
}

.site-card__text strong {
	font: 600 0.92rem/1.2 var(--font-sans);
}

.site-card__text small {
	font-size: 0.76rem;
	line-height: 1.35;
	color: var(--ink-3);
}

.site-card__go {
	flex: none;
	width: 0.95rem;
	height: 0.95rem;
	margin-left: auto;
	color: var(--ink-3);
}

.site-card:hover {
	border-color: var(--c);
	transform: translateY(-1px);
}

.site-card.is-current {
	border-color: var(--c);
	background: color-mix(in srgb, var(--c) 8%, var(--surface));
}

/* Masthead: the kept Risale-i Nur banner (1000 × 200 transparent PNG) */

.masthead {
	position: relative;
	padding-top: clamp(0.5rem, 1.6vw, 1.1rem);
	background: radial-gradient(60% 140% at 50% 0%, rgb(255 253 247 / 0.95), transparent 72%);
}

.masthead__inner {
	max-width: calc(1000px + 2 * var(--gutter));
}

.masthead__brand {
	margin: 0;
	font: inherit;
}

.masthead__link {
	display: block;
}

.masthead__img {
	display: block;
	width: 100%;
	height: auto;
	margin-inline: auto;
}

.rule {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	padding: 0.3rem 0 0.75rem;
	color: var(--gold-2);
}

.rule::before,
.rule::after {
	content: "";
	flex: 1;
	height: 1px;
	background: linear-gradient(to right, transparent, var(--gold-2));
}

.rule::after {
	transform: scaleX(-1);
}

.rule .icon {
	width: 0.85rem;
	height: 0.85rem;
}

/* Brand (site title) */

.brand {
	display: inline-flex;
	align-items: center;
	min-width: 0;
	color: var(--ink);
}

.brand__name {
	font: 700 1.3rem/1 var(--font-serif);
	letter-spacing: -0.01em;
	white-space: nowrap;
}

.brand__text {
	display: grid;
	gap: 0.35rem;
}

.brand__tagline {
	font: 600 0.62rem/1 var(--font-sans);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ink-3);
}

/* Navigation bar (sticky) */

.navbar {
	position: sticky;
	top: 0;
	z-index: 50;
	border-block: 1px solid var(--line);
	background: color-mix(in srgb, var(--paper) 94%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(12px);
	backdrop-filter: saturate(1.4) blur(12px);
	transition: box-shadow 0.25s;
}

.navbar.is-stuck {
	box-shadow: 0 8px 24px rgb(0 0 0 / 0.07);
}

.navbar-sentinel {
	height: 1px;
	margin-bottom: -1px;
}

.navbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	min-height: var(--navbar-h);
}

.navbar__toggle {
	margin-left: -0.6rem;
}

.navbar__actions {
	margin-right: -0.6rem;
}

.primary-nav {
	display: none;
}

@media (min-width: 1120px) {
	.navbar {
		border-top-color: var(--ink);
	}

	.navbar__toggle,
	.brand--bar {
		display: none;
	}

	.navbar__inner::before {
		content: "";
		width: 2.75rem;
		flex: none;
	}

	.primary-nav {
		display: block;
		flex: 1;
		min-width: 0;
	}

	.navbar__actions {
		margin-right: -0.6rem;
	}
}

.primary-nav .menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-nav .menu > li {
	position: relative;
}

.primary-nav .menu > li > a {
	position: relative;
	display: block;
	padding: 1.05rem 0.7rem;
	font: 600 0.72rem/1 var(--font-sans);
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--ink-2);
	transition: color 0.2s;
}

@media (min-width: 1280px) {
	.primary-nav .menu > li > a {
		padding-inline: 0.9rem;
		font-size: 0.76rem;
		letter-spacing: 0.07em;
	}
}

.primary-nav .menu > li > a::after {
	content: "";
	position: absolute;
	left: 0.7rem;
	right: 0.7rem;
	bottom: 0.6rem;
	height: 2px;
	background: var(--brand);
	transform: scaleX(0);
	transition: transform 0.25s var(--ease);
}

.primary-nav .menu > li > a:hover,
.primary-nav .menu > li:focus-within > a,
.primary-nav .menu > .current-menu-item > a,
.primary-nav .menu > .current-menu-ancestor > a,
.primary-nav .menu > li > a[aria-current] {
	color: var(--brand);
}

.primary-nav .menu > li > a:hover::after,
.primary-nav .menu > li:focus-within > a::after,
.primary-nav .menu > .current-menu-item > a::after,
.primary-nav .menu > .current-menu-ancestor > a::after,
.primary-nav .menu > li > a[aria-current]::after {
	transform: scaleX(1);
}

/* Optional second level */

.primary-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 60;
	min-width: 14rem;
	margin: 0;
	padding: 0.4rem;
	list-style: none;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-2);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}

.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.primary-nav .sub-menu a {
	display: block;
	padding: 0.6rem 0.8rem;
	border-radius: var(--radius-s);
	font-size: 0.9rem;
	color: var(--ink-2);
}

.primary-nav .sub-menu a:hover {
	background: var(--surface-2);
	color: var(--brand);
}

.brand--bar {
	margin-inline: auto;
}

/* The site title can be long ("Risale-i Nur - Üstâd Bediüzzaman Said-i Nursi(ra)"): on phones it is a little smaller and wraps instead of running under the buttons. */
.brand--bar .brand__name {
	font-size: clamp(0.82rem, 0.2rem + 3vw, 1.3rem);
	line-height: 1.1;
	white-space: normal;
	text-wrap: balance;
}

.navbar .brand--bar .brand__name {
	text-align: center;
}

/* ---------- 05 · Overlays: search panel, search form, mobile drawer ---------- */

.search-form {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.35rem 0.35rem 0.35rem 1.15rem;
	border: 1px solid var(--line-2);
	border-radius: 999px;
	background: var(--surface);
	box-shadow: var(--shadow-1);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form:focus-within {
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgb(163 25 31 / 0.15);
}

.search-form__input {
	flex: 1;
	min-width: 0;
	padding: 0.55rem 0;
	border: 0;
	background: transparent;
	font: 500 1.05rem/1.3 var(--font-sans);
	outline: none;
}

.search-form__input::placeholder {
	color: var(--ink-3);
}

.search-form__submit {
	display: grid;
	place-items: center;
	flex: none;
	width: 2.6rem;
	height: 2.6rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--brand);
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s;
}

.search-form__submit:hover {
	background: var(--brand-2);
}

.search-panel,
.drawer {
	position: fixed;
	inset: 0;
	z-index: 100;
}

.search-panel[hidden],
.drawer[hidden] {
	display: none;
}

/* While an overlay fades out it must not swallow clicks meant for the page. */
.search-panel:not(.is-open),
.drawer:not(.is-open) {
	pointer-events: none;
}

.search-panel__backdrop,
.drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgb(18 24 31 / 0.55);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity 0.25s;
}

.search-panel.is-open .search-panel__backdrop,
.drawer.is-open .drawer__backdrop {
	opacity: 1;
}

.search-panel__box {
	position: relative;
	padding: 1rem 0 1.75rem;
	border-bottom: 1px solid var(--line);
	background: var(--paper);
	transform: translateY(-14px);
	opacity: 0;
	transition: transform 0.28s var(--ease), opacity 0.2s;
}

.search-panel.is-open .search-panel__box {
	transform: none;
	opacity: 1;
}

.search-panel__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.5rem;
}

.search-panel__top .eyebrow {
	margin: 0;
}

.drawer__panel {
	position: absolute;
	inset: 0 auto 0 0;
	display: flex;
	flex-direction: column;
	width: min(88vw, 390px);
	background: var(--paper);
	box-shadow: var(--shadow-2);
	transform: translateX(-100%);
	transition: transform 0.32s var(--ease);
}

.drawer.is-open .drawer__panel {
	transform: none;
}

.drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.5rem 0.75rem 0.5rem 1.1rem;
	border-bottom: 1px solid var(--line);
}

.drawer__head .brand--bar {
	margin: 0;
}

.drawer__body {
	flex: 1;
	padding: 1rem 1.1rem 1.5rem;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.drawer__nav .menu {
	margin: 1rem 0 1.5rem;
	padding: 0;
	list-style: none;
}

.drawer__nav .menu a {
	display: block;
	padding: 0.85rem 0.15rem;
	border-bottom: 1px solid var(--line);
	font: 600 1.05rem/1.25 var(--font-serif);
}

.drawer__nav .menu a:hover,
.drawer__nav .menu .current-menu-item > a,
.drawer__nav .menu a[aria-current] {
	color: var(--brand);
}

.drawer__nav .sub-menu {
	margin: 0;
	padding: 0 0 0 1rem;
	list-style: none;
}

.drawer__heading {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 0.75rem;
	font: 700 0.7rem/1.2 var(--font-sans);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--gold);
}

.drawer__main {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6rem;
	margin-bottom: 0.75rem;
	padding: 0.75rem 0.95rem;
	border-radius: var(--radius);
	background: var(--ink);
	color: #fff;
	font: 700 0.92rem/1.25 var(--font-serif);
}

.drawer__main:hover {
	background: var(--brand);
}

.drawer__main .icon {
	width: 1rem;
	height: 1rem;
}

.sites--drawer .sites__title {
	display: none;
}

.sites--drawer .sites__grid {
	grid-template-columns: 1fr;
	gap: 0.5rem;
	margin: 0;
}

.sites--drawer .site-card small {
	display: none;
}

.drawer__foot .dateline {
	flex-wrap: wrap;
	white-space: normal;
}

.drawer__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 0.75rem;
	padding: 0.75rem 1.1rem calc(0.75rem + env(safe-area-inset-bottom));
	border-top: 1px solid var(--line);
	font-size: 0.78rem;
}

/* ---------- 06 · Homepage ---------- */

.site-main {
	padding-block: clamp(0.5rem, 2vw, 1.5rem) 0;
}

.site-main:focus {
	outline: none;
}

/* The books start right under the navigation bar (the section heading is screen-reader-only). */

.library {
	padding-top: clamp(1rem, 2.5vw, 1.5rem);
}

/* Book grid */

.books {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(0.75rem, 2.2vw, 1.5rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 620px) {
	.books {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 900px) {
	.books {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 1120px) {
	.books {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

/* Card: the wrapper never moves, only its inner part flips (so hover cannot flicker). */

.book {
	/* The flip state. Hover, tap and keyboard focus switch these three values (see "Flip" below). */
	--flip-angle: 0deg;
	--front-visibility: visible;
	--front-swap: 0.06s;
	display: grid;
	min-width: 0;
	perspective: 1200px;
}

.book__flip {
	position: relative;
	display: grid;
	transform: rotateY(var(--flip-angle));
	transform-style: preserve-3d;
	transition: transform 0.75s var(--ease);
}

.book__face {
	position: relative;
	grid-area: 1 / 1;
	border-radius: var(--radius-l);
}

/*
 * Hide the backface of the faces AND of everything inside them.
 *
 * Safari/WebKit paints every element that gets a compositing layer of its own (the cover image, the
 * shadow under it, the masked pattern…) as a separate layer and does not hide it together with its
 * parent face. With only the faces hidden, the cover showed through — mirrored — on the back of the
 * flipped card. Chrome and Firefox hide the whole face at once, so this is harmless there.
 * (The front also needs transform-style: preserve-3d, see below, or WebKit still ignores the children.)
 */
.book__face,
.book__face *,
.book__face *::before,
.book__face *::after {
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

/* Front */

.book__front {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1.25rem 0.75rem 1.05rem;
	border: 1px solid var(--line);
	background: linear-gradient(180deg, #fff 0%, var(--surface-2) 100%);
	box-shadow: var(--shadow-1);
	text-align: center;
	/* Keeps the children in the same 3-D space, so WebKit hides them with the face. */
	transform-style: preserve-3d;
	/* Safety net: also hide the front for good once the card has turned past edge-on (see "Flip"). */
	visibility: var(--front-visibility);
	transition: visibility 0s linear var(--front-swap);
}

.book__stage {
	position: relative;
	display: grid;
	place-items: end center;
	width: 100%;
	padding-bottom: 0.3rem;
}

.book__stage::after {
	content: "";
	position: absolute;
	left: 12%;
	right: 12%;
	bottom: 0;
	height: 0.7rem;
	border-radius: 50%;
	background: radial-gradient(closest-side, rgb(40 25 10 / 0.3), transparent);
}

.book__cover {
	position: relative;
	z-index: 1;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 13.5rem;
	object-fit: contain;
	filter: drop-shadow(0 9px 7px rgb(40 25 10 / 0.22));
}

.book__title {
	font: 600 1.02rem/1.2 var(--font-serif);
	color: var(--ink);
}

.book__sub {
	display: block;
	margin-top: 0.3rem;
	font: 600 0.66rem/1 var(--font-sans);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gold);
}

/* Back: the hover content (Lügatlı Oku · Flash Oku · PDF İndir) */

.book__back {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.95rem;
	padding: 1rem 0.85rem;
	overflow: hidden;
	isolation: isolate;
	border: 1px solid rgb(255 255 255 / 0.12);
	background: radial-gradient(120% 90% at 50% 0%, #b8222a 0%, var(--brand) 40%, #761018 100%);
	box-shadow: 0 18px 40px rgb(110 16 21 / 0.32);
	color: #fff;
	transform: rotateY(180deg);
}

.book__back::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgb(239 220 170 / 0.17);
	-webkit-mask: var(--pattern) 0 0 / 48px 48px repeat;
	mask: var(--pattern) 0 0 / 48px 48px repeat;
}

.book__back-title {
	margin: 0;
	font: 600 1.05rem/1.25 var(--font-serif);
	text-align: center;
	color: var(--gold-3);
	text-wrap: balance;
}

.book__actions {
	display: grid;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.book__action {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	width: 100%;
	padding: 0.62rem 0.8rem;
	border: 1px solid rgb(255 255 255 / 0.34);
	border-radius: 999px;
	background: rgb(255 255 255 / 0.1);
	color: #fff;
	font: 700 0.7rem/1.1 var(--font-sans);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.book__action .icon {
	width: 1.05rem;
	height: 1.05rem;
}

a.book__action:hover,
a.book__action:focus-visible {
	border-color: var(--gold-3);
	background: var(--gold-3);
	color: #4a0d11;
	transform: translateX(2px);
}

a.book__action:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.book__action.is-soon {
	border-style: dashed;
	opacity: 0.5;
	cursor: not-allowed;
}

.book__note {
	margin: -0.35rem 0 0;
	text-align: center;
	font: 600 0.66rem/1.3 var(--font-sans);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--gold-3);
}

.book--soon .book__cover {
	filter: drop-shadow(0 9px 7px rgb(40 25 10 / 0.22)) saturate(0.92);
}

/*
 * Flip: mouse hover, keyboard focus, tap (JS adds .is-open on touch screens).
 *
 * --front-swap times the safety net on .book__front: with the 0.75s / ease curve the card is edge-on
 * after about 0.11s, so the front is hidden a little later than that on the way over (0.16s) and shown
 * again a little earlier on the way back (0.06s). Where backface-visibility already hides it nothing
 * changes; where an engine gets that wrong, the mirrored front disappears after a few frames at most.
 */

@media (hover: hover) {
	.book:hover {
		--flip-angle: 180deg;
		--front-visibility: hidden;
		--front-swap: 0.16s;
	}
}

.book.is-open {
	--flip-angle: 180deg;
	--front-visibility: hidden;
	--front-swap: 0.16s;
}

@supports selector(:has(*)) {
	.book:has(:focus-visible) {
		--flip-angle: 180deg;
		--front-visibility: hidden;
		--front-swap: 0.16s;
	}
}

@supports not selector(:has(*)) {
	.book:focus-within {
		--flip-angle: 180deg;
		--front-visibility: hidden;
		--front-swap: 0.16s;
	}
}

/* Notice */

.notice {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 1rem 1.1rem;
	max-width: 62rem;
	margin: clamp(2rem, 5vw, 3.5rem) auto 0;
	padding: 1.25rem 1.4rem;
	border: 1px solid var(--line);
	border-left: 4px solid var(--gold-2);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-1);
}

.notice__icon {
	display: grid;
	place-items: center;
	width: 2.7rem;
	height: 2.7rem;
	border-radius: 50%;
	background: var(--brand-soft);
	color: var(--brand);
}

.notice__icon .icon {
	width: 1.4rem;
	height: 1.4rem;
}

.notice__body p {
	margin: 0 0 0.6em;
	font-size: 0.95rem;
	line-height: 1.7;
	color: var(--ink-2);
}

.notice__body p:last-child {
	margin-bottom: 0;
}

.notice__body a {
	color: var(--brand);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.notice__body a:hover {
	color: var(--brand-2);
}

@media (max-width: 520px) {
	.notice {
		grid-template-columns: 1fr;
	}
}

/* ---------- 07 · Pages, listings, forms ---------- */

.page-head {
	margin: clamp(1.5rem, 4vw, 3rem) 0 1.5rem;
}

.page-head__title {
	font-size: clamp(1.8rem, 1.3rem + 2vw, 2.8rem);
	letter-spacing: -0.02em;
}

.page-head__lead {
	margin: 0.75rem 0 0;
	font: 400 1.15rem/1.55 var(--font-serif);
	color: var(--ink-2);
}

.article__media {
	margin: 0 0 1.5rem;
}

.article__media img {
	width: 100%;
	border-radius: var(--radius);
}

.prose {
	font: 400 1.12rem/1.75 var(--font-serif);
	color: var(--ink);
}

.prose > * + * {
	margin-top: 1.1em;
}

.prose h2,
.prose h3,
.prose h4 {
	margin-top: 1.6em;
}

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

.prose img,
.prose iframe,
.prose video {
	border-radius: var(--radius);
}

.prose blockquote {
	margin-inline: 0;
	padding: 0.25rem 0 0.25rem 1.1rem;
	border-left: 3px solid var(--gold-2);
	font-style: italic;
	color: var(--ink-2);
}

.prose .alignwide,
.prose .alignfull {
	max-width: 100%;
}

.page-links {
	margin-top: 1.5rem;
	font: 600 0.9rem var(--font-sans);
}

.post-list {
	display: grid;
	gap: 1.25rem;
}

.post-card {
	display: grid;
	gap: 1rem;
	padding: 1rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-l);
	background: var(--surface);
	box-shadow: var(--shadow-1);
}

@media (min-width: 640px) {
	.post-card:has(.post-card__media) {
		grid-template-columns: 240px 1fr;
		align-items: center;
	}
}

.post-card__media img {
	width: 100%;
	border-radius: var(--radius);
}

.post-card__title {
	margin: 0 0 0.4rem;
	font-size: 1.35rem;
}

.post-card__title a:hover {
	color: var(--brand);
}

.post-card__excerpt {
	margin: 0;
	color: var(--ink-2);
}

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

.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	justify-content: center;
}

.pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.7rem;
	border: 1px solid var(--line-2);
	border-radius: 999px;
	background: var(--surface);
	font-weight: 600;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
	border-color: var(--brand);
	background: var(--brand);
	color: #fff;
}

.post-navigation .nav-links {
	justify-content: space-between;
}

.post-navigation a {
	display: grid;
	gap: 0.2rem;
	max-width: 24rem;
	font: 600 1.05rem/1.3 var(--font-serif);
}

.post-navigation a:hover {
	color: var(--brand);
}

.nav-sub {
	font: 700 0.66rem/1 var(--font-sans);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gold);
}

.not-found {
	display: grid;
	justify-items: start;
	gap: 1rem;
	padding-bottom: 1rem;
}

.not-found .search-form {
	width: min(100%, 30rem);
}

.not-found__code {
	margin: 0;
	font: 700 clamp(4rem, 12vw, 7rem)/1 var(--font-serif);
	color: var(--brand);
	opacity: 0.9;
}

/* ---------- 08 · Footer ---------- */

.site-footer {
	position: relative;
	isolation: isolate;
	margin-top: clamp(2.5rem, 6vw, 4.5rem);
	background: var(--night);
	color: var(--on-night-2);
}

.site-footer::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgb(255 255 255 / 0.04);
	-webkit-mask: var(--pattern) 0 0 / 64px 64px repeat, linear-gradient(#000, transparent 70%);
	-webkit-mask-composite: source-in;
	mask: var(--pattern) 0 0 / 64px 64px repeat, linear-gradient(#000, transparent 70%);
	mask-composite: intersect;
}

.site-footer::after {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 3px;
	background: linear-gradient(to right, var(--brand), var(--gold-2) 50%, var(--emerald));
}

.footer__top {
	display: grid;
	gap: 2.25rem;
	padding-block: clamp(2.5rem, 6vw, 4rem);
}

@media (min-width: 640px) {
	.footer__top {
		grid-template-columns: 1fr 1fr;
	}

	.footer__brand {
		grid-column: 1 / -1;
	}
}

@media (min-width: 1024px) {
	.footer__top {
		grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
		gap: 3rem;
	}

	.footer__brand {
		grid-column: auto;
	}
}

.footer__brand {
	display: grid;
	gap: 1.1rem;
	align-content: start;
}

.brand--footer .brand__name {
	font-size: 1.7rem;
	line-height: 1.15;
	color: #fff;
	/* The site title can be long ("Risale-i Nur - Üstâd Bediüzzaman Said-i Nursi(ra)"): wrap it instead of running into the next column. */
	white-space: normal;
	text-wrap: balance;
}

.brand--footer .brand__tagline {
	color: var(--on-night-2);
}

.footer__about {
	max-width: 46ch;
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.65;
}

.social--footer .social__link {
	width: 2.4rem;
	height: 2.4rem;
	background: rgb(255 255 255 / 0.07);
	color: var(--on-night);
}

.social--footer .social__link:hover {
	background: var(--brand);
	color: #fff;
}

.footer__title {
	margin: 0 0 1rem;
	font: 700 0.72rem/1.2 var(--font-sans);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--on-night);
}

.footer-links {
	display: grid;
	gap: 0.55rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-links a {
	font-size: 0.95rem;
	color: var(--on-night-2);
	transition: color 0.2s;
}

.footer-links a:hover {
	color: #fff;
}

.langs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lang-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.28rem 0.8rem 0.28rem 0.3rem;
	border: 1px solid rgb(255 255 255 / 0.16);
	border-radius: 999px;
	color: var(--on-night);
	font-size: 0.88rem;
	transition: border-color 0.2s, background-color 0.2s;
}

.lang-chip:hover {
	border-color: var(--gold-2);
	background: rgb(255 255 255 / 0.05);
}

.lang-chip__code {
	display: grid;
	place-items: center;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.1);
	font: 700 0.6rem/1 var(--font-sans);
	letter-spacing: 0.05em;
}

.lang-chip[lang="ar"] .lang-chip__label,
.lang-chip[lang="fa"] .lang-chip__label,
.lang-chip[lang="ur"] .lang-chip__label {
	font: 400 1.1rem/1.2 var(--font-arabic);
}

.footer__sites {
	padding-bottom: clamp(2rem, 4vw, 3rem);
}

.footer__title--sites {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 0.25rem;
	padding-top: 1.75rem;
	border-top: 1px solid rgb(255 255 255 / 0.1);
}

.sites__group {
	margin-top: 1.5rem;
}

.sites__title {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	margin: 0;
	font: 600 0.68rem/1.2 var(--font-sans);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--on-night-2);
}

.sites__title::after {
	content: "";
	flex: 1;
	height: 1px;
	background: rgb(255 255 255 / 0.1);
}

.sites__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 0.7rem;
	margin-top: 0.9rem;
}

.site-footer .site-card {
	border-color: rgb(255 255 255 / 0.1);
	background: rgb(255 255 255 / 0.04);
	color: var(--on-night);
}

.site-footer .site-card__icon {
	background: color-mix(in srgb, var(--c) 30%, transparent);
	color: color-mix(in srgb, var(--c) 45%, #fff);
}

.site-footer .site-card__text small,
.site-footer .site-card__go {
	color: var(--on-night-2);
}

.site-footer .site-card:hover {
	border-color: color-mix(in srgb, var(--c) 70%, #fff);
	background: rgb(255 255 255 / 0.07);
}

.site-footer .site-card.is-current {
	border-color: color-mix(in srgb, var(--c) 70%, #fff);
	background: color-mix(in srgb, var(--c) 22%, transparent);
}

.footer__bottom {
	border-top: 1px solid rgb(255 255 255 / 0.1);
	font-size: 0.85rem;
}

.footer__bottom-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	padding-block: 1.1rem;
}

.footer__copy {
	margin: 0;
}

.to-top {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--on-night);
	font-weight: 600;
}

.to-top:hover {
	color: #fff;
}

.site-footer :focus-visible {
	outline-color: #f28b85;
}

/* ---------- 09 · Motion and print ---------- */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}

	/* No 3-D flip: cross-fade the two faces instead. */
	.book__flip {
		transform: none !important;
		transform-style: flat;
	}

	.book__face {
		transition: opacity 0.2s;
	}

	.book__front {
		visibility: visible;
		transform-style: flat;
	}

	.book__back {
		transform: none;
		opacity: 0;
		pointer-events: none;
	}

	.book.is-open .book__back {
		opacity: 1;
		pointer-events: auto;
	}

	.book.is-open .book__front {
		opacity: 0;
	}

	@media (hover: hover) {
		.book:hover .book__back {
			opacity: 1;
			pointer-events: auto;
		}

		.book:hover .book__front {
			opacity: 0;
		}
	}

	@supports selector(:has(*)) {
		.book:has(:focus-visible) .book__back {
			opacity: 1;
			pointer-events: auto;
		}

		.book:has(:focus-visible) .book__front {
			opacity: 0;
		}
	}

	@supports not selector(:has(*)) {
		.book:focus-within .book__back {
			opacity: 1;
			pointer-events: auto;
		}

		.book:focus-within .book__front {
			opacity: 0;
		}
	}
}

@media print {
	.topbar,
	.navbar,
	.navbar-sentinel,
	.search-panel,
	.drawer,
	.site-footer .footer__sites,
	.to-top {
		display: none !important;
	}

	.site::before,
	.site-footer::before,
	.site-footer::after {
		display: none;
	}

	.site-footer {
		background: none;
		color: #000;
	}

	.book__flip {
		transform: none !important;
	}

	.book__front {
		visibility: visible !important;
	}

	.book__back {
		display: none;
	}
}
