/* === PoliteDraft — Graphite Tech B2B Palette === */
/*
 *  Deep Navy Slate #1a1a2e  — dark mode background
 *  Azure Blue #b8963e       — primary accent
 *  Crisp White              — light mode background
 *  Slate #3d3a35            — muted text
 *  Cool Gray #e0dbd2        — light borders
 */

/* ── Pico.css Variable Overrides ── */
:root {
    --pico-font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --pico-border-radius: 8px;
}

/* Light Theme (default) */
[data-theme="light"] {
    --pico-primary: #b8963e;
    --pico-primary-hover: #9a7d2e;
    --pico-primary-focus: rgba(184, 150, 62, 0.25);
    --bg: #fdfbf7;
    --bg-card: #fdfbf7;
    --bg-subtle: #f5f2ea;
    --text: #1a1a2e;
    --text-heading: #1a1a2e;
    --text-muted: #4a463f;
    --text-muted-light: #8a8377;
    --accent: #b8963e;
    --accent-hover: #9a7d2e;
    --accent-subtle: rgba(184, 150, 62, 0.07);
    --accent-gold: #b8963e;
    --accent-blue: #7d6324;
    --border: #e0dbd2;
    --border-strong: #d4cdc2;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --header-bg: rgba(253, 251, 247, 0.94);
    --footer-bg: #f5f2ea;
}

/* Dark Theme — Night Navy */
[data-theme="dark"] {
    --pico-primary: #c4a34e;
    --pico-primary-hover: #d0b668;
    --pico-primary-focus: rgba(196, 163, 78, 0.25);
    --bg: #1a1a2e;
    --bg-card: #2d2a25;
    --bg-subtle: #23232e;
    --text: #e0dbd2;
    --text-heading: #faf7f0;
    --text-muted: #8a8377;
    --text-muted-light: #6b655b;
    --accent: #c4a34e;
    --accent-hover: #d0b668;
    --accent-subtle: rgba(196, 163, 78, 0.12);
    --accent-gold: #c4a34e;
    --accent-blue: #d0b668;
    --border: #3d3a35;
    --border-strong: #4a463f;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
    --header-bg: rgba(26, 26, 46, 0.94);
    --footer-bg: #141422;
}

/* ── Base ── */
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--pico-font-family);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

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

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 60px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-heading);
    text-decoration: none;
    letter-spacing: -0.02em;
    white-space: nowrap;
}
.logo-accent {
    color: var(--accent);
}
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.header-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}
.header-nav a:hover {
    color: var(--accent);
    background: var(--accent-subtle);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Theme Toggle Button ── */
.theme-btn {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.9rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: 'Inter', system-ui, sans-serif;
}
.theme-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

/* ── Main ── */
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.25rem 5rem;
}

/* ── Search ── */
.search-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1.25rem 0;
}
.search-wrapper {
    position: relative;
    max-width: 100%;
}
.search-input {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Inter', system-ui, sans-serif;
}
.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}
.search-input::placeholder {
    color: var(--text-muted-light);
}
.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    max-height: 360px;
    overflow-y: auto;
    z-index: 200;
    display: none;
}
.search-results.active {
    display: block;
}
.search-results a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.search-results a:last-child {
    border-bottom: none;
}
.search-results a:hover {
    background: var(--accent-subtle);
}
.search-results .result-title {
    font-weight: 600;
    font-size: 0.92rem;
}
.search-results .result-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.search-no-results {
    padding: 1.25rem;
    text-align: center;
    color: var(--text-muted);
}

/* ── Hero (Homepage) ── */
.hero {
    text-align: center;
    padding: 3.5rem 1rem 3rem;
}
.hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--text-heading);
    margin-bottom: 1rem;
}
.hero h1 .hl {
    color: var(--accent);
}
.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}
.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.btn-primary {
    display: inline-block;
    background: var(--accent);
    color: #fff !important;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s;
}
.btn-primary:hover {
    background: var(--accent-hover);
}
.btn-outline {
    display: inline-block;
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Section Titles ── */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 3rem 0 1.5rem;
    color: var(--text-heading);
    letter-spacing: -0.01em;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}
