/*
Theme Name: Efuje Ajut

Author: Fetuli Sobar

Description: A modern responsive theme for content websites.
Version: 3.4.5
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nndz-theme
Tags: news, blog, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ── CSS Variables – layout/spacing only (colors injected by PHP via wp_add_inline_style) ── */
:root {
    --radius: 8px;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, .06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, .14);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

    /* Layout Spacing & Radius */
    --section-gap: 80px;
    --card-radius-lg: 16px;
    --container-width: 1240px;

    /* Color fallbacks – overridden by PHP inline style */
    --color-primary: #e63946;
    --color-secondary: #1a1a2e;
    --color-accent: #f0a500;
    --color-bg: #f4f4f6;
    --color-surface: #ffffff;
    --color-text: #2d2d2d;
    --color-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-nav-bg: #1a1a2e;
    --color-nav-text: #ffffff;
    --color-nav-hover: #e63946;
    --color-breaking-bg: #e63946;
    --color-breaking-text: #ffffff;
    --color-footer-bg: #0f0f1a;
    --color-footer-text: rgba(255, 255, 255, 0.65);
    --color-footer-heading: #ffffff;
    --color-footer-border: rgba(255, 255, 255, 0.08);
    --color-footer-link: rgba(255, 255, 255, 0.6);
    --color-footer-link-hover: #ffffff;
    --color-badge-bg: #e63946;
    --color-badge-text: #ffffff;
    --color-btn-bg: #e63946;
    --color-btn-text: #ffffff;
    --color-btn-hover-bg: #c1121f;
    --color-link: #e63946;
    --color-link-hover: #c1121f;
    --color-primary-dark: #c1121f;
    --color-primary-light: #f08080;
    --color-primary-subtle: #fde8e9;
    --color-primary-alpha: rgba(230, 57, 70, 0.12);
    --color-section-border: #e63946;
    --gradient-brand: linear-gradient(135deg, #e63946 0%, #f0a500 100%);
    --gradient-dark: linear-gradient(135deg, #1a1a2e 0%, #0d0d1a 100%);
}

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

/* ── Base ── */
body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-link);
    text-decoration: none;
}

a:hover {
    color: var(--color-link-hover);
}

.nndz-ec a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul,
ol {
    padding-left: 1.5em;
}

button {
    font-family: inherit;
}

/* ── Container ── */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Layout ── */
.nndz-kdw {
    padding: 32px 0 48px;
}

.nndz-sct {
    gap: 32px;
    align-items: flex-start;
}

.nndz-mc {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* ── Full-width layout (homepage body layouts) ── */
/* Dùng body.is-fullwidth-layout để override toàn bộ container chain */
body.is-fullwidth-layout .nndz-kdw {
    padding: 0;
}

body.is-fullwidth-layout .nndz-kdw>.container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

body.is-fullwidth-layout .nndz-sct {
    display: block !important;
    gap: 0 !important;
}

body.is-fullwidth-layout .sidebar {
    display: none !important;
}

body.is-fullwidth-layout .nndz-mc {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden;
    padding: 0;
}

/* ── Sidebar widgets ── */
.widget {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.widget-title {
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--color-secondary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary);
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget ul li {
    padding: 7px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: .875rem;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget a {
    color: var(--color-text);
}

.widget a:hover {
    color: var(--color-primary);
}

/* ── Single post content ── */
.nndz-ec {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-text);
}

.nndz-ec p {
    margin-bottom: 1.4em;
}

.nndz-ec h2 {
    font-size: 1.5rem;
    margin: 2em 0 .75em;
    color: var(--color-secondary);
}

.nndz-ec h3 {
    font-size: 1.25rem;
    margin: 1.75em 0 .6em;
    color: var(--color-secondary);
}

.nndz-ec ul,
.nndz-ec ol {
    margin-bottom: 1.4em;
}

.nndz-ec li {
    margin-bottom: .4em;
}

.nndz-ec blockquote {
    border-left: 4px solid var(--color-primary);
    margin: 2em 0;
    padding: 16px 24px;
    background: var(--color-primary-subtle);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: var(--color-muted);
}

.nndz-ec img {
    border-radius: 6px;
    margin: 1.5em 0;
}

.nndz-ec a {
    color: var(--color-primary);
    text-decoration: underline;
}

.nndz-ec code {
    background: var(--color-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: .9em;
    color: var(--color-primary);
}

.nndz-ec pre {
    background: var(--color-secondary);
    color: var(--color-nav-text);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.4em;
    font-size: .9rem;
}

/* ── Post header (single) ── */
.nndz-eh {
    margin-bottom: 28px;
}

.nndz-eh .nndz-et {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--color-secondary);
    margin-bottom: 14px;
}

.nndz-em {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .85rem;
    color: var(--color-muted);
    flex-wrap: wrap;
}

.nndz-em a {
    color: var(--color-muted);
}

.nndz-em a:hover {
    color: var(--color-primary);
}

.nndz-em .nndz-cb {
    display: inline-block;
    padding: 3px 10px;
    background: var(--color-primary);
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-radius: 3px;
}

.post-thumbnail {
    margin-bottom: 28px;
    border-radius: var(--radius);
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
}

/* ── Pagination ── */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    background: var(--color-surface);
    font-size: .875rem;
    font-weight: 500;
    transition: all .2s;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    text-decoration: none;
}

/* ── Post navigation ── */
.post-navigation {
    display: flex;
    gap: 16px;
    margin-top: 40px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
    padding: 16px 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: .875rem;
    transition: border-color .2s;
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation a {
    color: var(--color-text);
    font-weight: 600;
}

.post-navigation a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

/* ── Comments ── */
.comments-area {
    margin-top: 48px;
}

.comments-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border);
}

