/*
Theme Name: LEM 24 Horas 2026
Theme URI: https://lem24horas.com.br
Description: Portal de notícias de Luís Eduardo Magalhães, Bahia. Tema clássico, Bootstrap 5.3.8, sem build step.
Version: 3.0.0
Author: Snow
Requires PHP: 8.1
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lem24h
Tags: news, magazine, bootstrap, classic
*/

/* ==========================================================================
   TABLE OF CONTENTS
   1.  Tokens
   2.  Reset & base
   3.  Typography
   4.  Accessibility
   5.  Brand: star, wordmark, logo
   6.  Icons
   7.  Chips, buttons, forms
   8.  Header
   9.  Navigation
   10. Footer
   11. Ads
   12. Utilities
   13. Sections & layout
   14. Cards
   15. List rows & ranked lists
   16. Sidebar & widgets
   17. Article
   18. Archive, search, 404
   19. Category rails
   20. Mídia kit
   ========================================================================== */


/* ==========================================================================
   1. TOKENS
   The only place a colour is written down. Nothing below this block, and no
   template, may hardcode a hex.
   ========================================================================== */

:root {
    /* Flag palette */
    --lem-blue:        #0A35A8;  /* flag blue — primary */
    --lem-blue-deep:   #06246F;  /* headers, footer */
    --lem-blue-soft:   #E8EDFA;  /* tints, hover backgrounds */
    --lem-red:         #E8112D;  /* flag red — accent, "URGENTE", live dot */
    --lem-red-deep:    #B00C22;
    --lem-white:       #FFFFFF;

    /* Neutrals */
    --lem-ink:         #14161C;  /* body text */
    --lem-ink-muted:   #5A6172;  /* meta, timestamps */
    --lem-line:        #E3E6ED;  /* borders, dividers */
    --lem-surface:     #FFFFFF;
    --lem-surface-alt: #F6F7FB;  /* page background, cards */

    /* Type stacks. Self-hosted; the fallbacks are metric-similar so a missing
       font file shifts the layout as little as possible. */
    --lem-font-head: 'Roboto Condensed', 'Arial Narrow', 'Helvetica Neue', system-ui, sans-serif;
    --lem-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

    /* Fluid type scale. Every size holds at 320px — headlines are the reason
       this site exists, so they are checked at the narrowest supported width. */
    --lem-text-xs:   clamp(0.6875rem, 0.66rem + 0.14vw, 0.75rem);
    --lem-text-sm:   clamp(0.8125rem, 0.79rem + 0.11vw, 0.875rem);
    --lem-text-base: clamp(0.9375rem, 0.91rem + 0.14vw, 1rem);
    --lem-text-lg:   clamp(1.0625rem, 1.02rem + 0.23vw, 1.1875rem);
    --lem-text-xl:   clamp(1.1875rem, 1.11rem + 0.39vw, 1.4375rem);
    --lem-text-2xl:  clamp(1.375rem, 1.24rem + 0.68vw, 1.875rem);
    --lem-text-3xl:  clamp(1.625rem, 1.38rem + 1.23vw, 2.5rem);
    --lem-text-4xl:  clamp(1.875rem, 1.44rem + 2.17vw, 3.25rem);

    /* Spacing */
    --lem-gap-xs: 0.25rem;
    --lem-gap-sm: 0.5rem;
    --lem-gap:    1rem;
    --lem-gap-md: 1.5rem;
    --lem-gap-lg: 2.5rem;
    --lem-gap-xl: 4rem;

    /* Shape */
    --lem-radius-sm: 3px;
    --lem-radius:    6px;
    --lem-radius-lg: 10px;

    /* Depth — restrained; a news page uses rules and whitespace, not shadows. */
    --lem-shadow-sm: 0 1px 2px rgba(20, 22, 28, 0.06);
    --lem-shadow:    0 2px 8px rgba(20, 22, 28, 0.08);

    /* Chrome */
    --lem-header-h:  64px;
    --lem-measure:   68ch;

    /* Bootstrap bridge: let BS components inherit the brand without overrides
       scattered through the file. */
    --bs-primary:      var(--lem-blue);
    --bs-link-color:   var(--lem-blue);
    --bs-link-hover-color: var(--lem-blue-deep);
    --bs-body-font-family: var(--lem-font-body);
    --bs-body-color:   var(--lem-ink);
    --bs-body-bg:      var(--lem-surface-alt);
    --bs-border-color: var(--lem-line);
}


/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
        /* Anchored headings must clear the sticky header. */
        scroll-padding-top: calc(var(--lem-header-h) + 1rem);
    }
}

body {
    margin: 0;
    background: var(--lem-surface-alt);
    color: var(--lem-ink);
    font-family: var(--lem-font-body);
    font-size: var(--lem-text-base);
    line-height: 1.6;
    /* No overflow-x:hidden here. It masked a layout bug and breaks position:
       sticky on descendants; overflow is fixed at the source instead. */
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

img {
    /* Stops a broken or slow image from collapsing its box. */
    background-color: var(--lem-surface-alt);
}

a {
    color: var(--lem-blue);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--lem-blue-deep);
}

hr {
    border: 0;
    border-top: 1px solid var(--lem-line);
    margin: var(--lem-gap-md) 0;
    opacity: 1;
}


/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--lem-font-head);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--lem-ink);
    margin: 0 0 var(--lem-gap-sm);
    /* Condensed headlines break badly mid-word at 320px without this. */
    text-wrap: balance;
}

h1 { font-size: var(--lem-text-4xl); }
h2 { font-size: var(--lem-text-3xl); }
h3 { font-size: var(--lem-text-2xl); }
h4 { font-size: var(--lem-text-xl); }
h5 { font-size: var(--lem-text-lg); }
h6 { font-size: var(--lem-text-base); }

p {
    margin: 0 0 var(--lem-gap);
}

.lem-standfirst {
    font-size: var(--lem-text-lg);
    line-height: 1.5;
    color: var(--lem-ink-muted);
    max-width: var(--lem-measure);
}

.lem-meta {
    font-size: var(--lem-text-sm);
    color: var(--lem-ink-muted);
}

.lem-date {
    color: var(--lem-ink-muted);
    font-variant-numeric: tabular-nums;
}


/* ==========================================================================
   4. ACCESSIBILITY
   ========================================================================== */

