:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-ai: #a855f7;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-image: radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent 400px);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.source-pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent);
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5rem;
    margin-top: 0;
    line-height: 1.2;
}

.article-content {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 40px;
    transition: min-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden; /* Prevent content spill during transition */
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content p:last-child {
    margin-bottom: 0;
}

.meta-data {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.back-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 500;
}

.back-link:hover {
    color: white;
}

/* Bias Mixer Styles */
.bias-mixer-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.bias-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.info-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.info-btn {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80; /* Glowing Green */
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.1);
}

.info-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #4ade80;
    color: #fff;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
    transform: scale(1.05);
}

.info-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 280px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(74, 222, 128, 0.3); /* Match green theme */
    border-radius: 12px;
    padding: 20px;
    font-size: 0.9rem;
    color: #f1f5f9;
    line-height: 1.6;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(34, 197, 94, 0.05);
    text-transform: none !important; /* Force sentence case */
    letter-spacing: normal !important;
    text-align: left;
}

.info-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.info-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 10px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(15, 23, 42, 0.98) transparent;
}

.bias-controls {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.bias-controls::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}



.bias-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.bias-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

/* ACCESSIBILITY: Explicit focus-visible ring for keyboard users, since outline is weird on rounded pills */
.bias-btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* The Dot Indicator */
.bias-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    transition: all 0.3s ease;
}

.bias-btn[data-bias="objective"] .bias-dot {
    background: #94a3b8;
    box-shadow: 0 0 8px rgba(148, 163, 184, 0.4);
}

.bias-btn[data-bias="realist"] .bias-dot {
    background: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.bias-btn[data-bias="progressive"] .bias-dot {
    background: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.bias-btn[data-bias="conservative"] .bias-dot {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* Active States with distinct colors */
.bias-btn.active {
    color: white;
    padding: 8px 22px;
    /* Expand slightly when active */
}

.bias-btn.active .bias-dot {
    background: white !important;
    box-shadow: none !important;
}

.bias-btn[data-bias="objective"].active {
    background: linear-gradient(135deg, #64748b, #475569);
    box-shadow: 0 4px 15px rgba(100, 116, 139, 0.4);
}

.bias-btn[data-bias="realist"].active {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.bias-btn[data-bias="progressive"].active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.bias-btn[data-bias="conservative"].active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* Skeleton Animation for switching */
.skeleton {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite linear;
    margin-bottom: 12px;
    width: 100%;
}

.skeleton.w-80 {
    width: 80%;
}

.skeleton.w-60 {
    width: 60%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Related Pulse Section */
.related-pulse-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    clear: both;
}

.related-pulse-section h3 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-pulse-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}

@media (max-width: 850px) {
    .related-pulse-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 550px) {
    .related-pulse-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.related-pulse-card-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.related-pulse-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.related-pulse-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.related-pulse-card h4 {
    color: #fff;
    margin: 0 0 1rem 0;
    font-size: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-pulse-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* --- MOBILE REFINEMENTS --- */
@media (max-width: 600px) {
    h1 {
        font-size: 1.6rem !important; /* Approx 2/3 of 2.5rem */
        line-height: 1.3;
        margin-bottom: 15px;
    }

    .glass-card {
        padding: 24px; /* More room for content */
    }

    .meta-data {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .bias-mixer-container {
        padding: 15px;
        margin-bottom: 25px;
    }

    .bias-controls {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 2-column grid for usability */
        gap: 10px;
        width: 100%;
        background: transparent;
        border: none;
        padding: 0;
        box-shadow: none;
        overflow-x: visible;
    }

    .bias-btn {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 8px;
        justify-content: center;
        padding: 12px 8px;
        font-size: 0.85rem;
        width: 100%;
        margin: 0;
    }

    .bias-btn.active {
        padding: 12px 8px;
    }

    /* External Pulse Mobile Refinements */
    .external-pulse-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }

    .external-pulse-grid {
        grid-template-columns: 1fr !important; /* Force single column earlier */
        gap: 1.5rem; /* More vertical separation */
        margin-bottom: 2.5rem;
    }

    .external-pulse-card {
        padding: 1.5rem; /* More consistent space */
        height: auto !important; /* Allow natural expansion */
        min-height: 0 !important; /* Remove constraints that cause overlapping */
    }
}

/* External Pulse Styles (Desktop + Global) */
.external-pulse-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    clear: both;
}

.external-pulse-section h3 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.external-pulse-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 3rem;
}

.external-pulse-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Better for text-heavy cards */
}

.external-pulse-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-ai);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.5);
}

.external-pulse-card h4 {
    color: #fff;
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.external-pulse-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.visit-link {
    display: inline-flex;
    align-items: center;
    color: var(--accent-ai) !important; /* Force override of blue link defaults */
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 18px;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 6px;
    width: fit-content;
    transition: all 0.2s ease;
}

.external-pulse-card:hover .visit-link {
    background: var(--accent-ai) !important;
    color: #fff !important;
    border-color: var(--accent-ai) !important;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

@media (max-width: 950px) {
    .external-pulse-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 750px) {
    .external-pulse-grid {
        grid-template-columns: 1fr;
    }
}

/* --- GATED ACCESS STYLES --- */
.article-body-layer {
    position: relative;
    width: 100%;
}

.article-body-layer.is-gated .blur-content-zone {
    filter: blur(25px) grayscale(50%);
    opacity: 0.25;
    pointer-events: none;
    user-select: none;
    transition: filter 0.4s ease;
}

.gated-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 45%, 
                rgba(15, 23, 42, 0) 15%, 
                rgba(15, 23, 42, 0.4) 45%, 
                rgba(15, 23, 42, 0.95) 90%);
    backdrop-filter: blur(6px);
    pointer-events: none;
    z-index: 9998;
    animation: atmosphericPulse 4s infinite alternate ease-in-out;
}

.gated-card-wrapper {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    width: 90%;
    max-width: 620px;
    padding: 20px;
    z-index: 9999;
    pointer-events: auto;
}

@keyframes atmosphericPulse {
    from { opacity: 0.92; }
    to { opacity: 1; }
}

.gated-box {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(30px);
    border: 2px solid rgba(168, 85, 247, 0.7);
    border-radius: 2.5rem;
    padding: 4rem 3rem;
    text-align: center;
    box-shadow: 0 0 60px rgba(168, 85, 247, 0.2), 
                inset 0 0 40px rgba(168, 85, 247, 0.1);
    animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.gated-box::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 2.5rem;
    padding: 2px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.8), transparent, rgba(168, 85, 247, 0.8));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.gated-box h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gated-box p {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.gated-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: flex-start;
}

.btn-group-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.btn-reassurer {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.gated-actions .btn-primary {
    min-width: 200px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    min-width: 160px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}