/*
 * Vistas del blog. Todo cuelga de .bt para no tocar el resto del sitio, y todo color y
 * tipografia sale de los tokens que el plugin calcula desde la paleta del sitio.
 */

.bt {
    --bt-max: 1120px;
    --bt-measure: 68ch;
    --bt-gutter: clamp(1.25rem, 5vw, 4rem);
    --bt-rhythm: clamp(3rem, 7vw, 6rem);
    --bt-ease: cubic-bezier(0.22, 1, 0.36, 1);

    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: var(--bt-rhythm) var(--bt-gutter);
    background: var(--bt-bg);
    color: var(--bt-fg);
    font-family: var(--bt-font-body);
    overflow-x: clip;
}

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

/* ---------- Piezas compartidas ---------- */

.bt .bt-eyebrow {
    margin: 0 0 1.25rem;
    font-family: var(--bt-font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bt-accent);
}

.bt .bt-eyebrow a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s var(--bt-ease);
}

.bt .bt-eyebrow a:hover,
.bt .bt-eyebrow a:focus-visible {
    border-bottom-color: currentColor;
}

.bt .bt-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    color: var(--bt-muted);
}

.bt .bt-meta a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--bt-border);
}

.bt .bt-meta a:hover,
.bt .bt-meta a:focus-visible {
    color: var(--bt-fg);
    border-bottom-color: currentColor;
}

.bt .bt-meta__dot {
    opacity: 0.5;
}

.bt .bt-section-title {
    margin: 0 0 2rem;
    font-family: var(--bt-font-display);
    font-size: clamp(1.25rem, 2.4vw, 1.75rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.bt .bt-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.875rem 1.75rem;
    background: var(--bt-accent);
    color: var(--bt-on-accent);
    font-family: var(--bt-font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    border: 1px solid var(--bt-accent);
    transition: background-color 0.25s var(--bt-ease), color 0.25s var(--bt-ease);
}

.bt .bt-button:hover,
.bt .bt-button:focus-visible {
    background: transparent;
    color: var(--bt-accent);
}

.bt a:focus-visible,
.bt button:focus-visible {
    outline: 2px solid var(--bt-accent);
    outline-offset: 3px;
}

/* ---------- Miniaturas ---------- */

.bt .bt-thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--bt-surface);
}

.bt .bt-thumb__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--bt-ease);
}

/* ---------- Cabecera del listado ---------- */

.bt-archive__head {
    max-width: var(--bt-max);
    margin: 0 auto 3.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--bt-border);
}

.bt .bt-archive__title {
    max-width: 20ch;
    margin: 0;
    font-family: var(--bt-font-display);
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.02;
    text-wrap: balance;
}

.bt .bt-archive__description {
    max-width: 52ch;
    margin: 1.25rem 0 0;
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    line-height: 1.6;
    color: var(--bt-muted);
}

/* ---------- Listado ---------- */

.bt-list {
    max-width: var(--bt-max);
    margin: 0 auto;
}

.bt .bt-card {
    display: grid;
    gap: 1.25rem;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--bt-border);
}

.bt .bt-card:first-child {
    padding-top: 0;
}

.bt .bt-card__media {
    display: block;
    text-decoration: none;
}

.bt .bt-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.875rem;
}

.bt .bt-card__title {
    margin: 0;
    font-family: var(--bt-font-display);
    font-size: clamp(1.375rem, 2.6vw, 1.875rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    text-wrap: balance;
}

.bt .bt-card__title a {
    color: inherit;
    text-decoration: none;
    background-image: linear-gradient(var(--bt-accent), var(--bt-accent));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0 1px;
    transition: background-size 0.35s var(--bt-ease);
}

.bt .bt-card:hover .bt-card__title a,
.bt .bt-card__title a:focus-visible {
    background-size: 100% 1px;
}

.bt .bt-card:hover .bt-thumb__img {
    transform: scale(1.04);
}

.bt .bt-card__excerpt {
    max-width: 62ch;
    margin: 0;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--bt-muted);
}

.bt .bt-card__more {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bt-accent);
}

.bt .bt-card__more::after {
    content: " \2192";
    display: inline-block;
    transition: transform 0.25s var(--bt-ease);
}

.bt .bt-card:hover .bt-card__more::after {
    transform: translateX(4px);
}

/* Entrada destacada: la primera del blog ocupa el ancho completo. */
.bt .bt-card--featured .bt-thumb {
    aspect-ratio: 16 / 7;
}

.bt .bt-card--featured .bt-card__title {
    font-size: clamp(1.75rem, 4vw, 3rem);
    letter-spacing: -0.03em;
}

.bt .bt-card--featured .bt-card__excerpt {
    font-size: clamp(1rem, 1.6vw, 1.125rem);
}

/* ---------- Estado vacio y paginacion ---------- */

.bt-empty {
    max-width: var(--bt-measure);
    margin: 0 auto;
    padding: 4rem 0;
    text-align: center;
}

