/* =========================================================
   بن جويد — خريطة الرحلة
   Layout: chart (sea) bands for hero / gallery / headers, paper bands
   for books & reading, a logbook page on a desk, a dark footer.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
	/* constant materials */
	--paper: #EFE3C8;
	--paper-2: #F4EAD4;
	--paper-ink: #1B2F3A;
	--paper-muted: #4A5A60;
	--paper-muted-2: #5F6E74;
	--navy: #0D2431;
	--night: #0A1C26;
	--red: #8E2B23;
	--brass-deep: #8C6A2C;
	--rule: rgba(13, 36, 49, .16);

	/* light theme (chart bands become pale paper) */
	--sea: #F7F1E4;
	--sea-2: #EDE4D1;
	--desk: #D8C9AA;
	--land: #E6D9BD;
	--ink: #1B2F3A;
	--ink-strong: #0D2431;
	--muted: #45565D;
	--muted-2: #5E6E74;
	--brass: #86642A;
	--brass-rgb: 134, 100, 42;
	--on-brass: #FFF8EA;
	--logo-filter: none;
	--medallion-ring: #F7F1E4;

	/* type */
	--f-display: "Noto Naskh Arabic", "Traditional Arabic", "Times New Roman", serif;
	--f-script: "Aref Ruqaa", "Noto Naskh Arabic", serif;
	--f-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;

	--wrap: 1360px;
	--gutter: max(20px, env(safe-area-inset-left, 0px));
	--head-h: 84px;
	color-scheme: light;
}

:root[data-theme="dark"] {
	--sea: #0D2431;
	--sea-2: #102C3B;
	--desk: #0D2431;
	--land: #12313F;
	--ink: #EFE3C8;
	--ink-strong: #F7EEDB;
	--muted: #B9C6CB;
	--muted-2: #8FA3AB;
	--brass: #D9B26A;
	--brass-rgb: 217, 178, 106;
	--on-brass: #1B1408;
	--logo-filter: brightness(0) invert(.86) sepia(.6) saturate(1.4);
	--medallion-ring: #0D2431;
	color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--sea: #0D2431;
		--sea-2: #102C3B;
		--desk: #0D2431;
		--land: #12313F;
		--ink: #EFE3C8;
		--ink-strong: #F7EEDB;
		--muted: #B9C6CB;
		--muted-2: #8FA3AB;
		--brass: #D9B26A;
		--brass-rgb: 217, 178, 106;
		--on-brass: #1B1408;
		--logo-filter: brightness(0) invert(.86) sepia(.6) saturate(1.4);
		--medallion-ring: #0D2431;
		color-scheme: dark;
	}
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 12px); }
body {
	margin: 0;
	background: var(--sea);
	color: var(--ink);
	font-family: var(--f-body);
	font-size: 17px;
	line-height: 1.85;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.35; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; border-radius: 2px; }
.paper :focus-visible, .logbook :focus-visible { outline-color: var(--red); }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
	position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100;
	padding: 10px 16px; background: var(--brass); color: var(--on-brass); text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
	max-width: var(--wrap);
	margin-inline: auto;
	padding-left: max(20px, env(safe-area-inset-left, 0px));
	padding-right: max(20px, env(safe-area-inset-right, 0px));
}
@media (min-width: 900px) {
	.wrap { padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); }
}
.wrap--narrow { max-width: 1160px; }
.wrap--read { max-width: 820px; }

