/*
Theme Name: Truong Sa News
Author: Trường Sa
Description: Theme tạp chí tin tức tông xanh biển: tiêu đề serif Newsreader, nội dung Roboto, hero ảnh Trường Sa, đọc thoải mái trên mobile.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: truongsa-news
*/

:root {
	--c-sea: #0c4a6e;
	--c-sea-dk: #082f49;
	--c-link: #0369a1;
	--c-sand: #c2410c;
	--c-ink: #0c1f2e;
	--c-text: #1e293b;
	--c-soft: #475569;
	--c-bg: #ffffff;
	--c-tint: #f0f7fb;
	--c-tint-2: #e0eff7;
	--c-line: #e2e8f0;
	--c-ring: #0369a1;

	--f-head: "Newsreader", Georgia, "Times New Roman", serif;
	--f-body: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

	--r-sm: 6px;
	--r-md: 10px;
	--r-lg: 14px;
	--sh-sm: 0 1px 2px rgba(12, 31, 46, .06), 0 1px 3px rgba(12, 31, 46, .08);
	--sh-md: 0 6px 18px rgba(12, 31, 46, .1);
	--wrap: 1200px;
	--t: 200ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--c-bg); color: var(--c-text); font: 400 16px/1.65 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg, video, iframe { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--c-link); text-decoration: none; transition: color var(--t) ease; }
a:hover { color: var(--c-sea-dk); }
h1, h2, h3, h4 { font-family: var(--f-head); color: var(--c-ink); line-height: 1.25; font-weight: 700; margin: 0 0 .5em; text-wrap: balance; }
p { margin: 0 0 1em; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--c-ring); outline-offset: 2px; border-radius: 4px; }
.ico { flex: none; vertical-align: middle; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--c-ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); }
.skip:focus { top: 12px; color: #fff; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.wrap--read { max-width: 760px; }
.wrap--wide { max-width: 1000px; }
@media (min-width: 768px) { .wrap { padding-inline: 24px; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; background: var(--c-sea); color: #fff; font-weight: 500; border: 0; cursor: pointer; transition: background-color var(--t) ease, transform var(--t) ease; }
.btn:hover { background: var(--c-sea-dk); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn--light { background: #fff; color: var(--c-sea); }
.btn--light:hover { background: var(--c-tint-2); color: var(--c-sea-dk); }

.kicker { display: inline-block; font: 700 12px/1.2 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--c-sand); margin-bottom: 8px; }
.kicker:hover { color: #9a3412; }
.meta { font-size: 13.5px; color: var(--c-soft); margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Header ---------- */
.head { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--c-line); }
.admin-bar .head { top: 32px; }
@media (max-width: 782px) { .admin-bar .head { top: 0; } }
.head__in { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--c-ink); flex: none; }
.brand:hover { color: var(--c-ink); }
.brand__mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--c-sea); color: #fff; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font: 700 22px/1.1 var(--f-head); letter-spacing: -.01em; }
.brand__tag { font-size: 12px; color: var(--c-soft); }

.nav { margin-left: auto; }
.nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nav__list li { position: relative; }
.nav__list a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; color: var(--c-text); font-weight: 500; font-size: 15px; }
.nav__list a:hover { background: var(--c-tint); color: var(--c-sea); }
.nav__list .current-menu-item > a, .nav__list .current-cat > a, .nav__list .current-post-ancestor > a, .nav__list .current-menu-parent > a { color: var(--c-sea); background: var(--c-tint-2); }
.nav__list .sub-menu { list-style: none; margin: 0; padding: 6px; position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-md); box-shadow: var(--sh-md); opacity: 0; visibility: hidden; transition: opacity var(--t) ease, visibility var(--t); }
.nav__list li:hover > .sub-menu, .nav__list li:focus-within > .sub-menu { opacity: 1; visibility: visible; }
.head__tools { display: flex; gap: 6px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--c-line); background: #fff; color: var(--c-ink); cursor: pointer; transition: background-color var(--t) ease, border-color var(--t) ease; }
.icon-btn:hover { background: var(--c-tint); border-color: var(--c-tint-2); }
.nav-toggle { display: none; }
.nav-toggle__close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__close { display: inline; }
.head__search { border-top: 1px solid var(--c-line); background: #fff; padding-block: 14px; }
.head__search .searchform { max-width: 640px; margin: 0 auto; }

@media (max-width: 899px) {
	.head__in { gap: 12px; }
	.head__tools { margin-left: auto; }
	.nav-toggle { display: grid; }
	.nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--c-line); box-shadow: var(--sh-md); display: none; margin: 0; }
	.nav.is-open { display: block; }
	.nav__list { flex-direction: column; gap: 0; padding: 8px 16px 16px; }
	.nav__list a { border-radius: var(--r-sm); min-height: 48px; border-bottom: 1px solid var(--c-line); }
	.nav__list .sub-menu { position: static; opacity: 1; visibility: visible; box-shadow: none; border: 0; padding: 0 0 0 16px; }
	.brand__tag { display: none; }
}

