/* The blog: lists of posts, the post page and its typography. Colours and fonts come from theme.css */

/* Blog header (above the list) */
.blog-header {
    background: var(--x-grey-light);
    border-bottom: 1px solid var(--x-line);
    padding: 64px 0 28px;
}

.blog-header-kicker {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--x-grey);
    margin-bottom: 6px;
}

.blog-header-title {
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.05;
    margin: 0;
}

.blog-dot {
    color: var(--x-yellow-strong);
}

.blog-header-intro {
    font-size: 1.05rem;
    margin: 14px 0 0;
    max-width: 36rem;
}

.blog-search {
    position: relative;
}

.blog-search .fas {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--x-grey);
    pointer-events: none;
}

.blog-search .form-control {
    border-radius: 999px;
    padding: 12px 20px 12px 46px;
    border-color: var(--x-line);
    background: #fff;
}

.blog-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 32px;
}

.blog-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--x-line);
    border-radius: 999px;
    background: #fff;
    color: var(--x-charcoal);
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color .15s, background-color .15s;
}

.blog-chip:hover,
.blog-chip:focus-visible {
    border-color: var(--x-charcoal);
    color: var(--x-charcoal);
}

.blog-chip.active {
    background: var(--x-charcoal);
    border-color: var(--x-charcoal);
    color: #fff;
}

.blog-chip-count {
    font-size: .72rem;
    opacity: .6;
}

/* Post cards */
.post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card-media {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: var(--x-radius);
    background: var(--x-grey-light);
    margin-bottom: 18px;
}

.post-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.post-card:hover .post-card-media img {
    transform: scale(1.03);
}

.post-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--x-yellow);
    overflow: hidden;
}

.post-card-placeholder::before {
    content: '';
    position: absolute;
    width: 70%;
    aspect-ratio: 1;
    right: -18%;
    top: -30%;
    border: 14px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
}

.post-card-placeholder span {
    font-size: 3.4rem;
    font-weight: 700;
    color: var(--x-charcoal);
}

.post-kicker {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--x-charcoal);
    text-decoration: none;
    border-bottom: 2px solid var(--x-yellow);
    margin-bottom: 10px;
}

.post-kicker:hover {
    border-bottom-color: var(--x-charcoal);
    color: var(--x-charcoal);
}

.post-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -.01em;
    margin-bottom: 10px;
}

.post-card-title a {
    color: var(--x-charcoal);
    text-decoration: none;
    background-image: linear-gradient(var(--x-yellow), var(--x-yellow));
    background-size: 0 35%;
    background-position: 0 88%;
    background-repeat: no-repeat;
    transition: background-size .25s ease;
}

.post-card-title a:hover,
.post-card-title a:focus-visible {
    background-size: 100% 35%;
}

.post-card-excerpt {
    margin-bottom: 18px;
}

.post-card .post-byline {
    margin-top: auto;
}

/* The big first post on the blog's front page */
@media (min-width: 992px) {
    .post-card-featured {
        display: grid;
        grid-template-columns: 1.15fr 1fr;
        gap: 48px;
        align-items: center;
    }

    .post-card-featured .post-card-media {
        margin-bottom: 0;
    }

    .post-card-featured .post-byline {
        margin-top: 0;
    }
}

.post-card-featured .post-card-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.post-card-featured .post-card-excerpt {
    font-size: 1.02rem;
}

/* Author, date and reading time */
.post-byline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-avatar {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--x-charcoal);
    color: var(--x-yellow);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .03em;
}

.post-byline-text {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.post-author {
    font-weight: 600;
    font-size: .88rem;
    color: var(--x-charcoal);
}

.post-meta {
    font-size: .8rem;
}

/* Paging and empty lists */
.blog-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 64px;
    padding-top: 28px;
    border-top: 1px solid var(--x-line);
}

.blog-pager-status {
    font-size: .85rem;
}

.blog-empty {
    text-align: center;
    padding: 48px 0;
}

.blog-empty .far {
    font-size: 2.6rem;
    color: var(--x-yellow-strong);
    margin-bottom: 16px;
}

/* The post page */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 1030;
    pointer-events: none;
}

.reading-progress span {
    display: block;
    height: 100%;
    background: var(--x-yellow-strong);
    width: 0;
}

.post-preview-banner {
    background: var(--x-yellow);
    color: var(--x-charcoal);
    padding: 10px 0;
    font-size: .88rem;
}

