/* Blog: /blog and /blog/<slug> (pages/blogList.ejs, pages/blogArticle.ejs, partials/blog*.ejs).
   Hand-written, no SCSS source. Loaded after main_page.css (fonts and the .footer of
   SiteFooter.ejs); its `* { margin: 0; padding: 0; color: #141414 }` is why paragraphs,
   lists and links get their spacing and colour back here. Colours and type: DESIGN.md. */

/* main_page.css puts a font and a colour on every element (`*`): inside the blog they are inherited
   again, so a link in a heading takes the heading's font. Rules below set them where they differ. */
.blog * {
    font-family: inherit;
    color: inherit;
}

:root {
    --blog-blue: #4450F2;
    --blog-blue-hover: #1D29C7;
    --blog-ink: #141414;
    --blog-muted: #5F6670;
    --blog-line: #DDDFE0;
    --blog-soft: #F8F8F8;
    --blog-lavender: #EEF0FF;
}

.blog {
    box-sizing: border-box;
    max-width: 1140px;
    margin: 0 auto;
    padding: 24px 15px 96px;
}

/* ── List ── */
.blog-intro {
    max-width: 760px;
    margin-bottom: 40px;
}

.blog-title,
.blog-article__title {
    margin-bottom: 16px;
    font-family: 'Poppins', Roboto, sans-serif;
    font-size: 42px;
    line-height: 50px;
    font-weight: 600;
}

.blog-lead {
    font-size: 20px;
    line-height: 32px;
    color: var(--blog-muted);
}

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

.blog-card {
    display: flex;
    flex-direction: column;
}

.blog-card__image-link {
    display: block;
    margin-bottom: 16px;
}

.blog-card__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1.91;
    object-fit: cover;
    border-radius: 12px;
    background: var(--blog-soft);
}

.blog-card__title {
    margin-bottom: 8px;
    font-family: 'Poppins', Roboto, sans-serif;
    font-size: 21px;
    line-height: 29px;
    font-weight: 600;
}

.blog-card__title a:hover {
    color: var(--blog-blue);
}

.blog-card__desc {
    font-size: 16px;
    line-height: 24px;
    color: var(--blog-muted);
}

.blog-card__date {
    margin-top: auto;
    padding-top: 12px;
    font-size: 14px;
    line-height: 20px;
}

.blog-card__date,
.blog-card__date time {
    color: var(--blog-muted);
}

/* ── Article: text column, documents beside it on a wide screen ── */
.blog--article {
    display: grid;
    grid-template-columns: minmax(0, 760px) minmax(0, 300px);
    justify-content: space-between;
    column-gap: 48px;
    align-items: start;
}

.blog--article .blog-docs {
    position: sticky;
    top: 24px;
    margin-top: 0;
}

.blog--article .blog-more {
    grid-column: 1 / -1;
}

.blog-article__meta,
.blog-article__meta time {
    font-size: 15px;
    line-height: 24px;
    color: var(--blog-muted);
}

.blog-article__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1.91;
    object-fit: cover;
    margin-top: 28px;
    border-radius: 16px;
    background: var(--blog-soft);
}

.blog-article__body {
    margin-top: 32px;
    font-size: 18px;
    line-height: 30px;
}

.blog-article__body p,
.blog-article__body ul,
.blog-article__body ol,
.blog-article__body table {
    margin-bottom: 20px;
}

.blog-article__body h2 {
    margin: 48px 0 16px;
    font-family: 'Poppins', Roboto, sans-serif;
    font-size: 28px;
    line-height: 36px;
    font-weight: 600;
}

.blog-article__body h3 {
    margin: 32px 0 12px;
    font-family: 'Poppins', Roboto, sans-serif;
    font-size: 21px;
    line-height: 29px;
    font-weight: 600;
}

.blog-article__body h2 + h3 {
    margin-top: 16px;
}

.blog-article__body ul,
.blog-article__body ol {
    padding-left: 26px;
}

.blog-article__body li {
    margin-bottom: 8px;
}

.blog-article__body li > ul,
.blog-article__body li > ol {
    margin: 8px 0 0;
}

.blog-article__body strong {
    font-weight: 600;
}

.blog-article__body a {
    color: var(--blog-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-article__body a:hover {
    color: var(--blog-blue-hover);
}

.blog-article__body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 24px;
}

.blog-article__body th,
.blog-article__body td {
    padding: 12px 16px 12px 0;
    border-bottom: 1px solid var(--blog-line);
    text-align: left;
    vertical-align: top;
}

.blog-article__body th {
    font-weight: 600;
    border-bottom-width: 2px;
}

/* A short aside inside an article: <p class="blog-note"> */
.blog-article__body .blog-note {
    padding: 16px 20px;
    border-radius: 12px;
    background: var(--blog-lavender);
}

/* ── Documents for your trip (beside an article, under the list) ── */
.blog-docs {
    margin-top: 64px;
    padding: 24px;
    border-radius: 16px;
    background: var(--blog-soft);
}

.blog-docs__title {
    margin-bottom: 16px;
    font-family: 'Poppins', Roboto, sans-serif;
    font-size: 21px;
    line-height: 29px;
    font-weight: 600;
}

.blog-docs__list {
    list-style: none;
}

.blog-docs__item {
    display: block;
    padding: 14px 0;
    border-top: 1px solid var(--blog-line);
}

.blog-docs__name {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
    color: var(--blog-blue);
}

.blog-docs__item:hover .blog-docs__name {
    color: var(--blog-blue-hover);
    text-decoration: underline;
}

.blog-docs__sub {
    display: block;
    font-size: 14px;
    line-height: 21px;
    color: var(--blog-muted);
}

/* Under the list of articles the three documents stand in a row */
.blog--list .blog-docs__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 32px;
}

/* ── More from the blog ── */
.blog-more {
    margin-top: 72px;
    padding-top: 40px;
    border-top: 1px solid var(--blog-line);
}

.blog-more__title {
    margin-bottom: 24px;
    font-family: 'Poppins', Roboto, sans-serif;
    font-size: 28px;
    line-height: 36px;
    font-weight: 600;
}

@media (max-width: 1023.98px) {
    .blog--article {
        display: block;
    }

    .blog--article .blog-docs {
        position: static;
        margin-top: 48px;
    }

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

@media (max-width: 767.98px) {
    .blog {
        padding: 16px 16px 64px;
    }

    .blog-title,
    .blog-article__title {
        font-size: 30px;
        line-height: 38px;
    }

    .blog-lead {
        font-size: 18px;
        line-height: 28px;
    }

    .blog-article__body {
        font-size: 17px;
        line-height: 28px;
    }

    .blog-article__body h2 {
        margin-top: 40px;
        font-size: 24px;
        line-height: 32px;
    }

    .blog-article__body h3 {
        font-size: 19px;
        line-height: 27px;
    }

    /* a wide table scrolls by itself, the page does not */
    .blog-article__body table {
        display: block;
        overflow-x: auto;
    }

    .blog-cards,
    .blog--list .blog-docs__list {
        grid-template-columns: minmax(0, 1fr);
    }
}
