/* Wikiwand-style article layout */

.finepedia-theme.wiki-article-page.col-3cm .main-inner {
    max-width: none;
}

.wiki-article-page .main-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.wiki-article-layout {
    padding: 0px 0 40px;
}

.sidebar .wiki-toc-sticky-wrap {
    position: relative;
    margin-bottom: 20px;
}

.sidebar .wiki-toc-sticky-stack {
    position: sticky;
    top: var(--fp-toc-sticky-top, 20px);
    z-index: 5;
}

.sidebar .wiki-toc-sidebar {
    position: static;
    top: auto;
    overflow: visible;
    margin-bottom: 0;
    z-index: auto;
    background: transparent;
    padding: var(--fp-sidebar-pad-y) var(--fp-sidebar-pad-x);
    border-bottom: none;
}

.sidebar .wiki-toc-sticky-stack > .fp-recent-posts-widget {
    margin-top: 0;
    border-top: 1px solid var(--fp-border, #e8e8e8);
}

.sidebar .wiki-toc-nav {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    overflow: visible;
}

.wiki-toc-title {
    font-family: var(--fp-font);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fp-gray);
    border-bottom: none;
    padding: 0;
    margin: 0 0 12px;
}

.wiki-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wiki-toc-list--nested {
    margin: 0;
    padding: 0;
    border-left: none;
}

/* Nested sidebar TOC children */
.wiki-toc-nested {
    margin: 2px 0 4px;
    padding: 0 0 0 14px;
    list-style: none;
}

.wiki-toc-nested__item {
    margin: 0;
    padding: 0;
}

.wiki-toc-nested__row {
    display: flex;
    align-items: flex-start;
    min-height: 24px;
    margin: 0;
    padding: 0 0 0 8px;
}

.wiki-toc-nested__row.wiki-toc-row--leaf {
    padding-left: 8px;
}

.wiki-toc-nested__link {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    font-family: var(--fp-font);
    font-size: 0.89em;
    font-weight: 400;
    line-height: 1.45;
    padding: 2px 0;
    margin: 0 0 0 4px;
    color: #8a8a8a;
    text-decoration: none;
    border: none;
    border-radius: 0;
    transition: color 0.15s ease;
}

.wiki-toc-nested__link::before {
    content: "–";
    display: inline-block;
    margin-right: 6px;
    color: #8a8a8a;
}

.wiki-toc-nested__link:hover,
.wiki-toc-nested__link.active {
    color: var(--fp-teal-dark);
}

.wiki-toc-nested__link.active {
    font-weight: 700;
}

.wiki-toc-item {
    margin: 0;
    padding: 0;
}

.wiki-toc-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-height: 28px;
    margin: 0;
    padding: 0;
}

.wiki-toc-row--leaf {
    padding-left: 18px;
}

.wiki-toc-row > a {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    font-family: var(--fp-font);
    font-size: 0.875rem;
    line-height: 1.45;
    padding: 2px 0;
    margin: 0;
    color: var(--fp-dark);
    text-decoration: none;
    border: none;
    border-radius: 0;
    transition: color 0.15s ease;
}

.wiki-toc-list > .wiki-toc-item > .wiki-toc-row > a {
    font-weight: 500;
}

.wiki-toc-toggle {
    flex: 0 0 14px;
    width: 14px;
    height: 28px;
    background: transparent;
    border: none;
    color: #b0b0b0;
    padding: 0;
    margin: 0;
    line-height: 28px;
    cursor: pointer;
    text-align: center;
}

.wiki-toc-toggle:hover {
    color: var(--fp-teal-dark);
}

.wiki-toc-toggle i {
    font-size: 0.65rem;
    transition: transform 0.15s ease;
    vertical-align: middle;
}

.wiki-toc-item--has-children.is-expanded > .wiki-toc-row .wiki-toc-toggle i {
    transform: rotate(90deg);
}

.wiki-toc-item--has-children:not(.is-expanded) > .wiki-toc-list--nested,
.wiki-toc-item--has-children:not(.is-expanded) > .wiki-toc-nested {
    display: none;
}

.wiki-toc-list a:hover {
    color: var(--fp-dark);
}

.wiki-toc-list > .wiki-toc-item > .wiki-toc-row > a.active {
    color: var(--fp-teal-dark);
    font-weight: 700;
}

body:has(#wiki-toc-sidebar) #fp-article-content .fp-wiki-toc {
    display: none;
}

.wiki-article-main {
    background: #faf8f5;
    border-radius: 8px;
    padding: 28px 32px;
    min-width: 0;
}

.wiki-article-title {
    font-family: var(--fp-font);
    font-size: 2.375em;
    font-weight: 400;
    letter-spacing: -1px;
    line-height: 1.3em;
    color: var(--fp-dark);
    margin: 0 0 12px;
}

