/*
Theme Name: Phước Đông Tin Tức
Theme URI: https://phuocdongnewcity.com/tin-tuc/
Author: Minh Phú Land
Description: Theme tin tức cho Phước Đông New City. Dùng lại token màu, font và công thức scale-to-fit của landing page nên đọc bài thấy liền mạch với trang chủ. Theme này CHỈ phục vụ /tin-tuc/ — landing page vẫn là bản React tĩnh ở web root.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: phuocdong-tin
Tags: news, minimal
*/

/* ==========================================================================
   Font — dùng lại file có sẵn ở web root của landing (/fonts/).
   Cùng origin nên trỏ đường dẫn tuyệt đối được, KHÔNG copy sang theme.
   ========================================================================== */
@font-face {
    font-family: "SVN-Super Display";
    src: url("/fonts/SVN-SuperDisplay-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "SVN-Super Display";
    src: url("/fonts/SVN-SuperDisplay-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "SVN-Mabry Pro";
    src: url("/fonts/SVN-MabryPro-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   Token — copy nguyên từ tailwind.config.js của landing
   ========================================================================== */
:root {
    --forest-900: #14301a;
    --forest-800: #1a3a20;
    --forest-700: #2e5233;
    --cream-100: #f4e8d4;
    --cream-50: #fbf5ea;
    --gold-900: #f5cb66;
    --gold-500: #c2a04b;
    --gold-300: #d9c188;
    --ink-900: #26492e;
    --ink-700: #3a2e22;
    --radius: 0.75rem;
}

/* ==========================================================================
   SCALE-TO-FIT — cùng công thức với src/index.css của landing.
   Mọi kích thước bên dưới đo bằng rem nên tự co giãn theo bề rộng màn hình,
   layout KHÔNG reflow. 1 mốc đổi layout duy nhất ở lg(1024px).
   ========================================================================== */
html {
    font-size: clamp(12px, 1vw, 20px);
    scroll-behavior: smooth;
    overflow-x: clip;
}
@media (max-width: 1023.98px) {
    html {
        font-size: clamp(13px, 3.9vw, 17px);
    }
}

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

body {
    margin: 0;
    background: var(--cream-50);
    color: var(--ink-900);
    font-family: "SVN-Mabry Pro", system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
}

h1,
h2,
h3,
h4 {
    font-family: "SVN-Super Display", Georgia, serif;
    font-weight: 500;
    line-height: 1.3;
    margin: 0;
}

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

a {
    color: var(--forest-700);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

/* Container khớp landing: max 1600px, px-6 mobile / px-[4.5rem] desktop */
.container {
    width: 100%;
    max-width: 1600px;
    margin-inline: auto;
    padding-inline: 1.5rem;
}
@media (min-width: 1024px) {
    .container {
        padding-inline: 4.5rem;
    }
}

.eyebrow {
    font-family: "SVN-Mabry Pro", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    margin: 0;
}
@media (min-width: 1024px) {
    .eyebrow {
        font-size: 0.875rem;
    }
}

/* Gradient vàng cho heading trên nền xanh — copy từ .gradient-gold của landing.
   padding-block để background-clip:text không cắt dấu thanh tiếng Việt. */
.gradient-gold {
    background-image: linear-gradient(
        to right,
        #f4e8d4 0%,
        #f5cb66 30%,
        #f5cb66 70%,
        #f4e8d4 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-block: 0.2em 0.14em;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
}
.skip-link:focus {
    left: 1rem;
    top: 1rem;
    z-index: 60;
    background: var(--gold-900);
    color: var(--forest-900);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

/* ==========================================================================
   Header — khớp Header.tsx của landing: fixed, backdrop-blur, logo trái,
   nút MENU phải. data-tone do assets/theme.js đặt theo section bên dưới.
   ========================================================================== */
.site-header {
    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid;
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    transition: transform 0.5s, background-color 0.5s, border-color 0.5s,
        box-shadow 0.5s;
}
.site-header[data-tone="dark"] {
    background: rgba(20, 48, 26, 0.35);
    border-color: rgba(255, 255, 255, 0.1);
}
.site-header[data-tone="light"] {
    background: rgba(244, 232, 212, 0.45);
    border-color: rgba(255, 255, 255, 0.3);
}
.site-header.is-scrolled {
    box-shadow: 0 4px 6px -1px rgba(38, 73, 46, 0.1);
}
.site-header.is-hidden {
    transform: translateY(-100%);
}

/* Scrim gradient — chỉ khi tone tối, giúp logo trắng nổi trên ảnh sáng */
.site-header__scrim {
    pointer-events: none;
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 7rem;
    opacity: 0;
    transition: opacity 0.5s;
    background: linear-gradient(to bottom, rgba(14, 30, 16, 0.55) 0%, transparent 100%);
}
.site-header[data-tone="dark"] .site-header__scrim {
    opacity: 1;
}

.site-header__bar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    max-width: 1600px;
    margin-inline: auto;
    padding: 0.25rem 1.5rem;
}
@media (min-width: 1024px) {
    .site-header__bar {
        padding-inline: 4.5rem;
    }
}

.site-header__logo {
    flex-shrink: 0;
    line-height: 0;
}
.site-header__logo img {
    height: 2rem;
    width: auto;
    transition: filter 0.3s;
}
@media (min-width: 1024px) {
    .site-header__logo img {
        height: 2.5rem;
    }
}
/* logo-main.png là bản màu → đảo thành trắng khi nền tối, như landing */
.site-header[data-tone="dark"] .site-header__logo img {
    filter: brightness(0) invert(1);
}

.site-header__menu {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: "SVN-Mabry Pro", sans-serif;
    font-size: 0.875rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: color 0.2s;
}
.site-header[data-tone="dark"] .site-header__menu {
    color: #fff;
}
.site-header[data-tone="light"] .site-header__menu {
    color: var(--forest-800);
}
.site-header__menu:hover {
    color: var(--gold-500);
}
.site-header__menu svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* ==========================================================================
   Drawer — khớp Sheet bên phải của landing
   ========================================================================== */
.drawer {
    padding: 0;
    border: 0;
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100%;
    background: transparent;
    overflow: hidden;
}
.drawer::backdrop {
    background: rgba(14, 30, 16, 0.6);
    opacity: 0;
    transition: opacity 0.25s;
}
.drawer.is-open::backdrop {
    opacity: 1;
}
.drawer__panel {
    position: absolute;
    inset-block: 0;
    right: 0;
    width: 18.75rem;
    max-width: 85vw;
    background: var(--forest-900);
    color: var(--cream-50);
    border-left: 1px solid var(--forest-700);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
}
.drawer.is-open .drawer__panel {
    transform: translateX(0);
}
@media (prefers-reduced-motion: reduce) {
    .drawer__panel,
    .drawer::backdrop {
        transition: none;
    }
}

.drawer__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}
.drawer__logo {
    line-height: 0;
}
.drawer__logo img {
    height: 2.5rem;
    width: auto;
}
.drawer__close {
    background: none;
    border: 0;
    color: var(--cream-50);
    cursor: pointer;
    padding: 0.5rem;
    margin: -0.5rem -0.5rem 0 0;
    min-width: 2.75rem;
    min-height: 2.75rem;
    display: grid;
    place-items: center;
    transition: color 0.2s;
}
.drawer__close:hover {
    color: var(--gold-300);
}
.drawer__close svg {
    width: 1.25rem;
    height: 1.25rem;
}

.drawer__nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.drawer__nav a {
    font-family: "SVN-Mabry Pro", sans-serif;
    font-size: 1.125rem;
    padding-block: 0.625rem;
    color: rgba(251, 245, 234, 0.9);
    text-decoration: none;
    transition: color 0.2s;
}
.drawer__nav a:hover {
    color: var(--gold-300);
}

.drawer__foot {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.drawer__phone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--cream-50);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}
.drawer__phone:hover {
    color: var(--gold-300);
}
.drawer__phone svg {
    width: 1rem;
    height: 1rem;
}
.drawer__cta {
    width: 100%;
}

/* ==========================================================================
   Dải tiêu đề trang — padding-top chừa chỗ cho header fixed
   ========================================================================== */
.page-hero {
    background: var(--forest-800);
    color: var(--cream-50);
    padding-block: 5rem 2.5rem;
    text-align: center;
}
@media (min-width: 1024px) {
    .page-hero {
        padding-block: 7rem 4rem;
    }
}
.page-hero .eyebrow {
    color: var(--gold-300);
    margin-bottom: 0.75rem;
}
.page-hero h1 {
    font-size: 1.875rem;
}
@media (min-width: 1024px) {
    .page-hero h1 {
        font-size: 2.5rem;
    }
}
.page-hero__desc {
    margin: 1rem auto 0;
    max-width: 44rem;
    color: rgba(251, 245, 234, 0.8);
    font-size: 1rem;
}

/* ==========================================================================
   Grid danh sách bài
   ========================================================================== */
.main {
    padding-block: 3rem;
}
@media (min-width: 1024px) {
    .main {
        padding-block: 4rem;
    }
}
/* single.php không có .page-hero → main nằm ngay dưới header fixed, phải chừa chỗ */
.main--flush {
    padding-top: 5.5rem;
}
@media (min-width: 1024px) {
    .main--flush {
        padding-top: 7.5rem;
    }
}

.post-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
    .post-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2rem;
    }
}

.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(38, 73, 46, 0.06);
    border: 1px solid rgba(38, 73, 46, 0.08);
    transition: box-shadow 0.25s, transform 0.25s;
}
.card:hover {
    box-shadow: 0 10px 30px rgba(38, 73, 46, 0.12);
    transform: translateY(-2px);
}
.card__thumb {
    aspect-ratio: 4 / 3;
    width: 100%;
    object-fit: cover;
    background: var(--cream-100);
}
.card__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}
.card__date {
    font-size: 0.875rem;
    color: var(--gold-500);
    letter-spacing: 0.04em;
}
.card__title {
    font-size: 1.25rem;
}
.card__title a {
    color: var(--ink-900);
    text-decoration: none;
}
.card__title a:hover {
    color: var(--forest-700);
}
.card__excerpt {
    font-size: 1rem;
    color: rgba(38, 73, 46, 0.75);
    margin: 0;
}
.card__more {
    margin-top: auto;
    padding-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--forest-700);
    font-weight: 700;
    text-decoration: none;
}
.card__more:hover {
    color: var(--gold-500);
}

