/**
 * Granite State Rundown — Header controls v1.0.5
 * Same desktop box size, icon scale, colors and borders as the final
 * Share This Article control row in GSR Article Layout.
 * Limits changes to the existing top-bar social links and Search trigger.
 */

/* The parent Fairy theme supplies dark circular backgrounds on li/a. */
html body li.gsr-header-social-item.gsr-header-social-item,
html body li.gsr-header-social-item.gsr-header-social-item::before,
html body li.gsr-header-social-item.gsr-header-social-item::after {
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Match 38×38px sharing controls with 17px artwork. */
html body a.gsr-header-social-link.gsr-header-social-link,
html body li.gsr-header-social-item > a.gsr-header-social-link.gsr-header-social-link,
html body a.gsr-header-search-control.gsr-header-search-control,
html body button.gsr-header-search-control.gsr-header-search-control,
html body .gsr-header-search-control.gsr-header-search-control {
    box-sizing: border-box !important;
    display: inline-flex !important;
    position: relative !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    flex: 0 0 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #cbd5df !important;
    border-radius: 9px !important;
    background: #f8f9fa !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #243b50 !important;
    text-align: center !important;
    text-decoration: none !important;
    font-size: 17px !important;
    line-height: 1 !important;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease !important;
    cursor: pointer;
}

/* Legacy social glyphs are hidden, as the exact sharing SVG paths are used. */
html body a.gsr-header-social-link::before,
html body a.gsr-header-social-link::after,
html body li.gsr-header-social-item > a.gsr-header-social-link::before,
html body li.gsr-header-social-item > a.gsr-header-social-link::after {
    content: none !important;
    display: none !important;
}

html body a.gsr-header-social-link svg.gsr-header-social-svg,
html body li.gsr-header-social-item > a.gsr-header-social-link svg.gsr-header-social-svg {
    box-sizing: content-box !important;
    display: block !important;
    width: 17px !important;
    min-width: 17px !important;
    max-width: 17px !important;
    height: 17px !important;
    min-height: 17px !important;
    max-height: 17px !important;
    flex: 0 0 17px !important;
    padding: 0 !important;
    margin: 0 !important;
    fill: currentColor !important;
    stroke: none !important;
    color: inherit !important;
    pointer-events: none;
}
html body a.gsr-header-social-link svg.gsr-header-social-svg path {
    fill: currentColor !important;
    stroke: none !important;
}

/* Search keeps its original handler and markup; its glyph is recolored. */
html body .gsr-header-search-control.gsr-header-search-control,
html body .gsr-header-search-control.gsr-header-search-control > i,
html body .gsr-header-search-control.gsr-header-search-control > span,
html body .gsr-header-search-control.gsr-header-search-control svg,
html body .gsr-header-search-control.gsr-header-search-control::before,
html body .gsr-header-search-control.gsr-header-search-control::after {
    color: inherit !important;
}
html body .gsr-header-search-control.gsr-header-search-control > i,
html body .gsr-header-search-control.gsr-header-search-control .fa,
html body .gsr-header-search-control.gsr-header-search-control .fas,
html body .gsr-header-search-control.gsr-header-search-control .dashicons {
    font-size: 17px !important;
    line-height: 1 !important;
    background: none !important;
}
html body .gsr-header-search-control.gsr-header-search-control svg {
    width: 17px !important;
    height: 17px !important;
    fill: currentColor !important;
}

/* Bring the social row together without modifying the primary menu. */
html body ul.gsr-header-social-list.gsr-header-social-list {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
html body ul.gsr-header-social-list > li.gsr-header-social-item {
    margin: 0 !important;
    padding: 0 !important;
}

html body a.gsr-header-social-link.gsr-header-social-link:hover,
html body a.gsr-header-social-link.gsr-header-social-link:focus-visible,
html body a.gsr-header-search-control.gsr-header-search-control:hover,
html body a.gsr-header-search-control.gsr-header-search-control:focus-visible,
html body button.gsr-header-search-control.gsr-header-search-control:hover,
html body button.gsr-header-search-control.gsr-header-search-control:focus-visible,
html body .gsr-header-search-control.gsr-header-search-control:hover,
html body .gsr-header-search-control.gsr-header-search-control:focus-visible {
    border-color: #a71919 !important;
    background: #a71919 !important;
    color: #fff !important;
}
html body .gsr-header-search-control.gsr-header-search-control:hover > i,
html body .gsr-header-search-control.gsr-header-search-control:focus-visible > i,
html body .gsr-header-search-control.gsr-header-search-control:hover::before,
html body .gsr-header-search-control.gsr-header-search-control:focus-visible::before {
    color: #fff !important;
}
html body .gsr-header-search-control.gsr-header-search-control:hover svg,
html body .gsr-header-search-control.gsr-header-search-control:focus-visible svg {
    color: #fff !important;
}
html body a.gsr-header-social-link.gsr-header-social-link:focus-visible,
html body .gsr-header-search-control.gsr-header-search-control:focus-visible {
    outline: 2px solid #a71919 !important;
    outline-offset: 2px !important;
}

/* Preserve room for the bigger controls in the thin top utility bar. */
html body .gsr-header-top-strip.gsr-header-top-strip {
    min-height: 48px !important;
}

/* Space is limited on phones; retain every account in an accessible row. */
@media (max-width: 782px) {
    html body a.gsr-header-social-link.gsr-header-social-link,
    html body li.gsr-header-social-item > a.gsr-header-social-link.gsr-header-social-link,
    html body a.gsr-header-search-control.gsr-header-search-control,
    html body button.gsr-header-search-control.gsr-header-search-control,
    html body .gsr-header-search-control.gsr-header-search-control {
        width: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
        flex-basis: 30px !important;
        border-radius: 8px !important;
    }
    html body a.gsr-header-social-link svg.gsr-header-social-svg,
    html body li.gsr-header-social-item > a.gsr-header-social-link svg.gsr-header-social-svg {
        width: 15px !important;
        min-width: 15px !important;
        max-width: 15px !important;
        height: 15px !important;
        min-height: 15px !important;
        max-height: 15px !important;
        flex-basis: 15px !important;
    }
    html body ul.gsr-header-social-list.gsr-header-social-list {
        max-width: calc(100vw - 94px) !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: thin;
        gap: 5px !important;
    }
}
@media (prefers-reduced-motion: reduce) {
    html body a.gsr-header-social-link.gsr-header-social-link,
    html body .gsr-header-search-control.gsr-header-search-control {
        transition: none !important;
    }
}

/* v1.0.3 — Search and profile controls must have the same visual treatment. */
html body li.gsr-header-search-item,
html body li.gsr-header-search-item::before,
html body li.gsr-header-search-item::after {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
html body .gsr-header-search-control.gsr-header-search-control {
    margin-right: 9px !important;
    background-color: #f8f9fa !important;
    border-color: #cbd5df !important;
    color: #243b50 !important;
}
html body .gsr-header-search-control.gsr-header-search-control:hover,
html body .gsr-header-search-control.gsr-header-search-control:focus-visible {
    background-color: #a71919 !important;
    border-color: #a71919 !important;
    color: #fff !important;
}
html body .gsr-header-search-control.gsr-header-search-control .fa-search,
html body .gsr-header-search-control.gsr-header-search-control .fa-search::before,
html body .gsr-header-search-control.gsr-header-search-control .search-icon,
html body .gsr-header-search-control.gsr-header-search-control .search-icon::before {
    color: inherit !important;
    background: transparent !important;
}
@media (max-width: 782px) {
    html body .gsr-header-search-control.gsr-header-search-control {
        margin-right: 5px !important;
    }
}

/* v1.0.5: fix confirmed Fairy markup without replacing menu elements. */
.site-header-topbar .fairy-menu-social.topbar-flex-grid {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 9px !important;
    width: auto !important;
    height: auto !important;
}
.site-header-topbar .fairy-menu-social > ul#menu-social-menu.social-menu {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    list-style: none !important;
}
.site-header-topbar .fairy-menu-social ul#menu-social-menu > li.gsr-header-social-item {
    display: block !important;
    flex: 0 0 auto !important;
    width: auto !important;
    height: auto !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.site-header-topbar .fairy-menu-social ul#menu-social-menu > li.gsr-header-social-item > a.gsr-header-social-link {
    float: none !important;
    overflow: hidden !important;
    text-indent: 0 !important;
    font-size: 0 !important;
}
.site-header-topbar .fairy-menu-social > button.search-toggle.gsr-header-search-control {
    display: inline-flex !important;
    flex: 0 0 38px !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}
.site-header-topbar .fairy-menu-social ul#menu-social-menu > li.gsr-header-social-item > a.gsr-header-social-link::before,
.site-header-topbar .fairy-menu-social ul#menu-social-menu > li.gsr-header-social-item > a.gsr-header-social-link::after {
    content: none !important;
    display: none !important;
}
@media(max-width:782px) {
    .site-header-topbar .fairy-menu-social > button.search-toggle.gsr-header-search-control {
        flex-basis: 30px !important;
    }
    .site-header-topbar .fairy-menu-social > ul#menu-social-menu.social-menu {
        max-width: calc(100vw - 95px) !important;
        overflow-x: auto !important;
    }
}
