/* ═══════════════════════════════════════════════════════════
   STOPSIT — Article Pages
   Reuses all CSS variables from ../styles.css
   ═══════════════════════════════════════════════════════════ */

/* ── Force white header on all article pages ── */
.article-page #header {
    background-color: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.article-page #header .logo-img--light { display: none !important; }
.article-page #header .logo-img--dark  { display: block !important; }
.article-page #header .nav-links a     { color: var(--dark); }
.article-page #header .hamburger       { color: var(--dark); }
.article-page #header .lang-btn {
    background: rgba(44, 110, 73, 0.1) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

/* ── Push content below fixed header ── */
.article-main {
    padding-top: 100px;
    padding-bottom: 5rem;
    background: var(--light);
    min-height: 100vh;
}

.article-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ── Breadcrumb ── */
.breadcrumb {
    font-size: 0.88rem;
    color: var(--dark);
    opacity: 0.7;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { opacity: 0.6; }

/* ── Article header ── */
.article-header {
    margin-bottom: 2.5rem;
}
.article-header h1 {
    font-size: 2.3rem;
    color: var(--primary);
    line-height: 1.25;
    margin-bottom: 1.2rem;
    font-weight: 700;
}
.article-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.88rem;
    color: var(--dark);
    opacity: 0.7;
    flex-wrap: wrap;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--medium);
}
.article-meta i {
    margin-right: 0.35rem;
    color: var(--accent);
}

/* ── Hero image (full-width, below header) ── */
.article-hero-img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 2.5rem;
    display: block;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* ── Article body typography ── */
.article-body {
    line-height: 1.9;
    font-size: 1.06rem;
    color: var(--dark);
}
.article-body h2 {
    color: var(--primary);
    font-size: 1.65rem;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--medium);
    font-weight: 700;
}
.article-body h3 {
    color: var(--secondary);
    font-size: 1.25rem;
    margin: 1.8rem 0 0.8rem;
    font-weight: 600;
}
.article-body p  { margin-bottom: 1.3rem; }
.article-body ul,
.article-body ol { padding-left: 1.6rem; margin-bottom: 1.3rem; }
.article-body li { margin-bottom: 0.55rem; }
.article-body strong { color: var(--primary); font-weight: 600; }
.article-body a { color: var(--primary); font-weight: 500; text-decoration: underline; }
.article-body a:hover { color: var(--accent); }

/* ── Float-right inline image ── */
/* ── Container for floated image + caption ── */
.article-figure-float {
    float: right;
    width: 320px; /* Controls the width of both image and text */
    margin: 0 0 1.5rem 2rem;
}

.article-figure-float img {
    width: 100%; /* Fills the 320px container */
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
    border: 3px solid var(--medium);
    display: block; /* Removes tiny gap at bottom of image */
}

.article-figure-float figcaption {
    font-size: 0.8rem;
    color: var(--dark);
    opacity: 0.65;
    text-align: center;
    margin-top: 0.6rem; /* Space between image and caption */
    font-style: italic;
    line-height: 1.4;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ── Info box component ── */
.info-box {
    background: linear-gradient(135deg, rgba(44,110,73,0.06) 0%, rgba(76,149,108,0.06) 100%);
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
    padding: 1.5rem 1.8rem;
    margin: 2rem 0;
    position: relative;
}
.info-box::before {
    content: '\f05a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 1.2rem;
    left: -0.85rem;
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    line-height: 28px;
    text-align: center;
}
.info-box-title {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.info-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.info-box ul li {
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(44,110,73,0.1);
    font-size: 0.97rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}
.info-box ul li:last-child { border-bottom: none; }
.info-box ul li::before {
    content: '✓';
    color: var(--secondary);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.05rem;
}
.info-box p {
    font-size: 0.97rem;
    margin: 0;
    color: var(--dark);
    opacity: 0.88;
    line-height: 1.75;
}

/* ── Warning / alert box variant ── */
.info-box.info-box--warning {
    border-left-color: var(--accent);
    background: linear-gradient(135deg, rgba(238,106,46,0.06) 0%, rgba(251,174,31,0.06) 100%);
}
.info-box.info-box--warning::before {
    content: '\f071';
    background: var(--accent);
}
.info-box.info-box--warning .info-box-title { color: var(--accent); }
.info-box.info-box--warning ul li::before { color: var(--accent); }

/* ── Step list ── */
.step-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    counter-reset: steps;
}
.step-list li {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
    counter-increment: steps;
    /* Prevent float siblings (inline images) from narrowing step text */
    clear: both;
    overflow: hidden;
}
.step-list li::before {
    content: counter(steps);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(44,110,73,0.3);
}
.step-list li .step-content strong {
    display: block;
    color: var(--primary);
    margin-bottom: 0.3rem;
    font-size: 1rem;
}
.step-list li .step-content p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.85;
}

