/* OpenCloud Portal - Brandis Intranet Style */
/* Basierend auf stadt-brandis.de Design */

:root {
    /* Brandis Farben - exakt wie Original */
    --color-primary: #e20613;
    --color-primary-dark: #b8050f;
    --color-text-dark: #32373c;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-text-muted: #abb8c3;
    --color-bg: #ffffff;
    --color-bg-light: #f9f9f9;
    --color-bg-footer: #32373c;
    --color-border: #e0e0e0;
    --color-link: #0073aa;

    /* Layout */
    --max-width: 1200px;
    --sidebar-width: 280px;
    --gap: 1.25em;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    font-size: 16px;
}

a {
    color: var(--color-link);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* ========================================
   TOP BAR - Sekundäre Navigation
   ======================================== */
.top-bar {
    background: var(--color-bg-light);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

.top-bar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.5rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
}

.top-bar a {
    color: var(--color-text-dark);
    text-decoration: none;
}

.top-bar a:hover {
    color: var(--color-primary);
}

.top-bar .search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--color-text-dark);
}

/* ========================================
   HEADER - Logo & Hauptnavigation
   ======================================== */
.site-header {
    background: var(--color-bg);
    border-bottom: 3px solid var(--color-primary);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    max-height: 60px;
    width: auto;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-branding h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-dark);
}

.site-branding .site-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

/* ========================================
   MAIN NAVIGATION - Brandis Style
   ======================================== */
.main-nav {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.main-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
}

.main-nav .nav-item {
    position: relative;
}

.main-nav .nav-item > a {
    display: block;
    padding: 1rem 1.25rem;
    color: var(--color-text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.main-nav .nav-item > a:hover,
.main-nav .nav-item.active > a {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Dropdown */
.main-nav .nav-item .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
}

.main-nav .nav-item:hover .dropdown {
    display: block;
}

.main-nav .dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--color-text-dark);
    border-bottom: 1px solid var(--color-border);
}

.main-nav .dropdown a:last-child {
    border-bottom: none;
}

.main-nav .dropdown a:hover {
    background: var(--color-bg-light);
    color: var(--color-primary);
}

/* Mobile Toggle */
.nav-toggle {
    display: none;
    background: var(--color-text-dark);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
}

/* ========================================
   LAYOUT
   ======================================== */
.page-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.layout {
    display: flex;
    gap: 2.5rem;
}

.sidebar {
    flex: 0 0 var(--sidebar-width);
}

.content {
    flex: 1;
    min-width: 0;
}

/* ========================================
   SIDEBAR - Tree Navigation
   ======================================== */
.sidebar-nav {
    background: var(--color-bg-light);
    border-radius: 4px;
    padding: 1rem;
}

.sidebar-nav .nav-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-nav .nav-item {
    margin-bottom: 0.125rem;
}

.sidebar-nav .nav-item > a {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--color-text);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.sidebar-nav .nav-item > a:hover {
    background: var(--color-border);
    color: var(--color-primary);
}

.sidebar-nav .nav-item.active > a {
    background: var(--color-primary);
    color: white;
}

/* Tree Arrows */
.sidebar-nav .nav-item.has-children > a::before {
    content: "›";
    margin-right: 0.5rem;
    font-weight: bold;
    transition: transform 0.2s;
}

.sidebar-nav .nav-item.has-children.open > a::before {
    transform: rotate(90deg);
}

.sidebar-nav .nav-children {
    display: none;
    margin-left: 1rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--color-border);
    margin-top: 0.25rem;
}

.sidebar-nav .nav-item.open > .nav-children {
    display: block;
}

/* ========================================
   BREADCRUMBS
   ======================================== */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

.breadcrumbs a {
    color: var(--color-text-light);
}

.breadcrumbs a:hover {
    color: var(--color-primary);
}

.breadcrumbs .separator {
    margin: 0 0.5rem;
    color: var(--color-text-muted);
}

/* ========================================
   ARTICLE CONTENT
   ======================================== */
article {
    max-width: 800px;
}

article h1 {
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin: 0 0 1rem;
    line-height: 1.2;
}

article h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
}

article h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin: 1.5rem 0 0.75rem;
}

article h1:first-child {
    margin-top: 0;
}

article p {
    margin: 1em 0;
}

article ul, article ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

article li {
    margin: 0.25em 0;
}

