/* Shared rich text output from admin-managed wiki content. */

.custom-category-content {
    margin-top: 20px;
}

.toc-page-head {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    padding: 0 0 8px;
    color: #1f0e02;
}

.toc-page-head h1 {
    margin: 0;
    color: #1f0e02;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2em;
    font-weight: 400;
    line-height: 1;
    text-shadow: none;
}

.toc-page-head .catalog-separator {
    height: 1px;
    background: #8c2a3d;
    box-shadow: none;
}

.toc-contents-box {
    display: inline-block;
    min-width: 265px;
    margin: 14px 0 34px;
    padding: 14px 18px 16px;
    border: 1px solid #777;
    background: #fbfbfb;
    color: #000;
    font-size: 12px;
    line-height: 1.35;
}

.toc-contents-title {
    margin-bottom: 6px;
    color: #000;
    font-size: 14px;
}

.toc-contents-title strong {
    font-weight: 700;
}

.toc-contents-title span {
    margin-left: 6px;
    font-size: 10px;
    font-weight: 400;
}

.toc-contents-box ol {
    margin: 0;
    padding-left: 20px;
}

.toc-contents-box li {
    margin: 2px 0;
}

.toc-contents-box a,
.toc-top-link a {
    color: #24180d;
    text-decoration: underline;
}

.toc-contents-box a:hover,
.toc-top-link a:hover {
    color: #990000;
}

.toc-page-intro {
    margin: 0 0 38px;
    color: #111;
    font-size: 12px;
    line-height: 1.45;
}

.toc-page-intro h2,
.toc-section h2 {
    margin: 1.5em 0 0.5em;
    overflow: hidden;
    border-bottom: 2px solid #990000;
    color: #000;
    font-family: "Quattrocento", "Trebuchet MS", "Linux Libertine", "Times New Roman", serif;
    font-size: 1.7em;
    font-weight: 400;
    line-height: 1.25;
    text-shadow: none;
}

.toc-page-intro p {
    max-width: 860px;
    margin: 0 0 1.1em;
}

.toc-section {
    margin-top: 42px;
}

.toc-section-description {
    margin: -4px 0 10px;
    color: #21180e;
    font-size: 12px;
    line-height: 1.4;
}

.toc-empty-section {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #86664a;
    background: #f5f5dc;
    color: #5f4b3d;
    font-size: 12px;
}

.toc-top-link {
    margin: 12px 0 0;
    text-align: right;
}

.toc-top-link a {
    font-size: 13px;
}

.wiki-table-wrap {
    width: 100%;
    overflow-x: auto;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    scrollbar-width: thin;
}

.wiki-table-wrap::-webkit-scrollbar {
    height: 10px;
}

.wiki-table-wrap::-webkit-scrollbar-track {
    background:
        linear-gradient(180deg, rgba(255, 253, 238, 0.72), rgba(224, 204, 150, 0.48)),
        var(--scrollbar-track);
    box-shadow: inset 0 0 0 1px rgba(91, 56, 24, 0.16);
}

