/* =========================================================================
   THE LAHORE TIMES — ARTICLE ACTION BAR (share + preferred source)
   Loaded on single posts only (functions.php section 15).
   ========================================================================= */

/* One strip: share on the left, preferred source on the right */
.lhr-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin: 18px 0;
    padding: 10px 0;
    border-top: 1px solid #e4e1da;
    border-bottom: 1px solid #e4e1da;
    min-height: 60px;              /* stable height whichever button renders */
}
.lhr-actions--bottom {
    margin-top: 28px;
    border-top: 2px solid #111;
    min-height: 0;
    justify-content: flex-start;
}

.lhr-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.lhr-share__label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #6b6b6b;
}

.lhr-share__items {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* One shared button shape — square, outlined, fills on hover */
.lhr-share__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #d9d5cd;
    background: #fff;
    color: #111;
    cursor: pointer;
    position: relative;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.lhr-share__btn svg { width: 18px; height: 18px; display: block; }
.lhr-share__btn:hover,
.lhr-share__btn:focus-visible {
    background: #111;
    border-color: #111;
    color: #fff;
}
.lhr-share__btn:focus-visible { outline: 2px solid #b30000; outline-offset: 2px; }

/* Brand colours on hover only — the row stays monochrome at rest so it
   reads as part of the paper, not as a strip of logos. */
.lhr-share__btn--facebook:hover { background: #1877f2; border-color: #1877f2; }
.lhr-share__btn--x:hover        { background: #000;     border-color: #000; }
.lhr-share__btn--whatsapp:hover { background: #25d366; border-color: #25d366; }
.lhr-share__btn--email:hover    { background: #b30000; border-color: #b30000; }
.lhr-share__btn--print:hover    { background: #444;    border-color: #444; }
.lhr-share__btn--copy:hover     { background: #b30000; border-color: #b30000; }

/* Copy confirmation */
.lhr-share__btn--copy.is-copied { background: #1a7f37; border-color: #1a7f37; color: #fff; }
.lhr-share__btn--copy.is-copied::after {
    content: "Link copied";
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: #111;
    color: #fff;
    font-size: 11px;
    letter-spacing: .04em;
    padding: 4px 8px;
    pointer-events: none;
    z-index: 2;
}

/* -------------------------------------------------------------------------
   GOOGLE PREFERRED SOURCE
   Our own pill shows from the first paint. JavaScript adds
   .lhr-prefsource--google only once Google's script has actually drawn its
   button, and only then do we swap. Nothing depends on :empty, which was
   what made the control blink in and out before.
   ------------------------------------------------------------------------- */
.lhr-prefsource {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

/* Google's own button: hidden until it genuinely renders */
.lhr-prefsource__google { display: none; }
.lhr-prefsource--google .lhr-prefsource__google { display: block; }
.lhr-prefsource--google .lhr-prefsource__fallback { display: none; }

/* Our pill — always available, never region-gated */
.lhr-prefsource__fallback {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1;
    color: #b30000;
    background: #fff;
    border: 1px solid #b30000;
    border-radius: 999px;
    padding: 10px 16px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}
.lhr-prefsource__fallback svg { width: 14px; height: 14px; flex: 0 0 14px; }
.lhr-prefsource__fallback:hover,
.lhr-prefsource__fallback:focus-visible {
    background: #b30000;
    color: #fff;
    text-decoration: none;
}
.lhr-prefsource__fallback:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

/* Phones: let the pill sit under the icons rather than squeeze them */
@media (max-width: 680px) {
    .lhr-actions { justify-content: flex-start; min-height: 0; }
    .lhr-prefsource { width: 100%; }
    .lhr-prefsource__fallback { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
    .lhr-share { gap: 8px 10px; }
    .lhr-share__btn { width: 36px; height: 36px; }
    .lhr-share__btn svg { width: 16px; height: 16px; }
}

/* =========================================================================
   PRINT — the Print button should produce a clean article, not the website
   ========================================================================= */
@media print {
    #header,
    #footer,
    .lhr-navbar,
    .lhr-masthead__dateline,
    .sidebar,
    .lhr-actions,
    .lhr-share,
    .lhr-prefsource,
    .lhr-related-posts,
    .post_nav,
    #comments,
    .comments_form_wrap,
    #slide_top,
    .ad-container-leaderboard,
    .ad-container-rectangle {
        display: none !important;
    }

    body { background: #fff !important; color: #000 !important; font-size: 12pt; }

    .content,
    .middle_content,
    .content_wrap,
    .middle_inner { width: 100% !important; max-width: none !important; float: none !important; }

    /* Keep the masthead logo as the printed letterhead */
    .lhr-masthead { display: block !important; text-align: left; }
    .lhr-masthead__logo { max-height: 50px !important; }

    .cmsmasters_post_title { font-size: 20pt; }

    /* Print the destination of every in-article link */
    .entry-content a::after,
    .cmsmasters_post_content a::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #555;
        word-break: break-all;
    }

    img { max-width: 100% !important; page-break-inside: avoid; }
    p, blockquote { orphans: 3; widows: 3; }
}