/* Visible on focus only — the first tab stop on every page. */
.lem-skip-link {
    position: absolute;
    top: -100%;
    left: var(--lem-gap-sm);
    z-index: 1100;
    padding: 0.75rem 1.25rem;
    background: var(--lem-blue);
    color: var(--lem-white);
    font-weight: 600;
    border-radius: 0 0 var(--lem-radius) var(--lem-radius);
    text-decoration: none;
}

.lem-skip-link:focus {
    top: 0;
    color: var(--lem-white);
}

/* One focus treatment everywhere, in the brand blue. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--lem-blue);
    outline-offset: 2px;
    border-radius: var(--lem-radius-sm);
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.screen-reader-text:focus {
    position: static !important;
    width: auto;
    height: auto;
    clip: auto;
    white-space: normal;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ==========================================================================
   5. BRAND: STAR, WORDMARK, LOGO
   ========================================================================== */

.lem-star {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Section titles are introduced by the star, per the brand rules. */
.lem-section-header {
    display: flex;
    align-items: center;
    gap: var(--lem-gap-sm);
    margin-bottom: var(--lem-gap);
    padding-bottom: var(--lem-gap-sm);
    border-bottom: 2px solid var(--lem-line);
}

.lem-section-header__title {
    font-size: var(--lem-text-xl);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* The coloured rule under a category rail heading. */
.lem-section-header--accent {
    border-bottom-color: var(--section-color, var(--lem-blue));
}

.lem-divider {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--lem-gap-sm);
}

.lem-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--lem-gap);
    padding: var(--lem-gap-xl) var(--lem-gap);
    text-align: center;
    color: var(--lem-ink-muted);
}

.lem-empty__text {
    margin: 0;
    font-size: var(--lem-text-lg);
}

/* --- Wordmark -------------------------------------------------------- */

.lem-wordmark-link {
    text-decoration: none;
    display: inline-block;
}

.lem-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-family: var(--lem-font-head);
    line-height: 1;
    white-space: nowrap;
}

.lem-wordmark__brand {
    font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--lem-blue);
}

.lem-wordmark__star {
    display: inline-flex;
}

.lem-wordmark__suffix {
    font-size: clamp(0.75rem, 0.68rem + 0.35vw, 0.9375rem);
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--lem-ink);
}

/* Stacked below the header breakpoint, horizontal above — same markup. */
.lem-wordmark--auto {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1em;
}

.lem-wordmark--auto .lem-wordmark__star {
    display: none;
}

@media (min-width: 576px) {
    .lem-wordmark--auto {
        flex-direction: row;
        align-items: center;
        gap: 0.4em;
    }

    .lem-wordmark--auto .lem-wordmark__star {
        display: inline-flex;
    }
}

.lem-wordmark--stacked {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1em;
}

.lem-wordmark--stacked .lem-wordmark__star {
    display: none;
}

/* A dedicated footer mark, sized like the header logo and free of the
   placeholder ground the global img rule paints. */
.lem-footer__logo-link {
    display: inline-block;
}

.lem-footer__logo {
    max-height: 52px;
    width: auto;
    background: none;
}

/* On the deep-blue footer the wordmark inverts. */
.lem-footer .lem-wordmark__brand,
.lem-footer .lem-wordmark__suffix {
    color: var(--lem-white);
}

/* An uploaded logo replaces the wordmark and is capped to the header height. */
.custom-logo {
    max-height: 44px;
    width: auto;
    /* The global img rule paints a placeholder ground behind every image;
       an uploaded logo is usually transparent and must not sit on it. */
    background: none;
}


/* ==========================================================================
   6. ICONS
   ========================================================================== */

.lem-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}


/* ==========================================================================
   7. CHIPS, BUTTONS, FORMS
   ========================================================================== */

/* Category chip. White on the category colour; every colour in the registry
   clears 4.5:1 against white. */
.lem-chip {
    display: inline-block;
    padding: 0.2em 0.65em;
    background: var(--chip-color, var(--lem-blue));
    color: var(--lem-white);
    font-family: var(--lem-font-head);
    font-size: var(--lem-text-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: var(--lem-radius-sm);
    line-height: 1.5;
}

.lem-chip:hover,
.lem-chip:focus {
    color: var(--lem-white);
    filter: brightness(0.88);
}

/* Red is scarce: this and the live dot are the only unprompted uses. */
.lem-chip--urgent {
    background: var(--lem-red-deep);
}

.lem-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--lem-gap-sm);
    padding: 0.7em 1.5em;
    border: 1px solid var(--lem-blue);
    border-radius: var(--lem-radius);
    background: var(--lem-blue);
    color: var(--lem-white);
    font-family: var(--lem-font-body);
    font-size: var(--lem-text-sm);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.lem-btn:hover {
    background: var(--lem-blue-deep);
    border-color: var(--lem-blue-deep);
    color: var(--lem-white);
}

.lem-btn--ghost {
    background: transparent;
    color: var(--lem-blue);
}

.lem-btn--ghost:hover {
    background: var(--lem-blue-soft);
    color: var(--lem-blue-deep);
}

.lem-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

/* --- Search ---------------------------------------------------------- */

.lem-search {
    display: flex;
    align-items: center;
    gap: var(--lem-gap-xs);
    background: var(--lem-surface);
    border: 1px solid var(--lem-line);
    border-radius: var(--lem-radius);
    padding: 0.15rem 0.15rem 0.15rem 0.65rem;
}

.lem-search__input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--lem-ink);
    font-family: inherit;
    font-size: var(--lem-text-sm);
    padding: 0.45rem 0;
}

.lem-search__input:focus {
    outline: none;
}

/* Focus ring belongs on the whole control, not the bare input. */
.lem-search:focus-within {
    outline: 3px solid var(--lem-blue);
    outline-offset: 2px;
}

.lem-search__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: var(--lem-radius-sm);
    background: var(--lem-blue);
    color: var(--lem-white);
    cursor: pointer;
}

.lem-search__submit:hover {
    background: var(--lem-blue-deep);
}


/* ==========================================================================
   8. HEADER
   ========================================================================== */

/* Thin blue strip: date, city, and the live dot. */
.lem-topbar {
    background: var(--lem-blue-deep);
    color: var(--lem-white);
    font-size: var(--lem-text-xs);
}

.lem-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--lem-gap);
    min-height: 32px;
    padding-block: 0.35rem;
}

.lem-topbar__group {
    display: flex;
    align-items: center;
    gap: var(--lem-gap);
}

.lem-topbar__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    color: var(--lem-white);
    text-decoration: none;
    opacity: 0.92;
}

.lem-topbar__item:hover {
    color: var(--lem-white);
    opacity: 1;
}

