:root {
    --layout-max-width: 1300px;
    --sidebar-width: 325px;
}

html.layout-narrow {
    --layout-max-width: 1200px;
    --sidebar-width: 300px;
}

.page-wrapper {
    max-width: var(--layout-max-width);
    margin: 0 auto;
    width: 100%;
    flex-grow: 1;
    padding: 40px 20px;
}

/* --- 1. Centered Header --- */
.page-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 0 20px;
}

.page-title {
    font-family: var(--font-head);
    font-size: 3.5rem;
    margin: 0 0 15px 0;
    line-height: 1.1;
    color: var(--text-main);
}

.page-subtitle {
    font-family: var(--font-mono);
    color: var(--accent);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.intro-text {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-top: 15px;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* --- 2. Separator Container --- */
.layout-separator-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    width: 100%;
}

.layout-separator-line {
    border: 0;
    height: 2px;
    background: var(--text-main);
    flex-grow: 1;
    opacity: 0.2;
}

.layout-toggle-btn {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-light);
    background: none;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    padding: 0;
    transition: color 0.2s;
    white-space: nowrap;
}

.layout-toggle-btn:hover {
    color: var(--accent);
}

/* --- 3. Grid Structure --- */
.layout-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 50px;
    align-items: flex-start;
}

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

.sidebar-column.collapsed {
    display: none;
}

.main-column {
    min-width: 0;
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

/* --- Grids and Lists --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.blog-list-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 900px) {
    .page-title {
        font-size: 2.5rem;
    }

    .layout-toggle-btn {
        display: none;
    }

    .layout-separator-container {
        display: block;
    }

    .layout-separator-line {
        width: 100%;
        display: block;
    }

    .layout-grid {
        display: flex;
        flex-direction: column;
    }

    .sidebar-column {
        order: 2;
        width: 100%;
    }

    /* Force uncollapse on mobile */
    .sidebar-column.collapsed {
        display: block;
    }

    .main-column {
        order: 1;
        width: 100%;
    }
}

.hidden {
    visibility: hidden;
    display: none;
}