.empty {
    text-align: center;
    padding-block: 4rem;
    color: rgba(38, 73, 46, 0.7);
}

/* Phân trang */
.pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.pagination .page-numbers {
    min-width: 2.75rem;
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-inline: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid rgba(38, 73, 46, 0.15);
    color: var(--forest-700);
    text-decoration: none;
    font-size: 0.875rem;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: var(--forest-800);
    border-color: var(--forest-800);
    color: var(--cream-50);
}

/* ==========================================================================
   Bài viết
   ========================================================================== */
.article {
    max-width: 52rem;
    margin-inline: auto;
}
.article__meta {
    font-size: 0.875rem;
    color: var(--gold-500);
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}
.article__title {
    font-size: 1.875rem;
    color: var(--ink-900);
}
@media (min-width: 1024px) {
    .article__title {
        font-size: 2.5rem;
    }
}
.article__thumb {
    margin-top: 1.75rem;
    width: 100%;
    border-radius: var(--radius);
    object-fit: cover;
}
.article__content {
    margin-top: 1.75rem;
    font-size: 1rem;
    line-height: 1.8;
}
.article__content > * + * {
    margin-top: 1.125rem;
}
.article__content h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
}
.article__content h3 {
    font-size: 1.25rem;
    margin-top: 1.75rem;
}
.article__content img,
.article__content iframe {
    border-radius: var(--radius);
    max-width: 100%;
}
.article__content iframe {
    aspect-ratio: 16 / 9;
    width: 100%;
    height: auto;
}
.article__content blockquote {
    margin-inline: 0;
    padding-left: 1.25rem;
    border-left: 3px solid var(--gold-500);
    color: rgba(38, 73, 46, 0.8);
    font-style: italic;
}
.article__content ul,
.article__content ol {
    padding-left: 1.5rem;
}
.article__content figcaption {
    font-size: 0.875rem;
    color: rgba(38, 73, 46, 0.6);
    text-align: center;
    margin-top: 0.5rem;
}

