/* ==================================================================
   Kunena floating pagination — vintage notebook on the right edge.

   Logic remains identical to the earlier working implementation:
   JavaScript reads the first standard desktop Kunena pagination block and
   mirrors its native links into a floating notebook. Only the visual design
   and screen position are changed here.
   ================================================================== */

#mp-forum-pagination {
    position: fixed;
    z-index: 70;
    top: 176px;
    /* Static floating position: anchored near the right forum edge and then
       shifted by a fixed amount. No runtime width calculation is used. */
    right: max(10px, calc(50vw - 595px));
    left: auto;
    width: 188px;
    max-height: none;
    color: #50483d;
    font-family: 'MicroplanePlaypen', Helvetica, Arial, sans-serif;
    pointer-events: none;
    transform: translateX(30px);
}

#mp-forum-pagination .mp-pager-book {
    position: relative;
    box-sizing: border-box;
    width: 150px;
    height: 420px;
    min-height: 0;
    max-height: none;
    margin: 0 34px 0 0;
    padding: 16px 14px 14px 14px;
    overflow: visible;
    background-color: #fffefa;
    background-image:
        repeating-linear-gradient(0deg, transparent 0, transparent 21px, rgba(130, 177, 222, 0.33) 21px, rgba(130, 177, 222, 0.33) 22px),
        repeating-linear-gradient(90deg, transparent 0, transparent 21px, rgba(130, 177, 222, 0.22) 21px, rgba(130, 177, 222, 0.22) 22px),
        linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(251,248,238,0.98) 100%);
    border: 1px solid #d5ceb8;
    border-radius: 7px;
    box-shadow:
        0 1px 0 rgba(255,255,255,.96) inset,
        2px 3px 0 rgba(119,104,77,.12),
        6px 8px 12px rgba(63,83,99,.14);
    transform: rotate(-0.25deg);
    pointer-events: auto;
}

/* No leather spine: the notebook is a clean graph-paper leaf with index cuts. */
#mp-forum-pagination .mp-pager-book::before {
    display: none !important;
}

/* small tape pieces */
#mp-forum-pagination .mp-pager-book::after {
    content: '';
    position: absolute;
    z-index: 2;
    top: -6px;
    right: 35px;
    width: 30px;
    height: 11px;
    background: rgba(236, 245, 249, .38);
    border: 1px solid rgba(128,150,164,.18);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
    transform: rotate(7deg);
    pointer-events: none;
}

#mp-forum-pagination .mp-pager-leaf {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 390px;
    min-height: 0;
}


#mp-forum-pagination .mp-pager-summary {
    display: none;
}

#mp-forum-pagination .mp-pager-controls {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    list-style: none;
}

#mp-forum-pagination .mp-pager-controls--top {
    margin-top: 6px;
}

#mp-forum-pagination .mp-pager-controls--bottom {
    margin-top: auto;
    padding-top: 18px;
}


#mp-forum-pagination .mp-pager-midmenu {
    margin: 10px 0 8px;
    padding: 6px 0 2px;
    border-top: 1px solid rgba(94,103,107,.25);
    border-bottom: 1px dashed rgba(94,103,107,.18);
}

#mp-forum-pagination .mp-pager-midmenu-title {
    margin: 0 0 4px 14px;
    color: #6d6b66;
    font-family: 'MicroplaneShantell', 'MicroplaneNotebook', 'Comic Sans MS', cursive !important;
    font-size: 13px;
    line-height: 16px;
    text-shadow: 0 1px 0 rgba(255,255,255,.82);
}

#mp-forum-pagination .mp-pager-midmenu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#mp-forum-pagination .mp-pager-midmenu li {
    display: block;
    margin: 0 0 3px;
    padding: 0;
    text-align: left;
}

#mp-forum-pagination .mp-pager-midmenu a,
#mp-forum-pagination .mp-pager-midmenu span {
    position: relative;
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 20px;
    margin: 0;
    padding: 1px 2px 2px 14px;
    overflow: hidden;
    color: #6d6b66 !important;
    font-family: 'MicroplaneShantell', 'MicroplaneNotebook', 'Comic Sans MS', cursive !important;
    font-size: 13px !important;
    font-weight: normal !important;
    line-height: 16px !important;
    text-align: left;
    text-decoration: none !important;
    text-shadow:
        0.12px 0.08px rgba(78, 75, 71, 0.30),
        -0.08px -0.06px rgba(78, 75, 71, 0.18),
        0 1px 0 rgba(255, 255, 255, 0.76) !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

#mp-forum-pagination .mp-pager-midmenu a::before,
#mp-forum-pagination .mp-pager-midmenu span::before {
    content: '→';
    position: absolute;
    top: 0;
    left: 0;
    color: rgba(78, 75, 71, 0.78);
    font-family: 'MicroplaneShantell', 'MicroplaneNotebook', 'Comic Sans MS', cursive !important;
    font-size: 12px;
    line-height: 16px;
    transform: rotate(-7deg);
}

