/* =========================================================
   FINANCE FOR CAMBODIANS
   Editorial / Wikipedia-inspired design system
   Visual-only stylesheet
   Existing HTML + JavaScript logic remains unchanged
   ========================================================= */


/* =========================================================
   1. DESIGN TOKENS
   ========================================================= */

:root {
    --blue: #3366cc;
    --blue-dark: #1f4f9c;
    --blue-soft: #eef4ff;

    --red: #b32424;
    --red-soft: #fff3f3;

    --gold: #b58a2a;

    --page: #f8f9fa;
    --surface: #ffffff;
    --surface-soft: #fdfdfd;

    --text: #202122;
    --text-soft: #404244;
    --muted: #72777d;

    --border: #c8ccd1;
    --border-light: #eaecf0;

    --hover: #f8f9fa;

    --max-width: 1240px;
    --reading-width: 900px;

    --header-height: 58px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    --space-9: 56px;
    --space-10: 72px;
}


/* =========================================================
   2. RESET
   ========================================================= */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;

    background: var(--page);
    color: var(--text);

    font-family:
        "Hanuman",
        "Noto Sans Khmer",
        "Khmer OS",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-weight: 400;
    line-height: 1.85;

    font-size: clamp(15px, 0.22vw + 14px, 17px);

    text-rendering: optimizeLegibility;
}

[hidden] {
    display: none !important;
}

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

button,
input,
textarea,
select {
    font: inherit;
}

button {
    font-weight: 400;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

::selection {
    background: #dbe7ff;
    color: var(--text);
}

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}


/* =========================================================
   3. GLOBAL TYPOGRAPHY
   ========================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    margin-bottom: 0.5em;

    color: var(--text);

    font-weight: 400;
    line-height: 1.45;

    overflow-wrap: anywhere;
}

h1 {
    font-size: clamp(28px, 4vw, 42px);
}

h2 {
    font-size: clamp(22px, 2.5vw, 30px);
}

h3 {
    font-size: clamp(18px, 2vw, 22px);
}

p {
    margin-top: 0;
}

strong,
b {
    font-weight: 400;
}


/* =========================================================
   4. HEADER / NAVIGATION
   ========================================================= */

header {
    position: sticky;
    top: 0;
    z-index: 50;

    background: rgba(255, 255, 255, 0.97);

    border-bottom: 1px solid var(--border);

    box-shadow: none;

    backdrop-filter: blur(8px);
}

