/* =====================================================
   Veritas Logic & Computation - Professional Theme
   garciacode.com
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Source+Sans+3:wght@400;600;700&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    color: #e8e6e3;
    background-color: #111827 !important;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(59, 47, 30, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(30, 41, 59, 0.5) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0v60M60 30H0' stroke='%23ffffff' stroke-width='0.3' opacity='0.03'/%3E%3C/svg%3E") !important;
    background-attachment: fixed !important;
    min-height: 100vh;
    padding: 0 0 60px;
}

/* Decorative top accent bar */
body::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, #b8860b, #d4a843, #b8860b, #8b6914, #b8860b);
    background-size: 200% 100%;
    animation: shimmer 8s linear infinite;
}

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

/* ===== LAYOUT CONTAINER ===== */
body > h1:first-of-type,
body > p,
body > div {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* ===== HEADER / BANNER ===== */
h1 {
    font-family: 'Libre Baskerville', 'Georgia', serif;
    font-size: 1.85rem;
    color: #f0ead6 !important;
    letter-spacing: 0.03em;
    line-height: 1.3;
    max-width: 900px;
    margin: 0 auto 0;
    padding: 32px 24px 24px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient(180deg, rgba(30, 27, 20, 0.6) 0%, transparent 100%);
    border-bottom: 1px solid rgba(184, 134, 11, 0.3);
    position: relative;
}

/* Subtle gold glow under header */
h1::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: radial-gradient(ellipse, rgba(184, 134, 11, 0.5), transparent);
}

/* Crest / logo inside h1 */
h1 div {
    float: none !important;
    position: static !important;
    flex-shrink: 0;
    order: 2;
    display: flex;
    align-items: center;
}

h1 img {
    width: 80px !important;
    height: auto !important;
    border-radius: 0;
    filter: brightness(0.9) drop-shadow(0 2px 8px rgba(184, 134, 11, 0.25));
    transition: filter 0.3s ease, transform 0.3s ease;
}

h1 img:hover {
    filter: brightness(1) drop-shadow(0 4px 12px rgba(184, 134, 11, 0.4));
    transform: scale(1.05);
}

/* ===== GENERAL HEADINGS ===== */
h2, h3, h4, h5, h6 {
    font-family: 'Libre Baskerville', 'Georgia', serif;
    line-height: 1.3;
    margin-bottom: 0.5em;
    color: #d4c5a0 !important;
}

h2 {
    font-size: 1.5rem;
    margin-top: 2em;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(184, 134, 11, 0.15);
}

h3 {
    font-size: 1.25rem;
    color: #c4b48a !important;
}

/* ===== PARAGRAPHS ===== */
p {
    color: #d1cdc4 !important;
    font-size: 1.05rem !important;
    line-height: 1.85;
    margin-bottom: 1.25em;
    max-width: 900px;
}

/* Sections with assignment lists - give them card-like styling */
p + p {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 1.5em;
    backdrop-filter: blur(2px);
}

/* ===== LINKS ===== */
a {
    color: #7eb8da !important;
    text-decoration: none;
    border-bottom: 1px solid rgba(126, 184, 218, 0.25);
    transition: color 0.2s ease, border-bottom-color 0.2s ease, background 0.2s ease;
    padding-bottom: 1px;
}

a:hover {
    color: #b8d8f0 !important;
    border-bottom-color: #b8d8f0;
    background: rgba(126, 184, 218, 0.08);
    border-radius: 2px;
}

a:visited {
    color: #a699c9 !important;
    border-bottom-color: rgba(166, 153, 201, 0.25);
}

a[href^="mailto:"] {
    color: #d4a843 !important;
    border-bottom-color: rgba(212, 168, 67, 0.3);
}

a[href^="mailto:"]:hover {
    color: #e8c36a !important;
    border-bottom-color: #e8c36a;
    background: rgba(212, 168, 67, 0.08);
}

/* ===== CODE / MONOSPACE BLOCKS ===== */
div[style*="monospace"],
pre,
code,
.niceFormat {
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', 'Monaco', monospace !important;
    background: #0d1117 !important;
    color: #c9d1d9 !important;
    border: 1px solid rgba(48, 54, 61, 0.8);
    border-radius: 10px;
    padding: 24px 28px !important;
    margin: 20px auto;
    max-width: 900px;
    overflow-x: auto;
    font-size: 0.9rem !important;
    line-height: 1.65 !important;
    tab-size: 4;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    position: relative;
}

/* Subtle top-left accent on code blocks */
div[style*="monospace"]::before,
pre::before,
.niceFormat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #b8860b, transparent);
    border-radius: 10px 0 0 10px;
}

/* ===== IMAGES ===== */
img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Centered image containers */
div[style*="text-align: center"] {
    margin: 32px auto !important;
}

div[style*="text-align: center"] img {
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

div[style*="text-align: center"] img:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ===== SELECTION ===== */
::selection {
    background: rgba(184, 134, 11, 0.35);
    color: #ffffff;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 5px;
    border: 2px solid #0f172a;
}

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

/* ===== OVERRIDE INLINE background-color: black ===== */
body[style*="background-color: black"] {
    background-color: #111827 !important;
}

/* ===== FOOTER-LIKE BOTTOM AREA ===== */
body::after {
    content: '';
    display: block;
    max-width: 200px;
    height: 1px;
    margin: 60px auto 0;
    background: linear-gradient(90deg, transparent, rgba(184, 134, 11, 0.4), transparent);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    body {
        padding: 0 0 40px;
    }

    body > h1:first-of-type,
    body > p,
    body > div {
        padding-left: 16px;
        padding-right: 16px;
    }

    h1 {
        font-size: 1.35rem;
        padding: 20px 16px 18px !important;
        flex-direction: column-reverse;
        text-align: center;
        gap: 12px;
    }

    h1 div {
        justify-content: center;
    }

    h1 img {
        width: 64px !important;
    }

    p {
        font-size: 0.95rem !important;
    }

    p + p {
        padding: 16px 18px;
    }

    div[style*="monospace"],
    .niceFormat {
        font-size: 0.8rem !important;
        padding: 14px 16px !important;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.15rem;
    }
}

/* ===== PRINT ===== */
@media print {
    body {
        background: white !important;
        background-image: none !important;
        color: black !important;
        padding: 0;
    }

    body::before, body::after {
        display: none;
    }

    h1, h2, h3, h4, h5, h6 {
        color: black !important;
    }

    h1 {
        border-bottom: 2px solid #333;
        background: none;
    }

    p {
        color: #333 !important;
    }

    p + p {
        background: none;
        border: none;
        padding: 0;
    }

    a {
        color: #0066cc !important;
    }

    div[style*="monospace"],
    .niceFormat {
        background: #f5f5f5 !important;
        color: #333 !important;
        border: 1px solid #ccc;
        box-shadow: none;
    }

    div[style*="monospace"]::before,
    .niceFormat::before {
        display: none;
    }
}
