/**
 * Blog Pages — CSS
 *
 * Single: hero, meta bar, content+sidebar layout, TOC, article typography,
 * sidebar CTA, author bio, related posts.
 * Archive: uses blog-grid and blog-card from home.css.
 */


/* =========================================================================
   BLOG HERO — 55vh with title overlay
   ========================================================================= */

.blog-hero {
    position: relative;
    height: 55vh;
    min-height: 360px;
    display: flex;
    align-items: flex-end;
    background: var(--dn-primary, #1B3A4B);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    margin-top: -64px;
    padding-top: 64px;
}

.blog-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(27, 58, 75, 0.2) 0%, rgba(27, 58, 75, 0.8) 100%);
}

.blog-hero__content {
    position: relative;
    z-index: 1;
    padding-bottom: 48px;
    max-width: 780px;
}

.blog-hero__category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--dn-accent, #E8A045);
    color: var(--dn-primary, #1B3A4B);
    font-family: var(--dn-font-secondary, 'Plus Jakarta Sans', sans-serif);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    text-decoration: none;
    margin-bottom: 12px;
}

.blog-hero__title {
    font-family: var(--dn-font-display, 'Fraunces', serif);
    font-size: clamp(1.75rem, 1.4rem + 1.8vw, 2.5rem);
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0;
}

@media (max-width: 767px) {
    .blog-hero {
        height: 45vh;
        min-height: 300px;
    }
}


/* =========================================================================
   META BAR
   ========================================================================= */

.blog-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px 0 8px;
    font-family: var(--dn-font-body, 'Inter', sans-serif);
    font-size: 14px;
    color: var(--dn-muted, #8C7B6E);
}

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