/* ---------- Buttons & small parts ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 54px; padding: 0 28px; border-radius: 2px;
	font: 600 16.5px/1.2 var(--f-body); text-decoration: none; cursor: pointer;
	border: 1.5px solid transparent; transition: filter .2s, background-color .2s;
}
.btn .icon { flex: 0 0 auto; }
.btn-brass {
	background: var(--brass); color: var(--on-brass);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), inset 0 0 0 4px var(--brass), inset 0 0 0 5px rgba(0, 0, 0, .28);
}
.btn-brass:hover { filter: brightness(1.08); }
.btn-line { border-color: rgba(var(--brass-rgb), .6); color: var(--ink); }
.btn-line:hover { background: rgba(var(--brass-rgb), .12); }
.btn-ink { background: var(--navy); color: var(--paper); }
.btn-ink:hover { filter: brightness(1.25); }
.btn-ink-line { border-color: var(--navy); color: var(--navy); }
.btn-ink-line:hover { background: rgba(13, 36, 49, .07); }
.btn-red-line { border-color: var(--red); color: var(--red); }
.btn-red-line:hover { background: rgba(142, 43, 35, .07); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.icon-btn {
	width: 46px; height: 46px; flex: 0 0 auto;
	display: grid; place-items: center; border-radius: 50%;
	border: 1px solid rgba(var(--brass-rgb), .5); background: transparent; color: var(--brass); cursor: pointer;
}
.icon-btn:hover { background: rgba(var(--brass-rgb), .12); }

.theme-toggle .when-light { display: none; }
:root[data-theme="light"] .theme-toggle .when-dark { display: none; }
:root[data-theme="light"] .theme-toggle .when-light { display: inline; }
@media (prefers-color-scheme: light) {
	:root:not([data-theme="dark"]) .theme-toggle .when-dark { display: none; }
	:root:not([data-theme="dark"]) .theme-toggle .when-light { display: inline; }
}

.script-kicker { font-family: var(--f-script); font-size: 26px; line-height: 1.5; color: var(--brass); }
.script-kicker a { text-decoration: none; }
.paper .script-kicker { color: var(--red); }
.section-title { font-size: clamp(36px, 4.4vw, 62px); font-weight: 700; color: var(--ink-strong); }
.paper .section-title { color: var(--navy); }
.section-lede { margin-top: 12px; font-size: 18px; color: var(--muted); max-width: 36em; }
.paper .section-lede { color: var(--paper-muted); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin-bottom: 56px; }
.section-head--center { display: block; text-align: center; }
.section-head--center .section-lede { margin-inline: auto; }
.link-more { color: var(--brass); font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; padding-block: 8px 2px; }
.empty { padding: 40px 0; text-align: center; color: var(--paper-muted); }

/* ---------- Chart & paper surfaces ---------- */
.chart {
	position: relative; overflow: hidden;
	background-color: var(--sea);
	background-image:
		repeating-linear-gradient(0deg, rgba(var(--brass-rgb), .07) 0 1px, transparent 1px 120px),
		repeating-linear-gradient(90deg, rgba(var(--brass-rgb), .07) 0 1px, transparent 1px 120px);
	color: var(--ink);
}
.chart--soft { background-color: var(--sea-2); }
.chart-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.chart-lines .rhumb path { stroke: var(--brass); stroke-width: .8; opacity: .22; fill: none; }
.chart-lines .coast { fill: var(--land); stroke: var(--brass); stroke-width: 1.2; stroke-opacity: .45; }
.chart-lines .fill { fill: var(--brass); }
.chart-lines .port { fill: none; stroke: var(--brass); stroke-opacity: .6; }

.paper { position: relative; overflow: hidden; background: var(--paper); color: var(--paper-ink); }
.paper > .wrap, .paper > nav, .paper > div { position: relative; }
.paper-grain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; mix-blend-mode: multiply; pointer-events: none; }

.textile { display: block; height: 30px; }

/* ---------- Header ---------- */
.site-head {
	position: sticky; top: 0; z-index: 50;
	background: var(--sea);
	border-bottom: 1px solid rgba(var(--brass-rgb), .22);
	padding-top: env(safe-area-inset-top, 0px);
}
.admin-bar .site-head { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-head { top: 0; } }
.head-row { display: flex; align-items: center; gap: 24px; min-height: var(--head-h); }
.brand { display: flex; align-items: center; margin-inline-end: auto; }
.site-logo { width: 64px; height: auto; max-height: 62px; object-fit: contain; filter: var(--logo-filter); }
.main-nav .menu { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.main-nav a {
	display: flex; align-items: center; min-height: 46px; padding: 0 14px;
	color: var(--ink); text-decoration: none; font-size: 15.5px; white-space: nowrap; border-radius: 2px;
}
.main-nav a:hover { background: rgba(var(--brass-rgb), .1); }
.main-nav .current-menu-item > a, .main-nav .current_page_item > a, .main-nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--brass); }
.head-actions { display: flex; gap: 10px; }
.menu-btn { display: none; }
.menu-btn .when-open { display: none; }
.menu-btn[aria-expanded="true"] .when-open { display: inline; }
.menu-btn[aria-expanded="true"] .when-closed { display: none; }
.site-search { border-top: 1px solid rgba(var(--brass-rgb), .18); padding-block: 16px 20px; }

@media (max-width: 1100px) {
	.menu-btn { display: grid; }
	.main-nav {
		position: absolute; inset-inline: 0; top: 100%;
		background: var(--sea); border-bottom: 1px solid rgba(var(--brass-rgb), .25);
		padding: 8px max(20px, env(safe-area-inset-right, 0px)) 16px;
		display: none;
	}
	.main-nav.is-open { display: block; }
	.main-nav .menu { flex-direction: column; }
	.main-nav a { min-height: 52px; font-size: 18px; border-bottom: 1px solid rgba(var(--brass-rgb), .12); }
}
@media (max-width: 600px) {
	:root { --head-h: 72px; }
	.site-logo { width: 52px; }
	.head-actions { gap: 6px; }
	.icon-btn { width: 44px; height: 44px; }
}

