/* ====================================
   BLOG ARTICLE CONTENT FORMATTING
   ==================================== */

.blog-article {
    max-width: 1000px;
    margin: 0 auto;
}

.article-header {
    max-width: 1000px;
    margin: 0 auto 1.25rem;
}

.article-hero img {
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

.article-content {
    max-width: 820px;
    margin: 0 auto;
}

.article-content img,
.article-content video,
.article-content iframe,
.article-content figure,
.article-content .intrinsic,
.article-content .image-block-wrapper {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1rem auto;
}

/* Force images to contain and avoid cropping from legacy wrappers */
.article-content img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Hard cap overly large images and center */
.article-content figure,
.article-content .image-block-outer-wrapper,
.article-content .image-block-wrapper {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 960px !important;
}

/* Gallery thumbs should not exceed container; ensure wrap */
.article-content .sqs-gallery, .article-content .sqs-gallery-container {
    max-width: 100% !important;
}

/* Neutralize Squarespace wrapper constraints that create large gaps */
.article-content .intrinsic,
.article-content .image-block-outer-wrapper,
.article-content .image-block-wrapper,
.article-content .sqs-image-shape-container-element,
.article-content figure[style] {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    margin: 1rem auto !important;
    overflow: visible !important;
}

/* Remove artificial aspect ratio padding */
.article-content .has-aspect-ratio,
.article-content [style*="padding-bottom"] {
    padding-bottom: 0 !important;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content pre {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

/* Collapse stacked line breaks and empty nodes */
.article-content br + br { display: none; }
.article-content p:empty { display: none; }
.article-content div:empty { display: none; }
.article-content > :first-child { margin-top: 0; }
.article-content > :last-child { margin-bottom: 0; }

/* Inline white-space from legacy imports can cause huge gaps */
.article-content [style*="white-space:pre"] { white-space: normal !important; }

/* Ensure embedded iframes are responsive without overflows */
.article-content iframe {
    width: 100% !important;
    max-width: 100% !important;
    border: 0;
}

/* 4:3 responsive video container */
.article-content .video-43 {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 4 / 3;
    margin: 1rem auto;
}

.article-content .video-43 > iframe,
.article-content .video-43 > video,
.article-content .video-43 .native-video-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Fallback: show Squarespace overlay thumbnail if no iframe */
.article-content .video-43 .sqs-video-overlay { position: absolute; inset: 0; }
.article-content .video-43 .sqs-video-overlay img { width: 100% !important; height: 100% !important; object-fit: cover !important; display: block; }

.article-content .video-43 > video {
    object-fit: contain;
    background: #000;
}

/* Common Squarespace wrappers set to 4:3 when flagged */
.article-content .sqs-native-video.video-43,
.article-content .embed-block-wrapper.video-43 {
    aspect-ratio: 4 / 3 !important;
}

/* Generic responsive video container; override aspect ratio inline as needed */
.article-content .video-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    margin: 1rem auto;
}
.article-content .video-container > iframe,
.article-content .video-container > video,
.article-content .video-container .native-video-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.article-content .video-container > video { object-fit: contain; background: #000; }

/* ====================================
   Squarespace content mappings (parity)
   ==================================== */
/* Reconstruct Squarespace gallery/grid layouts */
.article-content .sqs-gallery-container { margin: 1rem auto; }

/* Base grid for Squarespace galleries (grid variant only) */
.article-content .sqs-gallery-block-grid .sqs-gallery {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(var(--gallery-cols, 3), 1fr);
}

/* Respect Squarespace "thumbnails-per-row-X" hints */
.article-content .sqs-gallery-container.sqs-gallery-thumbnails-per-row-2 { --gallery-cols: 2; }
.article-content .sqs-gallery-container.sqs-gallery-thumbnails-per-row-3 { --gallery-cols: 3; }
.article-content .sqs-gallery-container.sqs-gallery-thumbnails-per-row-4 { --gallery-cols: 4; }

/* Ensure slide wrappers behave as tiles */
.article-content .sqs-gallery .slide,
.article-content .sqs-gallery .margin-wrapper,
.article-content .sqs-gallery .image-slide-anchor {
    display: block;
    width: 100%;
}

/* Square aspect ratio only for grid variant when indicated (no borders) */
.article-content .sqs-gallery-block-grid.sqs-gallery-aspect-ratio-square .image-slide-anchor,
.article-content .sqs-gallery-block-grid .sqs-gallery-aspect-ratio-square .image-slide-anchor {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0;
    border: 0;
    background: transparent;
}

/* Make thumbnails fill their tiles (override generic img rules) — grid variant */
.article-content .sqs-gallery-block-grid .sqs-gallery .thumb-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}

/* Responsive fallbacks for narrow viewports */
@media (max-width: 768px) {
    .article-content .sqs-gallery-block-grid .sqs-gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .article-content .sqs-gallery-block-grid .sqs-gallery { grid-template-columns: 1fr; }
}

/* Slideshow galleries should stack slides vertically (no grid) */
.article-content .sqs-gallery-block-slideshow .sqs-gallery { display: block; }
.article-content .sqs-gallery-block-slideshow .sqs-gallery .slide { margin: 0 0 12px; }
.article-content .sqs-gallery-block-slideshow .sqs-gallery .image-slide-anchor { display: block; width: 100%; }
.article-content .sqs-gallery-block-slideshow .sqs-gallery .thumb-image {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    display: block;
}

/* Inline image grouping: 1 / 2 / 3 columns then fallback to 2 columns */
.article-content .article-inline-gallery { display: grid; gap: 12px; margin: 1rem 0; }
.article-content .article-inline-gallery .inline-row { display: grid; gap: 12px; }
.article-content .article-inline-gallery .inline-row.cols-1 { grid-template-columns: 1fr; }
.article-content .article-inline-gallery .inline-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.article-content .article-inline-gallery .inline-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.article-content .article-inline-gallery img { width: 100% !important; height: auto !important; object-fit: contain !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }

@media (max-width: 768px) {
    .article-content .article-inline-gallery .inline-row.cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .article-content .article-inline-gallery .inline-row.cols-2,
    .article-content .article-inline-gallery .inline-row.cols-3 { grid-template-columns: 1fr; }
}
/* Normalize common Squarespace wrappers */
.article-content .sqs-layout,
.article-content .sqs-row,
.article-content .sqs-col-12,
.article-content .sqs-block,
.article-content .sqs-block-content,
.article-content .sqs-html-content {
    margin: 0;
    padding: 0;
}

/* Headings and lead text imported as sqsrte-large */
.article-content .sqsrte-large {
    font-size: 1.25rem;
    line-height: 1.5;
    font-weight: 700;
    margin: 1rem 0 0.5rem;
}

/* Image card captions (title + subtitle) */
.article-content figcaption.image-card-wrapper {
    max-width: 820px;
    margin: 0.5rem auto 1.25rem;
    color: var(--muted-color, #475569);
}
.article-content .image-card {
    text-align: left;
}
.article-content .image-card .image-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.article-content .image-card .image-subtitle {
    opacity: 0.95;
}

/* Simple image caption wrapper */
.article-content .image-caption-wrapper,
.article-content .image-caption {
    text-align: center;
    color: var(--muted-color, #64748b);
    font-size: 0.95rem;
}

/* Lists and blockquotes */
.article-content ul,
.article-content ol {
    padding-left: 1.25rem;
}
.article-content blockquote {
    margin: 1rem 0;
    padding-left: 1rem;
    border-left: 4px solid var(--secondary-color, #06b6d4);
    color: var(--muted-color, #475569);
}

/* Ensure embeds scale */
.article-content .embedly-embed,
.article-content .sqs-embed,
.article-content .sqs-native-video iframe,
.article-content iframe.embedly-embed {
    width: 100% !important;
    max-width: 100% !important;
    border: 0;
}

/* Post meta treatments within article header */
.article-header .post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    color: var(--muted-color, #64748b);
}
.article-header .post-meta .post-category {
    background: rgba(2, 132, 199, 0.08);
    color: var(--primary-color);
    padding: 0.15rem 0.5rem;
    border-radius: 0.4rem;
}

/* ====================================
   Fallback styling for Squarespace social icons (missing SVG sprites)
   ==================================== */
.article-content .sqs-svg-icon--outer nav {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.article-content .sqs-svg-icon--outer a {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Hide broken inline SVGs that reference missing symbols */
.article-content .sqs-svg-icon--outer svg { display: none !important; }

.article-content .sqs-svg-icon--outer .instagram-unauth::before { content: 'IG'; }
.article-content .sqs-svg-icon--outer .linkedin-unauth::before  { content: 'in'; }
.article-content .sqs-svg-icon--outer .twitter-unauth::before   { content: 'X'; }
.article-content .sqs-svg-icon--outer .email::before            { content: '✉'; }


/* Emphasize submit buttons inside blog post content/forms */
.article-content input[type="submit"],
.article-content button[type="submit"],
.article-content .sqs-system-button,
.article-content .sqs-button-element--primary,
.article-content a.sqs-block-button-element {
    display: inline-block;
    width: 100%;
    padding: 1rem 1.75rem;
    margin: 1rem 0;
    font-size: 1.125rem; /* 18px */
    font-weight: 700;
    border-radius: 0.75rem;
    background: var(--primary-color);
    color: #ffffff !important;
    border: none;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, filter 0.2s ease;
}

.article-content input[type="submit"]:hover,
.article-content button[type="submit"]:hover,
.article-content .sqs-system-button:hover,
.article-content .sqs-button-element--primary:hover,
.article-content a.sqs-block-button-element:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--secondary-color);
}

.article-content input[type="submit"]:disabled,
.article-content button[type="submit"]:disabled,
.article-content .sqs-system-button:disabled,
.article-content .sqs-button-element--primary:disabled,
.article-content a.sqs-block-button-element:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (min-width: 768px) {
    .article-content input[type="submit"],
    .article-content button[type="submit"],
    .article-content .sqs-system-button,
    .article-content .sqs-button-element--primary,
    .article-content a.sqs-block-button-element {
        width: auto;
        min-width: 280px;
    }
}

/* ====================================
   BLOG COMPONENT TEMPLATES
   ==================================== */

/* CTA Button */
.blog-button-wrapper {
    text-align: center;
    margin: 2rem 0;
}

.blog-cta-button {
    display: inline-block;
    padding: 0.875rem 2rem;
    margin: 1rem 0;
    background: var(--color-primary);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.blog-cta-button:hover {
    background: var(--color-primary-dark);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(248, 149, 33, 0.3);
}

/* Column Layouts */
.blog-columns {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

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

.blog-columns.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.blog-columns .col {
    background: #f8f9fa;
    padding: 1.5rem;
    border-left: 4px solid var(--color-primary);
}

.blog-columns .col h3 {
    margin-top: 0;
    color: #191817;
    font-family: 'Erbaum-Bold', sans-serif;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .blog-columns.cols-2,
    .blog-columns.cols-3 {
        grid-template-columns: 1fr;
    }
}

/* Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.comparison-table thead th {
    background: #191817;
    color: #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    font-family: 'Erbaum-Bold', sans-serif;
}

.comparison-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.comparison-table tbody tr:hover {
    background: #fff5f5;
}

.comparison-table td:first-child {
    font-weight: 600;
}

@media (max-width: 768px) {
    .comparison-table {
        font-size: 0.9rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Callout Box */
.blog-callout {
    background: #fff8e1;
    border-left: 4px solid var(--color-primary);
    padding: 1.5rem;
    margin: 2rem 0;
}

.blog-callout h4 {
    margin-top: 0;
    color: var(--color-primary);
    font-family: 'Erbaum-Bold', sans-serif;
    text-transform: uppercase;
}

/* Enhanced Quote */
.blog-quote {
    position: relative;
    background: #f8f9fa;
    border-left: 4px solid var(--color-primary);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    font-style: italic;
    font-size: 1.1rem;
}

.blog-quote cite {
    display: block;
    margin-top: 1rem;
    font-style: normal;
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.9rem;
}

/* ====================================
   SOCIAL MEDIA ICONS IN BLOG POSTS
   ==================================== */

.article-social-share {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-top: 3px solid var(--color-primary);
    border-bottom: 3px solid var(--color-primary);
    text-align: center;
}

.article-social-share h4 {
    margin: 0 0 1rem 0;
    color: #191817;
    font-family: 'Erbaum-Bold', sans-serif;
    text-transform: uppercase;
    font-size: 1.2rem;
}

.article-social-share .social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.article-social-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #191817;
    color: #ffffff;
    text-decoration: none;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.article-social-share a:hover {
    background: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(248, 149, 33, 0.3);
}

.article-social-share a i {
    line-height: 1;
}
