/* ~/CSS/Pages/Users/Friends/Friends.css
 *
 * Sliced out of the 2017FriendsPage dump's page CSS bundle. Everything else the page uses
 * (avatar-cards, avatar-card-*, rbx-tabs-horizontal, pager-holder, rbx-popover-content,
 * alert-system-feedback, the icon sprite) is already in SiteStyle.css.
 *
 * No url() references here, so nothing to re-point at public/.
 *
 * Rescoped from `.content` to `.page-content`: upstream wrapped page bodies in
 * <div class="content">, but _layout.ejs here wraps them in #Body.body-width, so every
 * `.content ...` rule would have been dead. The two rules that only sized that wrapper
 * (max-width and the small-screen margin) are dropped — .body-width already handles it. */

.form-inline {
    position: static;
}

.modal-header .icon-close {
    background-position: 0 -420px;
    background-size: 40px auto;
    width: 20px;
    height: 20px;
    vertical-align: top;
}

.page-content .friends-subtitle {
    margin: 0 0 0 6px;
    display: inline-block;
}

.page-content .tooltip-container .icon-moreinfo {
    background-position: 0 -200px;
    background-size: 40px auto;
    width: 20px;
    height: 20px;
    position: relative;
    top: 3px;
    padding: 0;
}

.page-content .ignore-button {
    float: right;
    margin: 6px 0 0;
}

@media (max-width: 543px) {
    .page-content .ignore-button {
        width: 100%;
        margin: 0 0 6px;
    }
}

.page-content .hide-template {
    opacity: 0;
    transition: all, 0.2s, ease-in-out;
}

.page-content .horizontal-tabs {
    margin-bottom: 12px;
}

.page-content .nav-tabs {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    margin-bottom: 12px;
}

/* Four tabs normally; three when the Requests tab is hidden on someone else's page. */
.page-content .rbx-tab {
    width: 25%;
}

.page-content .rbx-tab.subtract-item {
    width: 33.33333%;
}

/* ---------------------------------------------------------------------------
 * Mobile
 *
 * Two separate problems live below, in this order:
 *
 *  1. Rules the page LOST. /CSS/Legacy/Navigation.css is an older generation of the
 *     same style guide and _layout.ejs links it AFTER /CSS/SiteStyle.css, so wherever
 *     it re-declares a selector at equal specificity it wins — including over
 *     SiteStyle's `@media (max-width: 767px)` variants, since a media query adds no
 *     specificity of its own. Three of those regressions land on this page. They are
 *     restored here rather than in Navigation.css because that file is site-wide and
 *     every other page has been laid out against it as it stands.
 *
 *  2. Ergonomics the 2017 original never had. It was built for a 970px column and
 *     scaled down; it was never given finger-sized controls. Everything under the
 *     media queries is that: touch targets at the 44px guideline, and labels that
 *     stop crowding once four tabs have to share a 320px screen.
 *
 * Verified against the real page at 320 / 375 / 543 / 767 / 1200px.
 */

/* (1a) Navigation.css sets `.tooltip-container { display: table }`, which is a block
   box — so the "i" next to "Friends (11)" dropped onto a line of its own at EVERY
   width. SiteStyle and the 2017 dump both say inline-block. */
.page-content .tooltip-container {
    display: inline-block;
}

/* (1b) Navigation.css pins the system-feedback banner to a flat `width: 970px` where
   SiteStyle has `width: 100%; max-width: 970px`. The banner is position:fixed, so on a
   phone it did not widen the page (#Body is overflow-x:hidden below 970px) — it simply
   ran ~600px off the right edge, taking its floated close "X" with it, leaving a
   message that could not be dismissed. This is the banner every unfriend / follow /
   accept / ignore on this page reports through. */
.page-content .alert-system-feedback .alert {
    width: 100%;
    max-width: 970px;
}

@media (max-width: 767px) {
    /* (2a) Tab labels. Four tabs share 25% each, and at 320px that is 80px against a
       "Following" that measures 75.9px at the inherited 18px — about two pixels of
       gutter, and an overflow the moment Source Sans Pro is not the face that loads.
       The percentage padding made it worse by shrinking with the tab. Fixed px padding
       plus a smaller label buys real room; nowrap makes a miss show up as overflow
       rather than as one tab silently growing to two lines and shoving the row down. */
    .page-content .rbx-tab .rbx-tab-heading {
        padding: 14px 4px;
    }

    .page-content .rbx-tab .rbx-tab-heading span {
        font-size: 16px;
        white-space: nowrap;
    }

    /* (2b) Accept / Ignore on the Requests tab came out 31px tall — the one pair of
       controls on this page you are meant to hit repeatedly. Padding rather than
       min-height so the label stays vertically centred (these carry line-height:100%). */
    .page-content .avatar-card-btns [class^="btn-"] {
        padding: 13px 7px;
    }

    /* (2c) The card "..." menu was a bare 20px sprite tucked into the corner. Grow the
       anchor around it to 44px and pull the container back to the corner it now fills,
       so the icon stays where it was drawn. */
    .page-content .avatar-card-container .avatar-card-menu {
        top: 0;
        right: 0;
    }

    .page-content .avatar-card-menu .rbx-menu-item {
        display: block;
        padding: 12px;
    }

    /* (2d) Pager arrows were 32px. Dropping the float and centring the row as
       inline-blocks keeps the page number aligned with the taller arrows — .pager is
       already text-align:center, so nothing else has to change to keep it centred. */
    .page-content .pager li {
        float: none;
        display: inline-block;
        vertical-align: middle;
    }

    .page-content .pager li a {
        width: 44px;
        height: 44px;
        padding-top: 12px;
    }
}

@media (max-width: 543px) {
    /* (2e) 16px still crowds four tabs on the narrowest phones: at 320px a tab is 80px
       wide and "Following" needs ~67px of it. 14px brings that to ~59px. */
    .page-content .rbx-tab .rbx-tab-heading span {
        font-size: 14px;
    }

    /* (2f) 30px of title plus its padding costs a fifth of a phone's first screen. */
    .page-content .friends-title {
        font-size: 24px;
    }

    /* (2g) The 92px avatar leaves 164px of a 320px screen for the username and the
       "Playing <game>" line under it, which truncates most names. 72px gives that
       column ~200px and shortens every row by 24px, so more of the list fits on screen.
       The caption width is the dump's own `calc(100% - avatar - margins - menu room)`
       arithmetic re-run against the smaller avatar; it has to move with it or the
       caption keeps reserving space for the 92px one. */
    .page-content .avatar-card-container .avatar-card-fullbody {
        width: 72px;
        height: 72px;
        margin: 10px;
    }

    .page-content .avatar-card-container .avatar-card-caption {
        width: calc(100% - 72px - 20px - 20px);
    }
}
