/*
Theme Name: DuckTalesTheme
Theme URI: https://github.com/S0ftware-Developer
Author: Orlov Andrei
Author URI: https://orlovandrei.space
Description: Кастомная тема в духе приключенческих мультсериалов 80–90-х про богатого путешественника-селезня: игровой блог, детский сайт и портфолио. Жёлто-синяя палитра, монеты и сокровища, карта странствий, пиксельные шрифты. Меню выполнено в виде карты сокровищ, а посты оформлены как карточки-«экспедиции».
Version: 1.0.0
Requires at least: 5.3
Tested up to: 6.6
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ducktales-theme
Tags: blog, portfolio, kids, entertainment, custom-menu, featured-images, translation-ready, threaded-comments
*/

/* ==========================================================================
   1. ПЕРЕМЕННЫЕ: палитра, шрифты, тени
   ========================================================================== */
:root {
	/* Золото — монеты и акценты */
	--gold: #FFD23F;
	--gold-light: #FFE788;
	--gold-dark: #D9A61C;

	/* Синий — сюртук и небо Даксбурга */
	--blue: #1E3FA0;
	--blue-light: #4568C4;
	--blue-deep: #0E1F5C;
	--sky: #4A7BD9;
	--sky-light: #A9C8F2;

	/* Пергамент — карта и карточки-экспедиции */
	--parchment: #F3E2B0;
	--parchment-dark: #DEC583;
	--parchment-ink: #4A3312;

	/* Красный — крестик на карте и печати */
	--red: #D93A2B;
	--red-ink: #B52A1D;

	/* Изумруд — купюры и главная кнопка */
	--green: #2FA35B;
	--green-dark: #1E7A41;

	--text-light: #FDF6E3;
	--ink-soft: #6B5A3A;
	--link: #0E1F5C;

	/* Шрифты: пиксельный — заголовки, «бухгалтерская книга» — основной текст */
	--font-pixel: 'Press Start 2P', 'Courier New', monospace;
	--font-text: 'PT Serif', Georgia, 'Times New Roman', serif;

	/* Жёсткая тень, как в 8-битных играх */
	--shadow: 8px 8px 0 0 rgba(14, 31, 92, 0.35);

	--container: 1100px;
}

/* ==========================================================================
   2. БАЗА
   ========================================================================== */
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	background: var(--sky-light);
	color: var(--parchment-ink);
	font-family: var(--font-text);
	font-size: 1.15rem;
	line-height: 1.65;
}

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

.pixel-img {
	image-rendering: pixelated;
	image-rendering: crisp-edges;
}

a {
	color: var(--link);
	text-underline-offset: 0.2em;
}

a:hover {
	text-decoration-thickness: 3px;
}

:focus-visible {
	outline: 4px solid var(--red);
	outline-offset: 3px;
}

:where(.site-header, .site-footer) :focus-visible {
	outline-color: var(--gold-light);
}

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

.skip-link:focus {
	position: fixed !important;
	top: 8px;
	left: 8px;
	z-index: 1000;
	width: auto;
	height: auto;
	margin: 0;
	padding: 1rem 1.25rem;
	clip: auto;
	background: var(--gold);
	color: var(--blue-deep);
	font-family: var(--font-pixel);
	font-size: 0.7rem;
	text-decoration: none;
}

.container {
	width: min(var(--container), 100% - 2.5rem);
	margin-inline: auto;
}

.site-main {
	padding-block: 1.5rem 4rem;
}

/* ==========================================================================
   3. НЕБО ДАКСБУРГА: силуэт города и гидроплан
   ========================================================================== */
