/* Global Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

.row {
    width: 100%;
}


/* Sidebar Content */
.sidebar-content {
    position: sticky;
    top: 75px;
    /* Adjust based on your navbar height or desired offset */
    /* max-height: 100%;  */
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    /* Allows scrolling if content exceeds max-height */
    padding: 15px;
    background-color: #f8f9fa;
    /* Additional styling as needed */
}

/* TOC Container */
.sidebar .nav-link {
    color: var(--bs-primary);
    font-weight: 600;
}

.sidebar .nav-link:hover {
    color: var(--bs-success-dark);
    text-decoration: underline;
    transition: transform 0.3s ease;
}

.sidebar ul {
    list-style-type: none;
    /* Removes bullets from all lists */
}

.sidebar li {
    margin-left: 0;
    /* Reset margin */
}

.toc ul ul {
    padding-left: 15px;
    /* Indent nested lists */
}

.sidebar a {
    text-decoration: none;
    color: var(--bs-primary);
    display: block;
    padding: 5px 0;
}

.sidebar a.active {
    font-weight: bold;
}

.sidebar a:hover {
    color: var(--bs-success-dark);
    text-decoration: underline;
    transition: transform 0.3s ease;
}

.sidebar .nav-link.dropdown-toggle::after {
    transform: rotate(-90deg);
    /* Initial arrow pointing right */
    transition: transform 0.3s ease;
    /* Smooth rotation */
}

/* Rotate the arrow when the dropdown is open */
.sidebar .nav-link.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(0deg);
    /* Arrow pointing down */
}

/* Arrow Indicator Styling for Buttons */

/* Article container */
.article {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 50px;
}

/* Article Header */
.article-header {
    margin-bottom: 30px;
    text-align: center;
}

/* Article Title */
.article-title {
    font-size: 2.5rem;
    color: var(--bs-primary);
    font-weight: 700;
    margin-bottom: 10px;
}

/* Article Meta */
.article-meta {
    font-size: 1rem;
    color: #6c757d;
    text-align: center;
}

.article-meta .tags {
    display: inline;
    /* Ensure tags are inline */
}
p.image-for-representation {
    font-size: 0.75em;
}

.tag-link {
    color: var(--bs-primary);
    text-decoration: none;
}

.tag-link:hover {
    color: var(--bs-success-dark);
    text-decoration: underline;
}

.comma {
    color: #6c757d;
    /* Same color as the meta text */
}

/* Article Image */
.article-image {
    width: 50%;
    height: auto;
    align-content: center;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Article Body */
.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    padding-top: 20px;
    
}

.article-body p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.article-body blockquote {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-left: 5px solid var(--bs-primary);
    margin: 20px 0;
    font-size: 1.2rem;
    font-style: italic;
    color: #555;
}

/* Divider (hr) */
hr {
    border-top: 1px solid #dee2e6;
    margin: 30px 0;
}

/* Gallery */
.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px;
}

.gallery a {
    flex: 1 1 calc(33.33% - 16px);
    max-width: calc(33.33% - 16px);
    text-align: center;
    text-decoration: none;
    /* Remove underline from text */
    color: inherit;
    /* Maintain the text color */
}

.gallery-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    object-position: top;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-caption {
    margin-top: 8px;
    font-size: 14px;
    color: #333;
}

.gallery-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Comments Section */
.article-comments h2 {
    font-size: 2rem;
    color: var(--bs-primary);
    margin-bottom: 20px;
}

.article-comments {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    /* Bootstrap's md breakpoint */
    /* Adjustments for medium screens */
}

@media (max-width: 767.98px) {

    /* Bootstrap's sm breakpoint */
    /* Stack sidebar and content vertically */
    .sidebar-content {
        position: static;
        /* Disable sticky on small screens */
        max-height: none;
        overflow-y: visible;
    }
}

/* Author Bio Section */
.author-bio {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.author-bio h2 {
    font-size: 2rem;
    color: var(--bs-primary);
    margin-bottom: 20px;
    text-align: center;
}

.author-bio .author-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.author-bio .author-details img {
    max-width: 150px;
    border-radius: 50%;
    margin-right: 20px;
    margin-bottom: 20px;
}

.author-bio .author-details p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    flex: 1;
}

/* Comments Section */
.article-comments {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-top: 50px;
    margin-bottom: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-comments h2 {
    font-size: 2rem;
    color: var(--bs-primary);
    margin-bottom: 30px;
    text-align: center;
}

/* Individual Comment */
.comment {
    border-bottom: 1px solid #dee2e6;
    padding: 20px 0;
}

.comment:last-child {
    border-bottom: none;
}

.comment .comment-author {
    font-weight: bold;
    color: var(--bs-primary);
    margin-bottom: 5px;
}

.comment .comment-date {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 10px;
}

.comment .comment-content {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 10px;
}

.comment .reply-button {
    font-size: 0.9rem;
    color: var(--bs-primary);
    text-decoration: none;
}

.comment .reply-button:hover {
    text-decoration: underline;
}

/* Comment Form */
.comment-form {
    margin-top: 40px;
}

.comment-form h3 {
    font-size: 1.5rem;
    color: var(--bs-primary);
    margin-bottom: 20px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 1rem;
}

.comment-form button {
    background-color: var(--bs-primary);
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}

.comment-form button:hover {
    background-color: darken(var(--bs-primary), 10%);
}

/* Code Block Header */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f1f1f1;
    padding: 5px 10px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    font-family: monospace;
    margin-top: 20px;
}

.code-lang-label {
    font-weight: bold;
    color: #333;
}

.copy-code-button {
    background: none;
    border: none;
    color: var(--bs-primary);
    cursor: pointer;
    font-size: 1rem;
}

.copy-code-button:hover {
    color: #0056b3;
}

/* Adjust code block styles to account for the header */
pre {
    margin-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    position: relative;
    background-color: #f8f9fa;
    padding: 15px;
    overflow: auto;
}

pre code {
    display: block;
}