/* Application frame, masthead, side navigation, and page shell. */

.site-footer {
    position: relative;
    z-index: 1;
}

.wiki-masthead {
    --wiki-sidebar-track: 14em;
    --wiki-logo-track: 19em;
    --wiki-content-track: 1000px;
    --wiki-user-track: 9.5rem;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: var(--wiki-logo-track) minmax(220px, 1fr) var(--wiki-user-track);
    column-gap: 0;
    align-items: center;
    height: 68px;
}

.wiki-logo {
    display: block;
    min-width: 0;
    width: 100%;
    line-height: 1;
    text-decoration: none;
}

.wiki-logo:hover {
    text-decoration: none;
}

.wiki-header-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    align-items: center;
    justify-self: start;
    width: var(--wiki-content-track);
    max-width: 100%;
    min-width: 0;
    background: #fff;
}

.wiki-header-search .search-autocomplete {
    min-width: 0;
}

.wiki-header-search input {
    width: 100%;
    padding: 0 20px;
    border: 0;
    border-radius: 0;
    color: #222;
    font-size: 1.25em;
    outline: 0;
    box-shadow: none;
}

.wiki-header-search input::placeholder {
    color: #767676;
    opacity: 1;
}

.wiki-header-search button {
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    width: 72px;
    padding: 0;
    border: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0;
    background: linear-gradient(180deg, #fffdf6, #f4ead3);
    color: transparent;
    cursor: pointer;
    box-shadow: none;
    text-shadow: none;
    transition: background 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.wiki-header-search button::before {
    width: 30px;
    height: 30px;
    background: url("../../media/ui/search-ltr.png") center / contain no-repeat;
    content: "";
    transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.wiki-header-search button:hover {
    background: linear-gradient(180deg, #fff7df, #ead7ad);
    box-shadow: inset 0 0 0 1px rgba(136, 40, 58, 0.16), inset 0 8px 18px rgba(255, 255, 255, 0.44);
}

.wiki-header-search button:hover::before,
.wiki-header-search button:focus-visible::before {
    filter: brightness(1.04) saturate(1.08);
    transform: scale(1.08);
}

.wiki-header-search button:active {
    background: linear-gradient(180deg, #ead7ad, #fff7df);
    box-shadow: inset 0 2px 5px rgba(41, 18, 4, 0.22);
}

.wiki-header-search button:active::before {
    transform: scale(0.96);
}

.wiki-header-search button:focus-visible {
    outline: 2px solid rgba(136, 40, 58, 0.34);
    outline-offset: -3px;
}

.app-frame {
    display: grid;
    grid-template-columns: 14em 1000px;
    align-items: start;
    width: min(100em, calc(100% - 2em));
    min-height: 700px;
    gap: 0;
    margin: 194px auto 0;
}

.wiki-sidebar {
    display: grid;
    align-content: start;
    gap: 0;
    width: 14em;
    padding-right: 1em;
}

.wiki-side-panel {
    width: 100%;
    padding: 1.45em 1.5em 1.35em;
    margin: 0 0 1.45em;
    line-height: 1.1;
}

.wiki-side-panel h2 {
    line-height: 1.1;
}

.wiki-side-heading-link {
    color: inherit;
    text-decoration: none;
}

.wiki-side-heading-link:hover,
.wiki-side-heading-link.is-active {
    color: #fff4bf;
    text-decoration: underline;
}

.wiki-side-link {
    display: block;
    margin: 0 0 0.35em;
    font-size: 1em;
    line-height: 1.28;
    text-decoration: none;
}

.wiki-side-link:hover,
.wiki-side-link.is-active {
    text-decoration: underline;
}

.wiki-side-static-links {
    display: grid;
    gap: 0.24em;
}

.wiki-side-tree,
.wiki-side-tree-list {
    margin: 0;
    padding: 0;
}

.wiki-side-tree {
    font-family: Tahoma, Arial, sans-serif;
}

.wiki-side-tree-list {
    display: grid;
    gap: 0.34em;
    list-style: none;
}

.wiki-side-tree-list .wiki-side-tree-list {
    margin: 0.42em 0 0.55em;
    padding-left: 0.42em;
    border-left: 0;
}

.wiki-side-tree-item {
    min-width: 0;
}

.wiki-side-tree-label,
.wiki-side-tree-link {
    display: block;
    min-width: 0;
    font-size: 0.96em;
    font-weight: 400;
    line-height: 1.28;
    overflow-wrap: break-word;
    text-decoration: none;
    word-break: normal;
}

.wiki-side-tree-item--has-children > .wiki-side-tree-label,
.wiki-side-tree-item--has-children > .wiki-side-tree-link {
    margin-top: 0.95em;
    padding-bottom: 0.16em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.82);
    color: #f2dda0;
    font-size: 1em;
}

.wiki-side-tree-list--level-0 > .wiki-side-tree-item:first-child > .wiki-side-tree-label,
.wiki-side-tree-list--level-0 > .wiki-side-tree-item:first-child > .wiki-side-tree-link {
    margin-top: 0;
}

.wiki-side-tree-list--level-1 .wiki-side-tree-label,
.wiki-side-tree-list--level-1 .wiki-side-tree-link {
    font-size: 0.94em;
}

.wiki-side-tree-list--level-2 .wiki-side-tree-label,
.wiki-side-tree-list--level-2 .wiki-side-tree-link {
    font-size: 0.9em;
}

.wiki-side-tree-link:hover,
.wiki-side-tree-link.is-active {
    text-decoration: underline;
}

.content-wrap {
    width: 1000px;
    min-width: 0;
    min-height: 680px;
    /* Clip the resting (hidden) hover tooltips so a tile near the right edge
       can't push out the page width on narrow screens. Active tooltips are
       repositioned to position:fixed by the item tooltip module, so they escape this
       clip and still render in full. */
    overflow-x: clip;
}

.wiki-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 7px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(140, 42, 61, 0.3);
    font-size: 0.86rem;
}

.wiki-breadcrumb-sep {
    color: #b06a3e;
    font-weight: 900;
}

.wiki-breadcrumb-link {
    color: #c85054;
    font-weight: 700;
    text-decoration: none;
}

.wiki-breadcrumb-link:hover {
    color: var(--warm);
    text-decoration: underline;
}

.wiki-breadcrumb-current {
    color: #1f160d;
    font-weight: 800;
}

.page {
    width: 100%;
    min-height: 620px;
    margin: 0;
    padding: 1em 2em 3em;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.scroll-top-button {
    position: fixed;
    right: 22px;
    bottom: 92px;
    z-index: 1200;
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border: 1px solid #f2d372;
    border-radius: 50%;
    background:
        linear-gradient(145deg, rgba(255, 244, 163, 0.56) 0 18%, rgba(255, 244, 163, 0) 38%),
        radial-gradient(circle at 50% 50%, #916823 0 48%, #5e370a 49% 58%, #d9bc54 59% 64%, #6b450c 65% 100%);
    box-shadow:
        inset 0 2px 2px rgba(255, 247, 180, 0.72),
        inset 0 -5px 8px rgba(47, 24, 4, 0.72),
        0 2px 4px rgba(19, 8, 1, 0.62);
    color: transparent;
    font-size: 0;
    line-height: 1;
    cursor: pointer;
    opacity: 0.94;
    overflow: hidden;
    transition: transform 140ms ease, opacity 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.scroll-top-button::before {
    display: block;
    width: 30px;
    height: 34px;
    content: "";
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 36'%3E%3Cpath d='M7 18 16 9l9 9M16 10v22' fill='none' stroke='%23fff6d0' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    filter: drop-shadow(0 2px 1px rgba(22, 10, 2, 0.68));
}

.scroll-top-button[hidden] {
    display: none;
}

.scroll-top-button:hover,
.scroll-top-button:focus-visible {
    opacity: 1;
    filter: brightness(1.08);
    box-shadow:
        inset 0 2px 2px rgba(255, 247, 180, 0.82),
        inset 0 -5px 8px rgba(47, 24, 4, 0.62),
        0 3px 6px rgba(19, 8, 1, 0.74);
    transform: translateY(-3px);
}

.scroll-top-button:focus-visible {
    outline: 2px solid rgba(255, 240, 184, 0.8);
    outline-offset: 4px;
}

@media (max-width: 720px) {
    .scroll-top-button {
        right: 12px;
        bottom: 76px;
        width: 46px;
        height: 46px;
    }

    .scroll-top-button::before {
        width: 25px;
        height: 29px;
    }
}

/* --- Top header bar ------------------------------------------------------ */
.wiki-portal-shell .wiki-masthead {
    /* Full-width bar, centered to the same width as .app-frame so the
       search field starts exactly where the main content column starts. */
    padding-left: max(0px, calc((100% - 100em) / 2 - (var(--wiki-logo-track) - var(--wiki-sidebar-track))));
    padding-right: max(1em, calc((100% - 100em) / 2));
    background: var(--m2-dark);
    border-bottom: 0.2em solid var(--m2-gold);
    box-shadow: 0 3px 3px 2px rgba(0, 0, 0, 0.075), 0 0 2px rgba(0, 0, 0, 0.2);
}

.wiki-portal-shell .wiki-logo {
    max-width: 100%;
    padding: 0 0.75em 2px 0.65em;
    color: var(--m2-parchment);
    font-family: "Quattrocento", "Trebuchet MS", "Linux Libertine", "Times New Roman", serif;
    font-size: 1.45rem;
    font-variant: small-caps;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: none;
}

.wiki-portal-shell .wiki-logo:hover {
    color: #fff;
}

/* Search field with parchment border, filling the column between the 14em
   logo and the user area. */
.wiki-portal-shell .wiki-header-search {
    height: 40px;
    margin-right: 0;
    border: 1px solid var(--m2-parchment);
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}

.wiki-portal-shell .wiki-header-search input {
    height: 38px;
    min-height: 38px;
    background: #ffffff;
}

.wiki-portal-shell .wiki-header-search button {
    height: 38px;
    min-height: 38px;
}

/* The content frame starts flush below the fixed masthead. flex:1 makes the
   content area absorb leftover height so the footer stays compact at the
   bottom instead of stretching. */
.wiki-portal-shell .app-frame {
    flex: 1 0 auto;
    margin-top: 0;
    /* small gap so the content frame is detached from the footer (1:1) */
    margin-bottom: 2.5em;
    /* sit above the footer so item tooltips that overflow below the content
       panel render in front of the footer bar instead of behind it
       (layout.css gives app-frame and footer the same z-index:1) */
    position: relative;
    z-index: 2;
}

.wiki-portal-shell .wiki-sidebar {
    padding-top: 0;
}

/* --- Sidebar "scroll" panels (exact dark-brown + gold) ------------------- */
.wiki-portal-shell .wiki-side-panel {
    background: var(--m2-dark);
    border: 1px solid var(--m2-gold);
    color: var(--m2-parchment-text);
    box-shadow: 0 2px 3px 1px rgba(0, 0, 0, 0.05);
}

.wiki-portal-shell .wiki-side-panel h2 {
    margin: 0.25em 0 0.75em 0;
    padding-bottom: 0.15em;
    border-bottom: 1px solid #ffffff;
    color: var(--m2-parchment-text);
    font-family: inherit;
    font-size: 1em;
    font-weight: normal;
}

.wiki-portal-shell .wiki-side-link {
    color: var(--m2-parchment-text);
}

.wiki-portal-shell .wiki-side-tree-label,
.wiki-portal-shell .wiki-side-tree-link {
    color: var(--m2-parchment-text);
}

.wiki-portal-shell .wiki-side-link:hover,
.wiki-portal-shell .wiki-side-link.is-active,
.wiki-portal-shell .wiki-side-tree-link:hover,
.wiki-portal-shell .wiki-side-tree-link.is-active {
    color: #fff4bf;
}

/* --- Main content frame (exact parchment + crimson + gold base) ---------- */
.wiki-portal-shell .content-wrap {
    background: var(--m2-parchment);
    border: 1px solid var(--m2-crimson);
    border-bottom: 0.2em solid var(--m2-gold);
    box-shadow: 0 1px 2px 1px rgba(0, 0, 0, 0.02);
}

/* headings inside content rendered in the title face */
.wiki-portal-shell .content-wrap h1,
.wiki-portal-shell .content-wrap h2,
.wiki-portal-shell .content-wrap h3 {
    font-family: "Quattrocento", "Trebuchet MS", "Linux Libertine", "Times New Roman", serif;
}