.stat-card {
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.stat-card .stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ── Card Grid ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.35rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}
.card h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    line-height: 1.4;
}
.card h3 a {
    color: var(--text-heading);
    text-decoration: none;
    font-weight: 600;
}
.card h3 a:hover {
    color: var(--accent);
}
.card .meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

/* ── Badges ── */
.badge {
    display: inline-block;
    background: var(--accent-subtle);
    color: var(--accent);
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.73rem;
    letter-spacing: 0.01em;
}

/* ── Breadcrumb ── */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}
.breadcrumb a:hover {
    color: var(--accent);
}
.breadcrumb span {
    margin: 0 0.35rem;
}

/* ── Article ── */
article h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-heading);
    margin-bottom: 1rem;
}
article h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-top: 2rem;
}
article h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-heading);
}
article p, article li {
    line-height: 1.75;
    color: var(--text);
}

/* ── Summary Box ── */
.summary-box {
    background: var(--accent-subtle);
    border-left: 4px solid var(--accent);
    padding: 1.25rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 2rem;
}
.summary-box h2 {
    font-size: 1.1rem;
    color: var(--accent);
    margin: 0 0 0.5rem;
}
.summary-box p {
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}

/* ── HTS Data Table ── */
.hts-table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
}
.hts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.hts-table thead {
    background: var(--bg-subtle);
}
.hts-table th {
    text-align: left;
    padding: 0.7rem 0.9rem;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-strong);
    white-space: nowrap;
}
.hts-table td {
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: top;
    line-height: 1.5;
}
.hts-table tbody tr {
    transition: background 0.15s;
}
.hts-table tbody tr:hover {
    background: var(--accent-subtle);
}
.hts-table code {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.85rem;
    background: var(--bg-subtle);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
    white-space: nowrap;
}
.rate-free {
    color: #1d7040;
    font-weight: 600;
}
.rate-default {
    font-weight: 600;
    color: var(--text-heading);
}

/* ── E-E-A-T Section ── */
.eeat-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.eeat-section .eeat-inner {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    flex-wrap: wrap;
}
.eeat-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    color: var(--accent);
}
.eeat-info strong {
    color: var(--text-heading);
    font-size: 0.95rem;
}
.eeat-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0.35rem 0 0;
    max-width: 700px;
}
.eeat-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-muted-light);
    margin-top: 1rem;
}

/* ── Cross-nav ── */
.cross-nav {
    margin-top: 2rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.cross-nav strong {
    display: block;
    color: var(--text-heading);
    margin-bottom: 0.75rem;
}
.cross-nav .links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.cross-nav .links a {
    font-size: 0.88rem;
}

/* ── Page Content (Legal Pages) ── */
.page-content {
    max-width: 800px;
}
.page-content h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 1.5rem;
}
.page-body {
    font-size: 1rem;
    color: var(--text);
    line-height: 1.8;
}

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}
.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}
.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.pagination a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 700;
}

/* ── Footer ── */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--footer-bg);
    padding: 2.5rem 1.25rem;
    margin-top: 4rem;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}
.footer-col h4 {
    color: var(--text-heading);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}
.footer-col p {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.6;
}
.footer-col a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.2rem 0;
    transition: color 0.15s;
}
.footer-col a:hover {
    color: var(--accent);
}
.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-bottom p {
    color: var(--text-muted-light);
    font-size: 0.78rem;
    margin: 0.25rem 0;
    line-height: 1.6;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 0.75rem 1rem;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .site-main {
        padding: 1.25rem 0.75rem 3rem;
    }
    article h1 {
        font-size: 1.4rem;
    }
}
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    .logo {
        font-size: 1.1rem;
    }
    .hts-table th, .hts-table td {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
    }
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}