#mp-forum-pagination .mp-pager-midmenu li:nth-child(even) > a::before,
#mp-forum-pagination .mp-pager-midmenu li:nth-child(even) > span::before {
    transform: rotate(4deg);
}

#mp-forum-pagination .mp-pager-midmenu a::after,
#mp-forum-pagination .mp-pager-midmenu span::after {
    content: '';
    position: absolute;
    right: 5px;
    bottom: 1px;
    left: 14px;
    height: 1px;
    opacity: 0;
    background: rgba(78, 75, 71, 0.58);
    transform: scaleX(0.2) rotate(-0.75deg);
    transform-origin: left center;
    transition: opacity 160ms ease, transform 160ms ease;
}

#mp-forum-pagination .mp-pager-midmenu a:hover,
#mp-forum-pagination .mp-pager-midmenu a:focus {
    color: #4e4b47 !important;
    background-color: rgba(109, 107, 102, 0.08) !important;
    transform: translateX(2px) rotate(-0.35deg);
}

#mp-forum-pagination .mp-pager-midmenu a:hover::after,
#mp-forum-pagination .mp-pager-midmenu a:focus::after {
    opacity: 1;
    transform: scaleX(1) rotate(-0.75deg);
}

#mp-forum-pagination li {
    margin: 0;
    padding: 0;
    list-style: none;
}

#mp-forum-pagination .mp-pager-controls li {
    display: block;
    margin: 0 0 9px;
    text-align: center;
}

#mp-forum-pagination .mp-pager-controls a,
#mp-forum-pagination .mp-pager-controls span {
    position: relative;
    display: inline-block;
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    padding: 2px 5px 4px 14px;
    overflow: hidden;
    color: #6d6b66 !important;
    font-family: 'MicroplaneShantell', 'MicroplaneNotebook', 'Comic Sans MS', cursive !important;
    font-size: 15px;
    font-weight: normal !important;
    line-height: 18px;
    text-align: left;
    text-decoration: none !important;
    text-shadow:
        0.12px 0.08px rgba(78, 75, 71, 0.30),
        -0.08px -0.06px rgba(78, 75, 71, 0.18),
        0 1px 0 rgba(255, 255, 255, 0.76) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 44% 56% 49% 51% / 48% 45% 55% 52%;
    box-shadow: none !important;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

#mp-forum-pagination .mp-pager-controls a::before,
#mp-forum-pagination .mp-pager-controls span::before {
    content: '→';
    position: absolute;
    top: 1px;
    left: 0;
    color: rgba(78, 75, 71, 0.78);
    font-family: 'MicroplaneShantell', 'MicroplaneNotebook', 'Comic Sans MS', cursive !important;
    font-size: 14px;
    font-weight: normal;
    line-height: 18px;
    transform: rotate(-7deg);
    text-shadow:
        0.10px 0.07px rgba(78, 75, 71, 0.28),
        -0.06px -0.05px rgba(78, 75, 71, 0.16) !important;
}

#mp-forum-pagination .mp-pager-controls li:nth-child(even) > a::before,
#mp-forum-pagination .mp-pager-controls li:nth-child(even) > span::before {
    transform: rotate(4deg);
}

#mp-forum-pagination .mp-pager-controls a::after,
#mp-forum-pagination .mp-pager-controls span::after {
    content: '';
    position: absolute;
    right: 3px;
    bottom: 3px;
    left: 14px;
    height: 1px;
    opacity: 0;
    background: rgba(78, 75, 71, 0.65);
    transform: scaleX(0.2) rotate(-0.75deg);
    transform-origin: left center;
    transition: opacity 160ms ease, transform 160ms ease;
}

#mp-forum-pagination .mp-pager-controls a:hover,
#mp-forum-pagination .mp-pager-controls a:focus {
    color: #4e4b47 !important;
    background-color: rgba(109, 107, 102, 0.10) !important;
    transform: translateX(3px) rotate(-0.35deg);
}

#mp-forum-pagination .mp-pager-controls a:hover::after,
#mp-forum-pagination .mp-pager-controls a:focus::after {
    opacity: 1;
    transform: scaleX(1) rotate(-0.75deg);
}

/* Right-side index tabs */
#mp-forum-pagination .mp-pager-tabs {
    position: absolute;
    top: 34px;
    right: -34px;
    bottom: 28px;
    width: 44px;
    margin: 0;
    padding: 0;
    overflow: visible;
    list-style: none;
}


#mp-forum-pagination .mp-page-tab {
    position: relative;
    height: 28px;
    margin: 0 0 1px;
    padding: 0;
}

#mp-forum-pagination .mp-page-tab:nth-child(2n) {
    transform: rotate(0.5deg);
}

#mp-forum-pagination .mp-page-tab:nth-child(3n) {
    transform: rotate(-0.55deg);
}