/* The one animated element on the page, and the second permitted red. */
.lem-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--lem-red);
    box-shadow: 0 0 0 0 rgba(232, 17, 45, 0.7);
}

@media (prefers-reduced-motion: no-preference) {
    .lem-live-dot {
        animation: lem-pulse 2s infinite;
    }
}

@keyframes lem-pulse {
    70%  { box-shadow: 0 0 0 7px rgba(232, 17, 45, 0); }
    100% { box-shadow: 0 0 0 0 rgba(232, 17, 45, 0); }
}

/* --- Breaking bar ---------------------------------------------------- */

.lem-breaking {
    background: var(--lem-breaking-color, var(--lem-red));
    color: var(--lem-white);
}

.lem-breaking__inner {
    display: flex;
    align-items: center;
    gap: var(--lem-gap);
    padding-block: 0.6rem;
}

.lem-breaking__label {
    flex-shrink: 0;
    font-family: var(--lem-font-head);
    font-size: var(--lem-text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.15em 0.5em;
    background: rgba(0, 0, 0, 0.22);
    border-radius: var(--lem-radius-sm);
}

.lem-breaking__text {
    flex: 1;
    min-width: 0;
    color: var(--lem-white);
    font-weight: 600;
    font-size: var(--lem-text-sm);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lem-breaking__text:hover {
    color: var(--lem-white);
    text-decoration: underline;
}

.lem-breaking__dismiss {
    flex-shrink: 0;
    display: inline-flex;
    padding: 0.25rem;
    border: 0;
    background: transparent;
    color: var(--lem-white);
    cursor: pointer;
    opacity: 0.85;
}

.lem-breaking__dismiss:hover {
    opacity: 1;
}

/* --- Masthead -------------------------------------------------------- */

.lem-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--lem-surface);
    border-bottom: 1px solid var(--lem-line);
}

/* Only the masthead sticks; the topbar and breaking bar scroll away. */
.lem-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--lem-gap);
    min-height: var(--lem-header-h);
    padding-block: var(--lem-gap-sm);
}

.lem-header__brand {
    flex-shrink: 0;
}

.lem-header__actions {
    display: flex;
    align-items: center;
    gap: var(--lem-gap-sm);
}

.lem-header__search {
    display: none;
    width: min(260px, 30vw);
}

@media (min-width: 992px) {
    .lem-header__search {
        display: flex;
    }
}

/* Denser masthead once the page scrolls. */
.lem-header.is-stuck {
    box-shadow: var(--lem-shadow);
}

.lem-header.is-stuck .lem-header__bar {
    min-height: 52px;
}

.lem-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--lem-line);
    border-radius: var(--lem-radius);
    background: var(--lem-surface);
    color: var(--lem-ink);
    cursor: pointer;
}

@media (min-width: 992px) {
    .lem-menu-toggle {
        display: none;
    }
}


/* ==========================================================================
   9. NAVIGATION
   ========================================================================== */

.lem-nav {
    display: none;
    border-top: 1px solid var(--lem-line);
}

@media (min-width: 992px) {
    .lem-nav {
        display: block;
    }
}

.lem-nav__list {
    display: flex;
    align-items: stretch;
    gap: var(--lem-gap-md);
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
}

.lem-nav__list::-webkit-scrollbar {
    display: none;
}

.lem-nav__item {
    position: relative;
    display: flex;
    align-items: stretch;
}

.lem-nav__link {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 0;
    color: var(--lem-ink);
    font-family: var(--lem-font-head);
    font-size: var(--lem-text-sm);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.lem-nav__link:hover {
    color: var(--lem-blue);
    border-bottom-color: var(--lem-blue-soft);
}

/* The active underline is the third and last sanctioned use of red. */
.lem-nav__item.is-current > .lem-nav__link,
.lem-nav__link[aria-current] {
    color: var(--lem-blue-deep);
    border-bottom-color: var(--lem-red);
}

.lem-nav .dropdown-menu {
    --bs-dropdown-link-active-bg: var(--lem-blue);
    --bs-dropdown-border-color: var(--lem-line);
    --bs-dropdown-border-radius: var(--lem-radius);
    font-size: var(--lem-text-sm);
}

/* --- Mobile drawer --------------------------------------------------- */

.lem-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(320px, 88vw);
    z-index: 1045;
    display: flex;
    flex-direction: column;
    background: var(--lem-surface);
    border-left: 1px solid var(--lem-line);
    transform: translateX(100%);
    transition: transform 0.22s ease;
    visibility: hidden;
}

.lem-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
}

.lem-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--lem-gap);
    padding: var(--lem-gap);
    border-bottom: 1px solid var(--lem-line);
}

.lem-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--lem-gap);
}

.lem-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--lem-line);
    border-radius: var(--lem-radius);
    background: var(--lem-surface);
    color: var(--lem-ink);
    cursor: pointer;
}

.lem-drawer__backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(20, 22, 28, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease;
}

.lem-drawer__backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

/* Menu inside the drawer stacks and drops the uppercase treatment. */
.lem-drawer .lem-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow: visible;
}

.lem-drawer .lem-nav__item {
    display: block;
    border-bottom: 1px solid var(--lem-line);
}

.lem-drawer .lem-nav__link {
    display: block;
    padding: 0.85rem 0;
    border-bottom: 0;
    font-size: var(--lem-text-base);
}

.lem-drawer .lem-nav__item.is-current > .lem-nav__link {
    color: var(--lem-blue);
    border-left: 3px solid var(--lem-red);
    padding-left: 0.6rem;
}

/* Submenu disclosure, driven by js/mobile-menu.js. */
.lem-drawer .sub-menu,
.lem-drawer .dropdown-menu {
    display: block;
    position: static;
    list-style: none;
    margin: 0;
    padding: 0 0 0 var(--lem-gap);
    border: 0;
    overflow: hidden;
    height: 0;
    transition: height 0.2s ease;
}

.submenu-toggle {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: var(--lem-ink-muted);
    cursor: pointer;
}

.submenu-toggle[aria-expanded="true"] {
    transform: rotate(180deg);
}


/* ==========================================================================
   10. FOOTER
   ========================================================================== */

.lem-footer {
    background: var(--lem-blue-deep);
    color: var(--lem-white);
    margin-top: var(--lem-gap-xl);
    padding-top: var(--lem-gap-lg);
}

.lem-footer a {
    color: var(--lem-white);
    opacity: 0.88;
    text-decoration: none;
}

.lem-footer a:hover {
    color: var(--lem-white);
    opacity: 1;
    text-decoration: underline;
}

