/* ─────────────────────────────────────────────────────────────────────────────
   HELP CENTER - INDEPENDENT ARTICLE STYLES
───────────────────────────────────────────────────────────────────────────── */

/* ── 1. MAIN LAYOUT & CENTERING ── */
.article-main {
    padding: 60px 20px 120px;
    min-height: calc(100vh - 72px);
}

.article-center-column {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ── 2. THE ARTICLE PANEL (White Box) ── */
.article-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 64px 72px;
    box-shadow: var(--shadow-md);
    margin-bottom: 60px;
}

@media (max-width: 768px) {
    .article-main { padding: 40px 16px 80px; }
    .article-panel { padding: 40px 24px; }
}

/* ── 3. BREADCRUMBS & HEADER ── */
.article-breadcrumbs {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-3);
    margin-bottom: 32px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.article-breadcrumbs a {
    color: var(--ink-3);
    text-decoration: none;
    transition: color 0.2s;
}
.article-breadcrumbs a:hover { color: var(--gold); }
.article-breadcrumbs span { opacity: 0.5; }

.article-header {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.article-header h1 {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-family: 'DM Serif Display', serif;
    color: var(--ink);
    line-height: 1.15;
    margin-bottom: 24px;
    text-wrap: balance;
}

.article-meta-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--ink-3);
    font-family: 'DM Sans', sans-serif;
}

.meta-divider { color: var(--border-med); }
.meta-item { display: flex; align-items: center; gap: 6px; }

/* ── 4. CONTENT TYPOGRAPHY ── */
.article-body {
    font-family: 'DM Sans', sans-serif;
    color: var(--ink-2);
    font-size: 1.1rem; /* Highly readable body text */
    line-height: 1.8;
}

.article-body h2 {
    font-family: 'DM Sams', sans-serif;
    font-weight: 600;
    font-size: 2rem;
    color: var(--ink);
    margin: 56px 0 24px;
    line-height: 1.2;
}

.article-body h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ink);
    margin: 40px 0 16px;
}

.article-body p { margin-bottom: 24px; }

.article-body a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: all 0.2s;
}
.article-body a:hover {
    color: var(--gold);
    text-decoration-color: var(--gold);
}

/* ── 5. LISTS & MEDIA ── */
.article-body ul, .article-body ol {
    margin-bottom: 32px;
    padding-left: 28px;
}
.article-body li { padding-left: 12px; margin-bottom: 12px; }
.article-body li::marker { font-weight: 700; }

.article-media {
    margin: 48px 0;
    text-align: center;
}
.article-media img {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.05); 
    transition: all 0.3s ease;
    cursor: zoom-in;
}

.article-media img:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 26, 46, 0.075);
    border-color: var(--border-med);
}

.image-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 46, 0.5);
    backdrop-filter: blur(3px);
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* State when modal is active (Triggered by JS) */
.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}
.modal-wrapper {
    position: relative;
    display: flex;
    /* We calculate 90vw minus 60px to ensure the 20px gap + the X always fits on screen */
    max-width: calc(90vw - 60px); 
    max-height: 90vh;
    
    /* Animation when opening */
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.image-modal.active .modal-wrapper {
    transform: scale(1);
}
.modal-content {
    max-width: 100%; 
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border: 2px solid rgba(255,255,255,0.1);
}

.image-modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 0;
    /* This perfectly anchors the left edge of the X exactly 20px from the right edge of the image */
    left: calc(100% + 20px); 
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    line-height: 0.75; /* Removes invisible top padding from the text element */
    transition: 0.3s;
    cursor: pointer;
    z-index: 100001;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--gold);
    text-decoration: none;
}

/* Mobile responsive adjustments for the modal */
@media (max-width: 768px) {
    .modal-wrapper { max-width: 90vw; }
    .modal-close {
        left: auto;
        right: 12px;
        top: 12px;
        text-shadow: 0 2px 8px rgba(0,0,0,0.5); /* Helps visibility if placed over a white image */
    }
}
.media-caption {
    font-size: 0.85rem;
    color: var(--ink-3);
    margin-top: 14px;
    font-style: italic;
}

/* ── 6. CALLOUT BOXES ── */
.article-callout {
    display: flex;
    gap: 20px;
    padding: 28px;
    border-radius: var(--radius-sm);
    margin: 40px 0;
    background: var(--mist);
    border: 1px solid var(--border);
}
.article-callout.info { border-left-color: var(--blue); }
.article-callout.warning { border-left-color: var(--red); }

.callout-icon {
    font-size: 1.6rem;
    color: var(--gold);
    flex-shrink: 0;
    margin-top: 2px;
}
.info .callout-icon { color: var(--blue); }
.warning .callout-icon { color: var(--red); }

.callout-content h4 {
    margin: 0 0 8px 0;
    color: var(--ink);
    font-size: 1.05rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
}
.callout-content p { margin: 0; font-size: 0.95rem; line-height: 1.6; }

/* ── 7. FEEDBACK WIDGET ── */
.article-feedback {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}
.feedback-prompt { font-weight: 600; color: var(--ink); font-size: 1.05rem;}
.feedback-actions { display: flex; gap: 12px; }

.btn-vote {
    background: #fff;
    border: 1px solid var(--border-med);
    color: var(--ink-2);
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-vote:hover {
    border-color: var(--ink);
    color: var(--ink);
    background: var(--mist);
}

/* ── 8. RELATED ARTICLES ── */
.related-articles h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.8rem;
    color: var(--ink);
    margin-bottom: 24px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
@media (max-width: 640px) {
    .related-grid { grid-template-columns: 1fr; }
}