.sky {
	position: fixed;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
	background: linear-gradient(#4A7BD9 0%, #7EA6E8 55%, #C9DEF5 100%);
}

.sky__skyline {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	min-width: 900px;
	height: auto;
	opacity: 0.85;
}

.sky__plane {
	position: absolute;
	top: 14vh;
	left: 0;
	width: 130px;
}

.sky__plane img {
	display: block;
	width: 100%;
	height: auto;
}

/* Белый пунктирный след за гидропланом */
.sky__plane::before {
	content: '';
	position: absolute;
	right: 100%;
	top: 40%;
	width: 220px;
	height: 6px;
	background: repeating-linear-gradient(90deg, #fff 0 10px, transparent 10px 22px);
	-webkit-mask-image: linear-gradient(90deg, transparent, #000);
	mask-image: linear-gradient(90deg, transparent, #000);
}

/* ==========================================================================
   4. ШАПКА: синий сюртук с золотой пуговицей-швом и логотипом
   ========================================================================== */
.site-header {
	position: relative;
	background: var(--blue);
	border-bottom: 4px solid var(--blue-deep);
}

.site-header::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 8px;
	border-top: 4px dashed var(--gold);
}

.site-header__inner {
	width: min(var(--container), 100% - 2.5rem);
	margin-inline: auto;
	padding-block: 1.25rem 1.9rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.brand {
	display: flex;
	align-items: center;
	gap: 1.1rem;
	color: inherit;
	text-decoration: none;
}

.brand__logo {
	display: block;
	width: 76px;
	height: auto;
	flex: none;
}

.brand__logo.custom-logo {
	width: auto;
	max-height: 64px;
}

.brand__title {
	margin: 0;
	font-family: var(--font-pixel);
	font-size: clamp(1rem, 3vw, 1.5rem);
	line-height: 1.4;
	color: var(--gold);
	text-shadow: 3px 3px 0 var(--blue-deep);
}

.brand__tagline {
	margin: 0.4rem 0 0;
	font-size: 1rem;
	color: var(--text-light);
}

.nav-toggle {
	display: none;
	padding: 0.85rem 1rem;
	border: 0;
	background: var(--gold);
	color: var(--blue-deep);
	font-family: var(--font-pixel);
	font-size: 0.7rem;
	cursor: pointer;
	box-shadow: 0 4px 0 0 var(--gold-dark);
}

/* ==========================================================================
   5. МЕНЮ-КАРТА СОКРОВИЩ
   Кусок пергамента с рваным краем, компасом в углу и пунктирной тропой,
   соединяющей пункты-маркеры. На текущей странице маркер — красный крестик.
   ========================================================================== */
.map-nav {
	padding: 2.5rem 0;
	background: var(--blue-deep);
}

.map {
	position: relative;
	max-width: 900px;
	margin-inline: auto;
	padding: 2.25rem clamp(1.25rem, 4vw, 3rem) 2rem;
	background: var(--parchment);
	border: 4px solid var(--parchment-ink);
	box-shadow: var(--shadow);
	/* Неровный, «рваный» край пергамента */
	clip-path: polygon(
		0% 2%, 3% 0%, 8% 1.5%, 15% 0%, 24% 1.2%, 33% 0%, 45% 1.5%, 58% 0%, 70% 1%, 82% 0%, 92% 1.3%, 100% 0%,
		99% 12%, 100% 25%, 98.5% 40%, 100% 55%, 99% 70%, 100% 85%, 98% 100%,
		88% 99%, 76% 100%, 64% 98.7%, 52% 100%, 40% 98.5%, 28% 100%, 16% 99%, 6% 100%, 0% 98.5%,
		1% 85%, 0% 70%, 1.5% 55%, 0% 40%, 1% 25%, 0% 12%
	);
}

.map__compass {
	position: absolute;
	top: 0.75rem;
	right: 1.5rem;
	width: 52px;
	height: auto;
}

.map__title {
	margin: 0 0 1.5rem;
	font-family: var(--font-pixel);
	font-size: 0.75rem;
	line-height: 1.7;
	color: var(--parchment-ink);
	text-align: center;
}

.map ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0;
}

/* Пунктирная тропа между маркерами (не рисуется перед первым пунктом) */
.map li {
	position: relative;
	display: flex;
	align-items: center;
}

.map li + li::before {
	content: '';
	width: clamp(1.25rem, 3vw, 2.5rem);
	height: 4px;
	margin-inline: 0.4rem;
	background: repeating-linear-gradient(90deg, var(--parchment-ink) 0 6px, transparent 6px 12px);
	flex: none;
}

/* Пункт-маркер: бирка с зубчиками сверху и снизу, «приколотая» к карте */
.map a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.85rem 1rem 0.7rem;
	background: var(--gold);
	color: var(--blue-deep);
	font-family: var(--font-pixel);
	font-size: 0.65rem;
	line-height: 1.4;
	text-decoration: none;
	box-shadow: inset 0 0 0 4px var(--parchment-ink);
	clip-path: polygon(
		0 6px, 6px 6px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 6px, 100% 6px,
		100% calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 6px), 0 calc(100% - 6px)
	);
}

.map a::before {
	content: '';
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--blue-deep);
}

