/* Sauber: Clean content/design separation */

/* Home icon */
.home-icon {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary, #000044);
    color: #fff;
    border-radius: 50%;
    text-decoration: none !important;
    font-size: 18px;
    line-height: 1;
    transition: background 0.15s;
}
.home-icon:hover { background: var(--accent, #8b0000); color: #fff; }
:root {
    --primary: #000044;
    --accent: #8b0000;
    --text: #2a2a3a;
    --light: #fafaf8;
    --border: #e0ddd8;
    --sidebar-w: 260px;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--light);
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent); }

/* Layout */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.site-header h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.02em;
}
.site-header h1 a { color: inherit; }
.site-header .edit-toggle {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--primary);
    transition: all 0.15s;
}
.site-header .edit-toggle:hover { background: var(--primary); color: #fff; }
.site-header .edit-toggle.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.site-body { display: flex; min-height: calc(100vh - 64px - 48px); }

nav.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 24px 0;
}
nav.sidebar a {
    display: block;
    padding: 8px 24px;
    font-size: 0.9rem;
    color: var(--text);
    border-left: 3px solid transparent;
}
nav.sidebar a:hover { background: var(--light); color: var(--primary); }
nav.sidebar a.active {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

/* Hierarchical nav children */
nav.sidebar .nav-children {
    background: #f8f8f6;
    border-left: 1px solid var(--border);
    margin-left: 16px;
    padding: 4px 0;
}
nav.sidebar .nav-children a.nav-child {
    display: block;
    padding: 4px 12px 4px 16px;
    font-size: 0.8rem;
    color: #555;
    border-left: 2px solid transparent;
    line-height: 1.4;
}
nav.sidebar .nav-children a.nav-child:hover {
    background: #f0efe8;
    color: var(--primary);
}
nav.sidebar .nav-children a.nav-child.active {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

main {
    flex: 1;
    min-width: 0;
    padding: 40px 48px;
    max-width: 800px;
}
main h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.6em;
}
main h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary);
    margin: 1.2em 0 0.4em;
}
main p { margin-bottom: 0.8em; }
main hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
main blockquote {
    border-left: 3px solid var(--accent);
    margin: 1em 0;
    padding: 0.5em 1em;
    color: #555;
    font-style: italic;
}
main ul { margin: 0.5em 0 1em 1.5em; }
main li { margin-bottom: 0.3em; }
main img.content-image {
    max-width: 100%;
    height: auto;
}

.page-title {
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 0.3em;
    font-weight: 600;
}
.page-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5em;
    font-style: italic;
}
.page-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1.5em;
    letter-spacing: 0.02em;
}

.content-with-image { display: flex; gap: 24px; }
.content-with-image .content-text { flex: 1; }
.content-with-image .content-img {
    flex-shrink: 0;
    width: 220px;
}
.content-with-image .content-img img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Footer */
.site-footer {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    font-size: 0.8rem;
    color: #999;
    border-top: 1px solid var(--border);
    background: #fff;
}
.site-footer a { color: #999; }
.site-footer a:hover { color: var(--accent); }

/* Info Tooltip */
.info-tooltip {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000;
}
.info-tooltip .info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
    border: none;
}
.info-tooltip .info-btn:hover { background: var(--accent); }
.info-tooltip .tooltip-text {
    display: none;
    position: absolute;
    top: 36px;
    right: 0;
    width: 340px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}
.info-tooltip:hover .tooltip-text { display: block; }

/* Editor overlay */
.editor-bar {
    display: none;
    background: #f5f5f0;
    border-bottom: 1px solid var(--border);
    padding: 8px 48px;
}
.editor-bar.visible { display: flex; gap: 10px; align-items: center; }
.editor-bar button {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
}
.editor-bar button.save-btn { background: var(--primary); color: #fff; border-color: var(--primary); }
.editor-bar button.save-btn:hover { background: var(--accent); border-color: var(--accent); }
.editor-bar .status { font-size: 0.8rem; color: #888; margin-left: auto; }

/* Trumbowyg overrides */
.trumbowyg-box { border-radius: 4px; }

/* Responsive */
@media (max-width: 768px) {
    .site-body { flex-direction: column; }
    nav.sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 12px 0; display: block; }
    nav.sidebar a { padding: 6px 12px; border-left: none; }
    nav.sidebar .nav-children { margin-left: 8px; }
    nav.sidebar .nav-children a.nav-child { padding: 3px 8px 3px 12px; }
    main { padding: 24px 16px; }
    .content-with-image { flex-direction: column; }
    .content-with-image .content-img { width: 100%; max-width: 300px; }
}
