/*
Theme Name: SoyLyuPo
Theme URI: https://soylyupo.site
Author: LyuPo
Author URI: https://soylyupo.site
Description: Personal travel / sport / people blog. Green, black and grey palette with light and dark themes.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: soylyupo
Tags: blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, dark-mode
*/

/* ----------------------------------------------------------------
   Design tokens
----------------------------------------------------------------- */
:root {
	--c-bg: #f4f5f3;
	--c-bg-alt: #eaede9;
	--c-surface: #ffffff;
	--c-text: #151815;
	--c-text-muted: #5c635c;
	--c-brand: #2e7d32;
	--c-brand-strong: #1b5e20;
	--c-brand-soft: #e6f2e7;
	--c-black: #101210;
	--c-border: #dfe3dd;
	--c-shadow: rgba(16, 18, 16, 0.08);

	--radius: 14px;
	--radius-sm: 8px;
	--maxw: 1120px;
	--header-h: 68px;

	--font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
	--c-bg: #0e110e;
	--c-bg-alt: #161a16;
	--c-surface: #1b201b;
	--c-text: #e7ebe6;
	--c-text-muted: #9aa49a;
	--c-brand: #4caf50;
	--c-brand-strong: #81c784;
	--c-brand-soft: #1d2b1d;
	--c-black: #e7ebe6;
	--c-border: #2a312a;
	--c-shadow: rgba(0, 0, 0, 0.5);
}

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

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

body {
	margin: 0;
	background: var(--c-bg);
	color: var(--c-text);
	font-family: var(--font-sans);
	font-size: 17px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	transition: background 0.25s ease, color 0.25s ease;
}

body.admin-bar {
	--header-offset: 32px;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--c-brand-strong);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

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

h1, h2, h3, h4 {
	line-height: 1.25;
	margin: 0 0 0.5em;
	letter-spacing: -0.01em;
}

p {
	margin: 0 0 1.1em;
}

.container {
	width: 100%;
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 0 20px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
}

/* ----------------------------------------------------------------
   Header
----------------------------------------------------------------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--c-bg) 88%, transparent);
	backdrop-filter: saturate(1.2) blur(10px);
	border-bottom: 1px solid var(--c-border);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: var(--header-h);
}

.site-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: var(--c-text);
	font-weight: 800;
	font-size: 1.25rem;
	letter-spacing: -0.02em;
	flex-shrink: 0;
}

.site-logo {
	width: 44px;
	height: 44px;
	object-fit: contain;
	border-radius: 8px;
	background: #fff;
}

[data-theme="dark"] .site-logo {
	background: #eef1ee;
	border-radius: 8px;
}

.site-nav {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 4px;
}

.site-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 4px;
}

.site-nav a {
	display: inline-block;
	padding: 8px 14px;
	border-radius: var(--radius-sm);
	color: var(--c-text);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.98rem;
}

.site-nav a:hover {
	background: var(--c-bg-alt);
}

.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
	color: var(--c-brand-strong);
	background: var(--c-brand-soft);
}

/* Language switcher */
.language-switcher {
	display: flex;
	gap: 2px;
	align-items: center;
}

.language-switcher ul {
	display: flex;
	gap: 2px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.language-switcher li {
	list-style: none;
}

.language-switcher a,
.language-switcher .current-lang {
	padding: 6px 10px;
	border-radius: var(--radius-sm);
	font-weight: 700;
	text-transform: uppercase;
	font-size: 0.78rem;
	letter-spacing: 0.03em;
	color: var(--c-text-muted);
	text-decoration: none;
}

.language-switcher .current-lang {
	color: var(--c-brand-strong);
	background: var(--c-brand-soft);
}

/* Theme toggle */
.theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid var(--c-border);
	background: var(--c-surface);
	color: var(--c-text);
	cursor: pointer;
	font-size: 1.05rem;
	transition: transform 0.15s ease;
}