.post-container {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.post-header {
    padding: 56px 0 36px;
}

.post-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.post-breadcrumb a {
    color: var(--x-grey);
    text-decoration: none;
}

.post-breadcrumb a:hover {
    color: var(--x-charcoal);
}

.post-breadcrumb .fas {
    font-size: .6rem;
    color: var(--x-yellow-strong);
}

.post-title {
    font-size: clamp(2rem, 5vw, 3.1rem);
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.12;
    margin-bottom: 18px;
}

.post-lead {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 28px;
}

.post-hero-image {
    margin: 0 auto 8px;
}

.post-hero-image img {
    width: 100%;
    height: auto;
    max-height: 640px;
    object-fit: cover;
    border-radius: var(--x-radius);
}

.site-main:has(.post-container) {
    padding-top: 40px;
}

/* The post's text */
.prose {
    font-size: 1.07rem;
    line-height: 1.8;
    color: #3d3d3d;
    overflow-wrap: break-word;
}

.prose > * + * {
    margin-top: 1.4em;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre {
    margin-bottom: 0;
}

.prose h2,
.prose h3,
.prose h4 {
    color: var(--x-charcoal);
    font-weight: 700;
    letter-spacing: -.015em;
    line-height: 1.3;
    margin-bottom: 0;
}

.prose h2 {
    font-size: 1.7rem;
    margin-top: 2em;
}

.prose h3 {
    font-size: 1.35rem;
    margin-top: 1.8em;
}

.prose h4 {
    font-size: 1.12rem;
    margin-top: 1.6em;
}

.prose a {
    color: var(--x-charcoal);
    text-decoration: underline;
    text-decoration-color: var(--x-yellow-strong);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.prose a:hover {
    background: var(--x-yellow-soft);
}

.prose strong {
    color: var(--x-charcoal);
}

.prose ul,
.prose ol {
    padding-left: 1.4em;
}

.prose li + li {
    margin-top: .45em;
}

.prose li::marker {
    color: var(--x-yellow-strong);
    font-weight: 600;
}

.prose blockquote {
    border-left: 4px solid var(--x-yellow);
    padding: .2em 0 .2em 1.3em;
    font-size: 1.2rem;
    font-style: italic;
    color: var(--x-charcoal);
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--x-radius);
}

.prose hr {
    border: 0;
    height: auto;
    opacity: 1;
    text-align: center;
    margin: 2.4em 0;
}

.prose hr::before {
    content: '\2022\2002\2022\2002\2022';
    color: var(--x-yellow-strong);
    letter-spacing: .4em;
}

.prose code {
    font-size: .88em;
    background: var(--x-grey-light);
    border: 1px solid var(--x-line);
    border-radius: 5px;
    padding: .1em .35em;
    color: #b0006a;
}

.prose pre {
    background: #fafafa;
    border: 1px solid var(--x-line);
    border-radius: var(--x-radius);
    padding: 1.1em 1.3em;
    font-size: .88rem;
    line-height: 1.65;
    white-space: pre;
    overflow-x: auto;
}

.prose pre.hljs {
    background: #fafafa;
}

.prose .ql-align-center {
    text-align: center;
}

.prose .ql-align-right {
    text-align: right;
}

.prose .ql-align-justify {
    text-align: justify;
}

.prose .ql-indent-1 {
    padding-left: 2em;
}

.prose .ql-indent-2 {
    padding-left: 4em;
}

.prose .ql-indent-3 {
    padding-left: 6em;
}

/* Under the post */
.post-footer {
    margin-top: 56px;
}

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

.post-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 22px 0;
    border-top: 1px solid var(--x-line);
    border-bottom: 1px solid var(--x-line);
}

.post-share-label {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-right: 6px;
}

.post-share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--x-line);
    background: #fff;
    color: var(--x-charcoal);
    text-decoration: none;
    transition: background-color .15s, border-color .15s;
}

.post-share-button:hover,
.post-share-button:focus-visible {
    background: var(--x-yellow);
    border-color: var(--x-yellow);
    color: var(--x-charcoal);
}

.post-share-copied {
    font-size: .82rem;
    margin-left: 4px;
}

.post-author-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--x-grey-light);
    border-radius: var(--x-radius);
    padding: 24px 26px;
    margin: 36px 0;
}

.post-author-card a {
    color: var(--x-charcoal);
}

.post-adjacent {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.post-adjacent-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid var(--x-line);
    border-radius: var(--x-radius);
    color: var(--x-charcoal);
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: border-color .15s;
}

.post-adjacent-link:hover {
    border-color: var(--x-charcoal);
    color: var(--x-charcoal);
}

.post-adjacent-link span {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--x-grey);
}

@media (max-width: 575.98px) {
    .post-adjacent {
        grid-template-columns: 1fr;
    }
}

.post-related {
    margin-top: 88px;
    padding-top: 56px;
    border-top: 1px solid var(--x-line);
}

.section-heading {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin-bottom: 32px;
}

.section-heading::after {
    content: '.';
    color: var(--x-yellow-strong);
}

/* Newest posts on the home page */
.home-posts {
    margin-top: 88px;
    padding-top: 56px;
    border-top: 1px solid var(--x-line);
}

/* Comments */
.post-comment-link {
    margin-left: auto;
    font-size: .85rem;
    font-weight: 500;
    color: var(--x-charcoal);
    text-decoration: none;
}

.post-comment-link:hover {
    text-decoration: underline;
    text-decoration-color: var(--x-yellow-strong);
}

.comments {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid var(--x-line);
    scroll-margin-top: 24px;
}