.lem-footer__tagline {
    color: rgba(255, 255, 255, 0.78);
    max-width: 42ch;
}

.lem-footer__title {
    color: var(--lem-white);
    font-size: var(--lem-text-base);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--lem-gap);
    padding-bottom: var(--lem-gap-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.lem-footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--lem-gap-sm);
    font-size: var(--lem-text-sm);
}

.lem-footer__social {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lem-gap-sm);
}

.lem-footer__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    opacity: 1;
}

.lem-footer__social a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.lem-footer__editorial {
    font-size: var(--lem-text-sm);
    color: rgba(255, 255, 255, 0.78);
    display: grid;
    gap: var(--lem-gap-xs);
}

.lem-footer__bottom {
    margin-top: var(--lem-gap-lg);
    padding-block: var(--lem-gap);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    font-size: var(--lem-text-sm);
    color: rgba(255, 255, 255, 0.78);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--lem-gap-xs);
    text-align: center;
}

/* Footer widgets inherit the inverted palette. */
.lem-footer .footer-widget-title {
    color: var(--lem-white);
    font-size: var(--lem-text-base);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.lem-footer .footer-widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--lem-gap-sm);
    font-size: var(--lem-text-sm);
}

/* --- Back to top ----------------------------------------------------- */

.lem-to-top {
    position: fixed;
    right: var(--lem-gap);
    bottom: var(--lem-gap);
    z-index: 1035;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--lem-blue);
    color: var(--lem-white);
    box-shadow: var(--lem-shadow);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lem-to-top.is-visible {
    opacity: 1;
    visibility: visible;
}


/* ==========================================================================
   11. ADS
   Every slot reserves its space from the declared creative size, so a late
   or missing image cannot shift the page.
   ========================================================================== */

.lem-promos {
    margin-block: var(--lem-gap);
    text-align: center;
}

.lem-promo {
    display: block;
    margin-inline: auto;
    margin-bottom: var(--lem-gap);
    /* Fill the column the slot sits in rather than stopping at the
       creative's own width, so a banner lines up with the news grid. */
    width: 100%;
    max-width: 100%;
}

.lem-promo:last-child {
    margin-bottom: 0;
}

.lem-promo__link {
    display: block;
    text-decoration: none;
}

.lem-promo__img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--lem-radius-sm);
    background: var(--lem-surface-alt);
}

/* --- Rotate: cross-fade, CSS only ------------------------------------ */

.lem-promos--mode-rotate {
    position: relative;
}

.lem-promos--mode-rotate .lem-promo {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lem-promos--mode-rotate .lem-promo.is-visible {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .lem-promos--mode-rotate .lem-promo {
        opacity: 1;
        transition: none;
    }
}

/* --- Carousel: a scrolling row of sponsors --------------------------- */

.lem-promos--mode-carousel.is-carousel {
    display: flex;
    gap: var(--lem-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: var(--lem-gap-sm);
    text-align: left;
}

.lem-promos--mode-carousel.is-carousel .lem-promo {
    flex: 0 0 auto;
    scroll-snap-align: start;
    margin-bottom: 0;
}

/* --- House ad: the slot sells itself when unsold --------------------- */

.lem-house {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--lem-gap-xs);
    aspect-ratio: calc(var(--ad-w)) / calc(var(--ad-h));
    padding: var(--lem-gap);
    border: 1px dashed var(--lem-line);
    border-radius: var(--lem-radius);
    background: var(--lem-surface);
    text-align: center;
}

.lem-house:hover {
    border-color: var(--lem-blue);
    background: var(--lem-blue-soft);
}

.lem-house__title {
    font-family: var(--lem-font-head);
    font-size: var(--lem-text-lg);
    font-weight: 700;
    color: var(--lem-blue);
    line-height: 1.1;
}

.lem-house__text {
    font-size: var(--lem-text-xs);
    color: var(--lem-ink-muted);
}

/* A short slot cannot fit the strapline. */
.lem-promo--leaderboard .lem-house__text,
.lem-promo--mobile-banner .lem-house__text,
.lem-promo--mobile-banner .lem-house__star {
    display: none;
}

.lem-promo--leaderboard .lem-house,
.lem-promo--mobile-banner .lem-house {
    flex-direction: row;
    gap: var(--lem-gap-sm);
}

/* --- In-body ad ------------------------------------------------------- */

.lem-promos--inline {
    margin-block: var(--lem-gap-lg);
    padding-block: var(--lem-gap);
    border-block: 1px solid var(--lem-line);
}

/* ==========================================================================
   12. UTILITIES
   ========================================================================== */

.lem-container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: var(--lem-gap);
}

.lem-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lem-clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }

.lem-thumb {
    display: block;
    position: relative;
    overflow: hidden;
    background: var(--lem-surface-alt);
    /* Reserving the box is what keeps CLS at zero. */
    aspect-ratio: 16 / 9;
    border-radius: var(--lem-radius-sm);
}

.lem-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lem-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--lem-line);
}

/* ==========================================================================
   13. SECTIONS & LAYOUT
   ========================================================================== */

.lem-section {
    padding-block: var(--lem-gap-md);
}

.lem-section + .lem-section {
    padding-top: 0;
}

.lem-section--hero {
    padding-top: var(--lem-gap);
}

.lem-section-header__link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.2em;
    font-size: var(--lem-text-sm);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}


/* ==========================================================================
   14. CARDS
   ========================================================================== */

.lem-card {
    display: flex;
    flex-direction: column;
    background: var(--lem-surface);
    border: 1px solid var(--lem-line);
    border-radius: var(--lem-radius);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lem-card:hover {
    border-color: var(--lem-blue-soft);
    box-shadow: var(--lem-shadow);
}

.lem-card__media {
    display: block;
    text-decoration: none;
}

.lem-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--lem-gap-sm);
    padding: var(--lem-gap);
    flex: 1;
}

.lem-card__title {
    font-size: var(--lem-text-lg);
    line-height: 1.2;
    margin: 0;
}

.lem-card__title--sm {
    font-size: var(--lem-text-base);
}

.lem-card__title a {
    color: var(--lem-ink);
    text-decoration: none;
}

.lem-card__title a:hover {
    color: var(--lem-blue);
}

.lem-card__excerpt {
    margin: 0;
    font-size: var(--lem-text-sm);
    color: var(--lem-ink-muted);
}

.lem-card__footer {
    margin: auto 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    font-size: var(--lem-text-xs);
}

.lem-thumb img {
    transition: transform 0.3s ease;
}

