/* =========================================================================
   THE LAHORE TIMES — HEADER (loaded on every page via functions.php)

   ── ADJUST HERE ─────────────────────────────────────────────
   Logo display size:  --lhr-logo-h-desktop / --lhr-logo-h-mobile
   Accent color:       --lhr-accent
   ──────────────────────────────────────────────────────────── */

:root {
    --lhr-ink:    #111111;
    --lhr-paper:  #ffffff;
    --lhr-muted:  #6b6b6b;
    --lhr-hair:   #d9d5cd;
    --lhr-accent: #b30000;

    /* UNIFIED LINK PALETTE — one scheme for menu, body, everything.
       Change these two values to re-theme every link on the site. */
    --lhr-link:       #b30000;   /* base link color            */
    --lhr-link-hover: #6e0000;   /* hover / active (darker)    */

    --lhr-logo-h-desktop: 64px;   /* ← logo height on desktop */
    --lhr-logo-h-mobile:  44px;   /* ← logo height on phones  */
    --lhr-navbar-h: 52px;

    --lhr-serif: Georgia, "Times New Roman", serif;
    --lhr-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
}

/* position:sticky needs no overflow-clipping ancestor */
#page { overflow: visible; }

/* =========================================================================
   RESETS — neutralize the parent theme's generated header CSS.
   The parent applies fixed heights / fixed positioning to #header and
   compensating padding to #middle; with the new markup those rules made
   the header overlap and stretch ("everything broken"). Kill them here.
   ========================================================================= */
#header,
#header .lhr-masthead,
#header .lhr-navbar {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    line-height: normal !important;
    float: none !important;
    width: auto !important;
}
#header {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    box-shadow: none;
    background: var(--lhr-paper);
}
#middle,
.middle_inner {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
body { padding-top: 0 !important; }

/* Safety net: if any logo markup ever prints a second (retina) image,
   only the first one is shown. */
.lhr-masthead__logo-link img:not(:first-child),
.lhr-masthead .logo img:not(:first-child),
.lhr-masthead .logo_retina { display: none !important; }

/* Sticky must still work on the nav bar itself */
.lhr-navbar { position: sticky !important; top: 0 !important; }

/* ---- 1. Masthead ---- */
.lhr-masthead {
    text-align: center;
    padding: 18px 16px 12px;
    background: var(--lhr-paper);
}
.lhr-masthead__logo-link { display: inline-block; line-height: 0; }

/* The single masthead logo */
.lhr-masthead__logo {
    height: var(--lhr-logo-h-desktop) !important;
    width: auto !important;
    max-width: min(86vw, 560px) !important;
    aspect-ratio: auto !important;
    object-fit: contain;
    display: inline-block;
}
.lhr-masthead__text-logo {
    font-family: var(--lhr-serif);
    font-weight: 700;
    font-size: 40px;
    line-height: 1.1;
    color: var(--lhr-ink);
}

#header .lhr-masthead__dateline {
    margin: 10px 0 0 !important;
    font-family: var(--lhr-sans) !important;
    font-size: 12px !important;
    font-style: normal !important;
    letter-spacing: .14em !important;
    text-transform: uppercase !important;
    color: var(--lhr-muted);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    line-height: 1.4 !important;
}
#header .lhr-masthead__dateline strong { color: var(--lhr-ink); font-weight: 700; }
#header .lhr-masthead__dateline .sep { color: var(--lhr-hair); }
#header .lhr-masthead__dateline a {
    font-family: var(--lhr-sans) !important;
    font-size: 12px !important;
    font-style: normal !important;
    font-weight: 700 !important;
    letter-spacing: .14em !important;
    color: var(--lhr-ink) !important;
    text-decoration: none !important;
    border: 0 !important;
    padding: 0 !important;
}
#header .lhr-masthead__dateline a:hover { color: var(--lhr-accent) !important; }

/* Classic broadsheet double rule */
.lhr-rule {
    border: 0;
    margin: 0;
    height: 5px;
    background: var(--lhr-paper);
    border-top: 3px solid var(--lhr-ink);
    border-bottom: 1px solid var(--lhr-ink);
}

/* ---- 2. Sticky nav bar ---- */
#header .lhr-navbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 900;
    background: var(--lhr-paper) !important;
    border-bottom: 1px solid var(--lhr-hair);
    height: var(--lhr-navbar-h) !important;
    display: flex !important;
    align-items: center;            /* vertical centering */
    gap: 4px;
    padding: 0 8px !important;
    margin: 0 !important;
}
#header .lhr-navbar.is-stuck { box-shadow: 0 2px 10px rgba(0,0,0,.08); }

