/* ================================
   Blog Post Page Styles
   Mobile First Approach
   ================================ */

/* ================================
   Blog Post Hero
   ================================ */
.blog-post-page {
    background-color: #fff;
}

.blog-post-hero {
    background-color: #fff;
    padding: 0;
}

.blog-post-hero .container {
    padding: 0;
}

/* Hero Layout: stacked on mobile, image first */
.blog-post-hero-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Mobile: image comes first visually even though info is first in DOM */
.blog-post-hero-image {
    order: -1;
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
}

.blog-post-hero-image > img:first-child {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.blog-post-hero-detail {
    position: absolute;
    bottom: -1px;
    left: -1px;
    display: block;
    height: 48px;
}

.blog-post-hero-detail img {
    height: 100%;
    width: auto;
}

/* Hero Info (title + meta) */
.blog-post-hero-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 0 16px;
}

/* ================================
   Title & Meta (moved to hero)
   ================================ */
.blog-post-title-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.blog-post-accent {
    width: 12px;
    align-self: stretch;
    background-color: #8cc540;
    flex-shrink: 0;
}

.blog-post-title {
    font-family: "Avenir Next", sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #4d4d4d;
    line-height: 1.2;
    margin: 0;
}

/* Article Meta */
.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 24px;
}

.blog-post-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-family: "Work Sans", sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #97989f;
}

.blog-post-date {
    font-family: "Avenir Next", sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #4d4d4d;
}

/* ================================
   Blog Post Content Section
   ================================ */
.blog-post-content {
    padding: 40px 0;
}

.blog-post-layout {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* ================================
   Article Styles
   ================================ */
.blog-post-article {
    width: 100%;
}

/* Article Body */
.blog-post-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.blog-post-body p {
    font-family: "Avenir Next", sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #4d4d4d;
    line-height: 1.7;
    margin: 0;
}

/* Headings */
.blog-post-body h2 {
    font-family: "Avenir Next", sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #4d4d4d;
    margin: 16px 0 0 0;
    line-height: 1.3;
}

.blog-post-body h3 {
    font-family: "Avenir Next", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #4d4d4d;
    margin: 12px 0 0 0;
    line-height: 1.3;
}

.blog-post-body h4 {
    font-family: "Avenir Next", sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #4d4d4d;
    margin: 8px 0 0 0;
    line-height: 1.4;
}

/* Links */
.blog-post-body a {
    color: #73a534;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.blog-post-body a:hover {
    color: #5a8229;
}

/* Bold and Italic */
.blog-post-body strong,
.blog-post-body b {
    font-weight: 700;
}

.blog-post-body em,
.blog-post-body i {
    font-style: italic;
}

/* Lists */
.blog-post-body ul,
.blog-post-body ol {
    font-family: "Avenir Next", sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #4d4d4d;
    line-height: 1.7;
    margin: 0;
    padding-left: 24px;
}

.blog-post-body ul {
    list-style-type: disc;
}

.blog-post-body ol {
    list-style-type: decimal;
}

.blog-post-body li {
    margin-bottom: 8px;
    padding-left: 8px;
}

.blog-post-body li:last-child {
    margin-bottom: 0;
}

.blog-post-body li::marker {
    color: #8cc540;
}

/* Nested Lists */
.blog-post-body ul ul,
.blog-post-body ol ol,
.blog-post-body ul ol,
.blog-post-body ol ul {
    margin-top: 8px;
    margin-bottom: 0;
}

/* Blockquote - Standard WordPress */
.blog-post-body blockquote,
.blog-post-quote {
    display: flex;
    gap: 24px;
    padding: 0;
    margin: 16px 0;
    border: none;
    position: relative;
}

.blog-post-body blockquote::before,
.blog-post-quote::before {
    content: "";
    width: 5px;
    background-color: #8cc540;
    flex-shrink: 0;
}

.blog-post-body blockquote p,
.blog-post-quote p {
    font-family: "Avenir Next", sans-serif;
    font-size: 20px;
    font-weight: 400;
    font-style: italic;
    color: #4d4d4d;
    line-height: 1.5;
    margin: 0;
}

.blog-post-body blockquote cite {
    display: block;
    font-family: "Avenir Next", sans-serif;
    font-size: 14px;
    font-weight: 500;
    font-style: normal;
    color: #6e6f71;
    margin-top: 12px;
}

/* Tables */
.blog-post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-family: "Avenir Next", sans-serif;
    font-size: 15px;
}

