/* =================================================================
   Storefront · Blog
   -----------------------------------------------------------------
   Listado y nota. El cuerpo de la nota lo estila blog-content.css,
   la misma hoja que usa el editor del panel: acá sólo se le pasan
   los colores de la tienda y el ancho de lectura.
   ================================================================= */

body.theme-store .st-blog { padding-bottom: 48px; }

/* El blog se lee mejor en una caja más angosta que el catálogo. */
body.theme-store .st-blog > .st-container { max-width: 1120px; }

/* En la nota todo acompaña el ancho de lectura del texto. */
.st-blog--post .st-breadcrumbs,
.st-blog--post .st-blog-preview-notice { max-width: 720px; margin-inline: auto; }

.st-blog-header {
    max-width: 720px;
    margin: 0 0 28px;
}
.st-blog-header__title {
    margin: 0 0 8px;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.st-blog-header__copy {
    margin: 0;
    color: var(--st-muted);
    font-size: 16px;
}

.st-blog-empty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 32px;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius-lg);
    background: var(--st-bg-soft);
}
.st-blog-empty p { margin: 0; color: var(--st-muted); }

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

.st-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    align-items: start;
    gap: 22px;
}

.st-blog-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius-lg);
    background: var(--st-surface);
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.st-blog-card:hover {
    box-shadow: var(--st-shadow-strong);
    transform: translateY(-2px);
}

/* La portada siempre en 16:9, sin importar el alto de la imagen subida. */
.st-blog-card__media {
    position: relative;
    display: block;
    flex: 0 0 auto;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--st-bg-alt);
}
.st-blog-card__media img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.st-blog-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
}

/* Nota sin imagen destacada: la tarjeta es sólo texto y necesita más aire. */
.st-blog-card > .st-blog-card__body:first-child { padding: 22px 20px; }

.st-blog-card__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
}
.st-blog-card__title a {
    color: inherit;
    text-decoration: none;
}
.st-blog-card__title a:hover { text-decoration: underline; }

.st-blog-card__excerpt {
    margin: 0;
    color: var(--st-muted);
    font-size: 14.5px;
    line-height: 1.55;
}

.st-blog-card__meta {
    margin: auto 0 0;
    color: var(--st-fg-soft);
    font-size: 13px;
}
.st-blog-card__meta span[aria-hidden] { margin: 0 6px; }

.st-blog-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 32px;
}
.st-blog-pagination__copy {
    color: var(--st-muted);
    font-size: 14px;
}

/* Nota -------------------------------------------------------- */

.st-blog-preview-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px;
    padding: 12px 16px;
    border: 1px solid var(--st-border-strong);
    border-radius: var(--st-radius);
    background: var(--st-bg-alt);
    color: var(--st-fg-muted);
    font-size: 14px;
}

.st-blog-article {
    max-width: 720px;
    margin: 0 auto;
}

.st-blog-article__header { margin-bottom: 22px; }

.st-blog-article__title {
    margin: 0 0 10px;
    font-size: clamp(27px, 4.4vw, 42px);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.02em;
}

.st-blog-article__meta {
    margin: 0;
    color: var(--st-fg-soft);
    font-size: 14px;
}
.st-blog-article__meta span[aria-hidden] { margin: 0 6px; }

.st-blog-article__cover {
    margin: 0 0 28px;
    overflow: hidden;
    border-radius: var(--st-radius-lg);
    background: var(--st-bg-alt);
}
/* Se muestra completa, pero con un techo de alto: una foto muy vertical no
   debería empujar todo el texto fuera de la pantalla. */
.st-blog-article__cover img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 540px;
    object-fit: cover;
}

/* Los colores del cuerpo salen de la paleta de la tienda, así el
   modo oscuro funciona sin tocar la hoja compartida. */
.st-blog-article__body {
    --blog-color-fg: var(--st-fg);
    --blog-color-muted: var(--st-fg-muted);
    --blog-color-border: var(--st-border);
    --blog-color-accent: var(--st-accent);
    --blog-color-code-bg: var(--st-bg-alt);
    --blog-color-quote-bg: var(--st-bg-soft);
}

.st-blog-article__footer {
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid var(--st-border);
}

.st-blog-related {
    max-width: 720px;
    margin: 48px auto 0;
}
.st-blog-related__title {
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.st-blog-grid--related {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.st-blog-grid--related .st-blog-card__body { padding: 14px; }
.st-blog-grid--related .st-blog-card__title { font-size: 16px; }

/* En modo oscuro el acento de la tienda suele ser casi blanco y como
   color de enlace dentro del texto no se distingue: se usa un azul
   claro sólo para eso. */
body.theme-store.theme-store-dark .st-blog-article__body,
body.theme-store.theme-store-auto .st-blog-article__body {
    --blog-color-accent: #93b4ff;
}

@media (prefers-color-scheme: light) {
    body.theme-store.theme-store-auto .st-blog-article__body {
        --blog-color-accent: var(--st-accent);
    }
}

@media (max-width: 640px) {
    .st-blog-grid--related { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .st-blog-grid { gap: 16px; }
    .st-blog-card__body { padding: 15px; }
    .st-blog-article__cover { margin-bottom: 22px; }
    .st-blog-pagination { justify-content: space-between; }
}
