/*
Theme Name: CaermaTech
Theme URI: https://caermatech.co.mz
Author: CaermaTech Team
Author URI: https://caermatech.co.mz
Description: Tema personalizado para o blog CaermaTech
Version: 2.0
License: GPLv2 or later
Text Domain: caermatech
*/

/* ============================================
   1. ROOT VARIABLES
   ============================================ */
:root {
    --navy: #0B1F3A;
    --blue: #2563EB;
    --white: #FFFFFF;
    --gold: #C69E46;
    --bg-soft: #F6F8FB;
    --line: #E3E8F0;
    --ink: #0B1F3A;
    --ink-muted: #5B6B84;
    --ink-faint: #8996A9;
    --measure: 68ch;
    --radius: 2px;
    --shadow: 0 1px 2px rgba(11,31,58,0.04), 0 8px 24px -12px rgba(11,31,58,0.12);
}

/* ============================================
   2. RESET & BASE
   ============================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    color: #1a2a3a;
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

h1, h2, h3, .serif { font-family: 'Merriweather', Georgia, serif; }
h1, h2, h3 { color: var(--navy); margin: 0; line-height: 1.25; word-wrap: break-word; overflow-wrap: break-word; }
a { color: #1a4c8a; text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #2563EB; }
img, svg { max-width: 100%; display: block; height: auto; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ============================================
   3. UTILITY CLASSES
   ============================================ */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--navy);
    color: var(--white);
    padding: 12px 18px;
    z-index: 200;
    border-radius: var(--radius);
}
.skip-link:focus { left: 12px; top: 12px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* ============================================
   4. CAPULANA RULE
   ============================================ */
.capulana-rule {
    display: flex;
    gap: 6px;
    align-items: center;
    height: 8px;
    margin: 0;
}
.capulana-rule span {
    width: 8px;
    height: 8px;
    background: var(--gold);
    transform: rotate(45deg);
    flex: 0 0 auto;
    opacity: .9;
}
.capulana-rule.line::before { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.capulana-rule.full { justify-content: center; }
.capulana-rule.full span { opacity: .55; }
.capulana-rule.full span:nth-child(3n) { opacity: 1; background: var(--blue); }

/* ============================================
   5. UTILITY BAR
   ============================================ */
.utility-bar {
    background: var(--navy);
    color: #C9D4E5;
    font-size: 13px;
}
.utility-bar .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 38px;
}
.utility-bar .edition { letter-spacing: .04em; }
.utility-bar .edition strong { color: var(--gold); font-weight: 600; }
.utility-bar nav a { margin-left: 18px; color: #C9D4E5; font-size: 12.5px; }
.utility-bar nav a:hover { color: var(--white); }

/* ============================================
   6. MASTHEAD - CABEÇALHO CORRIGIDO
   ============================================ */
header.masthead {
    border-bottom: 1px solid var(--line);
    background: var(--white);
    position: relative;
    z-index: 20;
}

.masthead-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    gap: 20px;
}

/* LOGO - À ESQUERDA */
.logo {
    font-family: 'Merriweather', serif;
    font-weight: 900;
    font-size: 26px;
    color: var(--navy);
    letter-spacing: -0.01em;
    display: flex;
    align-items: baseline;
    gap: 2px;
    flex-shrink: 0;
    text-decoration: none;
}
.logo .dot { color: var(--gold); }
.logo img.custom-logo { max-height: 50px; width: auto; height: auto; }

/* MENU - CENTRALIZADO */
.primary-nav {
    display: flex;
    gap: 4px;
    align-items: center;
    flex: 1;
    justify-content: center;
}
.primary-nav a {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--navy);
    padding: 10px 16px;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.primary-nav a:hover { color: var(--blue); }
.primary-nav a.active { border-bottom: 2px solid var(--gold); }

/* AÇÕES DO HEADER */
.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.btn-ghost {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    padding: 9px 12px;
    text-decoration: none;
}
.btn-gold {
    background: var(--blue);
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--blue);
    text-decoration: none;
}
.btn-gold:hover { background: #1d4fd1; }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}
.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--navy);
    margin: 5px 0;
}

/* ============================================
   7. MAIN
   ============================================ */
main { display: block; }

/* ============================================
   8. SECTION
   ============================================ */
.section { padding: 64px 0; }
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 24px;
    flex-wrap: wrap;
}
.section-head h2 { font-size: 28px; color: var(--navy); }
.section-head .see-all { font-size: 14px; font-weight: 600; color: var(--blue); white-space: nowrap; }

