/* ==========================================================================
   O Fiscal - Custom Styles (complement Tailwind CSS)
   ========================================================================== */

/* ==========================================================================
   CLASSES TAILWIND FALTANTES NO BUILD
   O Tailwind purge removeu estas classes porque são usadas apenas no
   conteúdo dinâmico (body de artigos no banco de dados), não nos templates
   Blade. Precisam estar definidas aqui manualmente.
   ========================================================================== */

/* ── Backgrounds ────────────────────────────────────────── */
.bg-red-600    { background-color: #dc2626; }
.bg-red-800    { background-color: #991b1b; }
.bg-red-900    { background-color: #7f1d1d; }
.bg-red-50     { background-color: #fef2f2; }
.bg-orange-600 { background-color: #ea580c; }
.bg-orange-700 { background-color: #c2410c; }
.bg-orange-800 { background-color: #9a3412; }
.bg-amber-500  { background-color: #f59e0b; }
.bg-amber-50   { background-color: #fffbeb; }
.bg-green-600  { background-color: #16a34a; }
.bg-green-700  { background-color: #15803d; }
.bg-green-800  { background-color: #166534; }
.bg-green-50   { background-color: #f0fdf4; }
.bg-green-950  { background-color: #052e16; }
.bg-blue-600   { background-color: #2563eb; }
.bg-blue-800   { background-color: #1e40af; }
.bg-blue-900   { background-color: #1e3a8a; }
.bg-blue-50    { background-color: #eff6ff; }
.bg-sky-50     { background-color: #f0f9ff; }
.bg-gray-800   { background-color: #1f2937; }
.bg-gray-900   { background-color: #111827; }

/* ── Text colors ────────────────────────────────────────── */
.text-black    { color: #000000; }

/* ── Borders ────────────────────────────────────────────── */
.border-green-600 { border-color: #16a34a; }
.border-blue-500  { border-color: #3b82f6; }
.border-red-600   { border-color: #dc2626; }

/* ── Dark mode overrides for article content boxes ──────── */
.dark .bg-green-50  { background-color: #052e16; }
.dark .bg-green-950 { background-color: #052e16; }
.dark .bg-amber-50  { background-color: #1c1917; }
.dark .bg-sky-50    { background-color: #0c1929; }
.dark .bg-red-50    { background-color: #1f0a0a; }
.dark .bg-blue-50   { background-color: #0c1929; }

/* ---------- Smooth Scrolling ---------- */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ==========================================================================
   Prose / Article Body
   ========================================================================== */

.prose p {
    margin-bottom: 1.25em;
    line-height: 1.8;
}

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

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

.prose blockquote {
    border-left: 4px solid #1d4ed8; /* blue-700 */
    padding: 0.75em 1.25em;
    margin: 1.5em 0;
    background-color: #eff6ff; /* blue-50 */
    color: #1e3a5f;
    font-style: italic;
    border-radius: 0 0.375rem 0.375rem 0;
}

.prose ul {
    list-style-type: disc;
    padding-left: 1.5em;
    margin-bottom: 1.25em;
}

.prose ol {
    list-style-type: decimal;
    padding-left: 1.5em;
    margin-bottom: 1.25em;
}

.prose li {
    margin-bottom: 0.35em;
    line-height: 1.7;
}

.prose img {
    border-radius: 0.5rem;
    margin: 1.5em auto;
    display: block;
    max-width: 100%;
    height: auto;
}

.prose figure {
    margin: 1.5em 0;
    text-align: center;
}

.prose figcaption,
.prose .image-caption {
    font-size: 0.85rem;
    color: #6b7280; /* gray-500 */
    margin-top: 0.5em;
    text-align: center;
    font-style: italic;
}

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

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

.prose hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2em 0;
}

/* ==========================================================================
   Breaking News Animation
   ========================================================================== */

.breaking-news-bar {
    overflow: hidden;
    background-color: #dc2626; /* red-600 */
    color: #fff;
    font-weight: 700;
    padding: 0.5rem 0;
    position: relative;
}

.breaking-news-bar .label {
    display: inline-block;
    background-color: #fff;
    color: #dc2626;
    padding: 0.15rem 0.75rem;
    margin-right: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.8rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.breaking-news-bar .ticker {
    display: inline-block;
    white-space: nowrap;
    animation: ticker-scroll 20s linear infinite;
}

@keyframes ticker-scroll {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.breaking-news-bar:hover .ticker {
    animation-play-state: paused;
}

/* Pulse dot next to breaking label */
.breaking-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #fff;
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.8); }
}

/* ==========================================================================
   Custom Scrollbar (Dark Mode)
   ========================================================================== */

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

.dark ::-webkit-scrollbar-track {
    background: #1f2937; /* gray-800 */
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563; /* gray-600 */
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280; /* gray-500 */
}

/* Firefox */
.dark * {
    scrollbar-color: #4b5563 #1f2937;
    scrollbar-width: thin;
}

/* ==========================================================================
   Print Stylesheet
   ========================================================================== */

@media print {
    /* Hide non-essential elements */
    header,
    footer,
    nav,
    aside,
    .no-print,
    .breaking-news-bar,
    .sidebar,
    .share-buttons,
    .comments-section,
    .related-articles {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.6;
        color: #000;
        background: #fff;
    }

    .prose {
        max-width: 100%;
    }

    .prose a {
        color: #000;
        text-decoration: underline;
    }

    .prose a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555;
    }

    .prose img {
        max-width: 100%;
        page-break-inside: avoid;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    /* Print header with site name */
    .article-header::before {
        content: "O Fiscal - ofiscal.jor.br";
        display: block;
        font-size: 10pt;
        color: #666;
        margin-bottom: 1em;
        border-bottom: 1px solid #ccc;
        padding-bottom: 0.5em;
    }
}
