/* NN NEWS — full-width golden line */
.mainnav {
    border-bottom: 4px solid var(--gold);
}

.nn-menu-toggle {
    display: none;
}

/* Mobile header */
@media (max-width: 700px) {
    .masthead-shell:after {
        display: none;
    }

    .masthead {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
        grid-template-rows: auto auto;
        align-items: start;
        gap: 9px 8px;
        padding: 10px 12px;
        min-height: 0;
    }

    .masthead .brand {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        gap: 6px;
        align-items: flex-start;
    }

    .masthead .brand-mark {
        width: 55px;
        height: 60px;
        flex-shrink: 0;
    }

    .masthead .brand-type {
        min-width: 0;
    }

    .masthead .brand strong {
        font-size: clamp(.97rem, 3.7vw, 1.35rem);
        line-height: 1.25;
        white-space: nowrap;
    }

    .masthead .brand small {
        font-size: .55rem;
        letter-spacing: 1.4px;
    }

    .masthead .brand .tagline {
        display: none;
    }

    .masthead .head-actions {
        display: contents;
    }

    /* Language switch: top-aligned with निर्भय निष्पक्ष */
    .masthead .langs {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        align-self: start;
        margin: 0;
    }

    .masthead .langs a {
        font-size: .77rem;
        padding: 5px 9px;
    }

    /* Second row: hamburger left, search right */
    .masthead .nn-menu-toggle {
        display: inline-flex;
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
        align-items: center;
        gap: 6px;
        background: var(--deep);
        color: white;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: .88rem;
    }

    .masthead .search {
        display: flex;
        grid-column: 2;
        grid-row: 2;
        width: 100%;
        min-width: 0;
        max-width: none;
        flex-basis: auto;
        order: initial;
        margin: 0;
    }

    .masthead .search input {
        min-width: 0;
        padding: 7px;
        font-size: .78rem;
    }

    .masthead .search button {
        padding: 6px 10px;
    }

    /* Menu closed by default */
    .mainnav {
        display: block;
        width: 100%;
        overflow: visible;
    }

    .mainnav .nav-inner {
        display: none;
        width: 100%;
        overflow: visible;
    }

    /* Expanded menu: two rows, five columns */
    .mainnav.nn-open .nav-inner {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 2px;
        padding: 7px;
        white-space: normal;
    }

    .mainnav .nav-inner a {
        min-width: 0;
        padding: 9px 2px;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.35;
        font-size: clamp(.65rem, 2.5vw, .82rem);
        border-bottom: 0;
    }

    .mainnav .nav-inner a:first-child {
        border-bottom: 0;
    }
}

/* Equal-width mobile Menu and Search */
@media (max-width: 700px) {
    .masthead {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .masthead .nn-menu-toggle {
        width: 100%;
        justify-content: center;
        min-height: 40px;
    }

    .masthead .search {
        width: 100%;
        min-width: 0;
        min-height: 40px;
    }

    .masthead .search input {
        min-width: 0;
        width: 100%;
    }
}

/* Final mobile adjustment: narrow Menu, wide Search, equal height */
@media (max-width: 700px) {
    .masthead {
        grid-template-columns: 95px minmax(0, 1fr);
    }

    .masthead .nn-menu-toggle {
        width: 95px;
        height: 44px;
        min-height: 44px;
        padding: 0 8px;
        justify-content: center;
    }

    .masthead .search {
        width: 100%;
        height: 44px;
        min-height: 44px;
        margin: 0;
    }

    .masthead .search input {
        height: 44px;
        min-width: 0;
        flex: 1;
    }

    .masthead .search button {
        height: 44px;
        padding: 0 12px;
    }
}

/* Restore complete NN NEWS branding on mobile */
@media (max-width: 700px) {
    .masthead .brand .tagline {
        display: block !important;
        font-size: 0.65rem;
        line-height: 1.25;
        margin-top: 2px;
        color: var(--muted);
        white-space: normal;
    }

    .masthead .brand-type {
        min-width: 0;
        overflow: visible;
    }

    .masthead .brand small {
        display: block;
        margin-top: 2px;
    }
}

/* Keep NN NEWS tagline on one line on mobile */
@media (max-width: 700px) {
    .masthead .brand .tagline {
        display: block !important;
        white-space: nowrap !important;
        font-size: clamp(8px, 2.2vw, 11px);
        line-height: 1.3;
        letter-spacing: -0.15px;
        margin-top: 3px;
    }
}