.wiki-table-wrap::-webkit-scrollbar-thumb {
    border: 3px solid var(--scrollbar-edge);
    border-radius: 999px;
    background:
        linear-gradient(90deg, #b45a43, var(--scrollbar-thumb) 52%, #5d3210);
    background-clip: padding-box;
}

.wiki-table-wrap::-webkit-scrollbar-thumb:hover {
    background:
        linear-gradient(90deg, #c16d4c, var(--scrollbar-thumb-hover) 58%, #3a1209);
    background-clip: padding-box;
}

.wiki-item-table {
    width: 100%;
}

.wiki-content-table {
    width: auto !important;
    max-width: 100%;
}

.wiki-item-table,
.wiki-content-table {
    table-layout: auto;
    margin: 1em 1em 1em 0;
    border: 1px solid #000;
    border-collapse: collapse;
    border-spacing: 0;
    empty-cells: show;
    background: #f0d9a2;
    color: #000;
    font: inherit;
}

.wiki-content-table caption {
    padding: 2px;
    border: 1px solid #97100d;
    background: #2f1d1f;
    color: #f0d9a2;
    font-size: 1em;
    font-weight: 700;
    line-height: 2em;
    text-align: center;
    text-shadow: none;
}

.wiki-content-table caption h2,
.wiki-content-table caption h3,
.wiki-content-table caption h4,
.wiki-content-table caption p,
.wiki-content-table .wiki-content-table-title-cell h2,
.wiki-content-table .wiki-content-table-title-cell h3,
.wiki-content-table .wiki-content-table-title-cell h4,
.wiki-content-table .wiki-content-table-title-cell p,
.wiki-item-table .wiki-content-table-title-cell h2,
.wiki-item-table .wiki-content-table-title-cell h3,
.wiki-item-table .wiki-content-table-title-cell h4,
.wiki-item-table .wiki-content-table-title-cell p {
    margin: 0;
    overflow: visible;
    border: 0;
    color: inherit;
    font: inherit;
    text-shadow: none;
}

.wiki-item-table th,
.wiki-item-table td,
.wiki-content-table th,
.wiki-content-table td {
    box-sizing: content-box;
    padding: 2px;
    border: 1px solid #000;
    vertical-align: middle;
}

.wiki-content-table .wiki-content-cell-valign-top img,
.wiki-content-table th[style*="vertical-align: top"] img,
.wiki-content-table th[style*="vertical-align:top"] img,
.wiki-content-table td[style*="vertical-align: top"] img,
.wiki-content-table td[style*="vertical-align:top"] img {
    vertical-align: top !important;
}

.wiki-content-table .wiki-content-cell-valign-middle img,
.wiki-content-table th[style*="vertical-align: middle"] img,
.wiki-content-table th[style*="vertical-align:middle"] img,
.wiki-content-table td[style*="vertical-align: middle"] img,
.wiki-content-table td[style*="vertical-align:middle"] img {
    vertical-align: middle !important;
}

.wiki-content-table .wiki-content-cell-valign-bottom img,
.wiki-content-table th[style*="vertical-align: bottom"] img,
.wiki-content-table th[style*="vertical-align:bottom"] img,
.wiki-content-table td[style*="vertical-align: bottom"] img,
.wiki-content-table td[style*="vertical-align:bottom"] img {
    vertical-align: bottom !important;
}

.wiki-item-table th,
.wiki-content-table th {
    background: #2f1d1f;
    color: #f0d9a2;
    font-weight: 700;
    text-align: center;
    text-shadow: none;
}

.wiki-item-table td,
.wiki-content-table td {
    background: #f0d9a2;
}

.wiki-item-table img,
.wiki-content-table img {
    vertical-align: middle;
}

.wiki-content-table-title-row {
    border: 1px solid #2f1d1f;
    background: #2f1d1f;
    color: #f0d9a2;
}

.wiki-item-table .wiki-content-table-title-cell,
.wiki-content-table .wiki-content-table-title-cell {
    border: 1px solid #97100d;
    background: transparent;
    color: inherit;
    font-size: 1em;
    font-weight: 700;
    line-height: 2em;
    text-align: center;
    text-shadow: none;
}

/* Keep the authored/TOC grid dark when the late responsive stylesheet
   applies its softer generic border colour to other page tables. */
.content-wrap .wiki-item-table,
.content-wrap .wiki-content-table,
.content-wrap .wiki-item-table th,
.content-wrap .wiki-item-table td,
.content-wrap .wiki-content-table th,
.content-wrap .wiki-content-table td {
    border-color: #000;
}

.content-wrap .wiki-item-table .wiki-content-table-title-cell,
.content-wrap .wiki-content-table .wiki-content-table-title-cell {
    border-color: #97100d;
}

.toc-grid-empty {
    color: #5f4b3d;
    text-align: center;
}

.wiki-rich-content {
    overflow-wrap: anywhere;
    color: #2f1809;
}

.wiki-rich-content > *:first-child {
    margin-top: 0;
}

.wiki-rich-content h2,
.wiki-rich-content h3,
.wiki-rich-content h4 {
    color: #000;
    font-family: "Quattrocento", "Trebuchet MS", "Linux Libertine", "Times New Roman", serif;
    font-weight: 400;
    line-height: 1.25;
    text-shadow: none;
}

.wiki-rich-content h2 {
    margin: 1.5em 0 0.5em;
    overflow: hidden;
    border-bottom: 2px solid #990000;
    font-size: 1.7em;
}

.wiki-rich-content h3 {
    margin: 18px 0 8px;
    font-size: 1.25rem;
}

.wiki-rich-content p,
.wiki-rich-content li {
    font-size: 0.95rem;
}

.wiki-rich-content a {
    color: #88283a;
    font-weight: 900;
}

.wiki-item-table p,
.wiki-item-table li,
.wiki-content-table p,
.wiki-content-table li {
    font-size: inherit;
    line-height: inherit;
}

.wiki-item-table p,
.wiki-content-table p {
    margin: 0.4em 0 0.5em;
    line-height: 1.5em;
}

.wiki-item-table ul,
.wiki-item-table ol,
.wiki-content-table ul,
.wiki-content-table ol {
    margin: 0;
    padding-left: 18px;
}

.wiki-item-table a,
.wiki-content-table a {
    color: #1e0d00;
    font-weight: inherit;
}

.wiki-item-table a:hover,
.wiki-content-table a:hover {
    color: #990000;
}

.wiki-rich-content sub,
.wiki-rich-content sup {
    line-height: 0;
}

.wiki-content-lead {
    color: #5d3210;
    font-size: 1.08rem;
    font-weight: 900;
}

.wiki-content-muted {
    color: var(--muted);
    font-weight: 800;
}

.wiki-content-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border: 1px solid #5d3210;
    border-radius: 999px;
    background: #5d3210;
    color: #fff8df;
    font-size: 0.78rem;
    font-weight: 900;
}

.wiki-content-anchor {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 1px 7px;
    border: 1px dashed #8f6a47;
    border-radius: 4px;
    background: rgba(255, 248, 223, 0.85);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
}

.wiki-entity-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    min-height: 0;
    margin: 0 2px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #990000;
    font: inherit;
    line-height: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    vertical-align: -0.3em;
}

