/*
Theme Name: Personal Minimal
Theme URI: https://ducthuy.info/
Author: Đức Thủy
Author URI: https://ducthuy.info/
Description: Lightweight personal WordPress theme with a profile sidebar, editorial post grid, narrow reading layout, and native comments.
Version: 1.4.0
Requires at least: 5.5
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: personal-minimal
Domain Path: /languages
Tags: blog, one-column, two-columns, featured-images, threaded-comments, translation-ready
*/

/* Global design tokens. */
:root {
	--pm-orange: #FF6600;
	--pm-purple: #703FFF;
	--pm-purple-deep: #7029CB;
	--pm-black: #0a0a0a;
	--pm-text: #171717;
	--pm-muted: #707070;
	--pm-border: #e7e7e7;
	--pm-surface: #f7f7f7;
	--pm-white: #ffffff;
	--pm-container: 1170px;
	--pm-reading: 700px;
	--pm-radius: 14px;
}

/* Global reset / base. */
* { box-sizing: border-box; }

html {
	scroll-behavior: smooth;
	scrollbar-gutter: stable;
	scroll-padding-top: 72px;
}

body {
	margin: 0;
	background: var(--pm-white);
	color: var(--pm-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.7;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--pm-purple-deep); text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
a:hover { color: var(--pm-purple); }
button, input, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--pm-purple); outline-offset: 3px; }

.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;
}

/* Keyboard skip links: visible only when focused. */
.skip-links {
	position: fixed;
	z-index: 100000;
	top: 8px;
	left: 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	pointer-events: none;
}

.skip-link {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 8px 12px;
	border: 2px solid var(--pm-orange);
	border-radius: 8px;
	background: var(--pm-black);
	color: var(--pm-white);
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transform: translateY(calc(-100% - 24px));
	transition: transform .15s ease;
	pointer-events: auto;
}

.skip-link:hover,
.skip-link:focus,
.skip-link:focus-visible {
	color: var(--pm-white);
	transform: translateY(0);
}

@media (min-width: 783px) {
	.admin-bar .skip-links { top: 40px; }
}

@media (min-width: 601px) and (max-width: 782px) {
	.admin-bar .skip-links { top: 54px; }
}


/* Global back-to-top control reuses the scroll-progress listener. */
.back-to-top {
	position: fixed;
	z-index: 9980;
	right: max(18px, calc((100vw - var(--pm-container)) / 2));
	bottom: 22px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid #2a2a2a;
	border-radius: 999px;
	background: var(--pm-black);
	color: var(--pm-white);
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 8px 22px rgba(0, 0, 0, .16);
}

.back-to-top:hover { border-color: var(--pm-orange); }
.back-to-top[hidden] { display: none; }

/* Global layout utilities. */
.pm-container {
	width: min(calc(100% - 40px), var(--pm-container));
	margin-inline: auto;
}

.site-main { padding: 56px 0 80px; }

/* Shared pagination. */
.pagination,
.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 42px;
}

.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 6px 11px;
	border: 1px solid var(--pm-border);
	border-radius: 999px;
	color: var(--pm-text);
	text-decoration: none;
}

.page-numbers.current,
.page-numbers:hover {
	border-color: var(--pm-purple);
	color: var(--pm-purple-deep);
}


.pagination .nav-links { width: 100%; }
.page-numbers.dots { border-color: transparent; }

@media (max-width: 620px) {
	.pagination .nav-links { justify-content: space-between; }
	.pagination .page-numbers:not(.prev):not(.next) { display: none; }
}

/* Site-wide footer. */
.site-footer { border-top: 1px solid var(--pm-border); }
.site-footer__inner {
	min-height: 88px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	font-size: .84rem;
	color: var(--pm-muted);
}
.site-footer p { margin: 0; }

@media (max-width: 620px) {
	.pm-container { width: min(calc(100% - 28px), var(--pm-container)); }
	.site-main { padding-top: 38px; }
	.site-footer__inner {
		min-height: 76px;
		align-items: flex-start;
		flex-direction: column;
		justify-content: center;
		gap: 2px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

/* WordPress Core generated alignment/caption classes. */
.alignleft {
	float: left;
	margin: .25em 1.5em 1em 0;
}

.alignright {
	float: right;
	margin: .25em 0 1em 1.5em;
}

.aligncenter {
	display: block;
	margin-right: auto;
	margin-left: auto;
}

.wp-caption { max-width: 100%; }
.wp-caption-text,
.gallery-caption {
	margin-top: .55em;
	color: var(--pm-muted);
	font-size: .875rem;
	line-height: 1.5;
}

@media (max-width: 620px) {
	.alignleft,
	.alignright {
		float: none;
		display: block;
		margin-right: auto;
		margin-left: auto;
	}
}
