/* ========================================
   ZeaGrove Blog Styles
   ======================================== */

/* ── Blog Archive ── */
.zg-blog-archive {
    padding-bottom: 0;
}

/* Elementor heading area inside blog archive */
.zg-blog-archive .zg-blog-heading-area {
    padding: var(--zg-space-8, 2rem) 0 var(--zg-space-4, 1rem);
}

/* Posts Grid */
.zg-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Blog Card */
.zg-blog-card {
    background: var(--zg-white, #fff);
    border: 1px solid var(--zg-gray-200, #E9ECEF);
    border-radius: var(--zg-radius-lg, 12px);
    overflow: hidden;
    transition: box-shadow var(--zg-transition-base, 0.3s ease),
                transform var(--zg-transition-base, 0.3s ease);
}

.zg-blog-card:hover {
    box-shadow: var(--zg-shadow-md, 0 4px 12px rgba(0,0,0,0.08));
    transform: translateY(-2px);
}

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

.zg-blog-card-img-wrap {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--zg-gray-100, #F8F9FA);
}

.zg-blog-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--zg-transition-slow, 0.5s ease);
}

.zg-blog-card:hover .zg-blog-card-img {
    transform: scale(1.05);
}

.zg-blog-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.zg-blog-cat {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.zg-blog-cat-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--zg-primary, #2D8A4E);
    background: var(--zg-primary-light, #E8F5EC);
    padding: 0.25rem 0.625rem;
    border-radius: var(--zg-radius-full, 9999px);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: background var(--zg-transition-fast, 0.2s ease);
}

.zg-blog-cat-tag:hover {
    background: var(--zg-primary, #2D8A4E);
    color: #fff;
}

.zg-blog-card-title {
    font-family: var(--zg-font-heading, 'Noto Serif SC', Georgia, serif);
    font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
    line-height: 1.45;
    margin: 0;
    color: var(--zg-gray-800, #212529);
    transition: color var(--zg-transition-fast, 0.2s ease);
}

.zg-blog-card:hover .zg-blog-card-title {
    color: var(--zg-primary-dark, #1E6B37);
}

.zg-blog-card-excerpt {
    font-size: 0.9375rem;
    color: var(--zg-gray-500, #6C757D);
    line-height: 1.6;
    margin: 0;
}

.zg-blog-card-meta {
    font-size: 0.8125rem;
    color: var(--zg-gray-400, #ADB5BD);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.zg-blog-card-meta-sep {
    color: var(--zg-gray-300, #DEE2E6);
}

.zg-blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--zg-primary, #2D8A4E);
    text-decoration: none;
    transition: gap var(--zg-transition-fast, 0.2s ease);
}

.zg-blog-read-more:hover {
    gap: 0.625rem;
}

/* ── Single Post ── */
.zg-post-single {
    padding-bottom: 0;
}

.zg-post-article {
    background: var(--zg-white, #fff);
    border-radius: var(--zg-radius-lg, 12px);
    overflow: hidden;
}

.zg-post-header {
    padding: 1.5rem 0 1rem;
}

.zg-post-title {
    font-family: var(--zg-font-heading, 'Noto Serif SC', Georgia, serif);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1.3;
    margin: 0.75rem 0 0.5rem;
    color: var(--zg-gray-800, #212529);
}

.zg-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--zg-gray-400, #ADB5BD);
    margin-top: 0.5rem;
}

.zg-post-meta-sep {
    color: var(--zg-gray-300, #DEE2E6);
}

.zg-post-author-link {
    color: var(--zg-gray-500, #6C757D);
    text-decoration: none;
}

.zg-post-author-link:hover {
    color: var(--zg-primary, #2D8A4E);
}

.zg-post-featured-image {
    margin: 0 0 1.5rem;
    border-radius: var(--zg-radius-lg, 12px);
    overflow: hidden;
    background: var(--zg-gray-100, #F8F9FA);
}

.zg-post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Post Content — reading width */
.zg-post-content {
    max-width: 740px;
    margin: 0 auto;
    line-height: 1.8;
    font-size: 1.0625rem;
    color: var(--zg-gray-800, #212529);
}

/* Ensure Elementor blocks inside the_content don't overflow */
.zg-post-content .elementor-section-wrap,
.zg-post-content .elementor-section {
    max-width: 100%;
}

/* Post Footer */
.zg-post-footer {
    padding: 2rem 0 1rem;
}

.zg-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid var(--zg-gray-200, #E9ECEF);
}

.zg-post-tag-label {
    font-size: 0.8125rem;
    color: var(--zg-gray-500, #6C757D);
    font-weight: 600;
}

.zg-post-tag {
    display: inline-block;
    font-size: 0.8125rem;
    color: var(--zg-gray-600, #495057);
    background: var(--zg-gray-100, #F8F9FA);
    padding: 0.25rem 0.75rem;
    border-radius: var(--zg-radius-full, 9999px);
    text-decoration: none;
    transition: background var(--zg-transition-fast, 0.2s ease),
                color var(--zg-transition-fast, 0.2s ease);
}

.zg-post-tag:hover {
    background: var(--zg-primary, #2D8A4E);
    color: #fff;
}

/* Share Buttons */
.zg-post-share {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--zg-gray-200, #E9ECEF);
}

.zg-post-share-label {
    font-size: 0.8125rem;
    color: var(--zg-gray-500, #6C757D);
    font-weight: 600;
}

.zg-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--zg-gray-200, #E9ECEF);
    color: var(--zg-gray-500, #6C757D);
    text-decoration: none;
    transition: all var(--zg-transition-fast, 0.2s ease);
}

.zg-share-btn:hover {
    background: var(--zg-primary, #2D8A4E);
    border-color: var(--zg-primary, #2D8A4E);
    color: #fff;
}

/* Author Card */
.zg-post-author-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    background: var(--zg-gray-100, #F8F9FA);
    border-radius: var(--zg-radius-lg, 12px);
    align-items: flex-start;
}

.zg-author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--zg-gray-200, #E9ECEF);
}

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

.zg-author-info {
    flex: 1;
}

.zg-author-name {
    font-family: var(--zg-font-heading, 'Noto Serif SC', Georgia, serif);
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0 0 0.375rem;
    color: var(--zg-gray-800, #212529);
}

.zg-author-name a {
    color: inherit;
    text-decoration: none;
}

.zg-author-name a:hover {
    color: var(--zg-primary, #2D8A4E);
}

.zg-author-bio {
    font-size: 0.875rem;
    color: var(--zg-gray-500, #6C757D);
    line-height: 1.6;
    margin: 0;
}

/* ── Related Posts ── */
.zg-related-posts {
    padding: 2.5rem 0;
}

.zg-related-posts .zg-section-header {
    margin-bottom: 1.5rem;
}

.zg-related-posts .zg-section-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--zg-primary, #2D8A4E);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.zg-related-posts .zg-section-title {
    font-family: var(--zg-font-heading, 'Noto Serif SC', Georgia, serif);
    font-size: var(--zg-text-2xl, 1.5rem);
    margin: 0;
    color: var(--zg-gray-800, #212529);
}

.zg-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.zg-related-card {
    background: var(--zg-white, #fff);
    border: 1px solid var(--zg-gray-200, #E9ECEF);
    border-radius: var(--zg-radius-lg, 12px);
    overflow: hidden;
    transition: box-shadow var(--zg-transition-base, 0.3s ease);
}

.zg-related-card:hover {
    box-shadow: var(--zg-shadow-md, 0 4px 12px rgba(0,0,0,0.08));
}

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

.zg-related-card-img {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--zg-gray-100, #F8F9FA);
}

.zg-related-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.zg-related-card-body {
    padding: 1rem 1.125rem;
}

.zg-related-card-title {
    font-family: var(--zg-font-heading, 'Noto Serif SC', Georgia, serif);
    font-size: 1rem;
    line-height: 1.4;
    margin: 0 0 0.375rem;
    color: var(--zg-gray-800, #212529);
    transition: color var(--zg-transition-fast, 0.2s ease);
}

.zg-related-card:hover .zg-related-card-title {
    color: var(--zg-primary-dark, #1E6B37);
}

.zg-related-card-date {
    font-size: 0.8125rem;
    color: var(--zg-gray-400, #ADB5BD);
}

/* ── Empty State ── */
.zg-blog-empty {
    text-align: center;
    padding: 4rem 0;
    color: var(--zg-gray-500, #6C757D);
}

/* ── Responsive ── */
@media (max-width: 1023px) {
    .zg-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .zg-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .zg-posts-grid {
        grid-template-columns: 1fr;
    }

    .zg-related-grid {
        grid-template-columns: 1fr;
    }

    .zg-post-header {
        padding: 1rem 0 0.75rem;
    }

    .zg-post-author-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

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

    .zg-post-share {
        justify-content: center;
    }
}

/* ════════════════════════════════════════
   Enhanced Article Content Typography
   ════════════════════════════════════════ */

/* Headings inside article content */
.zg-post-content h2 {
    font-family: var(--zg-font-heading, 'Noto Serif SC', Georgia, serif);
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    margin: 2.5rem 0 1rem;
    color: var(--zg-gray-800, #212529);
    line-height: 1.35;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--zg-primary-light, #E8F5EC);
}

.zg-post-content h3 {
    font-family: var(--zg-font-heading, 'Noto Serif SC', Georgia, serif);
    font-size: clamp(1.1rem, 1.6vw, 1.35rem);
    margin: 2rem 0 0.75rem;
    color: var(--zg-primary-dark, #1E6B37);
    line-height: 1.4;
}

.zg-post-content h4 {
    font-size: 1.05rem;
    margin: 1.5rem 0 0.5rem;
    color: var(--zg-gray-700, #343A40);
    font-weight: 600;
}

/* Paragraphs */
.zg-post-content p {
    margin: 0 0 1.25rem;
    line-height: 1.85;
}

/* Strong emphasis */
.zg-post-content strong {
    color: var(--zg-gray-800, #212529);
}

/* Lists */
.zg-post-content ul,
.zg-post-content ol {
    margin: 0 0 1.5rem;
    padding-left: 1.5rem;
    line-height: 1.8;
}

.zg-post-content li {
    margin-bottom: 0.5rem;
}

.zg-post-content li strong {
    color: var(--zg-primary-dark, #1E6B37);
}

/* In-article images */
.zg-post-content figure.wp-block-image {
    margin: 2rem 0;
    text-align: center;
}

.zg-post-content figure.wp-block-image img {
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    max-width: 100%;
    height: auto;
}

.zg-post-content figure.wp-block-image figcaption {
    font-size: 0.85rem;
    color: var(--zg-gray-500, #6C757D);
    margin-top: 0.5rem;
    font-style: italic;
    line-height: 1.5;
}

/* Tables */
.zg-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.925rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.zg-post-content table thead tr {
    background-color: var(--zg-primary, #2D8A4E);
    color: #fff;
}

.zg-post-content table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.zg-post-content table td {
    padding: 10px 14px;
    border: 1px solid var(--zg-gray-200, #E9ECEF);
    vertical-align: top;
}

.zg-post-content table tbody tr:nth-child(even) {
    background-color: var(--zg-gray-100, #F8F9FA);
}

.zg-post-content table tbody tr:hover {
    background-color: var(--zg-primary-light, #E8F5EC);
}

/* Div-based callout boxes (used in articles) */
.zg-post-content div[style*="background:#f0f7f3"],
.zg-post-content div[style*="background: #f0f7f3"] {
    border-radius: 8px !important;
    margin: 2rem 0 !important;
}

/* CTA buttons in articles */
/* CTA Button in article (links inside a centered div) */
.zg-post-content div[style*="text-align:center"] > a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: #C8A45C;
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(200,164,92,0.3);
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.zg-post-content div[style*="text-align:center"] > a:hover {
    background: #B8933E;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(200,164,92,0.45);
}

/* Horizontal rule */
.zg-post-content hr {
    margin: 2.5rem 0;
    border: none;
    border-top: 1px solid var(--zg-gray-200, #E9ECEF);
}

/* Company signature at end of articles */
.zg-post-content p:last-of-type em {
    color: var(--zg-gray-500, #6C757D);
    font-size: 0.875rem;
    line-height: 1.7;
}

.zg-post-content p:last-of-type em a {
    color: var(--zg-primary, #2D8A4E);
    text-decoration: none;
}

.zg-post-content p:last-of-type em a:hover {
    text-decoration: underline;
}

/* ════════════════════════════════════════
   Reading Progress Bar
   ════════════════════════════════════════ */

.zg-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--zg-primary, #2D8A4E), var(--zg-accent, #C8A45C));
    z-index: 99999;
    transition: width 0.1s linear;
    will-change: width;
}

/* ════════════════════════════════════════
   Scroll to Top Button
   ════════════════════════════════════════ */

.zg-scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--zg-primary, #2D8A4E);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 99998;
    box-shadow: 0 2px 12px rgba(45, 138, 78, 0.3);
}

.zg-scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.zg-scroll-top:hover {
    background: var(--zg-primary-dark, #1E6B37);
    transform: translateY(-2px);
}

/* ════════════════════════════════════════
   Article Section Spacing Improvements
   ════════════════════════════════════════ */

.zg-blog-card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Better spacing for post footer elements */
.zg-post-footer {
    margin-top: 1rem;
}

/* Author card improvements */
.zg-post-author-card {
    border: 1px solid var(--zg-gray-200, #E9ECEF);
}

/* ----------------------------------------------
   Responsive: Article content adjustments
   ---------------------------------------------- */
@media (max-width: 767px) {
    .zg-post-content {
        padding: 0 0.25rem;
    }

    .zg-post-content table {
        font-size: 0.8125rem;
    }

    .zg-post-content table th,
    .zg-post-content table td {
        padding: 8px 10px;
    }

    .zg-post-content div[style*="text-align:center"] > a {
        display: flex !important;
        justify-content: center;
        padding: 0.875rem 1.5rem !important;
        font-size: 0.95em !important;
        width: 100%;
    }

    .zg-scroll-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 40px;
        height: 40px;
    }
}

/* ════════════════════════════════════════
   Blog archive - pagination styling
   ════════════════════════════════════════ */
.zg-pagination ul {
    display: flex;
    justify-content: center;
    gap: 0.375rem;
    list-style: none;
    padding: 1.5rem 0;
    margin: 0;
}

.zg-pagination li {
    margin: 0;
}

.zg-pagination a,
.zg-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.625rem;
    border: 1px solid var(--zg-gray-200, #E9ECEF);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--zg-gray-600, #495057);
    text-decoration: none;
    background: #fff;
    transition: all 0.2s ease;
}

.zg-pagination a:hover {
    background: var(--zg-primary-light, #E8F5EC);
    border-color: var(--zg-primary, #2D8A4E);
    color: var(--zg-primary, #2D8A4E);
}

.zg-pagination .current {
    background: var(--zg-primary, #2D8A4E);
    border-color: var(--zg-primary, #2D8A4E);
    color: #fff;
    font-weight: 600;
}

/* ── Disable entrance animation on blog PHP templates ── */
.page-template-page-blog .zg-section,
.single-post .zg-section {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}