.navbar {
    width: min(100%, var(--max-width));

    min-height: var(--header-height);

    margin: 0 auto;
    padding: 8px clamp(16px, 3vw, 28px);

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.logo {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;

    color: var(--text);

    font-size: clamp(17px, 1.5vw, 21px);
    line-height: 1.3;

    font-weight: 400;

    white-space: nowrap;
}

.logo img {
    width: auto;
    height: 40px;
}

.logo:hover {
    color: var(--blue);
    text-decoration: none;
}

.nav-links {
    list-style: none;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: clamp(14px, 2vw, 28px);

    margin: 0;
    padding: 0;
}

.nav-links a {
    display: block;

    padding: 8px 0;

    color: var(--text-soft);

    border-bottom: 2px solid transparent;

    font-size: clamp(14px, 1vw, 16px);

    line-height: 1.4;

    transition:
        color 0.15s ease,
        border-color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.current {
    color: var(--blue);

    border-bottom-color: var(--blue);

    text-decoration: none;
}

/* =========================================================
   5. HERO
   ========================================================= */

.hero {
    background: var(--surface);

    color: var(--text);

    text-align: center;

    padding:
        clamp(48px, 7vw, 84px)
        clamp(18px, 4vw, 32px)
        clamp(42px, 6vw, 68px);

    border-bottom: 1px solid var(--border);
}

.hero.small {
    padding:
        clamp(32px, 5vw, 52px)
        clamp(18px, 4vw, 32px)
        clamp(30px, 4vw, 46px);
}

.hero h1 {
    max-width: 900px;

    margin: 0 auto 12px;

    color: var(--text);

    font-size: clamp(28px, 4vw, 42px);

    font-weight: 400;

    line-height: 1.4;
}

.hero p {
    max-width: 760px;

    margin: 0 auto 28px;

    color: var(--muted);

    font-size: clamp(15px, 1.4vw, 18px);

    line-height: 1.8;
}


/* =========================================================
   6. SEARCH
   ========================================================= */

.search-box {
    width: min(100%, 680px);

    margin: 0 auto;

    display: flex;
    align-items: stretch;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 2px;

    overflow: hidden;

    box-shadow: none;
}

.search-box:focus-within {
    border-color: var(--blue);

    box-shadow: 0 0 0 1px var(--blue);
}

.search-box input {
    flex: 1 1 auto;

    min-width: 0;

    padding:
        11px
        14px;

    border: 0;
    outline: 0;

    background: var(--surface);

    color: var(--text);

    font-size: clamp(14px, 1.2vw, 16px);

    line-height: 1.5;
}

.search-box input::placeholder {
    color: #8a8f94;
}

.search-box button {
    flex: 0 0 auto;

    min-width: 92px;

    padding: 0 18px;

    border: 0;
    border-left: 1px solid var(--border);

    background: #f8f9fa;

    color: var(--text);

    font-size: clamp(14px, 1.1vw, 15px);

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.search-box button:hover {
    background: var(--blue);

    color: #fff;
}


/* =========================================================
   7. HERO ACTIONS
   ========================================================= */

.hero-actions {
    display: flex;

    justify-content: center;
    align-items: center;

    flex-wrap: wrap;

    gap: 10px;

    margin-top: 18px;
}

.btn-cta,
.btn-ghost {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding: 7px 16px;

    border-radius: 2px;

    font-size: clamp(14px, 1.1vw, 15px);

    line-height: 1.5;

    font-weight: 400;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.btn-cta {
    background: var(--blue);

    border: 1px solid var(--blue);

    color: #fff;
}

.btn-cta:hover {
    background: var(--blue-dark);

    border-color: var(--blue-dark);

    color: #fff;

    text-decoration: none;
}

.btn-ghost {
    background: var(--surface);

    border: 1px solid var(--border);

    color: var(--text);
}

.btn-ghost:hover {
    background: var(--hover);

    border-color: #a2a9b1;

    color: var(--text);

    text-decoration: none;
}


/* =========================================================
   8. MAIN CONTAINER
   ========================================================= */

.container {
    width: min(100%, var(--max-width));

    margin: 0 auto;

    padding:
        clamp(26px, 4vw, 42px)
        clamp(16px, 3vw, 28px)
        clamp(42px, 6vw, 70px);
}


/* =========================================================
   9. CATEGORY NAVIGATION
   ========================================================= */

.categories-bar {
    display: flex;

    gap: 6px;

    overflow-x: auto;

    padding: 0 0 10px;

    margin: 0 0 30px;

    border-bottom: 1px solid var(--border-light);

    scrollbar-width: thin;

    scrollbar-color: #c8ccd1 transparent;
}

.categories-bar::-webkit-scrollbar {
    height: 5px;
}

.categories-bar::-webkit-scrollbar-track {
    background: transparent;
}

.categories-bar::-webkit-scrollbar-thumb {
    background: #c8ccd1;

    border-radius: 10px;
}

.cat-chip {
    flex: 0 0 auto;

    appearance: none;

    padding: 6px 12px;

    background: transparent;

    border: 1px solid transparent;

    border-radius: 2px;

    color: var(--text-soft);

    font-size: clamp(13px, 1vw, 15px);

    line-height: 1.5;

    cursor: pointer;

    white-space: nowrap;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.cat-chip:hover {
    background: var(--hover);

    border-color: var(--border);

    color: var(--blue);
}

.cat-chip.active {
    background: var(--blue-soft);

    border-color: #c8d8f5;

    color: var(--blue);
}


/* =========================================================
   10. SECTION HEADER
   ========================================================= */

.section-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    flex-wrap: wrap;

    gap: 14px;

    margin-bottom: 8px;

    padding-bottom: 10px;

    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    margin: 0;

    font-size: clamp(22px, 2.5vw, 28px);

    font-weight: 400;
}

.tabs {
    display: flex;

    gap: 0;

    background: transparent;

    border: 1px solid var(--border);

    border-radius: 2px;

    padding: 0;
}

.tab-btn {
    appearance: none;

    border: 0;

    border-right: 1px solid var(--border);

    background: var(--surface);

    color: var(--muted);

    padding:
        6px
        13px;

    font-size: clamp(13px, 1vw, 14px);

    line-height: 1.5;

    cursor: pointer;
}

.tab-btn:last-child {
    border-right: 0;
}

.tab-btn:hover {
    background: var(--hover);

    color: var(--text);
}

.tab-btn.active {
    background: var(--blue-soft);

    color: var(--blue);
}

.result-count {
    margin: 0 0 18px;

    color: var(--muted);

    font-size: 13px;
}


/* =========================================================
   11. ARTICLE GRID
   ========================================================= */

.article-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap:
        clamp(18px, 2.5vw, 28px);
}


/* =========================================================
   12. ARTICLE CARDS
   ========================================================= */

.article-card {
    min-width: 0;

    display: flex;

    flex-direction: column;

    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 2px;

    box-shadow: none;

    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.article-card:hover {
    transform: none;

    border-color: #a2a9b1;

    box-shadow: none;
}

.thumbnail-wrapper {
    position: relative;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    background: #eaecf0;

    border-bottom: 1px solid var(--border);
}

.thumbnail-wrapper img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: opacity 0.15s ease;
}

.article-card:hover .thumbnail-wrapper img {
    opacity: 0.94;
}

.watermark {
    position: absolute;

    top: 10px;
    right: 10px;

    background: rgba(255, 255, 255, 0.94);

    color: var(--text);

    padding: 3px 7px;

    border: 1px solid var(--border);

    border-radius: 2px;

    box-shadow: none;

    font-size: 11px;

    font-weight: 400;
}


/* =========================================================
   13. ARTICLE CARD CONTENT
   ========================================================= */

.article-content-box {
    flex: 1;

    display: flex;

    flex-direction: column;

    gap: 8px;

    padding:
        16px
        16px
        18px;
}

.article-category-tag {
    align-self: flex-start;

    padding: 2px 7px;

    background: transparent;

    border-left: 3px solid var(--blue);

    color: var(--blue);

    border-radius: 0;

    font-size: 12px;

    line-height: 1.5;
}

.article-content-box h3 {
    margin: 0;

    color: var(--text);

    font-size: clamp(17px, 1.5vw, 20px);

    line-height: 1.55;

    font-weight: 400;
}

.article-content-box h3 a {
    color: inherit;
}

.article-content-box h3 a:hover {
    color: var(--blue);

    text-decoration: underline;
}

.article-desc {
    margin: 0;

    color: var(--text-soft);

    font-size: clamp(13px, 1vw, 15px);

    line-height: 1.75;
}

.article-meta {
    margin-top: auto;

    padding-top: 10px;

    border-top: 1px solid var(--border-light);

    color: var(--muted);

    font-size: 12px;

    line-height: 1.6;
}

.status-msg {
    grid-column: 1 / -1;

    padding: 40px 20px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 2px;

    color: var(--muted);

    text-align: center;
}

.noscript-list {
    margin: 0;

    padding: 18px 22px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 2px;
}


/* =========================================================
   14. SEE ALL
   ========================================================= */

.see-all-container {
    margin-top: 30px;

    text-align: center;
}

.see-all-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding: 7px 16px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 2px;

    color: var(--blue);

    font-size: 14px;

    line-height: 1.5;
}

.see-all-btn:hover {
    background: var(--blue-soft);

    border-color: #b8cbe9;

    color: var(--blue);

    text-decoration: none;
}


/* =========================================================
   15. AD SLOTS
   ========================================================= */

.ad-slot {
    width: min(100%, var(--max-width));

    margin:
        16px
        auto;

    padding:
        0
        clamp(16px, 3vw, 28px);

    text-align: center;
}

.ad-slot a {
    display: inline-block;

    max-width: 100%;
}

.ad-slot img {
    display: block;

    max-width: 100%;

    margin: 0 auto;

    border: 1px solid var(--border);

    border-radius: 2px;
}

.ad-label {
    display: block;

    margin-bottom: 3px;

    color: var(--muted);

    font-size: 10px;

    line-height: 1.4;
}

.ad-slot.ad-in-feed {
    grid-column: 1 / -1;

    margin: 0;

    padding: 0;
}

.ad-slot.ad-sidebar {
    margin: 0;

    padding: 0;
}


/* =========================================================
   16. CTA BOX
   ========================================================= */

.cta-box {
    margin:
        clamp(34px, 5vw, 52px)
        0;

    padding:
        clamp(26px, 4vw, 38px)
        clamp(20px, 4vw, 36px);

    background: var(--surface);

    border: 1px solid var(--border);

    border-left: 4px solid var(--blue);

    border-radius: 2px;

    color: var(--text);

    text-align: center;

    box-shadow: none;
}

.cta-box h2 {
    margin: 0 0 7px;

    font-size: clamp(21px, 2.5vw, 28px);

    font-weight: 400;
}

.cta-box p {
    max-width: 700px;

    margin: 0 auto 18px;

    color: var(--muted);

    font-size: clamp(14px, 1.2vw, 16px);
}

.cta-box .btn-cta {
    margin-top: 2px;
}


/* =========================================================
   17. ARTICLE PAGE LAYOUT
   ========================================================= */

.article-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(240px, 300px);

    align-items: start;

    gap:
        clamp(24px, 4vw, 42px);
}


/* =========================================================
   18. BREADCRUMB
   ========================================================= */

.breadcrumb {
    margin-bottom: 12px;

    color: var(--muted);

    font-size: 13px;

    line-height: 1.6;
}

.breadcrumb a {
    color: var(--blue);
}


/* =========================================================
   19. FULL ARTICLE
   ========================================================= */

.article-full {
    min-width: 0;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 2px;

    padding:
        clamp(22px, 4vw, 42px);

    box-shadow: none;
}

.art-title {
    margin:
        0
        0
        7px;

    color: var(--text);

    font-size: clamp(27px, 4vw, 40px);

    font-weight: 400;

    line-height: 1.4;
}

.art-meta-info {
    margin-bottom: 20px;

    color: var(--muted);

    font-size: 13px;

    line-height: 1.6;
}

.art-thumb {
    display: block;

    width: 100%;

    aspect-ratio: 16 / 9;

    object-fit: cover;

    margin-bottom: 24px;

    border: 1px solid var(--border);

    border-radius: 2px;
}

.art-description {
    margin-bottom: 22px;

    padding:
        14px
        16px;

    background: #f8f9fa;

    border-left: 3px solid var(--blue);

    color: var(--text-soft);

    font-size: clamp(16px, 1.5vw, 19px);

    line-height: 1.8;

    font-weight: 400;
}


/* =========================================================
   20. ARTICLE BODY
   ========================================================= */

.article-body {
    max-width: var(--reading-width);

    color: var(--text);

    font-size: clamp(15px, 1.15vw, 17px);

    line-height: 1.95;
}

.article-body h2 {
    margin:
        34px
        0
        12px;

    padding-bottom: 6px;

    border-bottom: 1px solid var(--border);

    font-size: clamp(21px, 2.3vw, 27px);

    font-weight: 400;
}

.article-body h3 {
    margin:
        26px
        0
        8px;

    font-size: clamp(18px, 1.8vw, 22px);

    font-weight: 400;
}

.article-body p {
    margin:
        0
        0
        16px;
}

.article-body ul,
.article-body ol {
    margin:
        0
        0
        18px;

    padding-left: 28px;
}

.article-body li {
    margin-bottom: 6px;
}

.article-body a {
    color: var(--blue);

    text-decoration: underline;

    text-decoration-thickness: 1px;

    text-underline-offset: 2px;
}


/* =========================================================
   21. SHARE BAR
   ========================================================= */

.share-bar {
    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 7px;

    margin-top: 30px;

    padding-top: 16px;

    border-top: 1px solid var(--border);
}

.share-bar a,
.share-bar button {
    appearance: none;

    padding:
        5px
        11px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 2px;

    color: var(--text-soft);

    font-size: 13px;

    line-height: 1.5;

    cursor: pointer;
}

.share-bar a:hover,
.share-bar button:hover {
    background: var(--hover);

    border-color: #a2a9b1;

    color: var(--blue);

    text-decoration: none;
}


/* =========================================================
   22. RELATED ARTICLES
   ========================================================= */

.related {
    margin-top: 34px;
}

.related h2 {
    margin:
        0
        0
        16px;

    padding:
        0
        0
        8px;

    border-left: 0;

    border-bottom: 1px solid var(--border);

    font-size: clamp(21px, 2.3vw, 27px);

    font-weight: 400;
}

.related .article-grid {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}


/* =========================================================
   23. SIDEBAR
   ========================================================= */

.sidebar {
    position: sticky;

    top: 78px;

    display: flex;

    flex-direction: column;

    gap: 18px;
}

.side-box {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 2px;

    padding: 16px;

    box-shadow: none;
}

.side-box h2 {
    margin:
        0
        0
        8px;

    padding-bottom: 7px;

    border-bottom: 1px solid var(--border);

    font-size: clamp(17px, 1.5vw, 20px);

    font-weight: 400;
}

.mini-item {
    display: flex;

    align-items: flex-start;

    gap: 10px;

    padding:
        10px
        0;

    border-bottom: 1px solid var(--border-light);
}

.mini-item:last-child {
    border-bottom: 0;
}

.mini-item img {
    flex: 0 0 auto;

    width: 82px;
    height: 52px;

    object-fit: cover;

    border: 1px solid var(--border);

    border-radius: 2px;
}

.mini-item span {
    color: var(--text-soft);

    font-size: 13px;

    line-height: 1.65;
}

.mini-item:hover span {
    color: var(--blue);
}


/* =========================================================
   24. ABOUT / CONTACT PAGES
   ========================================================= */

.page-content {
    width: min(100%, 900px);

    margin: 0 auto;
}

.page-content h2 {
    margin:
        32px
        0
        10px;

    padding-bottom: 7px;

    border-bottom: 1px solid var(--border);

    font-size: clamp(21px, 2.4vw, 28px);

    font-weight: 400;
}

.page-content p {
    margin-bottom: 16px;

    color: var(--text-soft);

    line-height: 1.9;
}


/* =========================================================
   25. INFORMATION CARDS
   ========================================================= */

.info-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 16px;

    margin:
        24px
        0;
}

