/* Base styles are isolated from the home page by body.blog-page. */
body.blog-page {
    --blog-red: #bd1111;
    --blog-red-dark: #971010;
    --blog-red-soft: #fff1f1;
    --blog-ink: #262626;
    --blog-muted: #626262;
    --blog-line: #e1e1e1;
    --blog-bg: #f6f6f6;
    --blog-white: #fff;
    --blog-radius: 14px;
    --blog-shadow: 0 12px 30px rgb(0 0 0 / 7%);
    margin: 0;
    background: var(--blog-bg);
    color: var(--blog-ink);
    font-family: "Montserrat", serif;
    font-size: 16px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

/* Ativado apenas depois que Motion e a deteccao de viewport estao disponiveis.
   translate independente preserva os transforms de hover dos componentes. */
.blog-page #blog-content .blog-reveal,
.blog-page #blog-content.blog-reveal {
    opacity: 0;
    translate: 0 18px;
}

.blog-page #blog-content .blog-reveal:focus-within {
    opacity: 1 !important;
    translate: none !important;
}

@media print, (prefers-reduced-motion: reduce) {
    .blog-page #blog-content .blog-reveal,
    .blog-page #blog-content.blog-reveal {
        opacity: 1 !important;
        translate: none !important;
    }
}

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

.blog-page [hidden] {
    display: none !important;
}

.blog-page a {
    color: inherit;
    text-decoration: none;
    text-underline-offset: 0.2em;
}

.blog-page :is(button, input, textarea, select) {
    font: inherit;
}

.blog-page :is(button, summary) {
    cursor: pointer;
}

.blog-page :focus-visible {
    outline: 3px solid var(--blog-red);
    outline-offset: 4px;
}

.blog-page img {
    max-width: 100%;
    height: auto;
}

.blog-page svg {
    display: inline-block;
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    vertical-align: middle;
}

.blog-page .blog-skip-link {
    position: absolute;
    z-index: 200;
    top: 12px;
    left: 16px;
    max-width: calc(100% - 32px);
    padding: 12px 16px;
    transform: translateY(calc(-100% - 20px));
    border-radius: 8px;
    background: #fff;
    color: var(--blog-red);
    font-weight: 700;
}

.blog-page .blog-skip-link:focus {
    transform: translateY(0);
}

.blog-page .blog-container {
    width: min(1280px, calc(100% - 48px));
    margin-inline: auto;
}

/* Compact introduction, without a fixed minimum height or a hero. */
.blog-page .blog-intro {
    padding-block: 20px 24px;
    border-bottom: 1px solid var(--blog-line);
}

.blog-page .blog-intro h1 {
    margin: 10px 0;
    font-size: clamp(1.9rem, 3.5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.blog-page .blog-intro p {
    max-width: 65ch;
    margin: 0;
    color: var(--blog-muted);
}

.blog-page .blog-intro .blog-eyebrow {
    color: var(--blog-red);
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.blog-page .blog-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 24px;
    color: var(--blog-muted);
    font-size: 0.875rem;
}

.blog-page .blog-breadcrumb a {
    color: var(--blog-red);
    text-decoration: underline;
}

.blog-page .blog-breadcrumb svg {
    width: 14px;
    height: 14px;
}

.blog-page .blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: 36px;
    padding-block: 32px 64px;
}

.blog-page :is(.blog-content, .blog-sidebar, .blog-article) {
    min-width: 0;
}

.blog-page .blog-results {
    margin: 0 0 20px;
    color: var(--blog-muted);
    font-size: 0.875rem;
}

.blog-page .blog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.blog-page .blog-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--blog-line);
    border-radius: var(--blog-radius);
    background: var(--blog-white);
    box-shadow: 0 3px 12px rgb(0 0 0 / 3%);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

/* Class may be on the image itself or on its enclosing link. */
.blog-page .blog-card__image,
.blog-page .blog-card__image img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    margin: 0;
    background: #f0f0f0;
    object-fit: contain;
}

