/**
 * Blog & Single Post Styles
 * Editorial design with refined typography
 *
 * @package SunnyHQ
 */

/* ============================================
   TYPOGRAPHY VARIABLES
   ============================================ */
:root {
    --font-blog-serif: 'Source Serif 4', Georgia, 'Times New Roman', Times, serif;
}

/* ============================================
   NAV BAR OVERRIDE FOR BLOG PAGES
   Apply "scrolled" dark state on blog/news pages
   (These pages have white backgrounds, so nav needs navy bg with white text/logo)
   ============================================ */

/* Navy background for nav bar */
.blog-archive .nav-bar,
.news-archive .nav-bar,
.single-post .nav-bar {
    background: rgba(2, 0, 81, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.25),
        0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

/* Show light (white) logo, hide dark logo */
.blog-archive .nav-logo-dark,
.news-archive .nav-logo-dark,
.single-post .nav-logo-dark {
    opacity: 0;
}

.blog-archive .nav-logo-light,
.news-archive .nav-logo-light,
.single-post .nav-logo-light {
    opacity: 1;
}

/* White nav link text */
.blog-archive .nav-link,
.news-archive .nav-link,
.single-post .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.blog-archive .nav-link:hover,
.news-archive .nav-link:hover,
.single-post .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* White phone number */
.blog-archive .nav-phone,
.news-archive .nav-phone,
.single-post .nav-phone {
    color: rgba(255, 255, 255, 0.7);
}

.blog-archive .nav-phone:hover,
.news-archive .nav-phone:hover,
.single-post .nav-phone:hover {
    color: #fff;
}

/* White mobile hamburger */
.blog-archive .nav-mobile-toggle span,
.news-archive .nav-mobile-toggle span,
.single-post .nav-mobile-toggle span {
    background: #fff;
}

/* ============================================
   MINIMAL PAGE TITLE (Blog/News Archive)
   Left-justified, editorial masthead style
   ============================================ */
.blog-title-section {
    padding: 6rem 0 1.5rem; /* Added ~8px extra top spacing for breathing room below nav */
    text-align: left;
}

.blog-page-title {
    font-family: var(--font-h);
    font-size: clamp(2.5rem, 5vw, 3rem);
    font-weight: 400;
    color: var(--navy);
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

.blog-page-subtitle {
    font-size: 1.05rem;
    color: var(--navy-50);
    margin: 0;
}

/* ============================================
   BLOG GRID
   ============================================ */
.blog-grid-section {
    padding: 2rem 0 5rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* ============================================
   BLOG CARD
   ============================================ */
.blog-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    border-color: var(--gray-300);
    box-shadow: 0 8px 24px rgba(2, 0, 81, 0.06);
}

.blog-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.blog-card-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--gray-100);
    position: relative;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Coral tint overlay on hover */
.blog-card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--coral);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.blog-card:hover .blog-card-image::after {
    opacity: 0.15;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.03);
}

/* Branded placeholder */
.blog-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
}

.blog-card-content {
    padding: 1.5rem;
}

/* Card titles use serif for editorial feel */
.blog-card-title {
    font-family: var(--font-blog-serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--navy);
    line-height: 1.35;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-excerpt {
    font-size: 0.875rem;
    color: var(--navy-60);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--navy-50);
}

.meta-sep {
    color: var(--gray-300);
}

/* ============================================
   PROMO BANNER — Compact version (120-150px)
   ============================================ */
.blog-promo-banner {
    background: linear-gradient(135deg, var(--coral) 0%, var(--deep-purple) 100%);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.blog-promo-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.blog-promo-content h2 {
    font-family: var(--font-h);
    font-size: 1.375rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.blog-promo-content p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 480px;
    margin: 0;
    line-height: 1.4;
}

.blog-promo-buttons {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.blog-promo-buttons .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* ============================================
   PAGINATION
   ============================================ */
.blog-pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.blog-pagination .nav-links,
.blog-pagination > * {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.blog-pagination a,
.blog-pagination span.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--navy-70);
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.blog-pagination a:hover {
    border-color: var(--coral);
    color: var(--coral);
}

.blog-pagination .current {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.blog-pagination .prev,
.blog-pagination .next {
    padding: 0;
}

.no-posts {
    text-align: center;
    padding: 4rem 0;
    color: var(--navy-50);
}

/* ============================================
   SINGLE POST — CLEAN EDITORIAL LAYOUT
   ============================================ */

/* Article container width */
.container-article {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Post Header - white background, clean */
.post-header {
    padding: 6rem 0 0; /* Added extra top spacing for breathing room below nav */
    background: #fff;
}

/* Category label - small, uppercase, coral */
.post-category-label {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--coral);
    text-decoration: none;
    margin-bottom: 0.75rem;
    transition: color 0.2s;
}

.post-category-label:hover {
    color: var(--deep-purple);
}

/* Post title - sans-serif, bold, authoritative */
.post-title {
    font-family: var(--font-h);
    font-size: clamp(2rem, 5vw, 2.625rem);
    font-weight: 700;
    color: var(--navy);
    line-height: 1.2;
    margin: 0 0 1.25rem;
    letter-spacing: -0.02em;
}

/* Author row */
.post-author-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.post-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.post-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-author-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--navy-50);
    flex-wrap: wrap;
}

.post-author-name {
    color: var(--navy-70);
    font-weight: 500;
}

.meta-dot {
    color: var(--gray-300);
}

/* Utility bar */
.post-utility-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
}

