/* static/css/blog/blog.css
   Blog — the list and one post, on StarRank's recipe: 604px stage,
   charcoal band with a gold hairline, white cards with 2px ink borders,
   Roboto titles, dates and text. Prefix blog-.
   The pager is the site's shared one, loaded by base.html. */

/* ---- header band: charcoal + gold hairline ---- */

/* the list's heading, and on a post the way back to the list */
.blog-eyebrow {
    display: inline-block;
    margin: 0;
    text-decoration: none;
}

a.blog-eyebrow:hover {
    color: #e0c04f;
}

/* the list's heading is a link to every post, flair filter off */
h1.blog-eyebrow a {
    color: inherit;
    text-decoration: none;
}

h1.blog-eyebrow a:hover {
    color: #e0c04f;
}

/* on a post: the way back on the left, the owner's EDIT on the right */
.blog-band {
    display: flex;
    align-items: center;
}

.blog-edit {
    margin-left: auto;
}

/* ---- flair buttons over the list, and the flair on a post: a copy of
   StarRank's subreddit chips on REDDIT, as links ---- */

.blog-chip {
    display: inline-block;
    font: 700 0.875rem/1.4 'Roboto', sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dark-surface);
    background: var(--cream);
    border: 2px solid var(--dark-surface);
    padding: 2px 9px;
    text-decoration: none;
    white-space: nowrap;
}

.blog-chip:hover {
    background: var(--surface);
}

.blog-chip.active {
    color: var(--accent-gold);
    background: var(--bg-footer);
}

/* ---- a post: a card on the list, the whole text on its own page ---- */
.blog-card {
    background: var(--surface);
    border: 2px solid var(--dark-surface);
    padding: 0.7rem 0.8rem 0.8rem;
    margin-bottom: 0.6rem;
}

.blog-date {
    display: inline-block;
    font: 700 0.875rem/1.4 'Roboto', sans-serif;
    color: var(--bg-footer);
    background: var(--cream);
    border: 1px solid var(--dark-surface);
    padding: 1px 7px;
    white-space: nowrap;
}

.blog-card-title,
.blog-title {
    margin: 0.45rem 0 0.35rem;
    font: 700 1.15rem/1.3 'Roboto', sans-serif;
    color: var(--dark-surface);
    overflow-wrap: anywhere;
}

.blog-title {
    font-size: 1.5rem;
    margin-bottom: 0.6rem;
}

/* the title is the way in, so it reads as a link */
.blog-card-title a {
    color: var(--accent-teal);
    text-decoration: none;
}

.blog-card-title a:hover {
    color: var(--accent-teal-dark);
}

.blog-lead {
    margin: 0;
    font: 400 1rem/1.5 'Roboto', sans-serif;
    color: var(--dark-surface);
    overflow-wrap: anywhere;
}

.blog-empty {
    margin: 0;
    font: 400 1rem/1.5 'Roboto', sans-serif;
    color: var(--dark-surface);
    background: var(--surface);
    border: 2px solid var(--dark-surface);
    padding: 0.7rem 0.8rem;
}

/* ---- the post's text, as the formatter hands it over ---- */
.blog-text {
    font: 400 1.05rem/1.65 'Roboto', sans-serif;
    color: var(--dark-surface);
    overflow-wrap: anywhere;
}

.blog-text > :first-child {
    margin-top: 0;
}

.blog-text > :last-child {
    margin-bottom: 0;
}

.blog-text p,
.blog-text ul,
.blog-text ol,
.blog-text blockquote,
.blog-text pre,
.blog-text table {
    margin: 0 0 0.9rem;
}

/* A Reddit picture: its own size, never wider than the text */
.blog-text img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* A table breaks between words only, never inside a number or a heading;
   too wide for the card, it slides sideways instead of shredding a column */
.blog-text table {
    display: block;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.blog-text th,
.blog-text td {
    overflow-wrap: normal;
    padding: 0.3rem 0.6rem;
}

/* The head is the site's charcoal band; every other row is parchment, so a
   reader follows a line across without a rule under every row */
.blog-text thead th {
    color: var(--accent-gold);
    background: var(--bg-footer);
}

.blog-text tbody tr:nth-child(even) {
    background: var(--cream);
}

.blog-text ul,
.blog-text ol {
    padding-left: 1.4rem;
}

.blog-text h1,
.blog-text h2,
.blog-text h3,
.blog-text h4,
.blog-text h5,
.blog-text h6 {
    margin: 1.2rem 0 0.5rem;
    font: 700 1.1rem/1.3 'Roboto', sans-serif;
    color: var(--dark-surface);
}

.blog-text a {
    color: var(--accent-teal);
}

.blog-text blockquote {
    border-left: 3px solid var(--accent-gold);
    padding-left: 0.8rem;
}

.blog-text pre {
    overflow-x: auto;
    background: var(--cream);
    border: 2px solid var(--dark-surface);
    padding: 0.5rem 0.6rem;
}

.blog-text code {
    font-size: 0.9em;
}

.blog-text img {
    max-width: 100%;
    height: auto;
}

.blog-text hr {
    border: none;
    border-top: 2px solid var(--dark-surface);
    margin: 1.2rem 0;
}

@media (max-width: 480px) {
    .blog-card,
    .blog-empty {
        padding: 0.5rem 0.35rem;
        margin-bottom: 0.4rem;
    }
    .blog-title {
        font-size: 1.3rem;
    }
}
