/*
Theme Name: Viện Phương Nam
Theme URI: https://tonyautomation.com
Author: Viện Chiến lược Chính sách Kinh tế Phương Nam
Description: Theme khối (block theme) cho website Viện Chiến lược Chính sách Kinh tế Phương Nam. Bố cục kiểu cổng thông tin viện nghiên cứu: đầu trang logo + tên viện, thanh menu tím than có menu con, banner trình chiếu, Tin nổi bật, Lĩnh vực hoạt động, các khối chuyên mục, thư viện ảnh, đối tác, chân trang và nút gọi/Zalo nổi. Sửa mọi thứ trong Giao diện > Trình chỉnh sửa, không cần code.
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vien-phuong-nam
*/

:root { --vpn-shadow: 0 2px 14px rgba(36, 27, 82, .08); }
body { -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }

/* ---------- Đầu trang ---------- */
.vpn-header-main { gap: 20px; }
.vpn-header-main .vpn-logo img { width: 96px; height: 96px; display: block; }
.vpn-header-brand { flex: 1 1 auto; text-align: center; }
.vpn-ten-vien { font-family: var(--wp--preset--font-family--serif); text-transform: uppercase; line-height: 1.22 !important; margin: 0 !important; }
.vpn-ten-vien a { color: inherit; }
.vpn-khau-hieu { margin-top: 6px !important; letter-spacing: .02em; }
.vpn-header-search { width: 260px; flex: 0 0 auto; }
.vpn-header-search .wp-block-search__inside-wrapper { border: 1px solid var(--wp--preset--color--border); border-radius: 3px; padding: 0; }
.vpn-header-search .wp-block-search__input { border: 0; padding: 8px 12px; font-size: .9rem; }
.vpn-header-search .wp-block-search__button { margin: 0; background: var(--wp--preset--color--red); color: #fff; border-radius: 0 2px 2px 0; padding: 6px 12px; }

/* Thanh menu */
.vpn-navbar { position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
body.admin-bar .vpn-navbar { top: 32px; }
.vpn-navbar .wp-block-navigation { font-size: .95rem; font-weight: 700; text-transform: uppercase; }
.vpn-navbar .wp-block-navigation .wp-block-navigation-item__content { padding: 13px 4px; }
.vpn-navbar .wp-block-navigation > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover,
.vpn-navbar .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content,
.vpn-navbar .wp-block-navigation .current-menu-ancestor > .wp-block-navigation-item__content { color: var(--wp--preset--color--accent) !important; }
.vpn-navbar .wp-block-navigation__submenu-container {
	background: #fff !important; color: var(--wp--preset--color--contrast) !important; border: 0 !important;
	border-top: 3px solid var(--wp--preset--color--red) !important; box-shadow: 0 8px 22px rgba(0,0,0,.15); min-width: 240px !important;
	text-transform: none; font-weight: 400;
}
.vpn-navbar .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 9px 16px !important; border-bottom: 1px solid var(--wp--preset--color--border); color: var(--wp--preset--color--contrast) !important; }
.vpn-navbar .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--red) !important; background: var(--wp--preset--color--light); }
.vpn-navbar .wp-block-navigation__responsive-container.is-menu-open { font-size: 1.05rem; }
.vpn-navbar .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container { background: transparent !important; box-shadow: none; border: 0 !important; color: #fff !important; }
.vpn-navbar .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content { color: #fff !important; border: 0; padding: 6px 0 6px 14px !important; }

/* ---------- Banner trình chiếu ---------- */
.vpn-slider { position: relative; overflow: hidden; }
.vpn-slider > .wp-block-cover { margin: 0 !important; transition: opacity .7s ease; }
.vpn-slider:not(.is-ready) > .wp-block-cover:not(:first-child) { display: none; }
.vpn-slider.is-ready > .wp-block-cover { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.vpn-slider.is-ready > .wp-block-cover.is-active { position: relative; opacity: 1; pointer-events: auto; }
.vpn-slider .wp-block-cover__inner-container { max-width: 1220px; }
.vpn-slider h2 { text-shadow: 0 2px 12px rgba(0,0,0,.35); text-transform: uppercase; }
.vpn-slider-dots { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; gap: 10px; justify-content: center; z-index: 5; }
.vpn-slider-dots button { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: transparent; padding: 0; cursor: pointer; }
.vpn-slider-dots button.is-active { background: var(--wp--preset--color--accent); border-color: var(--wp--preset--color--accent); }
.vpn-slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 42px; height: 42px; border-radius: 50%; border: 0;
	background: rgba(255,255,255,.18); color: #fff; font-size: 22px; line-height: 42px; cursor: pointer; }
.vpn-slider-arrow:hover { background: var(--wp--preset--color--red); }
.vpn-slider-arrow.prev { left: 16px; } .vpn-slider-arrow.next { right: 16px; }

/* ---------- Tiêu đề khối dạng nhãn đỏ ---------- */
.vpn-block-title { border-bottom: 2px solid var(--wp--preset--color--red); margin-bottom: 18px !important; }
.vpn-block-title > * { display: inline-block; margin: 0 !important; background: var(--wp--preset--color--red); color: #fff !important;
	padding: 7px 16px 6px; font-size: 1rem !important; font-weight: 700; text-transform: uppercase; border-radius: 3px 3px 0 0; }
.vpn-block-title a { color: #fff !important; }

/* Tiêu đề giữa có gạch trang trí */
.vpn-center-title { text-align: center; text-transform: uppercase; position: relative; padding-bottom: 14px; margin-bottom: 28px !important; }
.vpn-center-title::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 70px; height: 3px; background: var(--wp--preset--color--red); transform: translateX(-50%); }
.vpn-center-title::before { content: ""; position: absolute; left: 50%; bottom: 1px; width: 220px; height: 1px; background: var(--wp--preset--color--border); transform: translateX(-50%); }

/* ---------- Bài viết dạng thẻ / danh sách ---------- */
.vpn-thumb img, .vpn-thumb .wp-block-post-featured-image img { object-fit: cover; width: 100%; border-radius: 3px; }
.wp-block-post-featured-image img { object-fit: cover; }
.vpn-lead .wp-block-post-featured-image img { aspect-ratio: 16/10; }
.vpn-lead .wp-block-post-title { font-size: 1.3rem !important; line-height: 1.3; margin-top: 12px !important; }
.vpn-lead .wp-block-post-excerpt { color: #555; font-size: .95rem; }
.vpn-mini-list .wp-block-post-template > li { padding-bottom: 14px; margin-bottom: 14px !important; border-bottom: 1px dashed var(--wp--preset--color--border); }
.vpn-mini-list .wp-block-post-template > li:last-child { border-bottom: 0; margin-bottom: 0 !important; padding-bottom: 0; }
.vpn-mini-row { display: flex !important; gap: 12px; align-items: flex-start; }
.vpn-mini-row .wp-block-post-featured-image { flex: 0 0 112px; width: 112px !important; margin: 0 !important; }
.vpn-mini-row .wp-block-post-featured-image img { aspect-ratio: 4/3; border-radius: 3px; }
.vpn-mini-row .wp-block-post-title { font-size: .98rem !important; line-height: 1.35; margin: 0 0 4px !important; font-weight: 700; }
.vpn-title-list .wp-block-post-template > li { position: relative; padding-left: 16px; }
.vpn-title-list .wp-block-post-template > li::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; background: var(--wp--preset--color--red); transform: rotate(45deg); }
.vpn-title-list .wp-block-post-title { font-size: .98rem !important; margin: 0 0 2px !important; line-height: 1.35; font-weight: 700; }
.wp-block-post-title a:hover { color: var(--wp--preset--color--red); }
.wp-block-read-more { display: inline-block; border: 1px solid var(--wp--preset--color--border); padding: 4px 12px; font-size: .75rem; text-transform: uppercase; font-weight: 700; color: #666; border-radius: 2px; }
.wp-block-read-more:hover { background: var(--wp--preset--color--red); color: #fff; border-color: var(--wp--preset--color--red); }

/* Thẻ chuyên mục (trang chủ) */
.vpn-cat-card { background: #fff; box-shadow: var(--vpn-shadow); border-radius: 4px; padding: 18px 18px 20px; height: 100%; }
.vpn-cat-section { background: var(--wp--preset--color--light); }

/* Danh sách bài do shortcode [vien_chuyen_muc] tạo ra */
.vpn-sc .vpn-sc-lead img { aspect-ratio: 16/10; object-fit: cover; width: 100%; border-radius: 3px; display: block; }
.vpn-sc .vpn-sc-lead h3 { font-size: 1.12rem; margin: 10px 0 4px; line-height: 1.35; }
.vpn-sc .vpn-sc-date { color: var(--wp--preset--color--muted); font-size: .8125rem; }
.vpn-sc .vpn-sc-excerpt { font-size: .93rem; color: #555; margin: 6px 0 10px; }
.vpn-sc .vpn-sc-more { display: inline-block; border: 1px solid var(--wp--preset--color--border); padding: 3px 12px; font-size: .75rem; text-transform: uppercase; font-weight: 700; color: #666; }
.vpn-sc .vpn-sc-more:hover { background: var(--wp--preset--color--red); color: #fff; border-color: var(--wp--preset--color--red); }
.vpn-sc ul { list-style: none; padding: 0; margin: 16px 0 0; }
.vpn-sc li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px dashed var(--wp--preset--color--border); }
.vpn-sc li img { width: 96px; flex: 0 0 96px; aspect-ratio: 4/3; object-fit: cover; border-radius: 3px; }
.vpn-sc li h4 { font-size: .97rem; margin: 0 0 3px; line-height: 1.35; font-weight: 700; }
.vpn-sc-list article { display: flex; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--wp--preset--color--border); }
.vpn-sc-list article img { width: 260px; flex: 0 0 260px; aspect-ratio: 16/10; object-fit: cover; border-radius: 3px; }
.vpn-sc-list article h3 { margin: 0 0 6px; font-size: 1.2rem; }
.vpn-sc-list .vpn-sc-all { margin-top: 18px; }

/* Lưới tin trang lưu trữ */
.vpn-archive-list .wp-block-post-template > li { padding: 20px 0; border-bottom: 1px solid var(--wp--preset--color--border); margin: 0 !important; }
.vpn-archive-row { display: flex !important; gap: 20px; }
.vpn-archive-row .wp-block-post-featured-image { flex: 0 0 260px; width: 260px !important; margin: 0 !important; }
.vpn-archive-row .wp-block-post-featured-image img { aspect-ratio: 16/10; border-radius: 3px; }
.vpn-archive-row .wp-block-post-title { font-size: 1.2rem !important; margin: 0 0 6px !important; }

/* ---------- Lĩnh vực hoạt động ---------- */
.vpn-tiles { display: grid !important; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.vpn-tile { margin: 0 !important; text-align: center; }
.vpn-tile figure { margin: 0 !important; overflow: hidden; border-radius: 4px; }
.vpn-tile img { aspect-ratio: 4/3; object-fit: cover; width: 100%; transition: transform .35s ease; display: block; }
.vpn-tile:hover img { transform: scale(1.06); }
.vpn-tile p { margin: 10px 0 0 !important; font-weight: 700; text-transform: uppercase; font-size: .95rem; }
.vpn-tile a { color: var(--wp--preset--color--primary); }
.vpn-tile a:hover { color: var(--wp--preset--color--red); }

/* ---------- Thư viện ảnh & đối tác ---------- */
.vpn-gallery.wp-block-gallery img { aspect-ratio: 4/3; object-fit: cover; border-radius: 3px; }
.vpn-partners { display: grid !important; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.vpn-partner { border: 1px solid var(--wp--preset--color--border); border-radius: 4px; min-height: 84px; display: flex; align-items: center; justify-content: center;
	color: var(--wp--preset--color--muted); font-weight: 700; text-transform: uppercase; font-size: .85rem; margin: 0 !important; text-align: center; background: #fff; }

/* ---------- Trang trong ---------- */
.vpn-page-head { background: linear-gradient(90deg, var(--wp--preset--color--primary-dark), var(--wp--preset--color--primary)); }
.vpn-breadcrumb { font-size: .875rem; gap: 6px !important; }
.vpn-breadcrumb a { color: var(--wp--preset--color--accent) !important; }
.vpn-breadcrumb p, .vpn-breadcrumb .wp-block-post-title, .vpn-breadcrumb .wp-block-query-title { font-size: .875rem !important; margin: 0 !important; font-weight: 400 !important; color: #fff; }
.vpn-content .wp-block-post-content > * + * { margin-top: 1em; }
.vpn-content .wp-block-post-content a { color: var(--wp--preset--color--primary); text-decoration: underline; }
.vpn-content table { border-collapse: collapse; width: 100%; }
.vpn-content td, .vpn-content th { border: 1px solid var(--wp--preset--color--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.vpn-sidebar > .wp-block-group { background: #fff; box-shadow: var(--vpn-shadow); border-radius: 4px; padding: 18px; }
.vpn-info-box p { margin: 6px 0 !important; font-size: .95rem; }
.vpn-team img { border-radius: 50%; aspect-ratio: 1/1; object-fit: cover; }

/* ---------- Chân trang ---------- */
.vpn-footer a { color: #fff; }
.vpn-footer a:hover { color: var(--wp--preset--color--accent); }
.vpn-footer .vpn-mini-row .wp-block-post-featured-image { flex-basis: 80px; width: 80px !important; }
.vpn-footer .vpn-mini-row .wp-block-post-title a { color: #fff; }
.vpn-footer .wp-block-post-date { color: rgba(255,255,255,.6); }
.vpn-footer .vpn-mini-list .wp-block-post-template > li { border-color: rgba(255,255,255,.15); }
.vpn-footer p { margin: 5px 0 !important; }

/* Nút gọi / Zalo nổi */
.vpn-float { position: fixed; right: 18px; bottom: 22px; z-index: 999; display: flex; flex-direction: column; gap: 12px; }
.vpn-float a { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff !important;
	box-shadow: 0 6px 18px rgba(0,0,0,.25); position: relative; font-weight: 700; font-size: 13px; }
.vpn-float a::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid currentColor; opacity: .0; animation: vpn-ping 2s infinite; }
.vpn-float .vpn-zalo { background: #0068ff; } .vpn-float .vpn-zalo::after { border-color: #0068ff; }
.vpn-float .vpn-call { background: var(--wp--preset--color--red); } .vpn-float .vpn-call::after { border-color: var(--wp--preset--color--red); }
@keyframes vpn-ping { 0% { transform: scale(.85); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .vpn-float a::after { animation: none; } .vpn-slider > .wp-block-cover { transition: none; } }

/* ---------- Điện thoại / máy tính bảng ---------- */
@media (max-width: 1080px) {
	.vpn-tiles { grid-template-columns: repeat(3, 1fr); }
	.vpn-partners { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 781px) {
	.vpn-header-main { flex-wrap: wrap !important; justify-content: center !important; }
	.vpn-header-main .vpn-logo img { width: 64px; height: 64px; }
	.vpn-header-search { display: none; }
	.vpn-ten-vien { font-size: 1.15rem !important; }
	.vpn-khau-hieu { font-size: .75rem !important; }
	.vpn-navbar .wp-block-navigation__responsive-container-open { color: #fff; padding: 10px 0; }
	.vpn-tiles { grid-template-columns: repeat(2, 1fr); gap: 14px; }
	.vpn-tile p { font-size: .82rem; }
	.vpn-partners { grid-template-columns: repeat(2, 1fr); }
	.vpn-slider .wp-block-cover { min-height: 300px !important; }
	.vpn-slider-arrow { display: none; }
	.vpn-sc-list article, .vpn-archive-row { flex-direction: column; }
	.vpn-sc-list article img, .vpn-archive-row .wp-block-post-featured-image { width: 100% !important; flex-basis: auto; }
	.vpn-float a { width: 46px; height: 46px; }
}

.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important; }

/* Các phần lớn của trang nằm sát nhau (không có khe trắng) */
.wp-site-blocks > * { margin-block-start: 0 !important; }
@media (max-width: 781px) {
	.vpn-slider h2 { font-size: 1.45rem !important; }
	.vpn-slider p { font-size: 1rem !important; }
}
.vpn-content .wp-block-post-content .vpn-sc a { text-decoration: none; color: var(--wp--preset--color--contrast); }
.vpn-content .wp-block-post-content .vpn-sc a:hover { color: var(--wp--preset--color--red); }
.vpn-content .wp-block-post-content .vpn-sc a.wp-element-button { color: #fff; }
.vpn-sc-list article > a:first-child { flex: 0 0 260px; }
.vpn-sc li > a:first-child { flex: 0 0 96px; }
@media (max-width: 781px) { .vpn-sc-list article > a:first-child { flex-basis: auto; } .vpn-sc-list article img { width: 100%; } }