/* CTA cuối bài → đưa người đọc về form đăng ký của landing */
.article-cta {
    margin-top: 3rem;
    background: var(--forest-800);
    color: var(--cream-50);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
}
@media (min-width: 1024px) {
    .article-cta {
        padding: 2.5rem;
    }
}
.article-cta h2 {
    font-size: 1.5rem;
}
.article-cta p {
    margin: 0.75rem auto 0;
    max-width: 34rem;
    color: rgba(251, 245, 234, 0.8);
    font-size: 1rem;
}
.article-cta__actions {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.75rem 2rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn--gold {
    background: var(--gold-900);
    color: var(--forest-900);
    border: 2px solid var(--gold-900);
}
.btn--gold:hover {
    background: transparent;
    color: var(--gold-900);
}
.btn--ghost {
    border: 2px solid var(--gold-300);
    color: var(--gold-300);
}
.btn--ghost:hover {
    background: var(--gold-300);
    color: var(--forest-900);
}

.post-nav {
    margin-top: 2.5rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.875rem;
}
.post-nav a {
    color: var(--forest-700);
    text-decoration: none;
    max-width: 45%;
}
.post-nav a:hover {
    color: var(--gold-500);
}

/* ==========================================================================
   Footer — khớp Footer.tsx của landing: 4 cột
   logo | liên hệ | nav | newsletter+social, divider dọc giữa cột 2-3 và 3-4.
   ========================================================================== */
.site-footer {
    background: var(--forest-900);
    color: var(--cream-50);
}
.site-footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-block: 3rem;
}
@media (min-width: 1024px) {
    .site-footer__grid {
        grid-template-columns: 1fr 1.4fr 1.1fr 1.6fr;
        gap: 0;
        padding-block: 4rem;
    }
    .site-footer__brand {
        padding-right: 2rem;
    }
    .site-footer__contact {
        padding-inline: 2rem;
    }
    .site-footer__nav,
    .site-footer__signup {
        border-left: 1px solid rgba(251, 245, 234, 0.2);
        padding-inline: 2rem;
    }
    .site-footer__signup {
        padding-right: 0;
    }
}

