/*
 * Main Stylesheet — BSEN Tech
 * Theme colours injected as CSS variables by layout.php from site config.
 * Do not hardcode theme colours here — always use var(--spn-*).
 */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Verdana', 'Geneva', Tahoma, 'Liberation Sans', Arial, sans-serif;
    background: var(--spn-bg, #f5f1ec);
    color: var(--spn-text, #1a150f);
    line-height: 1.75;
}

a { color: var(--spn-accent, #c4621c); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ── Layout Containers ── */
.spn-header-inner,
.spn-footer-inner,
#spn-main,
.spn-section-inner {
    max-width: var(--spn-max-width, 1100px);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ── Header ── */
.spn-header {
    background: var(--spn-primary, #2c1f14);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.22);
}

.spn-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    flex-wrap: wrap;
}

/* Logo — the <a> element itself carries this class */
.spn-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    text-decoration: none;
    flex-shrink: 0;
}
.spn-logo:hover { color: #fff; text-decoration: none; }

/* Hamburger toggle (checkbox trick) */
.spn-nav-toggle { display: none; }

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

.spn-nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.2s;
}

/* Nav */
.spn-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.spn-nav ul li a {
    color: rgba(255,255,255,0.88);
    font-size: 0.87rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 0.15s;
}

.spn-nav ul li a:hover {
    color: #fff;
    text-decoration: none;
}

/* ── Hero ── */
.spn-hero {
    background: var(--spn-primary, #2c1f14);
    color: #fff;
    padding: 3rem 1.25rem 2.75rem;
    text-align: center;
}

.spn-hero h1 {
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.6rem;
    letter-spacing: 0.02em;
}

.spn-hero p {
    font-size: 1rem;
    color: rgba(255,255,255,0.82);
    max-width: 560px;
    margin: 0 auto;
}

/* ── Topic Cards ── */
.spn-topic-cards {
    padding: 2.5rem 1.25rem;
    background: var(--spn-bg, #f5f1ec);
}

.spn-topic-cards h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--spn-primary, #2c1f14);
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.spn-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
}

.spn-card {
    background: #fff;
    border: 1px solid rgba(44,31,20,0.12);
    border-radius: 3px;
    padding: 1.25rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.spn-card:hover { box-shadow: 0 3px 10px rgba(44,31,20,0.1); }

.spn-card-title { font-size: 1rem; font-weight: 700; }
.spn-card-title a { color: var(--spn-primary, #2c1f14); }
.spn-card-summary { font-size: 0.88rem; color: #4a4038; line-height: 1.6; flex: 1; }
.spn-card-cta { font-size: 0.83rem; font-weight: 700; color: var(--spn-accent, #c4621c); margin-top: auto; }

/* ── Latest Articles ── */
.spn-latest-articles {
    background: #fff;
    padding: 2rem 1.25rem;
    border-top: 1px solid rgba(44,31,20,0.08);
}

.spn-latest-articles-inner { max-width: 1100px; margin: 0 auto; }

.spn-latest-articles h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--spn-primary, #2c1f14);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.spn-latest-list { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.spn-latest-list li { border-bottom: 1px solid rgba(44,31,20,0.07); padding-bottom: 0.55rem; }
.spn-latest-list li:last-child { border-bottom: none; }
.spn-latest-list a { font-size: 0.92rem; color: var(--spn-primary, #2c1f14); font-weight: 600; }
.spn-latest-list a:hover { color: var(--spn-accent, #c4621c); text-decoration: none; }

/* ── Site Desc ── */
.spn-site-desc {
    padding: 1.5rem 1.25rem;
    background: var(--spn-bg, #f5f1ec);
    border-top: 1px solid rgba(44,31,20,0.08);
}

.spn-site-desc p { font-size: 0.88rem; color: #5a4f44; line-height: 1.7; max-width: 700px; }

/* ── Main Content ── */
#spn-main {
    padding: 2rem 1.25rem;
    min-height: 300px;
}

/* ── Article Layout ── */
.spn-article-header { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid var(--spn-accent, #c4621c); }
.spn-article-title { font-size: clamp(1.3rem, 2.8vw, 1.9rem); font-weight: 700; color: var(--spn-primary, #2c1f14); line-height: 1.3; margin-bottom: 0.4rem; }
.spn-article-meta { font-size: 0.8rem; color: #6a6058; }
.spn-article-body { max-width: 740px; font-size: 0.97rem; }
.spn-article-body h2 { font-size: 1.15rem; color: var(--spn-primary, #2c1f14); margin: 1.75rem 0 0.65rem; font-weight: 700; }
.spn-article-body p { margin-bottom: 1rem; }
.spn-article-body ul, .spn-article-body ol { margin: 0.75rem 0 1rem 1.5rem; }
.spn-article-body li { margin-bottom: 0.4rem; line-height: 1.65; }
.spn-article-body strong { color: var(--spn-primary, #2c1f14); }

/* ── Checklist ── */
.spn-checklist { list-style: none; margin-left: 0 !important; }
.spn-checklist li { padding-left: 1.5em; position: relative; margin-bottom: 0.5rem; }
.spn-checklist li::before { content: '▸'; position: absolute; left: 0; color: var(--spn-accent, #c4621c); font-weight: 700; }

/* ── FAQ ── */
.spn-faq { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid rgba(44,31,20,0.1); }
.spn-faq h2 { font-size: 1.1rem; color: var(--spn-primary, #2c1f14); margin-bottom: 1rem; font-weight: 700; }
.spn-faq-item { margin-bottom: 1.25rem; }
.spn-faq-q { font-weight: 700; color: var(--spn-primary, #2c1f14); margin-bottom: 0.35rem; font-size: 0.95rem; }
.spn-faq-a { font-size: 0.92rem; color: #3a3028; line-height: 1.7; }

/* ── Related ── */
.spn-related { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid rgba(44,31,20,0.1); }
.spn-related h2 { font-size: 0.95rem; color: var(--spn-primary, #2c1f14); margin-bottom: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.spn-related ul { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.spn-related a { font-size: 0.88rem; color: var(--spn-accent, #c4621c); font-weight: 600; }

/* ── AdSense placeholders ── */
.spn-adsense-top, .spn-adsense-mid, .spn-adsense-bottom { margin: 1.5rem 0; min-height: 90px; }

/* ── Policy Pages ── */
.spn-policy-header { margin-bottom: 1.5rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--spn-accent, #c4621c); }
.spn-policy-title { font-size: 1.6rem; font-weight: 700; color: var(--spn-primary, #2c1f14); }
.spn-policy-body h2 { font-size: 1.05rem; color: var(--spn-primary, #2c1f14); margin: 1.5rem 0 0.5rem; font-weight: 700; }
.spn-policy-body p { margin-bottom: 0.85rem; line-height: 1.75; font-size: 0.95rem; }
.spn-policy-body ul { margin: 0.5rem 0 1rem 1.5rem; }
.spn-policy-body li { margin-bottom: 0.35rem; line-height: 1.65; font-size: 0.95rem; }
.spn-policy-body a { color: var(--spn-accent, #c4621c); }

/* ── Category / Topic Hub ── */
.spn-category-header { margin-bottom: 1.5rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--spn-accent, #c4621c); }
.spn-category-title { font-size: 1.6rem; font-weight: 700; color: var(--spn-primary, #2c1f14); }
.spn-category-desc { font-size: 0.92rem; color: #55483e; margin-top: 0.4rem; }
.spn-category-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.25rem; }
.spn-category-list li { padding: 0.8rem 1rem; background: #fff; border: 1px solid rgba(44,31,20,0.1); border-radius: 3px; }
.spn-category-list a { font-weight: 700; color: var(--spn-primary, #2c1f14); font-size: 0.93rem; }
.spn-category-list a:hover { color: var(--spn-accent, #c4621c); text-decoration: none; }

/* ── Guide Pages ── */
.spn-guide-section { max-width: 740px; }
.spn-guide-section h2 { font-size: 1.15rem; color: var(--spn-primary, #2c1f14); margin: 1.5rem 0 0.6rem; font-weight: 700; }
.spn-guide-section p { margin-bottom: 0.9rem; line-height: 1.75; font-size: 0.96rem; }
.spn-guide-section ul { margin: 0.5rem 0 1rem 1.5rem; }
.spn-guide-section li { margin-bottom: 0.4rem; line-height: 1.65; font-size: 0.96rem; }

/* ── Coming Soon / Placeholder ── */
.spn-coming-soon { text-align: center; padding: 3rem 1rem; color: #5a4f44; font-size: 0.97rem; }
.spn-coming-soon h2 { color: var(--spn-primary, #2c1f14); margin-bottom: 0.5rem; font-size: 1.4rem; font-weight: 700; }

/* ── Operations Note ── */
.spn-operations-note { background: #fff; border-left: 4px solid var(--spn-accent, #c4621c); padding: 1.25rem 1.5rem; border-radius: 0 3px 3px 0; max-width: 660px; margin-top: 1rem; }
.spn-operations-note p { margin-bottom: 0.7rem; font-size: 0.94rem; line-height: 1.7; }
.spn-operations-note p:last-child { margin-bottom: 0; }

/* ── Article Index ── */
.spn-article-index h2 { font-size: 1.4rem; color: var(--spn-primary, #2c1f14); margin-bottom: 1.25rem; font-weight: 700; }
.spn-article-cards { display: flex; flex-direction: column; gap: 1rem; max-width: 780px; }
.spn-card.spn-article-card { flex-direction: row; align-items: flex-start; gap: 1rem; }
.spn-article-card-body { flex: 1; }
.spn-article-card-body h3 { font-size: 0.97rem; font-weight: 700; margin-bottom: 0.3rem; }
.spn-article-card-body h3 a { color: var(--spn-primary, #2c1f14); }
.spn-article-card-body p { font-size: 0.86rem; color: #55483e; margin: 0; }
.spn-article-card-meta { font-size: 0.77rem; color: #7a6e64; margin-top: 0.3rem; }

/* ── Sitemap ── */
.spn-sitemap { max-width: 780px; margin: 0 auto; }
.spn-sitemap h2 { font-size: 1.05rem; color: var(--spn-primary, #2c1f14); margin: 1.5rem 0 0.5rem; font-weight: 700; }
.spn-sitemap ul { list-style: none; margin-left: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.spn-sitemap a { font-size: 0.88rem; color: var(--spn-accent, #c4621c); }

/* ── Footer ── */
.spn-footer {
    background: var(--spn-primary, #2c1f14);
    color: rgba(255,255,255,0.7);
    padding: 2.25rem 1.25rem 1.25rem;
    margin-top: 3rem;
    font-size: 0.84rem;
}

.spn-footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 1.75rem;
}

.spn-footer-col h3 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    margin-bottom: 0.85rem;
}
.spn-footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; }
.spn-footer-col li { margin-bottom: 0.45rem; }
.spn-footer-col a { color: rgba(255,255,255,0.65); font-size: 0.82rem; }
.spn-footer-col a:hover { color: #fff; text-decoration: none; }

.spn-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.79rem;
    color: rgba(255,255,255,0.45);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .spn-nav-hamburger { display: flex; }
    .spn-nav { display: none; width: 100%; padding-bottom: 0.75rem; }
    .spn-nav-toggle:checked ~ .spn-nav { display: block; }
    .spn-nav ul { flex-direction: column; gap: 0.5rem; }
    .spn-hero { padding: 2.25rem 1rem 1.75rem; }
    .spn-card-grid { grid-template-columns: 1fr; }
    .spn-footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .spn-footer-grid { grid-template-columns: 1fr; }
}