.blog-page .blog-card__image img {
    height: 100%;
}

.blog-page .blog-card__body {
    display: flex;
    flex: 1;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
}

.blog-page .blog-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 5px;
    background: var(--blog-red-soft);
    color: var(--blog-red);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.5;
}

.blog-page .blog-category--empty {
    background: #f0f0f0;
    color: var(--blog-muted);
}

.blog-page .blog-card__title {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.blog-page .blog-card__summary {
    margin: 0;
    color: var(--blog-muted);
    font-size: 0.9375rem;
}

.blog-page .blog-date {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0;
    color: var(--blog-muted);
    font-size: 0.8125rem;
}

.blog-page :is(.blog-read, .blog-back) {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    color: var(--blog-red);
    font-size: 0.875rem;
    font-weight: 700;
}

.blog-page .blog-read {
    margin-top: auto;
}

.blog-page .blog-back {
    margin-top: 24px;
}

.blog-page .blog-back svg {
    transform: rotate(180deg);
}

.blog-page .blog-sidebar {
    display: grid;
    gap: 24px;
}

.blog-page .blog-panel {
    padding: 24px;
    border: 1px solid var(--blog-line);
    border-radius: var(--blog-radius);
    background: var(--blog-white);
}

.blog-page .blog-panel h2 {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--blog-line);
    font-size: 1.0625rem;
    line-height: 1.4;
}

.blog-page .blog-panel nav a,
.blog-page .blog-recent > a {
    display: block;
    padding-block: 12px;
    border-bottom: 1px solid var(--blog-line);
    font-size: 0.875rem;
}

.blog-page .blog-panel nav a:last-child,
.blog-page .blog-recent > a:last-child {
    border-bottom: 0;
}

/* Native GET form: action=blog/pesquisa, input name=q. */
.blog-page .blog-search {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.blog-page .blog-search label {
    flex-basis: 100%;
    font-size: 0.875rem;
    font-weight: 700;
}

.blog-page .blog-search > div {
    display: flex;
    width: 100%;
    min-width: 0;
    gap: 8px;
}

.blog-page .blog-search input[type="search"] {
    width: 0;
    min-width: 0;
    min-height: 46px;
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #aaa;
    border-radius: 8px;
    background: var(--blog-white);
    color: var(--blog-ink);
    font-size: 1rem;
}

.blog-page .blog-search input::placeholder {
    color: var(--blog-muted);
    opacity: 1;
}

.blog-page .blog-search button {
    display: inline-flex;
    min-width: 46px;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 0;
    border-radius: 8px;
    background: var(--blog-red);
    color: var(--blog-white);
}

.blog-page .blog-recent :is(strong, time) {
    display: block;
}

.blog-page .blog-recent strong {
    margin-bottom: 4px;
    font-weight: 600;
    line-height: 1.5;
}

.blog-page .blog-recent time {
    color: var(--blog-muted);
    font-size: 0.8125rem;
}

.blog-page .blog-archive summary {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 9px;
    padding-block: 8px;
    list-style: none;
    font-size: 0.875rem;
    font-weight: 700;
}

.blog-page .blog-archive summary::-webkit-details-marker {
    display: none;
}

.blog-page .blog-archive summary::before {
    content: "+";
    display: inline-grid;
    width: 20px;
    height: 20px;
    place-items: center;
    color: var(--blog-red);
    font-size: 1.15rem;
    line-height: 1;
    transition: transform 220ms ease;
}

.blog-page .blog-archive details[open] summary::before {
    transform: rotate(45deg);
}

.blog-page .blog-archive__content {
    overflow: hidden;
}

.blog-page .blog-archive details[open] .blog-archive__content {
    animation: blog-collapse-open 240ms ease both;
}

.blog-page .blog-archive nav svg {
    margin-right: 6px;
    color: var(--blog-red);
}

.blog-page .blog-clear-filters {
    display: inline-flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid var(--blog-red);
    border-radius: 8px;
    color: var(--blog-red);
    font-size: 0.8125rem;
    font-weight: 700;
    text-align: center;
    /* Troca de cor instantânea evita um quadro intermediário de texto
       vermelho sobre fundo vermelho durante o hover. */
    transition: transform 180ms ease;
}

.blog-page .blog-clear-filters svg {
    width: 17px;
    height: 17px;
}

.blog-page .blog-pagination,
.blog-page .blog-pagination ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    list-style: none;
}

