/*
 * Desk Pages — «Лист на столе»
 * Общие стили для внутренних страниц сайта: разделы, произведения, архивы.
 * Подключается через desk-common.php.
 */

/* --- Стрелка «наверх» -------------------------------------------- */

.desk-to-top {
	position: fixed;
	right: 26px;
	bottom: 30px;
	z-index: 60;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--card, #fbf7ec);
	box-shadow: 3px 8px 16px rgba(58, 48, 34, 0.25), inset 0 0 0 1px rgba(58, 48, 34, 0.08);
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.desk-to-top.is-shown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.desk-to-top:hover,
.desk-to-top:focus-visible {
	transform: translateY(-3px);
	box-shadow: 4px 11px 20px rgba(58, 48, 34, 0.3), inset 0 0 0 1px rgba(58, 48, 34, 0.1);
}
.desk-to-top svg {
	width: 24px;
	height: 24px;
	display: block;
}
.desk-to-top path {
	fill: none;
	stroke: var(--ink, #2b2620);
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}
@media (max-width: 640px) {
	.desk-to-top { right: 14px; bottom: 16px; width: 46px; height: 46px; }
	.desk-to-top svg { width: 21px; height: 21px; }
}
@media (prefers-reduced-motion: reduce) {
	.desk-to-top { transition: none; }
}

/* --- Основные стили страниц -------------------------------------- */

.poet-desk-inner {
	--paper:     #f3edde;
	--card:      #fbf7ec;
	--ink:       #2b2620;
	--ink-soft:  #5f584c;
	--pencil:    #8a8172;
	--accent:    #9a3b1e;

	margin: 0;
	overflow-x: hidden;
	font-family: 'Neucha', Georgia, serif;
	color: var(--ink);

	background-color: var(--paper);
	background-image:
		radial-gradient(120% 90% at 50% 20%, rgba(0,0,0,0) 60%, rgba(96, 78, 52, 0.09) 100%),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240'%3E%3Cg fill='none' stroke='%234a4237' stroke-width='2' stroke-linecap='round' opacity='.08'%3E%3Cg transform='rotate(-8 60 70)'%3E%3Cellipse cx='54' cy='86' rx='7' ry='5' transform='rotate(-14 54 86)'/%3E%3Cpath d='M60.5 84 L60.5 46'/%3E%3Cpath d='M60.5 46 C69 49 73 57 70 65'/%3E%3C/g%3E%3Cg transform='rotate(6 170 150)'%3E%3Cpath d='M156 128 L156 160 M180 122 L180 154 M156 128 L180 122 L180 128 L156 134 Z'/%3E%3Cellipse cx='154' cy='162' rx='7' ry='5' transform='rotate(-14 154 162)'/%3E%3Cellipse cx='178' cy='156' rx='7' ry='5' transform='rotate(-14 178 156)'/%3E%3C/g%3E%3Cg transform='rotate(14 100 200)'%3E%3Cellipse cx='96' cy='206' rx='6.5' ry='4.6' transform='rotate(-14 96 206)'/%3E%3Cpath d='M102 204 L102 170'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
		repeating-linear-gradient(to bottom,
			transparent 0, transparent 9px,   rgba(63,56,45,0.085) 9px,   rgba(63,56,45,0.085) 10px,
			transparent 10px, transparent 19px, rgba(63,56,45,0.085) 19px, rgba(63,56,45,0.085) 20px,
			transparent 20px, transparent 29px, rgba(63,56,45,0.085) 29px, rgba(63,56,45,0.085) 30px,
			transparent 30px, transparent 39px, rgba(63,56,45,0.085) 39px, rgba(63,56,45,0.085) 40px,
			transparent 40px, transparent 49px, rgba(63,56,45,0.085) 49px, rgba(63,56,45,0.085) 50px,
			transparent 50px, transparent 104px),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.028'/%3E%3C/svg%3E");
	background-size: auto, 480px 480px, auto, 240px 240px;
	/* бумага неподвижна: лист прокручивается по нотному стану */
	background-attachment: fixed, fixed, fixed, fixed;
}

.poet-desk-inner .site-header,
.poet-desk-inner .site-footer {
	display: none;
}

.poet-desk-inner .desk-page,
.poet-desk-inner .desk-page *,
.poet-desk-inner .desk-page *::before,
.poet-desk-inner .desk-page *::after {
	box-sizing: border-box;
}

.desk-page {
	max-width: 880px;
	margin: 0 auto;
	padding: clamp(1.5rem, 4vh, 3rem) clamp(0.8rem, 3vw, 2rem) 3rem;
}

/* лист: чистая бумага поверх нотного стана */
.desk-sheet {
	background: var(--card);
	border-radius: 3px;
	padding: clamp(1.6rem, 4.5vw, 3.2rem);
	box-shadow:
		0 18px 44px rgba(58, 48, 34, 0.18),
		0 2px 8px rgba(58, 48, 34, 0.08),
		inset 0 0 0 1px rgba(58, 48, 34, 0.05);
	animation: sheet-in 0.6s ease both;
}

@keyframes sheet-in {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* --- навигация между разделами ------------------------------- */

.desk-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.4rem 1.3rem;
	margin-bottom: 2rem;
	font-size: 1.05rem;
}

.desk-nav a {
	color: var(--pencil);
	text-decoration: none;
	padding-bottom: 2px;
	background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
	transition: color 0.25s ease, background-size 0.3s ease;
}
.desk-nav a:hover { color: var(--ink); background-size: 100% 2px; }
.desk-nav .is-current {
	color: var(--ink);
	background-size: 100% 2px;
}
.desk-nav .desk-home { margin-right: 0.6rem; }

/* --- заголовок раздела ---------------------------------------- */

.desk-page-head { text-align: center; }

.desk-page-head h1 {
	margin: 0;
	font-family: 'Neucha', Georgia, serif;
	font-weight: 400;
	font-style: normal; /* перебиваем курсив из кита Elementor */
	letter-spacing: 0.03em;
	font-size: clamp(2.2rem, 5vw, 3.2rem);
	line-height: 1.15;
	color: var(--ink);
	opacity: 0;
	animation: desk-ink 0.7s ease 0.1s forwards;
}

.desk-page-head .flourish {
	display: block;
	width: min(280px, 64%);
	height: auto;
	margin: 0.4rem auto 0;
	overflow: visible;
}
.desk-page-head .flourish path {
	fill: none;
	stroke: var(--ink-soft);
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-dasharray: 300;
	stroke-dashoffset: 300;
	animation: desk-draw 0.9s ease 0.5s forwards;
}

.desk-subtitle {
	margin: 0.7rem 0 0;
	color: var(--pencil);
	font-size: 1.05rem;
	letter-spacing: 0.1em;
}

/* подразделы раздела («Детские» и т.п.) */
.desk-subsections {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem 1.2rem;
	margin-top: 1.2rem;
	font-size: 1.1rem;
}
.desk-subsections a {
	color: var(--accent);
	text-decoration: none;
	padding: 0.12rem 0.9rem;
	border: 1.5px solid rgba(154, 59, 30, 0.45);
	border-radius: 999px;
	transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.desk-subsections a:hover {
	background: var(--accent);
	border-color: var(--accent);
	color: #fdfaf2;
}

@keyframes desk-ink {
	from { opacity: 0; filter: blur(3px); }
	to   { opacity: 1; filter: blur(0); }
}
@keyframes desk-draw {
	to { stroke-dashoffset: 0; }
}

/* --- список произведений -------------------------------------- */

.desk-works { list-style: none; margin: 2.2rem 0 0; padding: 0; }

.desk-work {
	padding: 1.15rem 0;
	border-bottom: 1px dashed rgba(93, 83, 66, 0.3);
}
.desk-work:last-child { border-bottom: 0; }

.desk-work-title {
	font-family: 'Neucha', Georgia, serif;
	font-size: 1.45rem;
	color: var(--ink);
	text-decoration: none;
	padding-bottom: 2px;
	background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
	transition: background-size 0.3s ease;
}
.desk-work-title:hover { background-size: 100% 2px; }

.desk-work-excerpt {
	margin: 0.45rem 0 0;
	font-family: Georgia, serif;
	font-size: 0.98rem;
	line-height: 1.65;
	color: var(--ink-soft);
}

.desk-work-meta {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.95rem;
	color: var(--pencil);
}

/* --- музыка --------------------------------------------------- */

.desk-tracks { list-style: none; margin: 2.2rem 0 0; padding: 0; }

.desk-track {
	padding: 1.4rem 0;
	border-bottom: 1px dashed rgba(93, 83, 66, 0.3);
}
.desk-track:last-child { border-bottom: 0; }

.desk-track-title {
	margin: 0 0 0.5rem;
	font-family: 'Neucha', Georgia, serif;
	font-weight: 400;
	font-size: 1.4rem;
	color: var(--ink);
}

.desk-track-body { font-family: Georgia, serif; font-size: 1rem; color: var(--ink-soft); }
.desk-track-body .wp-audio-shortcode,
.desk-track-body audio { width: 100%; max-width: 480px; }
.desk-track-body p { margin: 0.4rem 0; }

.desk-btn {
	display: inline-block;
	margin-top: 0.5rem;
	padding: 0.32rem 1.05rem;
	border: 1.5px solid var(--accent);
	border-radius: 999px;
	color: var(--accent);
	text-decoration: none;
	font-family: 'Neucha', Georgia, serif;
	font-size: 1.02rem;
	transition: background 0.25s ease, color 0.25s ease;
}
.desk-btn:hover { background: var(--accent); color: #fdfaf2; }

/* --- книги ---------------------------------------------------- */

.desk-books {
	list-style: none;
	margin: 2.4rem 0 0;
	padding: 0;
	display: grid;
	/* auto-fit схлопывает пустые треки — редкие книги стоят по центру */
	grid-template-columns: repeat(auto-fit, minmax(230px, 400px));
	justify-content: center;
	gap: 2.2rem 2rem;
}

.desk-book-cover {
	display: block;
	position: relative;
	margin: 0;
	padding: 7px; /* фотоснимок с полем снизу, как на «столе» */
	background: var(--card);
	box-shadow: 4px 10px 18px rgba(58, 48, 34, 0.22), inset 0 0 0 1px rgba(58, 48, 34, 0.06);
	transform: rotate(-1.6deg);
	transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.3, 1.15), box-shadow 0.4s ease;
}
.desk-book-cover:hover {
	transform: rotate(0deg) translateY(-5px);
	box-shadow: 6px 14px 24px rgba(58, 48, 34, 0.3), inset 0 0 0 1px rgba(58, 48, 34, 0.06);
}
.desk-book-cover a { display: block; }
.desk-book-cover img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 0;
	box-shadow: none;
	transform: none;
	transition: none;
	filter: grayscale(0.55) sepia(0.22) contrast(1.03);
}
/* рамка «от руки» поверх обложки */
.desk-book-cover .desk-book-frame {
	position: absolute;
	top: 7px;
	left: 7px;
	width: calc(100% - 14px);
	height: calc(100% - 14px);
	pointer-events: none;
	overflow: visible;
}
.desk-book-cover .desk-book-frame .ink {
	fill: none;
	stroke: var(--ink);
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}
/* загибающийся уголок при наведении — как у фото на главной */
.desk-book-cover .fold {
	position: absolute;
	left: 7px;
	bottom: 7px;
	width: 30px;
	height: 30px;
	background: linear-gradient(225deg, #d8caa7 0%, #ece1c8 35%, #f4ecd9 100%);
	clip-path: polygon(0 100%, 100% 100%, 0 0);
	transform: scale(0);
	transform-origin: 0 100%;
	transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.3, 1.2);
	pointer-events: none;
}
.desk-book-cover:hover .fold { transform: scale(1); }

.desk-book-title {
	margin: 0.9rem 0 0.15rem;
	font-family: 'Neucha', Georgia, serif;
	font-weight: 400;
	font-size: 1.3rem;
	line-height: 1.25;
}
.desk-book-title a { color: var(--ink); text-decoration: none; }
.desk-book-title a:hover { color: var(--accent); }

.desk-book-meta { margin: 0; font-size: 0.95rem; color: var(--pencil); }

.desk-book-anno {
	margin: 0.5rem 0 0;
	font-family: Georgia, serif;
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--ink-soft);
}

/* --- страница произведения ------------------------------------ */

.desk-work-head { text-align: center; margin-bottom: 1.8rem; }

.desk-work-meta-line {
	margin: 0.9rem 0 0;
	font-size: 1rem;
	color: var(--pencil);
}
.desk-work-meta-line a { color: var(--accent); text-decoration: none; }
.desk-work-meta-line a:hover { text-decoration: underline; }

.desk-work-body {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 1.13rem;
	line-height: 1.85;
	color: var(--ink);
}
.desk-work-body p { margin: 0 0 1.05em; }
/* стихи: строфы — колонкой по центру листа; кап поднят с 17em (~34 знака)
   до 21em (~42 знака) — длинная строка стиха не переносится */
.poet-desk-poetry .desk-work-body > p {
	width: fit-content;
	max-width: 21em;
	margin-left: auto;
	margin-right: auto;
}
/* тот же кап — и для родного макета разворота (тема ставит 17em) */
.poet-desk-poetry .desk-work-body.desk-spread > p { max-width: 21em; }
/* стихи чуть крупнее прозы — строка физически длиннее, колонка визуально шире */
.poet-desk-poetry .desk-work-body { font-size: 1.22rem; }
.desk-work-body a { color: var(--accent); }
.desk-work-body audio,
.desk-work-body .wp-audio-shortcode { width: 100%; max-width: 480px; }
.desk-work-body img { max-width: 100%; height: auto; }

/* --- фото в обтекание (задаётся выравниванием в редакторе) ----
   «Слева» — снимок слева, текст обходит его справа;
   «Справа» — зеркально. Размер фото — ширина блока в редакторе. */
.desk-work-body figure.wp-block-image.alignleft {
	float: left;
	width: min(40%, 320px);
	margin: 0.35rem 1.6rem 0.8rem 0;
}
.desk-work-body figure.wp-block-image.alignright {
	float: right;
	width: min(40%, 320px);
	margin: 0.35rem 0 0.8rem 1.6rem;
}
/* фото без обтекания — по центру листа (узкий снимок не прижимается к левому краю);
   в макете desk-spread фото оформляется собственным правилом темы */
.desk-work-body:not(.desk-spread) figure.wp-block-image:not(.alignleft):not(.alignright) {
	width: fit-content;
	margin-left: auto;
	margin-right: auto;
}
/* на мобильном обтекание убираем: фото над текстом по центру */
@media (max-width: 640px) {
	.desk-work-body figure.wp-block-image.alignleft,
	.desk-work-body figure.wp-block-image.alignright {
		float: none;
		width: min(100%, 360px);
		margin: 0 auto 1rem;
	}
}
.desk-work-body blockquote {
	margin: 1.4em 0;
	padding-left: 1.2em;
	border-left: 2px solid rgba(154, 59, 30, 0.45);
	font-style: italic;
}

.desk-pager {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.6rem 1rem;
	margin-top: 2.4rem;
	padding-top: 1.4rem;
	border-top: 1px dashed rgba(93, 83, 66, 0.3);
	font-size: 1.02rem;
}
.desk-pager a, .desk-pager span {
	color: var(--pencil);
	text-decoration: none;
	max-width: 46%;
}
.desk-pager a:hover { color: var(--accent); }
.desk-pager .desk-back {
	flex: 0 0 100%;
	max-width: none;
	text-align: center;
	color: var(--accent);
}

/* --- пагинация списков ---------------------------------------- */

.desk-pager-list { margin-top: 2.2rem; text-align: center; }
.desk-pager-list ul { list-style: none; display: flex; justify-content: center; gap: 0.8rem; margin: 0; padding: 0; }
.desk-pager-list a, .desk-pager-list span {
	color: var(--pencil);
	text-decoration: none;
	font-size: 1.05rem;
	padding: 0.15rem 0.6rem;
	border-radius: 6px;
}
.desk-pager-list .current { color: var(--accent); border-bottom: 2px solid var(--accent); }
.desk-pager-list a:hover { color: var(--ink); }

/* --- пустой раздел -------------------------------------------- */

.desk-empty { text-align: center; padding: 2.5rem 0 1.5rem; }
.desk-empty svg {
	width: 110px;
	height: auto;
	opacity: 0.75;
}
.desk-empty svg path {
	fill: none;
	stroke: var(--ink-soft);
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.desk-empty p {
	margin: 1rem 0 0;
	font-size: 1.15rem;
	color: var(--pencil);
}

/* --- подпись и подсказки -------------------------------------- */

.desk-page-foot {
	margin-top: 2.6rem;
	padding-top: 1.4rem;
	border-top: 1px dashed rgba(93, 83, 66, 0.3);
	text-align: center;
	font-size: 1rem;
	color: var(--pencil);
}
.desk-page-foot .dot { color: var(--accent); }

.desk-hint {
	max-width: 880px;
	margin: 1rem auto;
	padding: 0.8rem 1.1rem;
	border: 1.5px dashed var(--accent);
	border-radius: 8px;
	background: rgba(255, 250, 240, 0.85);
	color: var(--ink-soft);
	font-size: 0.98rem;
}

/* --- книга, вставленная блоком HTML (Гдетство и др.) ------ */

.desk-work-body .gdetstvo-pub {
	margin: 0 0 1.6rem;
	text-align: center;
	color: var(--pencil);
	font-size: 0.98rem;
	font-family: 'Neucha', Georgia, serif;
	letter-spacing: 0.05em;
}

.desk-work-body h2 {
	margin: 2.6rem 0 1rem;
	font-family: 'Neucha', Georgia, serif;
	font-weight: 400;
	font-size: 1.6rem;
	line-height: 1.25;
	color: var(--ink);
	padding-bottom: 3px;
	background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
	transition: background-size 0.3s ease;
}
.desk-work-body h2:hover { background-size: 100% 2px; }

.desk-work-body .gdetstvo-review {
	font-style: italic;
	color: var(--ink-soft);
}

.desk-work-body .gdetstvo-toc {
	columns: 2 240px;
	column-gap: 2.5rem;
	padding-left: 1.2rem;
}
.desk-work-body .gdetstvo-toc li { margin: 0.25rem 0; }
.desk-work-body .gdetstvo-toc a { color: var(--ink-soft); text-decoration: none; }
.desk-work-body .gdetstvo-toc a:hover { color: var(--accent); }

.desk-work-body .gdetstvo-stanza {
	margin: 0 auto 1.15em;
	width: fit-content;
	max-width: 100%;
	line-height: 1.7;
}

/* «читать далее»: рецензии «О книге» сворачиваются до оглавления */
.desk-work-body details.desk-book-more {
	margin: 0.2rem 0 1.8rem;
}
.desk-work-body .desk-book-more-btn {
	display: inline-flex;
	align-items: baseline;
	gap: 0.4rem;
	cursor: pointer;
	padding: 0.32rem 1.05rem;
	border: 1.5px solid var(--accent);
	border-radius: 999px;
	color: var(--accent);
	background: transparent;
	font-family: 'Neucha', Georgia, serif;
	font-size: 1.02rem;
	line-height: 1.5;
	list-style: none; /* без штатного треугольника */
	user-select: none;
	transition: background 0.25s ease, color 0.25s ease;
}
.desk-work-body .desk-book-more-btn::-webkit-details-marker { display: none; }
.desk-work-body .desk-book-more-btn::after {
	content: '↓';
	font-size: 0.95em;
}
.desk-work-body details.desk-book-more[open] .desk-book-more-btn::after {
	content: '↑';
}
.desk-work-body .desk-book-more-btn:hover,
.desk-work-body .desk-book-more-btn:focus-visible,
.desk-work-body details.desk-book-more[open] .desk-book-more-btn {
	background: var(--accent);
	color: #fdfaf2;
	outline: none;
}
.desk-work-body .desk-book-more-closed { display: inline; }
.desk-work-body .desk-book-more-open   { display: none; }
.desk-work-body details.desk-book-more[open] .desk-book-more-closed { display: none; }
.desk-work-body details.desk-book-more[open] .desk-book-more-open   { display: inline; }

/* спрятанная часть «О книге» — та же типографика, что у видимой */
.desk-work-body .desk-book-more-inner {
	padding-top: 0.2rem;
}

/* заголовки стихов книги — по центру строф */
.desk-work-body h2[id^="poem-"] {
	text-align: center;
}

/* --- архивы (рубрики, метки, даты) --------------------------- */

.desk-archive-note {
	text-align: center;
	margin: 1.6rem 0 0;
}

nav.pagination,
nav.navigation.pagination {
	margin-top: 2.2rem;
}
nav.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.8rem;
}
nav.pagination .page-numbers {
	color: var(--pencil);
	text-decoration: none;
	font-size: 1.05rem;
	padding: 0.15rem 0.6rem;
}
nav.pagination .page-numbers.current {
	color: var(--accent);
	border-bottom: 2px solid var(--accent);
}
nav.pagination .page-numbers:hover { color: var(--ink); }
nav.pagination .screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

/* --- роман «Месторождения» ------------------------------------ */

.desk-work-body .mesto-dedication {
	text-align: center;
	font-style: italic;
	color: var(--ink-soft);
	margin-bottom: 1.8rem;
}

.desk-work-body .mesto-toc {
	columns: 2 240px;
	column-gap: 2.5rem;
	padding-left: 1.2rem;
}
.desk-work-body .mesto-toc li { margin: 0.25rem 0; }
.desk-work-body .mesto-toc a { color: var(--ink-soft); text-decoration: none; }
.desk-work-body .mesto-toc a:hover { color: var(--accent); }

/* панель-плейлист: лежит внизу экрана, как закладка на листе */
.desk-audio-bar {
	position: fixed;
	bottom: 0;
	width: min(680px, 100%);
	z-index: 60;
	/* центр видимой области (без скроллбара),
	   как лист .desk-page — 50% у fixed считает
	   от ширины без скроллбара */
	left: 50%;
	transform: translateX(-50%) translateY(110%);
	background: var(--card);
	border: 1px solid rgba(58, 48, 34, 0.18);
	border-bottom: none;
	border-radius: 10px 10px 0 0;
	box-shadow: 0 -6px 24px rgba(58, 48, 34, 0.18);
	padding: 0.55rem 0.9rem 0.65rem;
	font-family: 'Neucha', Georgia, serif;
	transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.3, 1.1);
}
.desk-audio-bar.is-shown { transform: translateX(-50%); }
.desk-audio-bar-row {
	display: flex;
	align-items: center;
	gap: 0.7rem;
}
/* кнопки плеера: овальная обводка «карандашом», без заливки */
.desk-audio-bar button {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	min-width: 40px;
	height: 32px;
	padding: 0 0.7rem;
	border-radius: 999px;
	border: 1.5px solid rgba(58, 48, 34, 0.45);
	background: none;
	color: var(--ink-soft);
	font-family: 'Neucha', Georgia, serif;
	font-size: 1rem;
	cursor: pointer;
	transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.desk-audio-bar button:hover {
	background: none;
	border-color: var(--accent);
	color: var(--accent);
	transform: translateY(-1px);
}
.desk-audio-bar button svg {
	width: 15px;
	height: 15px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.desk-audio-bar .pp { min-width: 32px; padding: 0; }
.desk-audio-bar .prev,
.desk-audio-bar .next { min-width: 32px; padding: 0; }
/* ±10 секунд: компактные капсулы с цифрой */
.desk-audio-bar .back10,
.desk-audio-bar .fwd10 {
	min-width: 40px;
	padding: 0;
	font-size: 0.95rem;
	letter-spacing: 0.02em;
}
.desk-audio-bar .close { min-width: 32px; padding: 0; }
/* неактивная кнопка (первая/последняя глава) */
.desk-audio-bar button:disabled {
	opacity: 0.35;
	cursor: default;
	transform: none;
}
.desk-audio-bar button:disabled:hover {
	border-color: rgba(58, 48, 34, 0.45);
	color: var(--ink-soft);
	transform: none;
}
/* на узком экране прячем переключение глав (оно есть в списке
   «главы»), оставляя ±10 секунд и управление */
@media (max-width: 480px) {
	.desk-audio-bar .prev,
	.desk-audio-bar .next { display: none; }
	.desk-audio-bar-row { gap: 0.4rem; }
	.desk-audio-bar button { min-width: 34px; height: 30px; }
	.desk-audio-bar .back10,
	.desk-audio-bar .fwd10 { min-width: 36px; }
}
.desk-audio-bar-title {
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 1.08rem;
	color: var(--ink);
}
.desk-audio-bar-time { flex: none; font-size: 0.92rem; color: var(--pencil); }
.desk-audio-bar-list-btn {
	flex: none;
	width: auto !important;
	padding: 0 0.8rem;
	font-family: inherit;
	font-size: 1rem;
}
/* выпадающий список глав (плейлист) */
.desk-audio-bar-list {
	display: none;
	margin: 0.6rem 0 0.2rem;
	max-height: 42vh;
	overflow-y: auto;
}
.desk-audio-bar.is-list-open .desk-audio-bar-list { display: block; }
.desk-audio-bar-list button {
	display: block;
	width: 100%;
	height: auto;
	border: none;
	border-radius: 6px;
	padding: 0.28rem 0.6rem;
	text-align: left;
	font-family: inherit;
	font-size: 1.02rem;
	color: var(--ink-soft);
}
.desk-audio-bar-list button:hover { background: rgba(154, 59, 30, 0.09); }
.desk-audio-bar-list button.is-active {
	color: var(--accent);
	background: rgba(154, 59, 30, 0.07);
}
.desk-audio-bar-list .num { color: var(--pencil); margin-right: 0.5rem; }
/* подсказка по главе: длительность из m3u + имя файла.
   Одна общая подсказка на панель (вне списка с overflow),
   чтобы не обрезалась и не создавала горизонтальный скролл */
.desk-audio-tip {
	position: fixed;
	z-index: 70;
	display: none;
	width: max-content;
	max-width: 300px;
	padding: 0.3rem 0.6rem;
	border: 1px solid rgba(58, 48, 34, 0.25);
	border-radius: 6px;
	background: var(--card);
	box-shadow: 2px 4px 12px rgba(58, 48, 34, 0.18);
	font-family: 'Neucha', Georgia, serif;
	font-size: 0.85rem;
	color: var(--pencil);
	text-align: left;
	white-space: normal;
	pointer-events: none;
}
.desk-audio-tip.is-on { display: block; }
/* на телефоне подсказка — во всю ширину над панелью */
.desk-audio-tip.is-wide {
	width: auto;
	max-width: none;
	text-align: center;
}
/* прогресс-полоска — тонкая линия «карандашом» */
.desk-audio-bar-track {
	position: relative;
	height: 3px;
	margin-top: 0.5rem;
	background: rgba(58, 48, 34, 0.14);
	border-radius: 2px;
	cursor: pointer;
}
.desk-audio-bar-track .fill {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0%;
	background: var(--accent);
	border-radius: 2px;
}

.desk-work-body .mesto-chapter p {
	margin: 0 0 1.05em;
	text-align: justify;
	hyphens: auto;
}

/* стихотворные вставки внутри романа */
.desk-work-body .mesto-verse {
	font-style: italic;
	color: var(--ink-soft);
	text-align: left;
	hyphens: none;
	margin: 1.3em 0 1.3em 2.2em;
	line-height: 1.55;
}

/* фотография автора на карточке романа — снимок на листе */
.desk-work-body .mesto-photo {
	width: 240px;
	max-width: 70%;
	margin: 0 auto 1.6rem;
	padding: 8px 8px 26px;
	background: #fffdf7;
	box-shadow: 3px 8px 18px rgba(58, 48, 34, 0.22);
	transform: rotate(-2deg);
	transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.3, 1.15), box-shadow 0.4s ease;
}
.desk-work-body .mesto-photo:hover {
	transform: rotate(0deg) translateY(-3px);
	box-shadow: 5px 12px 24px rgba(58, 48, 34, 0.28);
}
.desk-work-body .mesto-photo img {
	display: block;
	width: 100%;
	height: auto;
}
.desk-work-body .mesto-photo figcaption {
	font-family: 'Neucha', Georgia, serif;
	font-style: normal; /* reset.css темы курсивит figcaption */
	font-size: 0.95rem;
	color: var(--pencil);
	text-align: center;
	margin-top: 8px;
}

/* кнопка «аудиоверсия» под фотографией — строка «от руки»
   с наушниками, по центру; подчёркивание появляется при наведении,
   как у обычных ссылок сайта */
/* кнопка «Аудиоверсия» и подпись-ссылка — единый блок по центру
   под фотографией; ссылка вынесена из кнопки (в <button> ссылки
   запрещены) */
.desk-audio-open-wrap {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.55rem;
	width: max-content;
	max-width: 100%;
	margin: 0.4rem auto 1.8rem;
}
button.desk-audio-open {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.55rem;
	padding: 0.3rem 1rem 0.42rem;
	border: none;
	/* Elementor красит button:hover в розовый — сбрасываем */
	background: transparent !important;
	cursor: pointer;
	font-family: 'Neucha', Georgia, serif;
	font-size: 1.35rem;
	color: var(--ink);
	text-decoration: none;
	transition: color 0.25s ease;
}
/* подпись «— послушать роман · Читает...» может переноситься */
.desk-audio-open-cap { white-space: normal; }
button.desk-audio-open svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: var(--pencil);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: stroke 0.25s ease;
}
/* подпись с именем чтеца и ссылкой на его страницу */
.desk-audio-open-cap {
	font-style: normal;
	font-family: 'Neucha', Georgia, serif;
	font-size: 0.92rem;
	color: var(--pencil);
	text-align: center;
}
.desk-audio-open-cap a {
	color: var(--accent);
	font-family: 'Neucha', Georgia, serif;
}
/* на телефоне подпись под иконкой, по центру */
@media ( max-width: 600px ) {
	.desk-audio-open-wrap { flex-direction: column; gap: 0.2rem; }
	button.desk-audio-open {
		padding: 0.3rem 0.6rem 0.42rem;
		text-align: center;
	}
	.desk-audio-open-cap { max-width: 16rem; text-align: center; }
}
/* подчёркивание — только при наведении, как у ссылок */
button.desk-audio-open .lbl {
	text-decoration: underline;
	text-decoration-color: rgba(0, 0, 0, 0);
	text-decoration-thickness: 1.5px;
	text-underline-offset: 4px;
	transition: text-decoration-color 0.25s ease;
}
button.desk-audio-open:hover .lbl,
button.desk-audio-open:focus-visible .lbl {
	text-decoration-color: currentColor;
}
button.desk-audio-open:hover,
button.desk-audio-open:focus-visible { color: var(--accent); }
button.desk-audio-open:hover svg { stroke: var(--accent); }
/* плеер играет — кнопка подсвечена */
button.desk-audio-open.is-open { color: var(--accent); }
button.desk-audio-open.is-open svg { stroke: var(--accent); }