.comment-author .fn {
    font-weight: 700;
}

.comment-metadata {
    font-size: .8rem;
    color: var(--color-muted);
    margin-bottom: 8px;
}

.comment-content {
    font-size: .9rem;
}

.comment-reply-link {
    font-size: .8rem;
    color: var(--color-primary);
    font-weight: 600;
}

/* ── 404 ── */
.error-404 {
    text-align: center;
    padding: 80px 20px;
}

.error-404 .error-code {
    font-size: 8rem;
    font-weight: 900;
    color: var(--color-border);
    line-height: 1;
}

.error-404 h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--color-secondary);
}

.error-404 p {
    color: var(--color-muted);
    margin-bottom: 24px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 24px;
    border-radius: 6px;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    transition: all .2s;
    border: 2px solid transparent;
    text-decoration: none;
}

.btn--primary {
    background: var(--color-btn-bg);
    color: var(--color-btn-text);
    border-color: var(--color-btn-bg);
}

.btn--primary:hover {
    background: var(--color-btn-hover-bg);
    border-color: var(--color-btn-hover-bg);
    color: var(--color-btn-text);
    text-decoration: none;
}

.btn--outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn--outline:hover {
    background: var(--color-primary);
    color: var(--color-btn-text);
    text-decoration: none;
}

.btn--ghost {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn--ghost:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    text-decoration: none;
}

/* ── Utility ── */
.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;
}

.text-muted {
    color: var(--color-muted);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .nndz-sct {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .post-navigation {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .nndz-kdw {
        padding: 20px 0 32px;
    }
}

/* ── Body Sections Spacing ─────────────────────────────────────────────────────
   Tăng khoảng cách giữa các sections trong body layouts
   và padding bên trong để content không dính sát edge
   ──────────────────────────────────────────────────────────────────────────── */
:root {
    --section-gap: 100px;
    --section-padding-x: 4%;
    --card-gap: 24px;
}

/* Tất cả sections trong body layouts: thêm padding ngang + tăng gap */
body.is-fullwidth-layout .nndz-mc>section,
body.is-fullwidth-layout .nndz-mc>div>section {
    margin-bottom: var(--section-gap);
    padding-left: var(--section-padding-x);
    padding-right: var(--section-padding-x);
}

/* Section đầu tiên (hero) không cần padding ngang */
body.is-fullwidth-layout .nndz-mc>section:first-child {
    padding-left: 0;
    padding-right: 0;
}

/* Padding top/bottom cho sections có background */
body.is-fullwidth-layout .nndz-mc>section[class*="reveal"] {
    padding-top: 48px;
    padding-bottom: 48px;
}

/* Hero sections: không thêm padding top/bottom */
body.is-fullwidth-layout .nndz-mc>section:first-child[class*="hero"] {
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: var(--section-gap);
}

/* ── Category Layout Spacing ───────────────────────────────────────────────────
   Thêm gap giữa cards, padding cho grid
   ──────────────────────────────────────────────────────────────────────────── */

/* Override gap: 0 trong category grids */
[class*="cat-"][class*="__grid"],
[class*="cat-"][class*="__list"] {
    gap: var(--card-gap) !important;
    padding: 24px;
}

/* Cards trong category: thêm border-radius và spacing */
[class*="cat-"][class*="__card"] {
    border-radius: var(--radius);
    overflow: hidden;
}

/* Card body padding tăng */
[class*="cat-"][class*="__card-body"] {
    padding: 16px 20px 20px;
}

/* ── News Grid Spacing (index.php archive) ─────────────────────────────────── */
.nndz-ng {
    gap: var(--card-gap);
    padding: 0;
}

.nndz-ng--3 {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    display: grid;
}

/* ── Body Card Grids — tăng gap cho tất cả grid trong body layouts ──────────── */
[class*="__grid"] {
    gap: var(--card-gap);
}

/* Responsive spacing */
@media (max-width: 768px) {
    :root {
        --section-gap: 60px;
        --section-padding-x: 16px;
        --card-gap: 16px;
    }
}

@media (max-width: 480px) {
    :root {
        --section-gap: 40px;
        --section-padding-x: 12px;
        --card-gap: 12px;
    }
}