.blog-page .blog-pagination {
    margin-top: 32px;
}

.blog-page .blog-pagination ul {
    margin: 0;
}

.blog-page .blog-pagination :is(a, strong, span) {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid var(--blog-line);
    border-radius: 8px;
    background: var(--blog-white);
    font-size: 0.875rem;
}

.blog-page .blog-pagination strong,
.blog-page .blog-pagination [aria-current="page"],
.blog-page .blog-pagination .active > :is(a, span) {
    border-color: var(--blog-red);
    background: var(--blog-red);
    color: var(--blog-white);
}

.blog-page .blog-empty {
    padding: 40px 24px;
    border: 1px solid var(--blog-line);
    border-radius: var(--blog-radius);
    background: var(--blog-white);
    text-align: center;
}

.blog-page main.blog-empty {
    margin-block: 32px 64px;
}

.blog-page .blog-empty > svg {
    width: 36px;
    height: 36px;
    color: var(--blog-red);
}

.blog-page .blog-empty :is(h1, h2) {
    margin: 12px 0;
    font-size: 1.5rem;
}

.blog-page .blog-empty p {
    max-width: 48ch;
    margin: 12px auto;
    color: var(--blog-muted);
}

.blog-page .blog-article__header {
    margin-bottom: 24px;
}

.blog-page .blog-article__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.blog-page .blog-article__actions .blog-back,
.blog-page .blog-article__actions .blog-share {
    margin: 0;
}