.blog-post-body table th,
.blog-post-body table td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid #ededed;
    color: #4d4d4d;
}

.blog-post-body table th {
    background-color: #f4f4f4;
    font-weight: 600;
}

.blog-post-body table tr:nth-child(even) {
    background-color: #fafafa;
}

.blog-post-body table tr:hover {
    background-color: #f0f7e8;
}

/* Code Blocks */
.blog-post-body code {
    font-family: "Monaco", "Consolas", "Courier New", monospace;
    font-size: 14px;
    background-color: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    color: #d63384;
}

.blog-post-body pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 20px 24px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.blog-post-body pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    font-size: 14px;
    line-height: 1.6;
}

/* Images and Figures */
.blog-post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.blog-post-body figure,
.blog-post-figure {
    width: 100%;
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
}

.blog-post-body figure img,
.blog-post-figure img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 0;
}

.blog-post-body figcaption {
    font-family: "Avenir Next", sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #6e6f71;
    text-align: center;
    padding: 12px 16px;
    background-color: #f4f4f4;
    margin: 0;
}

/* WordPress Alignment Classes */
.blog-post-body .alignleft {
    float: left;
    margin: 8px 24px 8px 0;
}

.blog-post-body .alignright {
    float: right;
    margin: 8px 0 8px 24px;
}

.blog-post-body .aligncenter {
    display: block;
    margin: 16px auto;
}

.blog-post-body .alignnone {
    margin: 16px 0;
}

/* WordPress Caption */
.blog-post-body .wp-caption {
    max-width: 100%;
    margin: 16px 0;
}

.blog-post-body .wp-caption-text {
    font-family: "Avenir Next", sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #6e6f71;
    text-align: center;
    padding: 8px 0;
}

/* WordPress Blocks - Gallery */
.blog-post-body .wp-block-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 16px 0;
}

.blog-post-body .wp-block-gallery .wp-block-image {
    margin: 0;
}

/* WordPress Blocks - Separator */
.blog-post-body hr,
.blog-post-body .wp-block-separator {
    border: none;
    border-top: 1px solid #ededed;
    margin: 32px 0;
}

.blog-post-body .wp-block-separator.is-style-wide {
    border-top-width: 2px;
}

.blog-post-body .wp-block-separator.is-style-dots {
    border: none;
    text-align: center;
}

.blog-post-body .wp-block-separator.is-style-dots::before {
    content: "···";
    font-size: 24px;
    letter-spacing: 12px;
    color: #8cc540;
}

/* WordPress Blocks - Pullquote */
.blog-post-body .wp-block-pullquote {
    padding: 24px 0;
    margin: 24px 0;
    border-top: 4px solid #8cc540;
    border-bottom: 4px solid #8cc540;
}

.blog-post-body .wp-block-pullquote blockquote {
    margin: 0;
}

.blog-post-body .wp-block-pullquote blockquote::before {
    display: none;
}

.blog-post-body .wp-block-pullquote p {
    font-size: 24px;
    font-weight: 500;
    text-align: center;
    font-style: normal;
}

.blog-post-body .wp-block-pullquote cite {
    text-align: center;
}

/* Video Embeds */
.blog-post-body .wp-block-embed,
.blog-post-body iframe {
    width: 100%;
    margin: 16px 0;
}

.blog-post-body .wp-block-embed__wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.blog-post-body .wp-block-embed__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Share Section */
.blog-post-share {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-top: 40px;
    margin-top: 40px;
    border-top: 1px solid #ededed;
}