.info-card {
    padding: 18px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 2px;

    box-shadow: none;
}

.info-card h3 {
    margin-bottom: 7px;

    color: var(--text);

    font-size: clamp(17px, 1.5vw, 20px);

    font-weight: 400;
}

.info-card p {
    margin: 0;

    color: var(--muted);

    font-size: 14px;

    line-height: 1.75;
}


/* =========================================================
   26. CONTACT FORM
   ========================================================= */

.contact-form {
    display: flex;

    flex-direction: column;

    gap: 14px;

    padding:
        clamp(20px, 4vw, 30px);

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 2px;

    box-shadow: none;
}

.contact-form label {
    color: var(--text);

    font-size: 14px;

    font-weight: 400;
}

.contact-form input,
.contact-form textarea {
    width: 100%;

    padding:
        10px
        12px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 2px;

    color: var(--text);

    font-size: clamp(14px, 1.1vw, 16px);

    line-height: 1.6;

    outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--blue);

    box-shadow: 0 0 0 1px var(--blue);
}

.contact-form textarea {
    min-height: 150px;

    resize: vertical;
}

.contact-form button {
    align-self: flex-start;

    padding:
        8px
        18px;

    background: var(--blue);

    border: 1px solid var(--blue);

    border-radius: 2px;

    color: #fff;

    font-size: 14px;

    font-weight: 400;

    cursor: pointer;
}

