/* ============================================================
   LEAN BLOG — theme.css
   Zero dependências. Zero fontes externas. Zero jQuery.
   ============================================================ */

/* ---------- Reset mínimo ---------- */

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

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

body {
    margin: 0;
    background: var(--lean-bg);
    color: var(--lean-fg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
    color: var(--lean-accent-d);
}

/* ---------- Skip link ---------- */

.lean-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999999;
    padding: 0.75rem 1rem;
    background: #fff;
    color: var(--lean-fg);
    border: 2px solid var(--lean-accent);
    border-radius: 0 0 6px 0;
    font-weight: 600;
}

.lean-skip:focus {
    left: 0;
}

/* ============================================================
   HEADER
   ============================================================ */

.lean-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--lean-border);
}

.lean-header__inner {
    max-width: var(--lean-wide);
    margin: 0 auto;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.lean-brand-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.lean-brand {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--lean-fg);
    text-decoration: none;
    white-space: nowrap;
}

.lean-brand:hover {
    color: var(--lean-accent);
}

.custom-logo {
    max-height: 44px;
    width: auto;
}

.lean-tagline {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--lean-muted);
    line-height: 1.4;
}

/* ---------- Navegação ---------- */

.lean-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lean-nav li {
    margin: 0;
}

.lean-nav a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--lean-fg-soft);
    text-decoration: none;
    transition: color 0.15s ease;
}

.lean-nav a:hover,
.lean-nav .current-menu-item > a {
    color: var(--lean-accent);
}

/* ============================================================
   MAIN
   ============================================================ */

.lean-main {
    max-width: var(--lean-max);
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}

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

.lean-hero {
    margin: 0 0 2.5rem;
}

.lean-hero__title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 800;
    text-wrap: balance;
}

.lean-hero__term {
    color: var(--lean-accent);
}

.lean-hero__meta {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--lean-muted);
}

/* ============================================================
   FEED / CARDS
   ============================================================ */

.lean-feed {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.lean-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--lean-border);
}

.lean-card:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.lean-card__media {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    background: var(--lean-surface);
}

.lean-card__img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.lean-card__media:hover .lean-card__img {
    transform: scale(1.02);
}

.lean-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.lean-card__cat {
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--lean-accent);
    text-decoration: none;
}

.lean-card__title {
    margin: 0;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    line-height: 1.3;
    letter-spacing: -0.01em;
    font-weight: 700;
    text-wrap: balance;
}

.lean-card__title a {
    color: var(--lean-fg);
    text-decoration: none;
}

.lean-card__title a:hover {
    color: var(--lean-accent);
}

.lean-card__excerpt {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--lean-fg-soft);
    line-height: 1.65;
}

.lean-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--lean-muted);
}

/* ============================================================
   ARTIGO
   ============================================================ */

.lean-article__header {
    margin-bottom: 1.75rem;
}

.lean-article__title {
    margin: 0 0 0.875rem;
    font-size: clamp(1.875rem, 4.5vw, 2.75rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
    font-weight: 800;
    text-wrap: balance;
}

.lean-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--lean-muted);
}

.lean-meta a {
    color: var(--lean-fg-soft);
    text-decoration: none;
    font-weight: 500;
}

.lean-meta a:hover {
    color: var(--lean-accent);
}

.lean-meta__sep {
    opacity: 0.5;
}

/* ---------- Figura ---------- */

.lean-figure {
    margin: 0 0 2rem;
}

.lean-figure__img {
    width: 100%;
    border-radius: 10px;
}

.lean-figure__caption {
    margin-top: 0.625rem;
    font-size: 0.8125rem;
    color: var(--lean-muted);
    text-align: center;
}

/* ============================================================
   PROSE — tipografia de conteúdo
   ============================================================ */

.lean-prose {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--lean-fg);
}

.lean-prose > * + * {
    margin-top: 1.25rem;
}

.lean-prose h2 {
    margin-top: 2.5rem;
    margin-bottom: 0.875rem;
    font-size: clamp(1.375rem, 3vw, 1.625rem);
    line-height: 1.3;
    letter-spacing: -0.015em;
    font-weight: 700;
    text-wrap: balance;
    scroll-margin-top: 5rem;
}

.lean-prose h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    line-height: 1.35;
    font-weight: 700;
    scroll-margin-top: 5rem;
}

.lean-prose h4 {
    margin-top: 1.75rem;
    margin-bottom: 0.625rem;
    font-size: 1.0625rem;
    font-weight: 700;
}

.lean-prose p {
    margin: 0;
}

.lean-prose ul,
.lean-prose ol {
    margin: 0;
    padding-left: 1.5rem;
}