/* --- Hero ------------------------------------------------------------ */

.lem-hero {
    display: flex;
    flex-direction: column;
    gap: var(--lem-gap);
    height: 100%;
}

.lem-hero__media {
    display: block;
}

.lem-hero__thumb {
    aspect-ratio: 16 / 9;
    border-radius: var(--lem-radius);
}

.lem-hero__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--lem-gap-sm);
}

.lem-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lem-gap-xs);
}

.lem-hero__title {
    font-size: var(--lem-text-3xl);
    line-height: 1.1;
    margin: 0;
}

.lem-hero__title a {
    color: var(--lem-ink);
    text-decoration: none;
}

.lem-hero__title a:hover {
    color: var(--lem-blue);
}

.lem-hero__standfirst {
    margin: 0;
    font-size: var(--lem-text-base);
    color: var(--lem-ink-muted);
}

.lem-hero__footer {
    margin: 0;
    display: flex;
    gap: 0.4em;
    font-size: var(--lem-text-xs);
}

/* The three secondary stories beside the lead. */
.lem-hero__side {
    display: grid;
    gap: var(--lem-gap);
    height: 100%;
    /* Distribute the secondary stories over the column instead of packing
       them to the top. With align-content:start the lead article's height
       left a large empty block underneath them. */
    align-content: space-between;
}

.lem-hero__side .lem-list-item {
    padding-bottom: var(--lem-gap);
    border-bottom: 1px solid var(--lem-line);
}

.lem-hero__side .lem-list-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}


/* ==========================================================================
   15. LIST ROWS & RANKED LISTS
   ========================================================================== */

.lem-list-item {
    display: flex;
    align-items: flex-start;
    gap: var(--lem-gap-sm);
}

.lem-list-item__media {
    flex-shrink: 0;
    width: 84px;
    display: block;
    border-radius: var(--lem-radius-sm);
    overflow: hidden;
}

.lem-list-item__media img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.lem-list-item__body {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
}

.lem-list-item__title {
    font-size: var(--lem-text-base);
    line-height: 1.25;
    margin: 0;
}

.lem-list-item__title a {
    color: var(--lem-ink);
    text-decoration: none;
}

.lem-list-item__title a:hover {
    color: var(--lem-blue);
}

.lem-list-item .lem-meta {
    font-size: var(--lem-text-xs);
    margin: 0;
}

/* The rank numeral in "Mais lidas". */
.lem-list-item__rank {
    flex-shrink: 0;
    font-family: var(--lem-font-head);
    font-size: var(--lem-text-2xl);
    font-weight: 700;
    line-height: 1;
    color: var(--lem-blue-soft);
    -webkit-text-stroke: 1px var(--lem-blue);
    min-width: 1.4em;
}

.lem-ranked {
    display: grid;
    gap: var(--lem-gap);
}

.lem-ranked .lem-list-item {
    padding-bottom: var(--lem-gap);
    border-bottom: 1px solid var(--lem-line);
}

.lem-ranked .lem-list-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.lem-ranked--compact .lem-list-item__rank {
    font-size: var(--lem-text-xl);
}

@media (min-width: 768px) {
    .lem-404__popular .lem-ranked,
    .lem-section > .lem-container > .lem-ranked {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--lem-gap-lg);
    }
}


/* ==========================================================================
   16. SIDEBAR & WIDGETS
   ========================================================================== */

.lem-sidebar__inner {
    display: grid;
    gap: var(--lem-gap-md);
}

/* The sidebar grid already spaces its children; an ad slot's own vertical
   margin would stack on top of the gap and pull the widgets apart. */
.lem-sidebar__inner > .lem-promos {
    margin-block: 0;
}

@media (min-width: 992px) {
    /* The aside spans its column, which is the track the sticky inner can
       travel along. Without this the sticky range collapses to the content
       height and the sidebar unpins early. */
    .lem-sidebar {
        height: 100%;
    }

    .lem-sidebar__inner {
        position: sticky;
        /* Clears the sticky masthead. Plain top-sticky is the fallback when
           JS is unavailable and the correct behaviour whenever the sidebar
           is shorter than the viewport. */
        top: calc(var(--lem-header-h) + var(--lem-gap));
        /* js/theme.js flips this to bottom-anchored while scrolling down, so
           a sidebar taller than the viewport can reach its own end. */
        will-change: margin-top;
    }
}

/* A sidebar that is being followed should not animate its own repositioning —
   the margin changes are corrective, not decorative. */
@media (prefers-reduced-motion: reduce) {
    .lem-sidebar__inner {
        transition: none !important;
    }
}

.lem-widget,
.widget {
    background: var(--lem-surface);
    border: 1px solid var(--lem-line);
    border-radius: var(--lem-radius);
    padding: var(--lem-gap);
}

.widget-title {
    font-size: var(--lem-text-base);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-bottom: var(--lem-gap-sm);
    border-bottom: 2px solid var(--lem-line);
}

.lem-widget .lem-section-header {
    margin-bottom: var(--lem-gap);
}

.lem-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
}

.lem-cat-list a {
    display: flex;
    align-items: center;
    gap: var(--lem-gap-sm);
    padding: 0.55rem 0;
    color: var(--lem-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--lem-line);
    font-size: var(--lem-text-sm);
}

.lem-cat-list li:last-child a {
    border-bottom: 0;
}

.lem-cat-list a:hover {
    color: var(--lem-blue);
}

.lem-cat-list__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chip-color, var(--lem-blue));
    flex-shrink: 0;
}

.lem-cat-list__name {
    flex: 1;
    min-width: 0;
}

.lem-cat-list__count {
    color: var(--lem-ink-muted);
    font-variant-numeric: tabular-nums;
    font-size: var(--lem-text-xs);
}

/* --- Right of reply ---------------------------------------------------- */

/* A quiet card: this is a legal notice, not a promotion, so it reads as
   editorial rather than competing with the ad slot above it. */
.lem-reply {
    background: var(--lem-blue-soft);
    border-color: transparent;
}

.lem-reply .lem-section-header {
    border-bottom-color: rgba(10, 53, 168, 0.18);
}

.lem-reply__law {
    margin: 0 0 var(--lem-gap-sm);
    font-size: var(--lem-text-xs);
    line-height: 1.5;
    color: var(--lem-ink-muted);
}

.lem-reply__text {
    margin: 0 0 var(--lem-gap);
    font-size: var(--lem-text-sm);
    line-height: 1.5;
    color: var(--lem-ink);
}