.map a:hover,
.map .current-menu-item > a,
.map .current_page_item > a,
.map .current-menu-ancestor > a {
	background: var(--red);
	color: var(--text-light);
}

/* На текущей странице — крестик вместо точки: «X marks the spot» */
.map .current-menu-item > a::before,
.map .current_page_item > a::before {
	width: 12px;
	height: 12px;
	border-radius: 0;
	background: transparent;
	background-image:
		linear-gradient(45deg, transparent 45%, var(--text-light) 45%, var(--text-light) 55%, transparent 55%),
		linear-gradient(-45deg, transparent 45%, var(--text-light) 45%, var(--text-light) 55%, transparent 55%);
}

.map a:focus-visible {
	outline: 4px solid var(--blue-deep);
	outline-offset: -10px;
}

/* Лента с силуэтом города под меню */
.skyline-band {
	height: 44px;
	overflow: hidden;
	background: var(--blue-deep);
	border-bottom: 4px solid var(--gold);
}

.skyline-band img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: bottom;
}

.skyline-band--footer {
	border-top: 4px solid var(--gold);
	border-bottom: 0;
}

/* ==========================================================================
   6. ГЛАВНАЯ: приветствие у Хранилища и карточки-экспедиции
   ========================================================================== */
.hero {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 2rem;
	align-items: center;
	margin-bottom: 3.75rem;
}

.hero__vault {
	display: block;
	width: 140px;
	height: auto;
}

.ledger {
	position: relative;
	padding: 1.5rem 1.75rem 1.75rem;
	background: var(--parchment);
	color: var(--parchment-ink);
	border: 4px solid var(--parchment-ink);
	box-shadow: var(--shadow);
}

.ledger__title {
	margin: 0 0 0.9rem;
	font-family: var(--font-pixel);
	font-size: clamp(0.85rem, 2.3vw, 1.1rem);
	line-height: 1.7;
	color: var(--blue);
}

.ledger__text {
	margin: 0;
	max-width: 60ch;
}

.page-header {
	display: inline-block;
	max-width: 100%;
	margin-bottom: 3rem;
	padding: 1.1rem 1.5rem;
	background: var(--blue);
	border: 4px solid var(--blue-deep);
	box-shadow: var(--shadow);
}

.page-header__title {
	margin: 0;
	font-family: var(--font-pixel);
	font-size: clamp(0.9rem, 2.6vw, 1.2rem);
	line-height: 1.7;
	color: var(--gold);
	overflow-wrap: anywhere;
}

.page-header__text {
	margin: 0.6rem 0 0;
	color: var(--text-light);
}

/* Сетка карточек */
.expeditions {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: 3.5rem 2.5rem;
}

/* Карточка-экспедиция: страница из журнала путешествий */
.expedition {
	position: relative;
	display: flex;
	flex-direction: column;
	margin-top: 2rem;
	background: var(--parchment);
	color: var(--parchment-ink);
	border: 4px solid var(--blue-deep);
	box-shadow: var(--shadow);
}

.expedition__tab {
	position: absolute;
	top: -2.2rem;
	left: 1.25rem;
	margin: 0;
	padding: 0.55rem 0.9rem 0.45rem;
	background: var(--blue);
	color: var(--gold);
	border: 4px solid var(--blue-deep);
	border-bottom: 0;
	font-family: var(--font-pixel);
	font-size: 0.6rem;
	line-height: 1.5;
}

.expedition__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 76px;
	padding: 0.7rem 1.1rem 0.7rem 1.25rem;
	background: var(--parchment-dark);
	border-bottom: 4px dashed var(--blue);
}

.expedition__place {
	margin: 0;
	font-family: var(--font-pixel);
	font-size: 0.6rem;
	line-height: 1.7;
	color: var(--ink-soft);
}

.expedition__icon {
	display: block;
	width: auto;
	height: auto;
	max-width: 56px;
	max-height: 48px;
	flex: none;
}

.expedition__thumb {
	display: block;
	border-bottom: 4px solid var(--blue-deep);
}

