@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --red: #c8102e;
    --ink: #171923;
    --muted: #69707d;
    --line: #e7e9ee;
    --paper: #fff;
    --bg: #f4f5f7;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, Arial, sans-serif;
    line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { width: min(1180px, calc(100% - 36px)); margin: auto; }

/* Cabeçalho */
.topline { background: #171923; color: #d9dce2; font-size: 12px; }
.topline-inner { display: flex; justify-content: space-between; padding: 7px 0; }
.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -1px;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    background: var(--red);
    color: white;
    border-radius: 9px;
    font-weight: 900;
    font-size: 30px;
}
.brand small {
    display: block;
    font-size: 9px;
    letter-spacing: 1.1px;
    color: var(--muted);
    font-weight: 700;
}
.search { display: flex; width: min(390px, 48%); }
.search input {
    min-width: 0;
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 6px 0 0 6px;
    padding: 11px 13px;
    font: inherit;
}
.search button, .btn {
    border: 0;
    background: var(--red);
    color: #fff;
    padding: 11px 17px;
    border-radius: 0 6px 6px 0;
    font: 600 14px Inter, Arial, sans-serif;
    cursor: pointer;
}

/* Menu desktop */
.nav { background: var(--red); color: white; width: 100%; }
.nav-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    overflow: visible;
    white-space: normal;
}
.nav a {
    display: block;
    padding: 13px 15px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.nav a:first-child { padding-left: 0; }
.nav a:hover { background: #a80c25; }

/* Botão e painel lateral mobile: ocultos no desktop */
.mobile-menu-button,
.mobile-menu-backdrop,
.mobile-menu-panel,
.mobile-menu-close { display: none; }

/* Conteúdo */
.main { padding-top: 25px; padding-bottom: 50px; }
.section-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 18px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
}
.section-heading span { white-space: nowrap; }
.section-heading i { height: 2px; background: var(--red); width: 100%; }

.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 28px;
}
.hero-card {
    display: grid;
    grid-template-columns: 1.12fr 1fr;
    gap: 22px;
    margin-bottom: 26px;
}
.hero-image {
    height: 350px;
    background: #eceef2;
    overflow: hidden;
    border-radius: 8px;
}
.hero-image img { width: 100%; height: 100%; object-fit: cover; }
.hero-copy { align-self: center; }
.category-tag {
    display: inline-block;
    color: var(--red);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    font-weight: 800;
    margin-bottom: 7px;
}
.hero-copy h1 {
    font-size: clamp(25px, 3vw, 38px);
    line-height: 1.14;
    letter-spacing: -1.2px;
    margin: 5px 0 12px;
}
.hero-copy p, .news-card p {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 12px;
}
.hero-copy small, .news-card small { color: #8a909b; font-size: 11px; }

/* Cards de notícias */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
.news-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: white;
    transition: transform .15s, box-shadow .15s;
}
.news-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px #1111110b; }
.news-card > a { display: block; height: 100%; }
.news-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #eceef2;
}
.news-card-body { padding: 14px; }
.news-card h2 {
    font-size: 17px;
    line-height: 1.3;
    margin: 3px 0 9px;
    letter-spacing: -.3px;
}
.news-card p {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Barra lateral e publicidade */
.sidebar { min-width: 0; }
.side-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--red);
    padding-bottom: 9px;
    margin-bottom: 14px;
}
.ad-box {
    display: block;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
    margin-bottom: 15px;
    background: #fff;
}
.ad-box img { width: 100%; max-height: 300px; object-fit: contain; background: #f5f5f5; }
.ad-box span { display: block; padding: 7px 10px; font-size: 11px; color: var(--muted); }
.ad-placeholder {
    min-height: 180px;
    border: 1px dashed #c8cbd3;
    background: #fafafa;
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #7b818c;
    margin-bottom: 26px;
}
.ad-placeholder strong { font-size: 15px; color: #505662; }
.ad-placeholder span { font-size: 12px; }
.mini-news { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mini-news span {
    display: block;
    color: var(--red);
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 800;
}
.mini-news strong { font-size: 13px; line-height: 1.35; }
.ad-row { display: flex; gap: 15px; margin-bottom: 25px; }
.ad-row .ad-box { flex: 1; margin: 0; }
.ad-row img { max-height: 130px; }

/* Rodapé */
.footer { background: #171923; color: #fff; padding: 28px 0; }
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    font-size: 13px;
}
.footer p { margin: 5px 0; color: #aeb3bd; font-size: 12px; }
.empty-state {
    padding: 40px 25px;
    text-align: center;
    background: #f7f8fa;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 25px;
}
.empty-state p { color: var(--muted); }
.btn { display: inline-block; border-radius: 6px; }

/* Página da notícia */
.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 820px) 280px;
    gap: 45px;
    padding-top: 32px;
    padding-bottom: 55px;
}
.breadcrumb { color: var(--muted); font-size: 12px; margin-bottom: 22px; }
.breadcrumb a { color: var(--red); }
.article h1 {
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.13;
    letter-spacing: -1.5px;
    margin: 8px 0 12px;
}
.article-lead { font-size: 19px; color: #555d69; line-height: 1.5; margin: 0 0 16px; }
.byline {
    font-size: 12px;
    color: #777e89;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
    margin-bottom: 22px;
}
.article-cover { margin: 0 0 26px; }
.article-cover img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 8px;
    background: #f0f1f3;
}
.article-cover figcaption { font-size: 11px; color: var(--muted); margin-top: 7px; }
.article-content { font-size: 17px; line-height: 1.9; overflow-wrap: anywhere; }
.share-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
    padding-top: 20px;
    margin-top: 28px;
    font-size: 12px;
}
.share-row a { background: #f1f2f5; padding: 8px 12px; border-radius: 5px; font-weight: 700; }
.related-title { margin-top: 35px; }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.related-grid a { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; font-size: 13px; }
.related-grid img { height: 110px; width: 100%; object-fit: cover; }
.related-grid strong { display: block; padding: 10px; }

/* Categorias, paginação e busca */
.category-grid { margin-bottom: 30px; }
.pagination { display: flex; gap: 6px; margin: 25px 0; }
.pagination a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 5px; }
.pagination .active { background: var(--red); color: white; }
.search-title { font-size: 22px; }

/* Tablets */
@media (max-width: 900px) {
    .home-grid, .article-layout { grid-template-columns: minmax(0, 1fr); }
    .sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .sidebar .side-title { grid-column: 1 / -1; }
    .hero-card { grid-template-columns: 1fr; }
    .hero-image { height: 320px; }
    .article-layout { gap: 25px; }
}

/* Celulares */
@media (max-width: 620px) {
    .wrap { width: calc(100% - 24px); }
    .topline-inner { font-size: 10px; }
    .masthead { padding: 15px 0; flex-wrap: wrap; gap: 14px; }
    .brand { font-size: 23px; }
    .brand-mark { width: 42px; height: 42px; font-size: 26px; }
    .search { width: 100%; }

    /* Esconde o menu horizontal e exibe botão para abrir menu lateral */
    .nav { display: none; }
    .mobile-menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
        width: 100%;
        border: 0;
        background: var(--red);
        color: #fff;
        padding: 13px 16px;
        font: 700 14px Inter, Arial, sans-serif;
        cursor: pointer;
        text-align: left;
    }
    .mobile-menu-button .hamburger {
        font-size: 23px;
        line-height: 1;
    }
    .mobile-menu-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 9998;
        background: rgba(0, 0, 0, .52);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
    }
    .mobile-menu-panel {
        display: block;
        position: fixed;
        z-index: 9999;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(84vw, 320px);
        overflow-y: auto;
        background: #fff;
        box-shadow: 8px 0 30px rgba(0, 0, 0, .18);
        transform: translateX(-105%);
        transition: transform .22s ease;
        padding: 0 0 20px;
    }
    body.menu-open { overflow: hidden; }
    body.menu-open .mobile-menu-backdrop {
        opacity: 1;
        visibility: visible;
    }
    body.menu-open .mobile-menu-panel { transform: translateX(0); }
    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 18px 16px;
        background: var(--red);
        color: #fff;
        font-weight: 800;
    }
    .mobile-menu-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        background: transparent;
        color: #fff;
        font-size: 28px;
        cursor: pointer;
        line-height: 1;
    }
    .mobile-menu-panel .mobile-menu-links {
        display: flex;
        flex-direction: column;
    }
    .mobile-menu-panel .mobile-menu-links a {
        padding: 13px 18px;
        border-bottom: 1px solid var(--line);
        color: var(--ink);
        font-size: 14px;
        font-weight: 700;
    }
    .mobile-menu-panel .mobile-menu-links a:hover {
        background: #f8e9ec;
        color: var(--red);
    }

    .main { padding-top: 20px; }
    /* Centraliza o título da seção */
    .section-heading {
        position: relative;
        justify-content: center;
        text-align: center;
        margin: 0 0 18px;
        min-height: 28px;
    }
    .section-heading span {
        white-space: normal;
        background: var(--paper);
        padding: 0 12px;
        position: relative;
        z-index: 1;
    }
    .section-heading i {
        position: absolute;
        left: 0;
        right: 0;
        top: 50%;
        width: 100%;
        z-index: 0;
    }

    .hero-card { grid-template-columns: 1fr; }
    .hero-image { height: 230px; }
    .hero-copy h1 { font-size: 28px; }
    .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .news-card img { height: 125px; }
    .news-card-body { padding: 10px; }
    .news-card h2 { font-size: 14px; }
    .news-card p { display: none; }
    .news-card .category-tag { font-size: 9px; }
    .sidebar { grid-template-columns: 1fr; }
    .ad-row { display: block; }
    .ad-row .ad-box { margin-bottom: 12px; }
    .article-layout { padding-top: 22px; }
    .article h1 { font-size: 32px; }
    .article-lead { font-size: 16px; }
    .article-content { font-size: 16px; }
    .footer-inner { align-items: flex-start; flex-direction: column; }
    .related-grid { grid-template-columns: 1fr 1fr; }
}