.contact-form button:hover {
    background: var(--blue-dark);

    border-color: var(--blue-dark);
}


/* =========================================================
   27. FOOTER
   ========================================================= */

footer {
    margin-top: 20px;

    padding:
        42px
        clamp(18px, 4vw, 30px);

    background: #eaecf0;

    border-top: 1px solid var(--border);

    color: var(--text-soft);

    text-align: center;
}

.footer-content {
    width: min(100%, 900px);

    margin: 0 auto;
}

.footer-content h3 {
    margin-bottom: 7px;

    color: var(--text);

    font-size: clamp(18px, 2vw, 22px);

    font-weight: 400;
}

.footer-content p {
    margin-bottom: 10px;

    color: var(--muted);

    font-size: 14px;

    line-height: 1.7;
}

.telegram-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 38px;

    margin-top: 8px;

    padding:
        7px
        16px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 2px;

    color: var(--blue);

    font-size: 14px;

    font-weight: 400;
}

.telegram-btn:hover {
    background: var(--blue-soft);

    border-color: #b8cbe9;

    color: var(--blue);

    text-decoration: none;
}

.facebook-link {
    color: var(--blue);
    font-weight: 700;
    text-decoration: underline;
}

.facebook-link:hover {
    color: var(--blue-dark);
}

.facebook-link:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