.blog-meta__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.blog-meta__name {
    font-weight: 600;
    color: var(--dn-text, #1A1A18);
}

.blog-meta__sep {
    opacity: 0.4;
}


/* =========================================================================
   CONTENT + SIDEBAR LAYOUT
   Content first in DOM (SEO), sidebar visually left via CSS order.
   ========================================================================= */

.blog-single__body {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 48px;
    padding-top: 16px;
    padding-bottom: 80px;
    align-items: start;
}

.blog-single__sidebar {
    position: relative;
    order: -1; /* Visually left, but after content in source */
}

.blog-single__content {
    min-width: 0;
    order: 1;
}

@media (max-width: 1023px) {
    .blog-single__body {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .blog-single__sidebar {
        order: -1; /* TOC above content on mobile */
    }
}


/* =========================================================================
   TABLE OF CONTENTS — Sticky sidebar
   ========================================================================= */

.toc {
    position: sticky;
    top: 140px;
    background: var(--dn-surface, #F7F3EE);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.toc__heading {
    font-family: var(--dn-font-body, 'Inter', sans-serif);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--dn-muted, #8C7B6E);
    margin: 0 0 12px;
}

.toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc__link {
    display: block;
    padding: 6px 12px;
    font-family: var(--dn-font-body, 'Inter', sans-serif);
    font-size: 13px;
    color: var(--dn-muted, #8C7B6E);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 4px 4px 0;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.toc__link:hover {
    color: var(--dn-primary, #1B3A4B);
    background: rgba(27, 58, 75, 0.04);
}

.toc__link.is-active {
    color: var(--dn-primary, #1B3A4B);
    font-weight: 600;
    border-left-color: var(--dn-accent, #E8A045);
    background: rgba(232, 160, 69, 0.06);
}

.toc__item--sub .toc__link {
    padding-left: 24px;
    font-size: 12px;
}

@media (max-width: 1023px) {
    .toc {
        position: static;
        max-height: none;
    }
}


/* =========================================================================
   BLOG SIDEBAR CTA WIDGET
   ========================================================================= */

.blog-cta-widget {
    background: #fff;
    border: 2px solid #EEE;
    border-radius: 12px;
    padding: 24px;
}

.blog-cta-widget__title {
    font-family: var(--dn-font-secondary, 'Plus Jakarta Sans', sans-serif);
    font-size: 16px;
    font-weight: 600;
    color: var(--dn-text, #1A1A18);
    margin: 0 0 6px;
}

.blog-cta-widget__text {
    font-size: 14px;
    color: var(--dn-muted, #8C7B6E);
    margin: 0 0 16px;
    line-height: 1.5;
}

.blog-cta-widget__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    font-family: var(--dn-font-secondary, 'Plus Jakarta Sans', sans-serif);
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 8px;
    transition: transform 0.15s ease;
}
.blog-cta-widget__btn:last-child {
    margin-bottom: 0;
}
.blog-cta-widget__btn:hover {
    transform: translateY(-1px);
}

.blog-cta-widget__btn--wa {
    background: #25D366;
    color: #fff;
}

.blog-cta-widget__btn--primary {
    background: var(--dn-primary, #1B3A4B);
    color: #fff;
}


/* =========================================================================
   ARTICLE BODY TYPOGRAPHY
   ========================================================================= */

.article-body {
    font-family: var(--dn-font-body, 'Inter', sans-serif);
    font-size: 17px;
    line-height: 1.75;
    color: var(--dn-text, #1A1A18);
    max-width: 700px;
}

.article-body h2 {
    font-family: var(--dn-font-secondary, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.625rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: var(--dn-text, #1A1A18);
    scroll-margin-top: 140px;
}

.article-body h3 {
    font-family: var(--dn-font-secondary, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    scroll-margin-top: 140px;
}

.article-body h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-body p {
    margin-bottom: 1.25rem;
}

.article-body a {
    color: var(--dn-accent, #E8A045);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}
.article-body a:hover {
    color: var(--dn-primary, #1B3A4B);
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.article-body figure {
    margin: 2rem 0;
}
.article-body figcaption {
    font-size: 13px;
    color: var(--dn-muted, #8C7B6E);
    margin-top: 8px;
    text-align: center;
    font-style: italic;
}

.article-body ul,
.article-body ol {
    margin: 0 0 1.25rem 1.5rem;
    padding: 0;
}
.article-body li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.article-body blockquote {
    margin: 2rem 0;
    padding: 20px 24px;
    border-left: 3px solid var(--dn-accent, #E8A045);
    background: var(--dn-surface, #F7F3EE);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--dn-text, #1A1A18);
}
.article-body blockquote p:last-child {
    margin-bottom: 0;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 15px;
}
.article-body th,
.article-body td {
    padding: 10px 14px;
    border: 1px solid #EEE;
    text-align: left;
}
.article-body th {
    background: var(--dn-surface, #F7F3EE);
    font-weight: 600;
}

/* CTA boxes inserted via [dn_cta] shortcode */
.article-body .dn-cta-box {
    margin: 2rem 0;
    padding: 24px;
    background: var(--dn-primary, #1B3A4B);
    border-radius: 12px;
    color: #fff;
}
.article-body .dn-cta-heading {
    font-family: var(--dn-font-secondary, 'Plus Jakarta Sans', sans-serif);
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 6px;
}
.article-body .dn-cta-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 16px;
}
.article-body .dn-cta-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.article-body .dn-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s ease;
}
.article-body .dn-cta-btn:hover {
    transform: translateY(-1px);
}
.article-body .dn-cta-btn-primary {
    background: var(--dn-accent, #E8A045);
    color: var(--dn-primary, #1B3A4B);
}
.article-body .dn-cta-btn-whatsapp {
    background: #25D366;
    color: #fff;
}


/* =========================================================================
   AUTHOR BIO
   ========================================================================= */

.author-bio {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: #fff;
    border: 1px solid #EEE;
    border-radius: 12px;
    margin-top: 48px;
}

.author-bio__photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-shrink: 0;
}

.author-bio__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dn-muted, #8C7B6E);
}

.author-bio__name {
    font-family: var(--dn-font-secondary, 'Plus Jakarta Sans', sans-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--dn-text, #1A1A18);
    margin: 4px 0 8px;
}
.author-bio__name a {
    color: inherit;
    text-decoration: none;
}
.author-bio__name a:hover {
    color: var(--dn-accent, #E8A045);
}

.author-bio__text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--dn-muted, #8C7B6E);
    margin: 0;
}

@media (max-width: 639px) {
    .author-bio {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}


/* =========================================================================
   RELATED POSTS
   ========================================================================= */

.blog-related {
    background: var(--dn-surface, #F7F3EE);
}


/* =========================================================================
   PAGINATION
   ========================================================================= */

.dn-pagination,
.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 32px 0 64px;
}

.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-family: var(--dn-font-body, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 500;
    color: var(--dn-text, #1A1A18);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s ease;
}
.nav-links .page-numbers:hover {
    background: var(--dn-surface, #F7F3EE);
}
.nav-links .page-numbers.current {
    background: var(--dn-primary, #1B3A4B);
    color: #fff;
}
.nav-links .prev,
.nav-links .next {
    font-weight: 600;
}
