/**
 * InGoal Standard Article Styles
 *
 * External CSS for the standard article template.
 * Loaded conditionally on posts with the template toggle enabled.
 * BEM prefix: sa- (Standard Article)
 *
 * Typography: Inter (headings/UI), Merriweather (body)
 * Extends ingoal-design-system.css variables
 *
 * @package InGoal
 * @since February 2026
 */

/* =========================================
   CSS Variables - Extending Site Design System
   ========================================= */
:root {
    --sa-content-width: 900px;
    --sa-wide-width: 1100px;
    --sa-navy: var(--ig-accent-blue, #31487A);
    --sa-navy-dark: var(--ig-navy, #0A1628);
    --sa-text: var(--ig-text-primary, #0A0A0A);
    --sa-text-light: var(--ig-text-secondary, #4A4A4A);
    --sa-border: var(--ig-border-color, #E0E0E0);
}

/* =========================================
   Divi Overrides
   ========================================= */
body.ingoal-standard-article-template #main-content,
body.ingoal-standard-article-template #et-main-area {
    padding: 0;
}

body.ingoal-standard-article-template .entry-content {
    padding: 0;
    margin: 0;
}

body.ingoal-standard-article-template #main-content .container {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

/* =========================================
   Article Base
   ========================================= */
.standard-article {
    font-family: var(--ig-font-body, 'Merriweather', Georgia, serif);
    font-size: 18px;
    line-height: var(--ig-leading-relaxed, 1.65);
    color: var(--sa-text);
    background: #fff;
}

.standard-article *,
.standard-article *::before,
.standard-article *::after {
    box-sizing: border-box;
}

/* =========================================
   Header Section
   ========================================= */
.sa-header {
    max-width: var(--sa-wide-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Featured Image */
.sa-header__image {
    margin: 0 auto 24px;
}

.sa-header__image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--ig-radius-lg, 12px);
}

.sa-header__caption {
    font-family: var(--ig-font-ui, 'Inter', sans-serif);
    font-size: var(--ig-text-sm, 13px);
    color: var(--sa-text-light);
    margin-top: 8px;
    text-align: center;
    line-height: 1.4;
}

/* Title Area */
.sa-header__title-wrap {
    max-width: var(--sa-content-width);
    margin: 0 auto;
    padding: 32px 0 24px;
}

.sa-header__title {
    font-family: var(--ig-font-heading, 'Inter', sans-serif);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    line-height: var(--ig-leading-tight, 1.15);
    letter-spacing: var(--ig-tracking-tight, -0.02em);
    color: var(--sa-navy-dark);
    margin: 0 0 12px;
    text-wrap: balance;
}

.sa-header__subtitle {
    font-family: var(--ig-font-body, 'Merriweather', Georgia, serif);
    font-size: var(--ig-text-lg, 20px);
    line-height: 1.4;
    color: var(--sa-text-light);
    margin: 0 0 20px;
    font-style: italic;
}

/* Byline */
.sa-header__byline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    font-family: var(--ig-font-ui, 'Inter', sans-serif);
    font-size: var(--ig-text-sm, 13px);
    color: var(--sa-text-light);
    padding-bottom: 24px;
    border-bottom: 1px solid var(--sa-border);
    line-height: 1.3;
}

.sa-header__author {
    font-weight: 700;
    color: var(--sa-navy-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

a.sa-header__author:hover {
    color: var(--ig-accent-blue, #31487A);
    text-decoration: underline;
}

.sa-header__separator {
    color: var(--sa-border);
}

.sa-header__author-bio {
    margin: 12px 0 0 0;
    font-family: var(--ig-font-body, 'Merriweather', serif);
    font-size: var(--ig-text-sm, 14px);
    color: var(--sa-text-secondary);
    line-height: 1.5;
}

/* =========================================
   Content Area
   ========================================= */
.sa-content {
    max-width: var(--sa-content-width);
    margin: 0 auto;
    padding: 40px 24px;
}

/* =========================================
   Text Section Block
   ========================================= */
.sa-block--text {
    margin-bottom: 32px;
}

.sa-block--text h2,
.sa-block--text h3,
.sa-block--text h4 {
    font-family: var(--ig-font-heading, 'Inter', sans-serif);
    font-weight: 700;
    line-height: var(--ig-leading-snug, 1.25);
    color: var(--sa-navy-dark);
    margin: 1.8em 0 0.6em;
}

.sa-block--text h2 {
    font-size: var(--ig-text-2xl, 28px);
}

.sa-block--text h3 {
    font-size: var(--ig-text-xl, 24px);
}

.sa-block--text h4 {
    font-size: var(--ig-text-lg, 20px);
}

.sa-block__heading {
    font-family: var(--ig-font-heading, 'Inter', sans-serif);
    font-size: var(--ig-text-2xl, 28px);
    font-weight: 700;
    line-height: var(--ig-leading-snug, 1.25);
    color: var(--sa-navy-dark);
    margin: 0 0 16px;
}

.sa-block--text p {
    font-family: var(--ig-font-body, 'Merriweather', Georgia, serif);
    font-size: 18px;
    line-height: var(--ig-leading-relaxed, 1.65);
    margin: 0 0 1.4em;
    color: var(--sa-text);
}

.sa-block--text p:last-child {
    margin-bottom: 0;
}

.sa-block--text a {
    color: var(--sa-navy);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: color var(--ig-transition-base, 0.2s ease);
}

.sa-block--text a:hover {
    color: var(--sa-navy-dark);
}

.sa-block--text strong,
.sa-block--text b {
    font-weight: 700;
}

.sa-block--text ul,
.sa-block--text ol {
    margin: 0 0 1.4em;
    padding-left: 1.5em;
}

.sa-block--text li {
    margin-bottom: 0.5em;
}

/* Drop Cap - First text_section only, direct child p only */
.sa-block--first > p:first-of-type::first-letter {
    float: left;
    font-family: var(--ig-font-heading, 'Inter', sans-serif);
    font-size: 3.5em;
    font-weight: 800;
    line-height: 0.8;
    padding-right: 0.08em;
    padding-top: 0.05em;
    color: var(--sa-navy-dark);
}

/* =========================================
   Image Block
   ========================================= */
.sa-block--image {
    margin: 40px 0;
}

.sa-block--image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--ig-radius-md, 8px);
}

.sa-block--image figcaption {
    font-family: var(--ig-font-ui, 'Inter', sans-serif);
    font-size: var(--ig-text-sm, 13px);
    color: var(--sa-text-light);
    margin-top: 8px;
    text-align: center;
    line-height: 1.4;
}

/* Image size: full-width */
.sa-block--image-full-width {
    max-width: var(--sa-wide-width);
    margin-left: calc(50% - min(var(--sa-wide-width), 100vw) / 2);
    margin-right: calc(50% - min(var(--sa-wide-width), 100vw) / 2);
    padding: 0 24px;
}

/* Image size: large */
.sa-block--image-large {
    max-width: 1060px;
    margin-left: calc(50% - min(1060px, 100vw) / 2);
    margin-right: calc(50% - min(1060px, 100vw) / 2);
    padding: 0 24px;
}

/* Image size: medium - stays within content width */
.sa-block--image-medium {
    max-width: var(--sa-content-width);
}

/* =========================================
   Pull Quote Block
   ========================================= */
.sa-block--quote {
    margin: 40px 0;
    padding: 24px 0 24px 24px;
    border-left: 4px solid var(--sa-navy);
}

.sa-block__quote-text {
    font-family: var(--ig-font-body, 'Merriweather', Georgia, serif);
    font-size: 22px;
    font-style: italic;
    line-height: 1.5;
    color: var(--sa-navy-dark);
    margin: 0 0 12px;
}

.sa-block__quote-attribution {
    font-family: var(--ig-font-ui, 'Inter', sans-serif);
    font-size: var(--ig-text-sm, 13px);
    font-weight: 600;
    color: var(--sa-text-light);
    margin: 0;
}

.sa-block__quote-attribution::before {
    content: '\2014\00a0';
}

/* =========================================
   Video Embed Block
   ========================================= */
.sa-video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--ig-radius-lg, 12px);
    box-shadow: var(--ig-shadow-md, 0 8px 24px rgba(10, 22, 40, 0.1));
    margin: 40px 0;
}

.sa-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.sa-block--video {
    margin: 40px 0;
}

.sa-block--video figcaption {
    font-family: var(--ig-font-ui, 'Inter', sans-serif);
    font-size: var(--ig-text-sm, 13px);
    color: var(--sa-text-light);
    margin-top: 12px;
    text-align: center;
    line-height: 1.4;
}

/* =========================================
   Callout Box Block
   ========================================= */
.sa-block--callout {
    margin: 40px 0;
    padding: 24px 28px;
    border-radius: 0 var(--ig-radius-md, 8px) var(--ig-radius-md, 8px) 0;
    border-left: 4px solid var(--sa-navy);
    background: #f8fafc;
}

/* Callout type: info (navy) - default */
.sa-block--callout-info {
    border-left-color: var(--sa-navy);
    background: #f0f4fa;
}

/* Callout type: tip (green) */
.sa-block--callout-tip {
    border-left-color: #16a34a;
    background: #f0fdf4;
}

/* Callout type: highlight (gold) */
.sa-block--callout-highlight {
    border-left-color: #ca8a04;
    background: #fefce8;
}

.sa-block__callout-heading {
    font-family: var(--ig-font-heading, 'Inter', sans-serif);
    font-size: var(--ig-text-lg, 20px);
    font-weight: 700;
    line-height: var(--ig-leading-snug, 1.25);
    color: var(--sa-navy-dark);
    margin: 0 0 12px;
}

.sa-block--callout p {
    font-family: var(--ig-font-body, 'Merriweather', Georgia, serif);
    font-size: 16px;
    line-height: var(--ig-leading-relaxed, 1.65);
    margin: 0 0 1em;
    color: var(--sa-text);
}

.sa-block--callout p:last-child {
    margin-bottom: 0;
}

.sa-block--callout a {
    color: var(--sa-navy);
    text-decoration: underline;
}

.sa-block--callout a:hover {
    color: var(--sa-navy-dark);
}

/* =========================================
   Share Bar Under Header - Positioning
   ========================================= */
.sa-header__share {
    max-width: var(--sa-content-width);
    margin: 0 auto;
    padding: 16px 24px 0;
}

/* =========================================
   Read Indicator (from activity tracking)
   ========================================= */
.standard-article .ingoal-read-indicator {
    margin-bottom: 12px;
}

/* =========================================
   Paywall Gate
   ========================================= */
.sa-paywall-gate {
    position: relative;
    margin-top: -120px;
    margin-left: -20px;
    padding-top: 0;
}

.sa-paywall-gate__fade {
    height: 150px;
    background: linear-gradient(to bottom, rgba(248, 250, 252, 0) 0%, rgba(248, 250, 252, 1) 100%);
    pointer-events: none;
}

.sa-paywall-gate__content {
    text-align: center;
    padding: 40px 24px 60px;
    background: linear-gradient(180deg, #f8fafc 0%, #f0f4f8 100%);
}

.sa-paywall-gate__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--sa-navy-dark);
    border-radius: 50%;
    margin-bottom: 20px;
    color: #fff;
}

.sa-paywall-gate__heading {
    font-family: var(--ig-font-heading, 'Inter', sans-serif);
    font-size: var(--ig-text-xl, 24px);
    font-weight: 800;
    color: var(--sa-navy-dark);
    margin: 0 0 12px;
    line-height: var(--ig-leading-snug, 1.25);
}

.sa-paywall-gate__message {
    font-family: var(--ig-font-body, 'Merriweather', Georgia, serif);
    font-size: var(--ig-text-base, 15px);
    color: var(--sa-text-light);
    line-height: var(--ig-leading-relaxed, 1.65);
    margin: 0 0 28px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.sa-paywall-gate__ctas {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

.sa-paywall-gate__btn {
    display: inline-block;
    padding: 14px 32px;
    font-family: var(--ig-font-ui, 'Inter', sans-serif);
    font-size: var(--ig-text-base, 15px);
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--ig-radius-md, 8px);
    transition: all var(--ig-transition-base, 0.2s ease);
    min-width: 220px;
    text-align: center;
}

.sa-paywall-gate__btn--primary {
    background: var(--sa-navy-dark);
    color: #fff;
}

.sa-paywall-gate__btn--primary:hover {
    background: var(--sa-navy);
    color: #fff;
    transform: translateY(-2px);
}

.sa-paywall-gate__btn--secondary {
    background: #fff;
    color: var(--sa-navy-dark);
    border: 2px solid var(--sa-border);
}

.sa-paywall-gate__btn--secondary:hover {
    border-color: var(--sa-navy-dark);
    background: #fff;
}

.sa-paywall-gate__login {
    font-family: var(--ig-font-ui, 'Inter', sans-serif);
    font-size: var(--ig-text-sm, 13px);
    color: var(--sa-text-light);
    margin: 0;
}

.sa-paywall-gate__login a {
    color: var(--sa-navy);
    text-decoration: none;
    font-weight: 600;
}

.sa-paywall-gate__login a:hover {
    text-decoration: underline;
}

/* =========================================
   Footer Section
   ========================================= */
.sa-footer {
    border-top: 1px solid var(--sa-border);
}

.sa-footer > .ig-share {
    padding: 32px 24px;
    border-radius: 0;
}

/* Related Posts */
.sa-related {
    padding: 60px 24px;
    background: #fff;
    border-top: 1px solid var(--sa-border);
}

.sa-related__inner {
    max-width: var(--sa-wide-width);
    margin: 0 auto;
}


/* =========================================
   Responsive - Tablet (768px)
   ========================================= */
@media (max-width: 768px) {
    .sa-header {
        padding: 0 16px;
    }

    .sa-header__title-wrap {
        padding: 24px 0 20px;
    }

    .sa-header__title {
        font-size: clamp(24px, 6vw, 32px);
    }

    .sa-header__subtitle {
        font-size: 18px;
    }

    .sa-header__image img {
        border-radius: 0;
    }

    .sa-header {
        max-width: 100%;
        padding: 0;
    }

    .sa-header__image {
        margin: 0 0 16px;
    }

    .sa-header__caption {
        padding: 0 16px;
    }

    .sa-header__title-wrap {
        padding: 24px 16px 20px;
    }

    .sa-content {
        padding: 32px 16px;
    }

    .sa-block--text p {
        font-size: 17px;
    }

    .sa-block__quote-text {
        font-size: 19px;
    }

    /* Full-bleed images on mobile */
    .sa-block--image-full-width,
    .sa-block--image-large {
        margin-left: -16px;
        margin-right: -16px;
        padding: 0;
        max-width: calc(100% + 32px);
    }

    .sa-block--image-full-width img,
    .sa-block--image-large img {
        border-radius: 0;
    }

    .sa-related {
        padding: 40px 16px;
    }

    .sa-header__share {
        padding: 0 16px;
    }

    .sa-paywall-gate__content {
        padding: 32px 16px 48px;
    }
}

/* =========================================
   Responsive - Small Mobile (480px)
   ========================================= */
@media (max-width: 480px) {
    .sa-header__byline {
        flex-direction: column;
        gap: 4px;
    }

    .sa-header__separator {
        display: none;
    }

    .sa-block--callout {
        padding: 20px;
    }
}
