:root {
    --primary: #DD5B5B;
    --primary-light: #f5a0a0;
    --accent-sky: #80DBFF;
    --accent-pink: #E971C8;
    --bg-grey: #f8fafc;
    --text-main: #1e293b;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: #ffffff;
    color: var(--text-main);
    scroll-behavior: smooth;
    line-height: 1.5;
}

h1, h2, h3, h4, .brand-font {
    font-family: 'Source Serif 4', serif;
    line-height: 1.15;
}

/* Secondary font for small labels, tags, footer */
.tag,
footer,
.font-secondary {
    font-family: 'Work Sans', sans-serif;
}

/* Hero title: style the <em> tag from config param */
.hero-title em {
    font-style: italic;
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: #fce9e9;
    text-underline-offset: 8px;
}

/* Skip to content (visible on focus for keyboard users) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.focus\:not-sr-only:focus {
    position: absolute;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

.nav-link {
    position: relative;
    cursor: pointer;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: #ffffff;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: #ffffff !important;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.card-hover {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(221, 91, 91, 0.08);
}

.prose p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: #64748b;
}

.prose h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.prose a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.prose img {
    border-radius: 1.5rem;
    margin: 2rem 0;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #fef5f5;
    color: var(--primary);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border-radius: 9999px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.tag:hover {
    background: #f9c4c4;
}

/* Leituras reference list */
.leituras-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leituras-list li {
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #475569;
}

.leituras-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.leituras-list li:first-child {
    padding-top: 0;
}

.leituras-list li strong {
    color: var(--text-main);
}

/* Disciplina content styling */
.disciplina-content ul {
    list-style: none;
    padding: 0;
}

.disciplina-content ul li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #475569;
}

.disciplina-content ul li:last-child {
    border-bottom: none;
}

.disciplina-content ul li strong {
    color: var(--text-main);
}

/* Mobile year navigation horizontal scroll */
.year-scroll-nav {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.year-scroll-nav::-webkit-scrollbar {
    display: none;
}

/* =============================
   Dark Mode (prefers-color-scheme)
   ============================= */
html.dark {
    --text-main: #e2e8f0;

    body {
        background-color: #0f172a !important;
        color: #e2e8f0 !important;
    }

    /* Headings */
    h1, h2, h3, h4, h5 {
        color: #f1f5f9 !important;
    }

    /* Nav stays as-is (already dark with primary color) */

    /* Main backgrounds */
    .bg-white { background-color: #1e293b !important; }
    .bg-slate-50 { background-color: #0f172a !important; }
    .bg-purple-50 { background-color: rgba(221, 91, 91, 0.15) !important; }
    .bg-indigo-50 { background-color: rgba(128, 219, 255, 0.15) !important; }
    .bg-emerald-50 { background-color: rgba(233, 113, 200, 0.15) !important; }

    /* Borders */
    .border-slate-100 { border-color: #334155 !important; }
    .border-slate-200 { border-color: #334155 !important; }
    .border-y { border-color: #334155 !important; }
    .divide-slate-100 > :not([hidden]) ~ :not([hidden]) {
        border-color: #334155 !important;
    }

    /* Text */
    .text-slate-900 { color: #f1f5f9 !important; }
    .text-slate-600 { color: #94a3b8 !important; }
    .text-slate-500 { color: #94a3b8 !important; }
    .text-slate-400 { color: #64748b !important; }
    .text-slate-300 { color: #475569 !important; }
    .text-slate-200 { color: #334155 !important; }

    /* Cards */
    .card-hover:hover {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    }

    /* Hero blobs */
    .blur-3xl {
        opacity: 0.15 !important;
    }

    /* Prose / article content */
    .prose p { color: #94a3b8; }
    .prose h2 { color: #f1f5f9; }
    .prose a { color: #f5a0a0; }

    /* Tags */
    .tag {
        background: rgba(221, 91, 91, 0.2);
        color: #f5a0a0;
    }
    .tag:hover {
        background: rgba(221, 91, 91, 0.35);
    }

    /* Leituras list */
    .leituras-list li {
        border-bottom-color: #334155;
        color: #94a3b8;
    }
    .leituras-list li strong {
        color: #f1f5f9;
    }

    /* Scrollbar */
    ::-webkit-scrollbar-thumb { background: #334155; }

    /* Selection */
    ::selection {
        background: rgba(221, 91, 91, 0.4) !important;
        color: #f1f5f9 !important;
    }

    /* Hero title em */
    .hero-title em {
        color: #f5a0a0;
        text-decoration-color: rgba(221, 91, 91, 0.3);
    }

    /* Stats numbers */
    .border-y.border-slate-100 {
        border-color: #334155 !important;
    }
}
