/* Shared styling for the article reading page (article.html) and its admin live-preview
   companion (article-preview.php) — kept in one file so the preview can never visually
   drift from the real page. */

:root {
    --art-ink: #16202B;
    --art-line: #E4E7EB;
    --art-accent: #1C9954;
    --art-accent-dark: #157A42;
    --art-navy: #0F3D5C;
    --art-muted: #6B6F6A;
    --art-btn-gray: #5B6470;
}

.article-hero {
    background: #f8fafc;
    padding: 64px 0 36px;
    text-align: center;
    position: relative;
}

.article-category {
    color: var(--art-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
    display: block;
    font-size: 0.75rem;
}

.article-title {
    font-size: 2.5rem;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 500;
    color: var(--art-navy);
    max-width: 780px;
    margin: 0 auto;
    padding: 0 40px;
    line-height: 1.25;
}

.article-dek {
    max-width: 680px;
    margin: 18px auto 0;
    padding: 0 40px;
    font-size: 1.05rem;
    color: var(--art-muted);
    line-height: 1.6;
}

.article-meta {
    margin-top: 20px;
    color: #94a3b8;
    font-size: 0.9rem;
}

.article-body {
    max-width: 900px;
    width: 100%;
    margin: 48px auto;
    padding: 0 40px;
    line-height: 1.65;
    color: var(--art-ink);
    font-size: 1rem;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

.article-next {
    border-top: 1px solid var(--art-line);
    padding-top: 28px;
    margin-top: 8px;
}

.article-next .article-next-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--art-muted);
    text-transform: uppercase;
    margin: 0 0 10px;
}

.article-next-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--art-line);
    border-radius: 16px;
    padding: 20px 22px;
}

.article-next-card .pain {
    font-size: 15px;
    margin: 0;
    color: var(--art-ink);
    max-width: 75%;
}

.article-next-card .go-btn {
    background: var(--art-btn-gray);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 999px;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s ease;
}

.article-next-card .go-btn:hover {
    background: var(--art-ink);
}

@media (max-width: 600px) {
    .article-next-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .article-next-card .pain {
        max-width: none;
    }

    .article-next-card .go-btn {
        width: 100%;
        text-align: center;
    }
}

.article-body img {
    max-width: 50%;
    height: auto;
    border-radius: 16px;
    margin: 30px auto;
    display: block;
}

.article-body img.full-width {
    max-width: 100%;
    width: 100%;
    object-fit: contain;
}

#artImageContainer {
    text-align: center;
    margin: 30px 0;
}

#artImageContainer img {
    max-width: 50%;
    height: auto;
    border-radius: 16px;
    display: block;
    margin: 0 auto;
}

#artImageContainer img.full-width {
    max-width: 100%;
    width: 100%;
    object-fit: contain;
}

.article-body h2 {
    margin: 40px 0 20px;
    color: #1e293b;
    font-size: 2rem;
}

.article-body h3 {
    margin: 30px 0 15px;
    color: #1e293b;
    font-size: 1.5rem;
}

.article-body p {
    margin-bottom: 1.5em;
}

.back-button-wrapper {
    position: absolute;
    top: 40px;
    left: 40px;
    z-index: 10;
}

.back-to-resources {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #1e293b;
    background: white;
    border: 1px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.back-to-resources:hover {
    border-color: #2EE08F;
    color: #2EE08F;
    box-shadow: 0 4px 8px rgba(46, 224, 143, 0.15);
    transform: translateY(-2px);
}

/* Large screens (1400px and above) — the reading column itself stays a fixed,
   comfortable line-length (matching the mockup's 720px .wrap) at every desktop
   width; only the hero title/back-button get extra breathing room. */
@media (min-width: 1400px) {
    .article-title {
        padding: 0 60px;
    }

    .back-button-wrapper {
        left: 60px;
    }
}

/* Tablets (768px - 1023px) */
@media (max-width: 1023px) {
    .article-hero {
        padding: 60px 0;
    }

    .article-title {
        font-size: 2.5rem;
        padding: 0 30px;
    }
    .back-button-wrapper {
        left: 30px;
    }

    .article-body {
        margin: 40px auto;
        font-size: 1.05rem;
        padding: 0 30px;
        max-width: 100%;
    }

    .article-body img,
    #artImageContainer img {
        max-width: 70%;
    }

    .article-body h2 {
        font-size: 1.75rem;
    }

    .article-body h3 {
        font-size: 1.35rem;
    }
}

/* Small tablets and large phones (600px - 767px) */
@media (max-width: 767px) {
    .article-hero {
        padding: 50px 0;
    }

    .article-title {
        font-size: 2rem;
        padding: 0 20px;
        line-height: 1.3;
    }

    .back-button-wrapper {
        position: static;
        margin-bottom: 20px;
        text-align: left;
        padding: 0 20px;
    }

    .article-category {
        font-size: 0.8rem;
        margin-bottom: 15px;
    }

    .article-meta {
        font-size: 0.85rem;
        margin-top: 15px;
    }

    .article-body {
        margin: 30px auto;
        font-size: 1rem;
        padding: 0 20px;
        max-width: 100%;
        line-height: 1.75;
    }

    .article-body img,
    #artImageContainer img {
        max-width: 85%;
        margin: 25px auto;
    }

    .article-body h2 {
        font-size: 1.5rem;
        margin: 35px 0 18px;
    }

    .article-body h3 {
        font-size: 1.25rem;
        margin: 25px 0 12px;
    }

    .back-to-resources {
        font-size: 0.9rem;
    }
}

/* Mobile phones (480px - 599px) */
@media (max-width: 599px) {
    .article-hero {
        padding: 40px 0;
    }

    .article-title {
        font-size: 1.75rem;
        padding: 0 15px;
    }
    .back-button-wrapper {
        padding: 0 15px;
    }

    .article-body {
        padding: 0 15px;
        font-size: 0.95rem;
    }

    .article-body img,
    #artImageContainer img {
        max-width: 95%;
        margin: 20px auto;
    }

    .article-body h2 {
        font-size: 1.35rem;
        margin: 30px 0 15px;
    }

    .article-body h3 {
        font-size: 1.15rem;
        margin: 20px 0 10px;
    }
}

/* Small mobile phones (up to 479px) */
@media (max-width: 479px) {
    .article-hero {
        padding: 30px 0;
    }

    .article-title {
        font-size: 1.5rem;
        padding: 0 15px;
        line-height: 1.4;
    }
    .back-button-wrapper {
        padding: 0 15px;
    }

    .article-category {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }

    .article-meta {
        font-size: 0.8rem;
        margin-top: 12px;
    }

    .article-body {
        margin: 25px auto;
        padding: 0 15px;
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .article-body img,
    #artImageContainer img {
        max-width: 100%;
        margin: 20px auto;
        border-radius: 12px;
    }

    .article-body h2 {
        font-size: 1.25rem;
        margin: 25px 0 12px;
    }

    .article-body h3 {
        font-size: 1.1rem;
        margin: 20px 0 10px;
    }

    .back-to-resources {
        margin-bottom: 25px;
        font-size: 0.85rem;
        padding: 0 15px;
    }
}

/* Responsive image and video styles */
.responsive-image,
.responsive-video {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {

    .responsive-image,
    .responsive-video {
        max-height: 500px;
    }
}

@media (max-width: 480px) {

    .responsive-image,
    .responsive-video {
        max-height: 400px;
    }
}