.post-subscribe-link {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--coral);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s;
}

.post-subscribe-link:hover {
    color: var(--deep-purple);
}

.post-share-icons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-share-icon {
    color: var(--navy-40);
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.post-share-icon:hover {
    color: var(--coral);
}

/* Divider */
.post-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0 0 1.5rem;
}

/* Featured Image - reduced bottom spacing */
.post-featured-image {
    padding: 0 0 1.5rem;
    background: #fff;
}

.post-featured-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Post Content - Serif body */
.post-content-section {
    padding: 0 0 3rem;
    background: #fff;
}

.post-content {
    font-family: var(--font-blog-serif);
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--navy-80);
}

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

.post-content p {
    margin-bottom: 1.75rem;
}

/* H2 — Sans-serif, larger (28-30px) */
.post-content h2 {
    font-family: var(--font-h);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

/* H3 — Sans-serif, larger (22-24px) */
.post-content h3 {
    font-family: var(--font-h);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--navy);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

/* H4 — Sans-serif */
.post-content h4 {
    font-family: var(--font-ui);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

.post-content a {
    color: var(--coral);
    text-decoration: none;
    transition: text-decoration 0.2s;
}

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

.post-content ul,
.post-content ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.post-content ul li,
.post-content ol li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.post-content ul li::marker {
    color: var(--coral);
}

.post-content ol li::marker {
    color: var(--coral);
    font-weight: 600;
}

/* Blockquotes — Serif italic */
.post-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: var(--gray-50);
    border-left: 4px solid var(--coral);
    border-radius: 0 8px 8px 0;
    font-family: var(--font-blog-serif);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--navy-70);
}

.post-content blockquote p {
    margin-bottom: 0;
}

.post-content blockquote p + p {
    margin-top: 1rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
}

.post-content figure {
    margin: 2rem 0;
}

.post-content figcaption {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--navy-50);
    text-align: center;
    margin-top: 0.75rem;
}

.post-content pre {
    background: var(--navy);
    color: #e5e7eb;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.post-content code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85em;
    background: var(--gray-100);
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

.post-content pre code {
    background: none;
    padding: 0;
    font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.post-content th,
.post-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.post-content th {
    font-family: var(--font-ui);
    font-weight: 600;
    color: var(--navy);
    background: var(--gray-50);
}

.post-content hr {
    border: none;
    height: 1px;
    background: var(--gray-200);
    margin: 3rem 0;
}

/* ============================================
   AUTHOR BOX
   ============================================ */
.author-box {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--gray-50);
    border-radius: 12px;
    margin-top: 3rem;
}

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

.author-info {
    flex: 1;
}

.author-label {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--navy-50);
}

.author-name {
    font-family: var(--font-h);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0.25rem 0 0.5rem;
}

.author-bio {
    font-size: 0.875rem;
    color: var(--navy-60);
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   RELATED POSTS
   ============================================ */
.related-posts {
    padding: 4rem 0;
    background: var(--gray-50);
}

.related-posts-title {
    font-family: var(--font-h);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    text-align: center;
    margin-bottom: 2rem;
}

/* ============================================
   POST CTA
   ============================================ */
.post-cta {
    padding: 0 0 4rem;
    background: var(--gray-50);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .blog-title-section {
        padding: 5rem 0 1.25rem;
    }

    .blog-page-title {
        font-size: 2.25rem;
    }

    .post-header {
        padding: 5rem 0 0;
    }

    .post-title {
        font-size: 1.75rem;
    }

    .post-author-meta {
        font-size: 0.8rem;
    }

    .blog-promo-banner {
        padding: 1rem 1rem;
    }

    .blog-promo-content h2 {
        font-size: 1.2rem;
    }

    .blog-promo-content p {
        font-size: 0.8rem;
    }

    .author-box {
        flex-direction: column;
        text-align: center;
    }

    .author-avatar img {
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-card-content {
        padding: 1.25rem;
    }

    .post-content {
        font-size: 1rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
    }

    .post-content h3 {
        font-size: 1.25rem;
    }

    .container-article {
        padding: 0 1rem;
    }

    .post-utility-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .post-share-icons {
        width: 100%;
        justify-content: flex-start;
    }
}