/* ---------- Search form ---------- */
.searchform { display: flex; gap: 8px; background: #fff; border: 1.5px solid var(--c-line); border-radius: 999px; padding: 4px 4px 4px 18px; transition: border-color var(--t) ease, box-shadow var(--t) ease; }
.searchform:focus-within { border-color: var(--c-link); box-shadow: 0 0 0 3px rgba(3, 105, 161, .18); }
.searchform input { flex: 1; min-width: 0; border: 0; background: transparent; height: 44px; outline: none; font-size: 16px; }
.searchform button { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; background: var(--c-sea); color: #fff; padding: 0 18px; min-height: 44px; font-weight: 500; cursor: pointer; transition: background-color var(--t) ease; }
.searchform button:hover { background: var(--c-sea-dk); }
@media (max-width: 420px) { .searchform button span { display: none; } .searchform button { padding: 0 14px; } }

/* ---------- Hero ---------- */
.hero { position: relative; color: #e0f2fe; background: var(--c-sea-dk); overflow: hidden; isolation: isolate; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8, 47, 73, .92) 0%, rgba(8, 47, 73, .78) 45%, rgba(8, 47, 73, .35) 100%); }
@media (max-width: 767px) { .hero::before { background: linear-gradient(180deg, rgba(8, 47, 73, .82), rgba(8, 47, 73, .92)); } }
.hero__in { padding-block: clamp(48px, 9vw, 104px); max-width: var(--wrap); }
.hero__kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fdba74; margin-bottom: 14px; }
.hero__title { color: #fff; font-size: clamp(1.9rem, 4.6vw, 3.25rem); font-weight: 700; max-width: 18ch; margin-bottom: 14px; line-height: 1.15; }
.hero__lead { font-size: clamp(1rem, 1.7vw, 1.15rem); max-width: 54ch; color: #dbeafe; margin-bottom: 26px; }
.hero__search { max-width: 560px; }
.hero__search .searchform { border-color: transparent; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }

.notice { background: #fff7ed; border-bottom: 1px solid #fed7aa; }
.notice__in { display: flex; align-items: center; gap: 10px; padding-block: 12px; color: #9a3412; font-size: 15px; }
.notice a { color: #9a3412; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.notice a:hover { color: #7c2d12; }

/* ---------- Sections ---------- */
.section { padding-block: 48px; }
.section--tint { background: var(--c-tint); }
.sec-title { font-size: clamp(1.4rem, 2.6vw, 1.8rem); margin-bottom: 22px; display: flex; align-items: center; gap: 14px; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--c-line); }
.sec-title span { position: relative; padding-left: 14px; }
.sec-title span::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 4px; border-radius: 2px; background: var(--c-sand); }

.lead { display: grid; gap: 28px; }
@media (min-width: 960px) { .lead { grid-template-columns: 1.55fr 1fr; gap: 36px; } }
.lead__media { display: block; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: var(--c-tint); margin-bottom: 16px; }
.lead__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms ease; }
.lead__main:hover .lead__media img { transform: scale(1.02); }
.lead__title { font-size: clamp(1.45rem, 3vw, 2.1rem); margin-bottom: 10px; }
.lead__title a, .mini__title a, .card__title a, .row__title a { color: var(--c-ink); }
.lead__title a:hover, .mini__title a:hover, .card__title a:hover, .row__title a:hover { color: var(--c-link); }
.lead__excerpt { color: var(--c-soft); font-size: 17px; }
.lead__side { display: grid; gap: 18px; align-content: start; }
.mini { display: grid; grid-template-columns: 128px 1fr; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--c-line); }
.mini:last-child { border-bottom: 0; padding-bottom: 0; }
.mini__media { display: block; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; background: var(--c-tint); }
.mini__media img { width: 100%; height: 100%; object-fit: cover; }
.mini__title { font-size: 18px; line-height: 1.3; margin-bottom: 6px; }

.ph { display: grid; place-items: center; width: 100%; height: 100%; min-height: 100%; color: #7dd3fc; background: linear-gradient(135deg, var(--c-sea), var(--c-sea-dk)); }

/* ---------- Layout ---------- */
.layout { display: grid; gap: 32px; }
@media (min-width: 1024px) { .layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; align-items: start; } }
.layout__main { min-width: 0; }
.layout__side { display: grid; gap: 20px; }
@media (min-width: 1024px) { .layout__side { position: sticky; top: 92px; } }

.rows { display: grid; gap: 0; background: #fff; border-radius: var(--r-lg); border: 1px solid var(--c-line); padding: 0 20px; }
.row { display: grid; grid-template-columns: 1fr 112px; gap: 16px; padding-block: 20px; border-bottom: 1px solid var(--c-line); align-items: start; }
.row:last-child { border-bottom: 0; }
@media (min-width: 640px) { .row { grid-template-columns: 1fr 200px; gap: 24px; } }
.row__media { display: block; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; background: var(--c-tint); }
.row__media img { width: 100%; height: 100%; object-fit: cover; }
.row__title { font-size: clamp(1.1rem, 2vw, 1.3rem); line-height: 1.3; margin-bottom: 6px; }
.row__excerpt { color: var(--c-soft); font-size: 15px; margin-bottom: 8px; display: none; }
@media (min-width: 640px) { .row__excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } }
.more { text-align: center; margin-top: 24px; }

.card-grid { display: grid; gap: 20px; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.card { background: #fff; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--c-line); transition: box-shadow var(--t) ease; }
.card:hover { box-shadow: var(--sh-md); }
.card__media { display: block; aspect-ratio: 16 / 10; background: var(--c-tint); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 16px 18px 18px; }
.card__title { font-size: 18px; line-height: 1.3; margin-bottom: 8px; }

/* ---------- Sidebar ---------- */
.side-box { background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 20px; }
.side-box__title { font-size: 19px; margin-bottom: 12px; }
.side-box--brand { background: linear-gradient(160deg, var(--c-sea), var(--c-sea-dk)); border: 0; color: #dbeafe; font-size: 15px; }
.side-box--brand .side-box__title { color: #fff; }
.side-cats { list-style: none; margin: 0; padding: 0; }
.side-cats a { display: flex; justify-content: space-between; align-items: center; min-height: 44px; padding: 6px 10px; border-radius: var(--r-sm); color: var(--c-text); font-weight: 500; }
.side-cats a:hover, .side-cats a[aria-current] { background: var(--c-tint); color: var(--c-sea); }
.count { font-size: 12px; font-weight: 700; background: var(--c-tint-2); color: var(--c-sea); padding: 2px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.side-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.side-list li::marker { color: var(--c-sand); font-weight: 700; }
.side-list a { color: var(--c-ink); font-family: var(--f-head); font-size: 17px; line-height: 1.3; font-weight: 600; }
.side-list a:hover { color: var(--c-link); }

/* ---------- Page head / article ---------- */
.page-head { background: var(--c-sea-dk); background: linear-gradient(120deg, var(--c-sea-dk), var(--c-sea)); color: #dbeafe; padding-block: 32px 36px; }
.page-head__title { color: #fff; font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 6px 0 6px; }
.page-head__desc { margin: 0; color: #dbeafe; max-width: 70ch; }
.crumbs { font-size: 13.5px; color: var(--c-soft); margin-bottom: 14px; }
.crumbs a { color: var(--c-soft); }
.crumbs a:hover { color: var(--c-link); text-decoration: underline; }
.page-head .crumbs, .page-head .crumbs a { color: #bae6fd; }
.page-head .crumbs a:hover { color: #fff; }

.article__head { padding-top: 36px; }
.article__title { font-size: clamp(1.8rem, 4.4vw, 2.75rem); line-height: 1.18; margin-bottom: 14px; }
.article__sapo { font-size: 19px; color: var(--c-soft); font-weight: 500; }
.article__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--c-soft); padding-bottom: 20px; border-bottom: 1px solid var(--c-line); margin-bottom: 24px; }
.article__meta span { display: inline-flex; align-items: center; gap: 6px; }
.article__cover { margin-block: 0 28px; }
.article__cover img { width: 100%; border-radius: var(--r-lg); max-height: 560px; object-fit: cover; }

.toc { background: var(--c-tint); border-radius: var(--r-md); padding: 16px 20px; margin-bottom: 28px; border-left: 4px solid var(--c-sea); }
.toc__title { font-weight: 700; color: var(--c-ink); margin-bottom: 6px; }
.toc__list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.toc__list a { font-size: 15px; }
.toc__list a:hover { text-decoration: underline; }
.toc__sub { margin-left: 16px; list-style: circle; }

.entry { font-size: 18px; line-height: 1.8; color: var(--c-text); overflow-wrap: anywhere; }
.entry > *:first-child { margin-top: 0; }
.entry h2 { font-size: 1.55em; margin: 1.7em 0 .55em; }
.entry h3 { font-size: 1.28em; margin: 1.5em 0 .5em; }
.entry h4 { font-size: 1.1em; margin: 1.3em 0 .4em; }
.entry p, .entry ul, .entry ol { margin: 0 0 1.15em; }
.entry ul, .entry ol { padding-left: 1.4em; }
.entry li { margin-bottom: .4em; }
.entry li::marker { color: var(--c-sea); }
.entry a { color: var(--c-link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.entry a:hover { text-decoration-thickness: 2px; }
.entry img { border-radius: var(--r-md); margin-inline: auto; }
.entry figure, .entry .wp-caption { margin: 1.6em auto; max-width: 100% !important; }
.entry figcaption, .entry .wp-caption-text { font-size: 14px; color: var(--c-soft); text-align: center; margin-top: 8px; }
.entry blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--c-sand); font-family: var(--f-head); font-size: 1.15em; color: var(--c-ink); }
.entry table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 15px; display: block; overflow-x: auto; }
.entry th, .entry td { border: 1px solid var(--c-line); padding: 8px 10px; text-align: left; vertical-align: top; }
.entry th { background: var(--c-tint); }
.entry iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.entry .aligncenter { display: block; margin-inline: auto; }
@media (min-width: 640px) { .entry .alignleft { float: left; margin: .3em 1.2em 1em 0; } .entry .alignright { float: right; margin: .3em 0 1em 1.2em; } }

.disclaimer { display: flex; gap: 10px; align-items: flex-start; background: #fff7ed; color: #9a3412; border-radius: var(--r-md); padding: 14px 16px; font-size: 14.5px; margin: 32px 0 20px; }
.disclaimer .ico { margin-top: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; margin: 0 0 40px; }
.tags span { font-weight: 700; }
.tags a { padding: 4px 12px; border-radius: 999px; background: var(--c-tint); color: var(--c-sea); }
.tags a:hover { background: var(--c-sea); color: #fff; }

/* ---------- Misc ---------- */
.pager { margin-top: 28px; }
.pager ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pager .page-numbers { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px; background: #fff; border: 1px solid var(--c-line); color: var(--c-text); font-weight: 500; }
.pager a.page-numbers:hover { border-color: var(--c-sea); color: var(--c-sea); }
.pager .current { background: var(--c-sea); border-color: var(--c-sea); color: #fff; }
.pager .dots { background: transparent; border: 0; }
.empty { background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 28px; }
.empty--big { text-align: center; }
.empty__code { font: 700 80px/1 var(--f-head); color: var(--c-sea); margin-bottom: 8px; }

.comments { border-top: 1px solid var(--c-line); padding-top: 28px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 24px; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--c-line); font-size: 15px; }
.comment-author { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.comment-author img { border-radius: 50%; }
.comment-respond { background: var(--c-tint); border-radius: var(--r-lg); padding: 20px; }
.comment-form label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; min-height: 44px; border: 1.5px solid var(--c-line); border-radius: var(--r-md); padding: 10px 12px; background: #fff; }
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--c-link); box-shadow: 0 0 0 3px rgba(3, 105, 161, .18); }

/* ---------- Footer ---------- */
.foot { background: var(--c-sea-dk); color: #b6cfe0; font-size: 15px; position: relative; }
.foot__wave { height: 28px; background: var(--c-bg); -webkit-mask: radial-gradient(28px 22px at 50% 0, #000 98%, transparent) 0 0 / 56px 28px repeat-x; mask: radial-gradient(28px 22px at 50% 0, #000 98%, transparent) 0 0 / 56px 28px repeat-x; }
.home .foot__wave, .archive .foot__wave, .search .foot__wave, .blog .foot__wave { background: var(--c-tint); }
.single:not(:has(.comments)) .foot__wave { background: var(--c-tint); }
.foot__grid { display: grid; gap: 32px; padding-block: 32px 36px; }
@media (min-width: 768px) { .foot__grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.foot .brand { color: #fff; margin-bottom: 14px; }
.foot .brand__tag { color: #93b4ca; display: block; }
.foot .brand__mark { background: #fff; color: var(--c-sea); }
.foot__about p { max-width: 46ch; }
.foot__h { font: 700 14px/1.2 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: #fff; margin-bottom: 12px; }
.foot__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.foot__list a { display: inline-flex; align-items: center; min-height: 36px; color: #c6dbe8; }
.foot__list a:hover { color: #fff; }
.foot__bar { border-top: 1px solid rgba(255, 255, 255, .1); padding-block: 16px; font-size: 13.5px; color: #93b4ca; }
.foot__bar-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.totop { display: inline-flex; align-items: center; gap: 6px; color: #c6dbe8; min-height: 44px; }
.totop:hover { color: #fff; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
	.lead__main:hover .lead__media img { transform: none; }
}
@media print { .head, .foot, .layout__side, .comments, .toc { display: none !important; } }