.blog-page .blog-back--header {
    min-width: 110px;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid var(--blog-line);
    border-radius: 8px;
    background: var(--blog-white);
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

@media (min-width: 981px) {
    .blog-page .blog-article__header {
        position: relative;
        min-height: 132px;
        padding-right: 316px;
    }

    .blog-page .blog-article__actions {
        position: absolute;
        top: 38px;
        right: 0;
        margin: 0;
    }

    .blog-page .blog-article__actions .blog-share {
        min-width: 174px;
    }

    .blog-page .blog-article__actions .blog-share .blog-share__toggle {
        width: 100%;
        justify-content: center;
    }

    .blog-page .blog-article__actions .blog-share .blog-share__panel {
        right: 0;
        left: auto;
        transform-origin: top right;
    }
}

.blog-page .blog-article__title {
    margin: 16px 0;
    font-size: clamp(1.875rem, 3.5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.blog-page .blog-article__summary {
    margin: 16px 0;
    color: var(--blog-muted);
    font-size: 1.125rem;
}

.blog-page .blog-article__cover,
.blog-page .blog-article__cover img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: var(--blog-radius);
    background: #eee;
    object-fit: contain;
}

.blog-page .blog-article__cover {
    margin: 0 0 32px;
}

.blog-page .blog-article__cover img {
    height: 100%;
}

.blog-page .blog-article__body {
    color: #414141;
    font-size: 1.0625rem;
    line-height: 1.85;
}

.blog-page .blog-article__body > :first-child {
    margin-top: 0;
}

.blog-page .blog-article__body :is(h2, h3, h4) {
    margin: 1.5em 0 0.6em;
    color: var(--blog-ink);
    line-height: 1.3;
}

.blog-page .blog-article__body :is(p, ul, ol) {
    margin-block: 0 1.25em;
}

.blog-page .blog-article__body a {
    color: var(--blog-red);
    text-decoration: underline;
}

.blog-page .blog-article__body figure {
    max-width: 100%;
    margin-inline: 0;
}

.blog-page .blog-article__body figcaption {
    color: var(--blog-muted);
    font-size: 0.875rem;
}

.blog-page .blog-article__body blockquote {
    margin: 24px 0;
    padding: 16px 24px;
    border-left: 4px solid var(--blog-red);
    background: var(--blog-white);
}

.blog-page .blog-article__body :is(pre, table) {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.blog-page .blog-article__body :is(iframe, video) {
    width: 100%;
    max-width: 100%;
}

.blog-page .blog-gallery {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--blog-line);
}

.blog-page .blog-gallery h2 {
    margin: 0 0 16px;
    font-size: 1.25rem;
}

.blog-page .blog-gallery > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.blog-page .blog-gallery a {
    display: block;
    border-radius: 8px;
    cursor: zoom-in;
    transition: box-shadow 180ms ease, transform 180ms ease;
}

.blog-page .blog-gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 8px;
    background: #eee;
    object-fit: contain;
}

.blog-page .fancybox-overlay {
    background: rgb(0 0 0 / 88%);
}

.blog-page .fancybox-image {
    cursor: zoom-in;
    transition: transform 220ms ease;
}

.blog-page .fancybox-image.is-zoomed {
    cursor: zoom-out;
}

/* Fancybox v2 deixa links de navegação com 40% da largura e 100% da altura
   sobre a foto. O alvo clicável deve ocupar apenas o ícone da seta. */
.blog-page .fancybox-nav {
    top: 50%;
    width: 36px;
    height: 34px;
    margin-top: -17px;
    background: none;
}

.blog-page .fancybox-prev {
    left: 10px;
}

.blog-page .fancybox-next {
    right: 10px;
}

.blog-page .fancybox-nav span {
    position: static;
    display: block;
    width: 36px;
    height: 34px;
    margin: 0;
    visibility: visible;
}

.blog-page .fancybox-title-inside-wrap {
    color: var(--blog-ink);
    font-family: "Montserrat", serif;
    font-size: 0.8125rem;
}

/* A legenda permanece no rodapé do modal, mas some durante a ampliação. */
.blog-page .fancybox-skin.blog-gallery--zoomed .fancybox-title-inside-wrap {
    visibility: hidden;
}

.blog-page .fancybox-skin.blog-gallery--zoomed .fancybox-close,
.blog-page .fancybox-skin.blog-gallery--zoomed .fancybox-nav {
    display: none;
}

/* JS owns hidden/aria-expanded; CSS hover cannot reopen a dismissed panel. */
.blog-page .blog-share {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin-block: 20px;
}

.blog-page .blog-share__toggle,
.blog-page .blog-share__panel :is(a, button) {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--blog-line);
    border-radius: 8px;
    background: var(--blog-white);
    color: var(--blog-ink);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
}

.blog-page .blog-share__toggle {
    color: var(--blog-red);
}

.blog-page .blog-share__toggle[aria-expanded="true"] {
    border-color: var(--blog-red);
    background: var(--blog-red-soft);
}

.blog-page .blog-share__panel {
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    display: grid;
    width: min(280px, calc(100vw - 48px));
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--blog-line);
    border-radius: 10px;
    background: var(--blog-white);
    box-shadow: var(--blog-shadow);
    transform-origin: top left;
    animation: blog-pop-in 180ms ease both;
}

.blog-page .blog-share__panel :is(a, button) {
    width: 100%;
    border-color: transparent;
}

.blog-page .blog-share__panel svg {
    color: var(--blog-red);
}

.blog-page .blog-share__panel .fa-whatsapp {
    width: 1.25em;
    color: var(--blog-red);
    font-size: 1.25rem;
    text-align: center;
}

.blog-page .blog-share__status {
    margin: 4px 8px;
    color: var(--blog-muted);
    font-size: 0.875rem;
}

