/* ==========================================================================
   Tribuna Tech Clone — estética clonada de braziljournal.com
   Fonts: Roboto Slab (display/headlines) + Inter (body/nav) + PT Serif (pull)
   Paleta: #000 header, #FFF page, #FBB000 accent, #4065F6 link, #212529 text
   ========================================================================== */

/* ---------- 0. Reset + tokens ---------- */
:root {
    --color-bg-page: #ffffff;
    --color-bg-header: #000000;
    --color-bg-hero: #000000;
    --color-bg-soft: #f7f7f7;
    --color-text-primary: #212529;
    --color-text-on-dark: #ffffff;
    --color-text-muted: #6c757d;
    --color-accent: #fbb000;     /* amarelo dourado — tag, hover */
    --color-link: #4065f6;       /* azul inline */
    --color-border: #e5e5e5;

    --font-display: 'Roboto Slab', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-serif: 'PT Serif', Georgia, serif;

    --container-max: 1200px;
    --content-max: 720px;
    --gutter: 24px;
    --header-h: 64px;
    --header-h-mobile: 56px;
}

/* Hard reset over Astra/parent — necessario porque Astra impoe max-width 700px no body */
html { margin-top: 0 !important; }
body.tribuna-home,
body.tribuna-archive,
body.tribuna-singular,
body.page,
body {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
    background: var(--color-bg-page) !important;
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Astra wrapping divs / page container */
#page, .hfeed.site, .site, #content.site-content, .ast-container, .ast-container-fluid,
.entry-content, .ast-article-single, .ast-article-post {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Re-aplica margin top apenas pra admin bar */
.admin-bar { padding-top: 32px; }

* { box-sizing: border-box; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-link); text-decoration: none; transition: color .15s ease; }
a:hover { color: #1e3fc7; }

/* Hide Astra default header/footer/nav when our template runs */
.ast-primary-header-bar,
.site-header.ast-primary-header,
.site-header,
#masthead,
.ast-below-header,
.ast-above-header,
header#masthead,
.site-footer,
footer#colophon { display: none !important; }

/* ---------- 1. Container ---------- */
.tt-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-inline: var(--gutter);
}
.tt-narrow {
    max-width: var(--content-max);
    margin: 0 auto;
    padding-inline: var(--gutter);
}

/* ---------- 2. Header BJ-clone ---------- */
.tt-header {
    background: var(--color-bg-header);
    color: var(--color-text-on-dark);
    height: var(--header-h);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #111;
}
.tt-header-inner {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-inline: var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
.tt-logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 24px;
    letter-spacing: -0.01em;
    color: var(--color-text-on-dark);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}
.tt-logo:hover { color: var(--color-accent); }
.tt-logo span { font-style: italic; font-weight: 400; opacity: .85; }

.tt-nav { display: flex; align-items: center; gap: 28px; flex: 1; justify-content: center; }
.tt-nav a {
    color: var(--color-text-on-dark);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: border-color .15s ease, color .15s ease;
}
.tt-nav a:hover,
.tt-nav .current-menu-item > a,
.tt-nav .current_page_item > a {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.tt-header-tools { display: flex; align-items: center; gap: 16px; }
.tt-search-btn,
.tt-menu-toggle {
    background: transparent;
    border: 0;
    cursor: pointer;
    color: #fff;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tt-menu-toggle { display: none; }

/* Search modal */
.tt-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.96);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--gutter);
}
.tt-search-overlay.is-open { display: flex; }
.tt-search-overlay form {
    width: 100%;
    max-width: 640px;
}
.tt-search-overlay input[type="search"] {
    width: 100%;
    background: transparent;
    border: 0;
    border-bottom: 2px solid #fff;
    color: #fff;
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 500;
    padding: 12px 0;
    outline: none;
}
.tt-search-overlay input::placeholder { color: rgba(255,255,255,.5); }
.tt-search-overlay .tt-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}

