/* The blog landing page: a grid of tutorial cards in the same look as the home page (rounded
   cards with the punch-hole, Smythe titles, a pill button), with the blog's dark mode. */

:root {
    --bh-bg: var(--color-surface-primary);
    --bh-card: var(--color-surface-card);
    --bh-text: var(--color-primary-text);
    --bh-title: var(--color-title-text);
    --bh-accent: var(--color-surface-active);
    --bh-link: var(--color-link-text);
    --bh-muted: #777777;
    --bh-chip: rgba(0, 0, 0, 0.07);
}

html.blog-dark-mode {
    --bh-bg: #171513;
    --bh-card: #211d19;
    --bh-text: #ead9c5;
    --bh-title: #ead9c5;
    --bh-accent: #e07a5f;
    --bh-link: #f0b66a;
    --bh-muted: #b9aa9b;
    --bh-chip: rgba(255, 255, 255, 0.08);
}

html,
body {
    margin: 0;
    background: var(--bh-bg);
    color: var(--bh-text);
    min-height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
}

/* top menu: the home page's own menu (base.css), with the theme button on the right */
#menu a {
    color: var(--bh-text);
}

#menu a.active-menu,
#menu a:hover {
    color: var(--bh-accent);
}

#bh-theme {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 4px;
}

/* title */
.bh-main {
    flex: 1;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: var(--menu-height) 24px 56px;
    box-sizing: border-box;
}

.bh-hero {
    text-align: center;
    padding: 40px 0 36px;
}

.bh-hero h1 {
    font-family: var(--font-title);
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    line-height: 1.05;
    margin: 0 0 14px;
    padding: 0;
    color: var(--bh-title);
}

.bh-hero p {
    max-width: 36em;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* cards */
.bh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

.bh-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bh-card);
    border-radius: 16px;
    padding: 36px 24px 24px;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.bh-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.3);
}

/* the punch hole, as on the home page */
.bh-card::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 50%;
    width: 1.1rem;
    height: 1.1rem;
    margin-left: -0.55rem;
    border-radius: 50%;
    background: var(--bh-bg);
    box-shadow: inset 0 3px 3px rgba(0, 0, 0, 0.3);
}

.bh-art {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.bh-art img {
    width: 62%;
    max-width: 230px;
    height: auto;
    border-radius: 12px;
}

.bh-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
}

.bh-kicker {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bh-link);
}

.bh-body h2 {
    margin: 0;
    padding: 0;
    font-family: var(--font-title);
    font-size: 1.9rem;
    line-height: 1.12;
    color: var(--bh-title);
}

.bh-body h2 a {
    text-decoration: none;
}

/* the whole card is clickable through the title link */
.bh-body h2 a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
}

.bh-text {
    margin: 0;
    line-height: 1.6;
}

.bh-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bh-tags li {
    padding: 3px 11px;
    border-radius: 999px;
    background: var(--bh-chip);
    font-size: 0.78rem;
    color: var(--bh-muted);
}

.bh-cta {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    margin-top: auto;
    padding: 9px 20px;
    border-radius: 25px;
    background: var(--bh-accent);
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
}

.bh-cta:hover {
    filter: brightness(1.08);
}

.bh-footer {
    padding: 16px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--bh-muted);
}

@media (max-width: 560px) {
    /* #menu ul (base.css) is more specific than #menu-items, so name both. */
    #menu #menu-items {
        gap: 14px;
        justify-content: center;
        padding: 0 48px 0 12px;
    }
    .bh-main {
        padding: var(--menu-height) 16px 40px;
    }
    .bh-hero {
        padding: 24px 0 24px;
    }
    .bh-card {
        padding: 34px 18px 20px;
    }
}