/* заметка о публикации и вводка журнала на карточке романа */
.desk-work-body .mesto-note {
	font-family: 'Neucha', Georgia, serif;
	color: var(--pencil);
	margin: 0 0 0.8rem;
}

.desk-work-body .mesto-intro {
	margin: 2.4rem 0 0;
	padding: 1.1rem 1.4rem;
	border-left: 3px solid rgba(154, 59, 30, 0.35);
	background: rgba(154, 59, 30, 0.05);
	font-style: italic;
	color: var(--ink-soft);
}
.desk-work-body .mesto-intro p { margin: 0 0 0.6em; }
.desk-work-body .mesto-intro-src {
	font-style: normal;
	font-family: 'Neucha', Georgia, serif;
	color: var(--pencil);
}

/* --- кнопка «аудиоверсия» --------------------------------------
   Рукописная строка-кнопка в стиле листа: наушники «от руки»,
   подчёркивание красным карандашом. По клику раскрывается плеер. */
.desk-audio { margin: 1.6rem 0 1.8rem; text-align: center; }
.desk-audio-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.3rem 0.9rem 0.36rem;
	border: none;
	background: none;
	cursor: pointer;
	font-family: 'Neucha', Georgia, serif;
	font-size: 1.18rem;
	letter-spacing: 0.04em;
	color: var(--ink);
	/* подчёркивание «карандашом», как у заголовков */
	background-image: linear-gradient(var(--accent), var(--accent));
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 100% 2px;
	transition: color 0.3s ease, background-color 0.3s ease;
}
.desk-audio-btn svg {
	width: 26px;
	height: 26px;
	fill: none;
	stroke: var(--accent);
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 0.3s ease;
}
.desk-audio-btn .desk-audio-hint {
	font-style: normal;
	font-size: 0.95rem;
	color: var(--pencil);
}
.desk-audio-btn:hover,
.desk-audio-btn:focus-visible {
	color: var(--accent);
}
.desk-audio-btn:hover svg { transform: translateY(-2px); }
.desk-audio.is-open .desk-audio-hint { display: none; }
.desk-audio .desk-audio-player { margin-top: 0.9rem; }
.desk-audio .desk-audio-player .wp-audio-shortcode,
.desk-audio .desk-audio-player audio { width: 100%; max-width: 480px; }