.expedition__thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.expedition__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 0.9rem;
	padding: 1.25rem 1.25rem 1.5rem;
}

.expedition__title {
	margin: 0;
	font-family: var(--font-pixel);
	font-size: 0.8rem;
	line-height: 1.9;
}

.expedition__title a {
	color: var(--blue-deep);
	text-decoration: none;
}

.expedition__title a:hover,
.expedition__title a:focus-visible {
	color: var(--red-ink);
	text-decoration: underline;
	text-decoration-thickness: 3px;
}

.expedition__excerpt {
	flex: 1;
}

.expedition__excerpt p {
	margin: 0;
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.15rem 1.25rem;
	margin: 0;
	font-size: 0.95rem;
	color: var(--ink-soft);
}

/* Пиксельная кнопка с монеткой, выскакивающей при наведении */
.button,
.search-submit,
.page-numbers {
	position: relative;
	display: inline-block;
	align-self: flex-start;
	padding: 0.95rem 1.4rem 0.95rem 1.2rem;
	border: 4px solid var(--blue-deep);
	background: var(--green);
	color: var(--text-light);
	font-family: var(--font-pixel);
	font-size: 0.7rem;
	line-height: 1.4;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 6px 0 0 var(--blue-deep);
	overflow: visible;
}

.button:hover,
.search-submit:hover,
a.page-numbers:hover {
	background: var(--green-dark);
	transform: translateY(2px);
	box-shadow: 0 4px 0 0 var(--blue-deep);
}

/* Монетка выскакивает из правого верхнего угла кнопки при наведении/фокусе (см. animations.css) */
.button::after {
	content: '';
	position: absolute;
	top: -4px;
	right: 6px;
	width: 14px;
	height: 14px;
	background: var(--gold);
	border: 2px solid var(--blue-deep);
	border-radius: 50%;
	opacity: 0;
}

.button:hover::after,
.button:focus-visible::after {
	animation: coin-pop 0.6s steps(6, end);
}

.page-numbers.current {
	background: var(--blue);
	color: var(--gold);
}

.pagination {
	margin-top: 3.5rem;
}

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

/* ==========================================================================
   7. ОДИНОЧНЫЙ ПОСТ, СТРАНИЦЫ, 404
   ========================================================================== */
.entry {
	position: relative;
	margin-top: 2.2rem;
	padding: clamp(1.5rem, 4vw, 3rem);
	background: var(--parchment);
	color: var(--parchment-ink);
	border: 4px solid var(--blue-deep);
	box-shadow: var(--shadow);
}

.entry__title {
	margin: 0 0 1rem;
	font-family: var(--font-pixel);
	font-size: clamp(1rem, 3.4vw, 1.5rem);
	line-height: 1.7;
	color: var(--blue);
}

.entry__thumb {
	margin: 1.5rem 0;
	border: 4px solid var(--blue-deep);
}

.entry__thumb img {
	display: block;
	width: 100%;
}

.entry__content {
	max-width: 68ch;
	margin-top: 1.75rem;
}

.entry__content > :first-child {
	margin-top: 0;
}

.entry__content h2,
.entry__content h3,
.entry__content h4 {
	margin: 2.25rem 0 1rem;
	font-family: var(--font-pixel);
	line-height: 1.7;
	color: var(--blue);
}

.entry__content h2 { font-size: 1.05rem; }
.entry__content h3 { font-size: 0.9rem; }
.entry__content h4 { font-size: 0.8rem; }

.entry__content blockquote {
	margin: 1.75rem 0;
	padding: 0.75rem 1.25rem;
	background: rgba(255, 210, 63, 0.3);
	border-left: 8px solid var(--gold-dark);
}

.entry__content pre,
.entry__content code {
	background: var(--blue-deep);
	color: var(--gold-light);
}

.entry__content code { padding: 0.1em 0.35em; }

.entry__content pre {
	padding: 1rem;
	overflow-x: auto;
}

.entry__content pre code { padding: 0; }

.entry__content table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
}

.entry__content th,
.entry__content td {
	padding: 0.5rem 0.9rem;
	border: 2px solid var(--blue-light);
}

.entry__footer {
	margin-top: 2.5rem;
	padding-top: 1.25rem;
	border-top: 4px dashed var(--gold-dark);
}