.wiki-entity-link:visited {
    color: #990000;
}

.wiki-entity-link:hover {
    background: transparent;
    color: #990000;
    text-decoration: none;
}

.wiki-entity-link--mob > img {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    object-fit: contain;
}

.wiki-entity-link-icon {
    display: inline-block;
    border: 1px solid #8f6a47;
    border-radius: 3px;
    background: #ead8a3;
}

.wiki-entity-link > span:not(.shop-tooltip):not(.wiki-entity-link-icon) {
    display: inline;
    min-width: 0;
}

.wiki-entity-link > strong,
.wiki-entity-link > small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wiki-entity-link > strong {
    display: inline;
    color: inherit;
    font: inherit;
}

.wiki-entity-link > small {
    display: none;
}

.wiki-entity-link--item {
    position: relative;
    color: #990000;
}

.wiki-entity-link--mob {
    color: #990000;
}

.wiki-entity-link--item .shop-tooltip,
.wiki-entity-link--item .shop-tooltip * {
    text-decoration: none;
}

.wiki-rich-content blockquote {
    margin: 16px 0;
    padding: 12px 14px;
    border-left: 4px solid #7d321d;
    background: rgba(245, 223, 152, 0.48);
    color: #2f1809;
    font-weight: 800;
}

.wiki-rich-content hr {
    height: 1px;
    margin: 22px 0;
    border: 0;
    background: #b49663;
}

.wiki-content-box {
    margin: 18px 0;
    padding: 14px 16px;
    border: 1px solid #8b6040;
    border-radius: 8px;
    background: #fff9df;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.32);
}

.wiki-content-box h3 {
    margin-top: 0;
}

.wiki-content-box--info {
    border-color: var(--accent-strong);
    background: #eee6d2;
}

.wiki-content-box--warning {
    border-color: var(--accent);
    background: #f1dcc4;
}

.wiki-content-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.wiki-content-columns > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(143, 106, 71, 0.68);
    border-radius: 8px;
    background: rgba(255, 248, 223, 0.72);
}

.wiki-content-image {
    margin: 18px 0;
    text-align: center;
}

.wiki-content-image img {
    display: block;
    width: min(100%, 720px);
    max-height: 520px;
    margin: 0 auto;
    border: 1px solid #8f6a47;
    border-radius: 8px;
    background: #fff8df;
    object-fit: contain;
    box-shadow: var(--shadow);
}

.wiki-content-image figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.wiki-content-media {
    box-sizing: border-box;
    display: block;
    width: min(100%, 840px);
    max-width: 100%;
    margin: 28px auto;
    padding: 9px;
    border: 2px solid #88283a;
    border-radius: 0;
    background: rgba(247, 239, 203, 0.5);
    text-align: center;
}

.wiki-content-media--moved {
    position: relative;
    z-index: 1;
}

.wiki-content-media img,
.wiki-content-media video {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-height: min(70vh, 640px);
    margin: 0 auto;
    border: 2px solid #1b120c;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    object-fit: contain;
}

.wiki-content-media video {
    height: auto;
}

.wiki-content-media[style*="height"] img,
.wiki-content-media[style*="height"] video {
    height: 100%;
    max-height: none;
}

.wiki-rich-content pre,
.wiki-content-code {
    overflow-x: auto;
    margin: 18px 0;
    padding: 12px;
    border: 1px solid #7d321d;
    border-radius: 8px;
    background: #251006;
    color: #fff4cf;
    white-space: pre;
}

@media (max-width: 900px) {
    .wiki-content-columns {
        grid-template-columns: 1fr;
    }
}