/* --- фотографии в тексте: «снимки на листе» --------------------
   Оформляем любые картинки в контенте (галерея, одиночные
   изображения) как приклеенные фотографии: белая рамка, тень,
   лёгкий поворот. Подписи — handwriting-шрифтом темы. */

.desk-work-body .wp-block-gallery {
	display: grid;
	/* три ряда фотографий на ширину листа */
	grid-template-columns: repeat(3, 1fr);
	gap: 1.8rem 1.4rem;
	margin: 2.2rem 0;
	align-items: start;
	justify-items: center;
}
/* галерея с нечётным числом фото: последний ряд не растягивается */
.desk-work-body .wp-block-gallery .wp-block-image {
	margin: 0;
	max-width: 100%;
}
.desk-work-body .wp-block-gallery figure.wp-block-image {
	margin: 0;
}

/* figure в галерее Gutenberg — flex-контейнер; штатные правила
   (width с ID-селектором :not(#individual-image) и is-cropped
   с flex:1/height:100%) схлопывают фото до миниатюры.
   Возвращаем обычную раскладку: figure на колонку сетки,
   картинка — резиновая, подпись — под фото, а не поверх. */
.desk-work-body .wp-block-gallery figure.wp-block-image {
	margin: 0;
	width: 100% !important; /* перебиваем calc(50% ...) c ID */
	height: auto;
	display: block;
}
.desk-work-body .wp-block-gallery figure.wp-block-image img {
	width: 100% !important;
	height: auto !important;
	flex: none;
	object-fit: unset;
}
.desk-work-body .wp-block-gallery figure.wp-block-image figcaption {
	position: static !important;
	background: none !important;
	color: var(--pencil) !important;
	text-shadow: none;
	backdrop-filter: none;
	padding: 0;
	max-height: none;
	overflow: visible;
}
.desk-work-body .wp-block-gallery figure.wp-block-image:has(figcaption)::before {
	display: none; /* тёмная маска Gutenberg поверх фото */
}