.lem-reply__cta {
    display: flex;
    align-items: center;
    gap: var(--lem-gap-sm);
    padding: 0.7rem 0.9rem;
    background: var(--lem-surface);
    border: 1px solid rgba(10, 53, 168, 0.22);
    border-radius: var(--lem-radius);
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.lem-reply__cta:hover {
    background: var(--lem-white);
    border-color: #25D366;
}

/* WhatsApp green on the mark only — the surrounding text stays in the
   theme palette so the card does not turn into a brand advert. */
.lem-reply__cta .lem-icon {
    color: #25D366;
    flex-shrink: 0;
}

.lem-reply__cta-text {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.lem-reply__cta-label {
    font-size: var(--lem-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--lem-ink-muted);
}

.lem-reply__cta-number {
    font-family: var(--lem-font-head);
    font-size: var(--lem-text-lg);
    font-weight: 700;
    color: var(--lem-blue);
    line-height: 1.1;
}

/* ==========================================================================
   17. ARTICLE
   ========================================================================== */

/* Reading progress, pinned under the sticky masthead. */
.lem-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 1031;
    background: transparent;
    pointer-events: none;
}

.lem-progress__bar {
    height: 100%;
    background: var(--lem-blue);
    transform: scaleX(0);
    transform-origin: 0 50%;
    will-change: transform;
}

.lem-article__header {
    padding-block: var(--lem-gap-md) var(--lem-gap);
}

/* The 68ch measure the brief asks for, applied to header and body alike. */
.lem-article__measure {
    max-width: var(--lem-measure);
}

.lem-article__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lem-gap-xs);
    margin-bottom: var(--lem-gap-sm);
}

.lem-article__title {
    font-size: var(--lem-text-4xl);
    line-height: 1.08;
    margin-bottom: var(--lem-gap-sm);
}

.lem-article__standfirst {
    margin-bottom: var(--lem-gap);
}

/* --- Full-bleed featured image --------------------------------------- */

.lem-article__figure {
    margin: 0 0 var(--lem-gap-md);
}

.lem-article__figure-media {
    aspect-ratio: 16 / 9;
    background: var(--lem-surface-alt);
    overflow: hidden;
}

.lem-article__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lem-article__caption {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lem-gap-sm);
    padding-top: var(--lem-gap-sm);
    font-size: var(--lem-text-sm);
    color: var(--lem-ink-muted);
}

.lem-article__credit {
    font-size: var(--lem-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (min-width: 1200px) {
    .lem-article__figure-media {
        border-radius: var(--lem-radius);
    }
}

/* --- Byline ---------------------------------------------------------- */

.lem-byline {
    display: flex;
    align-items: center;
    gap: var(--lem-gap-sm);
    padding-block: var(--lem-gap);
    border-block: 1px solid var(--lem-line);
}

.lem-byline__avatar {
    border-radius: 50%;
    flex-shrink: 0;
}

.lem-byline__text {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.lem-byline__author {
    font-weight: 600;
    font-size: var(--lem-text-sm);
}

.lem-byline__author a {
    color: var(--lem-ink);
    text-decoration: none;
}

.lem-byline__author a:hover {
    color: var(--lem-blue);
}

.lem-byline__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4em;
    font-size: var(--lem-text-xs);
}

.lem-byline__item {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
}

/* --- Body typography -------------------------------------------------- */

.lem-article__content {
    /* 19px base, 1.75 leading, 68ch measure — the brief's reading spec. */
    font-size: 19px;
    line-height: 1.75;
    max-width: var(--lem-measure);
}

.lem-article__content > * {
    margin-bottom: 1.4rem;
}

.lem-article__content h2,
.lem-article__content h3,
.lem-article__content h4 {
    margin-top: 2.2rem;
    margin-bottom: 0.8rem;
    line-height: 1.2;
}

.lem-article__content h2 { font-size: var(--lem-text-2xl); }
.lem-article__content h3 { font-size: var(--lem-text-xl); }
.lem-article__content h4 { font-size: var(--lem-text-lg); }

.lem-article__content a {
    color: var(--lem-blue);
    text-decoration: underline;
}

.lem-article__content ul,
.lem-article__content ol {
    padding-left: 1.4em;
}

.lem-article__content li {
    margin-bottom: 0.5rem;
}

.lem-article__content img {
    border-radius: var(--lem-radius-sm);
}

.lem-article__content figure {
    margin-block: var(--lem-gap-md);
}

.lem-article__content figcaption,
.lem-article__content .wp-caption-text {
    margin-top: var(--lem-gap-sm);
    font-size: var(--lem-text-sm);
    color: var(--lem-ink-muted);
    line-height: 1.5;
}

.lem-article__content blockquote,
.lem-article__content .wp-block-quote {
    margin-inline: 0;
    padding: var(--lem-gap-sm) 0 var(--lem-gap-sm) var(--lem-gap);
    border-left: 3px solid var(--lem-red);
    font-family: var(--lem-font-head);
    font-size: var(--lem-text-xl);
    line-height: 1.35;
    color: var(--lem-ink);
}

.lem-article__content blockquote cite,
.lem-article__content .wp-block-quote cite {
    display: block;
    margin-top: var(--lem-gap-sm);
    font-family: var(--lem-font-body);
    font-size: var(--lem-text-sm);
    font-style: normal;
    color: var(--lem-ink-muted);
}

.lem-article__content table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--lem-text-sm);
}

.lem-article__content th,
.lem-article__content td {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--lem-line);
    text-align: left;
}

.lem-article__content th {
    background: var(--lem-surface-alt);
    font-family: var(--lem-font-head);
}

/* Wide content scrolls inside its own box; the page never scrolls sideways. */
.lem-article__content .wp-block-table,
.lem-article__content pre {
    overflow-x: auto;
}

.lem-article__content pre {
    padding: var(--lem-gap);
    background: var(--lem-surface-alt);
    border: 1px solid var(--lem-line);
    border-radius: var(--lem-radius);
    font-size: var(--lem-text-sm);
    line-height: 1.5;
}

.lem-article__content iframe,
.lem-article__content .wp-block-embed iframe {
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

.lem-article__content .alignwide,
.lem-article__content .alignfull {
    max-width: none;
}

/* An in-body ad must read as an interruption, not as editorial. */
.lem-promos--inline {
    margin-block: var(--lem-gap-lg);
    padding-block: var(--lem-gap);
    border-block: 1px solid var(--lem-line);
}

/* --- Tags, share, related -------------------------------------------- */

.lem-article__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lem-gap-xs);
    margin-block: var(--lem-gap-md);
    max-width: var(--lem-measure);
}

