/* ═══════════════════════════════════════════════════════════
   RESOURCE CARDS (2026-11-19): guides and templates on /en/blog
   (Resources), the "Resources" teaser on /en/ and "Related guides"
   under each post. One stylesheet for all of them; the card HTML is
   generated from tools/resources/resources.json (see build.rb there).
   White cards with a hairline border and an abstract cover per topic,
   no shadows. Colours use each English page's tokens, with the same values
   as fallbacks. */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Every card fills its grid cell, so cards in a row share one height. */
.blog-grid > li {
    display: flex;
    margin: 0;
}

/* Cards hidden by the Topics filter on /en/blog. */
.blog-grid > li[hidden] { display: none; }

.blog-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    border: 0.5px solid var(--border-color, rgba(36, 21, 26, 0.12));
    border-radius: 12px;
    background: var(--surface, #FFFFFF);
    color: var(--text-primary, #24151A);
    text-decoration: none;
    transition: border-color 200ms ease;
}

.blog-card:focus-visible {
    outline: 1px solid var(--text-primary, #24151A);
    outline-offset: 4px;
}

/* Cover: 16:10 inline SVG, one abstract motif per topic (COVERS in
   build.rb). The card clips its top corners. */
.blog-card-cover {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
}

.cover-brown { --cover: var(--bg-dark, #24151A); }
.cover-coral { --cover: var(--primary-color, #FF7A59); }
.cover-cream { --cover: var(--bg-primary, #F6F4F0); }
.cover-blush { --cover: #F2E0D8; }

.cover-fill { fill: var(--cover); }

.cover-line {
    fill: none;
    stroke: var(--cover);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cover-accent { transition: transform 400ms cubic-bezier(0.2, 0.7, 0.2, 1); }

.blog-card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px 22px 22px;
}

.blog-card-tag {
    color: var(--primary-color, #FF7A59);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-transform: uppercase;
}

.blog-card-title {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--text-primary, #24151A);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.blog-card-excerpt {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--text-secondary, rgba(36, 21, 26, 0.68));
    font-size: 0.9375rem;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

/* Pushed to the bottom, so the meta lines of a row line up. */
.blog-card-meta {
    margin: auto 0 0;
    padding-top: 8px;
    color: var(--text-light, rgba(36, 21, 26, 0.62));
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    line-height: 1.5;
}

@media (hover: hover) {
    .blog-card:hover { border-color: rgba(36, 21, 26, 0.28); }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .blog-card:hover .cover-accent { transform: translateX(3px); }
}

/* Compact: "Related guides" under a post (no excerpt, smaller type). */
.blog-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.blog-grid--compact .blog-card-body { gap: 6px; padding: 16px 18px 18px; }
.blog-grid--compact .blog-card-title { font-size: 1.0625rem; line-height: 1.35; }

/* "Related guides" inside an article: keeps the article's own text,
   link and list styles off the cards. */
.bp-article .bp-guides {
    margin-top: 3.5em;
    padding-top: 2em;
    border-top: 1px solid var(--border-color, rgba(36, 21, 26, 0.12));
}

.bp-article .bp-guides .blog-grid { margin-top: 20px; padding: 0; }
.bp-article .blog-grid > li { margin: 0; }
.bp-article .blog-card,
.bp-article .blog-card:hover { color: var(--text-primary, #24151A); text-decoration: none; }

/* Pages: only shown when there are more than 9 items. */
.blog-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 56px;
}

.blog-pagination a,
.blog-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    border-bottom: 1px solid transparent;
    color: var(--text-secondary, rgba(36, 21, 26, 0.68));
    font-weight: 500;
    text-decoration: none;
}

.blog-pagination a:hover { color: var(--text-primary, #24151A); }

.blog-pagination [aria-current="page"] {
    border-bottom-color: var(--primary-color, #FF7A59);
    color: var(--text-primary, #24151A);
}

@media (max-width: 1023px) {
    .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
    .blog-grid,
    .blog-grid--compact { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

