/* ==========================================
   Cyber Threat Intelligence Blog - Custom CSS
   ========================================== */

/* Base */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: rgba(var(--a-500), 0.3);
    color: rgb(var(--t-heading));
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgb(var(--bg-900));
}

::-webkit-scrollbar-thumb {
    background: rgb(var(--bg-700));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* 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;
}

/* Article Content Styles */
.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: rgb(var(--t-heading));
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgb(var(--bg-800));
}

.article-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: rgb(var(--t-heading));
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgb(var(--t-heading));
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-content p {
    color: rgb(var(--t-body));
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

.article-content a {
    color: rgb(var(--a-400));
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.article-content a:hover {
    border-bottom-color: rgb(var(--a-400));
}

.article-content img {
    border-radius: 0.75rem;
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
}

.article-content ul,
.article-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
    color: rgb(var(--t-body));
}

.article-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.article-content ul li::marker {
    color: rgb(var(--a-500));
}

.article-content ol li::marker {
    color: rgb(var(--a-500));
    font-weight: 600;
}

.article-content blockquote {
    border-left: 4px solid rgb(var(--a-500));
    background: rgba(var(--a-500), 0.05);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
    color: rgb(var(--t-muted));
    font-style: italic;
}

.article-content pre {
    background: rgb(var(--bg-800));
    border: 1px solid rgb(var(--bg-700));
    border-radius: 0.75rem;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.article-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875em;
}

.article-content :not(pre) > code {
    background: rgb(var(--bg-800));
    color: rgb(var(--a-300));
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.85em;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.article-content th {
    background: rgb(var(--bg-800));
    color: rgb(var(--t-heading));
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border: 1px solid rgb(var(--bg-700));
}

.article-content td {
    padding: 0.75rem 1rem;
    border: 1px solid rgb(var(--bg-800));
    color: rgb(var(--t-body));
}

.article-content tr:nth-child(even) td {
    background: rgba(var(--bg-800), 0.3);
}

.article-content hr {
    border: none;
    border-top: 1px solid rgb(var(--bg-800));
    margin: 2rem 0;
}

/* Ad Container */
.ad-container {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgb(var(--bg-800));
    border-radius: 0.5rem;
    padding: 0.5rem;
    margin: 1rem 0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

/* Pulse animation for live indicator */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Smooth transitions */
article {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Focus styles */
input:focus, textarea:focus, select:focus {
    outline: none;
}

/* Print styles */
@media print {
    header, footer, aside, .ad-container, #backToTop, #cookieConsent, .share-buttons, #themePopup, #themeToggleBtn {
        display: none !important;
    }
    body {
        background: #fff;
        color: #000;
    }
    .article-content {
        color: #000;
    }
    .article-content a {
        color: #0066cc;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .article-content {
        font-size: 1rem;
        line-height: 1.75;
    }

    .article-content h2 {
        font-size: 1.4rem;
    }

    .article-content h3 {
        font-size: 1.2rem;
    }

    .article-content pre {
        font-size: 0.8rem;
        padding: 1rem;
    }
}

/* ========== LIGHT THEME (BEYAZ) OVERRIDES ========== */
[data-theme="beyaz"] {
    color-scheme: light;
}

/* ---- Text color overrides ---- */
[data-theme="beyaz"] .text-white {
    color: rgb(var(--t-heading)) !important;
}

[data-theme="beyaz"] .text-gray-300 {
    color: rgb(var(--t-body)) !important;
}

[data-theme="beyaz"] .text-gray-400 {
    color: rgb(var(--t-muted)) !important;
}

[data-theme="beyaz"] .text-gray-500 {
    color: rgb(var(--t-faint)) !important;
}

[data-theme="beyaz"] .text-gray-600 {
    color: rgb(var(--t-faint)) !important;
}

[data-theme="beyaz"] .text-gray-700 {
    color: rgb(var(--t-muted)) !important;
}

/* ---- Hover text overrides ---- */
[data-theme="beyaz"] .hover\:text-white:hover {
    color: rgb(var(--t-heading)) !important;
}

[data-theme="beyaz"] .group:hover .group-hover\:text-white {
    color: rgb(var(--t-heading)) !important;
}

[data-theme="beyaz"] .group:hover .group-hover\:text-cyan-400 {
    color: rgb(var(--a-400)) !important;
}

/* ---- Placeholder ---- */
[data-theme="beyaz"] .placeholder-gray-500::placeholder {
    color: rgb(var(--t-faint)) !important;
}

/* ---- Input / textarea text color ---- */
[data-theme="beyaz"] input.text-white,
[data-theme="beyaz"] textarea.text-white,
[data-theme="beyaz"] select.text-white {
    color: rgb(var(--t-heading)) !important;
}

/* ---- Border adjustments for visibility ---- */
[data-theme="beyaz"] .border-dark-600 {
    border-color: rgb(var(--bg-700)) !important;
}

/* ---- Prose overrides ---- */
[data-theme="beyaz"] .prose-invert {
    --tw-prose-body: rgb(var(--t-body));
    --tw-prose-headings: rgb(var(--t-heading));
    --tw-prose-links: rgb(var(--a-400));
    --tw-prose-bold: rgb(var(--t-heading));
    --tw-prose-code: rgb(var(--a-400));
}

[data-theme="beyaz"] .prose-headings\:text-white h1,
[data-theme="beyaz"] .prose-headings\:text-white h2,
[data-theme="beyaz"] .prose-headings\:text-white h3,
[data-theme="beyaz"] .prose-headings\:text-white h4 {
    color: rgb(var(--t-heading)) !important;
}

[data-theme="beyaz"] .prose-p\:text-gray-300 p {
    color: rgb(var(--t-body)) !important;
}

[data-theme="beyaz"] .prose-strong\:text-white strong {
    color: rgb(var(--t-heading)) !important;
}

[data-theme="beyaz"] .prose-ul\:text-gray-300 ul,
[data-theme="beyaz"] .prose-ol\:text-gray-300 ol {
    color: rgb(var(--t-body)) !important;
}

[data-theme="beyaz"] .prose-th\:text-white th {
    color: rgb(var(--t-heading)) !important;
}

[data-theme="beyaz"] .prose-code\:text-cyan-300 code {
    color: rgb(var(--a-400)) !important;
}

/* ---- Scrollbar ---- */
[data-theme="beyaz"] ::-webkit-scrollbar-track {
    background: rgb(var(--bg-950));
}

[data-theme="beyaz"] ::-webkit-scrollbar-thumb {
    background: rgb(var(--bg-700));
}

[data-theme="beyaz"] ::-webkit-scrollbar-thumb:hover {
    background: rgb(var(--t-faint));
}

/* ---- Shadows ---- */
[data-theme="beyaz"] .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.08) !important;
}

[data-theme="beyaz"] .shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15) !important;
}

/* ---- Theme switcher popup in light mode ---- */
[data-theme="beyaz"] #themePopup .bg-dark-900 {
    border-color: rgb(var(--bg-700)) !important;
}

[data-theme="beyaz"] #themeToggleBtn {
    border-color: rgb(var(--bg-700)) !important;
}