/* ---------- Search form ---------- */
.search-label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.search-input {
	flex: 1 1 260px; min-width: 0; min-height: 54px; padding: 0 16px;
	border: 1px solid rgba(var(--brass-rgb), .45); border-radius: 2px;
	background: rgba(var(--brass-rgb), .06); color: var(--ink); font: 16px var(--f-body);
}
.paper .search-input { color: var(--paper-ink); border-color: rgba(13, 36, 49, .3); background: rgba(255, 255, 255, .5); }
.paper .search-label { color: var(--paper-muted); }

/* ---------- Hero ---------- */
.hero { padding-bottom: 8px; }
.chart-label { position: absolute; font-family: var(--f-script); color: var(--brass); pointer-events: none; }
.chart-label--sur { right: 21%; top: 78%; font-size: 26px; }
.chart-label--hadd { right: 4%; top: 85%; font-size: 18px; opacity: .65; }
.chart-label--sea { left: 50%; top: 93%; font-size: 22px; letter-spacing: .5em; opacity: .4; }
.hero-grid { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding-top: 40px; }
.hero-text { flex: 1 1 540px; min-width: 0; padding-block: 32px; }
.hero-coords { font-size: 14px; letter-spacing: .12em; color: var(--brass); margin-bottom: 20px; }
.hero-coords a { text-decoration: none; }
.hero-honorific { font-family: var(--f-script); font-size: 30px; color: var(--muted); }
.hero-name { margin-top: 4px; font-size: clamp(40px, 5.3vw, 76px); font-weight: 700; line-height: 1.25; color: var(--ink-strong); }
.hero-tagline { margin-top: 22px; font-family: var(--f-script); font-size: clamp(28px, 2.8vw, 40px); line-height: 1.5; color: var(--brass); }
.hero-lede { margin: 16px 0 36px; max-width: 32em; font-size: 19px; line-height: 1.95; font-weight: 300; color: var(--muted); }