.lean-prose li + li {
    margin-top: 0.5rem;
}

.lean-prose blockquote {
    margin: 1.75rem 0;
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 3px solid var(--lean-accent);
    color: var(--lean-fg-soft);
    font-style: italic;
}

.lean-prose blockquote p:last-child {
    margin-bottom: 0;
}

.lean-prose code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9em;
    padding: 0.125rem 0.375rem;
    background: var(--lean-surface);
    border: 1px solid var(--lean-border);
    border-radius: 4px;
}

.lean-prose pre {
    margin: 1.75rem 0;
    padding: 1.125rem 1.25rem;
    background: #1a1a1a;
    color: #f5f5f5;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
}

.lean-prose pre code {
    padding: 0;
    background: none;
    border: 0;
    color: inherit;
    font-size: inherit;
}

.lean-prose img {
    border-radius: 8px;
    margin: 1.75rem auto;
}

.lean-prose hr {
    margin: 2.5rem 0;
    border: 0;
    border-top: 1px solid var(--lean-border);
}

.lean-prose table {
    width: 100%;
    margin: 1.75rem 0;
    border-collapse: collapse;
    font-size: 0.9375rem;
    font-variant-numeric: tabular-nums;
}

.lean-prose th,
.lean-prose td {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--lean-border);
    text-align: left;
    vertical-align: top;
}

.lean-prose th {
    background: var(--lean-surface);
    font-weight: 700;
}

.lean-prose tbody tr:nth-child(even) {
    background: #fcfcfd;
}

/* ---------- Links em conteúdo ---------- */

.lean-prose a {
    text-decoration: underline;
}

/* ============================================================
   PÁGINAS
   ============================================================ */

.lean-page__header {
    margin-bottom: 1.75rem;
}

.lean-page__title {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 800;
    text-wrap: balance;
}

/* ---------- Páginas legais do plugin ---------- */

.lean-page--legal .lean-page__content {
    font-size: 1rem;
}

.lean-page--legal .lean-prose h2 {
    padding-top: 0.5rem;
    border-top: 1px solid var(--lean-border);
}

.lean-page--legal .lean-prose h2:first-child {
    border-top: 0;
    padding-top: 0;
}

/* ============================================================
   TAGS
   ============================================================ */

.lean-article__footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--lean-border);
}

.lean-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lean-tag {
    display: inline-block;
    padding: 0.3125rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--lean-fg-soft);
    background: var(--lean-surface);
    border: 1px solid var(--lean-border);
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.lean-tag:hover {
    color: var(--lean-accent);
    border-color: var(--lean-accent);
}

/* ============================================================
   NAVEGAÇÃO ENTRE POSTS
   ============================================================ */

.lean-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--lean-border);
}

.lean-post-nav__item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 1rem 1.125rem;
    background: var(--lean-surface);
    border: 1px solid var(--lean-border);
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.lean-post-nav__item:hover {
    border-color: var(--lean-accent);
}

.lean-post-nav__item--next {
    text-align: right;
}

.lean-post-nav__label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--lean-muted);
}

.lean-post-nav__title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--lean-fg);
}

/* ============================================================
   PAGINAÇÃO
   ============================================================ */

.lean-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.lean-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--lean-fg-soft);
    background: #fff;
    border: 1px solid var(--lean-border);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.lean-pagination .page-numbers:hover {
    border-color: var(--lean-accent);
    color: var(--lean-accent);
}

.lean-pagination .page-numbers.current {
    background: var(--lean-accent);
    border-color: var(--lean-accent);
    color: #fff;
}

.lean-pagination .page-numbers.dots {
    border: 0;
    background: none;
}

/* ============================================================
   COMENTÁRIOS
   ============================================================ */

.lean-comments {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--lean-border);
}

.lean-comments__title {
    margin: 0 0 1.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.lean-comments__list {
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;
}

.lean-comments__list .comment-body {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--lean-border);
}

.lean-comments__list .children {
    margin: 0;
    padding-left: 1.5rem;
    list-style: none;
}

.lean-comments__list .comment-author {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

.lean-comments__list .comment-author img {
    border-radius: 50%;
}

.lean-comments__list .comment-metadata {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--lean-muted);
}

.lean-comments__list .comment-metadata a {
    color: inherit;
    text-decoration: none;
}

.lean-comments__list .comment-content {
    margin-top: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.65;
}

.lean-comments__list .reply {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
}

.lean-comments__note {
    font-size: 0.8125rem;
    color: var(--lean-muted);
}

/* ---------- Formulário de comentário ---------- */

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--lean-fg);
    background: #fff;
    border: 1px solid var(--lean-border);
    border-radius: 6px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--lean-accent);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