.theme-toggle:hover {
	transform: rotate(18deg);
}

/* ----------------------------------------------------------------
   Hero (front page)
----------------------------------------------------------------- */
.hero {
	padding: 72px 0 48px;
	text-align: center;
}

.hero h1 {
	font-size: clamp(2.1rem, 5vw, 3.4rem);
	margin-bottom: 0.25em;
	font-weight: 800;
}

.hero .hero-tagline {
	font-size: 1.25rem;
	color: var(--c-text-muted);
	max-width: 620px;
	margin: 0 auto 28px;
}

.hero-cta {
	display: inline-flex;
	gap: 12px;
	flex-wrap: wrap;
	justify-content: center;
}

.btn {
	display: inline-block;
	padding: 11px 22px;
	border-radius: 999px;
	font-weight: 700;
	text-decoration: none;
	border: 1px solid transparent;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
	background: var(--c-brand-strong);
	color: #fff;
}

.btn-primary:hover {
	background: var(--c-brand);
	color: #fff;
}

.btn-ghost {
	border-color: var(--c-border);
	color: var(--c-text);
	background: var(--c-surface);
}

.btn-ghost:hover {
	border-color: var(--c-brand);
	color: var(--c-brand-strong);
}

/* ----------------------------------------------------------------
   Sections & cards
----------------------------------------------------------------- */
.section {
	padding: 56px 0;
}

.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}

.section-head h2 {
	font-size: 1.7rem;
	margin: 0;
}

.section-head .more {
	font-weight: 700;
	text-decoration: none;
	color: var(--c-brand-strong);
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 22px;
}

.card {
	background: var(--c-surface);
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	overflow: hidden;
	text-decoration: none;
	color: var(--c-text);
	display: flex;
	flex-direction: column;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 30px var(--c-shadow);
	color: var(--c-text);
}

.card-thumb {
	aspect-ratio: 16 / 10;
	background: var(--c-bg-alt);
}

.card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.card-body {
	padding: 18px 20px 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.card-body h3 {
	margin: 0;
	font-size: 1.15rem;
}

.card-meta {
	font-size: 0.85rem;
	color: var(--c-text-muted);
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.chip {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--c-brand-soft);
	color: var(--c-brand-strong);
	font-size: 0.78rem;
	font-weight: 700;
}

.card-excerpt {
	color: var(--c-text-muted);
	font-size: 0.94rem;
	margin: 0;
}

/* Photo grid (home) */
.photo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 10px;
}

.photo-grid figure {
	margin: 0;
	border-radius: var(--radius-sm);
	overflow: hidden;
}

.photo-grid img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.photo-grid a:hover img {
	transform: scale(1.05);
}

/* ----------------------------------------------------------------
   Filters (trip archive)
----------------------------------------------------------------- */
.filters {
	background: var(--c-surface);
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	padding: 18px 20px;
	margin-bottom: 28px;
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: center;
}

.filters label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.92rem;
	color: var(--c-text-muted);
}

.filters select {
	font: inherit;
	font-size: 0.92rem;
	padding: 8px 12px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--c-border);
	background: var(--c-bg);
	color: var(--c-text);
}

.filters button {
	margin-left: auto;
}

/* ----------------------------------------------------------------
   Single posts
----------------------------------------------------------------- */
.article {
	max-width: 760px;
	margin: 0 auto;
	padding: 40px 0 64px;
}

.article-header {
	margin-bottom: 28px;
}

