/*
 * Blog Styles
 * Shared listing, archive, and single-post styling for Eme's Baked Goods.
 */

:root {
    --blog-cream: #f7f3ec;
    --blog-paper: #fffaf3;
    --blog-ink: #181512;
    --blog-charcoal: #4c4842;
    --blog-muted: #746d63;
    --blog-cocoa: #5a351f;
    --blog-blush: #efd4cf;
    --blog-gold: #b98548;
}

.blog-page-main,
.blog-archive-main,
.single-post-main {
    background:
        radial-gradient(circle at 88% 12%, rgba(239, 212, 207, 0.72), transparent 24rem),
        linear-gradient(180deg, var(--blog-cream), #fbf8f2 54%, #eee5d8);
    color: var(--blog-ink);
    overflow: hidden;
}

.blog-eyebrow {
    color: var(--blog-cocoa);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    margin: 0 0 0.9rem;
    text-transform: uppercase;
}

.blog-button,
.blog-text-link {
    align-items: center;
    display: inline-flex;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
}

.blog-button {
    background: var(--blog-ink);
    border-radius: 999px;
    box-shadow: 0 1rem 2rem rgba(24, 21, 18, 0.16);
    color: var(--blog-paper);
    font-size: 0.82rem;
    justify-content: center;
    min-height: 3rem;
    padding: 0.9rem 1.35rem;
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.blog-button:hover,
.blog-button:focus-visible {
    box-shadow: 0 1.2rem 2.4rem rgba(24, 21, 18, 0.2);
    transform: translateY(-2px);
}

.blog-text-link {
    border-bottom: 1px solid currentColor;
    color: var(--blog-cocoa);
    font-size: 0.76rem;
    padding-bottom: 0.18rem;
    transition: color 180ms ease, transform 180ms ease;
}

.blog-text-link:hover,
.blog-text-link:focus-visible {
    color: var(--blog-ink);
    transform: translateX(0.2rem);
}

.blog-hero,
.blog-listing,
.blog-article,
.related-posts-section {
    margin: 0 auto;
    max-width: 78rem;
    padding: clamp(4rem, 10vw, 7rem) 1.25rem;
}

.blog-hero {
    padding-bottom: clamp(2rem, 6vw, 4rem);
}

.blog-hero h1,
.blog-section-heading h2,
.blog-empty h2,
.single-post-hero h1,
.related-posts-section h2 {
    color: var(--blog-charcoal);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.8rem, 10vw, 6.2rem);
    font-weight: 500;
    letter-spacing: -0.07em;
    line-height: 0.96;
    margin: 0;
}

.blog-hero p:not(.blog-eyebrow),
.blog-section-heading p,
.blog-card p,
.blog-empty p,
.single-post-hero p,
.article-content,
.related-post p {
    color: var(--blog-muted);
    font-size: clamp(1rem, 2.5vw, 1.18rem);
    line-height: 1.8;
    margin: 1.15rem 0 0;
}

.blog-section-heading {
    margin-bottom: 2rem;
    max-width: 54rem;
}

.blog-card-grid,
.related-posts-grid {
    display: grid;
    gap: 1rem;
}

.blog-card,
.blog-empty,
.single-post-hero,
.article-content,
.post-navigation,
.related-post {
    background: rgba(255, 250, 243, 0.78);
    border: 1px solid rgba(24, 21, 18, 0.1);
    border-radius: 1.65rem;
    box-shadow: 0 1.2rem 2.4rem rgba(64, 48, 35, 0.08);
    overflow: hidden;
}

.blog-card__media {
    display: block;
    overflow: hidden;
}

.blog-card__media img,
.single-featured-image img,
.related-post img {
    display: block;
    height: auto;
    object-fit: cover;
    width: 100%;
}

.blog-card__media img {
    aspect-ratio: 1 / 0.72;
    transition: transform 400ms ease;
}

.blog-card:hover .blog-card__media img {
    transform: scale(1.04);
}

.blog-card__content,
.blog-empty,
.related-post__content {
    padding: clamp(1.3rem, 4vw, 2rem);
}

.blog-meta,
.single-post-meta {
    align-items: center;
    color: var(--blog-gold);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.76rem;
    font-weight: 900;
    gap: 0.65rem;
    letter-spacing: 0.12em;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.blog-meta a,
.single-post-meta a {
    color: inherit;
    text-decoration: none;
}

.blog-card h2,
.blog-card h3,
.related-post h3 {
    color: var(--blog-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.6rem, 5vw, 2.55rem);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1.02;
    margin: 0;
}

.blog-card h2 a,
.blog-card h3 a,
.related-post h3 a {
    color: inherit;
    text-decoration: none;
}

.blog-card .blog-text-link {
    margin-top: 1.3rem;
}

.blog-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.blog-pagination .page-numbers {
    align-items: center;
    background: rgba(255, 250, 243, 0.78);
    border: 1px solid rgba(24, 21, 18, 0.1);
    border-radius: 999px;
    color: var(--blog-ink);
    display: inline-flex;
    font-weight: 800;
    min-height: 2.7rem;
    padding: 0.55rem 1rem;
    text-decoration: none;
}

.blog-pagination .current {
    background: var(--blog-ink);
    color: var(--blog-paper);
}

.single-post-hero {
    margin: clamp(3rem, 8vw, 5rem) auto 1rem;
    max-width: 78rem;
    padding: clamp(1.6rem, 6vw, 4rem);
}

.single-featured-image {
    border-radius: 1.65rem;
    box-shadow: 0 1.2rem 2.4rem rgba(64, 48, 35, 0.08);
    margin: 1.5rem auto 0;
    max-width: 78rem;
    overflow: hidden;
}

.single-featured-image img {
    aspect-ratio: 1 / 0.54;
}

.single-post-layout {
    display: grid;
    gap: 1.5rem;
    margin: 1rem auto 0;
    max-width: 78rem;
}

.article-content {
    color: var(--blog-charcoal);
    max-width: 52rem;
    padding: clamp(1.5rem, 5vw, 3rem);
}

.article-content > *:first-child {
    margin-top: 0;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    color: var(--blog-ink);
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin: 2rem 0 0.8rem;
}

.article-content h2 {
    font-size: clamp(2rem, 6vw, 3.5rem);
}

.article-content h3 {
    font-size: clamp(1.6rem, 5vw, 2.6rem);
}

.article-content p,
.article-content ul,
.article-content ol {
    margin: 1rem 0 0;
}

.article-content a {
    color: var(--blog-cocoa);
    font-weight: 800;
}

.article-content blockquote {
    border-left: 0.3rem solid var(--blog-gold);
    color: var(--blog-cocoa);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.45rem;
    line-height: 1.35;
    margin: 2rem 0;
    padding-left: 1.25rem;
}

.post-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    margin: 1rem auto 0;
    max-width: 52rem;
    padding: 1rem;
}

.post-navigation a {
    color: var(--blog-cocoa);
    font-weight: 900;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
}

.blog-sidebar {
    display: grid;
    gap: 1rem;
}

.blog-sidebar-widget {
    background: rgba(255, 250, 243, 0.78);
    border: 1px solid rgba(24, 21, 18, 0.1);
    border-radius: 1.65rem;
    box-shadow: 0 1.2rem 2.4rem rgba(64, 48, 35, 0.08);
    color: var(--blog-muted);
    font-size: 1rem;
    line-height: 1.65;
    padding: clamp(1.25rem, 4vw, 1.75rem);
}

.blog-sidebar-title {
    color: var(--blog-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin: 0 0 1rem;
}

.blog-sidebar-widget ul,
.blog-sidebar-widget ol {
    margin: 0;
    padding-left: 1.2rem;
}

.blog-sidebar-widget li + li {
    margin-top: 0.55rem;
}

.blog-sidebar-widget a {
    color: var(--blog-cocoa);
    font-weight: 800;
}

.related-posts-section {
    padding-top: 0;
}

.related-post {
    color: inherit;
    display: grid;
    text-decoration: none;
}

.related-post img {
    aspect-ratio: 1 / 0.72;
}

@media (min-width: 820px) {
    .blog-card-grid,
    .related-posts-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .blog-card:first-child {
        grid-column: span 2;
    }
}

@media (min-width: 960px) {
    .single-post-layout.has-sidebar {
        align-items: start;
        grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
    }

    .single-post-layout.has-sidebar .article-content,
    .single-post-layout.has-sidebar .post-navigation {
        max-width: none;
    }

    .blog-sidebar {
        position: sticky;
        top: 2rem;
    }
}
