/**
 * Blog Post Enhanced Stylesheet - v2.0
 *
 * ARCHITECTURE:
 * - Mobile-first approach with progressive enhancement
 * - Component-based media queries (inline with components)
 * - CSS variables for theming and consistency
 *
 * BREAKPOINTS (Standardized):
 * - Mobile: Base styles (default)
 * - Tablet: 768px+
 * - Desktop: 1024px+
 * - Very Small: 480px (special cases)
 *
 * DYNAMIC VARIABLES:
 * - Border radius, brand color, and font size set via JavaScript
 * - Theme Design Settings control these values
 */

:root {
    --brand-color: #030303;
    --brand-color-dark: #000000;
    --brand-color-light: rgba(255, 139, 90, 0.1);
    --brand-color-lighter: rgba(255, 139, 90, 0.05);
    --border-radius: 16px;
    --base-font-size: 18px;
    --content-max-width: 1200px;
    --sidebar-width: 400px;
    --hero-bg-color: #383737;
    --sidebar-bg-color: #333;
    --hero-title-size: calc(var(--base-font-size) * 2.5);
    --hero-description-size: var(--base-font-size);
    --section-heading-size: calc(var(--base-font-size) * 1.5);
    --text-color: #333;
    --text-color-light: #444;
    --text-color-lighter: #666;
    --text-color-darker: #1a1a1a;
    --text-gray: #4b5563;
    --white: #ffffff;
    --grey-light: #f8f9fa;
    --grey-medium: #e9ecef;
    --grey-dark: #6c757d;
    --border-light: #e8e9ea;
    --transition: all 0.3s ease;
    --transition-fast: all 0.2s ease;
    --cta-button-bg-color: #ff8b5a;
    --cta-button-text-color: #ffffff;
    --brand-shadow: rgba(255, 139, 90, 0.3);
    --brand-shadow-hover: rgba(255, 139, 90, 0.4);

    /* Gradient definitions */
    --gradient-primary: linear-gradient(135deg, var(--brand-color) 0%, #e07040 100%);
    --gradient-light: linear-gradient(135deg, #fff9f5 0%, #ffffff 100%);
    --gradient-subtle: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);

    /* Standardized breakpoints (non-overlapping) */
    --breakpoint-mobile: 480px;
    --breakpoint-tablet: 768px;
    --breakpoint-desktop: 1024px;

    /* Breakpoint ranges:
     * Mobile: 0-767px (max-width: 767px)
     * Tablet: 768px-1023px (min-width: 768px and max-width: 1023px)
     * Desktop: 1024px+ (min-width: 1024px)
     */

    /* Layout dimensions */
    --toc-widget-height: 350px;
    --toc-header-height: 60px;
    --toc-list-height: 290px; /* Calculated: 350px - 60px */
    --featured-image-ratio-desktop: 3/2;
    --featured-image-ratio-mobile: 4/3;
    --sidebar-sticky-offset: 0.5rem;
    --sidebar-max-height: calc(100vh - 1rem);
}

/* White background on single posts to override any global Elementor background */
body.single-post {
    background: #ffffff !important;
    background-image: none !important;
}

/* Force overflow visible on parent containers for sticky positioning to work */
.site-main,
#content.site-main {
    overflow: visible !important;
}

