/*
 Theme Name:   MSEndpoint Theme
 Theme URI:    https://msendpoint.com
 Description:  A dark-mode enterprise blog interface with Deduction Mode, built from scratch to prevent any parent theme UI conflicts.
 Author:       Souhaiel
 Author URI:   https://msendpoint.com
 Version:      1.0.0
 Text Domain:  msendpoint-theme
*/

/* --- Base Formats & Resets --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #2563eb;
    /* Azure blue */
    --bg-dark: #0b1220;
    /* Deep navy */
    --bg-darker: #080f1a;
    --bg-panel: #111827;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --font-code: 'JetBrains Mono', monospace;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-base);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-smooth);
}

a:hover {
    text-decoration: underline;
    color: #3b82f6;
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: #f8fafc;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.5rem;
}

pre,
code {
    font-family: var(--font-code);
    font-size: 0.9em;
}

p {
    margin-bottom: 1.5rem;
}

/* --- Layout --- */
.site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    background-color: var(--bg-darker);
    border-bottom: 1px solid #1e293b;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .site-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
    letter-spacing: -0.5px;
}

.site-title a {
    color: #fff;
    text-decoration: none;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.main-navigation a {
    color: var(--text-main);
    font-weight: 500;
}

.main-navigation a:hover {
    color: var(--primary);
    text-decoration: none;
}

.site-content {
    padding: 40px 0;
    min-height: calc(100vh - 160px);
}

.post-card,
.single-post-container,
.page-container {
    background: var(--bg-panel);
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.post-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.post-content pre {
    background: #0f172a;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid #1e293b;
}

.site-footer {
    background-color: var(--bg-darker);
    border-top: 1px solid #1e293b;
    padding: 30px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Button */
.mse-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: background var(--transition-smooth);
}

.mse-btn:hover {
    background: #1d4ed8;
    color: #fff;
    text-decoration: none;
}

.mse-btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.mse-btn-outline:hover {
    background: rgba(37, 99, 235, 0.1);
}

/* --- Deduction Mode Overlay --- */

.deduction-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 18, 32, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-smooth);
    z-index: 9998;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
}

body.deduction-active .deduction-overlay {
    opacity: 1;
}

.deduction-overlay {
    mask-image: radial-gradient(circle 150px at var(--mouse-x, 50%) var(--mouse-y, 50%), transparent 0%, black 100%);
    -webkit-mask-image: radial-gradient(circle 150px at var(--mouse-x, 50%) var(--mouse-y, 50%), transparent 0%, black 100%);
}

.deduction-badge {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 16px;
    font-family: var(--font-code);
    font-size: 13px;
    border-radius: 4px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-smooth);
    pointer-events: none;
}

body.deduction-active .deduction-badge {
    opacity: 1;
    transform: translateY(0);
}

.deduction-clue {
    opacity: 0;
    color: var(--primary);
    font-family: var(--font-code);
    font-size: 0.85em;
    margin-left: 10px;
    transition: opacity var(--transition-smooth);
}

body.deduction-active .deduction-clue {
    opacity: 1;
}

@keyframes traceLine {
    from {
        stroke-dashoffset: 1000;
    }

    to {
        stroke-dashoffset: 0;
    }
}

.security-trace-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    stroke: var(--primary);
    stroke-width: 2;
    fill: none;
}

body.deduction-active .security-trace-path {
    animation: traceLine 2s ease-out forwards;
}

/* Cookie Banner Styling Container */
.mse-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e293b;
    color: #fff;
    padding: 20px;
    z-index: 10000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--primary);
    font-family: var(--font-base);
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mse-cookie-banner.show {
    transform: translateY(0);
}

.mse-cookie-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .mse-cookie-banner {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

.msendpoint-ad-box {
    margin: 30px 0;
    text-align: center;
    background: rgba(15, 23, 42, 0.8);
    padding: 20px;
    border: 1px dashed var(--primary);
    color: var(--text-muted);
    border-radius: 8px;
}