/* ========================================
   BLOG POST DETAIL PAGE STYLES
   ======================================== */

/* === Post Header === */
.post-header {
    padding: 130px 0 48px;
    text-align: center;
}

/* Breadcrumb (base .plp-breadcrumb styles live in products.css, which this
   page does not load, so define them here scoped to the post header). */
.post-header .plp-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 20px;
}

.post-header .plp-breadcrumb a {
    color: var(--text-3);
    transition: color 0.25s;
}

.post-header .plp-breadcrumb a:hover {
    color: var(--text);
}

.post-header .plp-breadcrumb span {
    color: var(--text);
    font-weight: 500;
}

.post-header .blog-card-tags {
    justify-content: center;
    margin-bottom: 20px;
}

.post-title {
    font-family: var(--font);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -2px;
    margin: 0 auto 20px;
    max-width: 760px;
}

.post-excerpt {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-2);
    max-width: 600px;
    margin: 0 auto 36px;
}

/* Post Meta */
.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.post-meta .blog-author {
    gap: 12px;
}

.post-meta .blog-avatar {
    width: 40px;
    height: 40px;
    font-size: 12px;
}

.post-author-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.post-author-info strong {
    font-size: 14px;
    font-weight: 650;
}

.post-author-info span {
    font-size: 12px;
    color: var(--text-3);
    font-weight: 450;
}

.post-meta-details {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-3);
}

/* === Cover Image === */
.post-cover {
    margin-bottom: 64px;
}

.post-cover-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    min-height: 400px;
}

.post-cover-has-img {
    padding: 0;
    min-height: auto;
}

.post-cover-has-img img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-lg);
}

.post-cover-mockup {
    width: 50%;
    max-width: 480px;
}

.post-cover-mockup .mockup-browser {
    box-shadow: 0 12px 48px rgba(0,0,0,0.1);
}

/* === Post Body Layout === */
.post-body {
    padding-bottom: 80px;
}

.post-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 64px;
    align-items: start;
}

/* === Table of Contents === */
.post-toc {
    position: sticky;
    top: 100px;
}

.post-toc-inner {
    padding-top: 4px;
}

.post-toc h4 {
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-3);
    margin-bottom: 16px;
}

.post-toc nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-link {
    display: block;
    font-size: 13px;
    font-weight: 450;
    color: var(--text-3);
    padding: 6px 0 6px 16px;
    border-left: 2px solid var(--border);
    transition: all 0.25s var(--ease);
    line-height: 1.4;
}

.toc-link:hover {
    color: var(--text-2);
}

.toc-link.active {
    color: var(--text);
    font-weight: 550;
    border-left-color: var(--text);
}

/* Share */
.post-share {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.post-share h4 {
    margin-bottom: 12px;
}

.post-share-links {
    display: flex;
    gap: 8px;
}

.share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-3);
    transition: all 0.25s var(--ease);
}

.share-btn:hover {
    border-color: var(--text);
    color: var(--text);
    transform: translateY(-2px);
}

/* === Article Content === */
.post-content {
    max-width: 720px;
}

.post-content section {
    margin-bottom: 48px;
}

.post-content h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 20px;
    padding-top: 8px;
}

.post-content h3 {
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.5px;
    margin-bottom: 14px;
    margin-top: 32px;
}

.post-content p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-2);
    margin-bottom: 20px;
}

.post-content img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 0 28px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 28px;
    font-size: 15px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.post-content thead th {
    background: var(--bg-alt);
    font-weight: 650;
    color: var(--text);
    text-align: left;
}

.post-content th,
.post-content td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    color: var(--text-2);
    vertical-align: top;
}

.post-content th:last-child,
.post-content td:last-child {
    border-right: none;
}

.post-content tbody tr:last-child td {
    border-bottom: none;
}

.post-content tbody td:first-child {
    font-weight: 600;
    color: var(--text);
}

.post-content a {
    color: var(--text);
    font-weight: 550;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--border);
    transition: text-decoration-color 0.25s;
}

.post-content a:hover {
    text-decoration-color: var(--text);
}

.post-content ul,
.post-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.post-content li {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-2);
    margin-bottom: 10px;
}

.post-content li strong {
    color: var(--text);
}

.post-content code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 2px 7px;
    border-radius: 6px;
    color: var(--text);
}