.share-label {
    font-family: "Proxima Nova", sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #6e6f71;
}

.share-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background-color: #4d4d4d;
    transition: opacity 0.2s ease;
}

.share-btn:hover {
    opacity: 0.8;
}

.share-btn.share-x {
    background-color: transparent;
}

.share-btn svg {
    width: 16px;
    height: 16px;
}

.share-btn.share-x svg {
    width: 24px;
    height: 24px;
}

/* ================================
   Sidebar / Related Posts
   ================================ */
.blog-post-sidebar {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-top: 40px;
    border-top: 1px solid #ededed;
}

.sidebar-title {
    font-family: "Avenir Next", sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #4d4d4d;
    margin: 0;
}

.related-posts {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Related Post Card */
.related-post {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.related-post-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-post-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.related-post-title {
    font-family: "Avenir Next", sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #4d4d4d;
    margin: 0;
    line-height: 1.3;
}

.related-post-title a {
    color: inherit;
    text-decoration: none;
}

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

.related-post-date {
    font-family: "Avenir Next", sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #6e6f71;
}

.related-post-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: "Avenir Next", sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #4d4d4d;
    text-decoration: none;
}

.related-post-link:hover {
    text-decoration: underline;
}

.related-post-link svg {
    width: 20px;
    height: 20px;
}

/* ================================
   Tablet (768px+)
   ================================ */
@media screen and (min-width: 768px) {
    .blog-post-hero {
        padding: 32px 0 24px;
    }

    .blog-post-hero .container {
        padding: 0 40px;
    }

    /* Hero layout: side by side — info left, image right (DOM order) */
    .blog-post-hero-layout {
        flex-direction: row;
        align-items: center;
        gap: 40px;
    }

    /* Reset mobile order override */
    .blog-post-hero-image {
        order: 0;
        flex: 0 0 50%;
        max-width: 50%;
        height: auto;
        aspect-ratio: 16 / 10;
        border-radius: 8px;
    }

    .blog-post-hero-info {
        flex: 1;
        padding: 0;
        justify-content: center;
    }

    .blog-post-hero-detail {
        left: auto;
        right: -1px;
    }

    .blog-post-content {
        padding: 40px 0 100px;
    }

    .blog-post-title {
        font-size: 32px;
    }

    .blog-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .blog-post-sidebar {
        border-top: none;
        padding-top: 0;
    }

    /* Content responsive */
    .blog-post-body h2 {
        font-size: 28px;
    }

    .blog-post-body h3 {
        font-size: 22px;
    }

    .blog-post-body blockquote p,
    .blog-post-quote p {
        font-size: 22px;
    }

    .blog-post-body .wp-block-gallery {
        grid-template-columns: repeat(3, 1fr);
    }

    .blog-post-body .wp-block-pullquote p {
        font-size: 28px;
    }
}

/* ================================
   Desktop (1440px+)
   ================================ */
@media screen and (min-width: 1440px) {
    .blog-post-hero .container {
        padding: 0 120px;
    }

    .blog-post-hero-layout {
        gap: 64px;
    }

    .blog-post-hero-image {
        flex: 0 0 55%;
        max-width: 55%;
    }

    .blog-post-title {
        font-size: 36px;
    }

    .blog-post-meta {
        flex-direction: row;
        align-items: center;
        gap: 24px;
    }

    .blog-post-content .container {
        padding: 0 120px;
    }

    .blog-post-layout {
        flex-direction: row;
        justify-content: space-between;
        gap: 64px;
        max-width: 100%;
    }

    .blog-post-article {
        flex: 1 1 0%;
        min-width: 0;
    }

    .blog-post-title-wrapper {
        gap: 24px;
    }

    .blog-post-sidebar {
        flex: 0 0 320px;
        min-width: 280px;
        max-width: 400px;
    }

    .sidebar-title {
        font-size: 32px;
    }
}