.footer-links {
    display: flex;

    justify-content: center;

    flex-wrap: wrap;

    gap:
        8px
        18px;

    margin-top: 20px;
}

.footer-links a {
    color: var(--blue);

    font-size: 13px;

    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}


/* =========================================================
   28. INLINE FOOTER STYLES OVERRIDE
   Existing HTML contains inline styles.
   These selectors visually normalize them.
   ========================================================= */

footer [style*="font-weight"] {
    font-weight: 400 !important;
}

footer [style*="text-decoration:none"] {
    text-decoration: none !important;
}

footer [style*="margin-top: 20px"] {
    margin-top: 20px !important;
}


/* =========================================================
   29. RESPONSIVE — LARGE TABLET
   ========================================================= */

@media (max-width: 1050px) {

    .article-layout {
        grid-template-columns:
            minmax(0, 1fr)
            250px;
    }

    .article-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .info-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   30. RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 820px) {

    .navbar {
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .nav-links {
        display: flex;
        flex: 1 1 260px;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0 clamp(8px, 1.5vw, 14px);
    }

    .nav-links a {
        padding: 6px 0;
    }

    .article-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;

        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 16px;
    }

    .article-full {
        width: 100%;
    }
}


/* =========================================================
   31. RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 620px) {

    body {
        font-size: 15px;
    }

    .navbar {
        min-height: 54px;

        padding:
            7px
            14px;
    }

    .logo {
        max-width: 100%;

        gap: 8px;
        font-size: 15px;

        white-space: normal;
    }

    .hero {
        padding:
            38px
            16px
            34px;
    }

    .hero.small {
        padding:
            30px
            16px
            28px;
    }

    .hero h1 {
        font-size: clamp(25px, 7vw, 32px);

        line-height: 1.45;
    }

    .hero p {
        font-size: 15px;

        line-height: 1.8;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        padding:
            10px
            11px;

        font-size: 14px;
    }

    .search-box button {
        min-width: 76px;

        padding:
            0
            10px;

        font-size: 13px;
    }

    .hero-actions {
        flex-direction: column;

        align-items: stretch;

        width: 100%;
    }

    .btn-cta,
    .btn-ghost {
        width: 100%;
    }

    .container {
        padding:
            22px
            14px
            42px;
    }

    .categories-bar {
        margin-bottom: 24px;
    }

    .section-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .tabs {
        width: 100%;
    }

    .tab-btn {
        flex: 1;
    }

    .article-grid,
    .related .article-grid {
        grid-template-columns: 1fr;

        gap: 16px;
    }

    .article-content-box {
        padding:
            14px
            14px
            16px;
    }

    .article-layout {
        gap: 22px;
    }

    .article-full {
        padding:
            18px
            15px;
    }

    .art-title {
        font-size: clamp(25px, 7vw, 31px);
    }

    .art-thumb {
        margin-bottom: 18px;
    }

    .article-body {
        font-size: 15px;

        line-height: 1.9;
    }

    .article-body h2 {
        margin-top: 28px;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;

        gap: 12px;
    }

    .contact-form {
        padding:
            18px
            14px;
    }

    .contact-form button {
        width: 100%;
    }

    .cta-box {
        padding:
            25px
            16px;
    }

    footer {
        padding:
            34px
            14px;
    }
}


/* =========================================================
   32. VERY SMALL DEVICES
   ========================================================= */