.lem-tag {
    display: inline-block;
    padding: 0.25em 0.7em;
    background: var(--lem-surface-alt);
    border: 1px solid var(--lem-line);
    border-radius: 999px;
    color: var(--lem-ink-muted);
    font-size: var(--lem-text-xs);
    text-decoration: none;
}

.lem-tag:hover {
    background: var(--lem-blue-soft);
    color: var(--lem-blue);
    border-color: var(--lem-blue-soft);
}

.lem-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--lem-gap);
    padding-block: var(--lem-gap);
    border-block: 1px solid var(--lem-line);
    margin-bottom: var(--lem-gap-lg);
}

.lem-share__heading {
    font-family: var(--lem-font-head);
    font-size: var(--lem-text-sm);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--lem-ink-muted);
}

.lem-share__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lem-gap-sm);
    list-style: none;
    margin: 0;
    padding: 0;
}

.lem-share__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--lem-line);
    border-radius: 50%;
    background: var(--lem-surface);
    color: var(--lem-ink-muted);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.lem-share__btn:hover {
    color: var(--lem-white);
    border-color: transparent;
}

/* WhatsApp leads, and carries its own brand colour on hover. */
.lem-share__btn--whatsapp:hover { background: #25D366; }
.lem-share__btn--facebook:hover { background: #1877F2; }
.lem-share__btn--x:hover        { background: var(--lem-ink); }
.lem-share__btn--telegram:hover { background: #229ED9; }
.lem-share__btn--copy:hover     { background: var(--lem-blue); }

.lem-related {
    margin-bottom: var(--lem-gap-lg);
}


/* ==========================================================================
   18. ARCHIVE, SEARCH, 404
   ========================================================================== */

.lem-archive-header {
    margin-bottom: var(--lem-gap-lg);
    padding-bottom: var(--lem-gap);
    border-bottom: 2px solid var(--section-color, var(--lem-line));
}

.lem-archive-header__title {
    display: flex;
    align-items: center;
    gap: var(--lem-gap-sm);
    margin-bottom: var(--lem-gap-sm);
}

.lem-archive-header__search {
    max-width: 420px;
    margin-top: var(--lem-gap);
}

.lem-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lem-gap-xs);
    margin-top: var(--lem-gap);
}

.lem-filter {
    display: inline-block;
    padding: 0.3em 0.8em;
    border: 1px solid var(--lem-line);
    border-radius: 999px;
    background: var(--lem-surface);
    color: var(--lem-ink-muted);
    font-size: var(--lem-text-sm);
    text-decoration: none;
}

.lem-filter:hover {
    border-color: var(--chip-color, var(--lem-blue));
    color: var(--chip-color, var(--lem-blue));
}

.lem-filter.is-active {
    background: var(--chip-color, var(--lem-blue));
    border-color: var(--chip-color, var(--lem-blue));
    color: var(--lem-white);
}

.lem-404 {
    text-align: center;
    padding-block: var(--lem-gap-xl) var(--lem-gap-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--lem-gap-sm);
}

.lem-404__code {
    font-family: var(--lem-font-head);
    font-size: clamp(3rem, 2rem + 5vw, 5rem);
    font-weight: 700;
    line-height: 1;
    color: var(--lem-blue);
    margin: 0;
}

.lem-404__title {
    margin: 0;
}

.lem-404__search {
    width: min(420px, 100%);
    margin-top: var(--lem-gap);
}

.lem-404__popular {
    margin-top: var(--lem-gap-xl);
}

/* --- Pagination ------------------------------------------------------- */

.lem-pagination,
.pagination {
    margin-top: var(--lem-gap-lg);
}

.lem-pagination .nav-links,
.pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lem-gap-xs);
    align-items: center;
    justify-content: center;
}

.lem-pagination .page-numbers,
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding-inline: 0.6rem;
    border: 1px solid var(--lem-line);
    border-radius: var(--lem-radius);
    background: var(--lem-surface);
    color: var(--lem-ink);
    text-decoration: none;
    font-size: var(--lem-text-sm);
}

.lem-pagination .page-numbers:hover,
.pagination .page-numbers:hover {
    border-color: var(--lem-blue);
    color: var(--lem-blue);
}

.lem-pagination .page-numbers.current,
.pagination .page-numbers.current {
    background: var(--lem-blue);
    border-color: var(--lem-blue);
    color: var(--lem-white);
}

.lem-load-more {
    display: flex;
    justify-content: center;
    margin-top: var(--lem-gap-lg);
}

.lem-pagelinks {
    display: flex;
    gap: var(--lem-gap-xs);
    align-items: center;
    margin-top: var(--lem-gap-md);
    font-size: var(--lem-text-sm);
}


/* ==========================================================================
   19. CATEGORY RAILS
   The four-story editoria strip. A real CSS Grid rather than Bootstrap
   columns: the cards size to their content instead of stretching to fill a
   row, which is what produced the tall empty gaps under short headlines.
   ========================================================================== */

.lem-rail__grid {
    display: grid;
    /* Two up on phones, four across from tablet width. */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* Row gap is tighter than the column gap: vertical space is the scarce
       resource on a news page, horizontal space is not. */
    gap: var(--lem-gap) var(--lem-gap);
    /* Cards align to the top of their track and keep their natural height. */
    align-items: start;
}

@media (min-width: 768px) {
    .lem-rail__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: var(--lem-gap-md) var(--lem-gap);
    }
}

/* The rail heading sits closer to its cards than a full section break. */
.lem-rail .lem-section-header {
    margin-bottom: var(--lem-gap-sm);
}

.lem-rail + .lem-rail {
    padding-top: 0;
}

/* --- Compact card ----------------------------------------------------- */

.lem-card--compact {
    /* Not a bordered surface: the rail reads as one strip, not four boxes. */
    border: 0;
    background: none;
    overflow: visible;
    height: auto;
}

.lem-card--compact:hover {
    box-shadow: none;
}

.lem-card--compact .lem-card__media {
    display: block;
    overflow: hidden;
    border-radius: var(--lem-radius-sm);
}

.lem-card--compact .lem-card__body {
    /* Only the gap the headline needs — no card padding, since there is no
       card chrome to pad against. */
    padding: var(--lem-gap-sm) 0 0;
    gap: 0.2rem;
    flex: 0 1 auto;
}

.lem-card--compact .lem-card__title {
    font-size: var(--lem-text-base);
    line-height: 1.25;
    margin: 0;
}

