/**
 * Clovi Help Center — shared styles for every page under /help/
 * Single source of truth for header, breadcrumb, sidebar, article column, and footer.
 * Home-only UI (hero, search, category grid) lives in help-home.css.
 */

html {
    scroll-behavior: smooth;
}

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

:root {
    --primary-color: #7cb342;
    --primary-dark: #689f38;
    --secondary-color: #8bc34a;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* -------- Header (always scope flex to header nav, never bare `nav`) -------- */
header {
    background: #f9fdf8;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header nav.container {
    padding: 24px;
}

.logo {
    display: flex;
    align-items: center;
}

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

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a.active {
    color: var(--primary-color);
}

.nav-links .btn-primary {
    padding: 8px 20px;
    font-size: 14px;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 16px 24px;
    flex-direction: column;
    gap: 16px;
}

.mobile-nav.open {
    display: flex;
}

.mobile-nav a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    padding: 8px 0;
}

.mobile-nav a:hover {
    color: var(--primary-color);
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 15px;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 179, 66, 0.3);
}

/* -------- Breadcrumb (full-width bar) -------- */
.breadcrumb {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 0;
}

.breadcrumb nav {
    font-size: 14px;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 8px;
    color: var(--border-color);
}

/* -------- Article layout: sidebar + content (minmax prevents grid blowout) -------- */
.help-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: clamp(24px, 3vw, 48px);
    align-items: start;
    padding: 40px 0 80px;
}

.help-sidebar {
    position: sticky;
    top: 88px;
    align-self: start;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 6px;
}

/* One pattern: .sidebar-title + .sidebar-nav OR legacy h3 + ul */
.sidebar-title,
.help-sidebar > h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    margin-bottom: 16px;
}

.sidebar-nav,
.help-sidebar > ul {
    list-style: none;
}

.sidebar-nav li,
.help-sidebar > ul > li {
    margin-bottom: 4px;
}

.sidebar-nav a,
.help-sidebar > ul a {
    display: block;
    padding: 10px 16px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
}

.sidebar-nav a:hover,
.help-sidebar > ul a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.sidebar-nav a.active,
.help-sidebar > ul a.active {
    background: #edf7e0;
    color: var(--primary-dark);
    font-weight: 600;
}

.article-content,
.help-article {
    min-width: 0;
    max-width: 720px;
}

.article-content h1,
.help-article h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    line-height: 1.2;
    color: var(--text-dark);
}

.article-meta {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 32px;
}

.article-content h2,
.help-article h2 {
    font-size: 22px;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
    color: var(--text-dark);
}

.article-content h3,
.help-article h3 {
    font-size: 18px;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.article-content p,
.help-article p {
    font-size: 16px;
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 16px;
}

.article-content ul,
.article-content ol,
.help-article ul:not(.help-steps),
.help-article ol:not(.help-steps) {
    margin-bottom: 16px;
    padding-left: 24px;
}

.article-content li,
.help-article li {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 8px;
}

.article-content code,
.help-article code {
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
}

.article-content a,
.help-article a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.article-content a:hover,
.help-article a:hover {
    text-decoration: underline;
}

.callout {
    background: #f0f7e8;
    border-left: 4px solid var(--primary-color);
    padding: 20px 24px;
    border-radius: 0 8px 8px 0;
    margin: 24px 0;
}

.callout p {
    margin-bottom: 0;
}

.callout strong {
    color: var(--primary-dark);
}

.help-note {
    border-left: 4px solid var(--primary-color);
    background: var(--bg-light);
    padding: 16px 20px;
    margin: 24px 0;
    border-radius: 0 8px 8px 0;
}

.help-note p {
    margin-bottom: 0;
    font-size: 15px;
}

.help-steps {
    list-style: none;
    counter-reset: step;
    margin: 20px 0 24px;
    padding-left: 0;
}

.help-steps li {
    counter-increment: step;
    position: relative;
    padding: 12px 16px 12px 56px;
    margin-bottom: 8px;
    background: var(--bg-light);
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    list-style: none;
}

.help-steps li::before {
    content: counter(step);
    position: absolute;
    left: 16px;
    top: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-articles {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.related-articles h2,
.related-articles h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.related-articles ul,
.related-list {
    list-style: none;
    padding-left: 0;
}

.related-articles li,
.related-list li {
    margin-bottom: 8px;
}

.related-articles a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
}

.related-articles a:hover {
    text-decoration: underline;
}

.related-list a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.related-list a:hover {
    text-decoration: underline;
}

.related-list a::before {
    content: '→';
}

/* -------- Category hub pages (main.help-hub) -------- */
main.help-hub {
    padding: 48px 0 80px;
}

main.help-hub .container > h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    line-height: 1.2;
}

main.help-hub .container > p {
    color: var(--text-light);
    margin-bottom: 32px;
    font-size: 17px;
    max-width: 800px;
}

main.help-hub .article-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 800px;
}

main.help-hub .article-list a {
    display: block;
    padding: 20px 24px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: border-color 0.2s, box-shadow 0.2s;
}

main.help-hub .article-list a:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    color: var(--primary-dark);
}

/* Compact footer used on hub pages */
footer.help-footer-minimal {
    background: var(--text-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 40px 0 24px;
    margin-top: 0;
}

footer.help-footer-minimal .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    text-align: center;
    font-size: 14px;
}

footer.help-footer-minimal .footer-bottom a {
    color: rgba(255, 255, 255, 0.9);
}

/* -------- Full marketing footer -------- */
footer:not(.help-footer-minimal) {
    background: var(--text-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
}

.footer-brand p {
    line-height: 1.7;
    margin-bottom: 24px;
}

.footer-links h4 {
    color: white;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
    font-size: 14px;
}

@media (max-width: 768px) {
    .help-layout {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 24px 0 60px;
    }

    .help-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        margin-bottom: 28px;
        padding-bottom: 24px;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
    }

    .article-content h1,
    .help-article h1 {
        font-size: 26px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }
}
