/* ══════════════════════════════════════════════
   Article Page Styles
   ══════════════════════════════════════════════ */

/* ── Featured Image ── */
.mwuk-featured-image {
    margin: 0 auto 1.5rem;
    max-width: var(--mwuk-content-width);
    border-radius: var(--mwuk-radius);
    overflow: hidden;
}

.mwuk-hero-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
}

/* ── Category Badge ── */
.mwuk-category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--mwuk-primary-light);
    color: var(--mwuk-primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.mwuk-category-badge:hover {
    background: var(--mwuk-primary);
    color: #fff;
    text-decoration: none;
}

/* ── Article Header ── */
.mwuk-article-header {
    margin-bottom: 2rem;
}

.mwuk-article-title {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--mwuk-navy);
    margin: 0 0 1rem;
}

.mwuk-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--mwuk-text-secondary);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--mwuk-border);
}

.mwuk-meta-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mwuk-meta-avatar {
    border-radius: 50%;
    object-fit: cover;
}

.mwuk-meta-author a {
    color: var(--mwuk-navy);
    font-weight: 600;
}

.mwuk-meta-date {
    color: var(--mwuk-text-light);
}

.mwuk-meta-reading-time {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    color: var(--mwuk-text-secondary);
}

.mwuk-meta-reading-time svg {
    opacity: 0.6;
}

/* ── Share Button (top) ── */
.mwuk-share-top {
    margin-top: 1rem;
}

.mwuk-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--mwuk-bg-light);
    border: 1px solid var(--mwuk-border);
    border-radius: var(--mwuk-radius-sm);
    color: var(--mwuk-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.mwuk-share-btn:hover {
    background: var(--mwuk-primary-light);
    border-color: var(--mwuk-primary);
    color: var(--mwuk-primary);
}

/* ── Key Takeaway ── */
.mwuk-key-takeaway-wrap {
    margin: 1.5rem 0 2rem;
}

.mwuk-key-takeaway {
    background: linear-gradient(135deg, #e8f5ee, #f0f9f4);
    border-left: 4px solid var(--mwuk-primary);
    border-radius: 0 var(--mwuk-radius) var(--mwuk-radius) 0;
    padding: 1.25rem 1.5rem;
}

.mwuk-kt-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--mwuk-primary-dark);
    margin-bottom: 0.5rem;
}

.mwuk-key-takeaway p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--mwuk-text);
}

/* ── Table of Contents ── */
.mwuk-toc {
    background: var(--mwuk-bg-light);
    border: 1px solid var(--mwuk-border);
    border-radius: var(--mwuk-radius);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0 2rem;
    position: static !important;
    float: none !important;
}

.mwuk-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mwuk-toc-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--mwuk-navy);
    margin: 0;
    padding: 0;
    border: none;
}

.mwuk-toc-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--mwuk-text-light);
    transition: transform 0.3s;
}

.mwuk-toc-toggle[aria-expanded="false"] svg {
    transform: rotate(-90deg);
}

.mwuk-toc-list {
    margin: 0.75rem 0 0;
    padding-left: 1.25rem;
    list-style: decimal;
}

.mwuk-toc-list.collapsed {
    display: none;
}

.mwuk-toc-list li {
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

.mwuk-toc-list a {
    color: var(--mwuk-text-secondary);
    font-size: 0.925rem;
    font-weight: 500;
    text-decoration: none;
}

.mwuk-toc-list a:hover {
    color: var(--mwuk-primary);
    text-decoration: none;
}

/* ── Article Body ── */
.mwuk-article-body {
    margin-bottom: 2.5rem;
}

.mwuk-article-body h2 {
    margin-top: 2.5rem;
    scroll-margin-top: 80px;
}

.mwuk-article-body h3 {
    margin-top: 1.75rem;
}

.mwuk-article-body p {
    font-size: var(--mwuk-font-size);
    line-height: var(--mwuk-line-height);
}

.mwuk-article-body a {
    color: var(--mwuk-link);
    text-decoration: underline;
    text-decoration-color: rgba(26, 115, 232, 0.3);
    text-underline-offset: 2px;
}

.mwuk-article-body a:hover {
    text-decoration-color: var(--mwuk-link);
}

.mwuk-article-body blockquote {
    border-left: 4px solid var(--mwuk-primary);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--mwuk-bg-light);
    border-radius: 0 var(--mwuk-radius-sm) var(--mwuk-radius-sm) 0;
    font-style: normal;
}