.desk-work-body .wp-block-gallery img,
.desk-work-body .wp-block-image:not(.mesto-photo) img {
	display: block;
	width: 100%;
	height: auto;
	background: #fffdf7;
	padding: 8px 8px 26px;
	box-shadow: 3px 8px 18px rgba(58, 48, 34, 0.22);
}
.desk-work-body .wp-block-gallery figure.wp-block-image,
.desk-work-body .wp-block-image:not(.mesto-photo) {
	transform: rotate(-1.8deg);
	transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.3, 1.15), box-shadow 0.4s ease;
}
/* снимки «наклеены» с чередующимся наклоном, как в альбоме */
.desk-work-body .wp-block-gallery figure.wp-block-image:nth-child(2n),
.desk-work-body .wp-block-image:nth-child(2n):not(.mesto-photo) {
	transform: rotate(1.6deg);
}
.desk-work-body .wp-block-gallery figure.wp-block-image:hover,
.desk-work-body .wp-block-image:not(.mesto-photo):hover {
	transform: rotate(0deg) translateY(-3px) scale(1.02);
	z-index: 2;
}
.desk-work-body .wp-block-gallery figure.wp-block-image:hover img,
.desk-work-body .wp-block-image:not(.mesto-photo):hover img {
	box-shadow: 5px 12px 24px rgba(58, 48, 34, 0.28);
}
.desk-work-body .wp-block-gallery figcaption,
.desk-work-body .wp-block-image figcaption {
	font-family: 'Neucha', Georgia, serif;
	font-style: normal; /* reset.css темы курсивит figcaption */
	font-size: 0.95rem;
	color: var(--pencil);
	text-align: center;
	margin-top: 6px;
}

