:root {
    --bg: #f5f7fb;
    --surface: #fff;
    --text: #172033;
    --muted: #687386;
    --line: #e6eaf0;
    --primary: #245fa6;
    --dark: #101827;
    --radius: 16px;
    --shadow: 0 8px 28px rgba(24, 39, 75, .06)
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
    line-height: 1.7
}

a {
    color: inherit;
    text-decoration: none
}

a:hover {
    color: var(--primary)
}

.container {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto
}

.site-header {
    background: var(--dark);
    color: #fff
}

.header-top {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.7px
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--primary);
    color: white;
    font-weight: 800
}

.brand span:last-child {
    color: #aeb8ca
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0 0 17px
}

.main-nav a {
    color: #cbd3e1;
    font-size: .86rem;
    padding: 8px 11px;
    border-radius: 8px
}

.main-nav a:hover, .main-nav a.active {
    color: #fff;
    background: rgba(255, 255, 255, .1)
}

.user-nav {
    align-items: center;
    display: flex;
    gap: 7px;
    margin-left: auto
}

.main-nav .user-nav a {
    border: 1px solid rgba(255, 255, 255, .24);
    font-weight: 700
}

.main-nav .user-nav-profile,
.main-nav .user-nav-login {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff
}

.main-nav .user-nav-logout {
    color: #ffd4d4
}

.main-nav .user-nav a:hover {
    filter: brightness(1.12)
}

.menu-toggle {
    display: none;
    border: 1px solid #394457;
    color: #fff;
    background: transparent;
    border-radius: 9px;
    padding: 8px 12px;
    font-size: 1.2rem;
    cursor: pointer
}

.page-wrap {
    padding: 36px 0 64px
}

.breadcrumb {
    color: var(--muted);
    font-size: .78rem;
    margin: 0 0 10px;
    overflow-x: auto;
    padding: 0 2px;
    white-space: nowrap
}

.breadcrumb ol {
    align-items: center;
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    min-width: max-content;
    padding: 0
}

.breadcrumb li {
    align-items: center;
    display: inline-flex
}

.breadcrumb li + li::before {
    color: #9aa4b5;
    content: '/';
    margin-right: 8px
}

.breadcrumb a {
    color: var(--primary)
}

.page-title {
    font-size: clamp(1.8rem, 4vw, 2.65rem);
    line-height: 1.2;
    letter-spacing: -1px;
    margin: 8px 0 14px
}

.page-description {
    color: var(--muted);
    max-width: 800px
}

.content-layout {
    display: grid;
    grid-template-columns:minmax(0, 1fr) 300px;
    gap: 28px
}

.article-content, .panel, .post-card, .side-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow)
}

.article-content {
    padding: clamp(22px, 4vw, 42px);
    min-width: 0
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--muted);
    font-size: .84rem;
    margin: 18px 0 26px
}

.article-content h2 {
    font-size: 1.55rem;
    line-height: 1.35;
    margin: 34px 0 12px
}

.article-content h3 {
    font-size: 1.18rem;
    margin: 26px 0 9px
}

.article-content p {
    margin: 0 0 17px
}

.article-content ul, .article-content ol {
    padding-left: 24px
}

.article-content li {
    margin: 7px 0
}

.article-content table {
    border-collapse: collapse;
    width: 100%;
    display: block;
    overflow-x: auto;
    margin: 18px 0
}

.article-content th, .article-content td {
    border: 1px solid var(--line);
    padding: 11px;
    text-align: left;
    min-width: 140px
}

.article-content th {
    background: #f0f2f8
}

.article-content pre {
    background: #111827;
    color: #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    overflow-x: auto;
    font-size: .85rem;
    line-height: 1.6
}

.article-content code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace
}

.article-content :not(pre) > code {
    background: #eef0f7;
    padding: 2px 5px;
    border-radius: 5px
}

.about-body.ql-editor {
    height: auto;
    overflow-y: visible;
    padding: 0
}

.about-body.ql-editor img {
    height: auto;
    max-width: 100%
}

.about-body.ql-editor .ql-video {
    aspect-ratio: 16 / 9;
    border: 0;
    width: 100%
}

.category-label {
    display: inline-block;
    color: var(--primary);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .7px
}

.post-list {
    display: grid;
    gap: 15px;
    margin-top: 24px
}

.post-card {
    padding: 22px
}

.post-card h2, .post-card h3 {
    font-size: 1.12rem;
    line-height: 1.4;
    margin: 8px 0
}

.post-card p {
    color: var(--muted);
    margin: 0;
    font-size: .92rem
}

.post-meta {
    color: #8992a2;
    font-size: .8rem;
    margin-top: 12px
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px
}

.side-card {
    padding: 22px
}

.side-card h3 {
    margin: 0 0 14px;
    font-size: 1rem
}

.side-list {
    list-style: none;
    padding: 0;
    margin: 0
}

.side-list li + li {
    border-top: 1px solid var(--line)
}

.side-list a {
    display: block;
    padding: 10px 0;
    font-size: .87rem;
    color: #485267
}

.side-list a:hover {
    color: var(--primary)
}

.search-form {
    display: flex;
    gap: 7px
}

.search-form input {
    min-width: 0;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 11px;
    font: inherit;
    font-size: .85rem
}

.search-form button {
    border: 0;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    padding: 0 13px;
    cursor: pointer
}

.article-actions {
    border-top: 1px solid var(--line);
    margin-top: 34px;
    padding-top: 22px
}

.article-quiz {
    border-top: 1px solid var(--line);
    margin-top: 38px;
    padding-top: 30px
}

