/*
Theme Name: VSTEP AI
Theme URI: https://vstep.online
Description: Theme tạp chí cho website dịch vụ ứng dụng AI cho doanh nghiệp. Header trắng cố định, khối 5 bài nổi bật, lưới bài viết kèm sidebar, footer đen.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: vstep-ai
*/

:root {
	--fl-body-font: "Roboto", "Helvetica Neue", Helvetica, sans-serif;
	--fl-headings-font: "Montserrat", "Helvetica Neue", Helvetica, sans-serif;
	--fl-accent-color: #dd9933;
	--fl-body-background: #ffffff;
	--fl-body-color: #444444;
	--fl-headings-color: #111111;
	--fl-meta-color: #777777;
	--fl-line: rgb(128 128 128 / .1);
	--fl-footer-background: #111111;
	--fl-footer-color: #9a9a9a;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
	margin: 0;
	background: var(--fl-body-background);
	color: var(--fl-body-color);
	font-family: var(--fl-body-font);
	font-size: 1rem;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--fl-headings-color); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--fl-accent-color); }
h1, h2, h3, h4, h5 {
	font-family: var(--fl-headings-font);
	font-weight: 700;
	color: var(--fl-headings-color);
	line-height: 1.35;
	margin: 0 0 16px;
}
ul { margin: 0; padding: 0; list-style: none; }
.clearfix::after { content: ""; display: table; clear: both; }
.fl-container { position: relative; width: 100%; max-width: 1188px; padding: 0 24px; margin: 0 auto; }
.screen-reader-text { position: absolute; left: -9999px; }
.skip-link:focus { left: 8px; top: 8px; z-index: 1000; background: #fff; padding: 8px 12px; }
:focus-visible { outline: 2px solid var(--fl-accent-color); outline-offset: 2px; }

/* ---------- Header ---------- */
#fl-header {
	position: fixed; top: 0; left: 0; width: 100%; height: 64px; z-index: 900;
	background: #fff; border-bottom: 1px solid var(--fl-line);
	font-family: var(--fl-headings-font); text-transform: uppercase;
}
.admin-bar #fl-header { top: 32px; }
#fl-header .fl-container { display: flex; align-items: center; height: 64px; }
#fl-logo { margin-right: 20px; flex: none; }
#fl-logo a { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 700; line-height: 64px; letter-spacing: .5px; }
#fl-logo .mark { display: inline-block; width: 28px; height: 28px; border-radius: 6px; background: var(--fl-headings-color); color: var(--fl-accent-color); font-size: .8rem; line-height: 28px; text-align: center; }
#fl-logo em { font-style: normal; color: var(--fl-accent-color); }
#fl-topmenu { flex: 1; min-width: 0; }
#fl-topmenu > ul { display: flex; flex-wrap: nowrap; }
#fl-topmenu li { position: relative; }
#fl-topmenu li a { display: block; font-size: .75rem; font-weight: 700; letter-spacing: 1px; line-height: 64px; padding: 0 9px; white-space: nowrap; }
#fl-topmenu li.current-menu-item > a, #fl-topmenu li.current-menu-parent > a { color: var(--fl-accent-color); }
#fl-topmenu li.menu-item-has-children > a::after { content: "▾"; margin-left: 6px; font-size: .7rem; font-weight: 400; }
#fl-topmenu .sub-menu {
	position: absolute; left: 0; top: 64px; min-width: 240px; background: #fff; text-transform: none;
	box-shadow: 0 2px 6px rgb(0 0 0 / .1); opacity: 0; visibility: hidden; transition: opacity .2s ease; z-index: 800;
}
#fl-topmenu li:hover > .sub-menu, #fl-topmenu li:focus-within > .sub-menu { opacity: 1; visibility: visible; }
#fl-topmenu .sub-menu li a { line-height: 40px; font-weight: 400; letter-spacing: normal; padding: 0 24px; border-bottom: 1px solid var(--fl-line); font-size: .85rem; }
#fl-topmenu .sub-menu li a:hover { background: var(--fl-line); color: var(--fl-headings-color); }
.header-icons { display: flex; align-items: center; gap: 4px; flex: none; }
.header-cta { background: var(--fl-headings-color); color: #fff !important; font-size: .7rem; font-weight: 700; letter-spacing: 1px; padding: 9px 14px; border-radius: 4px; white-space: nowrap; }
.header-cta:hover { background: var(--fl-accent-color); }
.icon-btn { width: 40px; height: 40px; border: 0; background: none; cursor: pointer; color: var(--fl-headings-color); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { color: var(--fl-accent-color); }
.icon-btn svg { width: 18px; height: 18px; }
#fl-drawer-icon { display: none; }

#fl-search-overlay { position: fixed; inset: 0; z-index: 950; background: rgb(255 255 255 / .97); display: none; align-items: center; justify-content: center; padding: 24px; }
#fl-search-overlay.open { display: flex; }
#fl-search-overlay form { width: 100%; max-width: 640px; display: flex; gap: 8px; }
#fl-search-overlay .close { position: absolute; top: 24px; right: 24px; }

#fl-drawer { position: fixed; top: 0; left: -300px; width: 280px; height: 100%; background: #fff; z-index: 960; overflow-y: auto; padding: 24px; transition: left .25s ease; box-shadow: 2px 0 12px rgb(0 0 0 / .12); }
#fl-drawer.open { left: 0; }
#fl-drawer li a { display: block; padding: 10px 0; border-bottom: 1px dotted var(--fl-line); font-family: var(--fl-headings-font); font-weight: 700; font-size: .9rem; }
#fl-drawer .sub-menu { padding-left: 16px; }
#fl-drawer .sub-menu a { font-weight: 400; }
.push-overlay { position: fixed; inset: 0; background: rgb(0 0 0 / .4); z-index: 955; display: none; }
.push-overlay.open { display: block; }

#fl-main-warp { padding-top: 64px; }

/* ---------- Bìa bài viết (dùng khi bài chưa có ảnh đại diện) ---------- */
.fl-picture { display: block; overflow: hidden; background: #f3f3f3; }
.fl-picture img { width: 100%; object-fit: cover; aspect-ratio: 554 / 346; transition: transform .4s ease; }
.fl-post:hover .fl-picture img, .fl-post:hover .fl-cover { transform: scale(1.03); }
.fl-cover {
	display: flex; align-items: flex-end; width: 100%; aspect-ratio: 554 / 346; padding: 16px;
	color: #fff; font-family: var(--fl-headings-font); font-weight: 700; font-size: .8rem; letter-spacing: 1.5px; text-transform: uppercase;
	background: linear-gradient(135deg, #111 0%, #3a2a12 60%, #dd9933 140%); transition: transform .4s ease;
	position: relative;
}
.fl-cover::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgb(255 255 255 / .14) 1px, transparent 1px); background-size: 18px 18px; }
.fl-cover span { position: relative; }
.fl-cover.c1 { background: linear-gradient(135deg, #0f1d2e 0%, #1d4468 70%, #dd9933 150%); }
.fl-cover.c2 { background: linear-gradient(135deg, #14261c 0%, #1f5a3d 70%, #dd9933 150%); }
.fl-cover.c3 { background: linear-gradient(135deg, #2a1420 0%, #6a2748 70%, #dd9933 150%); }
.fl-cover.c4 { background: linear-gradient(135deg, #1f1a2e 0%, #453a7a 70%, #dd9933 150%); }
.fl-cover.c5 { background: linear-gradient(135deg, #2b1c10 0%, #7a4a1c 70%, #f2c078 150%); }

/* ---------- Khối 5 bài nổi bật ---------- */
#fl-featured .posts-5 { position: relative; margin-top: 56px; display: grid; grid-template-columns: 1fr 1.15fr 1fr; grid-template-rows: auto auto; gap: 32px 0; }
#fl-featured .fl-post { display: flex; gap: 14px; align-items: flex-start; }
#fl-featured .fl-post .fl-picture { width: 48%; flex: none; }
#fl-featured .fl-post .content { flex: 1; min-width: 0; }
#fl-featured .fl-post:nth-child(1) { grid-column: 2; grid-row: 1 / span 2; display: block; padding: 0 28px; margin: 0 28px; border-left: 1px solid var(--fl-line); border-right: 1px solid var(--fl-line); text-align: center; }
#fl-featured .fl-post:nth-child(1) .fl-picture { width: 100%; }
#fl-featured .fl-post:nth-child(1) .fl-picture img, #fl-featured .fl-post:nth-child(1) .fl-cover { aspect-ratio: 4 / 3; }
#fl-featured .fl-post:nth-child(1) .category { margin-top: 14px; }
#fl-featured .fl-post:nth-child(1) .title { font-size: 1.35rem; }
#fl-featured .fl-post:nth-child(2) { grid-column: 1; grid-row: 1; }
#fl-featured .fl-post:nth-child(3) { grid-column: 3; grid-row: 1; }
#fl-featured .fl-post:nth-child(4) { grid-column: 1; grid-row: 2; }
#fl-featured .fl-post:nth-child(5) { grid-column: 3; grid-row: 2; }
.category { display: block; font-family: var(--fl-headings-font); font-weight: 700; font-size: .7rem; letter-spacing: 1px; text-transform: uppercase; }
.category a { color: var(--fl-accent-color); }
#fl-featured .title { font-size: 1rem; margin: 8px 0 0; }
.title a { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }

/* ---------- Dải giới thiệu dịch vụ ---------- */
.fl-intro { margin-top: 56px; padding: 40px 0; background: #111; color: #cfcfcf; }
.fl-intro .fl-container { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.fl-intro h1 { color: #fff; font-size: 1.9rem; margin-bottom: 12px; }
.fl-intro p { margin: 0 0 20px; }
.fl-intro ul { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fl-intro li a { display: block; padding: 16px; border: 1px solid rgb(255 255 255 / .12); border-radius: 6px; color: #fff; font-family: var(--fl-headings-font); font-weight: 700; font-size: .9rem; }
.fl-intro li a small { display: block; font-family: var(--fl-body-font); font-weight: 400; color: #9a9a9a; font-size: .8rem; line-height: 1.5; margin-top: 4px; }
.fl-intro li a:hover { border-color: var(--fl-accent-color); }

.btn, button.btn, input[type="submit"] {
	display: inline-block; border: 0; cursor: pointer; background: var(--fl-accent-color); color: #fff;
	font-family: var(--fl-headings-font); font-weight: 700; font-size: .8rem; letter-spacing: 1px; text-transform: uppercase;
	padding: 13px 22px; border-radius: 4px; transition: opacity .2s ease;
}
.btn:hover, input[type="submit"]:hover { opacity: .85; color: #fff; }
.btn.dark { background: #111; }

/* ---------- Nội dung + sidebar ---------- */
#fl-content { margin-top: 56px; }
#fl-content > .fl-container { display: flex; gap: 48px; align-items: flex-start; }
#fl-post-container { flex: 1; min-width: 0; }
#fl-sidebar { width: 30%; flex: none; }

.fl-loop-tabs { display: flex; margin-bottom: 40px; }
.fl-loop-tabs button {
	position: relative; flex: 1; padding: 10px 8px; border: 0; cursor: pointer; font-size: 14px; letter-spacing: 1px; text-transform: uppercase;
	font-family: var(--fl-headings-font); font-weight: 700; color: var(--fl-headings-color); background: var(--fl-line); border-right: 1px solid var(--fl-line);
}
.fl-loop-tabs button:hover, .fl-loop-tabs button.active { background: var(--fl-accent-color); color: #fff; }
.fl-loop-tabs button.active::after { content: ""; position: absolute; bottom: -4px; left: 50%; margin-left: -8px; border-top: 4px solid var(--fl-accent-color); border-left: 8px solid transparent; border-right: 8px solid transparent; }
.fl-loop-section { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 32px; }
.fl-loop-section[hidden] { display: none; }
.fl-loop-section .fl-post .title { font-size: 1.2rem; margin: 20px 0 10px; }
.fl-loop-section .fl-post .title a { -webkit-line-clamp: 3; line-clamp: 3; }
.fl-meta { display: inline-block; color: var(--fl-meta-color); font-size: .72rem; font-weight: 700; margin-right: 14px; font-family: var(--fl-headings-font); }
.fl-meta a { color: var(--fl-meta-color); }
.excerpt { font-size: .92rem; margin: 8px 0 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.archive-head { margin-bottom: 32px; padding-bottom: 16px; border-bottom: 6px solid var(--fl-line); }
.archive-head h1 { font-size: 1.6rem; text-transform: uppercase; margin-bottom: 6px; }
.archive-head p { margin: 0; color: var(--fl-meta-color); }
.pagination { margin-top: 48px; display: flex; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 6px 14px; background: var(--fl-line); font-family: var(--fl-headings-font); font-weight: 700; font-size: .8rem; }
.pagination .current, .pagination a:hover { background: var(--fl-accent-color); color: #fff; }

/* ---------- Widget ---------- */
.fl-widget { font-size: .875rem; margin-bottom: 40px; }
.fl-widget-title { display: flex; align-items: center; gap: 16px; font-size: 1.1rem; text-transform: uppercase; margin-bottom: 16px; }
.fl-widget-title::after { content: ""; flex: 1; height: 6px; background: var(--fl-line); }
.fl-widget ul li { border-bottom: 1px dotted rgb(128 128 128 / .25); padding: 8px 0; }
.fl-widget ul li a { font-weight: 700; }
.fl-widget ul li .count { float: right; color: var(--fl-meta-color); font-weight: 400; }
.fl-cta-box { background: #111; color: #cfcfcf; padding: 24px; border-radius: 6px; }
.fl-cta-box h3 { color: #fff; font-size: 1.05rem; text-transform: uppercase; }
.fl-cta-box p { margin: 0 0 16px; }
.fl-posts-widget .fl-post { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dotted rgb(128 128 128 / .25); }
.fl-posts-widget .fl-picture { width: 96px; flex: none; align-self: flex-start; }
.fl-posts-widget .fl-cover { font-size: 0; padding: 0; }
.fl-posts-widget .title { font-size: .875rem; margin: 0 0 4px; }
.fl-posts-widget .title a { -webkit-line-clamp: 3; line-clamp: 3; }

/* ---------- Bài viết / trang ---------- */
.fl-post-header { margin-bottom: 24px; }
.fl-post-header h1 { font-size: 2rem; margin: 8px 0 8px; }
.fl-post-header .fl-meta { font-size: .8rem; }
.fl-article-cover { margin-bottom: 32px; }
.fl-article-cover .fl-cover, .fl-article-cover img { aspect-ratio: 16 / 8; font-size: 1rem; }
.fl-article { font-size: 1.05rem; color: #333; }
.fl-article h2 { font-size: 1.45rem; margin-top: 40px; }
.fl-article h3 { font-size: 1.15rem; margin-top: 28px; }
.fl-article p { margin: 0 0 20px; }
.fl-article a { color: #b8741a; text-decoration: underline; text-underline-offset: 3px; }
.fl-article ul, .fl-article ol { margin: 0 0 20px; padding-left: 22px; }
.fl-article ul { list-style: disc; }
.fl-article li { margin-bottom: 8px; }
.fl-article blockquote { margin: 24px 0; padding: 4px 20px; border-left: 4px solid var(--fl-accent-color); background: #faf6ef; }
.fl-article table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: .95rem; }
.fl-article th, .fl-article td { border: 1px solid #e6e6e6; padding: 10px 12px; text-align: left; vertical-align: top; }
.fl-article th { background: #f6f6f6; font-family: var(--fl-headings-font); }
.fl-article .table-wrap { overflow-x: auto; }
.fl-article .lead { font-size: 1.15rem; color: #222; }
.fl-article .cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 24px; padding: 0; list-style: none; }
.fl-article .cards li { margin: 0; border: 1px solid #e6e6e6; border-radius: 6px; padding: 18px; }
.fl-article .cards li strong { display: block; font-family: var(--fl-headings-font); color: #111; margin-bottom: 4px; }
.fl-article .cards li a { text-decoration: none; }
.fl-article .steps { counter-reset: step; list-style: none; padding: 0; }
.fl-article .steps li { counter-increment: step; position: relative; padding-left: 52px; margin-bottom: 18px; }
.fl-article .steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: #111; color: var(--fl-accent-color); font-family: var(--fl-headings-font); font-weight: 700; text-align: center; line-height: 36px; }
.fl-article dl dt { font-family: var(--fl-headings-font); font-weight: 700; color: #111; margin-top: 18px; }
.fl-article dl dd { margin: 4px 0 0; }
.fl-box { margin-top: 48px; padding: 24px; border-radius: 8px; background: #111; color: #cfcfcf; }
.fl-box h3 { color: #fff; }
.fl-related { margin-top: 48px; }
.fl-tags a { display: inline-block; padding: 2px 10px; background: var(--fl-line); font-size: .8rem; margin: 0 4px 4px 0; }

/* ---------- Form ---------- */
.fl-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.fl-form .full { grid-column: 1 / -1; }
.fl-form label { display: block; font-family: var(--fl-headings-font); font-weight: 700; font-size: .8rem; color: #111; margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="search"], select, textarea {
	width: 100%; padding: 11px 12px; border: 1px solid #d5d5d5; border-radius: 4px; background: #fff; color: #222; font: inherit; font-size: .95rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--fl-accent-color); outline: none; box-shadow: 0 0 0 3px rgb(221 153 51 / .2); }
.fl-form .consent { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; font-weight: 400; font-family: var(--fl-body-font); }
.fl-form .consent input { margin-top: 5px; }
.fl-form .hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.fl-notice { padding: 14px 18px; border-radius: 4px; margin: 0 0 24px; font-weight: 700; }
.fl-notice.ok { background: #eaf6ee; color: #17603a; border: 1px solid #b9dfc8; }
.fl-notice.err { background: #fdecec; color: #9b1c1c; border: 1px solid #f3bcbc; }

/* ---------- Footer ---------- */
#fl-footer { margin-top: 80px; background: var(--fl-footer-background); color: var(--fl-footer-color); }
#fl-footer a { color: var(--fl-footer-color); }
#fl-footer a:hover { color: var(--fl-accent-color); }
#fl-footer-widgets { padding: 56px 0 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
#fl-footer .fl-widget-title { color: #fff; }
#fl-footer .fl-widget ul li a { font-weight: 400; }
#fl-copyright { border-top: 1px solid rgb(255 255 255 / .08); padding: 20px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .8rem; }
#fl-copyright ul { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- Nút nổi đặt lịch ---------- */
.fl-pill { position: fixed; right: 20px; bottom: 20px; z-index: 800; display: flex; align-items: center; gap: 12px; background: #111; color: #fff; padding: 10px 12px 10px 18px; border-radius: 999px; box-shadow: 0 6px 24px rgb(0 0 0 / .25); font-size: .85rem; }
.fl-pill[hidden] { display: none; }
.fl-pill strong { font-family: var(--fl-headings-font); }
.fl-pill a { background: var(--fl-accent-color); color: #fff; padding: 6px 14px; border-radius: 999px; font-family: var(--fl-headings-font); font-weight: 700; font-size: .75rem; white-space: nowrap; }
.fl-pill button { background: none; border: 0; color: #9a9a9a; cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
	#fl-topmenu, .header-cta { display: none; }
	#fl-drawer-icon { display: inline-flex; margin-right: 4px; }
	#fl-header .fl-container { justify-content: space-between; }
	#fl-logo { flex: 1; }
}
@media (max-width: 900px) {
	#fl-content > .fl-container { display: block; }
	#fl-sidebar { width: 100%; margin-top: 48px; }
	#fl-featured .posts-5 { display: block; margin-top: 32px; }
	#fl-featured .fl-post, #fl-featured .fl-post:nth-child(1) { margin: 0 0 24px; padding: 0; border: 0; }
	.fl-intro .fl-container { grid-template-columns: 1fr; }
	#fl-footer-widgets { grid-template-columns: 1fr; gap: 8px; padding-top: 40px; }
	#fl-footer { margin-top: 48px; }
}
@media (max-width: 600px) {
	.fl-container { padding: 0 16px; }
	.fl-loop-section, .fl-form, .fl-article .cards, .fl-intro ul { grid-template-columns: 1fr; }
	.fl-post-header h1 { font-size: 1.5rem; }
	.fl-intro h1 { font-size: 1.5rem; }
	.fl-pill { left: 12px; right: 12px; bottom: 12px; justify-content: space-between; }
	.admin-bar #fl-header { top: 46px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
