/* Magazine masthead.
   Desktop only (Fox swaps to its own mobile header at 840px and below). */
body.aftab-mag-header {
    --mag-ink: #111;
    --mag-muted: #6b6b6b;
    --mag-rule: #cfcfcf;
}

.aftab-mag-strip { display: none; }

@media (min-width: 841px) {
    /* Date strip: date on the right, social links on the left, full content width.
       Transparent so Fox's hand-drawn wrapper border stays continuous. */
    .aftab-mag-header .aftab-mag-strip {
        display: block;
        width: 100%;
        align-self: stretch;
        background: transparent;
        font-size: 13px;
        line-height: 1;
        color: var(--mag-muted);
    }
    .aftab-mag-header .aftab-mag-strip-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 36px;
        width: 1170px;
        max-width: calc(100% - 60px);
        margin: 0 auto;
        padding: 0;
    }
    /* .container's clearfix pseudo-elements would become flex items. */
    .aftab-mag-header .aftab-mag-strip-inner::before,
    .aftab-mag-header .aftab-mag-strip-inner::after {
        content: none;
        display: none;
    }
    .aftab-mag-header .aftab-mag-social {
        display: flex;
        gap: 18px;
    }
    .aftab-mag-header .aftab-mag-social a {
        color: var(--mag-muted);
        text-decoration: none;
    }
    .aftab-mag-header .aftab-mag-social a:hover,
    .aftab-mag-header .aftab-mag-social a:focus-visible {
        color: var(--mag-ink);
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    /* Logo first, category bar second */
    .aftab-mag-header #masthead .header-container {
        display: flex;
        flex-direction: column;
    }
    .aftab-mag-header #masthead .header-row-branding { order: 1; }
    .aftab-mag-header #masthead .header-row-nav { order: 2; }

    .aftab-mag-header #masthead .header-row-branding #wi-header {
        padding: 18px 0 26px;
        background: transparent;
    }
    .aftab-mag-header #masthead #logo-area { padding: 0; margin: 0; }
    .aftab-mag-header #masthead .main-img-logo {
        width: 860px;
        max-width: 100%;
        height: auto;
    }
    .aftab-mag-header #masthead .slogan:empty { display: none; }

    /* Category bar: thick+thin rule above, thin rule below, on the inner
       container so every line shares the content width. */
    .aftab-mag-header #masthead .header-row-nav,
    .aftab-mag-header #masthead .header-row-nav #wi-topbar {
        background: transparent;
        border: 0;
        box-shadow: none;
    }
    .aftab-mag-header #masthead #wi-topbar .container {
        position: relative;
        display: flex;
        justify-content: center;
        margin-top: 0;
        padding-top: 4px;
        border-top: 3px solid var(--mag-ink);
        border-bottom: 1px solid var(--mag-ink);
        box-shadow: inset 0 3px 0 #fff, inset 0 4px 0 var(--mag-ink);
    }
    .aftab-mag-header #masthead #wi-topbar .header-row-left {
        flex: 0 1 auto;
        justify-content: center;
    }
    .aftab-mag-header #masthead #wi-topbar .header-row-right {
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
    }

    .aftab-mag-header #masthead #wi-mainnav .menu > li > a {
        font-size: 15px;
        font-weight: 700;
        padding: 0 14px;
        line-height: 46px;
        position: relative;
    }
    /* Fox's default active item is a black box; use an underline instead.
       Drawn as a background image so Fox's dropdown chevron (a::after) stays. */
    .aftab-mag-header #masthead #wi-mainnav .menu > li {
        background-color: transparent !important;
    }
    .aftab-mag-header #masthead #wi-mainnav .menu > li > a {
        background-color: transparent !important;
        color: var(--mag-ink) !important;
        background-image: linear-gradient(var(--mag-ink), var(--mag-ink));
        background-repeat: no-repeat;
        background-origin: content-box;
        background-position: center bottom 10px;
        background-size: 0 2px;
        transition: background-size .2s ease;
    }
    .aftab-mag-header #masthead #wi-mainnav .menu > li:hover > a,
    .aftab-mag-header #masthead #wi-mainnav .menu > li > a:focus-visible,
    .aftab-mag-header #masthead #wi-mainnav .menu > li.current-menu-item > a,
    .aftab-mag-header #masthead #wi-mainnav .menu > li.current-menu-ancestor > a {
        background-size: 100% 2px;
    }
    /* Thin separators between categories */
    .aftab-mag-header #masthead #wi-mainnav .menu > li + li > a::before {
        content: "";
        position: absolute;
        right: 0;
        top: 50%;
        height: 12px;
        margin-top: -6px;
        border-right: 1px solid var(--mag-rule);
    }
}

@media (prefers-reduced-motion: reduce) {
    .aftab-mag-header #masthead #wi-mainnav .menu > li > a { transition: none; }
}