.site-footer__brand img {
    width: 11rem;
    height: auto;
}
@media (min-width: 1024px) {
    .site-footer__brand img {
        width: 100%;
    }
}

.site-footer h2 {
    font-size: 1.25rem;
    color: var(--gold-300);
}

.site-footer ul {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}
.site-footer__contact li {
    font-size: 0.875rem;
    color: rgba(251, 245, 234, 0.8);
    margin-bottom: 0.5rem;
}

.site-footer__nav ul {
    margin: 0;
}
.site-footer__nav li {
    margin-bottom: 0.625rem;
}
.site-footer__nav a {
    font-size: 0.875rem;
    color: rgba(251, 245, 234, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}
.site-footer__nav a:hover {
    color: var(--gold-300);
}

.site-footer__follow {
    margin-top: 2rem;
}
.site-footer__socials {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.site-footer__socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius);
    background: var(--forest-700);
    color: var(--cream-50);
    transition: background-color 0.2s, color 0.2s;
}
.site-footer__socials a:hover {
    background: var(--gold-500);
    color: var(--forest-900);
}
.site-footer__socials svg {
    width: 1rem;
    height: 1rem;
}

/* Newsletter — gạch chân dưới giống form footer landing */
.newsletter {
    margin-top: 1rem;
}
.newsletter__hp {
    position: absolute;
    left: -9999px;
}
.newsletter__row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(251, 245, 234, 0.3);
}
.newsletter input[type="email"] {
    flex: 1;
    background: transparent;
    border: 0;
    outline: none;
    padding-block: 0.75rem;
    color: var(--cream-50);
    font-family: inherit;
    font-size: 1rem;
    min-width: 0;
}
.newsletter input[type="email"]::placeholder {
    color: rgba(251, 245, 234, 0.5);
}
.newsletter button {
    display: grid;
    place-items: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.5rem;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--gold-300);
    transition: color 0.2s;
}
.newsletter button:hover:not(:disabled) {
    color: var(--gold-500);
}
.newsletter button:disabled {
    opacity: 0.5;
    cursor: default;
}
.newsletter button svg {
    width: 1.25rem;
    height: 1.25rem;
}
.newsletter__msg {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    min-height: 1.25rem;
}
.newsletter__msg[data-state="ok"] {
    color: var(--gold-300);
}
.newsletter__msg[data-state="err"] {
    color: #f08a80;
}

.site-footer__bottom {
    border-top: 1px solid rgba(251, 245, 234, 0.15);
    padding-block: 1.25rem;
    font-size: 0.875rem;
    color: rgba(251, 245, 234, 0.65);
    text-align: center;
}
