/*
 * Post styling for enthuse / episodes / reflections, after Strange Ambience:
 * a hairline and generous space between posts, an uppercase date line, a
 * proper rhythm inside post bodies, and tags as pill links at the foot of
 * each post.
 *
 * Strange Ambience's brown comes from its own masthead photo; here the same
 * roles use Feedback Monitor's copper. #cb9662 itself is too light for text
 * on white (2.6:1), so text uses a deeper copper (#8c5a2c, 5.8:1) and the
 * light copper is kept for fills, outlines and rules.
 *
 * The CMS stylesheet sets `a { color: red !important }` and
 * `h1 { color: white !important }` (for the masthead), so colours on links
 * and the page heading below need !important; they win on specificity.
 *
 * Canonical copy: shared/blog/css/blog.css (see bin/sync-shared.sh).
 */

#fm-content {
    --brand: #8c5a2c;
    --brand-dark: #6e4520;
    --brand-tint: rgba(203, 150, 98, 0.12);
    --brand-line: rgba(203, 150, 98, 0.5);
    --brand-rule: rgba(203, 150, 98, 0.35);
    --muted: #6b6257;

    padding-top: 2.5rem;
    padding-bottom: 3.5rem;
}


/* Links ------------------------------------------------------------- */

#fm-content a,
#fm-content a:link,
#fm-content a:visited {
    color: var(--brand) !important;
    text-underline-offset: 2px;
    text-decoration-color: var(--brand-line);
}

#fm-content a:hover,
#fm-content a:focus {
    color: var(--brand-dark) !important;
    text-decoration-color: var(--brand-dark);
}

#fm-content a:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 2px;
}


/* The list of posts: separation between entries ------------------- */

#fm-content ul#index {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

#index > li {
    margin-bottom: 4.5rem;
    padding-bottom: 3.5rem;
    border-bottom: 1px solid var(--brand-rule);
}

#index > li:last-child {
    margin-bottom: 2.5rem;
    padding-bottom: 0;
    border-bottom: none;
}

#fm-content #index article h2,
#fm-content article > h2 {
    margin-top: 0.75rem;
    margin-bottom: 0.9rem;
    font-family: TitilliumText-Bold, var(--fm-font, system-ui, sans-serif);
    font-weight: normal;
    line-height: 1.3;
}

#index article h2 a {
    text-decoration: none;
}

#index article h2 a:hover {
    text-decoration: underline;
}


/* Date line --------------------------------------------------------- */

.entry-meta {
    display: block;
    margin: 0 0 1.5rem;
}

.entry-date {
    display: block;
    margin-bottom: 0.6rem;
    font-family: TitilliumText-Bold, var(--fm-font, system-ui, sans-serif);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}


/* Tags -------------------------------------------------------------- */

/* Not scoped as "article > .categories": stored posts can carry a stray
   </article> that closes the wrapper early in the parsed page. */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1.4rem 0 0.9rem;
    padding: 0;
    list-style: none;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 0.7rem;
    line-height: 1;
    font-family: TitilliumText-Bold, var(--fm-font, system-ui, sans-serif);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    text-transform: lowercase;
    background-color: var(--brand-tint);
    border: 1px solid var(--brand-line);
    border-radius: 999px;
}

#fm-content a.category-tag,
#fm-content a.category-tag:link,
#fm-content a.category-tag:visited {
    color: var(--brand-dark) !important;
    text-decoration: none;
}

#fm-content a.category-tag:hover,
#fm-content a.category-tag:focus {
    color: #fff !important;
    background-color: var(--brand);
    border-color: var(--brand);
}


/* Inside a post ----------------------------------------------------- */

.entry-body {
    line-height: 1.65;
}

.entry-body p {
    margin: 0 0 1.4rem;
}

.entry-body img,
.entry-body iframe,
.entry-body video,
.entry-body embed,
.entry-body object {
    display: block;
    max-width: 100%;
    margin: 2.2rem 0;
}

.entry-body img {
    height: auto;
}

.entry-body h1,
.entry-body h2,
.entry-body h3,
.entry-body h4 {
    margin: 2.4rem 0 0.9rem;
    line-height: 1.3;
}

/* No double gap where a heading or paragraph opens the body */
.entry-body > *:first-child {
    margin-top: 0;
}

.entry-body > *:last-child {
    margin-bottom: 0;
}

.entry-body blockquote {
    margin: 2rem 0;
    padding-left: 1.2rem;
    border-left: 3px solid var(--brand-line);
    color: var(--muted);
}

/* A post's uploaded image, above its body on the article page */
.entry-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 0 2.2rem;
}


/* Previous / Next --------------------------------------------------- */

.pagination-nav {
    margin: 0 0 1rem;
}

#fm-content .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Bootstrap styles .page-link heavily, so these need to win on specificity */
#fm-content .pagination .page-item .page-link,
#fm-content .pagination .page-item .page-link:link,
#fm-content .pagination .page-item .page-link:visited {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1.1rem;
    font-family: TitilliumText-Bold, var(--fm-font, system-ui, sans-serif);
    font-size: 0.9rem;
    color: var(--brand-dark) !important;
    background-color: var(--brand-tint);
    border: 1px solid var(--brand-line);
    border-radius: 999px;
    text-decoration: none;
}

#fm-content .pagination .page-item .page-link:hover,
#fm-content .pagination .page-item .page-link:focus {
    color: #fff !important;
    background-color: var(--brand);
    border-color: var(--brand);
    box-shadow: none;
}


/* Tag page heading -------------------------------------------------- */

#fm-content .page-heading {
    margin: 0 0 0.4rem;
    font-family: TitilliumText-Bold, var(--fm-font, system-ui, sans-serif);
    font-weight: normal;
    color: #212529 !important;
}

.result-summary {
    margin: 0 0 2rem;
    font-style: italic;
    color: var(--muted);
}


/* Shorter masthead on every page but each blog's home page ---------- */

/* Same photograph and title, just short enough that the content starts
   above the fold - arriving from a tag or a post title puts the reader on
   the content, not another full screen of splash */
.masthead.masthead-short {
    height: 55vh;
    height: 55dvh;
    min-height: 260px;
    max-height: 560px;
}

/* The content is already in view, so the "scroll down" chevron is not needed */
.masthead-short .fm-scroll-cue {
    display: none;
}
