/* ---------------------------------------------------------------------
RESPONSIVE LAYER
Desktop (1012px and wider) is untouched: every rule below the first one
sits inside a max-width query.
  1011px and below  fluid frame, two columns
   860px and below  compact header with a Menu button, single column
   640px and below  phone: 16px margins, 16px running text, 44px targets
------------------------------------------------------------------------ */

.menu-toggle {
    display: none;
}

/* =====================================================================
   Fluid frame (tablet landscape and small laptops)
   ===================================================================== */
@media (max-width: 1011px) {
    html {
        overflow-x: hidden;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    .content-container {
        box-sizing: border-box;
        padding-left: 24px;
        padding-right: 24px;
        width: auto;
    }
    img {
        max-width: 100%;
        height: auto;
    }

    /* Two columns that share the width */
    .article .col.primary {
        width: calc(100% - 340px);
    }

    /* Masthead title shrinks to leave room for the edition label */
    .gsn .header {
        height: auto;
        min-height: 64px;
    }
    .gsn .header .page-title {
        font-size: clamp(30px, calc((100vw - 258px) / 15), 49px);
        width: auto;
        margin-right: 210px;
    }
    .gsn .tagline {
        line-height: 1.3;
        margin-right: 210px;
    }
    .wir-items .jcarousel-container {
        width: auto;
    }

    .footer .col-primary {
        width: calc(100% - 350px);
        box-sizing: border-box;
    }
    .footer .col-secondary {
        box-sizing: border-box;
        width: 308px;
    }
    .footer ul {
        margin-right: 18px;
    }

    .search-page-form input[type="text"] {
        box-sizing: border-box;
        max-width: calc(100% - 90px);
    }
}

/* =====================================================================
   Single column with a compact header (tablet portrait)
   ===================================================================== */
@media (max-width: 860px) {

    /* --- Global header: wordmark + Menu, links in a sheet ----------- */
    .site-header .content-container {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding-top: 14px;
        padding-bottom: 14px;
    }
    .site-header .logo {
        float: none;
        margin: 0;
        order: 0;
    }
    .site-header .logo img {
        width: 150px;
        height: auto;
    }
    .js .menu-toggle {
        display: block;
        order: 1;
        min-height: 44px;
        min-width: 44px;
        padding: 0 16px;
        border: 0;
        background: #002e5d;
        color: #fff;
        font: 700 16px/44px gsn-sans, "trebuchet ms", "helvetica neue", arial, helvetica, sans-serif;
        cursor: pointer;
    }
    .js .site-header.menu-open .menu-toggle {
        background: #00aae7;
    }
    .menu-toggle:focus-visible {
        outline: 3px solid #00aae7;
        outline-offset: 2px;
    }

    .site-header .nav-primary,
    .site-header .nav-ancillary,
    .site-header .sub {
        float: none;
        width: 100%;
        margin: 0;
    }
    .site-header .nav-primary { order: 2; }
    .site-header .nav-ancillary { order: 3; }
    .site-header .sub { order: 4; }

    .js .site-header .nav-primary,
    .js .site-header .nav-ancillary,
    .js .site-header .sub {
        display: none;
    }
    .js .site-header.menu-open .nav-primary,
    .js .site-header.menu-open .nav-ancillary,
    .js .site-header.menu-open .sub {
        display: block;
    }

    .site-header .nav-primary {
        border-top: 3px solid #002e5d;
        margin-top: 14px;
        padding-top: 6px;
    }
    .site-header .nav-primary li,
    .site-header .nav-ancillary li,
    .site-header .sub li {
        float: none;
        margin: 0;
    }
    .site-header .nav-primary a {
        display: block;
        font-size: 24px;
        line-height: 44px;
        padding: 2px 0;
    }
    .site-header .nav-primary .active {
        padding-left: 10px;
        padding-right: 10px;
    }

    .site-header .nav-ancillary {
        background: #e5f2f7;
        box-sizing: border-box;
        height: auto;
        margin-top: 12px;
        padding: 8px 16px 16px;
    }
    .site-header .nav-ancillary li {
        height: auto;
    }
    .site-header .nav-ancillary a {
        border-right: 0;
        display: block;
        font-size: 15px;
        line-height: 44px;
        padding: 0;
    }
    .site-header .nav-ancillary .search {
        margin-top: 8px;
        padding: 0;
        position: relative;
        width: auto;
    }
    .site-header .nav-ancillary input[type="text"] {
        box-sizing: border-box;
        font-size: 16px;
        height: 44px;
        margin: 0;
        padding: 0 44px 0 12px;
        width: 100%;
    }
    .site-header .nav-ancillary input[type="submit"] {
        right: 14px;
        top: 14px;
    }

    .site-header .sub {
        border-top: 0;
        height: auto;
        padding: 8px 0 4px;
    }
    .site-header .sub .nav-info,
    .site-header .sub .nav-interactive {
        float: none;
    }
    .site-header .sub a {
        font-size: 15px;
        line-height: 24px;
        margin-right: 0;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .site-header .nav-interactive a {
        background-position-y: 14px;
    }
    .site-header .nav-interactive .email { background-position: left -22px; }
    .site-header .nav-interactive .rss { background-position: -14px -101px; padding-left: 26px; }
    .site-header .nav-interactive .print-edition { background-position: left 14px; }
    .site-header .nav-interactive .get-involved { background-position: left -101px; }
    .site-header .nav-secondary a.active {
        border-bottom: 0;
        padding-bottom: 10px;
    }

    /* --- Running text: readable size, 75 characters at most ---------- */
    .main-article p,
    .main-article li,
    .main-article dd,
    .list-items p,
    .listing-intro p,
    .listing-empty,
    .topic-index p,
    .static-page ul,
    .static-page ol {
        font-size: 16px;
        line-height: 1.55;
    }
    .main-article p,
    .list-items p,
    .listing-intro p,
    .topic-index p {
        max-width: 40em;
    }

    /* --- Masthead ---------------------------------------------------- */
    .gsn.body .content-container {
        padding-top: 0;
    }
    .gsn .header {
        padding: 24px 0 20px;
    }
    .gsn .header .page-title {
        font-size: clamp(28px, 7.4vw, 49px);
        line-height: 1.05;
        margin-right: 0;
    }
    .gsn .tagline {
        font-size: 13px;
        line-height: 1.4;
        margin-right: 0;
        margin-top: 6px;
    }
    .gsn .header .ancillary {
        margin-top: 10px;
        position: static;
        text-align: left;
    }
    .masthead-edition br {
        display: none;
    }
    .masthead-edition strong {
        display: inline;
        font-size: 16px;
        margin-left: 4px;
    }

    /* --- Grey utility bar -------------------------------------------- */
    .gsn .utility,
    .gsn.article .utility {
        overflow: hidden;
    }
    .utility .issue {
        width: auto;
    }

    /* --- Columns stack; sidebar modules sit two-up ------------------- */
    .article .col.primary,
    .article .col.secondary {
        float: none;
        width: auto;
    }
    .col.primary > .print-issue {
        display: block;
        float: none;
        margin: 0 0 8px;
    }
    .article .col.secondary {
        clear: both;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 20px;
        align-items: start;
        margin-top: 24px;
    }
    .article .col.secondary .legal {
        grid-column: 1 / -1;
    }
    .gsn-search select {
        max-width: 100%;
    }
    .gsn-search .customStyleSelectBox {
        max-width: calc(100% - 32px);
    }
    .gsn-search input[type="text"] {
        box-sizing: border-box;
        max-width: 100%;
    }

    /* --- Week in Review ---------------------------------------------- */
    .wir-title {
        position: static;
        width: auto;
        overflow: hidden;
    }
    .wir-items .jcarousel-container {
        padding-top: 24px;
        width: auto;
    }
    .wir-items ul {
        margin-top: 0;
        padding-top: 0;
    }
    .wir-items .jcarousel-pagination {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 20px;
        position: static;
    }
    .wir-items .jcarousel-prev,
    .wir-items .jcarousel-next {
        position: relative;
    }
    .wir-items .jcarousel-prev::after,
    .wir-items .jcarousel-next::after {
        content: "";
        position: absolute;
        top: -15px;
        right: -8px;
        bottom: -15px;
        left: -8px;
    }
    .wir-items .wir-item-inner {
        box-sizing: border-box;
        display: block;
        padding: 0 16px;
    }
    .wir-items li.first .wir-item-inner {
        padding-left: 0;
    }

    /* --- Global footer ----------------------------------------------- */
    .footer .col-primary,
    .footer .col-secondary {
        float: none;
        width: auto;
    }
    .footer .col-primary {
        border-right: 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        column-gap: 20px;
        padding-right: 0;
    }
    .footer ul,
    .footer ul.last {
        float: none;
        margin-right: 0;
        padding: 32px 0 8px;
        width: auto;
    }
    .footer .col-secondary,
    .home .footer .col-secondary,
    .gsn-home .footer .col-secondary {
        background: none;
    }
    .footer ul li:first-child a,
    .footer .last li a {
        box-sizing: border-box;
    }
    .footer .col-secondary {
        border-top: 8px solid #0382b6;
        margin: 16px -24px 0;
        padding: 8px 24px 32px;
    }
    .footer .col-secondary ul {
        padding-top: 16px;
    }
    .footer .tail {
        display: none;
    }
}

/* =====================================================================
   Phone
   ===================================================================== */
@media (max-width: 640px) {
    .content-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .item-detail,
    .item-detail .tags,
    .list-featured .tags {
        font-size: 13px;
        line-height: 1.5;
    }
    .more,
    .more span {
        font-size: 13px;
    }
    .more {
        display: inline-block;
        padding: 12px 0;
    }

    /* Masthead */
    .gsn .tagline {
        font-size: 13px;
    }

    /* Utility bar: date on one line, links on the next */
    .utility .issue,
    .utility .ancillary {
        float: none;
        display: block;
    }
    .utility .ancillary {
        height: auto;
        margin-top: 4px;
        overflow: hidden;
    }
    .utility .ancillary a {
        display: inline-block;
        font-size: 14px;
        line-height: 32px;
    }
    .utility .back {
        background-position: left 13px;
        display: inline-block;
        font-size: 14px;
        line-height: 32px;
    }

    /* Story lists: smaller thumbnail, title beside it */
    .list-featured h2 {
        font-size: 26px;
        line-height: 1.15;
    }
    .print-issue {
        float: none;
        display: block;
        font-size: 15px;
        margin: 8px 0 0;
    }
    .list-items .thumb,
    .list-featured .thumb {
        width: 96px;
        margin-right: 12px;
        margin-bottom: 8px;
    }
    .list h3,
    .list-items h3 {
        font-size: 18px;
        line-height: 1.3;
    }

    /* Article */
    .main-article .content-titles {
        font-size: 24px;
    }
    .main-article .content-titles h1 {
        line-height: 1.2;
    }
    .main-article .media-preview {
        float: none;
        margin: 0 0 20px;
        width: auto;
        display: flex;
        gap: 12px;
        align-items: flex-start;
        background-color: #f4f4f4;
    }
    .main-article .media-preview img {
        flex: 0 0 45%;
        max-width: 45%;
    }
    .main-article .media-preview .caption {
        font-size: 13px;
        line-height: 1.45;
        padding: 8px 8px 8px 0;
    }
    .utility .share a {
        margin-right: 14px;
    }
    .article-footer .tags,
    .article-footer .tags li {
        font-size: 13px;
        line-height: 1.6;
    }

    /* Sidebar modules: one column */
    .article .col.secondary {
        display: block;
    }
    .quote blockquote p {
        font-size: 20px;
    }

    /* Listing pages */
    .listing-title {
        font-size: 26px;
    }
    .search-page-form input[type="text"] {
        display: block;
        font-size: 16px;
        height: 44px;
        max-width: none;
        width: 100%;
    }
    .search-page-form input[type="submit"] {
        margin: 10px 0 0;
        min-height: 44px;
        padding: 0 20px;
    }

    /* Week in Review: prev / next only, the page numbers would crowd */
    .footer-review .section-head {
        border-right: 0;
        float: none;
        font-size: 24px;
        margin-bottom: 12px;
        padding: 0;
    }
    .footer-review .date-select {
        float: none;
        padding-left: 0;
    }
    .wir-items .jcarousel-pagination ul {
        display: none;
    }
    .wir-items .jcarousel-list li {
        font-size: 16px;
    }
    .wir-items .wir-item-inner {
        padding: 0 10px;
    }

    /* Footer: two columns, links big enough for a thumb */
    .footer .col-primary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .footer .col-primary ul a {
        font-size: 14px;
        padding: 6px 0;
    }
    .footer .col-secondary {
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
    }
}
