/* Blog. Long-form reading, so the measure is narrow and the type is a step larger
   than the marketing pages, which are scanned rather than read. */

.container-narrow {
    max-width: 720px;
}

/* The index has no masthead, so it supplies its own breathing room under the nav. */
.post-index {
    padding: 72px 0 80px;
}

/* Announced, not displayed: the page needs a top-level heading it does not need to show. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Without a hero above it, the first item should not start with a rule of whitespace. */
.post-index .post-list-item:first-child {
    padding-top: 0;
}

/* Index */
.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-list-item {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.post-list-item:last-child {
    border-bottom: none;
}

.post-list-meta,
.post-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.post-list-item h2 {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 0.6rem;
}

.post-list-item h2 a {
    color: var(--text-dark);
    text-decoration: none;
}

.post-list-item h2 a:hover {
    color: var(--primary-color);
}

.post-list-item p {
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.post-list-more {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
}

/* Article */
.post {
    padding: 60px 0 40px;
}

.post-back {
    margin-bottom: 2rem;
}

.post-back a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
}

.post-back a:hover {
    color: var(--primary-color);
}

.post-title {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.post-meta {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
}

.post-body {
    font-size: 1.0625rem;
    line-height: 1.75;
}

.post-body > p,
.post-body > ul,
.post-body > ol,
.post-body > blockquote,
.post-body > .example {
    margin-bottom: 1.5rem;
}

.post-body h2 {
    font-size: 1.5rem;
    margin: 2.75rem 0 1rem;
    line-height: 1.3;
}

.post-body h3 {
    font-size: 1.175rem;
    margin: 2rem 0 0.75rem;
}

.post-body ul,
.post-body ol {
    padding-left: 1.35rem;
}

.post-body li {
    margin-bottom: 0.6rem;
}

.post-body a {
    color: var(--primary-color);
}

.post-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--background-section);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-body blockquote {
    border-left: 3px solid var(--border-color);
    padding-left: 1.25rem;
    color: var(--text-light);
    font-style: italic;
}

/* Paired good/bad samples. The border colour carries the same meaning as the label,
   never on its own. */
.example {
    border: 1px solid var(--border-color);
    border-left-width: 3px;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    background: var(--background-light);
}

.example-bad {
    border-left-color: #ef4444;
}

.example-good {
    border-left-color: var(--success-color);
}

.example-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.example p:last-child {
    margin-bottom: 0;
}

.post-cta {
    margin-top: 3.5rem;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--background-light);
    text-align: center;
}

.post-cta h3 {
    margin-bottom: 0.5rem;
}

.post-cta p {
    color: var(--text-light);
    margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
    .post-title { font-size: 1.75rem; }
    .post-body { font-size: 1rem; }
}

/* Other guides, at the foot of a guide. Reference pages are browsed sideways more than
   posts are, so they carry the list a blog post does not need. */
.guide-more {
    margin-top: 3rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border-color);
}

.guide-more h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.guide-more ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide-more li {
    margin-bottom: 0.4rem;
}

.guide-more a {
    color: var(--primary-color);
    text-decoration: none;
}