/* Compact wordmark slides in once the masthead scrolls away */
.lhr-navbar__brand {
    display: flex;
    align-items: center;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width .35s ease, opacity .25s ease;
    white-space: nowrap;
}
.lhr-navbar.is-stuck .lhr-navbar__brand { max-width: 200px; opacity: 1; margin-right: 6px; }
.lhr-navbar__brand a {
    font-family: var(--lhr-serif);
    font-weight: 700;
    font-size: 17px;
    color: var(--lhr-ink);
    text-decoration: none;
    padding: 0 6px 0 8px;
}
.lhr-navbar__brand a:hover { color: var(--lhr-accent); }

/* The menu row itself — swipeable on phones, centered on desktop.
   All selectors are prefixed with #header: the parent theme styles
   "#header ul li" (ID specificity), which was overriding the flex row
   and stacking the items with border lines through them. */
#header .lhr-navbar__links {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent);
}
#header .lhr-navbar__links::-webkit-scrollbar { display: none; }

#header .lhr-navbar__links .lhr-navlist {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 4px;
    width: max-content !important;
    float: none !important;
    border: 0 !important;
    background: none !important;
}
#header .lhr-navbar__links .lhr-navlist li {
    display: block !important;
    flex: 0 0 auto !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    line-height: normal !important;
    border: 0 !important;
    background: none !important;
    list-style: none !important;
    text-align: left !important;
    position: static !important;
}
/* Kill the parent's decorative lines/underlines (borders + pseudo-elements) */
#header .lhr-navbar__links .lhr-navlist li::before,
#header .lhr-navbar__links .lhr-navlist li::after,
#header .lhr-navbar__links .lhr-navlist a::before,
#header .lhr-navbar__links .lhr-navlist a::after {
    content: none !important;
    display: none !important;
}
html #header .lhr-navbar__links .lhr-navlist a {
    display: block !important;
    font-family: var(--lhr-sans) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    font-style: normal !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    color: #000000 !important;              /* menu base: solid black */
    text-decoration: none !important;
    border: 0 !important;
    background: none !important;
    padding: 8px 10px !important;
    margin: 0 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    height: auto !important;
}
html #header .lhr-navbar__links .lhr-navlist a:hover { color: var(--lhr-link-hover) !important; }
html #header .lhr-navbar__links .lhr-navlist .current-menu-item > a,
html #header .lhr-navbar__links .lhr-navlist .current_page_item > a,
html #header .lhr-navbar__links .lhr-navlist .current-cat > a {
    color: var(--lhr-link-hover) !important;
    box-shadow: inset 0 -2px 0 var(--lhr-link-hover);
}

/* Icon buttons */
.lhr-iconbtn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: var(--lhr-ink);
}
.lhr-iconbtn:hover { color: var(--lhr-accent); }
.lhr-iconbtn:focus-visible { outline: 2px solid var(--lhr-accent); outline-offset: 2px; }
.lhr-iconbtn svg { width: 22px; height: 22px; }

/* ---- 3. Search overlay ---- */
.lhr-search {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: var(--lhr-paper);
    border-bottom: 3px solid var(--lhr-ink);
    padding: 14px 12px;
    display: none;
    z-index: 970;
}
body.lhr-search-open .lhr-search { display: block; }
.lhr-search form {
    display: flex;
    gap: 8px;
    max-width: 720px;
    margin: 0 auto;
    align-items: center;
}
.lhr-search input[type="search"] {
    flex: 1;
    min-width: 0;
    font-family: var(--lhr-serif);
    font-size: 17px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 2px solid var(--lhr-ink);
    outline: none;
    background: transparent;
    border-radius: 0;
}
.lhr-search input[type="search"]:focus { border-color: var(--lhr-accent); }

/* ---- 4. Responsive ---- */
@media (max-width: 767px) {
    .lhr-masthead { padding: 12px 12px 10px; }
    .lhr-masthead__logo { height: var(--lhr-logo-h-mobile) !important; }
    .lhr-masthead__text-logo { font-size: 28px; }
    .lhr-masthead__dateline { font-size: 10.5px; gap: 7px; margin-top: 7px; }
}
@media (min-width: 1024px) {
    #header .lhr-navbar { padding: 0 24px !important; }
    /* Center the menu: make the scroller itself a flex container and
       center its content (margin:auto on the ul was being overridden
       by the inline critical CSS printed later in the document). */
    #header .lhr-navbar__links {
        display: flex !important;
        justify-content: center !important;
        mask-image: none;
        -webkit-mask-image: none;
    }
    #header .lhr-navbar__links .lhr-navlist { margin: 0 auto !important; }
    #header .lhr-navbar__links .lhr-navlist a { font-size: 13.5px !important; padding: 8px 14px !important; }
}
@media (prefers-reduced-motion: reduce) {
    .lhr-navbar__brand { transition: none; }
}