.kicker {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--blue);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.kicker .diamond { width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); flex: 0 0 auto; }
.kicker.on-dark { color: #9FC0FF; }

/* ============================================
   9. HERO
   ============================================ */
.hero {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 48px;
    padding: 56px 0;
    align-items: stretch;
}
.hero-visual {
    border-radius: var(--radius);
    overflow: hidden;
    background: radial-gradient(120% 140% at 15% 15%, #14315c 0%, #0B1F3A 55%, #08172c 100%);
    position: relative;
    min-height: 260px;
    display: flex;
    align-items: flex-end;
}
.hero-visual .motif { position: absolute; inset: 0; opacity: .5; }
.hero-visual .tag-float {
    position: relative;
    margin: 20px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(2px);
    color: var(--white);
    font-size: 12px;
    letter-spacing: .05em;
    border: 1px solid rgba(198,158,70,.5);
    border-radius: 2px;
}
.hero-main h1 { font-size: 40px; margin: 0 0 16px; word-wrap: break-word; overflow-wrap: break-word; }
.hero-main .dek { font-size: 18px; color: var(--ink-muted); margin-bottom: 20px; max-width: 56ch; }

.meta-row {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: #4a5a6a;
    flex-wrap: wrap;
}
.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Merriweather', serif;
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 auto;
}
.meta-row .dot-sep::before { content: "·"; margin: 0 2px; color: #8a9aaa; }

.hero-side { display: flex; flex-direction: column; gap: 0; }
.hero-side-item { padding: 20px 0; border-bottom: 1px solid var(--line); }
.hero-side-item:first-child { padding-top: 0; }
.hero-side-item:last-child { border-bottom: none; }
.hero-side-item h3 { font-size: 17px; margin-bottom: 8px; word-wrap: break-word; overflow-wrap: break-word; }
.hero-side-item .cat-tag { font-size: 12px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .07em; }

/* ============================================
   10. CATEGORY STRIP
   ============================================ */
.cat-strip { display: flex; gap: 12px; flex-wrap: wrap; }
.cat-pill {
    border: 1px solid var(--line);
    padding: 9px 16px;
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--navy);
}
.cat-pill:hover { border-color: var(--blue); color: var(--blue); }

/* ============================================
   11. CARD GRID
   ============================================ */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.card { display: flex; flex-direction: column; }
.card-visual {
    aspect-ratio: 16/10;
    border-radius: var(--radius);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.card-visual.v1 { background: linear-gradient(135deg, #0B1F3A, #2563EB); }
.card-visual.v2 { background: linear-gradient(135deg, #13294B, #0B1F3A 70%); }
.card-visual.v3 { background: linear-gradient(135deg, #2563EB, #0B1F3A); }
.card-visual::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle at 100% 100%, rgba(198,158,70,.35), transparent 60%);
}
.card h3 { font-size: 19px; margin-bottom: 8px; word-wrap: break-word; overflow-wrap: break-word; line-height: 1.4; }
.card p.excerpt { font-size: 15px; color: var(--ink-muted); margin: 0 0 12px; }
.card .cat-tag { font-size: 12px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; display: block; }
.card .meta-row { font-size: 12.5px; }

/* ============================================
   12. LATEST LIST
   ============================================ */
.latest-list { display: flex; flex-direction: column; }
.latest-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 24px;
    align-items: center;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}
.latest-item:first-child { padding-top: 0; }
.latest-thumb {
    width: 120px;
    aspect-ratio: 4/3;
    border-radius: var(--radius);
    background: linear-gradient(160deg, #0B1F3A, #1d3a66);
    position: relative;
    overflow: hidden;
}
.latest-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(198,158,70,.25), transparent 60%);
}
.latest-body h3 { font-size: 18px; margin-bottom: 6px; word-wrap: break-word; overflow-wrap: break-word; }
.latest-body p { font-size: 14.5px; color: var(--ink-muted); margin: 0 0 8px; max-width: 62ch; }
.read-time-tag { font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; text-align: right; }

/* ============================================
   13. NEWSLETTER
   ============================================ */
.newsletter {
    background: var(--navy);
    color: var(--white);
    border-radius: 4px;
    padding: 48px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: center;
}
.newsletter h2 { color: var(--white); font-size: 26px; margin-bottom: 10px; }
.newsletter p { color: #c8d4e8; font-size: 15px; max-width: 48ch; }
.newsletter form { display: flex; gap: 10px; }
.newsletter input {
    flex: 1;
    padding: 13px 16px;
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08);
    color: var(--white);
    font-size: 14.5px;
}
.newsletter input::placeholder { color: #8a9aaa; }
.newsletter input:focus { outline: 2px solid var(--gold); }
.newsletter button {
    background: var(--gold);
    color: var(--navy);
    font-weight: 700;
    font-size: 14.5px;
    padding: 13px 20px;
    border-radius: 2px;
    border: none;
    white-space: nowrap;
}
.newsletter button:hover { background: #d8b164; }
.newsletter .fineprint { font-size: 12px; color: #7C90B0; margin-top: 10px; max-width: none; }

/* ============================================
   14. FOOTER
   ============================================ */
footer {
    background: var(--bg-soft);
    border-top: 1px solid var(--line);
    padding: 56px 0 28px;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 40px;
    padding-bottom: 36px;
}
.footer-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); margin-bottom: 16px; }
.footer-grid ul li { margin-bottom: 10px; }
.footer-grid a { font-size: 14px; color: #4a5a6a; }
.footer-grid a:hover { color: var(--blue); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--ink-faint);
    flex-wrap: wrap;
    gap: 12px;
}

/* ============================================
   15. ARTICLE / SINGLE
   ============================================ */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gold);
    width: 0%;
    z-index: 100;
    transition: width .1s linear;
}
.article-header { padding: 44px 0 0; }
.breadcrumb { font-size: 13px; color: #6a7a8a; margin-bottom: 18px; }
.breadcrumb a { color: #1a4c8a; }
.breadcrumb a:hover { color: var(--blue); }
.article-header h1 {
    font-size: 38px;
    margin-bottom: 18px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}
.article-header .dek { font-size: 19px; color: var(--ink-muted); max-width: var(--measure); margin-bottom: 22px; }
.article-cover {
    aspect-ratio: 21/9;
    border-radius: 3px;
    margin: 32px 0;
    position: relative;
    overflow: hidden;
    background: radial-gradient(130% 160% at 80% 0%, #1d3a66 0%, #0B1F3A 55%, #08172c 100%);
}
.article-cover .caption { font-size: 12.5px; color: var(--ink-faint); margin-top: 10px; font-style: italic; }

.article-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 56px;
    align-items: flex-start;
}

/* ============================================
   16. TABLE OF CONTENTS
   ============================================ */
.toc {
    position: sticky;
    top: 24px;
    padding-top: 6px;
}
.toc h2 {
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ink-faint);
    margin-bottom: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
}
.toc ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-left: 1px solid var(--line);
}
.toc a {
    font-size: 13.5px;
    color: var(--ink-muted);
    padding: 7px 0 7px 16px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    border-left: 2px solid transparent;
    margin-left: -1px;
}
.toc a .diamond { width: 5px; height: 5px; background: var(--line); transform: rotate(45deg); margin-top: 5px; flex: 0 0 auto; }
.toc a:hover { color: var(--blue); }
.toc a.active { color: var(--navy); font-weight: 600; border-left-color: var(--gold); }
.toc a.active .diamond { background: var(--gold); }
.toc .reading-time { font-size: 12.5px; color: var(--ink-faint); margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ============================================
   17. ARTICLE BODY
   ============================================ */
.article-body {
    max-width: var(--measure);
    font-size: 18px;
    line-height: 1.8;
    color: #1a2a3a;
}
.article-body h2 { font-size: 28px; margin: 48px 0 16px; scroll-margin-top: 24px; color: var(--navy); }
.article-body h3 { font-size: 22px; margin: 36px 0 12px; scroll-margin-top: 24px; color: var(--navy); }
.article-body p { margin: 0 0 24px; }
.article-body ul, .article-body ol { margin: 0 0 24px; padding-left: 22px; }
.article-body li { margin-bottom: 8px; }
.article-body a {
    color: #1a4c8a;
    text-decoration: underline;
    text-decoration-color: #8ab4f8;
    text-underline-offset: 4px;
    font-weight: 500;
}
.article-body a:hover { color: var(--blue); text-decoration-color: var(--blue); }
.pull-quote {
    border-left: 3px solid var(--gold);
    padding: 4px 0 4px 24px;
    margin: 36px 0;
    font-family: 'Merriweather', serif;
    font-style: italic;
    font-size: 22px;
    color: var(--navy);
    line-height: 1.5;
}
.inline-figure {
    margin: 32px 0;
    border-radius: 3px;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #13294B, #2563EB 130%);
}
code { background: var(--bg-soft); padding: 2px 6px; border-radius: 2px; font-size: .9em; }

/* ============================================
   18. AUTHOR BOX
   ============================================ */
.author-box {
    display: flex;
    gap: 18px;
    padding: 28px;
    margin: 56px 0 0;
    background: var(--bg-soft);
    border-radius: 3px;
    border: 1px solid var(--line);
    max-width: var(--measure);
}
.author-box .avatar { width: 56px; height: 56px; font-size: 18px; }
.author-box h3 { font-size: 17px; margin-bottom: 4px; }
.author-box .role { font-size: 13px; color: var(--gold); font-weight: 600; margin-bottom: 8px; }
.author-box p { font-size: 14.5px; color: var(--ink-muted); margin: 0; }

/* ============================================
   19. RELATED SECTION
   ============================================ */
.related-section { margin-top: 64px; padding-top: 48px; border-top: 1px solid var(--line); }

/* ============================================
   20. PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 40px 0;
}
.pagination .page-numbers {
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font-weight: 500;
}
.pagination .page-numbers.current { background: var(--navy); color: var(--white); border-color: var(--navy); }
.pagination .page-numbers:hover:not(.current) { background: var(--bg-soft); }

/* ============================================
   21. WORDPRESS SPECIFIC
   ============================================ */
.admin-bar .progress-bar { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar .progress-bar { top: 46px; } }
.article-body .wp-block-image img { height: auto; max-width: 100%; }

/* ============================================
   22. RESPONSIVE
   ============================================ */
@media (max-width: 920px) {
    .hero-grid { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr 1fr; }
    .article-layout { grid-template-columns: 1fr; }
    .toc { position: static; margin-bottom: 32px; padding: 20px; background: var(--bg-soft); border-radius: 3px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .newsletter { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .article-header h1 { font-size: 28px; }
    .hero-main h1 { font-size: 26px; }
    .card h3 { font-size: 17px; }
    .section-head h2 { font-size: 24px; }
}
@media (max-width: 680px) {
    .primary-nav, .utility-bar nav { display: none; }
    .menu-toggle { display: block; }
    .card-grid { grid-template-columns: 1fr; }
    .latest-item { grid-template-columns: 80px 1fr; }
    .read-time-tag { grid-column: 2/3; text-align: left; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero-main h1 { font-size: 24px; }
    .article-header h1 { font-size: 24px; }
    .newsletter form { flex-direction: column; }
    .newsletter { padding: 28px; }
    .article-body { font-size: 16px; }
    .article-body h2 { font-size: 22px; }
    .article-body h3 { font-size: 18px; }
}
@media (max-width: 480px) {
    .article-header h1 { font-size: 20px; }
    .hero-main h1 { font-size: 20px; }
    .article-body { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}







/* ============================================
   HEADER E MENU FIXO - VERSÃO FINAL
   ============================================ */

/* UTILITY BAR FIXA */
.utility-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #0B1F3A;
}

/* MASTHEAD FIXO */
header.masthead {
    position: fixed;
    top: 38px;
    left: 0;
    right: 0;
    z-index: 9998;
    background: #FFFFFF;
    border-bottom: 1px solid #E3E8F0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* ESPAÇO NO BODY */
body {
    padding-top: 130px !important;
}

/* ADMIN BAR */
.admin-bar .utility-bar {
    top: 32px;
}

.admin-bar header.masthead {
    top: 70px;
}

@media screen and (max-width: 782px) {
    .admin-bar .utility-bar {
        top: 46px;
    }
    .admin-bar header.masthead {
        top: 84px;
    }
    body {
        padding-top: 140px !important;
    }
}

@media (max-width: 600px) {
    body {
        padding-top: 120px !important;
    }
    header.masthead {
        top: 35px;
    }
}

/* ============================================
   CORREÇÃO DO MENU - LINHA DOURADA
   ============================================ */

.primary-nav a.active {
    border-bottom: 3px solid #C69E46 !important;
    color: #0B1F3A !important;
}

.primary-nav a {
    padding: 10px 16px !important;
    border-bottom: 3px solid transparent !important;
    text-decoration: none !important;
    font-size: 14.5px !important;
    font-weight: 500 !important;
    color: #0B1F3A !important;
    transition: all 0.2s ease !important;
}

.primary-nav a:hover {
    border-bottom: 3px solid #2563EB !important;
    color: #2563EB !important;
}

.primary-nav {
    display: flex !important;
    gap: 4px !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
}

.masthead-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 20px 0 !important;
    gap: 20px !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
}

.logo {
    flex-shrink: 0 !important;
}

/* RESPONSIVO */
@media (max-width: 768px) {
    .masthead-inner {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    
    .primary-nav {
        order: 3 !important;
        flex: 1 1 100% !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 2px !important;
    }
    
    .primary-nav a {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 680px) {
    .primary-nav,
    .utility-bar nav {
        display: none !important;
    }
    
    .menu-toggle {
        display: block !important;
    }
}