.hero-medallion { flex: 0 1 640px; min-width: 0; display: flex; justify-content: center; }
.medallion { position: relative; width: min(640px, 100%); aspect-ratio: 1 / 1; }
.compass-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.compass-ring circle { stroke: var(--brass); }
.compass-ring .fill { fill: var(--brass); }
.compass-ring text { font-family: var(--f-display); font-size: 24px; fill: var(--brass); }
.compass-ring .north { font-size: 26px; font-weight: 700; fill: var(--ink-strong); }
.medallion-face {
	position: absolute; inset: 16%; border-radius: 50%; overflow: hidden;
	background: radial-gradient(circle at 50% 35%, #F3E7CC 0%, #E2D0A9 70%, #C9B07E 100%);
	box-shadow: 0 0 0 6px var(--medallion-ring), 0 0 0 7px var(--brass), 0 30px 60px rgba(0, 0, 0, .35);
}
.medallion-img { position: absolute; left: 50%; bottom: 0; width: 150%; max-width: none; transform: translateX(-50%); }

.hero-legend { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 28px 48px; padding-block: 8px 48px; }
.scale { display: flex; flex-direction: column; gap: 8px; width: 320px; max-width: 100%; }
.scale-label { font-size: 12.5px; letter-spacing: .1em; color: var(--muted-2); }
.scale-bar { display: flex; height: 10px; border: 1px solid var(--brass); }
.scale-bar i { flex: 1; }
.scale-bar i:nth-child(odd) { background: var(--brass); }
.scale-ticks { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.legend-stats { display: flex; flex-wrap: wrap; gap: 16px 40px; margin: 0; }
.legend-stats div { display: flex; flex-direction: column-reverse; }
.legend-stats dt { font-size: 12.5px; color: var(--muted-2); }
.legend-stats dd { margin: 0; font-family: var(--f-display); font-size: 34px; font-weight: 700; line-height: 1.3; color: var(--ink-strong); }

@media (max-width: 900px) {
	.hero-grid { flex-direction: column-reverse; align-items: stretch; padding-top: 24px; gap: 0; }
	.hero-medallion { flex: none; }
	.medallion { width: min(340px, 86vw); }
	.hero-text { text-align: center; padding-block: 24px 8px; flex: none; }
	.hero-lede { margin-inline: auto; }
	.hero .actions { justify-content: center; }
	.hero-legend { justify-content: center; text-align: center; }
	.chart-label { display: none; }
}
@media (max-width: 600px) {
	.hero-honorific { font-size: 22px; }
	.hero .actions .btn { flex: 1 1 100%; }
	.scale { display: none; }
	.legend-stats { gap: 12px 28px; }
	.legend-stats dd { font-size: 28px; }
}

/* ---------- Voyage (books route) ---------- */
.voyage { padding-block: 100px 110px; }
.margin-rose { position: absolute; left: 50px; top: 60px; width: 220px; height: 220px; opacity: .35; pointer-events: none; }
.margin-rose circle { fill: none; stroke: var(--brass-deep); }
.margin-rose .fill { fill: var(--brass-deep); }
.voyage .section-head { margin-bottom: 64px; }

.route { list-style: none; margin: 0; padding: 0; position: relative; display: grid; grid-template-columns: repeat(var(--stops, 7), minmax(0, 1fr)); gap: 22px; }
.route::before {
	content: ""; position: absolute; inset-inline: 4%; top: 19px; height: 0;
	border-top: 2px dashed var(--red);
}
.stop { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.stop-link { display: flex; flex-direction: column; align-items: center; width: 100%; text-decoration: none; color: var(--paper-ink); padding-top: 80px; }
.stop--low .stop-link { padding-top: 150px; }
.stop-marker { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: grid; place-items: center; }
.stop-marker i {
	display: block; width: 22px; height: 22px; border-radius: 50%;
	background: var(--paper); box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 5px var(--paper), inset 0 0 0 11px var(--red);
}
.stop-link::before {
	content: ""; position: absolute; top: 34px; height: 38px; left: 50%;
	border-left: 1px dashed var(--brass-deep);
}
.stop--low .stop-link::before { height: 108px; }
.stop--newest .stop-marker { top: -6px; }
.stop--newest .stop-marker svg .mast { stroke: var(--navy); stroke-width: 2; }
.stop--newest .stop-marker svg .sail { fill: var(--navy); }
.stop--newest .stop-marker svg .hull { fill: var(--red); }
.stop-cover { display: block; width: 100%; max-width: 160px; }
.book-cover {
	width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block;
	box-shadow: 8px 0 0 var(--navy), 10px 2px 0 #E2D2B0, 24px 26px 30px -12px rgba(13, 36, 49, .6);
}
.stop .book-cover { transform: perspective(700px) rotateY(16deg); transition: transform .35s ease; }
.stop-link:hover .book-cover, .stop-link:focus-visible .book-cover { transform: perspective(700px) rotateY(4deg) translateY(-6px); }
.stop--newest .book-cover { box-shadow: 8px 0 0 var(--navy), 10px 2px 0 #E2D2B0, 24px 26px 30px -12px rgba(13, 36, 49, .6), 0 0 0 3px var(--brass-deep); }
.book-cover--blank {
	display: grid; place-items: center; padding: 14px; overflow: hidden;
	background: var(--navy); color: var(--paper); font-family: var(--f-display); font-size: 17px; line-height: 1.5; text-align: center;
	background-image: linear-gradient(90deg, transparent 0 8px, rgba(217, 178, 106, .5) 8px 9px, transparent 9px calc(100% - 9px), rgba(217, 178, 106, .5) calc(100% - 9px) calc(100% - 8px), transparent calc(100% - 8px));
}
.book-cover--blank span { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.stop-title, .book-card-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.stop-year { margin-top: 22px; font-family: var(--f-display); font-size: 30px; font-weight: 700; line-height: 1.2; color: var(--red); }
.stop--newest .stop-year { font-family: var(--f-script); font-size: 26px; }
.stop-title { margin-top: 6px; font-family: var(--f-display); font-size: 18px; font-weight: 600; line-height: 1.5; }
.stop-kind { font-size: 13px; color: var(--paper-muted-2); }
.chip-dl {
	display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 12px;
	min-height: 32px; background: var(--navy); color: var(--paper); font-size: 12.5px; border-radius: 2px; text-decoration: none;
}
.chip-dl:hover { filter: brightness(1.3); }
.section-actions { margin-top: 80px; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

@media (max-width: 1100px) and (min-width: 901px) {
	.stop-title { font-size: 16px; }
	.stop-year { font-size: 24px; }
}
@media (max-width: 900px) {
	.voyage { padding-block: 60px 64px; }
	.margin-rose { width: 140px; height: 140px; left: -30px; top: 20px; }
	.route { display: flex; flex-direction: column; gap: 28px; padding-inline-start: 38px; }
	.route::before { inset-inline: auto; inset-inline-start: 10px; top: 10px; bottom: 30px; height: auto; border-top: 0; border-inline-start: 2px dashed var(--red); }
	.stop { flex-direction: row; flex-wrap: wrap; align-items: center; text-align: start; }
	.stop-link, .stop--low .stop-link { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; column-gap: 18px; padding-top: 0; align-items: start; }
	.stop-link::before { display: none; }
	.stop-cover { grid-row: 1 / span 4; max-width: 96px; }
	.stop .book-cover { transform: none; box-shadow: 5px 0 0 var(--navy), 14px 16px 20px -10px rgba(13, 36, 49, .6); }
	.stop--newest .book-cover { box-shadow: 5px 0 0 var(--navy), 0 0 0 3px var(--brass-deep), 14px 16px 20px -10px rgba(13, 36, 49, .6); }
	.stop-year { margin-top: 4px; font-size: 24px; }
	.stop-title { font-size: 17px; }
	.stop-marker { left: auto; transform: none; inset-inline-start: -38px; top: 44px; }
	.stop--newest .stop-marker { inset-inline-start: -46px; top: 30px; }
	.stop--newest .stop-marker svg { width: 34px; height: 31px; }
	.chip-dl { margin-inline-start: 114px; margin-top: -8px; }
	.section-actions { margin-top: 44px; }
	.section-actions .btn { flex: 1 1 100%; }
}

/* ---------- Logbook ---------- */
.log-desk { background: var(--desk); padding-block: 110px; }
.log-desk--page { padding-block: 70px 90px; }
.logbook {
	position: relative; background-color: var(--paper-2); color: var(--paper-ink);
	padding: 64px 80px 70px 64px;
	background-image: repeating-linear-gradient(180deg, transparent 0 55px, rgba(13, 36, 49, .13) 55px 56px);
	box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55);
}
.logbook-margin { position: absolute; top: 0; bottom: 0; right: 52px; width: 4px; border-inline: 1px solid rgba(142, 43, 35, .55); }
.stamp {
	position: absolute; left: 60px; top: 46px; width: 150px; height: 150px; border-radius: 50%;
	border: 3px solid rgba(142, 43, 35, .7);
	box-shadow: inset 0 0 0 6px var(--paper-2), inset 0 0 0 7px rgba(142, 43, 35, .7);
	transform: rotate(-14deg); display: grid; place-items: center; text-align: center;
	color: rgba(142, 43, 35, .8); font-family: var(--f-display); font-weight: 700; line-height: 1.35; pointer-events: none;
}
.stamp span { display: flex; flex-direction: column; font-size: 15px; }
.stamp b { font-size: 24px; }
.stamp small { font-size: 12px; letter-spacing: .1em; }
.logbook-kicker { font-size: 13px; letter-spacing: .14em; color: var(--red); }
.logbook-title { margin: 2px 0 36px; font-family: var(--f-script); font-size: clamp(44px, 5vw, 68px); font-weight: 700; color: var(--navy); }
.log-list { list-style: none; margin: 0; padding: 0; }
.log-row {
	display: grid; grid-template-columns: 160px minmax(0, 1fr) 220px 80px; gap: 0 16px; align-items: center;
	min-height: 72px; padding-block: 10px; border-bottom: 1px solid rgba(13, 36, 49, .18);
	text-decoration: none; color: var(--paper-ink);
}
.log-row--head { min-height: 0; padding-bottom: 10px; border-bottom: 2px solid var(--paper-ink); font-size: 13px; color: var(--paper-muted-2); }
a.log-row:hover .log-entry { color: var(--red); }
.log-date { font-family: var(--f-script); font-size: 21px; color: var(--red); line-height: 1.4; }
.log-entry { font-family: var(--f-display); font-size: 21px; font-weight: 600; line-height: 1.55; }
.log-source { font-size: 15px; color: var(--paper-muted); }
.log-go { display: inline-flex; align-items: center; gap: 6px; color: var(--red); font-weight: 600; font-size: 15px; }
.log-quote { margin: 44px 0 0; display: flex; gap: 16px; }
.log-quote::before { content: "«"; font-family: var(--f-display); font-size: 70px; line-height: .8; color: var(--red); }
.log-quote blockquote { margin: 0; }
.log-quote p { font-family: var(--f-script); font-size: clamp(24px, 2.5vw, 34px); line-height: 1.6; color: var(--navy); }
.log-quote figcaption { margin-top: 8px; font-size: 14px; color: var(--paper-muted-2); }
.log-more { margin-top: 30px; }

@media (max-width: 900px) {
	.log-desk { padding-block: 48px; }
	.log-desk .wrap { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
	.logbook { padding: 34px 40px 34px 20px; background-image: repeating-linear-gradient(180deg, transparent 0 47px, rgba(13, 36, 49, .13) 47px 48px); }
	.logbook-margin { right: 22px; width: 3px; }
	.stamp { width: 88px; height: 88px; left: 14px; top: 18px; border-width: 2px; }
	.stamp span { font-size: 11px; }
	.stamp b { font-size: 15px; }
	.stamp small { display: none; }
	.logbook-title { margin-bottom: 18px; }
	.log-row--head { display: none; }
	.log-row { grid-template-columns: 1fr; gap: 0; padding-block: 12px; }
	.log-date { font-size: 18px; }
	.log-entry { font-size: 18px; }
	.log-source { font-size: 13px; }
	.log-go { display: none; }
	.log-more .btn { width: 100%; }
}

/* ---------- Videos: film frames ---------- */
.reels { padding-block: 100px 110px; }
.reel-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 36px; }
.reel { display: flex; flex-direction: column; min-width: 0; }
.reel--lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px 48px; align-items: center; }
.reel--lead .reel-frame { grid-row: span 2; }
.reel-frame {
	position: relative; padding: 22px 12px; background: #16110D; border-radius: 3px;
	box-shadow: 0 26px 44px -20px rgba(13, 36, 49, .6);
}
.reel-frame::before, .reel-frame::after {
	content: ""; position: absolute; inset-inline: 10px; height: 8px;
	background-image: repeating-linear-gradient(90deg, rgba(239, 227, 200, .85) 0 10px, transparent 10px 22px);
	border-radius: 2px;
}
.reel-frame::before { top: 7px; }
.reel-frame::after { bottom: 7px; }
.reel-poster, .reel-frame iframe { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.reel-poster { overflow: hidden; }
.reel-poster img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.25) saturate(.9); transition: filter .3s, transform .4s ease; }
.reel-poster:hover img, .reel-poster:focus-visible img { filter: none; transform: scale(1.03); }
.reel-play {
	position: absolute; top: 50%; left: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px;
	display: grid; place-items: center; border-radius: 50%;
	background: rgba(217, 178, 106, .94); color: #1B1408; box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.reel-play .icon { transform: scaleX(-1); margin-inline-start: 4px; }
.reel-title { margin-top: 18px; font-family: var(--f-display); font-size: 19px; font-weight: 600; line-height: 1.6; color: var(--navy); }
.reel--lead .reel-title { margin-top: 0; font-size: clamp(24px, 2.4vw, 34px); align-self: end; }
.reel-yt { display: inline-flex; align-items: center; gap: 6px; align-self: start; min-height: 40px; color: var(--red); font-size: 14.5px; font-weight: 600; text-decoration: none; }
.reel-yt:hover { text-decoration: underline; }
@media (max-width: 900px) {
	.reels { padding-block: 56px 60px; }
	.reel-list { grid-template-columns: 1fr; gap: 36px; }
	.reel--lead { display: flex; }
	.reel--lead .reel-title { margin-top: 18px; font-size: 22px; }
	.reel-frame { padding: 16px 8px; }
	.reel-frame::before, .reel-frame::after { height: 6px; background-image: repeating-linear-gradient(90deg, rgba(239, 227, 200, .85) 0 7px, transparent 7px 16px); }
	.reel-frame::before { top: 5px; }
	.reel-frame::after { bottom: 5px; }
	.reel-play { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
}

/* ---------- Gallery & radio ---------- */
.gallery { padding-block: 100px 120px; }
.polaroids { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px; align-items: start; }
.polaroid {
	position: relative; display: block; background: var(--paper-2); padding: 14px 14px 46px;
	box-shadow: 0 24px 40px -14px rgba(0, 0, 0, .5); text-decoration: none; transition: transform .3s ease;
}
.polaroid::before {
	content: ""; position: absolute; top: -12px; left: 50%; width: 90px; height: 26px; margin-left: -45px;
	background: rgba(217, 178, 106, .75); transform: rotate(4deg);
}
.polaroids li:nth-child(1) .polaroid { transform: rotate(-3deg); }
.polaroids li:nth-child(2) .polaroid { transform: rotate(2deg); margin-top: 40px; }
.polaroids li:nth-child(3) .polaroid { transform: rotate(-1.5deg); }
.polaroids li:nth-child(4) .polaroid { transform: rotate(3deg); margin-top: 50px; }
.polaroid:hover, .polaroid:focus-visible { transform: rotate(0) scale(1.03) !important; }
.polaroid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.polaroid-caption { display: block; margin-top: 12px; font-family: var(--f-script); font-size: 20px; line-height: 1.5; color: var(--navy); text-align: center; }

.radio {
	margin-top: 110px; display: flex; flex-wrap: wrap; align-items: center; gap: 28px 40px;
	padding: 36px 44px; background: #1A1410; border: 1px solid #5A4421; border-radius: 14px;
	box-shadow: inset 0 0 0 6px #241B14, inset 0 0 0 7px #5A4421, 0 30px 60px -20px rgba(0, 0, 0, .6);
	color: #F0D49A;
}
.radio-play {
	width: 92px; height: 92px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center;
	background: radial-gradient(circle at 35% 30%, #F0D49A, #B88C3E 60%, #6F5222); color: #1A1410;
	box-shadow: 0 6px 16px rgba(0, 0, 0, .6); text-decoration: none;
}
a.radio-play:hover { filter: brightness(1.1); }
.radio-name { flex: 0 1 320px; min-width: 0; }
.radio-name p { font-size: 13px; letter-spacing: .12em; color: #C9B48D; }
.radio-name h3 { font-family: var(--f-script); font-size: clamp(36px, 4vw, 54px); font-weight: 700; line-height: 1.25; color: #F0D49A; }
.radio-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: #F0D49A; font-size: 15px; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(240, 212, 154, .45); }
.radio-link:hover { color: #FFF1CF; border-bottom-color: currentColor; }
.radio :focus-visible { outline-color: #F0D49A; }
.radio-dial {
	flex: 1 1 360px; min-width: 0; position: relative; height: 96px; border-radius: 6px; overflow: hidden; direction: ltr;
	background: linear-gradient(#F3E2B4, #E3CB8E); box-shadow: inset 0 2px 8px rgba(0, 0, 0, .35);
}
.dial-fine, .dial-major { position: absolute; left: 4%; right: 4%; top: 14px; }
.dial-fine { height: 26px; background-image: repeating-linear-gradient(90deg, #3B2B14 0 1px, transparent 1px 12px); }
.dial-major { height: 38px; background-image: repeating-linear-gradient(90deg, #3B2B14 0 2px, transparent 2px 60px); }
.dial-nums { position: absolute; left: 4%; right: 4%; bottom: 14px; display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: #3B2B14; }
.dial-needle { position: absolute; left: 61%; top: 6px; bottom: 6px; width: 3px; background: #A3241B; box-shadow: 0 0 6px rgba(163, 36, 27, .7); }

@media (max-width: 900px) {
	.gallery { padding-block: 56px 60px; }
	.polaroids { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
	.polaroids li:nth-child(2) .polaroid, .polaroids li:nth-child(4) .polaroid { margin-top: 18px; }
	.polaroid { padding: 8px 8px 26px; }
	.polaroid-caption { font-size: 16px; margin-top: 6px; }
	.radio { margin-top: 48px; padding: 20px; gap: 16px; }
	.radio-play { width: 64px; height: 64px; }
	.radio-play .icon { width: 22px; height: 22px; }
	.radio-dial { flex-basis: 100%; height: 64px; }
	.dial-fine { top: 10px; height: 16px; background-image: repeating-linear-gradient(90deg, #3B2B14 0 1px, transparent 1px 8px); }
	.dial-major { display: none; }
	.dial-nums { bottom: 8px; font-size: 11px; }
}

/* ---------- Inner page header ---------- */
.page-head { position: relative; overflow: hidden; background-color: var(--sea); color: var(--ink); padding-block: 80px 70px;
	background-image:
		repeating-linear-gradient(0deg, rgba(var(--brass-rgb), .07) 0 1px, transparent 1px 120px),
		repeating-linear-gradient(90deg, rgba(var(--brass-rgb), .07) 0 1px, transparent 1px 120px);
}
.page-head .wrap { position: relative; z-index: 1; }
.page-title { font-size: clamp(36px, 4.6vw, 64px); font-weight: 700; color: var(--ink-strong); }
.page-lede { margin-top: 12px; font-size: 18px; color: var(--muted); max-width: 40em; }
.entry-meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: 15px; }
.entry-meta a { color: var(--brass); }
@media (max-width: 600px) { .page-head { padding-block: 48px 40px; } }

/* ---------- Reading (prose) ---------- */
.page-body { padding-block: 70px 90px; }
.prose { font-size: 18px; line-height: 2; color: var(--paper-ink); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 32px; color: var(--navy); margin-top: 1.6em; }
.prose h3 { font-size: 25px; color: var(--navy); margin-top: 1.4em; }
.prose a { color: var(--red); text-underline-offset: 3px; }
.prose blockquote { margin-inline: 0; padding-inline-start: 22px; border-inline-start: 3px solid var(--red); font-family: var(--f-display); font-size: 21px; color: var(--navy); }
.prose img, .prose figure { max-width: 100%; height: auto; }
.prose figure { margin-inline: 0; }
.prose figcaption { font-size: 14px; color: var(--paper-muted-2); text-align: center; }
.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--rule); padding: 8px 12px; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.entry-figure img { width: 100%; box-shadow: 0 20px 40px -20px rgba(13, 36, 49, .5); }
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { margin-inline: auto; }
.wp-caption { max-width: 100%; }
/* NextGEN & WPDM output inside pages keeps working; give it room */
.prose .ngg-galleryoverview, .prose .w3eden { margin-top: 24px; }

/* ---------- Book page ---------- */
.book-hero { padding-block: 70px 80px; }
.book-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 64px; align-items: center; }
.book-cover--hero { max-width: 340px; transform: perspective(900px) rotateY(12deg); }
.book-title { font-size: clamp(32px, 4vw, 56px); font-weight: 700; color: var(--ink-strong); line-height: 1.3; }
.book-meta { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 24px 0 34px; }
.book-meta div { display: flex; flex-direction: column-reverse; }
.book-meta dt { font-size: 13px; color: var(--muted-2); }
.book-meta dd { margin: 0; font-family: var(--f-display); font-size: 26px; font-weight: 700; color: var(--brass); }
.dl-count { color: var(--muted); font-size: 15px; }
.no-digital { color: var(--muted); }
.book-excerpt { font-family: var(--f-display); font-size: 22px; color: var(--navy); }
.book-nav { padding-block: 34px; border-top: 1px solid var(--rule); }
.book-nav-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.book-nav-link { display: flex; flex-direction: column; min-width: 0; max-width: 46%; text-decoration: none; color: var(--paper-ink); }
.book-nav-link small { font-size: 13px; color: var(--red); }
.book-nav-link span { font-family: var(--f-display); font-size: 19px; font-weight: 600; line-height: 1.5; }
.book-nav-link--next { text-align: end; margin-inline-start: auto; }
@media (max-width: 800px) {
	.book-hero { padding-block: 40px 48px; }
	.book-hero-grid { grid-template-columns: 1fr; gap: 32px; justify-items: center; text-align: center; }
	.book-cover--hero { max-width: 220px; transform: none; }
	.book-meta { justify-content: center; }
	.book-hero .actions { justify-content: center; }
	.book-hero .actions .btn { flex: 1 1 100%; }
	.book-nav-link { max-width: 100%; }
}

/* ---------- Books archive & library ---------- */
.shelf-page { padding-block: 70px 100px; }
.shelf-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 56px 32px; }
.book-card { display: flex; flex-direction: column; align-items: flex-start; height: 100%; }
.book-card-link { display: flex; flex-direction: column; text-decoration: none; color: var(--paper-ink); }
.book-card-cover { display: block; width: 100%; max-width: 200px; }
.book-card .book-cover { transition: transform .3s ease; }
.book-card-link:hover .book-cover { transform: translateY(-6px); }
.book-card-year { margin-top: 20px; font-family: var(--f-display); font-size: 24px; font-weight: 700; color: var(--red); line-height: 1.3; }
.book-card-title { font-family: var(--f-display); font-size: 18px; font-weight: 600; line-height: 1.55; }
.book-card-kind { font-size: 13px; color: var(--paper-muted-2); }
.library-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 40px; }
.library-item { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 28px; align-items: center; padding: 24px; background: rgba(255, 255, 255, .45); border: 1px solid var(--rule); }
.library-title { font-size: 22px; color: var(--navy); line-height: 1.5; }
.library-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 18px; font-size: 14px; color: var(--paper-muted); }
@media (max-width: 600px) {
	.shelf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 18px; }
	.library-item { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 16px; }
	.library-item .btn { min-height: 48px; padding: 0 18px; }
}

/* ---------- Search results & pagination ---------- */
.search-again { margin-bottom: 36px; }
.results { list-style: none; margin: 0; padding: 0; }
.result { display: flex; flex-direction: column; padding-block: 18px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--paper-ink); }
.result-type { font-size: 13px; color: var(--red); font-weight: 600; }
.result-title { font-family: var(--f-display); font-size: 22px; font-weight: 600; }
.result-excerpt { color: var(--paper-muted); font-size: 15.5px; }
.pagination { margin-top: 36px; }
.pagination ul, .pagination .nav-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination a, .pagination span.page-numbers {
	display: grid; place-items: center; min-width: 46px; min-height: 46px; padding: 0 12px;
	border: 1px solid rgba(var(--brass-rgb), .5); color: var(--ink); text-decoration: none;
}
.pagination .current { background: var(--brass); color: var(--on-brass); }

/* ---------- Footer (always dark) ---------- */
.site-foot { background: var(--night); color: #B9C6CB; padding-block: 80px 34px; }
.foot-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 40px 56px; }
.site-logo--large { width: 200px; max-height: none; filter: brightness(0) invert(.86) sepia(.6) saturate(1.4); }
.foot-library { flex: 1 1 360px; min-width: 0; }
.foot-library .script-kicker { color: #D9B26A; font-size: 32px; }
.foot-library p:not(.script-kicker) { margin: 6px 0 22px; font-size: 16.5px; max-width: 30em; }
.site-foot .btn-brass { --brass: #D9B26A; --on-brass: #1B1408; }
.foot-nav .menu { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, auto); gap: 0 40px; }
.foot-nav a { display: flex; align-items: center; min-height: 44px; color: #B9C6CB; text-decoration: none; }
.foot-nav a:hover { color: #F0D49A; }
.foot-base { margin-top: 56px; padding-top: 20px; border-top: 1px solid rgba(217, 178, 106, .2); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 13px; color: #8FA3AB; }
@media (max-width: 700px) {
	.site-foot { padding-block: 48px 28px; text-align: center; }
	.foot-grid { flex-direction: column; }
	.site-logo--large { width: 130px; }
	.foot-library .btn { width: 100%; }
	.foot-nav .menu { justify-items: center; }
	.foot-base { justify-content: center; }
}

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