/* ==========================================================================
   WOPA Magazine & iCONTENT Unified Article Design System
   Standard WOPA Content styling with responsive ads and night-mode support
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@400;600;700;800&display=swap');

:root {
    --primary: #6c5ce7;
    --primary-light: #a29bfe;
    --primary-gradient: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    --bg-gradient: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    --card-bg: rgba(255, 255, 255, 0.98);
    --text-main: #2d3436;
    --text-muted: #636e72;
    --border-color: rgba(0, 0, 0, 0.08);
}

/* Dark / Night Mode (set from main page) */
body.wopa-night-mode {
    --bg-gradient: linear-gradient(180deg, #0b1120 0%, #111827 100%);
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    background: #0b1120 !important;
    color: #f1f5f9 !important;
}

body.wopa-night-mode .header-nav {
    background: rgba(15, 23, 42, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.wopa-night-mode .article-container,
body.wopa-night-mode main {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

body.wopa-night-mode .article-title {
    color: #f8fafc !important;
}

body.wopa-night-mode .article-p {
    color: #e2e8f0 !important;
}

body.wopa-night-mode .article-p.lead {
    color: #f8fafc !important;
}

body.wopa-night-mode .info-box {
    background: #0f172a !important;
    color: #cbd5e1 !important;
    border-right-color: #818cf8 !important;
}

body.wopa-night-mode .site-sidebar-inner {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.wopa-night-mode .share-bar,
body.wopa-night-mode div[style*="margin-top:40px"][style*="text-align:center"] {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.wopa-night-mode .related-card {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.wopa-night-mode .related-card h4 {
    color: #f1f5f9 !important;
}

body.wopa-night-mode .related-card p {
    color: #94a3b8 !important;
}

body.wopa-night-mode .video-fallback-bar {
    background: #0f172a !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

* { box-sizing: border-box; }

body {
    font-family: 'Assistant', sans-serif !important;
    background: var(--bg-gradient);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: 1.8;
    font-size: 1.15rem;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Header */
.header-nav {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 24px;
    transition: background 0.3s ease;
}

.header-nav .nav-container {
    width: 100%;
    max-width: 1540px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-nav .brand-home {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.header-nav .brand-home:hover {
    transform: scale(1.03);
    opacity: 0.9;
}

.header-nav .brand-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary);
    background: rgba(108, 92, 231, 0.08);
    padding: 7px 16px;
    border-radius: 25px;
    transition: all 0.2s ease;
}

.header-nav .brand-content:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

/* 3-Column Page Layout */
.page-wrapper {
    display: grid;
    grid-template-columns: 300px minmax(0, 880px) 300px;
    justify-content: center;
    gap: 25px;
    width: 100%;
    max-width: 1540px;
    margin: 25px auto 40px auto;
    padding: 0 15px;
    box-sizing: border-box;
    align-items: start;
}

.site-sidebar {
    position: sticky;
    top: 85px;
    width: 300px;
    display: block;
    overflow: hidden;
}

.site-sidebar-inner {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.04);
    border: 1px solid var(--border-color);
    text-align: center;
}

.site-sidebar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* Center Article Container */
.article-container, main {
    width: 100%;
    min-width: 0;
    background: var(--card-bg);
    padding: 35px 45px;
    border-radius: 20px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* Hide any stray reading controls */
.reading-controls-bar {
    display: none !important;
}

/* Article Typography */
.article-title {
    font-size: 2.3rem;
    font-weight: 800;
    color: #1e272e;
    line-height: 1.3;
    margin: 0 0 16px 0;
    letter-spacing: -0.5px;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.article-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none;
    color: #fff;
    background: var(--primary-gradient);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.25);
}

/* Ken Burns Living Image */
@keyframes kenBurnsSlow {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.06) translate(-1%, -0.8%); }
    100% { transform: scale(1.02) translate(0.8%, 0.6%); }
}

.article-main-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 28px;
    background: #0f172a;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.article-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: kenBurnsSlow 22s ease-in-out infinite alternate;
    will-change: transform;
    display: block;
}

.article-p {
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 22px;
    color: var(--text-main);
    text-align: justify;
}

.article-p.lead {
    font-size: 1.25rem;
    font-weight: 600;
    color: #3b3b3b;
    line-height: 1.75;
    margin-bottom: 26px;
}

.article-subheading {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 35px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Info Box */
.info-box {
    background: #f8fafc;
    border-right: 4px solid var(--primary);
    padding: 22px 26px;
    border-radius: 14px;
    margin: 28px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.info-box ul {
    margin: 0;
    padding-right: 20px;
}

.info-box li {
    margin-bottom: 12px;
    line-height: 1.7;
}

.info-box li:last-child {
    margin-bottom: 0;
}

/* Ad Layout */
.ad-wrapper {
    display: block !important;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    margin: 32px 0;
    clear: both;
    text-align: center;
    background: rgba(0, 0, 0, 0.015);
    border-radius: 12px;
    padding: 12px 0;
}

ins.adsbygoogle {
    display: block !important;
    max-width: 100% !important;
    margin: 0 auto;
}

/* Video Player */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 14px;
    margin: 25px 0 10px 0;
    background: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

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

.video-fallback-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 18px;
    margin-top: 5px;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.video-fallback-btn {
    background: #ff0000;
    color: #fff !important;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, background 0.2s;
}

.video-fallback-btn:hover {
    background: #cc0000;
    transform: translateY(-2px);
}

/* Share Bar */
.share-bar,
div[style*="margin-top:40px"][style*="text-align:center"] {
    margin-top: 40px;
    padding: 22px;
    background: #f8fafc;
    border-radius: 16px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    margin: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
    color: #fff !important;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.share-btn-wa { background: #25d366; }
.share-btn-fb { background: #1877f2; }
.share-btn-copy { background: #475569; cursor: pointer; border: none; }

/* Related Articles */
.related-articles-section {
    margin-top: 45px;
    padding-top: 25px;
    border-top: 2px dashed #cbd5e1;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.related-card {
    text-decoration: none;
    color: inherit;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

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

.related-card-content {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.related-card h4 {
    margin: 0 0 8px 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
}

.related-card p {
    margin: 0;
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.4;
}

/* Toast Message */
#wopa-toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.92rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

#wopa-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Footer */
footer {
    background: #1e272e;
    color: #d2dae2;
    text-align: center;
    padding: 28px 20px;
    margin-top: auto;
    font-size: 0.95rem;
}

footer a {
    color: #a29bfe;
    text-decoration: none;
    font-weight: 700;
}

/* Responsive Layout */
@media (max-width: 1520px) {
    .page-wrapper {
        grid-template-columns: minmax(0, 880px) 300px;
    }
    .site-sidebar-left {
        display: none !important;
    }
    main, .article-container {
        grid-column: 1;
    }
}

@media (max-width: 1100px) {
    .page-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0 12px;
        margin-top: 15px;
    }
    .site-sidebar {
        display: none !important;
    }
    main, .article-container {
        width: 100%;
        max-width: 100%;
        padding: 24px 20px;
        border-radius: 16px;
    }
    .article-title {
        font-size: 1.75rem;
    }
}
