:root {
    --blue: #0067c0;
    --blue-dark: #004881;
    --blue-light: #e8f2fc;
    --ink: #1b1f24;
    --ink-soft: #4b5563;
    --border: #e2e5ea;
    --bg: #f7f9fc;
    --white: #ffffff;
    --green: #1a7f43;
    --amber: #b7791f;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-mark-img { display: block; flex-shrink: 0; }
.logo-text strong { color: var(--blue); }
.main-nav { display: flex; align-items: center; gap: 24px; }
.main-nav a { color: var(--ink-soft); font-weight: 500; font-size: .95rem; }
.main-nav a:hover { color: var(--blue); text-decoration: none; }
.nav-cta {
    background: var(--blue); color: #fff !important; padding: 8px 16px; border-radius: 8px;
}
.nav-cta:hover { background: var(--blue-dark); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; }

/* Hero */
.hero {
    background: linear-gradient(180deg, var(--blue-light) 0%, var(--bg) 100%);
    padding: 64px 0 48px;
    text-align: center;
}
.hero-flex { display: flex; align-items: center; gap: 48px; text-align: left; }
.hero-flex .hero-copy { flex: 1; }
.hero-flex .hero-copy h1, .hero-flex .hero-copy p.lead { text-align: left; margin-left: 0; margin-right: 0; }
.hero-flex .hero-copy .search-box { margin-left: 0; }
.hero-flex .hero-img { flex-shrink: 0; width: 340px; }
.hero-flex .hero-img img { width: 100%; height: auto; display: block; }
.hero h1 { font-size: 2.4rem; margin: 0 0 12px; }
.hero p.lead { color: var(--ink-soft); font-size: 1.15rem; max-width: 640px; margin: 0 auto 28px; }
.search-box { max-width: 560px; margin: 0 auto; display: flex; gap: 8px; }
.search-box input {
    flex: 1; padding: 14px 18px; border-radius: 999px; border: 1px solid var(--border);
    font-size: 1rem; box-shadow: var(--shadow);
}
.search-box button {
    padding: 14px 24px; border-radius: 999px; border: none; background: var(--blue); color: #fff;
    font-weight: 600; cursor: pointer;
}
.search-box button:hover { background: var(--blue-dark); }

/* Section layout */
section { padding: 48px 0; }
section h2 { font-size: 1.6rem; margin-bottom: 8px; }
section > .wrap > p.section-lead { color: var(--ink-soft); margin-top: 0; margin-bottom: 32px; }

/* Category grid */
.category-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px;
}
.category-card {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.category-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(16,24,40,.1); text-decoration: none; }
.category-card .icon { font-size: 1.8rem; }
.category-card .icon img { width: 48px; height: 48px; display: block; }
.category-card h3 { margin: 10px 0 6px; font-size: 1.1rem; color: var(--ink); }
.category-card p { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.category-card .count { display: inline-block; margin-top: 12px; font-size: .82rem; color: var(--blue); font-weight: 600; }

/* Guide list */
.guide-list { display: flex; flex-direction: column; gap: 12px; }
.guide-row {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 20px; box-shadow: var(--shadow);
}
.guide-row .row-icon { width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; }
.guide-row .row-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.guide-row:hover { text-decoration: none; border-color: var(--blue); }
.guide-row h3 { margin: 0 0 4px; font-size: 1rem; color: var(--ink); }
.guide-row p { margin: 0; color: var(--ink-soft); font-size: .88rem; }
.badge {
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
    padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.badge-beginner { background: #e6f6ec; color: var(--green); }
.badge-intermediate { background: #fdf3e3; color: var(--amber); }

/* Guide detail */
.guide-header { background: var(--white); border-bottom: 1px solid var(--border); padding: 40px 0 32px; }
.breadcrumb { font-size: .85rem; color: var(--ink-soft); margin-bottom: 12px; }
.breadcrumb a { color: var(--ink-soft); }
.guide-header h1 { margin: 0 0 10px; font-size: 1.9rem; }
.guide-meta { display: flex; gap: 10px; align-items: center; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 32px 0; }
.steps li {
    counter-increment: step; position: relative; padding: 20px 20px 20px 60px;
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 14px; box-shadow: var(--shadow);
}
.steps li::before {
    content: counter(step); position: absolute; left: 18px; top: 18px;
    width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem;
}
.callout {
    background: var(--blue-light); border-left: 4px solid var(--blue); border-radius: 8px;
    padding: 16px 20px; margin: 24px 0; font-size: .95rem;
}

/* Diagnostic decision tree */
.diagnostic-step {
    border: 1px solid var(--border); border-radius: 10px; margin: 0 0 16px; overflow: hidden;
}
.diagnostic-step > summary {
    cursor: pointer; padding: 16px 20px; font-weight: 600; background: var(--white);
    list-style: none; display: flex; align-items: center; gap: 10px;
}
.diagnostic-step > summary::-webkit-details-marker { display: none; }
.diagnostic-step > summary::before { content: "?"; display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: #fff; font-size: .8rem; flex-shrink: 0; }
.diagnostic-step[open] > summary { border-bottom: 1px solid var(--border); }
.diagnostic-branches { padding: 18px 20px; display: grid; gap: 14px; }
.diagnostic-branch { border-left: 3px solid var(--border); padding-left: 16px; }
.diagnostic-branch .branch-label { font-weight: 600; font-size: .85rem; text-transform: uppercase;
    letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 6px; }
.diagnostic-branch.branch-yes { border-left-color: var(--green); }
.diagnostic-branch.branch-no { border-left-color: var(--amber); }
.diagnostic-result { background: var(--blue-light); border-radius: 8px; padding: 14px 16px; margin-top: 8px; }

/* FAQ */
.faq-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.faq-item summary { padding: 16px 20px; font-weight: 600; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; float: right; font-weight: 400; color: var(--ink-soft); }
.faq-item[open] summary::after { content: '−'; }
.faq-item .faq-body { padding: 0 20px 18px; color: var(--ink-soft); }

/* Cards / blog */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.post-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.post-card .post-thumb { display: block; width: 100%; height: 140px; object-fit: cover; }
.post-card .post-avatar { width: 40px; height: 40px; border-radius: 50%; display: block; }
.post-card .post-body { padding: 20px; }
.post-card .post-date { font-size: .8rem; color: var(--ink-soft); }
.post-card h3 { margin: 6px 0 8px; font-size: 1.05rem; }
.post-card p { color: var(--ink-soft); font-size: .92rem; margin: 0; }

/* Forms */
form.contact-form { max-width: 560px; }
form.contact-form label { display: block; font-weight: 600; margin: 16px 0 6px; font-size: .9rem; }
form.contact-form input, form.contact-form select, form.contact-form textarea {
    width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border); font-size: .95rem; font-family: inherit;
}
form.contact-form textarea { min-height: 140px; resize: vertical; }
form.contact-form button {
    margin-top: 20px; padding: 13px 26px; border: none; border-radius: 8px; background: var(--blue);
    color: #fff; font-weight: 600; font-size: 1rem; cursor: pointer;
}
form.contact-form button:hover { background: var(--blue-dark); }
.form-notice { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; font-size: .92rem; }
.form-notice.success { background: #e6f6ec; color: var(--green); }
.form-notice.error { background: #fdeaea; color: #b42318; }

/* Generic content */
.content-page { padding: 48px 0; }
.content-page h1 { font-size: 2rem; margin-bottom: 8px; }
.content-page h2 { font-size: 1.3rem; margin-top: 32px; }
.content-page .updated { color: var(--ink-soft); font-size: .85rem; margin-bottom: 24px; }

/* Footer */
.site-footer { background: #12161c; color: #b6bcc6; padding: 48px 0 0; margin-top: 64px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding-bottom: 32px; }
.site-footer .logo { color: #fff; }
.site-footer .logo-text strong { color: #6cb2f4; }
.footer-col h4 { color: #fff; font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 14px; }
.footer-col a { display: block; color: #b6bcc6; margin-bottom: 10px; font-size: .9rem; }
.footer-col a:hover { color: #fff; }
.footer-col p { font-size: .88rem; margin-top: 12px; }
.footer-bottom { border-top: 1px solid #262c36; padding: 18px 0; font-size: .8rem; color: #7d8592; }
.footer-bottom .disclaimer { margin: 0 0 10px; line-height: 1.6; max-width: 900px; }
.footer-bottom .disclaimer a { color: #9fb6d6; }

.footer-newsletter { margin-top: 18px; }
.footer-newsletter form { display: flex; gap: 6px; margin-top: 8px; }
.footer-newsletter input[type=email] {
    flex: 1; min-width: 0; padding: 9px 12px; border-radius: 6px; border: none; font-size: .85rem;
}
.footer-newsletter button {
    padding: 9px 14px; border: none; border-radius: 6px; background: var(--blue); color: #fff;
    font-weight: 600; cursor: pointer; font-size: .85rem; white-space: nowrap;
}
.footer-newsletter button:hover { background: var(--blue-dark); }
.footer-newsletter .consent { font-size: .7rem; color: #7d8592; margin-top: 8px; }
.footer-newsletter .thanks { color: #7ee0a0; font-weight: 600; font-size: .85rem; margin: 0; }
.footer-newsletter .oops { color: #f2a3a3; font-size: .85rem; margin: 0; }

.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a { display: block; opacity: .75; transition: opacity .15s; }
.footer-social a:hover { opacity: 1; }
.footer-social img { width: 28px; height: 28px; display: block; }

/* Category / hub header (wikiHow-style banner) */
.cat-hero {
    background: linear-gradient(180deg, var(--blue-light) 0%, #fff 100%);
    border-bottom: 1px solid var(--border);
    padding: 36px 0 28px;
}
.cat-hero-top { display: flex; align-items: center; gap: 18px; }
.cat-hero-icon {
    width: 60px; height: 60px; border-radius: 16px; background: var(--white);
    display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
    box-shadow: var(--shadow); flex-shrink: 0; overflow: hidden;
}
.cat-hero-icon img { width: 100%; height: 100%; display: block; }
.cat-hero h1 { margin: 0 0 4px; font-size: 1.8rem; }
.cat-hero .cat-count { color: var(--ink-soft); font-size: .9rem; margin: 0; }
.cat-hero p.cat-desc { color: var(--ink-soft); font-size: 1rem; margin: 14px 0 0; max-width: 640px; }

/* Subcategory pill tabs (wikiHow-style horizontal category switcher) */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 4px; overflow-x: auto; padding-bottom: 4px; }
.pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--white); color: var(--ink-soft);
    font-size: .85rem; font-weight: 600; white-space: nowrap; transition: all .15s;
}
.pill:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.pill.pill-active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Two-column layout: article grid + sidebar (wikiHow-style) */
.layout-2col { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.sidebar-box {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow); position: sticky; top: 84px;
}
.sidebar-box h3 { margin: 0 0 4px; font-size: 1rem; }
.sidebar-box .sidebar-sub { color: var(--ink-soft); font-size: .82rem; margin: 0 0 14px; }
.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li { border-top: 1px solid var(--border); }
.sidebar-list li:first-child { border-top: none; }
.sidebar-list a {
    display: flex; align-items: center; gap: 10px; padding: 11px 0; color: var(--ink); font-size: .88rem; font-weight: 500;
}
.sidebar-list a:hover { color: var(--blue); text-decoration: none; }
.sidebar-list .rank {
    width: 22px; height: 22px; border-radius: 50%; background: var(--blue-light); color: var(--blue);
    font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-box .sidebar-cta {
    display: block; text-align: center; margin-top: 16px; padding: 10px; border-radius: 8px;
    background: var(--blue-light); color: var(--blue-dark); font-weight: 600; font-size: .85rem;
}
.sidebar-box .sidebar-cta:hover { text-decoration: none; background: #d9ecfb; }

/* Article card grid (wikiHow-style thumbnail cards, icon instead of photo) */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.article-card {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; display: block; color: var(--ink);
}
.article-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(16,24,40,.12); text-decoration: none; }
.article-card .art-thumb {
    height: 108px; background: var(--blue-light); display: flex; align-items: center; justify-content: center; font-size: 2.4rem;
}
.article-card .art-thumb img { width: 56px; height: 56px; display: block; }
.article-card .art-body { padding: 14px 16px 16px; }
.article-card h3 { margin: 0 0 8px; font-size: .92rem; line-height: 1.35; color: var(--ink); min-height: 2.6em; }
.article-card .art-meta { display: flex; justify-content: space-between; align-items: center; }
.article-card .art-cat { font-size: .74rem; color: var(--ink-soft); }

/* Testimonials */
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.testimonial-card {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; box-shadow: var(--shadow);
}
.testimonial-card .stars { color: #f59e0b; font-size: .95rem; letter-spacing: 2px; margin-bottom: 10px; }
.testimonial-card .quote { color: var(--ink); font-size: .95rem; line-height: 1.55; margin: 0 0 16px; }
.testimonial-card .quote::before { content: '\201C'; }
.testimonial-card .quote::after { content: '\201D'; }
.testimonial-card .attribution { display: flex; align-items: center; gap: 10px; }
.testimonial-card .avatar-dot {
    width: 34px; height: 34px; border-radius: 50%; background: var(--blue-light); color: var(--blue-dark);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.testimonial-card .attribution-text strong { display: block; font-size: .88rem; }
.testimonial-card .attribution-text span { font-size: .78rem; color: var(--ink-soft); }

/* 404 */
.error-page { text-align: center; padding: 60px 0; }
.error-page .code { font-size: 5rem; font-weight: 800; color: var(--blue); margin: 0; }
.error-page img { max-width: 420px; margin: 0 auto 12px; }

@media (max-width: 720px) {
    .main-nav {
        position: absolute; top: 64px; left: 0; right: 0; background: #fff;
        flex-direction: column; align-items: flex-start; padding: 16px 24px; gap: 16px;
        border-bottom: 1px solid var(--border); display: none;
    }
    .main-nav.open { display: flex; }
    .nav-toggle { display: block; }
    .footer-inner { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.8rem; }
    .hero-flex { flex-direction: column; text-align: center; }
    .hero-flex .hero-copy h1, .hero-flex .hero-copy p.lead { text-align: center; }
    .hero-flex .hero-img { width: 240px; }
    .layout-2col { grid-template-columns: 1fr; }
    .sidebar-box { position: static; }
    .footer-newsletter form { flex-direction: column; }
}
