/*! Phisherman's Book — theme | (c) SBA https://sba.nl | Proprietary */

/* Measured on the old Themler site (October 2026), then modernised:
titles Almendra (the post title was Almendra Display: too thin, and
unreliable with font-display: optional) #269ccb → #1a8ab8 for 3:1 on paper, links #066b94 for 4.5:1,
body Arial 14px #555 → 17px #4a4a4a, brand Alex Brush #0777a3. */
:root {
	--pb-blue: #1a8ab8;
	--pb-blue-ink: #066b94;
	--pb-blue-deep: #0777a3;
	--pb-ink: #4a4a4a;
	--pb-ink-soft: #5e5e5e;
	--pb-paper: #f7f7f5;
	--pb-paper-mid: #efefec;
	--pb-paper-edge: #dcdcd7;
	--pb-cover: #2b2b2b;
	--pb-cover-light: #3d3d3d;
	--pb-font-body: "Helvetica Neue", Arial, "Liberation Sans", sans-serif;
	--pb-font-title: "Almendra", Georgia, "Times New Roman", serif;
	--pb-font-brand: "Alex Brush", "Brush Script MT", cursive;
	--pb-page-pad: clamp(1.5rem, 4.2vw, 3.75rem);
	--bs-body-font-family: var(--pb-font-body);
	--bs-body-color: var(--pb-ink);
	--bs-link-color: var(--pb-blue-ink);
	--bs-link-color-rgb: 6, 107, 148;
	--bs-link-hover-color: var(--pb-blue-deep);
	--bs-link-hover-color-rgb: 7, 119, 163;
}

html {
	scroll-behavior: smooth;
}

body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	font-family: var(--pb-font-body);
	font-size: 1.0625rem;
	line-height: 1.65;
	color: var(--pb-ink);
	background-color: #9fb7c4;
}

/* The photo sits on a fixed layer of its own: background-attachment: fixed is
ignored or janky on iOS, a fixed pseudo-element is not. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background-color: #9fb7c4;
	background-image: var(--pb-backdrop-small);
	background-size: cover;
	background-position: 22% 30%;
}

@media (min-width: 801px) {
	body::before {
		background-image: var(--pb-backdrop);
	}
}

a {
	color: var(--pb-blue-ink);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover,
a:focus {
	color: var(--pb-blue-deep);
}

:focus-visible {
	outline: 3px solid #f2a33a;
	outline-offset: 2px;
	border-radius: 2px;
}

.pb-skip {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 10;
	padding: 0.5rem 0.9rem;
	background: #fff;
	color: var(--pb-blue-ink);
}

/* Masthead: the shark above the book, the brand in script. */
.pb-masthead {
	padding: clamp(1.25rem, 3vw, 2rem) 16px clamp(0.75rem, 2vw, 1.25rem);
	text-align: center;
}

.pb-brand {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	text-decoration: none;
	color: var(--pb-blue-deep);
}

.pb-brand:hover,
.pb-brand:focus {
	color: var(--pb-blue-deep);
}

.pb-brand__logo {
	width: clamp(72px, 9vw, 104px);
	height: auto;
	filter: drop-shadow(0 6px 10px rgba(6, 40, 60, 0.28));
	transition: transform 0.4s ease;
}

.pb-brand:hover .pb-brand__logo {
	transform: rotate(-6deg) translateY(-2px);
}

.pb-brand__title {
	margin: 0.15rem 0 0;
	font-family: var(--pb-font-brand);
	font-size: clamp(2.6rem, 6vw, 3.75rem);
	font-weight: 400;
	line-height: 1.1;
	color: var(--pb-blue-deep);
	text-shadow: 0 0 2px #fff, 0 0 14px rgba(255, 255, 255, 0.9), 0 0 28px rgba(255, 255, 255, 0.6);
}

.pb-brand__tagline {
	margin: 0.2rem 0 0;
	font-family: var(--pb-font-title);
	font-size: 1rem;
	letter-spacing: 0.06em;
	color: #0b3f57;
	text-shadow: 0 0 8px rgba(255, 255, 255, 0.95), 0 0 2px #fff;
}

/* The book: a dark cover, a spread of two pages, page edges on both sides. */
.pb-book {
	flex: 1 0 auto;
	width: 100%;
	max-width: 1240px;
	margin: 0 auto clamp(2rem, 5vw, 3.5rem);
	padding: 0 16px;
}