.entry__tags {
	margin: 0 0 0.4rem;
	color: var(--ink-soft);
}

.post-navigation {
	margin-top: 3rem;
}

.post-navigation .nav-links {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
	gap: 1.5rem;
}

.post-navigation a {
	display: block;
	padding: 1rem 1.25rem;
	background: var(--blue);
	color: var(--text-light);
	text-decoration: none;
	border: 4px solid var(--blue-deep);
	box-shadow: 0 6px 0 0 var(--blue-deep);
}

.post-navigation a:hover {
	background: var(--blue-light);
}

.post-navigation .nav-next { text-align: right; }

/* Записка от дворецкого / домработницы: страница 404 и «ничего не найдено» */
.note {
	display: grid;
	justify-items: center;
	gap: 1.75rem;
	text-align: center;
}

.note__icon {
	width: 96px;
	height: auto;
}

/* Форма поиска */
.search-form {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: center;
}

.search-field {
	width: min(100%, 320px);
	padding: 0.8rem 1rem;
	border: 4px solid var(--blue-deep);
	background: var(--text-light);
	color: var(--parchment-ink);
	font: inherit;
}

/* ==========================================================================
   8. ФУТЕР: паттерн из монет и бандиты, которые их похищают
   ========================================================================== */
.site-footer {
	position: relative;
	background: var(--blue-deep) url('assets/images/pattern-coins.svg') repeat center top / 96px 96px;
	image-rendering: pixelated;
}

.site-footer__panel {
	position: relative;
	width: min(760px, 100% - 2.5rem);
	margin-inline: auto;
	padding: 2.5rem 1.5rem 2rem;
	display: grid;
	justify-items: center;
	gap: 1.25rem;
	text-align: center;
	background: var(--blue);
	color: var(--text-light);
	border: 4px solid var(--gold);
	box-shadow: var(--shadow);
}

/* Стопка монет и крадущиеся бандиты по краям панели */
.site-footer__heist {
	position: absolute;
	top: -30px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: flex-end;
	gap: 6px;
}

.site-footer__coin {
	width: 26px;
	height: auto;
}

.site-footer__bandit {
	position: absolute;
	bottom: -6px;
	width: 40px;
	height: auto;
}

.site-footer__bandit--left { left: -34px; }
.site-footer__bandit--right { right: -34px; transform: scaleX(-1); }

.site-footer__logo {
	width: 64px;
	height: auto;
}

.footer-nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem 1.75rem;
}

.footer-nav a {
	font-family: var(--font-pixel);
	font-size: 0.65rem;
	line-height: 1.6;
	color: var(--gold);
}

.site-footer__copy {
	margin: 0;
	font-size: 1rem;
}

.site-footer__credit a {
	color: var(--gold-light);
}

/* ==========================================================================
   9. ВЫРАВНИВАНИЕ И ПОДПИСИ (требования WordPress к темам)
   ========================================================================== */
.alignleft   { float: left;  margin: 0.4rem 1.5rem 1rem 0; }
.alignright  { float: right; margin: 0.4rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin-inline: auto; }

.wp-caption,
.wp-block-image figcaption,
.gallery-caption {
	font-size: 0.9rem;
	color: var(--ink-soft);
}

.sticky { position: relative; }

.bypostauthor { display: block; }

/* ==========================================================================
   10. АДАПТИВНОСТЬ
   ========================================================================== */
@media (max-width: 760px) {
	.hero {
		grid-template-columns: 1fr;
		justify-items: start;
		gap: 1.5rem;
	}

	.hero__vault { width: 100px; }

	.js .nav-toggle { display: inline-block; }
	.js .map-nav { display: none; }
	.js .map-nav.is-open { display: block; }

	.map ul {
		flex-direction: column;
		align-items: stretch;
	}

	.map li + li::before {
		width: 4px;
		height: clamp(1rem, 4vw, 1.5rem);
		margin: 0.2rem auto;
		background: repeating-linear-gradient(180deg, var(--parchment-ink) 0 6px, transparent 6px 12px);
	}

	.map a { width: 100%; }

	.site-footer__bandit--left { left: -8px; }
	.site-footer__bandit--right { right: -8px; }

	.post-navigation .nav-next { text-align: left; }
}