/* ---------- 3. Hero / front-page magazine grid ---------- */
.tt-front {
    padding-block: 48px 80px;
}
.tt-hero-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 32px;
    margin-bottom: 56px;
}
.tt-hero-lg .tt-card-img {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    margin-bottom: 16px;
}
.tt-hero-lg .tt-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}
.tt-hero-lg:hover .tt-card-img img { transform: scale(1.02); }
.tt-hero-lg .tt-tag { margin-bottom: 12px; }
.tt-hero-lg .tt-card-title {
    font-family: var(--font-display);
    font-size: 40px;
    line-height: 1.1;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 12px;
    letter-spacing: -0.01em;
}
.tt-hero-lg .tt-card-title a { color: inherit; text-decoration: none; }
.tt-hero-lg .tt-card-title a:hover { color: var(--color-link); }
.tt-hero-lg .tt-card-excerpt {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.55;
    color: var(--color-text-muted);
    margin: 0 0 12px;
}

.tt-hero-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.tt-hero-side .tt-card-sm {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}
.tt-hero-side .tt-card-sm:last-child { border-bottom: 0; }
.tt-hero-side .tt-card-title {
    font-family: var(--font-display);
    font-size: 18px;
    line-height: 1.25;
    font-weight: 600;
    margin: 8px 0 0;
}
.tt-hero-side .tt-card-title a { color: var(--color-text-primary); }
.tt-hero-side .tt-card-title a:hover { color: var(--color-link); }

/* Tag (signature BJ amarelo) */
.tt-tag {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent);
    text-decoration: none;
    line-height: 1;
}
.tt-tag:hover { color: #d99500; }

/* ---------- 4. Section heading ---------- */
.tt-section {
    margin-bottom: 56px;
}
.tt-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-text-primary);
}
.tt-section-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.005em;
}
.tt-section-more {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    text-decoration: none;
}
.tt-section-more:hover { color: var(--color-accent); }

/* ---------- 5. Grid de cards (boxarticle equivalente) ---------- */
.tt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.tt-grid--2 { grid-template-columns: repeat(2, 1fr); }
.tt-grid--4 { grid-template-columns: repeat(4, 1fr); }

.tt-card {
    display: flex;
    flex-direction: column;
}
.tt-card-img {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    margin-bottom: 14px;
    background: var(--color-bg-soft);
}
.tt-card-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}
.tt-card:hover .tt-card-img img { transform: scale(1.02); }
.tt-card .tt-tag { margin-bottom: 8px; }
.tt-card-title {
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 1.2;
    font-weight: 600;
    margin: 0 0 8px;
    letter-spacing: -0.005em;
}
.tt-card-title a { color: var(--color-text-primary); text-decoration: none; }
.tt-card-title a:hover { color: var(--color-link); }
.tt-card-excerpt {
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--color-text-muted);
    margin: 0;
}
.tt-card-meta {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 8px;
}

/* Variant: row card (imagem esquerda + texto direita) — BJ boxarticle--row */
.tt-card--row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    align-items: start;
}
.tt-card--row .tt-card-img {
    aspect-ratio: 16 / 9;
    margin-bottom: 0;
}
.tt-card--row .tt-card-title { font-size: 17px; }

/* ---------- 6. Archive page ---------- */
.tt-archive {
    padding-block: 40px 80px;
}
.tt-archive-head {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}
.tt-archive-kicker {
    font-family: var(--font-body);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-accent);
    font-weight: 700;
    margin: 0 0 8px;
}
.tt-archive-title {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 12px;
    letter-spacing: -0.015em;
    line-height: 1.05;
}
.tt-archive-desc {
    font-family: var(--font-body);
    font-size: 18px;
    color: var(--color-text-muted);
    max-width: 720px;
    margin: 0;
    line-height: 1.5;
}