/* одиночное фото — крупное, почти на всю ширину листа */
.desk-work-body .wp-block-image {
	text-align: center;
}
.desk-work-body .wp-block-image:not(.mesto-photo) > img {
	width: min(100%, 480px);
	margin: 0 auto;
}

/* узкий экран: фото в один столбец, крупнее */
@media (max-width: 560px) {
	.desk-work-body .wp-block-gallery {
		grid-template-columns: 1fr;
	}
	.desk-work-body .wp-block-image:not(.mesto-photo) > img {
		width: 100%;
	}
}

/* клик по фото — курсор лупы */
.desk-work-body .wp-block-gallery figure.wp-block-image img,
.desk-work-body .wp-block-image:not(.mesto-photo) img {
	cursor: zoom-in;
}

/* --- лайтбокс в стиле сайта: снимок крупно на тёмном фоне --- */
.desk-lightbox {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: 2.5rem 1.5rem 1.8rem;
	background: rgba(30, 26, 20, 0.88);
	opacity: 0;
	transition: opacity 0.25s ease;
}
.desk-lightbox.is-open { opacity: 1; }
.desk-lightbox img {
	display: block;
	max-width: min(1100px, 94vw);
	max-height: 82vh;
	width: auto;
	height: auto;
	object-fit: contain;
	background: #fffdf7;
	padding: 10px 10px 30px;
	box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
	transform: rotate(-0.6deg);
}
.desk-lightbox figcaption {
	font-family: 'Neucha', Georgia, serif;
	font-size: 1.05rem;
	color: #d8cfc0;
	text-align: center;
	margin-top: 4px;
}
button.desk-lightbox-close {
	position: absolute;
	top: 14px;
	right: 18px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(251, 247, 236, 0.12);
	color: #f1e9da;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}
button.desk-lightbox-close:hover { background: rgba(251, 247, 236, 0.25); }

/* стрелки перелистывания: тонкое «перо» в стиле росчерка темы */
button.desk-lightbox-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 54px;
	height: 54px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.25s ease, opacity 0.25s ease;
}
.desk-lightbox-arrow svg {
	width: 34px;
	height: 22px;
	display: block;
	overflow: visible;
}
.desk-lightbox-arrow path {
	fill: none;
	stroke: #d8cfc0;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: stroke 0.25s ease, transform 0.25s ease;
}
.desk-lightbox-arrow-prev { left: clamp(6px, 3vw, 40px); }
.desk-lightbox-arrow-next { right: clamp(6px, 3vw, 40px); }
.desk-lightbox-arrow:hover { background: rgba(251, 247, 236, 0.08); }
.desk-lightbox-arrow-prev:hover path { stroke: #fdfaf2; transform: translateX(-3px); }
.desk-lightbox-arrow-next:hover path { stroke: #fdfaf2; transform: translateX(3px); }

/* счётчик «2 / 6» под снимком */
.desk-lightbox-counter {
	font-family: 'Neucha', Georgia, serif;
	font-size: 0.95rem;
	letter-spacing: 0.12em;
	color: #8a8172;
}

/* --- стихотворение с одной иллюстрацией ------------------------
   Текст — узкой колонкой по центру листа, снимок — под ним,
   тоже по центру, в фирменной рамке. На мобильном всё как было. */
.desk-work-body.desk-spread > p {
	/* строфа центрируется по своей длиннейшей строке,
	   но не шире ~34 символов (в Neucha символ ~0.5em) */
	width: fit-content;
	max-width: 17em;
	margin-left: auto;
	margin-right: auto;
}
.desk-work-body.desk-spread > figure.wp-block-image,
.desk-work-body.desk-spread > .wp-block-group:has(> .wp-block-gallery) {
	float: none;
	width: min(100%, 360px);
	margin: 2.2rem auto 0.6rem;
}
/* одиночное фото в «галерее из одного снимка» — одна колонка */
.desk-work-body.desk-spread .wp-block-gallery {
	grid-template-columns: 1fr !important;
	gap: 0;
	margin: 0;
}
@media (max-width: 860px) {
	.desk-work-body.desk-spread > figure.wp-block-image {
		float: none;
		width: min(100%, 380px);
		margin: 1.6rem auto 0.4rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.desk-lightbox { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
	.poet-desk-inner *, .poet-desk-inner *::before, .poet-desk-inner *::after {
		animation: none !important;
		transition: none !important;
	}
	.desk-page-head h1 { opacity: 1; }
	.desk-page-head .flourish path { stroke-dashoffset: 0; }
}