.comment-form textarea {
    min-height: 140px;
    resize: vertical;
}

.comment-form .comment-form-cookies-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.comment-form .comment-form-cookies-consent input {
    margin-top: 0.25rem;
}

/* ============================================================
   BOTÕES
   ============================================================ */

.lean-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.lean-btn--primary {
    background: var(--lean-accent);
    border-color: var(--lean-accent);
    color: #fff;
}

.lean-btn--primary:hover {
    background: var(--lean-accent-d);
    border-color: var(--lean-accent-d);
    color: #fff;
}

/* ============================================================
   BUSCA
   ============================================================ */

.lean-search__label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.lean-search__row {
    display: flex;
    gap: 0.5rem;
}

.lean-search__input {
    flex: 1;
    min-width: 0;
    padding: 0.625rem 0.875rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--lean-fg);
    background: #fff;
    border: 1px solid var(--lean-border);
    border-radius: 6px;
}

.lean-search__input:focus {
    outline: none;
    border-color: var(--lean-accent);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

/* ============================================================
   404 / VAZIO
   ============================================================ */

.lean-404,
.lean-empty {
    padding: 3rem 0;
    text-align: center;
}

.lean-404__code {
    margin: 0 0 0.5rem;
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    color: var(--lean-border);
    letter-spacing: -0.04em;
}

.lean-404__title,
.lean-empty__title {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.lean-404__text,
.lean-empty__text {
    margin: 0 0 1.75rem;
    color: var(--lean-fg-soft);
}

.lean-404__search,
.lean-empty__search {
    max-width: 420px;
    margin: 0 auto 1.75rem;
    text-align: left;
}

.lean-404__back a,
.lean-empty__back a {
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
}

/* ============================================================
   ANÚNCIOS
   ============================================================ */

.lean-ad {
    margin: 2rem 0;
    text-align: center;
    overflow: hidden;
}

.lean-ad--top {
    margin: 2rem 0;
}

.lean-ad--bottom {
    margin: 2.5rem 0 0;
}

.lean-ad--archive {
    margin: 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--lean-border);
    border-bottom: 1px solid var(--lean-border);
}

/* ============================================================
   FOOTER
   ============================================================ */

.lean-footer {
    margin-top: 4rem;
    background: var(--lean-surface);
    border-top: 1px solid var(--lean-border);
}

.lean-footer__inner {
    max-width: var(--lean-wide);
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
    font-size: 0.875rem;
    color: var(--lean-muted);
}

.lean-footer__nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
}

.lean-footer__nav a {
    color: var(--lean-fg-soft);
    text-decoration: none;
}

.lean-footer__nav a:hover {
    color: var(--lean-accent);
}

.lean-footer__widgets {
    margin-bottom: 1.5rem;
}

.lean-widget {
    margin-bottom: 1.5rem;
}

.lean-widget__title {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--lean-fg);
}

.lean-footer__text {
    margin-bottom: 1.25rem;
    line-height: 1.65;
}

.lean-footer__copy {
    margin: 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--lean-border);
    font-size: 0.8125rem;
}

/* ============================================================
   ACESSIBILIDADE
   ============================================================ */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--lean-accent);
    outline-offset: 2px;
    border-radius: 3px;
}

/* ============================================================
   RESPONSIVO
   ============================================================ */

@media (min-width: 720px) {
    .lean-card {
        grid-template-columns: 280px 1fr;
        align-items: start;
    }

    .lean-card__media {
        position: sticky;
        top: 6rem;
    }
}

@media (max-width: 640px) {
    .lean-header__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .lean-nav ul {
        gap: 0.875rem;
    }

    .lean-main {
        padding: 1.75rem 1rem 3rem;
    }

    .lean-post-nav {
        grid-template-columns: 1fr;
    }

    .lean-post-nav__item--next {
        text-align: left;
    }

    .lean-search__row {
        flex-direction: column;
    }
}

/* ============================================================
   IMPRESSÃO
   ============================================================ */

@media print {
    .lean-header,
    .lean-footer,
    .lean-post-nav,
    .lean-comments,
    .lean-pagination,
    .lean-ad,
    .lean-skip {
        display: none !important;
    }

    .lean-main {
        max-width: 100%;
        padding: 0;
    }

    .lean-prose a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    .lean-prose h2,
    .lean-prose h3 {
        page-break-after: avoid;
    }

    .lean-prose table,
    .lean-prose pre,
    .lean-figure {
        page-break-inside: avoid;
    }
}

/* ============================================================
   MOVIMENTO REDUZIDO
   ============================================================ */

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.lean-header__lang {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .lean-header__lang {
        align-self: flex-start;
    }
}