.tt-pagination {
    margin-top: 48px;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.tt-pagination a,
.tt-pagination span {
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.tt-pagination a:hover { background: var(--color-bg-soft); }
.tt-pagination .current { background: var(--color-text-primary); color: #fff; border-color: var(--color-text-primary); }

/* ---------- 7. Single article — BJ tipográfico ---------- */
.tt-single {
    padding-block: 48px 80px;
}
.tt-single-hero {
    background: var(--color-bg-hero);
    color: var(--color-text-on-dark);
    padding-block: 56px 64px;
    margin-bottom: 48px;
}
.tt-single-hero .tt-tag {
    color: var(--color-accent);
    margin-bottom: 20px;
}
.tt-single-title {
    font-family: var(--font-display);
    font-size: 44px;
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: #fff;
    margin: 0 0 20px;
    max-width: 900px;
}
.tt-single-subtitle {
    font-family: var(--font-body);
    font-size: 20px;
    line-height: 1.45;
    font-weight: 400;
    color: rgba(255,255,255,.85);
    margin: 0 0 24px;
    max-width: 800px;
}
.tt-single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-family: var(--font-body);
    font-size: 14px;
    color: rgba(255,255,255,.7);
}
.tt-single-meta time { white-space: nowrap; }
.tt-single-meta .tt-author { color: #fff; font-weight: 600; }

.tt-single-featured {
    max-width: var(--container-max);
    margin: -32px auto 48px;
    padding-inline: var(--gutter);
}
.tt-single-featured img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.tt-single-featured figcaption {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-text-muted);
    padding-top: 8px;
}

.tt-article-body {
    max-width: var(--content-max);
    margin: 0 auto;
    padding-inline: var(--gutter);
    font-family: var(--font-body);
    font-size: 19px;
    line-height: 1.65;
    color: var(--color-text-primary);
}
.tt-article-body p { margin: 0 0 1.4em; }
.tt-article-body h2 {
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    margin: 2em 0 .6em;
    letter-spacing: -0.005em;
}
.tt-article-body h3 {
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 1.25;
    font-weight: 600;
    margin: 1.6em 0 .5em;
}
.tt-article-body a {
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.tt-article-body a:hover { color: #1e3fc7; }
.tt-article-body blockquote {
    border-left: 4px solid var(--color-accent);
    margin: 1.8em 0;
    padding: 4px 0 4px 20px;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 22px;
    line-height: 1.4;
    color: var(--color-text-primary);
}
.tt-article-body ul,
.tt-article-body ol { margin: 0 0 1.4em; padding-left: 1.4em; }
.tt-article-body li { margin: 0 0 .5em; }
.tt-article-body img,
.tt-article-body figure { margin: 1.6em 0; }
.tt-article-body figcaption {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 8px;
    line-height: 1.4;
}
.tt-article-body strong { font-weight: 700; }
.tt-article-body em { font-style: italic; }

/* Empresa-specific meta block (perfil institucional) */
.tt-empresa-meta {
    max-width: var(--content-max);
    margin: 0 auto 32px;
    padding-inline: var(--gutter);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px 24px;
    padding-block: 24px;
    border-top: 2px solid var(--color-text-primary);
    border-bottom: 1px solid var(--color-border);
}
.tt-empresa-meta dt {
    font-family: var(--font-body);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    font-weight: 600;
    margin: 0;
}
.tt-empresa-meta dd {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-text-primary);
    margin: 4px 0 0;
    font-weight: 500;
}

/* Related posts */
.tt-related {
    max-width: var(--container-max);
    margin: 80px auto 0;
    padding: 48px var(--gutter) 0;
    border-top: 2px solid var(--color-text-primary);
}

/* ---------- 8. Footer ---------- */
.tt-footer {
    background: #000;
    color: #fff;
    padding-block: 56px 32px;
    margin-top: 80px;
}
.tt-footer-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-inline: var(--gutter);
}
.tt-footer-top {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.tt-footer-brand {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
}
.tt-footer-brand span { font-style: italic; font-weight: 400; opacity: .85; }
.tt-footer h4 {
    font-family: var(--font-body);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
    margin: 0 0 16px;
    font-weight: 700;
}
.tt-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tt-footer ul li { margin-bottom: 10px; }
.tt-footer ul a {
    color: rgba(255,255,255,.75);
    font-family: var(--font-body);
    font-size: 14px;
    text-decoration: none;
}
.tt-footer ul a:hover { color: var(--color-accent); }
.tt-footer p { color: rgba(255,255,255,.65); font-size: 14px; line-height: 1.55; }
.tt-footer-bottom {
    border-top: 1px solid rgba(255,255,255,.15);
    padding-top: 24px;
    font-size: 12px;
    color: rgba(255,255,255,.6);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------- 9. Empresa archive card variant (logo+nome+setor) ---------- */
.tt-empresa-card {
    background: #fff;
    border: 1px solid var(--color-border);
    padding: 24px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.tt-empresa-card:hover {
    border-color: var(--color-text-primary);
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
.tt-empresa-card .tt-card-img {
    aspect-ratio: 3 / 2;
    background: var(--color-bg-soft);
    display: flex; align-items: center; justify-content: center;
}
.tt-empresa-card .tt-card-img img {
    width: auto;
    max-width: 80%;
    max-height: 70%;
    object-fit: contain;
}
.tt-empresa-card .tt-card-title { font-size: 20px; }
.tt-empresa-card .tt-empresa-sector {
    font-family: var(--font-body);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-top: 8px;
}

/* ---------- 10. Glossário index A-Z ---------- */
.tt-glossario-az {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}
.tt-glossario-az a {
    width: 36px; height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14px;
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    text-decoration: none;
}
.tt-glossario-az a:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #000;
}
.tt-glossario-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tt-glossario-list li {
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
}
.tt-glossario-list a {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-primary);
}
.tt-glossario-list a:hover { color: var(--color-link); }

/* ---------- 11. Ranking list style ---------- */
.tt-ranking-list { counter-reset: rank; list-style: none; padding: 0; margin: 0; }
.tt-ranking-list > li {
    counter-increment: rank;
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border);
}
.tt-ranking-list > li::before {
    content: counter(rank);
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
}

/* ---------- 12. Mobile drawer ---------- */
.tt-drawer {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: 88%;
    max-width: 360px;
    background: #000;
    color: #fff;
    z-index: 150;
    transform: translateX(100%);
    transition: transform .3s ease;
    padding: 80px 24px 24px;
    overflow-y: auto;
}
.tt-drawer.is-open { transform: translateX(0); }
.tt-drawer ul { list-style: none; margin: 0; padding: 0; }
.tt-drawer ul li { margin-bottom: 16px; }
.tt-drawer ul a {
    color: #fff;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    text-decoration: none;
}
.tt-drawer ul a:hover { color: var(--color-accent); }
.tt-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 140;
    display: none;
}
.tt-drawer-overlay.is-open { display: block; }

/* ---------- 13. 404 / Search empty ---------- */
.tt-404 {
    padding-block: 120px;
    text-align: center;
}
.tt-404 h1 {
    font-family: var(--font-display);
    font-size: 96px;
    font-weight: 800;
    color: var(--color-accent);
    margin: 0;
    line-height: 1;
}
.tt-404 p {
    font-family: var(--font-body);
    font-size: 20px;
    color: var(--color-text-muted);
    margin: 16px 0 24px;
}
.tt-btn {
    display: inline-block;
    background: var(--color-text-primary);
    color: #fff;
    padding: 12px 28px;
    font-family: var(--font-body);
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.08em;
}
.tt-btn:hover { background: var(--color-accent); color: #000; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .tt-hero-grid { grid-template-columns: 1fr; }
    .tt-hero-lg .tt-card-title { font-size: 32px; }
    .tt-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
    .tt-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .tt-footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .tt-header { height: var(--header-h-mobile); }
    .tt-nav { display: none; }
    .tt-menu-toggle { display: inline-flex; }
    .tt-logo { font-size: 20px; }

    .tt-hero-lg .tt-card-title { font-size: 26px; }
    .tt-single-title { font-size: 30px; }
    .tt-archive-title { font-size: 32px; }
    .tt-single-hero { padding-block: 36px 44px; }
    .tt-single-featured { margin-top: -20px; }

    .tt-card--row { grid-template-columns: 120px 1fr; gap: 12px; }
    .tt-card--row .tt-card-title { font-size: 15px; }

    .tt-section-title { font-size: 20px; }
    .tt-article-body { font-size: 17px; line-height: 1.6; }
    .tt-article-body h2 { font-size: 24px; }
    .tt-article-body h3 { font-size: 19px; }
    .tt-article-body blockquote { font-size: 19px; }
}

@media (max-width: 540px) {
    .tt-grid, .tt-grid--2, .tt-grid--4 {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .tt-footer-top { grid-template-columns: 1fr; gap: 32px; }
    .tt-footer-bottom { flex-direction: column; }
}