.article-header h1 {
	font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.article-meta {
	color: var(--c-text-muted);
	font-size: 0.92rem;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}

.article-featured {
	border-radius: var(--radius);
	overflow: hidden;
	margin-bottom: 28px;
}

.entry-content {
	font-size: 1.06rem;
}

.entry-content img {
	border-radius: var(--radius-sm);
	margin: 1.4em auto;
}

.entry-content blockquote {
	margin: 1.4em 0;
	padding: 2px 0 2px 20px;
	border-left: 3px solid var(--c-brand);
	color: var(--c-text-muted);
}

.entry-content iframe {
	max-width: 100%;
	border-radius: var(--radius-sm);
	margin: 1.4em 0;
}

.wp-block-embed {
	margin: 1.6em 0;
}

.wp-block-embed__wrapper {
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
	border-radius: var(--radius-sm);
}

.wp-block-embed__wrapper iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
}

/* ----------------------------------------------------------------
   Chapters list / navigation
----------------------------------------------------------------- */
.chapters {
	margin: 40px 0;
}

.chapters ol {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 12px;
}

.chapters li {
	background: var(--c-surface);
	border: 1px solid var(--c-border);
	border-radius: var(--radius-sm);
}

.chapters a {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	text-decoration: none;
	color: var(--c-text);
	font-weight: 600;
}

.chapters .num {
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--c-brand-soft);
	color: var(--c-brand-strong);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 0.9rem;
}

.chapter-nav {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 40px;
}

.chapter-nav a {
	text-decoration: none;
	font-weight: 700;
	color: var(--c-brand-strong);
}

/* ----------------------------------------------------------------
   Pagination
----------------------------------------------------------------- */
.pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 40px 0;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border-radius: var(--radius-sm);
	background: var(--c-surface);
	border: 1px solid var(--c-border);
	color: var(--c-text);
	text-decoration: none;
	font-weight: 600;
}

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

/* ----------------------------------------------------------------
   Contact form
----------------------------------------------------------------- */
.contact-form {
	max-width: 560px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--c-border);
	border-radius: var(--radius-sm);
	background: var(--c-surface);
	color: var(--c-text);
	font: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
	outline: 2px solid var(--c-brand);
	outline-offset: 1px;
}

.contact-form label {
	font-weight: 600;
	font-size: 0.95rem;
}

.hp-field {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.form-success {
	background: var(--c-brand-soft);
	color: var(--c-brand-strong);
	border: 1px solid var(--c-brand);
	border-radius: var(--radius-sm);
	padding: 12px 16px;
	font-weight: 600;
}

.form-error {
	background: #fdecea;
	color: #b3261e;
	border: 1px solid #e0b4b1;
	border-radius: var(--radius-sm);
	padding: 10px 14px;
}

/* ----------------------------------------------------------------
   Footer
----------------------------------------------------------------- */
.site-footer {
	border-top: 1px solid var(--c-border);
	background: var(--c-bg-alt);
	padding: 40px 0;
	margin-top: 48px;
}

.footer-inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 16px;
	align-items: center;
	color: var(--c-text-muted);
	font-size: 0.92rem;
}

.footer-inner .social a {
	color: var(--c-text-muted);
	text-decoration: none;
	font-weight: 600;
	margin-right: 16px;
}

.footer-inner .social a:hover {
	color: var(--c-brand-strong);
}

/* ----------------------------------------------------------------
   Responsive
----------------------------------------------------------------- */
.nav-toggle {
	display: none;
	margin-left: auto;
	width: 40px;
	height: 40px;
	border: 1px solid var(--c-border);
	border-radius: var(--radius-sm);
	background: var(--c-surface);
	color: var(--c-text);
	cursor: pointer;
	font-size: 1.1rem;
}

@media (max-width: 860px) {
	.nav-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.site-nav {
		position: absolute;
		top: var(--header-h);
		left: 0;
		right: 0;
		flex-direction: column;
		align-items: stretch;
		background: var(--c-surface);
		border-bottom: 1px solid var(--c-border);
		padding: 12px 20px 20px;
		display: none;
	}

	.site-nav.open {
		display: flex;
	}

	.site-nav ul {
		flex-direction: column;
		gap: 2px;
	}

	.site-nav a {
		display: block;
	}

	.hero {
		padding: 48px 0 32px;
	}
}