.bt .bt-empty__title {
    margin: 0 0 1.5rem;
    font-family: var(--bt-font-display);
    font-size: clamp(1.25rem, 2.4vw, 1.625rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.bt .bt-empty__search {
    margin: 0 0 2rem;
}

.bt .bt-empty__search input[type="search"] {
    min-height: 48px;
    padding: 0.75rem 1rem;
    background: var(--bt-surface);
    border: 1px solid var(--bt-border);
    color: var(--bt-fg);
    font: inherit;
}

.bt .bt-pagination {
    max-width: var(--bt-max);
    margin: 3.5rem auto 0;
}

.bt .bt-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bt .bt-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    padding: 0 0.75rem;
    border: 1px solid var(--bt-border);
    color: var(--bt-muted);
    font-size: 0.9375rem;
    text-decoration: none;
    transition: color 0.25s var(--bt-ease), border-color 0.25s var(--bt-ease);
}

.bt .bt-pagination .page-numbers:hover,
.bt .bt-pagination .page-numbers:focus-visible {
    color: var(--bt-fg);
    border-color: var(--bt-fg);
}

.bt .bt-pagination .page-numbers.current {
    color: var(--bt-on-accent);
    background: var(--bt-accent);
    border-color: var(--bt-accent);
}

.bt .bt-pagination .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

/* ---------- Entrada individual ---------- */

.bt-entry {
    max-width: var(--bt-max);
    margin: 0 auto;
}

.bt-entry__head {
    margin: 0 0 2.5rem;
}

.bt .bt-entry__title {
    max-width: 24ch;
    margin: 0 0 1.5rem;
    font-family: var(--bt-font-display);
    font-size: clamp(2.25rem, 6vw, 4rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.03;
    text-wrap: balance;
}

.bt .bt-entry__media {
    margin: 0 0 3rem;
}

.bt .bt-entry__image {
    display: block;
    width: 100%;
    height: auto;
}

.bt .bt-entry__media figcaption {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--bt-muted);
}

/* ---------- Cuerpo del articulo ---------- */

.bt-prose {
    max-width: var(--bt-measure);
    font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
    line-height: 1.75;
}

.bt .bt-prose > * {
    margin-block: 0 1.5em;
}

.bt .bt-prose > *:last-child {
    margin-bottom: 0;
}

.bt .bt-prose h2,
.bt .bt-prose h3,
.bt .bt-prose h4 {
    font-family: var(--bt-font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-block: 2.25em 0.75em;
    text-wrap: balance;
}

.bt .bt-prose h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.bt .bt-prose h3 {
    font-size: clamp(1.25rem, 2.2vw, 1.5rem);
}

.bt .bt-prose h4 {
    font-size: 1.125rem;
}

.bt .bt-prose a {
    color: var(--bt-accent);
    text-decoration: underline;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
}

.bt .bt-prose a:hover,
.bt .bt-prose a:focus-visible {
    text-decoration-thickness: 2px;
}

.bt .bt-prose strong {
    font-weight: 600;
    color: var(--bt-fg);
}

.bt .bt-prose ul,
.bt .bt-prose ol {
    padding-left: 1.25em;
}

.bt .bt-prose li {
    margin-bottom: 0.6em;
}

.bt .bt-prose li::marker {
    color: var(--bt-accent);
}

.bt .bt-prose blockquote {
    margin-inline: 0;
    padding: 0.25em 0 0.25em 1.5em;
    border-left: 2px solid var(--bt-accent);
    font-family: var(--bt-font-display);
    font-size: 1.125em;
    line-height: 1.45;
    letter-spacing: -0.01em;
}

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

.bt .bt-prose img,
.bt .bt-prose figure,
.bt .bt-prose iframe,
.bt .bt-prose video {
    max-width: 100%;
    height: auto;
}

.bt .bt-prose figure figcaption {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--bt-muted);
}

.bt .bt-prose hr {
    height: 0;
    margin-block: 3rem;
    border: 0;
    border-top: 1px solid var(--bt-border);
}

.bt .bt-prose code {
    padding: 0.15em 0.4em;
    background: var(--bt-surface-strong);
    font-size: 0.9em;
}

.bt .bt-prose pre {
    padding: 1.25rem;
    overflow-x: auto;
    background: var(--bt-surface-strong);
    border: 1px solid var(--bt-border);
}

.bt .bt-prose pre code {
    padding: 0;
    background: none;
}

.bt .bt-prose table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.bt .bt-prose th,
.bt .bt-prose td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--bt-border);
}

.bt .bt-prose th {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bt-muted);
}

/* ---------- Cierre de la entrada ---------- */

.bt .bt-cta {
    max-width: var(--bt-measure);
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--bt-border);
}

.bt-adjacent {
    display: grid;
    gap: 1px;
    max-width: var(--bt-max);
    margin: var(--bt-rhythm) auto 0;
    background: var(--bt-border);
    border-block: 1px solid var(--bt-border);
}

.bt .bt-adjacent__link {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.75rem 0;
    background: var(--bt-bg);
    color: inherit;
    text-decoration: none;
}

.bt .bt-adjacent__label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bt-muted);
}

.bt .bt-adjacent__title {
    font-family: var(--bt-font-display);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.25;
}

.bt .bt-adjacent__link:hover .bt-adjacent__title,
.bt .bt-adjacent__link:focus-visible .bt-adjacent__title {
    color: var(--bt-accent);
}

.bt-related {
    max-width: var(--bt-max);
    margin: var(--bt-rhythm) auto 0;
}

.bt-related__grid {
    display: grid;
    gap: 2rem;
}

.bt .bt-related .bt-card {
    display: block;
    padding: 0;
    border-bottom: 0;
}

.bt .bt-related .bt-card__media {
    margin-bottom: 1.25rem;
}

.bt .bt-related .bt-card__title {
    font-size: 1.125rem;
}

.bt .bt-related .bt-card__excerpt,
.bt .bt-related .bt-card__more {
    display: none;
}

/* ---------- Tablet ---------- */

@media (min-width: 768px) {
    .bt .bt-card {
        grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
        gap: 2.5rem;
        align-items: start;
    }

    .bt .bt-card--featured,
    .bt .bt-card--text {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
    }

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

    .bt .bt-adjacent__link {
        padding: 1.75rem 2rem;
    }

    .bt .bt-adjacent__link--next {
        text-align: right;
        align-items: flex-end;
    }

    .bt-related__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ---------- Escritorio ---------- */

@media (prefers-reduced-motion: reduce) {
    .bt *,
    .bt *::before,
    .bt *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