.comment-list,
.comment-replies {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list > li + li {
    border-top: 1px solid var(--x-line);
}

.comment-replies {
    margin: 0 0 8px 26px;
    padding-left: 26px;
    border-left: 2px solid var(--x-yellow);
}

.comment {
    padding: 22px 0;
    scroll-margin-top: 24px;
}

.comment:target {
    animation: comment-highlight 2.5s ease-out;
}

@keyframes comment-highlight {
    from { background: var(--x-yellow-soft); box-shadow: 0 0 0 12px var(--x-yellow-soft); }
    to { background: transparent; box-shadow: 0 0 0 12px transparent; }
}

.comment-pending {
    opacity: .75;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.post-avatar-author {
    background: var(--x-yellow);
    color: var(--x-charcoal);
}

.comment-author {
    font-weight: 600;
    color: var(--x-charcoal);
}

.comment-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--x-charcoal);
    color: #fff;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .04em;
    vertical-align: 2px;
}

.comment-badge-pending {
    background: var(--x-yellow-soft);
    color: #6b4f00;
    letter-spacing: 0;
}

.comment-meta {
    font-size: .78rem;
}

.comment-meta a {
    color: inherit;
    text-decoration: none;
}

.comment-meta a:hover {
    text-decoration: underline;
}

.comment-body {
    font-size: .98rem;
    line-height: 1.7;
    color: #3d3d3d;
    overflow-wrap: anywhere;
}

.comment-body p {
    margin-bottom: .7em;
}

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

.comment-body a {
    color: var(--x-charcoal);
    text-decoration-color: var(--x-yellow-strong);
}

.comment-body code {
    font-size: .88em;
    background: var(--x-grey-light);
    border: 1px solid var(--x-line);
    border-radius: 4px;
    padding: .05em .3em;
    color: #b0006a;
}

.comment-body pre {
    background: #fafafa;
    border: 1px solid var(--x-line);
    border-radius: 8px;
    padding: .8em 1em;
    margin: .7em 0;
    font-size: .85rem;
}

.comment-body pre code {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
}

.comment-action {
    border: 0;
    background: none;
    padding: 0;
    font-size: .8rem;
    font-weight: 500;
    color: var(--x-grey);
}

.comment-action:hover,
.comment-action:focus-visible {
    color: var(--x-charcoal);
    text-decoration: underline;
    text-decoration-color: var(--x-yellow-strong);
}

.comment-action-danger:hover {
    color: #b02a37;
}

.comment-deleted {
    font-size: .9rem;
    font-style: italic;
    margin: 0;
}

.comment-reply {
    margin-top: 16px;
}

.comment-form {
    margin-top: 28px;
}

.comment-reply .comment-form {
    margin-top: 0;
}

.comment-form textarea {
    border-color: var(--x-line);
    border-radius: var(--x-radius);
    padding: 12px 14px;
}

.comment-form-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.comment-help {
    font-family: var(--bs-font-monospace);
    font-size: .72rem;
    color: var(--x-grey);
}

.comment-login,
.comments-closed {
    margin-top: 28px;
    padding: 24px 26px;
    border-radius: var(--x-radius);
    background: var(--x-grey-light);
}

.comments-closed {
    font-size: .9rem;
}

.comments-empty {
    margin: 0;
}

/* Newsletter sign-up */
.newsletter-box {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 20px 40px;
    align-items: center;
    padding: 36px 36px;
    border-radius: var(--x-radius);
    background: var(--x-charcoal);
    color: #d4d4d4;
}

@media (min-width: 768px) {
    .newsletter-box {
        grid-template-columns: 1fr 1fr;
    }
}

.newsletter-box::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    right: -70px;
    top: -90px;
    border: 14px solid rgba(255, 204, 46, .25);
    border-radius: 50%;
    pointer-events: none;
}

.newsletter-box-kicker {
    margin: 0 0 6px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--x-yellow);
}

.newsletter-box-title {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: #fff;
}

.newsletter-box-intro {
    margin: 0;
    font-size: .92rem;
}

.newsletter-box-form {
    position: relative;
    z-index: 1;
}

.newsletter-box-fields {
    display: flex;
    gap: 8px;
}

.newsletter-box-fields .form-control {
    border-radius: 999px;
    padding: 10px 18px;
    border: 0;
}

.newsletter-box-fields .btn {
    flex: none;
}

.newsletter-box-error {
    margin-top: 8px;
    font-size: .85rem;
    color: #ffb3b3;
}

.newsletter-box-done {
    margin: 0;
    color: #fff;
}

.newsletter-box-done .fas {
    color: var(--x-yellow);
}

.newsletter-box-link {
    color: #d4d4d4;
    font-size: .85rem;
}

.newsletter-box-link:hover {
    color: #fff;
}

/* The field bots fill in and people never see */
.newsletter-box-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.blog-newsletter {
    margin-top: 72px;
}

.post-newsletter {
    margin-top: 48px;
}

/* The comment form's hidden field for bots (Comments::HONEYPOT) */
.comment-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
