/*
Theme Name: Udibay Minimal
Theme URI: https://udibay.za.com
Description: Giao diện tối giản một cột — tối ưu tốc độ và AMP paired.
Author: Udibay
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: udibay-minimal
License: GNU General Public License v2 or later
*/

:root {
	--bg: #121212;
	--bg-elevated: #1a1a1a;
	--text: #f5f5f5;
	--text-muted: #9ca3af;
	--accent: #22c55e;
	--accent-hover: #16a34a;
	--warn: #fbbf24;
	--warn-border: #eab308;
	--alert-text: #f97316;
	--content-width: 720px;
	--font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.7;
}

a {
	color: var(--accent);
	text-decoration: none;
}

a:hover {
	color: var(--accent-hover);
	text-decoration: underline;
}

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

/* Header + menu */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--bg);
	border-bottom: 1px solid #2a2a2a;
}

.site-header__inner {
	max-width: var(--content-width);
	margin: 0 auto;
	padding: 0.85rem 1.25rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.site-header__brand {
	color: var(--text);
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.3;
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.site-header__brand:hover {
	color: var(--accent);
	text-decoration: none;
}

.site-nav {
	position: relative;
}

/* Desktop non-AMP: menu ngang */
.site-nav--desktop {
	display: none;
}

.site-nav--drawer {
	display: block;
	flex-shrink: 0;
}

@media (min-width: 768px) {
	html:not([amp]) .site-nav--desktop {
		display: block;
		flex: 1;
		min-width: 0;
	}

	html:not([amp]) .site-nav--desktop .site-nav__list {
		display: flex;
		flex-wrap: wrap;
		justify-content: flex-end;
		align-items: center;
		gap: 0.15rem 0.35rem;
	}

	html:not([amp]) .site-nav--desktop .site-nav__list li {
		border: none;
	}

	html:not([amp]) .site-nav--desktop .site-nav__list a {
		display: block;
		padding: 0.35rem 0.55rem;
		font-size: 0.8rem;
		white-space: nowrap;
		border-radius: 4px;
	}

	html:not([amp]) .site-nav--desktop .site-nav__list a:hover,
	html:not([amp]) .site-nav--desktop .site-nav__list .current-menu-item > a,
	html:not([amp]) .site-nav--desktop .site-nav__list .current_page_item > a {
		background: rgba(34, 197, 94, 0.12);
		color: var(--accent);
	}

	html:not([amp]) .site-nav--drawer {
		display: none;
	}

	html:not([amp]) .site-header__brand {
		flex: 0 1 auto;
		max-width: 40%;
	}
}

html[amp] .site-nav--desktop {
	display: none !important;
}

html[amp] .site-nav--drawer {
	display: block !important;
}

.site-nav__toggle {
	list-style: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 1px solid #333;
	border-radius: 6px;
	background: var(--bg-elevated);
	color: var(--text);
	-webkit-tap-highlight-color: transparent;
}

.site-nav__toggle::-webkit-details-marker {
	display: none;
}

.site-nav__toggle::marker {
	content: '';
}

.site-nav__icon {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 22px;
}

.site-nav__bar {
	display: block;
	height: 2px;
	width: 100%;
	background: currentColor;
	border-radius: 1px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-nav--drawer[open] .site-nav__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.site-nav--drawer[open] .site-nav__bar:nth-child(2) {
	opacity: 0;
}

.site-nav--drawer[open] .site-nav__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

.site-nav__panel {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	min-width: 240px;
	max-width: min(320px, calc(100vw - 2.5rem));
	background: var(--bg-elevated);
	border: 1px solid #333;
	border-radius: 8px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
	padding: 0.5rem 0;
}

.site-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-nav__list li {
	margin: 0;
	border-bottom: 1px solid #2a2a2a;
}

.site-nav__list li:last-child {
	border-bottom: none;
}

.site-nav__list a {
	display: block;
	padding: 0.75rem 1.1rem;
	color: var(--text);
	font-size: 0.95rem;
	font-weight: 500;
	text-decoration: none;
}

.site-nav__list a:hover,
.site-nav__list .current-menu-item > a,
.site-nav__list .current_page_item > a {
	background: rgba(34, 197, 94, 0.1);
	color: var(--accent);
}

.site-nav__list .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	background: #151515;
}

.site-nav__list .sub-menu a {
	padding-left: 1.75rem;
	font-size: 0.9rem;
}

.site-wrap {
	max-width: var(--content-width);
	margin: 0 auto;
	padding: 2rem 1.25rem 4rem;
}

.site-brand {
	margin: 0 0 1.5rem;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.4;
}

.site-brand a {
	color: var(--text);
	text-decoration: none;
}

.site-brand a:hover {
	color: var(--accent);
	text-decoration: none;
}

.entry-title {
	margin: 0 0 1.25rem;
	font-size: clamp(1.35rem, 4vw, 1.75rem);
	font-weight: 700;
	line-height: 1.35;
	text-align: center;
}

.entry-hero {
	text-align: center;
	margin-bottom: 1.5rem;
}

.entry-hero .entry-title {
	margin-bottom: 1rem;
}

.btn-cta,
.wp-block-button__link,
a.button,
button.button,
input[type="submit"] {
	display: inline-block;
	background: var(--accent) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 999px;
	padding: 0.65rem 1.5rem;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none !important;
	cursor: pointer;
}

.btn-cta:hover,
.wp-block-button__link:hover,
a.button:hover {
	background: var(--accent-hover) !important;
	color: #fff !important;
	text-decoration: none !important;
}

.entry-meta {
	color: var(--text-muted);
	font-size: 0.9rem;
	margin-bottom: 1.75rem;
}

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

.entry-content > *:first-child {
	margin-top: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	color: var(--text);
	margin: 2rem 0 0.75rem;
	line-height: 1.35;
}

.entry-content p {
	margin: 0 0 1.1rem;
}

.entry-content ul,
.entry-content ol {
	margin: 0 0 1.1rem;
	padding-left: 1.35rem;
}

/* Khung cảnh báo vàng (alert) */
.entry-content blockquote,
.entry-content .alert,
.entry-content .notice,
.entry-content [class*="alert"],
.entry-content [style*="border"][style*="yellow"],
.entry-content table.has-yellow-border {
	border: 1px solid var(--warn-border) !important;
	background: rgba(251, 191, 36, 0.08);
	padding: 1rem 1.1rem;
	margin: 1.25rem 0;
	border-radius: 4px;
	color: var(--text);
}

/* Khung intro viền xanh */
.entry-content .intro-box,
.entry-content .highlight-box,
.entry-content blockquote.is-style-green,
.entry-content .has-green-border {
	border: 1px solid var(--accent) !important;
	background: rgba(34, 197, 94, 0.06);
	padding: 1rem 1.1rem;
	margin: 1.25rem 0;
	border-radius: 4px;
}

.entry-content strong {
	color: var(--text);
}

.site-footer {
	max-width: var(--content-width);
	margin: 0 auto;
	padding: 2rem 1.25rem;
	border-top: 1px solid #2a2a2a;
	color: var(--text-muted);
	font-size: 0.85rem;
	text-align: center;
}

/* Ẩn TOC/plugin nặng trên giao diện minimal */
#ftwp-container,
.fixed-toc,
.flatsome-scroll-up,
.ux-body-overlay {
	display: none !important;
}

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

/* Trang chủ */
.home-hero {
	margin: 0 0 1.5rem;
}

.home-hero img {
	width: 100%;
	border-radius: 4px;
}

.home-recent-posts {
	margin-top: 2.5rem;
	padding-top: 2rem;
	border-top: 1px solid #2a2a2a;
}

.home-post-card {
	margin-bottom: 2rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid #2a2a2a;
}

.home-post-card:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.home-post-card__thumb {
	display: block;
	margin-bottom: 1rem;
	border-radius: 4px;
	overflow: hidden;
}

.home-post-card__thumb img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.home-post-card__title {
	margin: 0 0 0.5rem;
	font-size: 1.15rem;
	text-align: left;
}

.home-post-card__title a {
	color: var(--text);
}

.home-post-card__title a:hover {
	color: var(--accent);
	text-decoration: none;
}

.home-post-card__excerpt {
	margin: 0;
	color: var(--text-muted);
	font-size: 0.95rem;
}

@media (max-width: 640px) {
	.site-wrap {
		padding-top: 1.25rem;
	}
}
