/* ===== ETTEM Guide — CSS ===== */
/* Reuses landing-page color palette */

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

:root {
    --primary: #1a3a5c;
    --primary-light: #2a5a8c;
    --primary-dark: #0f2640;
    --accent: #e8742a;
    --accent-hover: #d4651e;
    --green: #2ecc71;
    --bg-light: #f8f9fb;
    --bg-gray: #eef1f5;
    --text-dark: #1a1a2e;
    --text-muted: #6b7280;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
    --radius: 8px;
    --sidebar-w: 260px;
    --topbar-h: 56px;
    --max-content: 860px;
    --font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); color: var(--text-dark); line-height: 1.7; background: #fff; }
a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }

/* ===== TOPBAR ===== */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--topbar-h);
    background: var(--primary);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: var(--shadow-sm);
}
.topbar-logo {
    color: #fff; font-size: 1.2rem; font-weight: 700; letter-spacing: .5px;
}
.topbar-logo span { color: var(--accent); }
.topbar-links { display: flex; gap: 1rem; align-items: center; }
.topbar-links a {
    color: rgba(255,255,255,0.85); font-size: 0.85rem; font-weight: 500;
    padding: 0.3rem 0.6rem; border-radius: 4px; transition: background 0.2s;
}
.topbar-links a:hover { background: rgba(255,255,255,0.12); color: #fff; text-decoration: none; }
.topbar-links a.active { background: rgba(255,255,255,0.15); color: #fff; }

/* ===== LAYOUT ===== */
.layout {
    display: flex;
    margin-top: var(--topbar-h);
    min-height: calc(100vh - var(--topbar-h));
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-light);
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    padding: 1.25rem 0;
    z-index: 50;
}
.sidebar-title {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-muted);
    padding: 0 1.25rem; margin-bottom: 0.5rem;
}
.sidebar ul { list-style: none; }
.sidebar li a {
    display: block; padding: 0.4rem 1.25rem;
    font-size: 0.88rem; color: var(--text-dark);
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.sidebar li a:hover { background: var(--bg-gray); text-decoration: none; color: var(--primary); }
.sidebar li a.active {
    color: var(--primary); font-weight: 600;
    border-left-color: var(--accent);
    background: rgba(232,116,42,0.06);
}
.sidebar-section { margin-bottom: 1rem; }

/* ===== CONTENT ===== */
.content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2.5rem 3rem 4rem;
    max-width: calc(var(--max-content) + var(--sidebar-w) + 6rem);
}

/* ===== TYPOGRAPHY ===== */
.content h1 {
    font-size: 2rem; font-weight: 800; color: var(--primary);
    margin-bottom: 0.5rem; line-height: 1.2;
}
.content h2 {
    font-size: 1.4rem; font-weight: 700; color: var(--primary-dark);
    margin-top: 2.5rem; margin-bottom: 0.75rem;
    padding-bottom: 0.4rem; border-bottom: 2px solid var(--bg-gray);
}
.content h3 {
    font-size: 1.15rem; font-weight: 600; color: var(--text-dark);
    margin-top: 1.75rem; margin-bottom: 0.5rem;
}
.content p { margin-bottom: 1rem; }
.content ul, .content ol { margin: 0.5rem 0 1rem 1.5rem; }
.content li { margin-bottom: 0.35rem; }

.page-subtitle {
    font-size: 1.05rem; color: var(--text-muted); margin-bottom: 2rem;
}

/* ===== CALLOUTS ===== */
.callout {
    padding: 1rem 1.25rem; border-radius: var(--radius);
    margin: 1.25rem 0; font-size: 0.92rem; line-height: 1.6;
    border-left: 4px solid;
}
.callout-info { background: #ebf5ff; border-color: #3b82f6; }
.callout-tip { background: #ecfdf5; border-color: var(--green); }
.callout-warning { background: #fffbeb; border-color: #f59e0b; }
.callout strong { display: block; margin-bottom: 0.25rem; }

/* ===== TABLES ===== */
.content table {
    width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem;
    font-size: 0.9rem;
}
.content th {
    background: var(--primary); color: #fff;
    padding: 0.6rem 1rem; text-align: left; font-weight: 600;
}
.content td {
    padding: 0.55rem 1rem; border-bottom: 1px solid #e2e8f0;
}
.content tr:nth-child(even) td { background: var(--bg-light); }

/* ===== CODE ===== */
code {
    background: var(--bg-gray); padding: 0.15em 0.4em;
    border-radius: 4px; font-size: 0.88em; font-family: 'Cascadia Code', 'Fira Code', monospace;
}
pre {
    background: #1e293b; color: #e2e8f0; padding: 1rem 1.25rem;
    border-radius: var(--radius); overflow-x: auto;
    margin: 1rem 0 1.5rem; font-size: 0.85rem; line-height: 1.5;
}
pre code { background: none; padding: 0; color: inherit; }

/* ===== SCREENSHOTS ===== */
.screenshot {
    margin: 1.5rem 0;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.screenshot img { border-radius: 0; }
.screenshot-caption {
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    font-size: 0.82rem; color: var(--text-muted); text-align: center;
}

/* ===== PREV / NEXT ===== */
.page-nav {
    display: flex; justify-content: space-between; gap: 1rem;
    margin-top: 3rem; padding-top: 1.5rem;
    border-top: 2px solid var(--bg-gray);
}
.page-nav a {
    display: flex; flex-direction: column;
    padding: 0.75rem 1.25rem;
    border: 1px solid #e2e8f0; border-radius: var(--radius);
    transition: all 0.2s; max-width: 48%;
}
.page-nav a:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); text-decoration: none; }
.page-nav .nav-label {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-muted); margin-bottom: 0.15rem;
}
.page-nav .nav-title { font-weight: 600; color: var(--primary); }
.page-nav .next { text-align: right; margin-left: auto; }

/* ===== BADGES ===== */
.badge {
    display: inline-block; padding: 0.2em 0.6em; border-radius: 4px;
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
}
.badge-new { background: #dcfce7; color: #15803d; }
.badge-updated { background: #dbeafe; color: #1d4ed8; }

/* ===== MOBILE TOGGLE ===== */
.sidebar-toggle {
    display: none; position: fixed; bottom: 1.25rem; left: 1.25rem; z-index: 200;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--primary); color: #fff; border: none;
    font-size: 1.4rem; cursor: pointer;
    box-shadow: var(--shadow-md);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    :root { --sidebar-w: 0px; }
    .sidebar {
        transform: translateX(-280px);
        width: 280px;
        transition: transform 0.3s;
        box-shadow: var(--shadow-md);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
    .content { margin-left: 0; padding: 2rem 1.25rem 3rem; }
}

@media (max-width: 600px) {
    .content h1 { font-size: 1.6rem; }
    .content h2 { font-size: 1.2rem; }
    .page-nav { flex-direction: column; }
    .page-nav a { max-width: 100%; }
    .topbar-links { display: none; }
}

/* ===== PRINT ===== */
@media print {
    .topbar, .sidebar, .sidebar-toggle, .page-nav { display: none !important; }
    .content { margin-left: 0; padding: 0; max-width: 100%; }
    body { font-size: 11pt; line-height: 1.5; }
    .content h1 { font-size: 18pt; }
    .content h2 { font-size: 14pt; break-after: avoid; }
    .screenshot { break-inside: avoid; }
    a { color: inherit; }
    a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
}
