/* Wiki info icon behind page headings (#456) */
.wiki-info-icon {
    margin-left: 0.4rem;
    color: var(--bs-info);
    font-size: 0.7em;
    vertical-align: middle;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.15s ease;
}

.wiki-info-icon:hover,
.wiki-info-icon:focus {
    opacity: 1;
}

/* Public wiki page (#441) */
.wiki-page {
    max-width: 1100px;
    margin: 0 auto;
}

.wiki-sidebar {
    position: sticky;
    top: 1rem;
}

.wiki-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 70vh;
    max-height: 70dvh;
    overflow-y: auto;
}

.wiki-list-item {
    display: block;
    padding: 0.5rem 0.5rem 0.5rem 0;
    border-radius: 0.4rem;
    text-decoration: none;
    color: inherit;
    border-left: 3px solid transparent;
}

.wiki-list-item:hover {
    background: rgba(var(--app-neutral-rgb), 0.1);
}

.wiki-list-item.active {
    background: var(--bs-info-bg-subtle);
    border-left-color: var(--bs-info);
    padding-left: 0.5rem;
}

.wiki-list-item__title {
    display: block;
    font-weight: 600;
}

.wiki-list-item__subtitle {
    display: block;
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
}

.wiki-article .wiki-text {
    line-height: 1.6;
    white-space: normal;
}

.wiki-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.wiki-image {
    height: 160px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
    border: 1px solid rgba(var(--app-neutral-rgb), 0.2);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.wiki-image:hover {
    transform: scale(1.03);
}

/* Lightbox overlay for wiki images (#441) */
.wiki-image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(var(--app-black-rgb), 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
}

.wiki-image-overlay img {
    max-height: 85vh;
    max-height: 85dvh;
    max-width: 90vw;
    object-fit: contain;
    border-radius: 4px;
}

/* Mobile: hide the inline right column — on tap the article opens in the
   shared showOverlay modal instead (see wiki.js#_openDetailOverlay). */
@media (max-width: 767.98px) {
    .wiki-content-col {
        display: none;
    }
}

/* Admin image upload previews (#441) */
.wiki-image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.wiki-image-preview {
    position: relative;
}

.wiki-image-preview img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 0.4rem;
    border: 1px solid rgba(var(--app-neutral-rgb), 0.3);
}

/* The same corner X as the forum's image preview, and since #706 the same
   component — a `CloseButton` in the danger role. Only the geometry is still
   written twice. */
.wiki-image-preview .wiki-img-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* The screenshot at the top of an article (#747): the page it describes, as
   wide as the article and in its own 16:10 shape — not a 160px thumbnail like
   the uploaded images. A tap still opens it in the lightbox. */
.wiki-screenshot {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.wiki-screenshot:hover {
    transform: none;
}
