.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.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 {
    max-width: 65ch;
    color: #374151;
}

.prose h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #111827;
}

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

.prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #111827;
}

.prose p {
    margin-bottom: 1.25rem;
    line-height: 1.75;
}

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

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

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

.prose a {
    color: var(--cor-primaria);
    text-decoration: underline;
}

.prose a:hover {
    color: var(--cor-secundaria);
}

.prose blockquote {
    border-left: 4px solid var(--cor-primaria);
    padding-left: 1rem;
    font-style: italic;
    color: #6b7280;
    margin: 1.5rem 0;
}

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

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

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

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

.prose code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.prose pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.prose pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

.btn-primary {
    background-color: var(--cor-primaria);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.input-field {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--cor-primaria);
    box-shadow: 0 0 0 3px rgba(var(--cor-primaria-rgb), 0.1);
}

.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-hover:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

@media print {
    header,
    footer,
    nav,
    aside {
        display: none !important;
    }

    main {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .no-print {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

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

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

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top-color: var(--cor-primaria);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   Acessibilidade - Alto Contraste
   ========================================== */

html.high-contrast,
html.high-contrast body {
    background-color: #000 !important;
    color: #fff !important;
}

html.high-contrast a {
    color: #ff0 !important;
}

html.high-contrast a:hover {
    color: #fff !important;
    text-decoration: underline !important;
}

html.high-contrast header,
html.high-contrast nav,
html.high-contrast footer {
    background-color: #000 !important;
    border-color: #fff !important;
}

html.high-contrast .bg-white,
html.high-contrast .bg-gray-50,
html.high-contrast .bg-gray-100,
html.high-contrast .bg-gray-200 {
    background-color: #000 !important;
}

html.high-contrast .text-gray-500,
html.high-contrast .text-gray-600,
html.high-contrast .text-gray-700,
html.high-contrast .text-gray-800,
html.high-contrast .text-gray-900 {
    color: #fff !important;
}

html.high-contrast .border,
html.high-contrast .border-gray-200,
html.high-contrast .border-gray-300,
html.high-contrast [class*="border-"] {
    border-color: #fff !important;
}

html.high-contrast button,
html.high-contrast .btn-primary,
html.high-contrast .btn-secondary {
    background-color: #fff !important;
    color: #000 !important;
    border: 2px solid #fff !important;
}

html.high-contrast button:hover,
html.high-contrast .btn-primary:hover,
html.high-contrast .btn-secondary:hover {
    background-color: #ff0 !important;
    color: #000 !important;
}

html.high-contrast input,
html.high-contrast select,
html.high-contrast textarea {
    background-color: #000 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}

html.high-contrast input:focus,
html.high-contrast select:focus,
html.high-contrast textarea:focus {
    border-color: #ff0 !important;
    outline: 2px solid #ff0 !important;
}

html.high-contrast .card,
html.high-contrast .shadow,
html.high-contrast .shadow-sm,
html.high-contrast .shadow-lg,
html.high-contrast [class*="shadow"] {
    background-color: #000 !important;
    border: 2px solid #fff !important;
    box-shadow: none !important;
}

html.high-contrast img {
    filter: grayscale(100%) contrast(120%);
}

html.high-contrast .prose {
    color: #fff !important;
}

html.high-contrast .prose h1,
html.high-contrast .prose h2,
html.high-contrast .prose h3 {
    color: #fff !important;
}

html.high-contrast .prose a {
    color: #ff0 !important;
}

/* ==========================================
   Acessibilidade - Skip Link
   ========================================== */

.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 12px 24px;
    z-index: 9999;
    text-decoration: none;
    font-weight: bold;
    border-radius: 0 0 8px 8px;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid #ff0;
}
