article {
    margin-bottom: 2rem !important;
}

/* Top Images */

figure {
    margin: 2rem 0;
    text-align: center;
}

figure img {
    display: block;
    max-width: 100%;
    margin-bottom: 0;
    /* reduce space between image and caption */
}

figcaption {
    display: block;
    font-size: 0.9rem;
    color: #555;
    font-style: italic;
    margin: 0;
    /* remove default margins */
    line-height: 1.4;
    white-space: normal;
    text-align: center;
}

figcaption a {
    font-size: 0.9rem;
    color: #555;
    font-style: italic;
    margin: 0;
    /* remove default margins */
    line-height: 1.4;
    text-decoration: underline;
    white-space: nowrap;
}

.rich-content {
    max-width: 100%;
    line-height: 1.7;
    font-size: 1.1rem;
    color: #333;
}

/* Paragraphs */
.rich-content p {
    margin-bottom: 0.5em;
}

/* Headings */
.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-content h5,
.rich-content h6 {
    margin-top: 2em !important;
    margin-bottom: 0.5em !important;
    line-height: 1.2 !important;
    font-weight: 300 !important;
    text-align: center !important;
}

/* Lists */
.rich-content ul,
.rich-content ol {
    padding-left: 2em !important;
    margin-bottom: 0.5rem !important;
}

/* Blockquotes */
.rich-content blockquote {
    border-left: 4px solid #ccc;
    padding-left: 1em;
    color: #666;
    margin: 1.5em 0;
    font-style: italic;
}

/* Images */
.rich-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2em auto;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

/* Tables */
.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
}

.rich-content th,
.rich-content td {
    padding: 0.75em;
    border: 1px solid #ddd;
    text-align: left;
}

/* Iframes (YouTube, Spotify, etc.) */
.rich-content iframe {
    max-width: 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 2em 0;
    border: none;
}

/* Code blocks */
.rich-content pre {
    background: #f6f8fa;
    padding: 1em;
    overflow-x: auto;
    border-radius: 6px;
    margin-bottom: 2em;
}

.rich-content code {
    background: #f6f8fa;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: monospace;
}

.post-title {
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif !important;
    color: #666666 !important;
    font-weight: 300 !important;
    font-size: 2.2rem !important;
    margin-top: 3rem !important;
    margin-bottom: 0.05rem !important;
    line-height: 2 !important;
    text-align: center !important;
}

.date-published {
    font-family: 'Garamond', Georgia, 'Times New Roman', Times, serif !important;
    background-color: transparent !important;
    color: #333 !important;
    line-height: 1.6 !important;
    text-align: center !important;
    font-style: italic !important;
}

.content-container-blog {
    max-width: 800px;
    /* You can adjust this width */
    margin: 0 auto;
    /* Centers the content horizontally */
    padding: 0 1rem;
    /* Adds some padding to the left and right */
}

.media.full {
    margin: 2rem 0;
}

.iframe.html {
    max-width: 100%;
    text-align: center;
}

.embedly-embed {
    width: 100%;
    aspect-ratio: 400 / 102;
    /* or 16 / 9 for YouTube */
    height: auto !important;
    max-height: 150px !important;
    /* optional: to prevent huge embeds on large screens */
    display: block;
    margin: 0 auto;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.blog-card {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    height: 200px;
}

.blog-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.blog-card-image {
    width: 200px;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}

.blog-card-content {
    padding: 1rem 1rem 1rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-card-description {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-card-date {
    font-size: 0.9rem;
    color: #777;
}

.blog-title {
    text-align: center;
    font-size: 2.25rem;
    margin-bottom: 2rem;
    margin-top: 2rem;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination a {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.pagination a:hover {
    background-color: #f0f0f0;
}

.pagination a.active {
    background-color: #333;
    color: white;
    border-color: #333;
}

.pagination-ellipsis {
    padding: 0.5rem 0.75rem;
    color: #999;
    font-weight: bold;
}

/* Blog Post Bottom Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
}

.nav-col {
    overflow: hidden;
}

.nav-link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-weight: bold;
    text-decoration: none;
    overflow: hidden;
}

.nav-label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-title {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
    font-weight: bold;
}

.nav-link.newer {
    text-align: left;
}

.nav-link.older {
    text-align: right;
}

/* Blog Post Cards */
.blog-post-cards figure,
.blog-post-cards figure * {
    all: unset;
    display: revert;
    box-sizing: border-box;
}

.blog-post-cards figure {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: stretch;
    height: 160px;
    margin: 1.5rem 0 !important;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    /* ✅ Ensures padding/border don't break height */
}

.blog-post-cards figure img {
    width: 150px;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    vertical-align: middle;
    /* ✅ Eliminates phantom whitespace */
    border-radius: 0;
    /* Resets global border-radius */
}

.blog-post-cards figure figcaption {
    height: 100%;
    flex: 1;
    padding: 1rem;
    margin: 0;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left;
    /* ✅ Override the global center text */
    box-sizing: border-box;
}

/* Tag Styling */
.tag-header {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 500;
    margin-top: 1rem;
    margin-bottom: .75rem;
    color: #333;
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
}

/* Post Tags section under blog posts */

.post-tags {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.post-tags h3 {
    font-size: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #999;
    margin: 0;
    text-align: center !important;
    /* not strictly necessary now */
}

.post-tags ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    /* Ensure inline content centers too */
}

.post-tags li {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Prevent weird text float/align */
}

.post-tags a {
    display: inline-block;
    color: #333;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.post-tags a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .embedly-embed {
        height: 100px;
    }

    .blog-card {
        flex-direction: column;
        height: auto;
        max-height: 300px;
        overflow: hidden;
    }

    .blog-card-image {
        width: 100%;
        height: 180px;
        object-fit: cover;
        margin: 0 !important;
        padding: 0 !important;
        display: block;
    }

    .blog-card-content {
        padding: 0.1rem 1rem 0.75rem;
        flex-direction: column;
        flex-grow: 1;
        background: #fff;
        display: flex;
        justify-content: flex-start;
    }

    .blog-post-cards figure {
        grid-template-columns: 1fr;
        height: auto;
    }

    .blog-post-cards figure img {
        height: auto;
    }

    .blog-post-cards figure figcaption {
        text-align: center;
        justify-content: center;
    }

    .blog-card-title {
        font-size: 1.05rem;
        margin: 0 0 0.15rem !important;
        -webkit-line-clamp: 1;
        line-height: 1.2;
    }

    .blog-card-description {
        font-size: 0.9rem;
        line-height: 1.3;
        -webkit-line-clamp: 2;
        margin: 0 0 0.15rem;
    }

    .blog-card-date {
        font-size: 0.8rem;
        margin-top: auto;
    }
}