/* Styles for post.php layout and navigation */
.post-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    max-width: 1200px;
    margin: 2em auto;
}

.post-main {
    background: #fff;
    padding: 2em 2.5em;
    border-radius: 12px;
    box-shadow: 0 2px 12px #0001;
}

.post-navigation {
    background: #f8fbff;
    border: 1.5px solid #e3eaf7;
    border-radius: 12px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-navigation h3 {
    color: #1976d2;
    margin: 0 0 1rem 0;
    font-size: 1.1em;
    border-bottom: 2px solid #e3eaf7;
    padding-bottom: 0.5rem;
}

.post-navigation h3.toggle-button {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s;
}
.post-navigation h3.toggle-button:hover {
    color: #0d47a1;
}
.post-navigation h3.toggle-button::after {
    content: '▶';
    font-size: 0.7em;
    transition: transform 0.2s;
}
.post-navigation h3.toggle-button.expanded::after {
    transform: rotate(90deg);
}

.post-navigation-section {
    /* This class is just for semantic separation, no styles needed */
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-list li {
    margin-bottom: 0.3rem;
}

.nav-list a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.9em;
    line-height: 1.3;
}

/* Styles for hierarchical menu in navigation */
.nav-list ul {
    list-style: none;
    padding-left: 1rem;
    margin-top: 0.3rem;
}
.nav-list > ul {
    padding-left: 0;
}
.nav-list li {
    position: relative;
}
.nav-list ul li a {
    font-size: 0.85em;
    color: #555;
    padding: 0.3rem 0.6rem;
}
.nav-list a.parent-item {
    font-weight: 600;
    color: #333;
}

.nav-list a:hover {
    background: #e3eaf7;
    color: #1976d2;
}

.nav-list a.active {
    background: #1976d2;
    color: #fff;
}

/* Indents for heading hierarchy */
.nav-list .level-1 { margin-left: 0; }
.nav-list .level-2 { margin-left: 1rem; }
.nav-list .level-3 { margin-left: 2rem; }
.nav-list .level-4 { margin-left: 3rem; }
.nav-list .level-5 { margin-left: 4rem; }
.nav-list .level-6 { margin-left: 5rem; }

.post-heading {
    scroll-margin-top: 2rem;
}

/* Responsiveness */
@media (max-width: 768px) {
    .post-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .post-navigation {
        position: static;
        order: -1;
    }
    
    .nav-list .level-2 { margin-left: 0.5rem; }
    .nav-list .level-3 { margin-left: 1rem; }
    .nav-list .level-4 { margin-left: 1.5rem; }
    .nav-list .level-5 { margin-left: 2rem; }
    .nav-list .level-6 { margin-left: 2.5rem; }
}