.cgn-modern-article {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
        Cantarell, sans-serif;
    font-size: var(--base-font-size);
    line-height: 1.7;
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

.hero-section {
    color: var(--text-color);
    padding: 1.5rem 0 0 0;
    /* margin-top is controlled by Blog Post Top Margin setting in Design Settings */
    position: relative;
    min-height: auto;
    display: flex;
    align-items: flex-start;
}

.hero-container {
    position: relative;
    z-index: 1;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: flex-start;
    min-height: auto;
}

.hero-text {
    max-width: 100%;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    font-size: var(--hero-title-size);
    font-weight: 700;
    line-height: 1.2;
    margin: 1.5rem 0 1rem 0;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.hero-description {
    font-size: var(--hero-description-size);
    color: var(--text-color-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.hero-section .author-section {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Remove bottom margin from last meta item */
.hero-section .author-section > *:last-child {
    margin-bottom: 0;
}

.byline-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.byline-label {
    color: var(--text-color-light);
    font-weight: 600;
}

.byline-value {
    color: var(--text-color);
    font-weight: 400;
}

.reviewer-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.reviewer-label {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
}

.reviewer-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.reviewer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.reviewer-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.reviewer-name {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
}

.reviewer-title {
    color: var(--grey-dark);
    font-size: 0.875rem;
    font-weight: 400;
}

.post-meta {
    font-size: 1rem;
    color: var(--text-color-light);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.reviewed-by-link {
    font-size: 1rem;
    color: var(--text-color-light);
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

a[href="#key-points"],
#key-points-link {
    color: var(--brand-color);
    border-bottom: 2px solid var(--brand-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a[href="#key-points"]:hover,
#key-points-link:hover {
    color: var(--brand-color-dark);
    border-bottom-color: var(--brand-color-dark);
    text-decoration: none;
}

.reviewed-by-link .author-link {
    color: var(--brand-color);
    border-bottom: 2px solid var(--brand-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.reviewed-by-link .author-link:hover {
    color: var(--brand-color);
}

.hero-image {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.featured-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    object-fit: cover;
    aspect-ratio: var(--featured-image-ratio-desktop);
    overflow: hidden;
    display: block;
}

.featured-image-container {
    width: 100%;
    max-width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    aspect-ratio: var(--featured-image-ratio-desktop);
    background: transparent;
}

.featured-image-placeholder {
    width: 100%;
    aspect-ratio: var(--featured-image-ratio-desktop);
    background: var(--grey-light);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-lighter);
    font-size: 0.875rem;
}

.featured-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
}

/* Simple Breadcrumbs Section - Apple Style */
.simple-breadcrumbs-section {
    background: var(--white);
    border-bottom: 1px solid var(--grey-medium);
    padding: 0.75rem 0;
}

.simple-breadcrumbs-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.simple-breadcrumbs-container .cgn-breadcrumbs {
    display: flex;
    align-items: center;
}

.simple-breadcrumbs-container .cgn-breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.simple-breadcrumbs-container .cgn-breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.simple-breadcrumbs-container .cgn-breadcrumb-link {
    color: var(--text-color-light);
    text-decoration: none;
    transition: var(--transition-fast);
    font-weight: 400;
}

.simple-breadcrumbs-container .cgn-breadcrumb-link:hover {
    color: var(--brand-color);
    text-decoration: underline;
}

.simple-breadcrumbs-container .cgn-breadcrumb-current {
    color: var(--text-color);
    font-weight: 500;
}

.simple-breadcrumbs-container .cgn-breadcrumb-separator {
    color: var(--text-color-lighter);
    font-weight: 300;
}

/* Tablet breadcrumbs */
@media (min-width: 768px) and (max-width: 1023px) {
    .simple-breadcrumbs-container {
        padding: 0 1.5rem;
    }
}

/* Mobile breadcrumbs */
@media (max-width: 767px) {
    .simple-breadcrumbs-section {
        padding: 0.5rem 0;
    }

    .simple-breadcrumbs-container {
        padding: 0 1rem;
    }

    .simple-breadcrumbs-container .cgn-breadcrumb-list {
        font-size: 0.8125rem;
        gap: 0.375rem;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .simple-breadcrumbs-container {
        padding: 0 0.5rem;
    }

    .simple-breadcrumbs-container .cgn-breadcrumb-list {
        font-size: 0.75rem;
    }
}

/* Content Wrapper */
.content-wrapper {
    background: var(--white);
    min-height: 100vh;
}

.post-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 2rem 2rem;
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 3rem;
    align-items: start;
    position: relative;
}

.main-content {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal overflow */
}

.content-section {
    background: var(--brand-color-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.content-section.key-points-section {
    background: transparent;
    padding: 0;
}

.content-section h2,
.content-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

.key-points-heading {
    color: var(--text-color);
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.key-points-list {
    list-style: none;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid var(--grey-medium);
}

.key-point-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 1.2rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.key-point-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.125em;
    width: 20px;
    height: 20px;
    background-color: var(--brand-color);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M505 174.8l-39.6-39.6c-9.4-9.4-24.6-9.4-33.9 0L192 374.7 80.6 263.2c-9.4-9.4-24.6-9.4-33.9 0L7 302.9c-9.4 9.4-9.4 24.6 0 34L175 505c9.4 9.4 24.6 9.4 33.9 0l296-296.2c9.4-9.5 9.4-24.7.1-34zm-324.3 106c6.2 6.3 16.4 6.3 22.6 0l208-208.2c6.2-6.3 6.2-16.4 0-22.6L366.1 4.7c-6.2-6.3-16.4-6.3-22.6 0L192 156.2l-55.4-55.5c-6.2-6.3-16.4-6.3-22.6 0L68.7 146c-6.2 6.3-6.2 16.4 0 22.6l112 112.2z'/%3E%3C/svg%3E")
        no-repeat center;
    mask-size: contain;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M505 174.8l-39.6-39.6c-9.4-9.4-24.6-9.4-33.9 0L192 374.7 80.6 263.2c-9.4-9.4-24.6-9.4-33.9 0L7 302.9c-9.4 9.4-9.4 24.6 0 34L175 505c9.4 9.4 24.6 9.4 33.9 0l296-296.2c9.4-9.5 9.4-24.7.1-34zm-324.3 106c6.2 6.3 16.4 6.3 22.6 0l208-208.2c6.2-6.3 6.2-16.4 0-22.6L366.1 4.7c-6.2-6.3-16.4-6.3-22.6 0L192 156.2l-55.4-55.5c-6.2-6.3-16.4-6.3-22.6 0L68.7 146c-6.2 6.3-6.2 16.4 0 22.6l112 112.2z'/%3E%3C/svg%3E")
        no-repeat center;
    -webkit-mask-size: contain;
    flex-shrink: 0;
}

.key-point-item:last-child {
    margin-bottom: 0;
}

/* FAQ Navigation Link in Key Points */
.key-points-faq-link {
    margin-top: 1.5rem;
    text-align: right;
}

.faq-jump-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--brand-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-bottom: none;
}

.faq-jump-link:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.faq-link-text {
    font-weight: 400;
    letter-spacing: 0.025em;
    border-bottom: 1px solid var(--brand-color);
}

.faq-arrow {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-jump-link:hover .faq-arrow {
    transform: translateY(2px);
}

/* Clean TOC Widget */
.clean-toc-widget {
    background: var(--white);
    border: 1px solid var(--grey-medium);
    border-radius: var(--border-radius);
    overflow: hidden;
    height: var(--toc-widget-height); /* Fixed height to show 8+ headings */
    flex-shrink: 0;
    margin: 0; /* Ensure no margin conflicts */
}

.clean-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--grey-medium);
    background: var(--grey-light);
    height: var(--toc-header-height);
    box-sizing: border-box;
}

.clean-toc-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.clean-toc-list-container {
    height: var(--toc-list-height); /* Calculated from widget height - header */
    overflow-y: auto;
    padding: 0.75rem 0;
}

/* Clean TOC List Styles */
.clean-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.clean-toc-item {
    margin: 0;
    border-bottom: 1px solid var(--grey-light);
}

.clean-toc-item:last-child {
    border-bottom: none;
}

.clean-toc-link {
    display: block;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.4;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
    font-weight: normal; /* Override bold from article-content links */
    border-bottom: none; /* Remove bottom border from article-content links */
}

.clean-toc-link:hover {
    background: var(--grey-light);
    color: var(--brand-color);
    border-left-color: var(--brand-color);
    border-bottom: none; /* Keep bottom border removed on hover */
}

.clean-toc-link.active {
    background: var(--grey-light);
    color: var(--brand-color);
    border-left-color: var(--brand-color);
    font-weight: 500;
}

/* Mobile TOC Styling */
.mobile-toc-widget {
    background: var(--white);
    border: 1px solid var(--grey-medium);
    border-radius: var(--border-radius);
    margin: 2rem 1rem; /* Consistent mobile margins */
    overflow: hidden;
    display: none; /* Hidden by default, shown on mobile */
}

.mobile-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--grey-light);
    cursor: pointer;
    user-select: none;
    min-height: 56px; /* Better touch target for mobile */
    touch-action: manipulation;
}

.mobile-toc-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.mobile-toc-toggle {
    color: var(--text-color);
    font-size: 1.2rem;
    transition: var(--transition-fast);
    min-width: 24px;
    text-align: center;
    font-weight: bold;
}

.mobile-toc-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-toc-content.expanded {
    max-height: 500px;
}

.mobile-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-toc-item {
    border-bottom: 1px solid rgba(233, 236, 239, 0.5);
}

.mobile-toc-item:last-child {
    border-bottom: none;
}

.mobile-toc-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    transition: var(--transition-fast);
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.4;
    min-height: 48px; /* Better mobile touch target */
    touch-action: manipulation;
    border-bottom: none; /* Remove bottom border from article-content links */
}

.mobile-toc-link:hover {
    background: rgba(255, 139, 90, 0.05);
    color: var(--brand-color);
    border-bottom: none; /* Keep bottom border removed on hover */
}

.article-content {
    margin: 3rem 0;
    line-height: 1.7;
    font-size: var(--base-font-size);
    background: rgba(249, 249, 250, 1);
    padding: 1rem 1rem;
    border-radius: var(--border-radius);
    word-wrap: break-word; /* Break long words */
}

/* HR elements styling - respect brand color */
.article-content hr,
hr {
    border: none;
    border-top: 2px solid var(--brand-color);
    margin: 2rem 0;
    width: 100%;
    background: transparent;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2em;
    margin-bottom: 0.5em;
    color: var(--text-color);
}

.article-content h2 {
    font-size: 2em;
}

.article-content h3 {
    font-size: 1.5em;
}

.article-content h4 {
    font-size: 1.3em;
}

.article-content p {
    margin-bottom: 1.5em;
    text-align: justify;
    hyphens: auto;
}

.article-content p:first-of-type {
    font-size: 1.2em;
    font-weight: 400;
}

.article-content a {
    color: var(--brand-color);
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid var(--brand-color);
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5em;
    padding-left: 2em;
}

.article-content li {
    margin-bottom: 0.5em;
    line-height: 1.6;
}

.article-content blockquote {
    margin: 2em 0;
    padding: 1.5em 2em;
    background-color: var(--grey-light);
    border-left: 4px solid var(--brand-color);
    font-style: italic;
    font-size: 1.1em;
}

.article-content img {
    max-width: 100% !important;
    width: auto !important;
    height: auto;
    border-radius: var(--border-radius);
    margin: 1.5em 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    object-fit: contain; /* Ensure images fit within container */
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95em;
}

.article-content th,
.article-content td {
    padding: 0.75em;
    text-align: left;
    border-bottom: 1px solid var(--grey-medium);
}

.article-content th {
    background-color: var(--grey-light);
    font-weight: 600;
    color: var(--text-color);
}

.article-content .wp-block-image {
    text-align: center;
    max-width: 100% !important;
    overflow: hidden;
}

/* Ensure all WordPress blocks respect container width */
.article-content [class*="wp-block"] {
    max-width: 100% !important;
    overflow-x: hidden;
}

.article-content .wp-block-quote {
    border-left: 4px solid var(--brand-color);
    padding-left: 1.5em;
    font-style: italic;
}

.article-content a:focus,
.article-content button:focus {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
}

.social-sharing-section {
    text-align: center;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.social-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--white);
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    border: 2px solid var(--grey-medium);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.875rem;
}

.social-button:hover {
    background: var(--brand-color);
    color: var(--white);
    border-color: var(--brand-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--brand-shadow);
}

.recent-posts-section {
    margin: 4rem 0;
}

.recent-posts-section h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
}

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

.recent-post-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.recent-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

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

.recent-post-content {
    padding: 1.5rem;
}

.recent-post-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.recent-post-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.recent-post-title a:hover {
    color: var(--brand-color);
}

.recent-post-excerpt {
    color: var(--text-color-light);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.recent-post-meta {
    font-size: 0.75rem;
    color: var(--text-color-lighter);
    font-weight: 500;
}

/* Use higher specificity without !important for better maintainability */
body.single-post .post-container .clean-sidebar,
.cgn-modern-article .post-container .clean-sidebar,
body.single .post-container .clean-sidebar {
    position: sticky;
    top: var(--sidebar-sticky-offset);
    height: fit-content;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-height: var(--sidebar-max-height);
    overflow-y: auto; /* Allow sidebar to scroll when taller than viewport */
    z-index: 10;
    will-change: transform;
}

/* TOC Widget Stability */
body.single-post .clean-toc-widget,
body.single .clean-toc-widget,
.cgn-modern-article .clean-toc-widget {
    flex-shrink: 0;
    overflow: hidden;
}

/* CTA Widget Stability */
body.single-post .clean-cta-widget,
body.single .clean-cta-widget,
.cgn-modern-article .clean-cta-widget {
    flex-shrink: 0;
}

.sidebar-section {
    background: var(--sidebar-bg-color);
    color: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 0; /* Remove margin - using gap from parent */
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section h3,
.sidebar-section h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--white);
    font-weight: 600;
    font-size: 1.125rem;
}

/* Clean CTA Widget */
.clean-cta-widget {
    background: var(--white);
    border: 1px solid var(--grey-medium);
    border-radius: var(--border-radius);
    padding: 2rem;
    flex-shrink: 0;
    min-height: 200px;
    margin: 0; /* Ensure no margin conflicts */
}

.cta-section {
    background: var(--white);
    border: 1px solid var(--grey-medium);
    border-radius: var(--border-radius);
    overflow: hidden;
    padding: 2rem;
}

.cta-header {
    background: transparent;
    padding: 0 0 1.5rem 0;
    border-bottom: none;
}

.cta-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cta-logo {
    font-size: 1.2rem;
}

.cta-brand-name {
    color: var(--text-color);
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.cta-content {
    padding: 0;
    text-align: left;
}

.cta-title {
    color: var(--white);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 1.5rem 0;
}

.cta-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.cta-features li {
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color-light);
    font-size: 1.125rem;
    line-height: 1.6;
    font-weight: 400;
}

.cta-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.125em;
    width: 24px;
    height: 24px;
    background-color: var(--brand-color);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M505 174.8l-39.6-39.6c-9.4-9.4-24.6-9.4-33.9 0L192 374.7 80.6 263.2c-9.4-9.4-24.6-9.4-33.9 0L7 302.9c-9.4 9.4-9.4 24.6 0 34L175 505c9.4 9.4 24.6 9.4 33.9 0l296-296.2c9.4-9.5 9.4-24.7.1-34zm-324.3 106c6.2 6.3 16.4 6.3 22.6 0l208-208.2c6.2-6.3 6.2-16.4 0-22.6L366.1 4.7c-6.2-6.3-16.4-6.3-22.6 0L192 156.2l-55.4-55.5c-6.2-6.3-16.4-6.3-22.6 0L68.7 146c-6.2 6.3-6.2 16.4 0 22.6l112 112.2z'/%3E%3C/svg%3E")
        no-repeat center;
    mask-size: contain;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M505 174.8l-39.6-39.6c-9.4-9.4-24.6-9.4-33.9 0L192 374.7 80.6 263.2c-9.4-9.4-24.6-9.4-33.9 0L7 302.9c-9.4 9.4-9.4 24.6 0 34L175 505c9.4 9.4 24.6 9.4 33.9 0l296-296.2c9.4-9.5 9.4-24.7.1-34zm-324.3 106c6.2 6.3 16.4 6.3 22.6 0l208-208.2c6.2-6.3 6.2-16.4 0-22.6L366.1 4.7c-6.2-6.3-16.4-6.3-22.6 0L192 156.2l-55.4-55.5c-6.2-6.3-16.4-6.3-22.6 0L68.7 146c-6.2 6.3-6.2 16.4 0 22.6l112 112.2z'/%3E%3C/svg%3E")
        no-repeat center;
    -webkit-mask-size: contain;
}

.cta-features li:last-child {
    margin-bottom: 0;
}

.cta-button {
    display: block;
    background-color: var(--cta-button-bg-color);
    color: var(--cta-button-text-color) !important; /* Override article link styles */
    padding: 1rem 1.5rem;
    border-radius: var(--cta-button-radius, var(--border-radius));
    text-decoration: none !important;
    font-weight: 600;
    font-size: 1.125rem;
    transition: var(--transition);
    text-align: center;
    border: none;
    border-bottom: none !important; /* Remove link underline style */
    margin-top: 1.5rem;
}

.cta-button:hover,
.cta-button:focus,
.cta-button:active {
    background: var(--cta-button-bg-color);
    color: var(--cta-button-text-color) !important; /* Override article link styles */
    transform: translateY(-2px);
    text-decoration: none !important;
    border-bottom: none !important;
}

.mobile-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--brand-color);
    color: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    z-index: 1000;
    transform: translateY(0);
    transition: var(--transition);
    display: none; /* Hidden by default, shown on mobile */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.mobile-sticky-cta.collapsed {
    transform: translateY(calc(100% - 3rem));
}

