/* ═══════════════════════════════════════════════════════════════════
   common.css  –  Shared styles across all pages
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* ── Header ────────────────────────────────────────────────────────── */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.header-logo img,
.header-logo svg { width: 40px; height: 40px; }

.header-logo span {
    font-size: 1.15rem;
    font-weight: 700;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
    background: #eff6ff;
}

/* ── Dropdown ──────────────────────────────────────────────────────── */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    min-width: 220px;
    padding: 8px;
    z-index: 200;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: #f1f5f9;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 8px;
}

.dropdown-label {
    padding: 6px 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Page typography (shared by About & Wiki) ──────────────────────── */
.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 40px 0 8px;
}

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

/* ── Card base (shared by About & Wiki; Index overrides padding/margin) */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 20px 0 10px;
    color: var(--text);
}

.card p {
    margin-bottom: 12px;
    color: #334155;
}

.card ul {
    margin: 0 0 16px 20px;
    color: #334155;
}

.card li {
    margin-bottom: 6px;
}

/* ── Language switcher (used by header.js) ─────────────────────────── */


.lang-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.lang-btn:hover {
    color: var(--accent);
    background: #eff6ff;
}

.lang-btn.active {
    color: var(--accent);
    border-color: var(--border);
    background: var(--surface);
}

/* ═══════════════════════════════════════════════════════════════════
   Language Switcher Styles
   ═══════════════════════════════════════════════════════════════════ */

/* Distinct language link in nav */
.lang-link {
    border: 1px solid var(--border);
    background: var(--surface);
    margin-left: 8px;
}

.lang-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Language dropdown — compact, right-aligned */
.dropdown-menu.lang-dropdown {
    min-width: 120px;
    text-align: right;
}

.dropdown-menu.lang-dropdown .dropdown-item {
    text-align: right;
    padding-right: 16px;
}

/* Push language switcher to the far right of the nav bar */

/* Language switcher — distinct small bold monospace button */
.lang-link {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Fira Code', Consolas, monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8fafc;
    color: var(--text-muted);
}

.lang-link:hover {
    background: #eff6ff;
    border-color: var(--accent);
    color: var(--accent);
}

/* Invisible bridge between dropdown trigger and menu to prevent hover loss */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}