/* dark slot behind the cut tabs */
#mp-forum-pagination .mp-page-tab::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: 3px;
    right: 26px;
    bottom: 3px;
    width: 11px;
    background: rgba(91, 83, 69, .34);
    border-radius: 0 6px 6px 0;
    box-shadow: 1px 0 0 rgba(255,255,255,.18);
}

#mp-forum-pagination .mp-page-tab a,
#mp-forum-pagination .mp-page-tab span {
    position: relative;
    display: block;
    box-sizing: border-box;
    width: 42px;
    min-height: 27px;
    padding: 2px 7px 2px 6px;
    overflow: hidden;
    color: #4d5963;
    background-color: #fffefa;
    background-image:
        repeating-linear-gradient(0deg, transparent 0, transparent 21px, rgba(130, 177, 222, 0.33) 21px, rgba(130, 177, 222, 0.33) 22px),
        repeating-linear-gradient(90deg, transparent 0, transparent 21px, rgba(130, 177, 222, 0.22) 21px, rgba(130, 177, 222, 0.22) 22px),
        linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(251,248,238,0.98) 100%);
    background-size: 21px 21px, 21px 21px, auto;
    border: 1px solid #c8c1b0;
    border-left-color: #a9a18f;
    border-radius: 2px 7px 7px 2px;
    box-shadow: 1px 1px 0 rgba(255,255,255,.95), 2px 2px 3px rgba(119,104,77,.14);
    clip-path: polygon(0 14%, 12% 0, 88% 0, 100% 14%, 100% 86%, 88% 100%, 12% 100%, 0 86%, 0 66%, 8% 50%, 0 34%);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 14px;
    font-weight: normal;
    line-height: 22px;
    text-align: center;
    text-decoration: none;
    text-shadow: 0 1px 0 rgba(255,255,255,.88);
}

#mp-forum-pagination .mp-page-tab a:hover,
#mp-forum-pagination .mp-page-tab a:focus {
    z-index: 5;
    color: #304d61;
    background-color: #fffefa;
    border-color: #9facb6;
    box-shadow: 2px 2px 0 rgba(255,255,255,.96), 3px 3px 5px rgba(119,104,77,.16);
    transform: translateX(-4px);
}

#mp-forum-pagination .mp-page-tab.is-current a,
#mp-forum-pagination .mp-page-tab.is-current span {
    z-index: 6;
    color: #29485d;
    background-color: #edf7fb;
    background-image:
        repeating-linear-gradient(0deg, transparent 0, transparent 21px, rgba(130, 177, 222, 0.33) 21px, rgba(130, 177, 222, 0.33) 22px),
        repeating-linear-gradient(90deg, transparent 0, transparent 21px, rgba(130, 177, 222, 0.22) 21px, rgba(130, 177, 222, 0.22) 22px),
        linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(251,248,238,0.98) 100%);
    background-size: 21px 21px, 21px 21px, auto;
    border: 2px solid rgba(99,137,162,.84);
    box-shadow: 2px 2px 0 rgba(255,255,255,.96), 4px 4px 6px rgba(61,94,118,.18);
    transform: translateX(-8px) rotate(-1deg);
}

#mp-forum-pagination .mp-page-tab.is-gap span {
    color: #7b776c;
    background-color: #fffefa;
    border-color: #d5ceb8;
    letter-spacing: .08em;
    font-size: 13px;
}

body.mp-forum-layout #kunena .pagination.hidden-phone.mp-pager-source {
    display: none !important;
}

@media (max-width: 1260px) {
    /* Keep the same compact scale. Only the anchor relaxes to the viewport
       edge when there is no longer enough exterior margin around the forum. */
    #mp-forum-pagination {
        right: 10px;
    }
}

@media (max-width: 1020px), (max-height: 700px) {
    #mp-forum-pagination {
        display: none !important;
    }
    body.mp-forum-layout #kunena .pagination.hidden-phone.mp-pager-source {
        display: block !important;
    }
}


body.mp-menu-font-classic #mp-forum-pagination .mp-pager-controls a,
body.mp-menu-font-classic #mp-forum-pagination .mp-pager-controls span,
body.mp-menu-font-classic #mp-forum-pagination .mp-pager-controls a::before,
body.mp-menu-font-classic #mp-forum-pagination .mp-pager-controls span::before {
    font-family: Helvetica, Arial, sans-serif !important;
}

body.mp-menu-font-classic #mp-forum-pagination .mp-pager-midmenu-title,
body.mp-menu-font-classic #mp-forum-pagination .mp-pager-midmenu a,
body.mp-menu-font-classic #mp-forum-pagination .mp-pager-midmenu span,
body.mp-menu-font-classic #mp-forum-pagination .mp-pager-midmenu a::before,
body.mp-menu-font-classic #mp-forum-pagination .mp-pager-midmenu span::before {
    font-family: Helvetica, Arial, sans-serif !important;
}
