/* Keely consolidated maintenance layer, 1.23.4
   This file replaces the repeated patch-on-patch fixes for author text, footer external links,
   page overflow, mobile footer/header handling and the homepage library carousel. */

:root {
    --keely-external-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='black' d='M3 1.5h7.5V9H9.2V3.7L2.4 10.5l-.9-.9 6.8-6.8H3V1.5z'/%3E%3C/svg%3E");
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body,
.viewport,
.site-content,
.site-main,
main {
    max-width: 100%;
}

img,
video,
iframe,
figure,
picture {
    max-width: 100%;
}

/* Keep regular pages contained without disabling the intended homepage carousel rail. */
.library-page,
.commentary-page,
.all-posts-page,
.library-page .wide-container,
.commentary-page .wide-container,
.all-posts-page .wide-container,
.library-page .library-grid,
.commentary-page .grid,
.all-posts-page .grid,
.commentary-post-grid,
.normal-grid {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.library-page .library-grid-five {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.library-page .library-book-card,
.commentary-page .post-card,
.all-posts-page .post-card {
    min-width: 0;
}

/* Author and tag links: readable by default, animated only on hover. */
.post-card-author,
.post-card-author *,
.library-home-author,
.library-home-author *,
.library-book-card-author,
.library-book-card-author *,
.all-posts-latest-author,
.all-posts-latest-author *,
.commentary-latest-author,
.commentary-latest-author *,
.post-authors,
.post-authors *,
.post-author-plain-link,
.post-author-plain-link *,
.essay-author-link,
.essay-author-link *,
.essay-meta-link,
.essay-meta-link *,
.post-card-tags,
.post-card-tags * {
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-transform: none !important;
    font-kerning: normal !important;
}

.post-card-author,
.library-home-author,
.library-book-card-author,
.all-posts-latest-author,
.commentary-latest-author {
    display: block;
    white-space: normal;
}

.post-card-author a,
.library-home-author a,
.library-book-card-author a,
.all-posts-latest-author a,
.commentary-latest-author a,
.post-author-plain-link,
.essay-author-link,
.essay-meta-link,
.post-card-tags a {
    display: inline !important;
    color: currentColor;
    text-decoration: none;
    white-space: normal !important;
}

.post-card-author .wrap-characters,
.library-home-author .wrap-characters,
.library-book-card-author .wrap-characters,
.all-posts-latest-author .wrap-characters,
.commentary-latest-author .wrap-characters,
.post-authors .wrap-characters,
.post-author-plain-link.wrap-characters,
.essay-author-link.wrap-characters,
.essay-meta-link.wrap-characters {
    display: inline !important;
    white-space: normal !important;
}

.post-card-author .scramble-word,
.library-home-author .scramble-word,
.library-book-card-author .scramble-word,
.all-posts-latest-author .scramble-word,
.commentary-latest-author .scramble-word,
.post-authors .scramble-word,
.essay-author-link .scramble-word,
.essay-meta-link .scramble-word,
.post-card-tags .scramble-word {
    display: inline !important;
    white-space: normal !important;
}

.post-card-author .scramble-char,
.library-home-author .scramble-char,
.library-book-card-author .scramble-char,
.all-posts-latest-author .scramble-char,
.commentary-latest-author .scramble-char,
.post-authors .scramble-char,
.essay-author-link .scramble-char,
.essay-meta-link .scramble-char,
.post-card-tags .scramble-char {
    display: inline !important;
    position: relative;
}

.post-card-author .scramble-random,
.library-home-author .scramble-random,
.library-book-card-author .scramble-random,
.all-posts-latest-author .scramble-random,
.commentary-latest-author .scramble-random,
.post-authors .scramble-random,
.essay-author-link .scramble-random,
.essay-meta-link .scramble-random,
.post-card-tags .scramble-random {
    position: absolute !important;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.keely-plain-scramble,
.keely-plain-scramble:hover {
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-transform: none !important;
}

.keely-plain-scramble:hover,
.post-card-tags a:hover,
.post-author-plain-link:hover,
.essay-author-link:hover,
.essay-meta-link:hover,
.all-posts-latest-author a:hover,
.commentary-latest-author a:hover {
    background-color: var(--text-color);
    color: var(--background-color) !important;
}

/* Full-image article hero meta: never let the author split letter-by-letter. */
.post-header-full-image .bottom-item-links,
.post-header-moving-title .bottom-item-links,
.post-header-circle-bottom .bottom-item-links {
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

.post-header-full-image .bottom-item-links a,
.post-header-moving-title .bottom-item-links a,
.post-header-circle-bottom .bottom-item-links a,
.post-hero-author-link {
    letter-spacing: normal !important;
    word-spacing: normal !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

/* Footer backgrounds and visibility. */
.footer-wrapper,
.footer-normal-wrapper {
    display: block !important;
    visibility: visible !important;
    position: relative;
    overflow: hidden;
    background-image: var(--footer-bg-image);
    background-size: auto 100%;
    background-position: center right;
    background-repeat: no-repeat;
}

.footer-wrapper .creative-footer,
.footer-normal-wrapper .footer-normal {
    visibility: visible !important;
    background-color: transparent;
}

.footer-content-inner > p,
.footer-normal-content > p,
.footer-tagline,
.footer-description {
    display: none !important;
}

.footer-logo-image,
.footer-logo img {
    width: auto;
    max-width: none;
    height: max(calc(18px * var(--logo-scale)), calc(1.25vw * var(--scale) * var(--logo-scale)));
}

/* Footer external-link arrows, excluding social icons. */
footer .footer-nav a,
footer .footer-nav-link,
footer .footer-normal-links a {
    display: inline-flex !important;
    align-items: baseline;
    width: auto !important;
    max-width: max-content;
    gap: 0;
    white-space: nowrap !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

footer .footer-nav a.keely-external-link::after,
footer .footer-nav-link.keely-external-link::after,
footer .footer-normal-links a.keely-external-link::after {
    content: "";
    display: inline-block;
    width: 0.62em;
    height: 0.62em;
    margin-left: 0.3em;
    flex: 0 0 0.62em;
    opacity: 0.78;
    background-color: currentColor;
    -webkit-mask: var(--keely-external-icon) center / contain no-repeat;
    mask: var(--keely-external-icon) center / contain no-repeat;
    vertical-align: 0.08em;
}

footer .footer-nav a.keely-social-link::after,
footer .footer-nav-link.keely-social-link::after,
footer .footer-normal-links a.keely-social-link::after,
footer .external-link-icon {
    display: none !important;
    content: none !important;
}

/* Mobile layout. */
@media screen and (max-width: 767px) {
    html,
    body,
    .viewport,
    .site-content,
    .site-main,
    main {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .navbar,
    .navbar-inner {
        min-height: 58px !important;
        height: 58px !important;
        align-items: center !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .logo-outer {
        flex: 0 0 58vw !important;
        width: 58vw !important;
        max-width: 58vw !important;
        padding-left: 16px !important;
        padding-right: 0 !important;
        justify-content: flex-start !important;
        align-items: center !important;
        overflow: visible !important;
    }

    .logo-wrapper,
    .logo-image-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: flex-start !important;
        align-items: center !important;
        overflow: visible !important;
    }

    .logo-image-wrapper img,
    .logo-image {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 36px !important;
        object-fit: contain !important;
        object-position: left center !important;
    }

    .menu-link-wrapper {
        flex: 0 0 auto !important;
        width: auto !important;
        margin-left: auto !important;
        padding-right: 16px !important;
    }

    .post-header-full-image .section-bottom,
    .post-header-moving-title .section-bottom,
    .post-header-circle-bottom .section-bottom {
        display: grid !important;
        grid-template-columns: 40% 60% !important;
        align-items: end !important;
        gap: 0 !important;
    }

    .post-header-full-image .bottom-item,
    .post-header-moving-title .bottom-item,
    .post-header-circle-bottom .bottom-item {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .post-header-full-image .bottom-item-links,
    .post-header-moving-title .bottom-item-links,
    .post-header-circle-bottom .bottom-item-links {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal !important;
        line-height: 1.15 !important;
        font-size: clamp(22px, 6.4vw, 32px) !important;
    }

    .post-header-full-image .bottom-item-links a,
    .post-header-moving-title .bottom-item-links a,
    .post-header-circle-bottom .bottom-item-links a,
    .post-hero-author-link {
        display: inline !important;
        white-space: normal !important;
        letter-spacing: normal !important;
        word-spacing: normal !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
    }

    .library-page .library-grid-five,
    .library-page .library-grid,
    .commentary-page .grid,
    .commentary-page .normal-grid,
    .all-posts-page .grid,
    .all-posts-page .normal-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .home-template .library-section .library-carousel[data-library-carousel],
    body:not(.library-template) .library-section:not(.tag-essays-section) .library-carousel[data-library-carousel] {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory;
        touch-action: pan-x pan-y !important;
        scrollbar-width: none;
        max-width: 100vw !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .home-template .library-section .library-carousel[data-library-carousel]::-webkit-scrollbar,
    body:not(.library-template) .library-section:not(.tag-essays-section) .library-carousel[data-library-carousel]::-webkit-scrollbar {
        display: none;
    }

    .home-template .library-section .library-carousel[data-library-carousel] .library-card,
    body:not(.library-template) .library-section:not(.tag-essays-section) .library-carousel[data-library-carousel] .library-card {
        flex: 0 0 82vw !important;
        width: 82vw !important;
        max-width: 82vw !important;
        min-width: 82vw !important;
        margin-right: 16px !important;
        scroll-snap-align: start;
    }

    .footer-wrapper,
    .footer-normal-wrapper {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
        min-height: 0 !important;
        clear: both;
        background-image: var(--footer-bg-image-mobile);
        background-size: auto 100%;
        background-position: center right;
        background-repeat: no-repeat;
    }

    .creative-footer,
    .footer-normal {
        display: flex !important;
        visibility: visible !important;
        min-height: auto !important;
        height: auto !important;
    }

    .footer-logo-image,
    .footer-logo img {
        height: max(calc(9px * var(--logo-scale)), calc(1.15vw * var(--scale) * var(--logo-scale)));
        max-width: 62vw;
    }

    footer .footer-nav a,
    footer .footer-nav-link,
    footer .footer-normal-links a {
        white-space: nowrap !important;
        letter-spacing: normal !important;
        word-spacing: normal !important;
    }
}

/* Header/menu external links use the same indicator as footer links. */
custom-menu a.keely-external-link::after,
.nav a.keely-external-link::after,
.navbar a.keely-external-link::after {
    content: "";
    display: inline-block;
    width: 0.62em;
    height: 0.62em;
    margin-left: 0.3em;
    flex: 0 0 0.62em;
    opacity: 0.78;
    background-color: currentColor;
    -webkit-mask: var(--keely-external-icon) center / contain no-repeat;
    mask: var(--keely-external-icon) center / contain no-repeat;
    vertical-align: 0.08em;
}

custom-menu a.keely-social-link::after,
.nav a.keely-social-link::after,
.navbar a.keely-social-link::after {
    display: none !important;
    content: none !important;
}

.menu-email-link,
.menu-email-link * {
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-transform: none !important;
}

/* Keely 1.23.6 stability overrides. Keep these scoped and last. */
.post-card-tags,
.post-card-tags *,
.post-card-author,
.post-card-author *,
.library-home-author,
.library-home-author *,
.library-book-card-author,
.library-book-card-author *,
.all-posts-latest-author,
.all-posts-latest-author *,
.commentary-latest-author,
.commentary-latest-author *,
.post-author-plain-link,
.post-author-plain-link *,
.essay-author-link,
.essay-author-link *,
.essay-meta-link,
.essay-meta-link * {
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-transform: none !important;
    font-kerning: normal !important;
}

.post-card-tags a,
.post-card-author a,
.library-home-author a,
.library-book-card-author a,
.all-posts-latest-author a,
.commentary-latest-author a,
.post-author-plain-link,
.essay-author-link,
.essay-meta-link {
    display: inline !important;
    white-space: normal !important;
    text-decoration: none;
}

.post-card-tags a:hover,
.post-card-author a:hover,
.library-home-author a:hover,
.library-book-card-author a:hover,
.all-posts-latest-author a:hover,
.commentary-latest-author a:hover,
.post-author-plain-link:hover,
.essay-author-link:hover,
.essay-meta-link:hover,
.keely-plain-scramble.keely-scrambling-now {
    background-color: var(--text-color);
    color: var(--background-color) !important;
}

footer .footer-nav a.keely-external-link::after,
footer .footer-nav-link.keely-external-link::after,
footer .footer-normal-links a.keely-external-link::after,
footer .footer-normal-links .keely-external-link::after {
    content: "" !important;
    display: inline-block !important;
    width: 0.62em !important;
    height: 0.62em !important;
    margin-left: 0.3em !important;
    flex: 0 0 0.62em !important;
    opacity: 0.78 !important;
    background-color: currentColor !important;
    -webkit-mask: var(--keely-external-icon) center / contain no-repeat !important;
    mask: var(--keely-external-icon) center / contain no-repeat !important;
    vertical-align: 0.08em !important;
}

footer .socials a::after,
footer .socials-buttons a::after,
footer .keely-social-link::after,
footer .footer-logo::after {
    display: none !important;
    content: none !important;
}

.library-page,
.commentary-page,
.all-posts-page,
.library-page .site-main,
.commentary-page .site-main,
.all-posts-page .site-main,
.library-page .wide-container,
.commentary-page .wide-container,
.all-posts-page .wide-container {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

@media screen and (max-width: 767px) {
    body.home-template .library-section:not(.tag-essays-section) .library-carousel.keely-mobile-swipe-ready,
    body.home-template .library-section:not(.tag-essays-section) .library-carousel[data-library-carousel] {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory !important;
        touch-action: pan-x pan-y !important;
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(50% - 50vw) !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
        box-sizing: border-box !important;
    }

    body.home-template .library-section:not(.tag-essays-section) .library-carousel.keely-mobile-swipe-ready::-webkit-scrollbar,
    body.home-template .library-section:not(.tag-essays-section) .library-carousel[data-library-carousel]::-webkit-scrollbar {
        display: none !important;
    }

    body.home-template .library-section:not(.tag-essays-section) .library-carousel.keely-mobile-swipe-ready .library-card,
    body.home-template .library-section:not(.tag-essays-section) .library-carousel[data-library-carousel] .library-card {
        flex: 0 0 82vw !important;
        width: 82vw !important;
        min-width: 82vw !important;
        max-width: 82vw !important;
        margin-right: 16px !important;
        scroll-snap-align: start !important;
        transform: none !important;
    }

    .library-page .library-carousel,
    .library-page .library-grid,
    .library-page .library-grid-five,
    .commentary-page .grid,
    .commentary-page .normal-grid,
    .all-posts-page .grid,
    .all-posts-page .normal-grid {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
}

/* Keely 1.23.7 focused repair: author/tag scramble and footer external arrows */
.keely-author-tag-scramble,
.keely-author-tag-scramble * {
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-transform: none !important;
    font-kerning: normal !important;
}

.keely-author-tag-scramble {
    display: inline !important;
    white-space: normal !important;
    text-decoration: none;
}

.keely-author-tag-scramble .scramble-word {
    display: inline-block !important;
    white-space: nowrap !important;
}

.keely-author-tag-scramble .scramble-char {
    display: inline-block !important;
    position: relative !important;
    line-height: inherit !important;
}

.keely-author-tag-scramble .scramble-random {
    position: absolute !important;
    inset: 0 !important;
    opacity: 0;
    pointer-events: none !important;
}

.keely-author-tag-scramble .scramble-main {
    position: relative !important;
    opacity: 1;
}

.keely-author-tag-scramble:hover {
    background-color: var(--text-color) !important;
    color: var(--background-color) !important;
}

footer a.keely-external-link {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 0.28em !important;
    width: auto !important;
    max-width: max-content !important;
    white-space: nowrap !important;
}

footer a.keely-external-link::after {
    content: none !important;
    display: none !important;
}

footer a.keely-external-link > .keely-external-icon {
    display: inline-flex !important;
    width: 0.62em !important;
    height: 0.62em !important;
    flex: 0 0 0.62em !important;
    margin: 0 0 0 0.08em !important;
    color: currentColor !important;
    opacity: 0.78 !important;
    line-height: 1 !important;
    vertical-align: 0.08em !important;
}

footer a.keely-external-link > .keely-external-icon svg {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    overflow: visible !important;
}

footer a.keely-social-link > .keely-external-icon,
footer .footer-socials a > .keely-external-icon,
footer .socials a > .keely-external-icon,
footer .socials-buttons a > .keely-external-icon {
    display: none !important;
}

/* Keely 1.23.8 focused final layer: use the original scramble engine for author/tag links and force footer external arrows. */
.post-card-tags a.keely-author-tag-scramble,
.post-card-author a.keely-author-tag-scramble,
.library-home-author a.keely-author-tag-scramble,
.library-book-card-author a.keely-author-tag-scramble,
.all-posts-latest-author a.keely-author-tag-scramble,
.commentary-latest-author a.keely-author-tag-scramble,
a.post-author-plain-link.keely-author-tag-scramble,
a.essay-author-link.keely-author-tag-scramble,
a.essay-meta-link.keely-author-tag-scramble {
    display: inline-flex !important;
    flex-wrap: wrap !important;
    align-items: baseline !important;
    gap: 0 !important;
    width: auto !important;
    max-width: 100% !important;
    white-space: normal !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-transform: none !important;
    background: transparent !important;
}

.post-card-tags a.keely-author-tag-scramble:hover,
.post-card-author a.keely-author-tag-scramble:hover,
.library-home-author a.keely-author-tag-scramble:hover,
.library-book-card-author a.keely-author-tag-scramble:hover,
.all-posts-latest-author a.keely-author-tag-scramble:hover,
.commentary-latest-author a.keely-author-tag-scramble:hover,
a.post-author-plain-link.keely-author-tag-scramble:hover,
a.essay-author-link.keely-author-tag-scramble:hover,
a.essay-meta-link.keely-author-tag-scramble:hover {
    background: transparent !important;
    color: currentColor !important;
}

.post-card-tags a.keely-author-tag-scramble .scramble-word,
.post-card-author a.keely-author-tag-scramble .scramble-word,
.library-home-author a.keely-author-tag-scramble .scramble-word,
.library-book-card-author a.keely-author-tag-scramble .scramble-word,
.all-posts-latest-author a.keely-author-tag-scramble .scramble-word,
.commentary-latest-author a.keely-author-tag-scramble .scramble-word,
a.post-author-plain-link.keely-author-tag-scramble .scramble-word,
a.essay-author-link.keely-author-tag-scramble .scramble-word,
a.essay-meta-link.keely-author-tag-scramble .scramble-word {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

.post-card-tags a.keely-author-tag-scramble .scramble-char,
.post-card-author a.keely-author-tag-scramble .scramble-char,
.library-home-author a.keely-author-tag-scramble .scramble-char,
.library-book-card-author a.keely-author-tag-scramble .scramble-char,
.all-posts-latest-author a.keely-author-tag-scramble .scramble-char,
.commentary-latest-author a.keely-author-tag-scramble .scramble-char,
a.post-author-plain-link.keely-author-tag-scramble .scramble-char,
a.essay-author-link.keely-author-tag-scramble .scramble-char,
a.essay-meta-link.keely-author-tag-scramble .scramble-char {
    display: inline-block !important;
    position: relative !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

.post-card-tags a.keely-author-tag-scramble .scramble-random,
.post-card-author a.keely-author-tag-scramble .scramble-random,
.library-home-author a.keely-author-tag-scramble .scramble-random,
.library-book-card-author a.keely-author-tag-scramble .scramble-random,
.all-posts-latest-author a.keely-author-tag-scramble .scramble-random,
.commentary-latest-author a.keely-author-tag-scramble .scramble-random,
a.post-author-plain-link.keely-author-tag-scramble .scramble-random,
a.essay-author-link.keely-author-tag-scramble .scramble-random,
a.essay-meta-link.keely-author-tag-scramble .scramble-random {
    position: absolute !important;
    inset: 0 !important;
    z-index: 2 !important;
    opacity: 0;
    color: var(--background-color) !important;
    background-color: var(--text-color) !important;
    pointer-events: none !important;
}

.post-card-tags a.keely-author-tag-scramble .scramble-main,
.post-card-author a.keely-author-tag-scramble .scramble-main,
.library-home-author a.keely-author-tag-scramble .scramble-main,
.library-book-card-author a.keely-author-tag-scramble .scramble-main,
.all-posts-latest-author a.keely-author-tag-scramble .scramble-main,
.commentary-latest-author a.keely-author-tag-scramble .scramble-main,
a.post-author-plain-link.keely-author-tag-scramble .scramble-main,
a.essay-author-link.keely-author-tag-scramble .scramble-main,
a.essay-meta-link.keely-author-tag-scramble .scramble-main {
    position: relative !important;
    z-index: 1 !important;
}

footer a.keely-external-link:not(.keely-social-link),
footer .nav a.keely-external-link:not(.keely-social-link),
footer .footer-nav-wrapper a.keely-external-link:not(.keely-social-link) {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 0.28em !important;
    width: auto !important;
    max-width: max-content !important;
    white-space: nowrap !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

footer a.keely-external-link:not(.keely-social-link) .keely-external-icon,
footer .nav a.keely-external-link:not(.keely-social-link) .keely-external-icon,
footer .footer-nav-wrapper a.keely-external-link:not(.keely-social-link) .keely-external-icon {
    display: inline-flex !important;
    width: 0.66em !important;
    height: 0.66em !important;
    flex: 0 0 0.66em !important;
    margin-left: 0 !important;
    color: currentColor !important;
    opacity: 0.82 !important;
    vertical-align: 0.08em !important;
}

footer a.keely-external-link:not(.keely-social-link) .keely-external-icon svg,
footer .nav a.keely-external-link:not(.keely-social-link) .keely-external-icon svg,
footer .footer-nav-wrapper a.keely-external-link:not(.keely-social-link) .keely-external-icon svg {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

footer a.keely-social-link .keely-external-icon,
footer [class*="social"] a .keely-external-icon,
footer a.keely-social-link::after,
footer [class*="social"] a::after {
    display: none !important;
    content: none !important;
}


/* Keely 1.23.9 focused fixes: footer external arrows only, no header/menu arrow changes, no scramble changes. */
custom-menu a.keely-external-link::after,
.nav a.keely-external-link::after,
.navbar a.keely-external-link::after {
    content: none !important;
    display: none !important;
}

custom-menu a .keely-footer-external-icon,
.nav a .keely-footer-external-icon,
.navbar a .keely-footer-external-icon,
custom-menu a .keely-external-icon,
.nav a .keely-external-icon,
.navbar a .keely-external-icon {
    display: none !important;
}

footer .footer-nav a,
footer .footer-nav-link,
footer .footer-normal-links a {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 0 !important;
    white-space: nowrap !important;
    width: auto !important;
    max-width: max-content !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

footer a.keely-external-link::after,
footer a.external-link::after {
    content: none !important;
    display: none !important;
}

footer a.keely-external-link .keely-footer-external-icon,
footer a.keely-external-link .external-link-icon,
footer a.external-link .external-link-icon {
    display: inline-flex !important;
    width: 0.62em !important;
    height: 0.62em !important;
    flex: 0 0 0.62em !important;
    margin-left: 0.28em !important;
    vertical-align: 0.08em !important;
    opacity: 0.78 !important;
    line-height: 1 !important;
}

footer a.keely-external-link .keely-footer-external-icon svg,
footer a.keely-external-link .external-link-icon svg,
footer a.external-link .external-link-icon svg {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

footer a.keely-social-link .keely-footer-external-icon,
footer .socials a .keely-footer-external-icon,
footer .socials a .external-link-icon,
footer [class*="social"] a .keely-footer-external-icon,
footer [class*="social"] a .external-link-icon {
    display: none !important;
}

/* Keely 1.24.0 focused fixes: commentary filter, external arrows, menu scroll lock. */
html.keely-menu-open,
body.keely-menu-open {
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none;
}

custom-menu.open {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;
}

custom-menu .menu-links-inner a.keely-external-link,
footer a.keely-external-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.32em !important;
    width: auto !important;
    max-width: max-content !important;
    white-space: nowrap !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

custom-menu .menu-links-inner a.keely-external-link::after,
footer a.keely-external-link::after,
custom-menu .menu-links-inner a.external-link::after,
footer a.external-link::after {
    content: none !important;
    display: none !important;
}

custom-menu .menu-links-inner a.keely-external-link > .keely-external-icon,
footer a.keely-external-link > .keely-external-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 0.72em !important;
    height: 0.72em !important;
    flex: 0 0 0.72em !important;
    margin-left: 0.02em !important;
    color: currentColor !important;
    opacity: 0.82 !important;
    line-height: 1 !important;
    vertical-align: baseline !important;
}

custom-menu .menu-links-inner a.keely-external-link > .keely-external-icon svg,
footer a.keely-external-link > .keely-external-icon svg {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

[data-socials] a > .keely-external-icon,
footer [data-socials] a > .keely-external-icon,
footer a.keely-social-link > .keely-external-icon,
custom-menu a.keely-social-link > .keely-external-icon {
    display: none !important;
}


/* Keely 1.24.6 commentary filter repair: keep the page horizontally contained without clipping the opened tag menu. */
.all-posts-hero-shell,
.all-posts-hero-shell .wide-container,
.all-posts-hero-filter-row {
    overflow: visible !important;
}

.all-posts-filter-dropdown,
.all-posts-filter-dropdown[open],
.all-posts-filter-menu {
    overflow: visible;
}

.all-posts-filter-dropdown[open] .all-posts-filter-menu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    color: var(--text-color) !important;
    background: var(--background-color) !important;
}

.all-posts-filter-menu {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.all-posts-filter-item {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: var(--text-color) !important;
}

/* Keely 1.24.6 footer external-link indicator repair */
footer .footer-nav a.keely-external-link,
footer .footer-nav-link.keely-external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
}

footer .footer-nav a.keely-external-link .keely-external-icon,
footer .footer-nav-link.keely-external-link .keely-external-icon {
    display: inline-flex !important;
    width: 0.78em;
    height: 0.78em;
    flex: 0 0 auto;
    opacity: 0.9;
    transform: translateY(-0.02em);
}

footer .footer-nav a.keely-external-link .keely-external-icon svg,
footer .footer-nav-link.keely-external-link .keely-external-icon svg {
    width: 100%;
    height: 100%;
}

/* Keely 1.26: remove duplicate vertical scrollbar rails on commentary/all-posts pages.
   Keep the document scrolling on the root element only, and ensure closed overlays/dropdowns
   cannot reserve or paint their own scrollbar track. */
html:not(.keely-menu-open) {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

body:not(.keely-menu-open) {
    overflow-y: visible !important;
    overflow-x: clip !important;
}

custom-menu:not(.open) {
    visibility: hidden !important;
    overflow: hidden !important;
    pointer-events: none !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

custom-menu.open {
    visibility: visible !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

custom-menu::-webkit-scrollbar,
custom-menu.open::-webkit-scrollbar,
custom-menu:not(.open)::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

.all-posts-filter-dropdown:not([open]) .all-posts-filter-menu {
    overflow: hidden !important;
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-width: 0 !important;
    box-shadow: none !important;
}

.all-posts-filter-dropdown[open] .all-posts-filter-menu {
    max-height: min(420px, calc(100vh - 120px)) !important;
    padding: 10px 10px 14px !important;
    border-width: 1px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Keely 1.27.1: match article tag dimming to author treatment only. */
.post-card-tags,
.all-posts-latest-tagline {
    opacity: 0.6 !important;
    transition: opacity 0.2s ease;
}

.post-card-tags:hover,
.all-posts-latest-tagline:hover {
    opacity: 1 !important;
}

/* Keely 1.27.2: stop mobile scroll anchoring jitter on the commentary latest story only. */
@media screen and (max-width: 767px) {
    .commentary-page .all-posts-latest-wrap,
    .commentary-page .all-posts-latest {
        overflow-anchor: none !important;
    }
}


/* Keely 1.32.0: lock the mobile commentary latest article against its own touch-drag movement only. */
@media screen and (max-width: 767px) {
    .commentary-page .all-posts-latest-wrap,
    .commentary-page .all-posts-latest,
    .commentary-page .all-posts-latest-copy {
        height: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: auto !important;
        overscroll-behavior: none !important;
        overflow-anchor: none !important;
    }

    .commentary-page .all-posts-latest-media,
    .commentary-page .all-posts-latest-media *,
    .commentary-page .all-posts-latest-title a,
    .commentary-page .all-posts-latest-link {
        -webkit-user-drag: none !important;
        user-select: none !important;
    }
}


/* Keely 1.32.2: tag essay mobile fixes. */
.tag-essays-section .library-card-media,
.tag-essays-section .tag-essay-card-placeholder,
.tag-essays-section .library-card-placeholder { aspect-ratio: 2 / 3 !important; }
.tag-essays-section .library-home-author,
.tag-essays-section .library-home-author *,
.tag-essays-section .library-home-author a.keely-author-tag-scramble,
.tag-essays-section .library-home-author a.keely-author-tag-scramble * { letter-spacing: normal !important; word-spacing: normal !important; white-space: normal !important; }
.tag-essays-section .library-home-author a.keely-author-tag-scramble,
.tag-essays-section .library-home-author a.keely-author-tag-scramble .scramble-word,
.tag-essays-section .library-home-author a.keely-author-tag-scramble .scramble-char,
.tag-essays-section .library-home-author a.keely-author-tag-scramble .scramble-main { display: inline !important; }
@media screen and (max-width: 767px) {
    .tag-essays-section .tag-essays-carousel.has-one-essay,
    .tag-essays-section .tag-essays-carousel.has-one-essay.flickity-enabled { display: block !important; overflow-x: hidden !important; overflow-y: visible !important; touch-action: pan-y !important; scroll-snap-type: none !important; }
    .tag-essays-section .tag-essays-carousel.has-one-essay .tag-essay-card-placeholder { display: none !important; }
    .tag-essays-section .tag-essays-carousel.has-one-essay .tag-essay-card:not(.tag-essay-card-placeholder) { position: relative !important; left: auto !important; transform: none !important; width: calc(100vw - 36px) !important; max-width: calc(100vw - 36px) !important; margin-right: 0 !important; }
}

/* Keely 1.32.3: tag essay desktop rail cleanup.
   Hide filler cells visually while preserving their carousel/grid space. */
.tag-essays-section .tag-essay-card-placeholder { visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; background: transparent !important; }
.tag-essays-section .tag-essay-card-placeholder .library-card-placeholder { background: transparent !important; }
.tag-essays-section .library-card-title { font-size: clamp(24px, 1.75vw, 34px) !important; line-height: 1.03 !important; letter-spacing: -0.035em !important; margin-bottom: 12px !important; }
.tag-essays-section .library-home-author,
.tag-essays-section .library-home-author *,
.tag-essays-section .library-home-author .post-author-plain-link,
.tag-essays-section .library-home-author .post-author-plain-link *,
.tag-essays-section .library-home-author a.keely-author-tag-scramble,
.tag-essays-section .library-home-author a.keely-author-tag-scramble * { letter-spacing: 0 !important; word-spacing: normal !important; text-transform: none !important; font-kerning: normal !important; font-stretch: normal !important; }
.tag-essays-section .library-home-author .post-author-plain-link,
.tag-essays-section .library-home-author a.keely-author-tag-scramble { display: inline-flex !important; flex-wrap: wrap !important; align-items: baseline !important; gap: 0 !important; white-space: normal !important; }
.tag-essays-section .library-home-author .scramble-word { display: inline-flex !important; flex-wrap: nowrap !important; white-space: nowrap !important; margin: 0 !important; }
.tag-essays-section .library-home-author .scramble-char,
.tag-essays-section .library-home-author .scramble-main { display: inline-block !important; margin: 0 !important; padding: 0 !important; }
@media screen and (max-width: 767px) { .tag-essays-section .library-card-title { font-size: clamp(28px, 8vw, 42px) !important; line-height: 1.02 !important; } }
@media screen and (max-width:767px){body.home-template .library-section:not(.tag-essays-section) .library-carousel[data-library-carousel],body.home-template .library-section:not(.tag-essays-section) .library-carousel.native-mobile-carousel,body.home-template .library-section:not(.tag-essays-section) .library-carousel.keely-mobile-swipe-ready{width:100vw!important;max-width:100vw!important;margin-left:calc(50% - 50vw)!important;padding-left:9vw!important;padding-right:9vw!important;scroll-padding-left:9vw!important;scroll-padding-right:9vw!important;box-sizing:border-box!important}body.home-template .library-section:not(.tag-essays-section) .library-carousel[data-library-carousel] .library-card,body.home-template .library-section:not(.tag-essays-section) .library-carousel.native-mobile-carousel .library-card,body.home-template .library-section:not(.tag-essays-section) .library-carousel.keely-mobile-swipe-ready .library-card{flex:0 0 82vw!important;width:82vw!important;min-width:82vw!important;max-width:82vw!important;margin-right:16px!important;scroll-snap-align:center!important}}