/* Blockquote */
.post-content blockquote {
    border-left: 3px solid var(--text);
    padding: 20px 28px;
    margin: 32px 0;
    background: var(--bg-alt);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.post-content blockquote p {
    font-size: 17px;
    font-weight: 500;
    font-style: italic;
    color: var(--text);
    margin-bottom: 0;
    line-height: 1.7;
}

/* Code Block */
.post-code {
    margin: 28px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.post-code-header {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.post-code-header span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: 0.3px;
}

.post-code pre {
    padding: 20px 22px;
    overflow-x: auto;
    background: #fafafa;
}

.post-code code {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
    background: none;
    border: none;
    padding: 0;
    border-radius: 0;
}

/* Callout */
.post-callout {
    display: flex;
    gap: 14px;
    padding: 20px 24px;
    background: #f0f4ff;
    border: 1px solid #d4deff;
    border-radius: var(--radius);
    margin: 28px 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-2);
}

.post-callout-icon {
    flex-shrink: 0;
    color: #4f6df5;
    margin-top: 1px;
}

.post-callout strong {
    color: var(--text);
}

.post-callout-warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.post-callout-warning .post-callout-icon {
    color: #d97706;
}

/* === Author Box === */
.post-author-box {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 32px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin: 56px 0 36px;
}

.post-author-avatar {
    width: 46px !important;
    height: 76px !important;
    font-size: 16px !important;
    flex-shrink: 0;
    /* The logo is already a self-contained rounded-square tile, so render it as
       that tile instead of clipping it into a circle with a second background. */
    border-radius: 14px;
    background: transparent;
}

.post-author-avatar img {
    object-fit: contain;
}

.post-author-content strong {
    display: block;
    font-size: 16px;
    font-weight: 650;
    margin-bottom: 6px;
}

.post-author-content p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-2);
    margin-bottom: 0;
}

/* === Post Tags === */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 48px;
}

.post-tags span {
    font-size: 12px;
    font-weight: 550;
    color: var(--text-2);
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 100px;
    transition: all 0.25s var(--ease);
}

.post-tags span:hover {
    border-color: var(--text);
    color: var(--text);
}

/* === Post Navigation === */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.post-nav-link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.3s var(--ease);
}

.post-nav-link:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.post-nav-next {
    text-align: right;
}

.post-nav-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-3);
}

.post-nav-next .post-nav-label {
    justify-content: flex-end;
}

.post-nav-title {
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.3px;
    line-height: 1.4;
}

/* === Related Posts === */
.post-related {
    padding: 80px 0;
    border-top: 1px solid var(--border);
}

.post-related-grid {
    margin-bottom: 0;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .post-content-wrapper {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .post-toc {
        position: relative;
        top: 0;
        margin-bottom: 48px;
        padding-bottom: 32px;
        border-bottom: 1px solid var(--border);
    }

    .post-toc nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0;
    }

    .toc-link {
        border-left: none;
        border-bottom: 2px solid var(--border);
        padding: 8px 14px 8px 0;
        font-size: 12px;
    }

    .toc-link.active {
        border-bottom-color: var(--text);
    }

    .post-share {
        display: none;
    }

    .post-content {
        max-width: 100%;
    }

    .post-related .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .post-header {
        padding: 110px 0 36px;
    }

    .post-title {
        font-size: 28px;
        letter-spacing: -1.2px;
    }

    .post-excerpt {
        font-size: 15px;
        margin-bottom: 28px;
    }

    .post-meta {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .post-cover-image {
        min-height: 260px;
        padding: 40px 24px;
    }

    .post-cover-mockup {
        width: 70%;
    }

    .post-cover {
        margin-bottom: 40px;
    }

    .post-content h2 {
        font-size: 22px;
    }

    .post-content h3 {
        font-size: 18px;
    }

    .post-content p,
    .post-content li {
        font-size: 15px;
    }

    .post-author-box {
        flex-direction: column;
        gap: 16px;
        padding: 24px;
    }

    .post-nav {
        grid-template-columns: 1fr;
    }

    .post-nav-next {
        text-align: left;
    }

    .post-nav-next .post-nav-label {
        justify-content: flex-start;
    }

    .post-related .blog-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .post-title {
        font-size: 24px;
        letter-spacing: -1px;
    }

    .post-cover-image {
        min-height: 200px;
    }

    .post-cover-mockup {
        width: 85%;
    }

    .post-code pre {
        padding: 16px;
    }

    .post-code code {
        font-size: 12px;
    }

    .post-callout {
        flex-direction: column;
        gap: 10px;
    }
}
