/* ==========================================================================
   notes.css — Styles for the /notes section (index + post pages)
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Index page — hide sidebar on smaller screens
   --------------------------------------------------------------------------- */
@media (max-width: 980px) {
    #sidebar {
        display: none;
    }
}

/* Override main.css button zero-padding on small screens */
@media screen and (max-width: 480px) {
    #pagination .button {
        padding-left: 1.5em !important;
        padding-right: 1.5em !important;
    }

    .post-content .button,
    #posts-container .button {
        padding-left: 1.5em !important;
        padding-right: 1.5em !important;
    }
}

/* ---------------------------------------------------------------------------
   Post page — meta row, tags, content, TOC
   --------------------------------------------------------------------------- */

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.post-meta span:not(:last-child)::after {
    content: " |";
    margin-left: 1rem;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: center;
}

.tag {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: 3px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.3s;
}

.tag:hover {
    opacity: 0.8;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.post-content table th,
.post-content table td {
    padding: 0.75rem;
    border: 1px solid #ddd;
    text-align: left;
}

.post-content table th {
    font-weight: bold;
}

.post-content ul,
.post-content ol {
    margin: 1rem 0;
    margin-left: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

/* ---------------------------------------------------------------------------
   Table of contents sidebar
   --------------------------------------------------------------------------- */

#toc-sidebar {
    position: sticky;
    top: 2rem;
}

#toc-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ddd;
}

#toc-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#toc-content li {
    margin-bottom: 0.5rem;
}

#toc-content a {
    color: #007acc;
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    padding: 0.3rem 0;
    transition: color 0.2s;
}

#toc-content a:hover {
    color: #0056b3;
    text-decoration: underline;
}

#toc-content ul ul {
    margin-left: 1.2rem;
    margin-top: 0.3rem;
}

#toc-content>ul>li {
    font-weight: 500;
    margin-bottom: 0.8rem;
}

#toc-content>ul>li ul a {
    font-weight: normal;
}

/* Hide TOC sidebar on medium and smaller screens */
@media screen and (max-width: 1024px) {
    #toc-sidebar {
        display: none;
    }
}