/**
 * ═══════════════════════════════════════════════════════
 * CalculaBrasil — Custom CSS
 * ═══════════════════════════════════════════════════════
 */

/* ─── Reset / Base ──────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Scrollbar Customizada ─────────────────────────── */

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ─── Hide Scrollbar (nav horizontal) ───────────────── */

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

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

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

/* ─── Prose (conteúdo editorial) ────────────────────── */

.prose {
    line-height: 1.75;
    color: #374151;
}

.prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.prose p {
    margin-bottom: 1rem;
}

.prose ul, .prose ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose li {
    margin-bottom: 0.375rem;
}

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

.prose a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose a:hover {
    color: #1d4ed8;
}

.prose blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6b7280;
}

.prose code {
    background: #f1f5f9;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-family: 'Fira Code', 'Cascadia Code', monospace;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.prose th, .prose td {
    border: 1px solid #e5e7eb;
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-size: 0.875rem;
}

.prose th {
    background: #f9fafb;
    font-weight: 600;
}

.prose tr:hover {
    background: #f9fafb;
}

/* ─── Animações ─────────────────────────────────────── */

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

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

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

.animate-slide-up {
    animation: slideUp 0.4s ease-out forwards;
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.7; }
}

.animate-pulse-soft {
    animation: pulse-soft 2s ease-in-out infinite;
}

/* ─── Focus Visible ─────────────────────────────────── */

*:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ─── Inputs ────────────────────────────────────────── */

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

input::placeholder {
    color: #9ca3af;
}

/* ─── Print ─────────────────────────────────────────── */

@media print {
    header, footer, nav,
    .no-print,
    .adsbygoogle,
    [x-data*="cookie"] {
        display: none !important;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    a {
        color: black;
        text-decoration: none;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* ─── Dark Mode (base — Tailwind cuida do resto) ───── */

.dark body {
    background-color: #0f172a;
    color: #e2e8f0;
}

.dark .prose {
    color: #cbd5e1;
}

.dark .prose h2,
.dark .prose h3 {
    color: #f1f5f9;
}

.dark .prose strong {
    color: #f1f5f9;
}

.dark .prose code {
    background: #1e293b;
    color: #e2e8f0;
}

.dark .prose th {
    background: #1e293b;
}

.dark .prose th,
.dark .prose td {
    border-color: #334155;
}

/* ─── Utilidades ────────────────────────────────────── */

.text-balance {
    text-wrap: balance;
}

.gradient-text {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── AdSense placeholder fix ───────────────────────── */

.adsbygoogle {
    display: block;
    min-height: 50px;
}

ins.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
}