.wiki-article-lead {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 16px;
}

.wiki-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.82rem;
    color: #888;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8e4de;
}

.wiki-source-link {
    color: var(--fp-teal);
    text-decoration: none;
}

.wiki-featured-image {
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
}

.wiki-article-body {
    font-size: 1rem;
    line-height: 1.75;
    color: #333;
}

.wiki-content.wikiwand-style {
    background: transparent;
}

.wiki-content .infobox,
.wiki-content table.infobox,
.wiki-infobox .infobox {
    float: right;
    clear: right;
    width: 280px;
    margin: 0 0 16px 20px;
    background: #fff;
    border: 1px solid #ddd;
    font-size: 0.85rem;
}

.wiki-infobox th {
    text-align: left;
    padding: 6px 10px;
    background: #f0ebe3;
    font-weight: 600;
    vertical-align: top;
    width: 38%;
}

.wiki-infobox td {
    padding: 6px 10px;
    vertical-align: top;
}

.wiki-figure {
    margin: 1.5em 0;
    padding: 12px;
    background: #f5f2ed;
    border: 1px dashed #ccc;
    border-radius: 6px;
}

.wiki-figure figcaption {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.wiki-content .infobox,
.wiki-content table.infobox {
    float: right;
    clear: right;
    width: 280px;
    margin: 0 0 16px 20px;
    background: #fff;
    border: 1px solid #ddd;
    font-size: 0.85rem;
}

.wiki-content img {
    max-width: 100%;
    height: auto;
}

.wiki-content .wiki-heading {
    font-family: var(--fp-font);
    color: var(--fp-dark);
    margin: 2em 0 0.75em;
    scroll-margin-top: 20px;
    font-weight: 400;
    line-height: 1.3em;
}

.wiki-content h2 {
    font-size: 1.6rem;
}
.wiki-content h3 {
    font-size: 1.3rem;
}
.wiki-content a {
    color: var(--fp-teal);
}

.wiki-attribution {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #e8e4de;
    font-size: 0.82rem;
    color: #888;
}

/* Collapsed References section (article body) */
.wiki-references {
    margin: 2em 0 1em;
    border: 1px solid #e8e4de;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.wiki-references .wiki-references__heading,
.wiki-content .wiki-references .wiki-heading {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 1.15rem;
}

.wiki-references__title {
    font-family: var(--fp-font);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--fp-dark);
}

.wiki-references__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 14px 16px;
    border: none;
    background: #f3f1ec;
    color: var(--fp-dark);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.wiki-references__toggle:hover {
    background: #ebe7df;
}

.wiki-references__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    color: #666;
    line-height: 1;
    transition: transform 0.15s ease;
}

.wiki-references__icon i,
.wiki-references__icon::before {
    font-size: 0.85rem;
    line-height: 1;
}

/* Fallback chevron when Font Awesome icon markup is missing */
.wiki-references__icon:empty::before {
    content: "";
    display: block;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid #666;
    border-bottom: 2px solid #666;
    transform: rotate(45deg);
    margin-top: -0.2rem;
}

.wiki-references.is-expanded .wiki-references__icon {
    transform: rotate(180deg);
}

.wiki-references.is-expanded .wiki-references__icon:empty::before {
    margin-top: 0.15rem;
}

/* Collapsed by default — only show body when explicitly expanded via click */
.wiki-references__body {
    display: none;
    padding: 12px 16px 16px;
    border-top: 1px solid #e8e4de;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #444;
}

.wiki-references.is-expanded > .wiki-references__body {
    display: block;
}

.wiki-references:not(.is-expanded) > .wiki-references__body,
.wiki-references.is-collapsed > .wiki-references__body,
.wiki-references__body[hidden] {
    display: none !important;
}

.wiki-references__body .references,
.wiki-references__body ol.references,
.wiki-references__body ol.fp-wiki-import-list {
    margin: 0;
    padding-left: 1.25rem;
}

.wiki-references__body li {
    margin: 0 0 0.55em;
    padding-left: 0.15rem;
}

.wiki-references__body .wiki-ref-link,
.wiki-references__body .wiki-cite-link,
.wiki-content .wiki-cite-link {
    color: var(--fp-teal);
    text-decoration: none;
}

.wiki-references__body .wiki-ref-link:hover,
.wiki-content .wiki-cite-link:hover {
    text-decoration: underline;
}

.wiki-content sup.reference,
.wiki-content sup {
    font-size: 0.75em;
    line-height: 1;
}

/* Comments styles moved to public/css/comments.css */

.wiki-disqus-wrap {
    min-height: 200px;
}

@media (max-width: 1024px) {
    .sidebar .wiki-toc-sticky-wrap {
        height: auto !important;
    }

    .sidebar .wiki-toc-sticky-stack,
    .sidebar .wiki-toc-sidebar {
        position: static;
    }
}
