/* ============================================================
   Blog CMS — Custom CSS
   Tailwind handles most styling; this file adds extras.
   ============================================================ */

/* ── Image Protection ──────────────────────────────────────── */
img {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
}

/* Overlay transparente sobre imagens para bloquear arrastar/salvar */
.img-protected {
    position: relative;
    overflow: hidden;
}
.img-protected::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background: transparent;
}
.img-protected img {
    pointer-events: none;
}

/* Desabilitar seleção de texto em imagens */
body {
    -webkit-touch-callout: none;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Typography for article content */
.prose h1, .prose h2, .prose h3, .prose h4 {
    font-weight: 700;
    line-height: 1.3;
    margin-top: 1.75em;
    margin-bottom: 0.75em;
    color: #111827;
}
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose p  { margin-bottom: 1.25em; color: #374151; line-height: 1.8; }
.prose ul, .prose ol { padding-left: 1.5em; margin-bottom: 1.25em; }
.prose li { margin-bottom: 0.4em; color: #374151; }
.prose blockquote {
    border-left: 4px solid #2563eb;
    padding: 0.75em 1.25em;
    background: #eff6ff;
    border-radius: 0 0.5rem 0.5rem 0;
    margin: 1.5em 0;
    font-style: italic;
    color: #1e40af;
}
.prose a { color: #2563eb; text-decoration: underline; }
.prose a:hover { color: #1d4ed8; }
.prose img { border-radius: 0.75rem; margin: 1.5em auto; }
.prose code {
    background: #f3f4f6;
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.875em;
    color: #dc2626;
}
.prose pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1.25em;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 1.5em 0;
}
.prose pre code { background: none; color: inherit; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.prose th, .prose td { border: 1px solid #e5e7eb; padding: 0.6em 1em; text-align: left; }
.prose th { background: #f9fafb; font-weight: 600; }
.prose hr { border: none; border-top: 2px solid #e5e7eb; margin: 2em 0; }

/* Line clamp utility */
.line-clamp-1 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.line-clamp-2 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.line-clamp-3 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* Sidebar link styles (used in admin) */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #d1d5db;
    transition: background-color 0.15s, color 0.15s;
}
.sidebar-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: #ffffff;
}
.sidebar-link.active {
    background-color: #2563eb;
    color: #ffffff;
}

/* Focus ring */
*:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Fade-in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }

/* Card hover effect */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* Image aspect ratio helper */
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video  { aspect-ratio: 16 / 9; }

/* Print styles */
@media print {
    header, footer, nav, .no-print { display: none !important; }
    body { background: white; }
    .prose { max-width: 100%; }
}