.blog-page .blog-share__status:empty {
    margin: 0;
}

/* The view supplies a noscript link; do not expose an inert toggle. */
.blog-page .blog-share:not(.is-enhanced) .blog-share__toggle {
    display: none;
}

.blog-page .blog-share noscript a {
    color: var(--blog-red);
    text-decoration: underline;
}

/* Temporary textarea used only by the legacy clipboard fallback. */
.blog-page .blog-copy-buffer {
    position: fixed;
    top: 0;
    left: -9999px;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    font-size: 16px;
}

@media (hover: hover) and (pointer: fine) {
    .blog-page .blog-card:hover {
        border-color: #c6c6c6;
        box-shadow: var(--blog-shadow);
    }

    .blog-page .blog-card__title a:hover,
    .blog-page .blog-panel a:hover,
    .blog-page .blog-back:hover,
    .blog-page .blog-read:hover {
        color: var(--blog-red);
        text-decoration: underline;
    }

    .blog-page .blog-search button:hover,
    .blog-page .blog-pagination a:hover {
        border-color: var(--blog-red-dark);
        background: var(--blog-red-dark);
        color: var(--blog-white);
    }

    .blog-page .blog-share__toggle:hover,
    .blog-page .blog-share__panel a:hover,
    .blog-page .blog-share__panel button:hover {
        background: var(--blog-red-soft);
        color: var(--blog-red);
    }

    .blog-page .blog-back--header:hover {
        border-color: var(--blog-red);
        background: var(--blog-red-soft);
        text-decoration: none;
        transform: translateY(-1px);
    }

    .blog-page .blog-gallery a:hover {
        box-shadow: 0 9px 22px rgb(0 0 0 / 12%);
        transform: translateY(-2px);
    }

    /* This selector outranks the generic sidebar-link hover rule so the
       button label stays readable over its red hover background. */
    .blog-page .blog-archive .blog-clear-filters:hover,
    .blog-page .blog-panel a.blog-clear-filters:hover {
        background: var(--blog-red);
        color: var(--blog-white);
        text-decoration: none;
        transform: translateY(-1px);
    }
}

@media (max-width: 980px) {
    .blog-page .blog-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .blog-page .blog-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

@media (max-width: 640px) {
    .blog-page .blog-container {
        width: calc(100% - 32px);
    }

    .blog-page .blog-layout {
        padding-block: 24px 40px;
    }

    .blog-page .blog-breadcrumb {
        padding-top: 18px;
    }

    .blog-page .blog-intro {
        padding-block: 16px 20px;
    }

    .blog-page .blog-intro h1,
    .blog-page .blog-article__title {
        letter-spacing: -0.025em;
    }

    .blog-page .blog-grid,
    .blog-page .blog-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }

    .blog-page .blog-card__body,
    .blog-page .blog-panel {
        padding: 20px;
    }

    .blog-page .blog-article__summary {
        font-size: 1rem;
    }

    .blog-page .blog-article__body {
        font-size: 1rem;
        line-height: 1.75;
    }

    .blog-page .blog-gallery > div {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .blog-page .blog-gallery > div {
        grid-template-columns: minmax(0, 1fr);
    }

    .blog-page .blog-article__body blockquote {
        padding: 14px 18px;
    }
}

@media (max-width: 360px) {
    .blog-page .blog-article__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .blog-page .blog-article__actions .blog-back,
    .blog-page .blog-article__actions .blog-share,
    .blog-page .blog-article__actions .blog-share__toggle {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .blog-page *,
    .blog-page *::before,
    .blog-page *::after {
        scroll-behavior: auto !important;
        animation: none !important;
        transition: none !important;
    }
}

@keyframes blog-collapse-open {
    from {
        opacity: 0;
        transform: translateY(-7px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blog-pop-in {
    from {
        opacity: 0;
        transform: translateY(-5px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