/* ── CTA box ── */
.article-cta {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 2.8rem;
    border-radius: 12px;
    text-align: center;
    margin: 3.5rem 0 2rem;
    box-shadow: 0 10px 30px rgba(44,110,73,0.3);
}
.article-cta h3 {
    font-size: 1.6rem;
    margin-bottom: 0.9rem;
    font-weight: 700;
}
.article-cta p {
    opacity: 0.92;
    margin-bottom: 1.8rem;
    font-size: 1.05rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}
.article-cta .btn-primary {
    background: white;
    color: var(--primary);
    font-weight: 700;
    padding: 0.9rem 2.5rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}
.article-cta .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    background: #f8f9fa;
}

/* ── Back link ── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
    transition: gap 0.2s ease;
}
.back-link:hover { gap: 0.8rem; color: var(--accent); }

/* ── Related articles teaser ── */
.related-articles {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--medium);
}
.related-articles h3 {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-weight: 700;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
}
.related-card {
    background: white;
    border-radius: 8px;
    padding: 1.3rem;
    box-shadow: 0 3px 12px rgba(0,0,0,0.07);
    text-decoration: none;
    color: inherit;
    border-left: 3px solid var(--secondary);
    transition: all 0.3s ease;
    display: block;
}
.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-left-color: var(--accent);
}
.related-card .rc-title {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    line-height: 1.4;
}
.related-card .rc-meta {
    font-size: 0.8rem;
    color: var(--dark);
    opacity: 0.6;
}

/* ── Article listing page (index) ── */
.articles-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 5rem 0 3rem;
    text-align: center;
    color: white;
    margin-bottom: 3rem;
}
.articles-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.articles-hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .article-main    { padding-top: 80px; }
    .article-header h1 { font-size: 1.7rem; }
    .article-meta    { gap: 0.8rem; }
    .article-hero-img { height: 220px; }
    .article-img-float {
        float: none;
        width: 100%;
        height: 220px;
        margin: 0 0 1.5rem 0;
    }
    .article-img-caption {
        float: none;
        width: 100%;
        margin: -1rem 0 1.5rem 0;
    }
    .article-cta { padding: 2rem 1.5rem; }
    .article-cta h3 { font-size: 1.3rem; }
    .articles-hero { padding: 3.5rem 1rem 2rem; }
    .articles-hero h1 { font-size: 1.8rem; }
    .article-figure-float {
        float: none;
        width: 100%;
        margin: 0 0 1.5rem 0;
    }
    
    .article-figure-float img {
        height: 220px;
    }    
}

@media (max-width: 480px) {
    .article-header h1 { font-size: 1.45rem; }
    .article-body h2   { font-size: 1.35rem; }
    .step-list li      { gap: 0.9rem; }
}

/* ── Intro row: image beside opening text ── */
.article-intro-row {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}
.article-intro-img {
    width: 320px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
    border: 3px solid var(--medium);
    /* Never stretch beyond its natural height */
    height: auto;
    max-height: 260px;
}
.article-intro-row > div {
    flex: 1;
    min-width: 0;
}

@media (max-width: 640px) {
    .article-intro-row {
        display: flex !important;
        flex-direction: column-reverse !important;
    }
    .article-intro-img {
        float: none !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 0 1.5rem 0 !important; 
        max-height: 250px;
        object-fit: cover;
    }
}


/* Language badges on article cards */
.article-card-langs {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.lang-badge {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border: 2px solid var(--primary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1.4;
}
.lang-badge:hover {
    background: var(--primary);
    color: white;
}
.lang-badge--active {
    background: var(--primary);
    color: white;
}

/* Language switcher bar inside articles */
.article-lang-switcher {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.article-lang-switcher a {
    padding: 0.3rem 0.9rem;
    border: 2px solid var(--primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}
.article-lang-switcher a:hover,
.article-lang-switcher a[aria-current="page"] {
    background: var(--primary);
    color: white;
}

.info-box ul li strong {
    display: contents;
    font-weight: bold; /* Ensures it stays bold */
}

/* ── Permanent Step List Fix ── */
.step-list {
    list-style: none !important;
    padding: 0 !important; /* Forces browser user-agent styles to 0 */
    margin: 1.5rem 0;
    counter-reset: step-counter;
}

.step-list li {
    display: flex !important;
    flex-direction: row; /* In RTL, 'row' starts from the right automatically */
    gap: 1.2rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
    counter-increment: step-counter;
}

.step-list li::before {
    content: counter(step-counter);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(44,110,73,0.3);
}

.step-content {
    padding: 0 !important;
    margin: 0 !important;
    flex: 1; /* Ensures text takes up the remaining space */
}