.pb-book__cover {
	position: relative;
	padding: 9px 9px 12px;
	border-radius: 12px;
	background: linear-gradient(180deg, var(--pb-cover-light), var(--pb-cover) 40%, #1f1f1f);
	box-shadow: 0 2px 0 rgba(255, 255, 255, 0.08) inset, 0 28px 60px rgba(8, 28, 40, 0.45), 0 6px 16px rgba(8, 28, 40, 0.3);
	/* The book is its own layer in a page transition: it turns, the rest fades. */
	view-transition-name: pb-book;
}

.pb-book__spread {
	position: relative;
	min-height: 60vh;
	border-radius: 4px;
	/* stacked page edges */
	box-shadow:
		2px 1px 0 #e9e9e5, 4px 2px 0 #c8c8c3, 6px 3px 0 #e9e9e5, 8px 4px 0 #bdbdb8,
		-2px 1px 0 #e9e9e5, -4px 2px 0 #c8c8c3, -6px 3px 0 #e9e9e5, -8px 4px 0 #bdbdb8;
}

.pb-page {
	position: relative;
	min-width: 0;
	padding: var(--pb-page-pad);
	background: linear-gradient(90deg, var(--pb-paper-mid) 0%, var(--pb-paper) 10%, var(--pb-paper) 100%);
}

@media (min-width: 992px) {
	.pb-page--left {
		border-radius: 4px 0 0 4px;
		padding-right: calc(var(--pb-page-pad) + 1rem);
		background: linear-gradient(90deg, #e8e8e4 0%, var(--pb-paper) 7%, var(--pb-paper) 84%, var(--pb-paper-mid) 93%, var(--pb-paper-edge) 98.5%, #c9c9c3 100%);
	}

	.pb-page--right {
		border-radius: 0 4px 4px 0;
		padding-left: calc(var(--pb-page-pad) + 1rem);
		background: linear-gradient(270deg, #e8e8e4 0%, var(--pb-paper) 7%, var(--pb-paper) 84%, var(--pb-paper-mid) 93%, var(--pb-paper-edge) 98.5%, #c9c9c3 100%);
	}
}

@media (max-width: 991.98px) {
	.pb-book__cover {
		padding: 6px 6px 9px;
		border-radius: 10px;
	}

	.pb-book__spread {
		box-shadow: 2px 1px 0 #e9e9e5, 4px 2px 0 #c8c8c3, 6px 3px 0 #bdbdb8;
	}

	.pb-page {
		border-radius: 0;
	}

	.pb-page:first-child {
		border-radius: 4px 4px 0 0;
	}

	.pb-page:last-child {
		border-radius: 0 0 4px 4px;
	}

	/* One page on a phone: the second "page" simply continues. */
	.pb-page + .pb-page {
		padding-top: 0;
	}
}

@media (max-width: 575.98px) {
	.pb-book {
		padding-left: 10px;
		padding-right: 10px;
	}

	:root {
		--pb-page-pad: 1.5rem;
	}
}

/* A post on a page */
.pb-card {
	position: relative;
	isolation: isolate;
	margin-bottom: clamp(2rem, 4vw, 2.75rem);
}

.pb-card:last-of-type {
	margin-bottom: 0;
}


.pb-card__title {
	margin: 0 0 0.2rem;
	font-family: var(--pb-font-title);
	font-size: 1.5rem;
	font-weight: 400;
	line-height: 1.3;
	text-align: center;
	text-wrap: balance;
}

.pb-card__title a {
	color: var(--pb-blue);
	text-decoration: none;
}

.pb-card__title a:hover,
.pb-card__title a:focus {
	color: var(--pb-blue-deep);
	text-decoration: underline;
}

.pb-card__meta {
	margin: 0 0 0.75rem;
	font-size: 0.8125rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-align: center;
	color: var(--pb-ink-soft);
}

.pb-card__teaser {
	margin: 0 0 0.5rem;
}

.pb-card__more {
	font-weight: 600;
	text-decoration: none;
}

.pb-card__more:hover,
.pb-card__more:focus {
	text-decoration: underline;
}

.pb-page__heading {
	margin: 0 0 1.75rem;
	font-family: var(--pb-font-title);
	font-size: clamp(1.9rem, 3.4vw, 2.5rem);
	font-weight: 400;
	line-height: 1.2;
	color: var(--pb-blue);
}

.pb-intro {
	margin-bottom: 2rem;
	font-style: italic;
}

.pb-empty {
	margin-bottom: 1.5rem;
}

/* A story on the right page */
.pb-story__title {
	margin: 0 0 0.4rem;
	font-family: var(--pb-font-title);
	font-size: clamp(2rem, 4vw, 2.75rem);
	font-weight: 400;
	line-height: 1.15;
	color: var(--pb-blue);
	text-wrap: balance;
}

.pb-story__meta {
	margin: 0 0 1.75rem;
	font-size: 0.875rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--pb-ink-soft);
}

.pb-story__content > * {
	margin-top: 0;
	margin-bottom: 1.1rem;
}

.pb-story__content blockquote,
.pb-story__content .wp-block-quote {
	margin: 1.75rem 0;
	padding: 0.25rem 0 0.25rem 1.25rem;
	border-left: 3px solid var(--pb-blue);
	font-family: var(--pb-font-title);
	font-size: 1.25rem;
	line-height: 1.45;
	color: #2f5f74;
}

.pb-story__content blockquote p {
	margin: 0;
}

.pb-story__content ul,
.pb-story__content ol {
	padding-left: 1.25rem;
}

.pb-story__content li + li {
	margin-top: 0.35rem;
}

.pb-story__content figure {
	margin: 1.5rem 0;
}

.pb-story__content img {
	max-width: 100%;
	height: auto;
	border-radius: 3px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.pb-story__nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	margin-top: 2.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid #d6d6d0;
	font-size: 0.9375rem;
}

.pb-story__nav a {
	text-decoration: none;
	min-width: 0;
}

.pb-story__nav a:hover,
.pb-story__nav a:focus {
	text-decoration: underline;
}

.pb-story__next {
	margin-left: auto;
	text-align: right;
}

/* The side page */
.pb-aside__back {
	margin: 0 0 1.5rem;
	font-weight: 600;
}

.pb-aside__back a {
	text-decoration: none;
}

.pb-aside__title {
	margin: 2rem 0 0.6rem;
	font-family: var(--pb-font-title);
	font-size: 1.3rem;
	font-weight: 400;
	color: var(--pb-ink);
}

.pb-aside__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pb-aside__list li {
	padding: 0.3rem 0;
	border-bottom: 1px dotted #cfcfc9;
}

.pb-aside__list a {
	text-decoration: none;
}

.pb-aside__list a:hover,
.pb-aside__list a:focus,
.pb-aside__list a[aria-current] {
	text-decoration: underline;
}

.pb-aside__list a[aria-current] {
	color: var(--pb-ink);
}

@media (min-width: 576px) {
	.pb-aside__list--columns {
		columns: 2;
		column-gap: 2rem;
	}

	.pb-aside__list--columns li {
		break-inside: avoid;
	}
}

.pb-search__label {
	display: block;
	margin-bottom: 0.35rem;
	font-family: var(--pb-font-title);
	font-size: 1.3rem;
}

.pb-search__row {
	display: flex;
	min-width: 0;
}

.pb-search__input {
	min-width: 0;
	border: 1px solid #c4c4be;
	border-right: 0;
	border-radius: 4px 0 0 4px;
	background: #fff;
}

.pb-search__input:focus {
	border-color: var(--pb-blue);
	box-shadow: none;
}

.pb-search__button {
	flex: 0 0 auto;
	border-radius: 0 4px 4px 0;
	background: var(--pb-blue-ink);
	color: #fff;
}

.pb-search__button:hover,
.pb-search__button:focus {
	background: var(--pb-blue-deep);
	color: #fff;
}

.pb-pager {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 2.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid #d6d6d0;
	font-weight: 600;
}

.pb-pager a {
	text-decoration: none;
}

.pb-pager__older {
	margin-left: auto;
}

/* Footer: a quiet band below the book */
.pb-footer {
	padding: 1.1rem 16px;
	background: rgba(8, 30, 44, 0.78);
	text-align: center;
}

.pb-footer__text {
	margin: 0;
	font-size: 0.875rem;
	color: #f1f5f7;
}

@keyframes pbOpen {
	from {
		opacity: 0;
		transform: translateY(18px) scale(0.985);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes pbRise {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* ==== Motion (v1.0.2) =====================================================
Everything below only moves transform and opacity, so nothing reflows and the
layout-shift budget stays at zero. All of it stops for prefers-reduced-motion. */

/* First visit of a session (html.pb-arrive, set inline in the head): the book
opens, the stories rise, the shark swims in. Later pages turn instead. */
.pb-arrive .pb-book__cover {
	animation: pbOpen 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.pb-arrive .pb-card {
	animation: pbRise 0.6s 0.35s ease both;
}

.pb-arrive .pb-page--right .pb-card {
	animation-delay: 0.5s;
}

.pb-arrive .pb-brand__logo {
	animation: pbSwimIn 1.4s cubic-bezier(0.25, 0.8, 0.3, 1) both, pbBite 0.45s 1.45s ease-in-out both;
}

@keyframes pbSwimIn {
	0% {
		opacity: 0;
		transform: translate(-90px, 18px) rotate(-14deg) scale(0.85);
	}
	60% {
		opacity: 1;
		transform: translate(8px, -4px) rotate(6deg) scale(1.02);
	}
	100% {
		opacity: 1;
		transform: none;
	}
}

/* The bite: a squash towards the reader and a snap back. */
@keyframes pbBite {
	0%, 100% {
		transform: none;
	}
	35% {
		transform: rotate(-9deg) scale(1.14, 0.9);
	}
	55% {
		transform: rotate(4deg) scale(0.96, 1.06);
	}
}

/* The shark bites whenever a "Continue reading" link is under the pointer or
the keyboard: the hook is about to be taken. */
body:has(.pb-card__more:hover, .pb-card__more:focus-visible) .pb-brand__logo {
	animation: pbBite 0.45s ease-in-out;
}

/* Fishing line and bobber, hanging from the rod over the edge of the book. */
.pb-masthead {
	position: relative;
}

.pb-line {
	position: absolute;
	top: 0;
	bottom: -10px;
	left: max(34px, calc(50% - min(500px, 41vw)));
	width: 34px;
	margin-left: -17px;
	pointer-events: none;
	transform-origin: 50% 0;
	animation: pbSway 7s ease-in-out infinite alternate;
	z-index: 1;
}

.pb-line::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 40px;
	left: 50%;
	width: 1.5px;
	margin-left: -0.75px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95) 25%, rgba(40, 40, 40, 0.7));
}

.pb-line__bobber {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 34px;
	height: 44px;
	animation: pbBob 3.2s ease-in-out infinite;
	filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
}

@keyframes pbSway {
	from {
		transform: rotate(-2.2deg);
	}
	to {
		transform: rotate(1.6deg);
	}
}

@keyframes pbBob {
	0%, 100% {
		transform: translateY(0) rotate(0deg);
	}
	30% {
		transform: translateY(3px) rotate(-4deg);
	}
	60% {
		transform: translateY(-2px) rotate(3deg);
	}
}

@media (max-width: 575.98px) {
	.pb-line {
		left: 22px;
		transform: scale(0.8);
	}
}

/* Depth: the lake moves slower than the page, and light drifts over the water.
Scroll-driven where the browser supports it; a still photo elsewhere. */
body::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: radial-gradient(38% 22% at 62% 58%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 70%),
		radial-gradient(25% 14% at 30% 66%, rgba(255, 250, 220, 0.35), rgba(255, 255, 255, 0) 70%);
	mix-blend-mode: soft-light;
	animation: pbShimmer 11s ease-in-out infinite alternate;
}

@keyframes pbShimmer {
	from {
		opacity: 0.55;
		transform: translate3d(-3%, 0, 0);
	}
	to {
		opacity: 1;
		transform: translate3d(3%, -1%, 0);
	}
}

@supports (animation-timeline: scroll()) {
	body::before {
		inset: -6vh 0;
		animation: pbDrift linear both;
		animation-timeline: scroll(root);
	}

	@keyframes pbDrift {
		from {
			transform: translate3d(0, 0, 0) scale(1.04);
		}
		to {
			transform: translate3d(0, -6vh, 0) scale(1.04);
		}
	}
}

/* Paper that answers: a soft light rises under the story you point at. */
.pb-card::before {
	content: "";
	position: absolute;
	inset: -14px -18px;
	z-index: -1;
	border-radius: 8px;
	background: radial-gradient(120% 90% at 30% 0%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 72%);
	box-shadow: 0 12px 26px -16px rgba(30, 60, 80, 0.45);
	opacity: 0;
	transform: translateY(5px);
	transition: opacity 0.35s ease, transform 0.35s ease;
	pointer-events: none;
}

.pb-card:hover::before,
.pb-card:focus-within::before {
	opacity: 1;
	transform: none;
}

/* Turning the page between two pages of the site (cross-document view
transitions). Browsers without them simply show the next page. */
@view-transition {
	navigation: auto;
}

::view-transition-group(pb-book) {
	animation-duration: 0.55s;
}

::view-transition-old(pb-book) {
	transform-origin: 0 50%;
	animation: pbTurnOut 0.45s cubic-bezier(0.4, 0, 0.7, 0.4) both;
}

::view-transition-new(pb-book) {
	transform-origin: 100% 50%;
	animation: pbTurnIn 0.5s 0.12s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@keyframes pbTurnOut {
	to {
		opacity: 0;
		transform: perspective(1800px) rotateY(-70deg);
	}
}

@keyframes pbTurnIn {
	from {
		opacity: 0;
		transform: perspective(1800px) rotateY(18deg) translateX(24px);
	}
}

/* Whoever asked for less motion gets none of it. */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}

	@view-transition {
		navigation: none;
	}
}

@media print {
	body::before,
	body::after,
	.pb-line,
	.pb-masthead .pb-brand__logo,
	.pb-aside,
	.pb-footer {
		display: none;
	}

	.pb-book__cover {
		background: none;
		box-shadow: none;
		padding: 0;
	}

	.pb-page {
		background: none;
	}
}
