/* public/css/wiki.css */

.wiki-article-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}
.wiki-article-content {
    padding-bottom: 2rem;
}
.wiki-article-content table {
    @apply table table-bordered table-hover table-sm w-100;
    display: table;
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.wiki-article-content pre {
    white-space: pre;
    overflow-x: auto;
    word-break: keep-all;

    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    display: block;
}

.wiki-article-content code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 0.3rem;
}

.wiki-article-content img {
    max-width: 90%;
    height: auto;
    display: block;
    margin: 2em auto;
}
/*Table of contents(TOC)*/

.table-of-contents {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 100%;
    overflow-x: auto;
}

.table-of-contents::before{
    content: var(--toc-label, "Table of Contents");
    display: block;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: .75rem;
    color: #343a40;
}

.table-of-contents ul {
    list-style-type: disc;
    padding-left: 1.25rem;
    margin: 0;
}

.table-of-contents ul ul {
    list-style-type: circle;
    padding-left: 1.25rem;
}

.table-of-contents ul ul ul {
    list-style-type: square;
    padding-left: 1.25rem;
}

.table-of-contents li {
    margin: 0.25rem 0;
}

.table-of-contents a {
    text-decoration: none;
    color: #007bff;
    transition: color 0.2s ease;
}

.table-of-contents a:hover {
    text-decoration: underline;
    color: #0056b3;
}

@media (max-width: 768px) {
    .table-of-contents {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }

    .table-of-contents::before {
        font-size: 1rem;
    }
}

/* markdown_table css */

.table-responsive {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.table-responsive table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Equal column widths */
    text-align: center;  /* Horizontal centering for cells */
}

.table-responsive th,
.table-responsive td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    vertical-align: middle; /* Vertical centering */
    word-wrap: break-word;
}

.table-responsive th {
    font-weight: bold;
    text-align: center; /* Header horizontally centered */
}

/*.table-responsive tr:nth-child(even) {*/
/*    background-color: #f8f9fa;*/
/*}*/

/*.table-responsive tr:hover {*/
/*    background-color: #e9ecef;*/
/*}*/

/* Optional alignment override if markdown sets specific alignment */
.table-responsive td[align="left"] {
    text-align: left;
}
.table-responsive td[align="center"] {
    text-align: center;
}
.table-responsive td[align="right"] {
    text-align: right;
}

/*blockquote*/
blockquote {
    border-left: 4px solid #ccc;
    padding: 0.5em 1em;
    margin: 1em 0;
    background-color: #f9f9f9;
    color: #555;
    font-style: italic;
    position: relative;
}

blockquote::before {
    content: "";
    font-size: 2em;
    color: #ccc;
    position: absolute;
    left: 10px;
    top: -10px;
    line-height: 1;
}

blockquote > p:last-child {
    margin-bottom: 0;
}

/*for easyMDE*/
button.table {
    width: unset !important;
    display: inline-block;
}