.mobile-cta-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.mobile-cta-text {
    flex: 1;
}

.mobile-cta-text strong {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.mobile-cta-text span {
    font-size: 0.75rem;
    opacity: 0.9;
}

.mobile-cta-heading {
    flex: 1;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--white);
}

.mobile-cta-button {
    background: var(--cta-button-bg-color);
    color: var(--cta-button-text-color) !important; /* Respect theme settings */
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    white-space: nowrap;
    border-bottom: none !important; /* Remove link underline style */
}

.mobile-cta-button:hover {
    background: var(--cta-button-bg-color);
    color: var(--cta-button-text-color) !important;
    transform: scale(1.05);
    text-decoration: none !important;
    border-bottom: none !important;
}

.mobile-cta-toggle {
    position: absolute;
    top: -2.5rem;
    right: 1rem;
    background: var(--brand-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-cta-toggle:hover {
    background: var(--brand-color);
}

.mobile-cta-toggle svg {
    transition: var(--transition);
}

.mobile-sticky-cta.collapsed .mobile-cta-toggle svg {
    transform: rotate(180deg);
}

/* ========================================
   FAQ Section - Plain Text Display
   Mobile: Base styles
   Tablet (768px+): Larger padding and fonts
   Desktop (1024px+): Maximum spacing
   ======================================== */
.faq-section {
    margin: 3rem 0;
    background: var(--white);
    border-radius: var(--border-radius, 8px);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.faq-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-color-darker);
    margin: 0 0 1.5rem 0;
    padding: 1.5rem 1.5rem 0 1.5rem;
    line-height: 1.3;
}

.faq-container {
    padding: 0;
}

.faq-item {
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem 1.5rem;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color-darker);
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.faq-answer {
    color: var(--text-gray);
    font-size: 1rem;
    line-height: 1.7;
}

.faq-answer p {
    margin: 0 0 1rem 0;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

/* ========================================
   FAQ Tablet & Desktop Styles (768px+)
   ======================================== */
@media (min-width: 768px) {
    .faq-section {
        margin: 3rem 0;
    }

    .faq-title {
        font-size: 1.5rem;
        padding: 2rem 2rem 0 2rem;
        margin: 0 0 2rem 0;
    }

    .faq-item {
        padding: 2rem;
    }

    .faq-question {
        font-size: 1.375rem;
        margin-bottom: 1rem;
    }

    .faq-answer {
        font-size: 1.0625rem;
    }
}

/* ========================================
   FAQ Large Desktop Styles (1024px+)
   ======================================== */
@media (min-width: 1024px) {
    .faq-section {
        margin: 3.5rem 0;
    }

    .faq-title {
        font-size: 1.75rem;
        padding: 2.5rem 2.5rem 0 2.5rem;
        margin: 0 0 2rem 0;
    }

    .faq-item {
        padding: 2.5rem;
    }

    .faq-question {
        font-size: 1.5rem;
    }

    .faq-answer {
        font-size: 1.125rem;
    }
}

/* Author Section Styling */
.author-section {
    background: var(--grey-light);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid var(--grey-medium);
}

.author-card {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.author-avatar {
    flex-shrink: 0;
}

.author-avatar img {
    border-radius: 50%;
    border: 3px solid var(--brand-color);
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.author-info {
    flex: 1;
}

.author-name {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.author-bio {
    color: var(--text-color-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.author-bio p {
    margin-bottom: 0.75rem;
}

.author-bio p:last-child {
    margin-bottom: 0;
}

.read-more-link {
    display: inline-flex;
    align-items: center;
    color: var(--brand-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid var(--brand-color);
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    font-size: 0.9rem;
}

.read-more-link:hover {
    background: var(--brand-color);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--brand-shadow);
}

/* Improved Sticky Widget Positioning */
.sticky-widget {
    position: sticky;
    top: 2rem;
    margin-bottom: 1.5rem;
    height: fit-content;
    max-height: calc(100vh - 6rem);
    overflow: hidden;
}

@media (min-width: 1024px) {
    body .mobile-sticky-cta {
        display: none;
    }
}

/* Clean Responsive Design */
@media (min-width: 1024px) {
    .clean-sidebar {
        display: flex;
    }
}

/* Responsive Design */

/* Tablet Styles (includes mobile) */
@media (max-width: 1023px) {
    :root {
        --sidebar-width: 350px;
    }

    .post-container {
        gap: 2rem;
        padding: 2rem 1.5rem;
    }

    .hero-container {
        padding: 0 1.5rem;
    }

    .hero-section {
        padding: 1.75rem 0 0 0;
        min-height: auto;
    }

    .breadcrumb-container {
        padding: 0 1.5rem;
    }

    .hero-content {
        gap: 2rem;
        min-height: auto;
        align-items: flex-start;
    }

    .hero-title {
        font-size: calc(var(--hero-title-size) * 0.9);
        margin: 3rem 0 1rem 0;
    }

    /* Tablet hero breadcrumbs */
    .hero-breadcrumbs {
        top: 0.75rem;
        left: 1.5rem;
    }

    /* Author page hero content spacing to avoid breadcrumb overlap on tablet */
    .author-page .hero-content {
        padding-top: 2.5rem;
    }

    .hero-breadcrumbs .cgn-breadcrumbs {
        padding: 0.4rem 0.9rem;
    }

    /* Tablet featured image sizing - use 1:1 square ratio */
    .featured-image-container {
        aspect-ratio: 1/1;
        height: auto;
    }

    .featured-image-placeholder {
        aspect-ratio: 1/1;
        height: auto;
    }
}

/* All Tablets (768px - 1023px) - Single Column Layout */
@media (min-width: 768px) and (max-width: 1023px) {
    .post-container {
        grid-template-columns: 1fr !important;
        max-width: 800px;
        padding: 2rem 1.5rem;
        gap: 2rem;
    }

    .clean-sidebar {
        display: none !important;
    }

    .mobile-toc-widget {
        display: block !important;
        margin: 2rem 1.5rem;
    }

    /* Constrain content width for better readability */
    .main-content {
        max-width: 800px;
        margin: 0 auto;
    }

    /* Hero section single-column layout for tablet portrait */
    .hero-section {
        min-height: auto;
    }

    .hero-content {
        grid-template-columns: 1fr !important;
        gap: 1.25rem;
        text-align: left;
        min-height: auto;
    }

    .hero-text {
        order: 1;
    }

    .hero-image {
        order: 2;
        margin-top: 0.5rem;
    }

    .featured-image {
        margin-bottom: 2rem;
    }

    .featured-image-container {
        display: block;
    }

    /* Key points section optimization for tablet */
    .key-points-list {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }

    /* Featured image sizing for tablet - use 1:1 square ratio */
    .featured-image-container {
        aspect-ratio: 1/1;
        height: auto;
    }

    .featured-image-placeholder {
        aspect-ratio: 1/1;
        height: auto;
    }
}

/* TOC Responsive Styles */
@media (min-width: 1024px) {
    .mobile-toc-widget {
        display: none !important;
    }

    .sidebar-toc-widget {
        display: block;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .mobile-toc-widget {
        display: block !important;
    }

    .sidebar-toc-widget {
        display: none !important;
    }
}

@media (max-width: 767px) {
    body .clean-sidebar {
        display: none;
    }

    .mobile-toc-widget {
        display: block;
    }

    /* Mobile FAQ improvements */
    .faq-question {
        padding: 1rem 1.25rem;
        gap: 0.75rem;
    }

    .faq-icon {
        width: 32px;
        height: 32px;
        margin-top: 0.125rem;
        min-width: 32px;
        min-height: 32px;
        color: #4b5563; /* Make icon more visible on mobile */
    }

    .faq-question-text {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    /* Make featured image 4:3 on mobile for less height */
    .featured-image-container {
        aspect-ratio: var(--featured-image-ratio-mobile);
    }

    .featured-image-placeholder {
        aspect-ratio: var(--featured-image-ratio-mobile);
    }

    /* Ensure consistent margins for all page elements */
    .recent-posts-section,
    .author-card {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    /* Override any sections that might have their own horizontal margins */
    .content-wrapper > * {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    :root {
        --hero-title-size: calc(var(--base-font-size) * 1.7);
        --hero-description-size: calc(var(--base-font-size) * 1.05);
    }

    .hero-container {
        padding: 0 1rem;
        width: 100%;
        max-width: 100%;
    }

    .hero-section {
        padding: 1rem 0 0 0;
        min-height: auto;
    }

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

    .hero-content {
        grid-template-columns: 1fr;
        gap: 0.625rem;
        text-align: left;
        min-height: auto;
        width: 100%;
        max-width: 100%;
    }

    /* Light design - no overlay needed */
    .hero-section::before {
        display: none;
    }

    .hero-text {
        order: 1;
        padding: 0;
        width: 100%;
        max-width: 100%;
    }

    .hero-image {
        order: 2;
        margin-top: 0;
    }

    .featured-image {
        margin-bottom: 2rem;
    }

    .featured-image-container {
        aspect-ratio: var(--featured-image-ratio-mobile);
        height: auto;
        overflow: hidden;
    }

    .hero-description {
        font-size: calc(var(--base-font-size) * 1.05);
        line-height: 1.6;
        margin-bottom: 0.75rem;
        color: var(--text-color-light);
    }

    .hero-section .author-section {
        margin-top: 0.5rem;
        gap: 0.25rem;
        margin-bottom: 0.5rem;
        padding: 0 1rem;
    }

    /* Mobile post meta styling */
    .post-meta {
        font-size: 0.875rem;
        line-height: 1.4;
        margin-bottom: 0.25rem;
    }
    .reviewed-by-link {
        font-size: 0.875rem;
        line-height: 1.4;
        margin-bottom: 0.25rem;
    }
    .byline-item {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }

    /* Mobile hero breadcrumbs */
    .hero-breadcrumbs {
        top: 0.5rem;
        left: 1rem;
    }

    .hero-breadcrumbs .cgn-breadcrumbs {
        padding: 0.375rem 0.75rem;
    }

    .hero-breadcrumbs .cgn-breadcrumb-list {
        gap: 0.25rem;
        font-size: 0.75rem;
    }

    .hero-breadcrumbs .cgn-breadcrumb-link,
    .hero-breadcrumbs .cgn-breadcrumb-current {
        font-size: 0.75rem;
    }

    .hero-breadcrumbs .cgn-breadcrumb-separator {
        font-size: 0.65rem;
    }

    .reviewer-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .reviewer-avatar {
        width: 40px;
        height: 40px;
    }

    .reviewer-meta {
        gap: 0.125rem;
    }

    .reviewer-name {
        font-size: 0.9rem;
    }

    .reviewer-title {
        font-size: 0.8rem;
    }

    .post-meta {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .reviewed-by-link {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    /* Mobile byline improvements */
    .byline-item {
        gap: 0.375rem;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .byline-label {
        font-weight: 600;
        color: var(--text-color);
    }

    .byline-value {
        font-weight: 400;
    }

    body .post-container {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0.75rem 1rem; /* Consistent mobile margin */
    }

    .main-content {
        width: 100%;
        max-width: 100%;
    }

    /* Sidebar hidden on mobile - handled above in consolidated media query */

    .mobile-sticky-cta {
        display: block; /* Show mobile CTA */
    }

    .recent-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .social-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 0; /* Remove padding since post-container now handles margins */
    }

    .social-button {
        width: 100%;
        max-width: 300px;
        justify-content: center;
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
        min-height: 48px; /* Better touch target */
        border-radius: calc(var(--border-radius) * 1.5);
    }

    .social-button svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .content-section {
        padding: 0; /* Remove padding since post-container now handles margins */
        margin-bottom: 1.5rem;
    }

    .article-content {
        font-size: calc(var(--base-font-size) * 0.95);
        line-height: 1.8;
    }

    .article-content h1 {
        font-size: 1.9em;
        line-height: 1.3;
        margin-top: 1.5em;
    }

    .article-content h2 {
        font-size: 1.6em;
        line-height: 1.4;
        margin-top: 1.8em;
        margin-bottom: 0.8em;
    }

    .article-content h3 {
        font-size: 1.4em;
        line-height: 1.4;
        margin-top: 1.6em;
    }

    .article-content p {
        margin-bottom: 1.6em;
        text-align: left; /* Better for mobile reading */
    }

    .article-content blockquote {
        padding: 1em 1.5em;
        margin: 1.5em 0;
    }

    .toc-section.mobile-collapsible {
        background: var(--brand-color-light);
        border: 1px solid var(--brand-color);
        border-radius: var(--border-radius);
        overflow: hidden;
    }

    .toc-mobile-header {
        background: var(--brand-color);
        color: var(--white);
        padding: 1rem;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: 600;
    }

    .toc-mobile-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding: 0 1rem;
    }

    .toc-mobile-content.expanded {
        max-height: 500px;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    /* Ensure all elements fit within viewport */
    * {
        box-sizing: border-box;
    }

    .hero-container {
        padding: 0 0.5rem;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .hero-section {
        padding: 1rem 0;
        min-height: 140px;
    }

    /* Very small mobile hero breadcrumbs */
    .hero-breadcrumbs {
        top: 0.25rem;
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
    }

    /* Author page hero content spacing to avoid breadcrumb overlap */
    .author-page .hero-content {
        padding-top: 3rem;
    }

    .hero-breadcrumbs .cgn-breadcrumbs {
        padding: 0.25rem 0.5rem;
        border-radius: 20px;
        max-width: calc(100vw - 1rem);
        overflow: hidden;
    }

    .hero-breadcrumbs .cgn-breadcrumb-list {
        gap: 0.125rem;
        font-size: 0.7rem;
    }

    .hero-breadcrumbs .cgn-breadcrumb-link,
    .hero-breadcrumbs .cgn-breadcrumb-current {
        font-size: 0.7rem;
        word-break: break-word;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 150px;
    }

    .hero-breadcrumbs .cgn-breadcrumb-separator {
        font-size: 0.6rem;
    }

    .post-container {
        padding: 1.5rem 0.5rem;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .hero-title {
        font-size: calc(var(--base-font-size) * 1.8);
        margin: 1.5rem 0 0.5rem 0;
        line-height: 1.3;
        letter-spacing: -0.015em;
    }

    .hero-description {
        font-size: var(--base-font-size);
        margin-bottom: 0.625rem;
        line-height: 1.55;
    }

    .hero-section .author-section {
        margin-top: 0.75rem;
        gap: 0.375rem;
        margin-bottom: 0.625rem;
        padding: 1rem;
    }

    /* Very small mobile post meta styling */
    .post-meta {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 0.375rem;
    }
    .reviewed-by-link {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 0.375rem;
    }
    .byline-item {
        font-size: 0.85rem;
        margin-bottom: 0.375rem;
    }

    .reviewer-details {
        gap: 0.375rem;
    }

    .reviewer-avatar {
        width: 36px;
        height: 36px;
    }

    .reviewer-name {
        font-size: 0.85rem;
    }

    .reviewer-title {
        font-size: 0.75rem;
    }

    .byline-item {
        font-size: 0.9rem;
        gap: 0.375rem;
        margin-bottom: 0.5rem;
    }

    .post-meta {
        font-size: 0.875rem;
        line-height: 1.4;
    }

    .reviewed-by-link {
        font-size: 0.875rem;
        line-height: 1.4;
    }

    .byline-label {
        font-weight: 500;
        min-width: fit-content;
    }

    .mobile-cta-content {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .mobile-cta-button {
        width: 100%;
    }

    /* Very small screen social button improvements */
    .social-sharing-section {
        padding: 2rem 0;
    }

    .social-buttons {
        padding: 0 0.5rem;
        gap: 0.875rem;
    }

    .social-button {
        max-width: 280px;
        padding: 0.875rem 1.25rem;
        font-size: 0.85rem;
    }

    /* Mobile key points adjustments */
    .key-points-list {
        padding: 1rem;
    }

    .key-point-item {
        font-size: 1rem;
        padding-left: 1.25rem;
    }

    /* Featured image optimization for very small screens - maintain 1:1 square */
    .featured-image-container {
        aspect-ratio: 1/1; /* Keep square ratio on very small screens */
    }

    .hero-image {
        margin-top: 0;
    }

    /* FAQ improvements for very small screens */
    .faq-question {
        padding: 0.875rem 1rem;
        gap: 0.625rem;
        font-size: 0.9rem;
    }

    .faq-icon {
        width: 30px;
        height: 30px;
        margin-top: 0.1rem;
        min-width: 30px;
        min-height: 30px;
        color: #4b5563;
    }

    .faq-question-text {
        font-size: 0.9rem;
        line-height: 1.35;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   READING PROGRESS BAR (Sidebar - Desktop Only)
   Horizontal bar above TOC that fills as user scrolls
   ======================================== */
.reading-progress-container {
    width: 100%;
    background: var(--grey-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    height: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--grey-medium);
}

.reading-progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--brand-color);
    transition: width 0.2s ease-out;
    box-shadow: 0 0 8px rgba(255, 139, 90, 0.4);
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .reading-progress-bar {
        transition: none;
    }
}

/* Hide progress bar on mobile and tablet */
@media (max-width: 767px) {
    .reading-progress-container {
        display: none;
    }
}

/* ========================================
   AUTHOR PAGE STYLES
   Desktop: Full hero with side-by-side layout
   Tablet (768px): Simplified hero, stacked layout
   Mobile (480px): Compact hero, centered content
   ======================================== */

/* Author Hero Section */
.author-hero-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px; /* Reduced from 200px */
    padding: 1.5rem 0; /* Reduced padding */
    margin-top: 3.5rem;
}

.author-hero-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 800px;
    width: 100%;
}

.author-hero-avatar {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    position: relative;
}

.author-hero-image {
    width: 120px !important;
    height: 120px !important;
    border-radius: 50%;
    border: 4px solid var(--brand-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    object-fit: cover;
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
    transition: var(--transition-fast);
}

.author-hero-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Author Avatar Placeholder */
.author-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    font-weight: 700;
    font-size: calc(var(--base-font-size) * 2.2);
    letter-spacing: 1px;
}

.avatar-initials {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.author-hero-text {
    flex: 1;
}

.author-hero-title {
    font-size: calc(var(--base-font-size) * 2.2);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.75rem 0; /* Reduced margin for compact hero */
    color: var(--text-color);
}

.author-hero-bio {
    font-size: calc(var(--base-font-size) * 1.1);
    line-height: 1.6;
    color: var(--text-color-light);
    margin-bottom: 1rem; /* Reduced for compact design */
}

.author-hero-stats {
    display: flex;
    gap: 2rem;
}

.author-stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: calc(var(--base-font-size) * 1.5);
    font-weight: 700;
    color: var(--brand-color);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-color-light);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Author Content Area */
.author-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 3rem 2rem;
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 3rem;
    align-items: start;
}

.author-main-content {
    max-width: 100%;
    width: 100%;
}

.author-posts-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: calc(var(--base-font-size) * 1.8);
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 2rem;
    text-align: center;
}

/* Author Posts Grid */
.author-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.author-post-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: 1px solid var(--grey-medium);
}

.author-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.author-post-image {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.author-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.author-post-card:hover .author-post-image img {
    transform: scale(1.05);
}

.author-post-content {
    padding: 1.5rem;
}

.author-post-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.author-post-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.author-post-title a:hover {
    color: var(--brand-color);
}

.author-post-excerpt {
    color: var(--text-color-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.author-post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-color-lighter);
    font-weight: 500;
}

.meta-separator {
    color: var(--grey-dark);
}

/* Author Pagination */
.author-pagination {
    margin-top: 3rem;
    text-align: center;
}

.pagination-list {
    display: inline-flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    align-items: center;
}

.pagination-item {
    margin: 0;
}

.pagination-item a,
.pagination-item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--grey-medium);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition-fast);
}

.pagination-item a:hover {
    background: var(--brand-color);
    color: var(--white);
    border-color: var(--brand-color);
}

.pagination-item .current {
    background: var(--brand-color);
    color: var(--white);
    border-color: var(--brand-color);
}

/* Author Sidebar */
.author-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
    max-height: calc(100vh - 4rem);
}

.author-quick-info {
    background: var(--white);
    border: 1px solid var(--grey-medium);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
}

.author-quick-info h4 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.author-sidebar-avatar {
    margin-bottom: 1rem;
}

.author-sidebar-avatar img {
    border-radius: 50%;
    border: 2px solid var(--brand-color);
}

.author-sidebar-stats {
    margin-bottom: 1rem;
}

.sidebar-stat {
    font-size: 0.9rem;
    color: var(--text-color-light);
}

.sidebar-stat strong {
    color: var(--brand-color);
    font-size: 1.1rem;
}

.author-sidebar-bio {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-color-light);
}

/* No Posts Section */
.no-posts-section {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--grey-light);
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

.no-posts-section h2 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: calc(var(--base-font-size) * 1.5);
}

.no-posts-section p {
    color: var(--text-color-light);
    margin-bottom: 2rem;
}

.back-to-blog-link {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--brand-color);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.back-to-blog-link:hover {
    background: var(--brand-color-dark);
    transform: translateY(-1px);
}

/* Author Page Mobile Responsive Styles */
@media (max-width: 767px) {
    .author-hero-content {
        min-height: 100px; /* Even more compact on mobile */
        padding: 1rem 0;
    }

    .author-hero-info {
        flex-direction: column;
        text-align: center;
        gap: 1rem; /* Reduced gap */
    }

    .author-hero-avatar {
        width: 100px;
        height: 100px;
    }

    .author-hero-image {
        width: 100px !important;
        height: 100px !important;
        border-width: 3px; /* Slightly thinner border on mobile */
    }

    .author-avatar-placeholder {
        font-size: calc(
            var(--base-font-size) * 1.8
        ); /* Smaller text on mobile */
    }

    .author-hero-title {
        font-size: calc(var(--base-font-size) * 1.8);
        margin-bottom: 0.5rem; /* Reduced margin */
    }

    .author-hero-bio {
        font-size: var(--base-font-size);
        margin-bottom: 0.75rem; /* Reduced margin */
    }

    .author-hero-stats {
        justify-content: center;
        gap: 1.5rem;
    }

    .author-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 1rem;
    }

    .author-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .author-post-card {
        max-width: 100%;
    }

    .section-title {
        font-size: calc(var(--base-font-size) * 1.5);
        margin-bottom: 1.5rem;
    }

    .author-sidebar {
        position: static;
        order: -1;
    }

    .pagination-list {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .pagination-item a,
    .pagination-item span {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .author-hero-content {
        min-height: 80px; /* Very compact on very small screens */
        padding: 0.75rem 0;
    }

    .author-hero-info {
        gap: 0.75rem; /* Tighter spacing */
    }

    .author-hero-avatar {
        width: 80px;
        height: 80px;
    }

    .author-hero-image {
        width: 80px !important;
        height: 80px !important;
        border-width: 2px; /* Thin border on very small screens */
    }

    .author-avatar-placeholder {
        font-size: calc(
            var(--base-font-size) * 1.4
        ); /* Even smaller text on very small screens */
    }

    .author-hero-title {
        font-size: calc(var(--base-font-size) * 1.6);
        margin-bottom: 0.5rem; /* Compact margins */
    }

    .author-hero-bio {
        font-size: 0.95rem;
        margin-bottom: 0.5rem; /* Reduced margin */
    }

    .author-hero-stats {
        gap: 1rem;
    }

    .stat-number {
        font-size: calc(var(--base-font-size) * 1.3);
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .author-container {
        padding: 1.5rem 0.5rem;
    }

    .author-posts-grid {
        gap: 1rem;
    }

    .author-post-content {
        padding: 1rem;
    }

    .author-post-title {
        font-size: 1.1rem;
    }

    .author-post-excerpt {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: calc(var(--base-font-size) * 1.3);
    }

    .author-quick-info {
        padding: 1rem;
    }

    .no-posts-section {
        padding: 2rem 1rem;
    }
}

.cta-button:focus,
.mobile-cta-button:focus,
.social-button:focus,
.sidebar-social-button:focus,
.mobile-cta-toggle:focus {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
}

@media print {
    .clean-sidebar,
    .mobile-sticky-cta,
    .social-sharing-section,
    .sidebar-social {
        display: none;
    }

    .post-container {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .hero-section {
        background: var(--white);
        color: var(--text-color);
    }

    .hero-title {
        color: var(--text-color);
    }
}

/* Force hero title color to override Elementor styles */
body.single .cgn-modern-article .hero-title,
body.single-post .hero-section .hero-title {
    color: var(--text-color);
}

/* Desktop grid layout with higher specificity */
body.single .cgn-modern-article .post-container,
body.single-post .cgn-modern-article .post-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 3rem;
    align-items: start;
    position: relative;
}

body.single .cgn-modern-article .hero-content,
body.single-post .cgn-modern-article .hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}

body.single .cgn-modern-article .main-content,
body.single-post .cgn-modern-article .main-content {
    grid-column: 1;
    width: 100%;
    max-width: 100%;
}

body.single .cgn-modern-article .clean-sidebar,
body.single-post .cgn-modern-article .clean-sidebar {
    grid-column: 2;
    position: sticky;
    top: var(--sidebar-sticky-offset);
    height: fit-content;
    display: block;
    width: var(--sidebar-width);
    align-self: start;
    max-height: var(--sidebar-max-height);
}

@media (min-width: 1024px) {
    body.single .cgn-modern-article .clean-sidebar,
    body.single-post .cgn-modern-article .clean-sidebar {
        display: block;
    }

    body.single .cgn-modern-article .post-container,
    body.single-post .cgn-modern-article .post-container {
        display: grid;
        grid-template-columns: 1fr 400px;
    }
}

@media (max-width: 767px) {
    body.single .cgn-modern-article .post-container,
    body.single-post .cgn-modern-article .post-container {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        padding: 1rem;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    body.single .cgn-modern-article .clean-sidebar,
    body.single-post .cgn-modern-article .clean-sidebar {
        display: none;
    }

    body.single .cgn-modern-article .main-content,
    body.single-post .cgn-modern-article .main-content {
        grid-column: 1;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    body.single .cgn-modern-article .hero-container,
    body.single-post .cgn-modern-article .hero-container {
        width: 100%;
        max-width: 100%;
        padding: 0 1rem;
    }

    body.single .cgn-modern-article .hero-content,
    body.single-post .cgn-modern-article .hero-content {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
    }

    body.single .cgn-modern-article .hero-text,
    body.single-post .cgn-modern-article .hero-text {
        width: 100%;
        max-width: 100%;
        padding: 0;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    /* Mobile author section adjustments */
    .author-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .author-avatar img {
        width: 64px;
        height: 64px;
    }

    .author-section {
        padding: 1.5rem;
    }

    /* Key Points Mobile Improvements */
    .key-points-heading {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }

    .key-points-list {
        padding: 1.5rem;
    }

    .key-point-item {
        font-size: 1.1rem;
        line-height: 1.7;
        margin-bottom: 1.25rem;
        padding-left: 1.5rem;
    }

    .key-point-item::before {
        width: 18px;
        height: 18px;
    }
}
