/* ============================================================
   AIFENCE v2.0 — AI Security News Portal
   Supplemental CSS (Tailwind CDN handles base utilities)
   ============================================================ */

/* === GLOBAL OVERRIDES === */
::selection {
    background: rgba(0, 240, 255, 0.25);
    color: #fff;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0a0a0f;
}

::-webkit-scrollbar-thumb {
    background: #252530;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #44445a;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* === TICKER ANIMATION === */
.ticker-track {
    animation: ticker-scroll 30s linear infinite;
}

.ticker-track:hover {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: ticker-blink 1.5s ease-in-out infinite;
}

@keyframes ticker-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* === PULSING DOT (Subscribe button) === */
.btn-pulse {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

/* === SEVERITY BADGES === */
.severity-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 3px;
    line-height: 1.6;
}

.severity-critical {
    background: rgba(255, 62, 62, 0.15);
    color: #ff3e3e;
    border: 1px solid rgba(255, 62, 62, 0.3);
}

.severity-high {
    background: rgba(255, 159, 28, 0.15);
    color: #ff9f1c;
    border: 1px solid rgba(255, 159, 28, 0.3);
}

.severity-medium {
    background: rgba(250, 204, 21, 0.15);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.3);
}

.severity-low {
    background: rgba(0, 255, 157, 0.15);
    color: #00ff9d;
    border: 1px solid rgba(0, 255, 157, 0.3);
}

/* === HERO SLIDER === */
.hero-slide {
    animation: fadeSlideIn 0.6s ease-out;
}

.hero-slide.hidden {
    display: none;
}

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

.hero-dot {
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-dot.active {
    background: #00f0ff;
    width: 1.5rem;
}

/* === THREAT RADAR BARS === */
.threat-bar {
    animation: threat-fill 1.5s ease-out;
}

@keyframes threat-fill {
    from { width: 0; }
}

.threat-gauge {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.threat-gauge:hover {
    transform: translateY(-2px);
    border-color: #44445a;
}

/* === GHOST CONTENT (prose-dark) === */
.prose-dark {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #ccccd8;
}

.prose-dark > * + * {
    margin-top: 1.5em;
}

.prose-dark h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2.5em;
    margin-bottom: -0.25em;
    color: #fff;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #252530;
    scroll-margin-top: 5rem;
}

.prose-dark h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: -0.25em;
    color: #fff;
    scroll-margin-top: 5rem;
}

.prose-dark h4 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-top: 1.5em;
    color: #e0e0e8;
}

.prose-dark a {
    color: #00f0ff;
    text-decoration: underline;
    text-decoration-color: rgba(0, 240, 255, 0.3);
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

.prose-dark a:hover {
    color: #fff;
    text-decoration-color: rgba(255, 255, 255, 0.5);
}

.prose-dark strong {
    color: #fff;
    font-weight: 600;
}

.prose-dark blockquote {
    border-left: 3px solid #00f0ff;
    padding: 0.75rem 0 0.75rem 1.5rem;
    color: #8888a0;
    font-style: italic;
    background: #111118;
    border-radius: 0 4px 4px 0;
    margin: 2em 0;
}

.prose-dark code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875em;
    background: #1a1a24;
    color: #00f0ff;
    padding: 0.15em 0.4em;
    border-radius: 3px;
    border: 1px solid #252530;
}

.prose-dark pre {
    background: #111118;
    border: 1px solid #252530;
    border-left: 3px solid #8b5cf6;
    border-radius: 6px;
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    margin: 2em 0;
}

.prose-dark pre code {
    background: none;
    border: none;
    padding: 0;
    color: #e0e0e8;
    font-size: 1em;
}

.prose-dark ul,
.prose-dark ol {
    padding-left: 1.5rem;
}

.prose-dark li + li {
    margin-top: 0.4em;
}

.prose-dark li::marker {
    color: #44445a;
}

.prose-dark hr {
    border: none;
    border-top: 1px solid #252530;
    margin: 2.5em 0;
}

.prose-dark figure {
    margin: 2em 0;
}

.prose-dark figure img {
    width: 100%;
    border-radius: 6px;
    border: 1px solid #252530;
}

.prose-dark figcaption {
    text-align: center;
    font-size: 0.78rem;
    color: #44445a;
    margin-top: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
}

.prose-dark table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    margin: 2em 0;
}

.prose-dark thead th {
    background: #111118;
    font-weight: 600;
    color: #fff;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid #252530;
    font-size: 0.8125rem;
    letter-spacing: 0.03em;
}

.prose-dark tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #1a1a24;
    color: #ccccd8;
}

.prose-dark tbody tr:hover {
    background: #111118;
}

/* Ghost image card widths */
.prose-dark .kg-width-wide {
    margin-left: -4rem;
    margin-right: -4rem;
    max-width: calc(100% + 8rem);
}

.prose-dark .kg-width-full {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
}

/* === TOC SIDEBAR === */
#toc-nav a {
    display: block;
    padding: 4px 0;
    color: #8888a0;
    font-size: 0.8125rem;
    line-height: 1.4;
    transition: color 0.15s ease;
    border-left: 2px solid transparent;
    padding-left: 10px;
}

#toc-nav a:hover {
    color: #e0e0e8;
}

#toc-nav a.active {
    color: #00f0ff;
    border-left-color: #00f0ff;
}

#toc-nav a.toc-h3 {
    padding-left: 22px;
    font-size: 0.75rem;
}

/* === SUBSCRIBE FORM STATES === */
.subscribe-form.loading .btn-text { display: none; }
.subscribe-form.loading .btn-loading { display: inline !important; }
.subscribe-form.success .btn-text { display: none; }
.subscribe-form.success .btn-success { display: inline !important; }
.subscribe-form.success button { background: #00ff9d !important; }

/* === SCROLL REVEAL === */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === LINE CLAMP === */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === GHOST CARD OVERRIDES === */
.kg-bookmark-card {
    background: #111118;
    border: 1px solid #252530;
    border-radius: 6px;
    overflow: hidden;
    margin: 2em 0;
}

.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.kg-bookmark-content {
    flex: 1;
    padding: 1.25rem;
}

.kg-bookmark-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
}

.kg-bookmark-description {
    font-size: 0.8125rem;
    color: #8888a0;
    margin-top: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #44445a;
}

.kg-bookmark-icon {
    width: 16px;
    height: 16px;
}

.kg-bookmark-thumbnail {
    width: 160px;
    flex-shrink: 0;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === CALLOUT CARDS === */
.kg-callout-card {
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin: 2em 0;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.kg-callout-card-grey {
    background: #111118;
    border: 1px solid #252530;
}

.kg-callout-card-blue {
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.2);
}

.kg-callout-card-red {
    background: rgba(255, 62, 62, 0.08);
    border: 1px solid rgba(255, 62, 62, 0.2);
}

.kg-callout-emoji {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* === RESPONSIVE === */
@media (max-width: 1280px) {
    .prose-dark .kg-width-wide {
        margin-left: -2rem;
        margin-right: -2rem;
        max-width: calc(100% + 4rem);
    }
}

@media (max-width: 768px) {
    .prose-dark .kg-width-wide {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
    }

    .kg-bookmark-container {
        flex-direction: column;
    }

    .kg-bookmark-thumbnail {
        width: 100%;
        height: 160px;
    }
}