.quiz-heading { margin-bottom: 24px }
.quiz-heading h2 { margin: 4px 0 8px }
.quiz-kicker { color: var(--primary); font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase }
.quiz-question { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 16px; min-width: 0; padding: 18px }
.quiz-question legend { font-weight: 700; line-height: 1.5; max-width: 100%; overflow-wrap: anywhere; padding: 0 5px }
.quiz-question legend span { align-items: center; background: var(--primary); border-radius: 50%; color: #fff; display: inline-flex; font-size: .8rem; height: 25px; justify-content: center; margin-right: 9px; width: 25px }
.quiz-option { align-items: flex-start; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; margin-top: 9px; padding: 10px; transition: background .15s, border-color .15s }
.quiz-option:hover { background: #f3f6ff }
.quiz-option input { accent-color: var(--primary); margin-top: 3px }
.quiz-option > span { min-width: 0; overflow-wrap: anywhere }
.quiz-option.is-correct { background: #eaf8ef; color: #156b38 }
.quiz-option.is-incorrect { background: #fff0f0; color: #a12828 }
.quiz-explanation { color: var(--muted); font-size: .92rem; margin: 12px 5px 0 }
.quiz-submit { background: var(--primary); border: 0; border-radius: 9px; color: #fff; cursor: pointer; font: inherit; font-weight: 700; padding: 12px 18px }
.quiz-submit:disabled { cursor: wait; opacity: .7 }
.quiz-result { background: #f1f5ff; border-radius: 10px; color: var(--dark); font-weight: 600; margin-top: 18px; padding: 14px }
.category-quiz-list { display: grid; gap: 22px }
.category-quiz-card { padding: clamp(20px, 4vw, 34px) }
.category-quiz-card h2 { margin: 5px 0 6px; font-size: 1.5rem }
.category-quiz-card > p { color: var(--muted); margin-top: 0 }
.category-quiz-start { display: inline-block; margin-top: 12px; text-decoration: none }
.category-test-list { border-top: 1px solid var(--line); display: grid; gap: 14px; margin-top: 22px; padding-top: 18px }
.category-test-item { align-items: center; display: flex; gap: 20px; justify-content: space-between }
.category-test-item h3 { font-size: 1.05rem; margin: 0 0 5px }
.category-test-item p { color: var(--muted); font-size: .92rem; margin: 0 }
.category-test-actions { align-items: center; display: flex; flex-shrink: 0; gap: 12px }
.category-test-actions .category-quiz-start { margin-top: 0 }
.quiz-score { color: #156b38; font-size: .9rem; font-weight: 700; white-space: nowrap }
.quiz-pending { background: #fff8e6; border-radius: 9px; color: #725400 !important; margin: 20px 0 0 !important; padding: 12px 14px }

/* Disciplinas e aulas */
.subject-list { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 24px }
.subject-card { display: flex; flex-direction: column; padding: 26px }
.subject-card h2 { font-size: 1.35rem; margin: 5px 0 8px }
.subject-card p { color: var(--muted); margin: 0 0 20px }
.subject-card .quiz-submit { align-self: flex-start; margin-top: auto; text-decoration: none }
.lesson-list { display: grid; gap: 14px; margin-top: 26px }
.lesson-card { align-items: center; display: flex; gap: 20px; justify-content: space-between; padding: 22px }
.lesson-card h2 { font-size: 1.12rem; margin: 0 0 4px }
.lesson-card p { color: var(--muted); font-size: .9rem; margin: 0 }
.lesson-card-meta { align-items: center; display: flex; flex-shrink: 0; gap: 14px }
.lesson-card-score { color: #156b38; font-size: .85rem; font-weight: 800; white-space: nowrap }
.lesson-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 290px }
.lesson-content { min-width: 0; padding: clamp(22px, 4vw, 40px) }
.lesson-content h2 { font-size: 1.45rem; margin: 30px 0 10px }
.lesson-content p, .lesson-content li { color: #38465b }
.lesson-content pre { background: #121a2a; border-radius: 10px; color: #e4ecff; overflow-x: auto; padding: 18px }
.lesson-content code { font-family: Consolas, monospace }
.course-lesson-figure { margin: 24px 0 28px }
.course-lesson-cover { aspect-ratio: 40 / 21; border-radius: 12px; display: block; height: auto; object-fit: cover; width: 100% }
.course-lesson-figure figcaption { color: var(--muted); font-size: .78rem; margin-top: 7px }
.course-level { background: #eef4ff; border-left: 4px solid var(--primary); border-radius: 6px; padding: 12px 14px }
.course-challenge { background: #f7f9fc; border: 1px solid var(--border); border-radius: 10px; margin-top: 28px; padding: 2px 20px 20px }
.lesson-video { aspect-ratio: 16 / 9; border: 0; border-radius: 11px; display: block; margin: 24px 0; width: 100% }
.lesson-side { align-self: start; padding: 22px }
.lesson-side h2 { font-size: 1.05rem; margin: 0 0 12px }
.lesson-side ol { margin: 0; padding-left: 20px }
.lesson-side li { color: var(--muted); font-size: .88rem; margin: 8px 0 }
.lesson-side a { color: var(--text) }
.lesson-side .is-current a { color: var(--primary); font-weight: 800 }
.lesson-quiz { margin-top: 30px; padding: clamp(22px, 4vw, 34px) }
@media (max-width: 800px) { .subject-list { grid-template-columns: 1fr } .lesson-layout { grid-template-columns: 1fr } .lesson-side { order: -1 } }
@media (max-width: 560px) { .lesson-card { align-items: flex-start; flex-direction: column } .lesson-card-meta { align-items: flex-start; flex-direction: column; gap: 9px } }

/* Área de usuário */
.auth-layout { align-items: center; display: grid; gap: clamp(28px, 7vw, 94px); grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); min-height: 560px }
.auth-intro { max-width: 550px }
.auth-intro > p { color: var(--muted); font-size: 1.02rem; margin: 0 0 22px }
.auth-benefits { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0 }
.auth-benefits li { color: #465168; font-size: .93rem }
.auth-benefits li::before { color: var(--primary); content: '✓'; font-weight: 800; margin-right: 10px }
.auth-outline-link { border-bottom: 1px solid #cbc8ff; color: var(--primary); display: inline-flex; font-size: .92rem; font-weight: 700; gap: 8px; padding-bottom: 4px }
.auth-card { padding: clamp(24px, 4vw, 38px) }
.auth-card h2 { font-size: 1.6rem; letter-spacing: -.4px; line-height: 1.25; margin: 4px 0 6px }
.auth-eyebrow { color: var(--primary); font-size: .73rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase }
.auth-card-description { color: var(--muted); font-size: .92rem; margin: 0 0 24px }
.auth-form { display: grid; gap: 8px }
.auth-form label { color: #3f4a5e; font-size: .88rem; font-weight: 700; margin-top: 8px }
.auth-form input { background: #fff; border: 1px solid #dce2ec; border-radius: 9px; color: var(--text); font: inherit; outline: none; padding: 11px 12px; transition: border-color .15s, box-shadow .15s }
.auth-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 91, 255, .12) }
.auth-form small { color: var(--muted); font-size: .76rem; margin-top: -2px }
.auth-submit { margin-top: 16px; width: 100% }
.form-error { background: #fff1f1; border: 1px solid #ffd2d2; border-radius: 9px; color: #a12828; font-size: .88rem; margin: 0 0 18px; padding: 10px 12px }
.auth-switch { border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; margin: 24px 0 0; padding-top: 20px; text-align: center }
.auth-switch a { color: var(--primary); font-weight: 700 }
.social-login-disabled { color: var(--muted); font-size: .78rem; margin: 18px 0 0; text-align: center }

.dashboard { display: grid; gap: 22px }
.dashboard-hero { align-items: center; background: linear-gradient(120deg, #171f35, #29245b 70%, #5148b8); color: #fff; display: flex; justify-content: space-between; padding: clamp(24px, 4vw, 36px) }
.dashboard-hero .page-title { margin-bottom: 8px }
.dashboard-hero p { color: #d5d9e8; margin: 0 }
.dashboard-logout { border: 1px solid rgba(255, 255, 255, .35); border-radius: 9px; color: #fff; font-size: .85rem; font-weight: 700; padding: 9px 13px; white-space: nowrap }
.dashboard-logout:hover { background: rgba(255, 255, 255, .1); color: #fff }
.dashboard-stats { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)) }
.dashboard-stat { padding: 20px 22px }
.dashboard-stat span { color: var(--muted); display: block; font-size: .8rem; font-weight: 600 }
.dashboard-stat strong { display: block; font-size: 1.75rem; letter-spacing: -.7px; line-height: 1.2; margin-top: 4px }
.dashboard-grid { display: grid; gap: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)) }
.dashboard-section { min-width: 0; padding: 26px }
.dashboard-section-heading { align-items: flex-start; display: flex; gap: 15px; justify-content: space-between; margin-bottom: 20px }
.dashboard-section-heading h2 { font-size: 1.25rem; line-height: 1.3; margin: 2px 0 0 }
.dashboard-section-heading > a { color: var(--primary); font-size: .82rem; font-weight: 700; padding-top: 4px; white-space: nowrap }
.dashboard-list { border-top: 1px solid var(--line) }
.dashboard-list-item { align-items: center; border-bottom: 1px solid var(--line); color: var(--text); display: flex; gap: 16px; justify-content: space-between; padding: 15px 0 }
.dashboard-list-item h3 { font-size: .91rem; line-height: 1.4; margin: 0 }
.dashboard-list-item p { color: var(--muted); font-size: .76rem; margin: 3px 0 0 }
.attempt-score { align-items: flex-end; display: flex; flex-direction: column; flex-shrink: 0 }
.attempt-score strong { font-size: .9rem }
.attempt-score span { color: var(--primary); font-size: .78rem; font-weight: 800 }
.read-item:hover h3 { color: var(--primary) }
.read-item > span { color: var(--primary); font-size: 1.15rem; font-weight: 700 }
.dashboard-empty { background: #f7f8fc; border: 1px dashed #d6dcea; border-radius: 10px; color: var(--muted); padding: 22px }
.dashboard-empty p { font-size: .88rem; margin: 0 0 15px }
.dashboard-empty .quiz-submit { display: inline-block; font-size: .84rem; padding: 9px 13px }

/* Comentários dos artigos */
.article-comments { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 28px }
.comments-heading { align-items: center; display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px }
.comments-heading h2 { color: var(--text); font-size: 1.35rem; margin: 3px 0 0 }
.comments-count { color: var(--muted); font-size: .83rem; white-space: nowrap }
.comment-form { background: #fafbff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 25px; padding: 15px }
.comment-toolbar { border: 0 !important; border-bottom: 1px solid var(--line) !important; padding: 0 0 8px !important }
.comment-toolbar .ql-emoji { color: #49566a; font-size: 1rem; width: 30px }
.comment-editor { background: #fff; min-height: 130px }
.comment-editor .ql-editor { font-family: inherit; font-size: .95rem; min-height: 130px }
.comment-form-footer { align-items: center; color: var(--muted); display: flex; font-size: .78rem; gap: 15px; justify-content: space-between; margin-top: 12px }
.comment-form-footer .quiz-submit { font-size: .84rem; padding: 9px 14px }
.comment-feedback { color: var(--primary); font-size: .82rem; margin: 8px 0 0 }
.comment-login-note, .comments-empty { background: #f7f8fc; border: 1px dashed #d6dcea; border-radius: 9px; color: var(--muted); font-size: .9rem; padding: 15px }
.comment-login-note a { color: var(--primary); font-weight: 700 }
.comment-list { border-top: 1px solid var(--line) }
.comment-item { border-bottom: 1px solid var(--line); padding: 20px 0 16px }
.comment-meta { align-items: baseline; display: flex; gap: 10px }
.comment-meta strong { color: var(--text); font-size: .92rem }
.comment-meta time { color: var(--muted); font-size: .76rem }
.comment-body { color: #38465b; font-size: .94rem; line-height: 1.7; margin-top: 8px; overflow-wrap: anywhere }
.comment-body p { margin: 7px 0 }
.comment-body ul, .comment-body ol { margin: 7px 0; padding-left: 24px }
.comment-body a { color: var(--primary); text-decoration: underline }
.comment-report { color: var(--muted); font-size: .76rem; margin-top: 10px }
.comment-report summary { cursor: pointer; display: inline-block }
.comment-report form { background: #fafbff; border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 7px; margin-top: 8px; max-width: 440px; padding: 11px }
.comment-report label { display: grid; gap: 3px }
.comment-report select, .comment-report textarea { border: 1px solid #dce2ec; border-radius: 6px; font: inherit; font-size: .8rem; padding: 6px }
.comment-report textarea { min-height: 55px; resize: vertical }
.comment-report-submit { background: var(--primary); border: 0; border-radius: 6px; color: #fff; cursor: pointer; font: inherit; font-size: .78rem; justify-self: start; padding: 7px 10px }
.comment-pagination { display: flex; gap: 7px; justify-content: center; margin-top: 22px }
.comment-pagination a { border: 1px solid var(--line); border-radius: 7px; color: var(--primary); font-size: .82rem; min-width: 30px; padding: 4px 8px; text-align: center }
.comment-pagination a.is-current { background: var(--primary); color: #fff }
@media (max-width: 560px) { .comments-heading, .comment-form-footer { align-items: flex-start; flex-direction: column; } .comment-form-footer .quiz-submit { align-self: flex-end; } }

@media (max-width: 800px) {
    .auth-layout, .dashboard-grid { grid-template-columns: 1fr }
    .auth-layout { min-height: 0 }
    .auth-intro { max-width: 680px }
}

@media (max-width: 560px) {
    .dashboard-hero { align-items: flex-start; flex-direction: column; gap: 18px }
    .dashboard-stats { grid-template-columns: 1fr }
    .dashboard-section { padding: 20px }
    .dashboard-section-heading { flex-direction: column; gap: 6px }
}

.rating-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.rating-buttons button {
    border: 1px solid var(--line);
    background: #fff;
    padding: 9px 14px;
    border-radius: 9px;
    cursor: pointer
}

.rating-buttons button:hover {
    border-color: var(--primary)
}

.site-footer {
    background: var(--dark);
    color: #aeb8ca;
    padding: 34px 0
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap
}

.footer-inner strong {
    color: #fff
}

.footer-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: .85rem
}

.footer-copy {
    font-size: .8rem;
    margin: 8px 0 0;
    color: #8490a5
}

@media (max-width: 850px) {
    .content-layout {
        grid-template-columns:1fr
    }

    .sidebar {
        display: grid;
        grid-template-columns:repeat(2, minmax(0, 1fr))
    }
}

@media (max-width: 620px) {
    .container {
        width: min(100% - 28px, 1160px)
    }

    .header-top {
        min-height: 68px
    }

    .menu-toggle {
        display: inline-block
    }

    .main-nav {
        display: none;
        flex-direction: column;
        padding: 0 0 15px
    }

    .main-nav.is-open {
        display: flex
    }

    .main-nav a {
        padding: 10px
    }

    .user-nav {
        align-items: stretch;
        flex-direction: column;
        gap: 7px;
        margin-left: 0
    }

    .page-wrap {
        padding: 24px 0 45px
    }

    .sidebar {
        grid-template-columns:1fr
    }

    .article-content {
        padding: 22px 18px
    }
}

/* Acessibilidade, navegação por teclado e estabilidade visual. */
html {
    scroll-padding-top: 24px;
}

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-width: 320px;
}

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

main {
    min-height: 55vh;
}

.skip-link {
    background: #202b3c;
    border-radius: 0 0 8px 8px;
    color: #fff;
    font-weight: 700;
    left: 16px;
    padding: 10px 16px;
    position: fixed;
    top: 0;
    transform: translateY(-120%);
    transition: transform .15s ease;
    z-index: 10000;
}

.skip-link:focus {
    color: #fff;
    transform: translateY(0);
}

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid #8b7cff;
    outline-offset: 3px;
}

.visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.logout-form {
    display: inline-flex;
    margin: 0;
}

.dashboard-logout-form {
    margin: 0;
}

button.dashboard-logout {
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.main-nav .user-nav-logout {
    background: transparent;
    border: 1px solid #dce3ed;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: .84rem;
    font-weight: 600;
    min-height: 38px;
    padding: 8px 13px;
}

.main-nav .user-nav-logout:hover {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.not-found-panel {
    margin: 0 auto;
    max-width: 760px;
    text-align: center;
}

.not-found-search {
    margin: 24px auto;
    max-width: 520px;
}

.not-found-search button {
    min-width: 96px;
}

.legal-layout {
    max-width: 900px;
}

.legal-content h2 {
    margin-top: 32px;
}

@media (max-width: 620px) {
    .main-nav .logout-form,
    .main-nav .user-nav-logout {
        width: 100%;
    }

    .main-nav .user-nav-logout {
        min-height: 44px;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* Correções e complementos */
.hero-panel {
    padding: 36px;
    margin-bottom: 28px;
    background: linear-gradient(120deg, #171f35, #29245b 70%, #5148b8);
    color: #fff
}

.hero-category-label {
    color: #c4c0ff
}

.hero-description {
    color: #d5d9e8;
    max-width: 700px
}

.state-panel {
    padding: 32px
}

.empty-category-panel {
    padding: 24px;
    margin-top: 24px
}

.article-body {
    overflow-wrap: anywhere
}

.article-body h2 {
    font-size: 1.55rem;
    line-height: 1.35;
    margin: 34px 0 12px
}

.article-body h3 {
    font-size: 1.18rem;
    margin: 26px 0 9px
}

.article-body p {
    margin: 0 0 17px
}

.article-body ul, .article-body ol {
    padding-left: 24px
}

.article-body li {
    margin: 7px 0
}

.article-body table {
    border-collapse: collapse;
    width: 100%;
    display: block;
    overflow-x: auto;
    margin: 18px 0
}

.article-body th, .article-body td {
    border: 1px solid var(--line);
    padding: 11px;
    text-align: left;
    min-width: 140px
}

.article-body th {
    background: #f0f2f8
}

.article-body pre {
    position: relative;
    background: #111827;
    color: #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    overflow-x: auto;
    font-size: .85rem;
    line-height: 1.6
}

.article-body pre .copy-code-button {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 1px solid #59657a;
    border-radius: 7px;
    background: #1f2937;
    color: #fff;
    padding: 6px 9px;
    font: inherit;
    font-size: .75rem;
    cursor: pointer
}

.article-body pre .copy-code-button:hover {
    background: #374151
}

.share-actions {
    border-top: 1px solid var(--line);
    margin-top: 34px;
    padding-top: 22px
}

.article-reader-actions {
    margin-top: 26px
}

.article-reader {
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 9px 14px
}

.article-reader[aria-pressed="true"] {
    border-color: var(--primary);
    color: var(--primary)
}

.reader-feedback { min-height: 1.3em; margin: 8px 0 0; font-size: .88rem }

.share-actions h2 {
    font-size: 1.1rem;
    margin: 0 0 12px
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px
}

.share-button {
    border: 0;
    border-radius: 9px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    min-width: 34px;
    text-decoration: none;
    font-size: 18px;
    padding: 5px;
}

/* Aumentar ícones de compartilhamento */
.share-buttons {
    gap: 14px;
}

/* Ajuste proporcional dos ícones */
.share-buttons .share-button svg {
    width: 36px !important;
    height: 36px !important;
    max-width: none !important;
    max-height: none !important;
}

.share-facebook,
.share-instagram,
.share-print {
    font-size: 18px !important;
    line-height: 1 !important;
}

/* Tamanho dos demais ícones */
.share-facebook,
.share-instagram,
.share-print {
    font-size: 14px !important;
    line-height: 1;
}

.share-whatsapp { background: #25d366 }
.share-facebook { background: #1877f2 }
.share-instagram { background: #c13584 }
.share-print { background: #4b5563 }
.share-feedback { min-height: 1.3em; margin: 10px 0 0; font-size: .88rem }

@media print {
    .site-header,
    .sidebar,
    .site-footer,
    .article-reader-actions,
    .share-actions,
    .article-actions,
    .copy-code-button {
        display: none !important
    }

    .page-wrap,
    .container,
    .content-layout,
    .article-content {
        display: block;
        max-width: none;
        padding: 0
    }
}

.article-body code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace
}

.article-body :not(pre) > code {
    background: #eef0f7;
    padding: 2px 5px;
    border-radius: 5px
}

/* Card inteiro clicável */
.post-card {
    position: relative;
    cursor: pointer;
}

/* Link do título cobre todo o card */
.post-card .post-title-link {
    color: inherit;
    text-decoration: none;
}

.post-card .post-title-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Categoria permanece independente */
.post-card .category-link {
    position: relative;
    z-index: 2;
    align-self: flex-start;
    display: inline-block;
    text-decoration: none;
}

/* Hover */
.post-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    transition: .2s ease;
}

.post-card:hover h2 {
    color: var(--primary);
}

@media (max-width: 620px) {
    .hero-panel {
        padding: 24px 20px
    }
}

/* ========================================
   MAIS POPULARES - GRID 3 COLUNAS
======================================== */

.mais-populares-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.mais-populares-grid .card-mais-popular {
    width: 100%;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
}

.mais-populares-grid .card-destaque {
    width: 100%;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
}

/* Tablets */
@media (max-width: 900px) {
    .mais-populares-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* ========================================
   MAIS POPULARES
======================================== */

.mais-populares-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 24px;
    align-items: stretch;
}

/* CARD DESTAQUE - HORIZONTAL */
.mais-populares-grid .card-destaque {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    min-height: 280px;
    height: auto;
    padding: 0;
    overflow: hidden;
}

/* IMAGEM À ESQUERDA */
.card-destaque .destaque-imagem {
    flex: 0 0 40%;
    min-width: 0;
    overflow: hidden;
}

.card-destaque .destaque-imagem img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 280px;
    object-fit: cover;
}

/* CONTEÚDO À DIREITA */
.card-destaque .destaque-conteudo {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
}

.card-destaque .destaque-conteudo h2 {
    font-size: 1.5rem;
    line-height: 1.35;
    margin: 12px 0;
}

.card-destaque .destaque-conteudo p {
    color: var(--muted);
    margin-bottom: 18px;
}

.card-destaque .destaque-leia-mais {
    color: var(--primary);
    font-weight: 700;
}

/* DEMAIS CARDS */
.mais-populares-grid .card-mais-popular {
    width: 100%;
    min-width: 0;
    height: 100%;
}

/* TABLETS */
@media (max-width: 900px) {
    .mais-populares-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* CELULARES */
@media (max-width: 600px) {
    .mais-populares-grid {
        grid-template-columns: 1fr;
    }

    .mais-populares-grid .card-destaque {
        flex-direction: column;
    }

    .card-destaque .destaque-imagem {
        flex: none;
        width: 100%;
    }

    .card-destaque .destaque-imagem img {
        height: 210px;
        min-height: 210px;
    }

    .card-destaque .destaque-conteudo {
        padding: 22px;
    }
}


/* Celulares */
@media (max-width: 600px) {
    .mais-populares-grid {
        grid-template-columns: 1fr;
    }
}

/* Aumenta a largura somente na página do artigo */
.container:has(.article-content) {
    width: min(1400px, calc(100% - 40px));
}

/* Ajusta a coluna do artigo e mantém a barra lateral */
.content-layout:has(.article-content) {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
}

/* Responsividade */
@media (max-width: 850px) {
    .content-layout:has(.article-content) {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .container:has(.article-content) {
        width: calc(100% - 28px);
    }
}

/* CARD DESTAQUE - HORIZONTAL */
.mais-populares-grid .card-destaque {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    min-height: 280px;
    height: auto;
    padding: 0;
    overflow: hidden;
}

/* IMAGEM À ESQUERDA */
.card-destaque .destaque-imagem {
    flex: 0 0 40%;
    min-width: 0;
    overflow: hidden;
}

.card-destaque .destaque-imagem img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 280px;
    object-fit: cover;
}

/* CONTEÚDO À DIREITA */
.card-destaque .destaque-conteudo {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
}

.card-destaque .destaque-conteudo h2 {
    font-size: 1.5rem;
    line-height: 1.35;
    margin: 12px 0;
}

.card-destaque .destaque-conteudo p {
    color: var(--muted);
    margin-bottom: 18px;
}

.card-destaque .destaque-leia-mais {
    color: var(--primary);
    font-weight: 700;
}

/* DEMAIS CARDS */
.mais-populares-grid .card-mais-popular {
    width: 100%;
    min-width: 0;
    height: 100%;
}

/* TABLETS */
@media (max-width: 900px) {
    .mais-populares-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* CELULARES */
@media (max-width: 600px) {
    .mais-populares-grid {
        grid-template-columns: 1fr;
    }

    .mais-populares-grid .card-destaque {
        flex-direction: column;
    }

    .card-destaque .destaque-imagem {
        flex: none;
        width: 100%;
    }

    .card-destaque .destaque-imagem img {
        height: 210px;
        min-height: 210px;
    }

    .card-destaque .destaque-conteudo {
        padding: 22px;
    }
}


/* Celulares */
@media (max-width: 600px) {
    .mais-populares-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   LARGURA E LAYOUT DA PÁGINA DO ARTIGO
======================================== */

/* Aumenta a largura somente quando o container contém um artigo */
.container:has(.article-content) {
    width: min(1400px, calc(100% - 40px));
}

/* O artigo ocupa toda a largura disponível.
   Não reserva uma coluna lateral vazia. */
.content-layout:has(> .article-content) {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

/* Responsividade da página do artigo */
@media (max-width: 620px) {
    .container:has(.article-content) {
        width: calc(100% - 28px);
    }
}

.share-facebook span {
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
}

.share-instagram span {
    font-size: 22px;
    line-height: 1;
}

.share-print span {
    font-size: 22px;
    line-height: 1;
}

/* Redesign editorial NerdTools: camada visual sem alterar a aplicação. */
:root {
    --bg: #f3f6fa;
    --surface: #fff;
    --text: #17233b;
    --muted: #627087;
    --line: #dfe6f0;
    --primary: #6d4aff;
    --dark: #0b1730;
    --radius: 14px;
    --shadow: 0 12px 30px rgba(17, 37, 70, .08);
}

body { background: radial-gradient(circle at top right, #e9edff 0, transparent 31rem), var(--bg); }
a { transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid rgba(109, 74, 255, .32); outline-offset: 3px; }
.container { width: min(1220px, calc(100% - 48px)); }

/* Cabeçalho e navegação */
.site-header { background: linear-gradient(115deg, #091329, #132548 62%, #1a2450); border-bottom: 1px solid rgba(255,255,255,.08); box-shadow: 0 5px 18px rgba(4,13,31,.14); }
.header-top { min-height: 80px; }
.brand { font-size: 1.4rem; }
.brand-mark { background: linear-gradient(135deg, #7b5cff, #4e31d5); box-shadow: 0 8px 20px rgba(109,74,255,.36); }
.main-nav { align-items: center; border-top: 1px solid rgba(255,255,255,.09); gap: 4px; padding: 10px 0; }
.main-nav a { color: #c9d4e8; font-size: .82rem; font-weight: 600; padding: 9px 12px; }
.main-nav > a:hover, .main-nav > a.active { background: rgba(255,255,255,.1); color: #fff; }
.main-nav .user-nav { border-left: 1px solid rgba(255,255,255,.15); gap: 8px; padding-left: 12px; }
.main-nav .user-nav a { border-radius: 8px; padding: 8px 13px; }
.main-nav .user-nav-profile, .main-nav .user-nav-login { box-shadow: 0 5px 13px rgba(88,56,219,.3); }

/* Estrutura editorial, cartões e listas */
.page-wrap { padding: 48px 0 76px; }
.breadcrumb { background: rgba(255,255,255,.72); border: 1px solid rgba(223,230,240,.9); border-radius: 8px; margin-bottom: 16px; padding: 7px 11px; }
.breadcrumb a { color: #4958b8; font-weight: 700; }
.page-title { color: #10203b; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -1.45px; }
.page-description { font-size: 1.03rem; line-height: 1.75; }
.article-content, .panel, .post-card, .side-card { border-color: rgba(217,225,237,.95); box-shadow: var(--shadow); }
.panel, .side-card { background: rgba(255,255,255,.94); }
.hero-panel { background: linear-gradient(120deg, #0b1832, #1a2d57 60%, #4933ad); border: 0; box-shadow: 0 18px 34px rgba(13,27,55,.19); overflow: hidden; padding: clamp(28px,5vw,52px); position: relative; }
.hero-panel::after { background: rgba(162,147,255,.22); border-radius: 50%; content: ''; height: 260px; position: absolute; right: -95px; top: -135px; width: 260px; }
.hero-panel > * { position: relative; z-index: 1; }
.category-label { color: #593cd7; letter-spacing: .1em; }
.hero-category-label { color: #cfc7ff; }
.post-list, .mais-populares-grid { gap: 18px; }
.post-card { background: #fff; border-radius: 12px; padding: 25px; }
.post-card:hover { border-color: #9a8aff; box-shadow: 0 17px 32px rgba(45,52,105,.13); transform: translateY(-4px); }
.post-card h2, .post-card h3 { color: #14233f; font-size: 1.2rem; }
.post-card p { line-height: 1.65; }
.mais-populares-grid .card-destaque { border-radius: 14px; box-shadow: 0 18px 36px rgba(17,37,70,.12); }
.card-destaque .destaque-imagem { flex-basis: 44%; }
.card-destaque .destaque-conteudo { padding: clamp(26px,4vw,46px); }
.card-destaque .destaque-conteudo h2 { color: #10203b; font-size: clamp(1.45rem,2.8vw,2rem); }
.card-destaque .destaque-leia-mais { align-self: flex-start; background: #f0edff; border-radius: 7px; padding: 8px 12px; }
.side-card { border-radius: 12px; padding: 24px; }
.side-card h3 { color: #182642; font-size: 1.05rem; }
.side-list a { color: #53627b; font-weight: 600; }
.search-form input { border-color: #ccd6e5; border-radius: 8px; padding: 12px; }
.search-form button, .quiz-submit { background: linear-gradient(135deg, #7351ff, #593ad9); box-shadow: 0 8px 16px rgba(91,58,217,.2); }
.search-form button:hover, .quiz-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* Página de artigo: leitura confortável e ações claras */
.article-content { border-radius: 16px; box-shadow: 0 16px 38px rgba(17,37,70,.09); padding: clamp(26px,5vw,58px); }
.container:has(.article-content) { width: min(1080px, calc(100% - 48px)); }
.article-content > img { border-radius: 12px; display: block; height: auto; margin: 6px 0 34px; max-width: 100%; object-fit: cover; width: 100%; }
.article-meta { align-items: center; border-bottom: 1px solid var(--line); gap: 12px 18px; margin: 20px 0 24px; padding-bottom: 20px; }
.article-body { color: #25344e; font-size: 1.03rem; line-height: 1.82; }
.article-body h2 { color: #132542; font-size: clamp(1.45rem,2.4vw,1.85rem); margin-top: 42px; }
.article-body h3 { color: #1b2c49; }
.article-body blockquote { border-left: 4px solid var(--primary); color: #4f5d73; margin: 24px 0; padding: 5px 0 5px 20px; }
.article-body pre { border: 1px solid #243452; box-shadow: 0 11px 24px rgba(11,23,48,.18); }
.article-reader { background: #f8f7ff; border-color: #d9d2ff; border-radius: 8px; color: #4d32c2; }
.article-reader:hover, .article-reader[aria-pressed="true"] { background: #eeeaff; border-color: var(--primary); }
.share-actions, .article-actions, .article-quiz { border-top-color: #dce4ef; margin-top: 40px; padding-top: 28px; }
.share-actions h2, .article-actions h3 { color: #192a48; }
.share-button { border-radius: 10px; box-shadow: 0 6px 12px rgba(18,31,56,.16); min-height: 42px; min-width: 42px; transition: transform .18s ease, filter .18s ease; }
.share-button:hover { color: #fff; filter: brightness(1.07); transform: translateY(-3px); }
.rating-buttons button { background: #fff; border-color: #d6dfeb; border-radius: 8px; color: #263650; font: inherit; font-weight: 700; padding: 10px 16px; }
.rating-buttons button:hover { background: #f4f1ff; border-color: var(--primary); color: #5437d3; }
.article-quiz-login { background: #f8f7ff; border-color: #ddd6ff; box-shadow: none; margin-top: 38px; padding: 22px; }

/* Rodapé */
.site-footer { background: linear-gradient(120deg, #081226, #101f3c); border-top: 3px solid #6041e5; padding: 48px 0; }
.footer-inner { align-items: flex-start; }
.footer-inner strong { font-size: 1.15rem; }
.footer-copy { max-width: 440px; }
.footer-links { gap: 10px 20px; }
.footer-links a { color: #c8d3e7; font-weight: 600; }
.footer-links a:hover { color: #bdb0ff; }

@media (max-width: 620px) {
    .container { width: min(100% - 28px, 1220px); }
    .page-wrap { padding: 28px 0 52px; }
    .main-nav { border-top: 1px solid rgba(255,255,255,.09); padding-top: 8px; }
    .main-nav .user-nav { border-left: 0; border-top: 1px solid rgba(255,255,255,.13); margin-top: 5px; padding: 10px 0 0; }
    .article-content { border-radius: 12px; padding: 24px 18px; }
    .article-body { font-size: 1rem; line-height: 1.76; }
    .card-destaque .destaque-conteudo { padding: 24px 20px; }
    .share-buttons { gap: 10px; }
    .share-button { min-height: 40px; min-width: 40px; }
    .site-footer { padding: 38px 0; }
}

/* Tema editorial claro: substitui a camada escura anterior. */
:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #202b3c;
    --muted: #64748b;
    --line: #e8edf3;
    --primary: #635bdb;
    --dark: #202b3c;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(32, 43, 60, .035);
}

body { background: #f9fbfd; }
.container { width: min(1180px, calc(100% - 48px)); }

/* Navegação clara, compacta e integrada ao conteúdo. */
.site-header { background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--line); box-shadow: none; color: var(--text); }
.header-top { min-height: 70px; }
.brand { color: #202b3c; font-size: 1.28rem; }
.brand span:last-child { color: #334155; }
.brand-mark { background: #635bdb; border-radius: 9px; box-shadow: none; height: 34px; width: 34px; }
.main-nav { border-top: 1px solid #f1f4f8; gap: 2px; padding: 8px 0; }
.main-nav a { color: #526176; font-size: .84rem; font-weight: 500; padding: 8px 10px; }
.main-nav > a:hover, .main-nav > a.active { background: #f3f1ff; color: #554cc3; }
.main-nav .user-nav { border-left-color: #e8edf3; padding-left: 10px; }
.main-nav .user-nav a { border-color: #dce3ed; font-weight: 600; }
.main-nav .user-nav-profile, .main-nav .user-nav-login { background: #635bdb; border-color: #635bdb; box-shadow: none; color: #fff; }
.main-nav .user-nav-logout { color: #64748b; }
.menu-toggle { background: #fff; border-color: #dce3ed; color: #334155; }

/* Estrutura e hierarquia editorial. */
.page-wrap { padding: 42px 0 68px; }
.breadcrumb { background: transparent; border: 0; border-radius: 0; font-size: .78rem; margin-bottom: 15px; padding: 0; }
.breadcrumb a { color: #635bdb; font-weight: 600; }
.page-title { color: #202b3c; font-size: clamp(2rem, 3.7vw, 2.7rem); letter-spacing: -1.15px; }
.page-description { color: #64748b; max-width: 720px; }
.article-content, .panel, .post-card, .side-card { border-color: var(--line); box-shadow: var(--shadow); }
.panel, .side-card { background: #fff; }
.hero-panel { background: #f1f5f9; border: 1px solid #e8edf3; box-shadow: none; color: #202b3c; padding: clamp(28px, 4vw, 44px); }
.hero-panel::after { display: none; }
.hero-panel h1 { color: #202b3c; }
.hero-description, .dashboard-hero p { color: #64748b; }
.hero-category-label { color: #635bdb; }
.category-label { color: #635bdb; font-size: .72rem; }

/* Home, categorias e sidebar. */
.content-layout { gap: 34px; }
.post-list, .mais-populares-grid { gap: 16px; }
.post-card { border-radius: 10px; padding: 23px; }
.post-card:hover { border-color: #d8d2ff; box-shadow: 0 7px 18px rgba(37, 48, 75, .065); transform: translateY(-2px); }
.post-card h2, .post-card h3 { color: #25324a; font-size: 1.13rem; }
.post-card p { color: #64748b; }
.mais-populares-grid .card-destaque { box-shadow: none; }
.card-destaque .destaque-imagem { flex-basis: 42%; }
.card-destaque .destaque-conteudo { padding: clamp(25px, 4vw, 40px); }
.card-destaque .destaque-conteudo h2 { color: #202b3c; font-size: clamp(1.4rem, 2.5vw, 1.8rem); }
.card-destaque .destaque-leia-mais { background: transparent; color: #635bdb; padding: 5px 0; }
.side-card { border-radius: 10px; box-shadow: none; padding: 21px; }
.side-card h3 { color: #334155; font-size: 1rem; }
.side-list a { color: #64748b; font-size: .86rem; font-weight: 500; }
.side-list li + li { border-top-color: #edf1f5; }
.search-form input { background: #fff; border-color: #e1e7ef; }
.search-form button { background: #635bdb; box-shadow: none; }

/* Página de leitura. */
.container:has(.article-content) { width: min(1180px, calc(100% - 48px)); }
.article-content { background: #fff; border-radius: 12px; box-shadow: none; padding: clamp(26px, 5vw, 54px); }
.article-content > img { border-radius: 9px; margin-bottom: 32px; }
.article-meta { border-bottom-color: #edf1f5; color: #718096; font-size: .81rem; padding-bottom: 18px; }
.article-body { color: #3d4b60; font-size: 1.02rem; line-height: 1.86; }
.article-body h2 { color: #25324a; font-size: clamp(1.4rem, 2.4vw, 1.75rem); }
.article-body h3 { color: #334155; }
.article-body blockquote { background: #faf9ff; border-left-color: #635bdb; color: #59677c; }
.article-body pre { background: #202b3c; border-color: #202b3c; box-shadow: none; }
.article-reader { background: #fff; border-color: #ddd8fb; color: #574fc2; }
.article-reader:hover, .article-reader[aria-pressed="true"] { background: #f5f3ff; }

/* Ações discretas e consistentes. */
.share-actions, .article-actions, .article-quiz { border-top-color: #edf1f5; margin-top: 36px; padding-top: 25px; }
.share-actions h2, .article-actions h3 { color: #334155; font-size: 1.05rem; }
.share-button { border-radius: 8px; box-shadow: none; min-height: 38px; min-width: 38px; }
.share-button:hover { box-shadow: none; transform: translateY(-1px); }
.rating-buttons button { border-color: #dfe6ef; box-shadow: none; color: #526176; }
.rating-buttons button:hover { background: #f7f6ff; border-color: #cfc8ff; color: #574fc2; }
.quiz-submit { background: #635bdb; box-shadow: none; }
.article-quiz-login { background: #faf9ff; border-color: #e4e0ff; }

/* Rodapé claro e de baixo contraste. */
.site-footer { background: #f1f5f9; border-top: 1px solid #e2e8f0; color: #64748b; padding: 40px 0; }
.footer-inner strong { color: #334155; }
.footer-copy { color: #718096; }
.footer-links a { color: #526176; font-weight: 500; }
.footer-links a:hover { color: #635bdb; }

@media (max-width: 620px) {
    .container, .container:has(.article-content) { width: calc(100% - 28px); }
    .page-wrap { padding: 27px 0 48px; }
    .main-nav .user-nav { border-top-color: #e8edf3; }
    .article-content { border-radius: 10px; padding: 24px 18px; }
    .article-body { font-size: 1rem; line-height: 1.8; }
    .card-destaque .destaque-conteudo { padding: 22px 20px; }
    .category-test-item { align-items: flex-start; flex-direction: column; gap: 12px; }
    .category-test-actions { align-items: flex-start; flex-wrap: wrap; }
}

/* Portal editorial: componentes compartilhados e hierarquia de leitura. */
.community-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; margin-top: 24px; align-items: start; }
.community-form textarea { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid #bccbdc; border-radius: 9px; font: inherit; resize: vertical; }
.community-form input { min-width: 0; width: 100%; box-sizing: border-box; }
.community-form .quiz-submit { justify-self: start; margin-top: 12px; }
.community-aside p, .team-biography { line-height: 1.8; overflow-wrap: anywhere; }
.community-aside h3 { margin-top: 24px; }
.form-privacy { font-size: .9rem; color: #536277; margin: 16px 0; }
.community-success { padding: 14px; border-radius: 8px; background: #eaf7ee; color: #245b32; }
.community-error { padding: 14px; border-radius: 8px; background: #fff0ef; color: #952c26; }
.contact-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.team-profile { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 28px; margin-top: 24px; }
.team-monogram { display: grid; place-items: center; width: 100px; height: 100px; background: #e9f1fa; color: #245fa6; font-size: 2.8rem; border-radius: 24px; }
.team-links { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 28px; }
.push-settings-link { display: block; margin-top: 18px; padding-top: 16px; border-top: 1px solid #ccd7e3; font-weight: 600; }
@media (max-width: 760px) { .community-grid, .team-profile { grid-template-columns: minmax(0, 1fr); } }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.article-notifications { position: relative; }
.article-notifications summary { display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 7px 10px; border: 1px solid #bccbdc; border-radius: 8px; cursor: pointer; color: #245fa6; list-style: none; }
.article-notifications summary::-webkit-details-marker { display: none; }
.notification-count { min-width: 22px; padding: 0 5px; border-radius: 12px; background: #245fa6; color: #fff; font-size: .78rem; text-align: center; }
.notification-panel { position: absolute; z-index: 30; top: calc(100% + 10px); right: 0; width: min(380px, calc(100vw - 100px)); max-height: min(70vh, 650px); overflow: auto; padding: 20px; background: #fff; color: #172033; border: 1px solid #ccd7e3; border-radius: 12px; box-shadow: 0 8px 28px rgba(24,39,75,.15); }
.notification-panel h2 { font-size: 1.1rem; margin: 0; }
.notification-status { font-size: .88rem; color: #536277; }
.notification-list { list-style: none; margin: 14px 0; padding: 0; }
.notification-list a { display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; border-bottom: 1px solid #e6eaf0; overflow-wrap: anywhere; }
.notification-list a:hover { background: #edf4fb; }
.notification-unread { font-weight: 650; }
.notification-list small { color: #245fa6; font-weight: 600; }
.notification-mark-all, .notification-more, .history-clear { color: #245fa6; background: #fff; border: 1px solid #bccbdc; border-radius: 8px; padding: 8px 12px; min-height: 44px; cursor: pointer; }
.reading-history > section { margin-bottom: 24px; }
.reading-history .dashboard-section-heading { flex-wrap: wrap; }
.reading-history h3 { overflow-wrap: anywhere; }
@media (max-width: 620px) { .notification-label { display: none; } .header-top { gap: 12px; } }
:root { --primary: #245fa6; --muted: #536277; --border: var(--line); }
body { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
:focus-visible { outline: 3px solid #245fa6; outline-offset: 4px; }
.site-header { background: #fff; color: var(--text); border-bottom: 1px solid var(--line); }
.brand span:last-child, .brand span:last-child span { color: var(--text); }
.brand-mark, .quiz-submit, .search-form button { background: var(--primary); }
.main-nav a { color: #43526a; min-height: 44px; display: inline-flex; align-items: center; }
.main-nav > a:hover, .main-nav > a.active { color: #174d8a; background: #edf4fb; }
.main-nav .user-nav a { border-color: #cdd9e7; }
.main-nav .user-nav .user-nav-login, .main-nav .user-nav .user-nav-profile { background: var(--primary); color: #fff; }
.menu-toggle { color: #245fa6; border-color: #bccbdc; min-height: 44px; min-width: 44px; }
.category-label, .hero-category-label, .breadcrumb a, .footer-links a:hover { color: var(--primary); }
.home-hero { background: #eef4fa; margin-bottom: 24px; max-width: none; }
.hero-panel .hero-description { color: #43546a; opacity: 1; }
.home-hero .page-title { max-width: 850px; font-size: clamp(2rem, 4.5vw, 3.5rem); letter-spacing: -.045em; }
.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 22px; }
.secondary-link { color: #174d8a; font-weight: 650; text-decoration: underline; text-underline-offset: 4px; }
.discovery-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin: 0 0 42px; }
.discovery-card { padding: 24px; }
.discovery-card > span { color: var(--primary); font: 700 1.25rem ui-monospace, monospace; }
.discovery-card h2 { margin: 12px 0 5px; font-size: 1.2rem; }
.discovery-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.section-heading { margin: 28px 0 18px; font-size: 1.35rem; letter-spacing: -.025em; }
.editorial-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.editorial-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.editorial-card:hover { transform: none; border-color: #b6cbe2; }
.card-cover { display: block; aspect-ratio: 40/21; background: #e9eff6; overflow: hidden; }
.card-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-copy { padding: 24px; display: flex; flex: 1; flex-direction: column; }
.card-copy h2 { margin: 9px 0 12px; font-size: 1.2rem; }
.card-copy p { margin-bottom: 20px; }
.post-meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; font-size: .8rem; }
.featured-article .card-copy h2 { font-size: clamp(1.4rem,2.6vw,1.9rem); }
.sidebar { min-width: 0; }
.side-card h2 { font-size: 1.05rem; margin: 0 0 14px; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 28px; }
.pagination a { padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.article-page-layout { grid-template-columns: minmax(0,1fr) 255px; align-items: start; }
.article-body { max-width: 72ch; overflow-wrap: anywhere; }
.article-content > img { max-width: min(100%, 72ch); font-size: 1.02rem; }
.article-body figure { max-width: 100%; margin: 24px 0; }
.article-body a, .lesson-written-content a, .about-body a { color: #174d8a; text-decoration: underline; text-underline-offset: 3px; }
.article-body img, .article-body video { max-width: 100%; height: auto; border-radius: 8px; }
.article-body iframe { max-width: 100%; }
.article-body h2, .article-body h3 { scroll-margin-top: 28px; }
.article-body blockquote { background: #f0f6fb; border-left-color: #245fa6; }
.article-body pre { overflow-wrap: normal; }
.reading-sidebar { position: sticky; top: 20px; display: grid; gap: 20px; min-width: 0; }
.article-toc summary { cursor: pointer; font-weight: 700; min-height: 44px; }
.article-toc ol { list-style: none; padding: 0; margin: 10px 0 0; max-height: 60vh; overflow-y: auto; }
.article-toc li { margin: 6px 0; }
.article-toc a { display: block; padding: 6px 0; font-size: .88rem; color: #43526a; }
.article-toc .toc-subheading { padding-left: 14px; border-left: 1px solid var(--line); }
.reading-progress { position: fixed; z-index: 100; top: 0; left: 0; width: 100%; height: 4px; border: 0; appearance: none; background: transparent; color: var(--primary); }
.reading-progress::-webkit-progress-bar { background: transparent; }
.reading-progress::-webkit-progress-value { background: var(--primary); }
.reading-progress::-moz-progress-bar { background: var(--primary); }
.article-neighbors { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; border-block: 1px solid var(--line); padding: 24px 0; margin-top: 36px; }
.article-neighbors span, .article-neighbors strong { display: block; }
.article-neighbors span { color: var(--muted); font-size: .8rem; margin-bottom: 6px; }
.share-copy, .share-copy:hover { font: inherit; width: auto; padding-inline: 14px; background: #245fa6; color: #fff; }
.tool-panel { padding: clamp(20px,4vw,40px); margin-top: 28px; max-width: 900px; }
.tool-panel label { display: block; font-weight: 650; margin: 20px 0 8px; }
.tool-panel textarea, .tool-panel select { display: block; width: 100%; max-width: 100%; padding: 12px; border: 1px solid #9caec2; border-radius: 8px; color: var(--text); background: #fff; }
.tool-panel textarea { font-family: ui-monospace, monospace; resize: vertical; }
.secondary-button { padding: 11px 17px; background: #fff; border: 1px solid #9caec2; border-radius: 8px; cursor: pointer; color: #174d8a; }
.footer-copy, .article-meta { color: #536277; }
.quiz-submit:hover { color: #fff; background: #194b85; }
.quiz-result:empty { display: none; }
@media (max-width: 900px) {
    .article-page-layout { grid-template-columns: minmax(0,1fr); }
    .reading-sidebar { position: static; grid-row: 1; }
    .reading-sidebar > section { display: none; }
    .article-toc ol { max-height: none; }
}
@media (max-width: 620px) {
    .discovery-grid, .editorial-grid, .article-neighbors { grid-template-columns: minmax(0,1fr); }
    .discovery-grid { gap: 12px; }
    .discovery-card { padding: 20px; }
    .card-copy { padding: 20px; }
    .hero-links { align-items: stretch; flex-direction: column; }
    .hero-links a { text-align: center; }
    .main-nav .user-nav { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print { .reading-sidebar, .reading-progress, .article-neighbors { display: none !important; } .article-page-layout { display: block; } }

/* Breadcrumb responsivo: títulos longos quebram sem criar rolagem horizontal. */
@media (max-width: 620px) {
    .breadcrumb {
        font-size: .72rem;
        margin-bottom: 12px;
        overflow: visible;
        padding: 0;
        white-space: normal;
        word-break: break-word;
    }

    .breadcrumb ol {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 4px 7px;
        min-width: 0;
    }

    .breadcrumb li {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .breadcrumb li + li::before {
        margin-right: 7px;
    }
}