.lem-card--compact .lem-meta {
    font-size: var(--lem-text-xs);
    margin: 0;
}

.lem-card--compact:hover .lem-thumb img {
    transform: scale(1.03);
}

/* --- Latest-news grid ------------------------------------------------- */

/* The standard cards keep their border, but the footer should not push the
   card taller than its content needs. */
.lem-card__footer {
    margin-top: auto;
    padding-top: var(--lem-gap-xs);
}

/* --- Lead ad slot ----------------------------------------------------- */

/* The header_top slot sits directly above "Últimas notícias" inside the same
   column, so it needs no top margin of its own and only a small gap below. */
.lem-promos--lead {
    margin-top: 0;
    margin-bottom: var(--lem-gap);
}

.lem-promos--lead .lem-promo:last-child {
    margin-bottom: 0;
}

/* --- House ad --------------------------------------------------------- */

.lem-house__icon {
    display: inline-flex;
    color: #25D366;
}

.lem-house:hover .lem-house__icon {
    color: var(--lem-blue-deep);
}


/* ==========================================================================
   20. MÍDIA KIT
   ========================================================================== */

.lem-mk-hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--lem-gap-sm);
    padding-block: var(--lem-gap-lg);
    border-bottom: 1px solid var(--lem-line);
    margin-bottom: var(--lem-gap-lg);
}

.lem-mk-hero__title {
    margin: 0;
}

.lem-mk-section {
    margin-bottom: var(--lem-gap-xl);
}

.lem-mk-copy {
    margin-top: var(--lem-gap-md);
}

/* --- Audience numbers -------------------------------------------------- */

.lem-mk-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--lem-gap);
}

.lem-mk-stat {
    background: var(--lem-surface);
    border: 1px solid var(--lem-line);
    border-radius: var(--lem-radius);
    padding: var(--lem-gap-md) var(--lem-gap);
    text-align: center;
    display: grid;
    gap: var(--lem-gap-xs);
}

.lem-mk-stat__value {
    font-family: var(--lem-font-head);
    font-size: var(--lem-text-3xl);
    font-weight: 700;
    line-height: 1;
    color: var(--lem-blue);
}

.lem-mk-stat__label {
    font-size: var(--lem-text-sm);
    color: var(--lem-ink-muted);
}

/* --- Zone diagram ------------------------------------------------------ */

.lem-mk-zones {
    display: grid;
    gap: var(--lem-gap-lg);
    align-items: start;
}

@media (min-width: 768px) {
    .lem-mk-zones {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

.lem-mk-page {
    border: 1px solid var(--lem-line);
    border-radius: var(--lem-radius);
    background: var(--lem-surface);
    padding: var(--lem-gap-sm);
    display: grid;
    gap: var(--lem-gap-sm);
}

.lem-mk-page__bar {
    background: var(--lem-blue-deep);
    color: var(--lem-white);
    font-size: var(--lem-text-xs);
    text-align: center;
    padding: 0.5rem;
    border-radius: var(--lem-radius-sm);
}

.lem-mk-page__slot {
    border: 1px dashed var(--lem-blue);
    background: var(--lem-blue-soft);
    color: var(--lem-blue-deep);
    font-size: var(--lem-text-xs);
    font-weight: 700;
    text-align: center;
    padding: 0.85rem 0.5rem;
    border-radius: var(--lem-radius-sm);
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* Hovering a slot in the diagram highlights it, so a client can point. */
.lem-mk-page__slot:hover {
    background: var(--lem-blue);
    color: var(--lem-white);
}

.lem-mk-page__slot--tall {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lem-mk-page__split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--lem-gap-sm);
}

.lem-mk-page__main,
.lem-mk-page__aside {
    display: grid;
    gap: var(--lem-gap-xs);
    align-content: start;
}

.lem-mk-page__line {
    height: 6px;
    background: var(--lem-line);
    border-radius: 2px;
}

.lem-mk-zone-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--lem-gap);
}

.lem-mk-zone-list li {
    display: grid;
    gap: 0.15rem;
    padding-bottom: var(--lem-gap);
    border-bottom: 1px solid var(--lem-line);
}

.lem-mk-zone-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.lem-mk-zone-list__size {
    font-family: var(--lem-font-head);
    font-size: var(--lem-text-sm);
    color: var(--lem-red-deep);
    letter-spacing: 0.04em;
}

/* --- Format swatches --------------------------------------------------- */

.lem-mk-formats {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--lem-gap-md);
    margin-bottom: var(--lem-gap);
}

.lem-mk-format {
    margin: 0;
    display: grid;
    gap: var(--lem-gap-xs);
    justify-items: center;
}

/* Drawn at the format's true proportions, capped so half-page fits. */
.lem-mk-format__box {
    width: 100%;
    max-width: 190px;
    min-width: 90px;
    max-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lem-blue-soft);
    border: 1px solid var(--lem-blue);
    border-radius: var(--lem-radius-sm);
    color: var(--lem-blue-deep);
    font-family: var(--lem-font-head);
    font-size: var(--lem-text-xs);
    font-weight: 700;
}

.lem-mk-format figcaption {
    font-size: var(--lem-text-xs);
    color: var(--lem-ink-muted);
    text-align: center;
}

/* --- Contact ----------------------------------------------------------- */

.lem-mk-contact__grid {
    display: grid;
    gap: var(--lem-gap-lg);
}

@media (min-width: 768px) {
    .lem-mk-contact__grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

.lem-mk-contact__list {
    list-style: none;
    margin: var(--lem-gap) 0 0;
    padding: 0;
    display: grid;
    gap: var(--lem-gap-sm);
    font-size: var(--lem-text-sm);
}

.lem-mk-contact__list li {
    display: flex;
    align-items: center;
    gap: var(--lem-gap-sm);
}

.lem-mk-form {
    background: var(--lem-surface);
    border: 1px solid var(--lem-line);
    border-radius: var(--lem-radius);
    padding: var(--lem-gap-md);
    display: grid;
    gap: var(--lem-gap-sm);
}

.lem-mk-form__field {
    display: grid;
    gap: var(--lem-gap-xs);
    margin: 0;
}

.lem-mk-form__field label {
    font-size: var(--lem-text-sm);
    font-weight: 600;
}

.lem-mk-form input,
.lem-mk-form textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--lem-line);
    border-radius: var(--lem-radius);
    font-family: inherit;
    font-size: var(--lem-text-sm);
    color: var(--lem-ink);
    background: var(--lem-surface);
}