/* Why Trust / Real-Life Example boxes */
.mwuk-article-body div[style*="background"] {
    border-radius: var(--mwuk-radius) !important;
    margin: 1.5rem 0 !important;
}

/* ── FAQ Accordion ── */
.mwuk-article-body h2#faq {
    margin-top: 3rem;
}

.mwuk-article-body h2#faq ~ h3 {
    background: var(--mwuk-bg-light);
    margin: 0;
    padding: 1rem 1.25rem;
    border: 1px solid var(--mwuk-border);
    border-bottom: none;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--mwuk-navy);
    transition: background 0.2s;
}

.mwuk-article-body h2#faq ~ h3:first-of-type {
    border-radius: var(--mwuk-radius) var(--mwuk-radius) 0 0;
    margin-top: 1rem;
}

.mwuk-article-body h2#faq ~ h3:hover {
    background: var(--mwuk-primary-light);
}

.mwuk-article-body h2#faq ~ h3 + p,
.mwuk-article-body h2#faq ~ h3 + div {
    padding: 0.75rem 1.25rem 1rem;
    border: 1px solid var(--mwuk-border);
    border-top: none;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--mwuk-text-secondary);
}

/* Last FAQ item */
.mwuk-article-body h2#faq ~ h3:last-of-type + p,
.mwuk-article-body h2#faq ~ h3:last-of-type + div {
    border-radius: 0 0 var(--mwuk-radius) var(--mwuk-radius);
}

/* ── Author Box ── */
.mwuk-author-box {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    background: var(--mwuk-bg-light);
    border: 1px solid var(--mwuk-border);
    border-radius: var(--mwuk-radius);
    padding: 1.5rem;
    margin: 2.5rem 0;
}

.mwuk-author-photo {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.mwuk-author-label {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mwuk-text-light);
}

.mwuk-author-name {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--mwuk-navy);
}

.mwuk-author-name a {
    color: var(--mwuk-link);
}

.mwuk-author-title {
    font-weight: 400;
    color: var(--mwuk-text-secondary);
}

.mwuk-author-bio {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--mwuk-text-secondary);
}

/* ── Share Buttons (bottom) ── */
.mwuk-share-bottom {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--mwuk-border);
    border-bottom: 1px solid var(--mwuk-border);
    margin-bottom: 2.5rem;
}

.mwuk-share-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--mwuk-text-secondary);
    white-space: nowrap;
}