@media (max-width: 380px) {

    .hero h1 {
        font-size: 24px;
    }

    .logo {
        font-size: 14px;
    }

    .search-box button {
        min-width: 68px;

        font-size: 12px;
    }

    .article-content-box h3 {
        font-size: 17px;
    }

    .art-title {
        font-size: 24px;
    }
}


/* =========================================================
   33. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* =========================================================
   34. PRINT
   ========================================================= */

@media print {

    header,
    .hero-actions,
    .search-box,
    .categories-bar,
    .tabs,
    .sidebar,
    .share-bar,
    .ad-slot,
    footer {
        display: none !important;
    }

    body {
        background: #fff;

        color: #000;
    }

    .container {
        max-width: none;

        padding: 0;
    }

    .article-full {
        border: 0;

        padding: 0;
    }

    .article-body {
        max-width: none;

        color: #000;
    }

    a {
        color: #000;

        text-decoration: none;
    }
}

/* =========================================================
   22. ARTICLE EXTRAS (figures, tables, TOC, FAQ, tools)
   ========================================================= */

.article-body { overflow-wrap: anywhere; }
.article-body[lang="en"] { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hanuman", sans-serif; }
.article-body h2, .article-body h3 { scroll-margin-top: calc(var(--header-height) + 16px); }
.article-body h3 { font-weight: 700; }

.art-figure { margin: 18px 0 22px; }
.art-figure img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--border); border-radius: 6px; background: var(--border-light); }
.art-figure figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.6; font-style: italic; }