/* Ajuste do botão do menu mobile: ícone no canto e título centralizado */
.mobile-menu-button {
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 52px;
    border: 0;
    background: var(--red);
    color: #fff;
    font: 700 14px Inter, Arial, sans-serif;
    cursor: pointer;
    text-align: center;
}
.mobile-menu-button .hamburger {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 23px;
    line-height: 1;
}
.mobile-menu-current-title {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}
.mobile-menu-backdrop,
.mobile-menu-panel,
.mobile-menu-close {
    display: none;
}

@media (max-width: 620px) {
    .nav.desktop-nav { display: none; }

    .mobile-menu-button { display: flex; }

    .mobile-menu-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 9998;
        background: rgba(0, 0, 0, .52);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
    }

    .mobile-menu-panel {
        display: block;
        position: fixed;
        z-index: 9999;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(84vw, 320px);
        overflow-y: auto;
        background: #fff;
        box-shadow: 8px 0 30px rgba(0, 0, 0, .18);
        transform: translateX(-105%);
        transition: transform .22s ease;
        padding: 0 0 20px;
    }

    body.menu-open { overflow: hidden; }
    body.menu-open .mobile-menu-backdrop {
        opacity: 1;
        visibility: visible;
    }
    body.menu-open .mobile-menu-panel { transform: translateX(0); }

    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 18px 16px;
        background: var(--red);
        color: #fff;
        font-weight: 800;
    }
    .mobile-menu-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        background: transparent;
        color: #fff;
        font-size: 28px;
        cursor: pointer;
        line-height: 1;
    }
    .mobile-menu-panel .mobile-menu-links {
        display: flex;
        flex-direction: column;
    }
    .mobile-menu-panel .mobile-menu-links a {
        padding: 13px 18px;
        border-bottom: 1px solid var(--line);
        color: var(--ink);
        font-size: 14px;
        font-weight: 700;
    }
    .mobile-menu-panel .mobile-menu-links a:hover {
        background: #f8e9ec;
        color: var(--red);
    }
}