/* ========================================
   NEWS CARDS - Brandis Style
   ======================================== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
    margin: 1.5rem 0;
}

.news-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.news-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.news-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.news-card-content {
    padding: 1.25rem;
}

.news-card-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.news-card-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.news-card-title a {
    color: var(--color-text-dark);
    text-decoration: none;
}

.news-card-title a:hover {
    color: var(--color-primary);
}

.news-card-excerpt {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin: 0 0 1rem;
    line-height: 1.5;
}

.news-card-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-primary);
}

.news-card-link:hover {
    text-decoration: underline;
}

/* ========================================
   TOC - Inhaltsverzeichnis
   ======================================== */
.toc {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 4px 4px 0;
}

.toc h2 {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    padding: 0;
}

.toc ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style: none;
}

.toc li {
    margin: 0.375rem 0;
    position: relative;
}

.toc li::before {
    content: "–";
    position: absolute;
    left: -1rem;
    color: var(--color-text-muted);
}

.toc a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
}

.toc a:hover {
    color: var(--color-primary);
}

/* ========================================
   TABLES
   ======================================== */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5rem 0;
}

th, td {
    border: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
    text-align: left;
}

th {
    background: var(--color-bg-light);
    font-weight: 600;
    color: var(--color-text-dark);
}

tr:hover {
    background: var(--color-bg-light);
}

/* ========================================
   CODE
   ======================================== */
pre, code {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.9em;
}

code {
    background: var(--color-bg-light);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

pre {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    padding: 1rem;
    overflow-x: auto;
    border-radius: 4px;
}

pre code {
    background: none;
    padding: 0;
}

/* ========================================
   CALLOUTS
   ======================================== */
.callout {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    border-left: 4px solid;
}

.callout-icon {
    font-size: 1.25em;
    flex-shrink: 0;
}

.callout-content p {
    margin: 0;
}

.callout-info {
    background: #e7f3ff;
    border-color: #0073aa;
}

.callout-warning {
    background: #fff8e5;
    border-color: #ffb900;
}

.callout-tip {
    background: #edfaef;
    border-color: #46b450;
}

.callout-danger {
    background: #fbeaea;
    border-color: var(--color-primary);
}

/* ========================================
   DIRECTORY LISTING
   ======================================== */
.directory-listing {
    margin: 1.5rem 0;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: var(--color-bg-light);
}

.file-icon {
    margin-right: 0.75rem;
    font-size: 1.25em;
    color: var(--color-text-muted);
}

.file-item a {
    color: var(--color-text-dark);
    font-weight: 500;
}

.file-item a:hover {
    color: var(--color-primary);
}

.file-size {
    margin-left: auto;
    font-size: 0.85em;
    color: var(--color-text-muted);
}

/* ========================================
   CHILDREN LISTING
   ======================================== */
.children-listing {
    margin: 1.5rem 0;
}

.children-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.child-item {
    padding: 1.25rem;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    transition: all 0.2s;
}

.child-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(226, 6, 19, 0.1);
}

.child-item a {
    color: var(--color-text-dark);
    font-weight: 600;
    font-size: 1.05em;
}

.child-item a:hover {
    color: var(--color-primary);
}

.child-desc {
    margin: 0.5rem 0 0;
    font-size: 0.9em;
    color: var(--color-text-light);
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
    background: var(--color-bg-footer);
    color: white;
    margin-top: 3rem;
}

.footer-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: white;
}

.footer-section p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin: 0.5rem 0;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-section a:hover {
    color: white;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

.footer-bottom a {
    color: rgba(255,255,255,0.8);
    margin: 0 0.75rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 992px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        flex: none;
        width: 100%;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .nav-toggle {
        display: block;
    }

    .main-nav-inner {
        display: none;
        flex-direction: column;
        padding: 0;
    }

    .main-nav-inner.open {
        display: flex;
    }

    .main-nav .nav-item > a {
        border-bottom: 1px solid var(--color-border);
    }

    .main-nav .nav-item .dropdown {
        position: static;
        box-shadow: none;
        border: none;
        background: var(--color-bg-light);
    }

    .top-bar-inner {
        justify-content: center;
    }

    .footer-main {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* ========================================
   PRINT
   ======================================== */
@media print {
    .top-bar,
    .main-nav,
    .sidebar,
    .site-footer,
    .toc {
        display: none;
    }

    .site-header {
        border-bottom: 2px solid black;
    }

    .page-wrapper {
        padding: 0;
    }

    article {
        max-width: none;
    }
}