.key-box { margin: 20px 0; padding: 14px 18px; background: var(--blue-soft); border-left: 4px solid var(--blue); border-radius: 4px; }
.key-box strong { display: block; margin-bottom: 4px; color: var(--blue-dark); }
.key-box p { margin: 0; }

.table-wrap, .tool-scroll { overflow-x: auto; margin: 18px 0; }
.art-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; background: var(--surface); }
.art-table th, .art-table td { padding: 10px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.art-table thead th { background: var(--blue-soft); color: var(--blue-dark); }
.art-table tbody tr:nth-child(even) td { background: var(--page); }

.toc-box { margin: 22px 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-soft); }
.toc-title { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 12px 16px; border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--blue-dark); cursor: pointer; text-align: left; }
.toc-title::after { content: "\25BE"; font-size: 14px; transition: transform .2s; }
.toc-title[aria-expanded="false"]::after { transform: rotate(-90deg); }
.toc-list { margin: 0; padding: 0 16px 12px 40px; }
.toc-list[hidden] { display: none; }
.toc-list li { margin-bottom: 4px; }
.toc-list a { text-decoration: none; color: var(--text-soft); }
.toc-list a:hover, .toc-list a.active { color: var(--blue); text-decoration: underline; }
.toc-list a.active { font-weight: 700; }

.read-progress { position: fixed; top: 0; left: 0; z-index: 1000; height: 3px; width: 0; background: var(--blue); pointer-events: none; transition: width .1s linear; }

.faq-item { margin: 0 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.faq-item summary { padding: 12px 16px; font-weight: 700; cursor: pointer; }
.faq-item[open] summary { border-bottom: 1px solid var(--border-light); color: var(--blue-dark); }
.faq-item p { margin: 0; padding: 12px 16px; }

.source-list { font-size: 15px; }

.tool-box { margin: 24px 0; padding: 18px; border: 1px solid var(--blue); border-radius: 8px; background: var(--blue-soft); }
.tool-box h3 { margin-top: 0; }
.tool-hint { margin: 0 0 12px; color: var(--text-soft); font-size: 14px; line-height: 1.6; }
.tool-box input, .tool-box select { width: 100%; min-width: 90px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; font: inherit; background: #fff; box-sizing: border-box; }
.tool-box .art-table td { padding: 6px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.tool-grid label, .tool-row label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700; }
.tool-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 14px; }
.tool-row label { flex: 1 1 200px; }
.btn-tool { padding: 10px 22px; border: 0; border-radius: 4px; background: var(--blue); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.btn-tool:hover { background: var(--blue-dark); }
.tool-result { margin-top: 14px; padding: 12px 16px; background: #fff; border: 1px solid var(--border); border-radius: 6px; font-size: 15px; line-height: 1.7; }
.tool-result:empty { display: none; }
.tool-result ul, .tool-result ol { margin-bottom: 8px; }

@media (max-width: 600px) {
    .art-table { font-size: 14px; }
    .art-table th, .art-table td { padding: 8px; }
}

/* keep wide tools/tables from stretching the article column on small screens */
.article-layout > div { min-width: 0; }
.tool-box { max-width: 100%; box-sizing: border-box; }