.mwuk-share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mwuk-share-icon {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: var(--mwuk-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.mwuk-share-icon:hover {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
}

.mwuk-share-fb { background: #1877f2; }
.mwuk-share-tw { background: #0f1419; }
.mwuk-share-wa { background: #25d366; }
.mwuk-share-em { background: #6b7280; }

/* ── Related Articles ── */
.mwuk-related {
    margin: 3rem 0;
}

.mwuk-related-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    border: none;
    padding: 0;
}

.mwuk-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.mwuk-related-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--mwuk-border);
    border-radius: var(--mwuk-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s;
}

.mwuk-related-card:hover {
    box-shadow: var(--mwuk-shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.mwuk-related-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.mwuk-related-card-body {
    padding: 1rem;
}

.mwuk-related-cat {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mwuk-primary);
}

.mwuk-related-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--mwuk-navy);
    margin: 0.35rem 0 0.5rem;
    line-height: 1.4;
}

.mwuk-related-meta {
    font-size: 0.8rem;
    color: var(--mwuk-text-light);
}

/* ── Disclaimer ── */
.mwuk-disclaimer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--mwuk-border);
}

.mwuk-disclaimer p {
    font-size: 0.85rem;
    color: var(--mwuk-text-light);
    font-style: italic;
    line-height: 1.6;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .mwuk-article-title {
        font-size: 1.6rem;
    }

    .mwuk-article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .mwuk-author-box {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .mwuk-related-grid {
        grid-template-columns: 1fr;
    }

    .mwuk-share-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ══════════════════════════════════════════════
   Inline Content Fixes
   Fix styling conflicts from inline HTML in articles
   ══════════════════════════════════════════════ */

/* ── Fix: Tables with inline white text on white background ── */
.mwuk-article-body table,
.mwuk-article-body table th,
.mwuk-article-body table td,
.mwuk-article-body table thead th {
    color: inherit !important;
}

.mwuk-article-body table thead tr,
.mwuk-article-body table thead {
    background: var(--mwuk-navy) !important;
}

.mwuk-article-body table thead th {
    color: #fff !important;
}

.mwuk-article-body table td {
    color: var(--mwuk-text) !important;
}

/* ── Fix: Hide Kadence's built-in author box (we use the inline one) ── */
.author-section,
.entry-author,
.post-author-box,
.kadence-author-box,
.wp-block-post-author,
.entry-author-style-normal,
.entry-author-style-center {
    display: none !important;
}

/* ── Fix: Style the inline author box properly ── */
.mwuk-article-body > div[style*="display:flex"][style*="gap"] {
    border-radius: var(--mwuk-radius) !important;
    border: 1px solid var(--mwuk-border) !important;
    background: var(--mwuk-bg-light) !important;
    padding: 1.5rem !important;
    margin: 2rem 0 !important;
}

.mwuk-article-body > div[style*="display:flex"] img[style*="border-radius:50%"] {
    width: 80px !important;
    height: 80px !important;
    object-fit: cover;
}

/* ── Fix: Hide duplicate inline "In This Guide" / TOC boxes ── */
.mwuk-article-body > div[style*="border-radius"]:has(strong:only-child) {
    display: none !important;
}

/* Hide inline TOC boxes that contain "In This Guide" or "Table of Contents" */
.mwuk-article-body div[style*="background:#f5f7fa"],
.mwuk-article-body div[style*="background: #f5f7fa"] {
    display: none !important;
}

/* But keep other styled boxes (Key Takeaway, Why Trust, Real-Life Example) */
.mwuk-article-body div[style*="gradient"],
.mwuk-article-body div[style*="#e8f5e9"],
.mwuk-article-body div[style*="#fafafa"],
.mwuk-article-body div[style*="#f0f7ff"],
.mwuk-article-body div[style*="#fff8e1"],
.mwuk-article-body div[style*="#eff6ff"] {
    display: block !important;
}

/* ── Fix: Hide inline "Share This Guide" boxes (theme has its own) ── */
.mwuk-article-body div[style*="border-top"][style*="border-bottom"]:has(strong:first-child) {
    display: none !important;
}

/* Target share boxes by their content structure */
.mwuk-article-body div[class="mwk-share"],
.mwuk-article-body div[style*="padding:20px 0"]:has(a[style*="background:#1877f2"]) {
    display: none !important;
}

/* ── Fix: ALL FAQ H3 questions - consistent styling regardless of inline styles ── */
.mwuk-article-body h3[style*="color"] {
    color: var(--mwuk-navy) !important;
}

/* FAQ Q&A pairs wrapped in divs (some articles use this format) */
.mwuk-article-body div[style*="margin:24px 0"] {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

.mwuk-article-body div[style*="margin:24px 0"] h3 {
    color: var(--mwuk-navy) !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    margin: 1.5rem 0 0.5rem !important;
    padding: 0 !important;
}

.mwuk-article-body div[style*="margin:24px 0"] p {
    margin: 0 0 1rem !important;
}

/* ── Fix: Kadence theme author elements (stronger selectors) ── */
.entry-author-style-normal,
.entry-author-style-center,
.author-section,
.entry-author,
.post-author-box,
.kadence-author-box,
.wp-block-post-author,
.author-info,
div[class*="author-section"],
div[class*="entry-author"] {
    display: none !important;
}

/* ── Fix: Calculator styling ── */
.mwuk-article-body input[type="number"],
.mwuk-article-body input[type="text"],
.mwuk-article-body select {
    border: 1px solid var(--mwuk-border) !important;
    border-radius: var(--mwuk-radius-sm) !important;
    padding: 0.625rem 0.875rem !important;
    font-size: 1rem !important;
    font-family: var(--mwuk-font) !important;
    color: var(--mwuk-text) !important;
    background: #fff !important;
}

.mwuk-article-body input:focus,
.mwuk-article-body select:focus {
    outline: none !important;
    border-color: var(--mwuk-primary) !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 63, 0.15) !important;
}

.mwuk-article-body button[onclick],
.mwuk-article-body button[type="button"] {
    background: var(--mwuk-primary) !important;
    color: #fff !important;
    border: none !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: var(--mwuk-radius-sm) !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    cursor: pointer !important;
}
