/* HealthClasic Custom Styles */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Alpine.js cloaking */
[x-cloak] {
    display: none !important;
}

/* Line clamp utilities */
.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;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #10b981;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #059669;
}

/* Form focus improvements */
input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Animation utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Scroll offset for sticky header and TOC anchors */
.prose h2[id],
.prose h3[id] {
    scroll-margin-top: 90px;
}

/* ========================================
   Article / Prose Styles (Tailwind Typography fallback)
   ======================================== */
.prose {
    line-height: 1.75;
    color: #374151;
}
.dark .prose {
    color: #d1d5db;
}

/* Headings */
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    font-weight: 700;
    color: #111827;
    margin-top: 2em;
    margin-bottom: 0.8em;
    line-height: 1.3;
}
.dark .prose h1,
.dark .prose h2,
.dark .prose h3,
.dark .prose h4,
.dark .prose h5,
.dark .prose h6 {
    color: #f9fafb;
}

.prose h1 {
    font-size: 2.25rem;
}
.prose h2 {
    font-size: 1.75rem;
    padding-bottom: 0.3em;
    border-bottom: 2px solid #e5e7eb;
}
.dark .prose h2 {
    border-bottom-color: #374151;
}
.prose h3 {
    font-size: 1.4rem;
    color: #1f2937;
}
.prose h4 {
    font-size: 1.15rem;
}

/* Paragraphs */
.prose p {
    margin-bottom: 1.25em;
}

/* Links */
.prose a {
    color: #059669;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
}
.prose a:hover {
    color: #047857;
}
.dark .prose a {
    color: #34d399;
}
.dark .prose a:hover {
    color: #6ee7b7;
}

/* Lists */
.prose ul,
.prose ol {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.5em;
}
.prose ul {
    list-style-type: disc;
}
.prose ol {
    list-style-type: decimal;
}
.prose li {
    margin-bottom: 0.5em;
}
.prose li::marker {
    color: #059669;
}

/* Strong / Bold */
.prose strong {
    font-weight: 700;
    color: #111827;
}
.dark .prose strong {
    color: #f9fafb;
}

/* Images */
.prose img {
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 1.5em 0;
    max-width: 100%;
    height: auto;
}

/* Blockquotes */
.prose blockquote {
    border-left: 4px solid #10b981;
    background: #f0fdf4;
    padding: 1rem 1.5rem;
    margin: 1.5em 0;
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
    color: #065f46;
}
.dark .prose blockquote {
    background: #064e3b;
    color: #d1fae5;
}

/* Code */
.prose code {
    background: #f3f4f6;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
    color: #c7254e;
}
.dark .prose code {
    background: #1f2937;
    color: #fca5a5;
}
.prose pre {
    background: #1f2937;
    color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5em 0;
}
.prose pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: 0.875em;
}

/* Tables */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95em;
}
.prose th,
.prose td {
    border: 1px solid #e5e7eb;
    padding: 0.75em 1em;
    text-align: left;
}
.dark .prose th,
.dark .prose td {
    border-color: #374151;
}
.prose th {
    background: #f9fafb;
    font-weight: 600;
    color: #111827;
}
.dark .prose th {
    background: #1f2937;
    color: #f9fafb;
}
.prose tr:nth-child(even) {
    background: #f9fafb;
}
.dark .prose tr:nth-child(even) {
    background: #1f2937;
}

/* Horizontal Rule */
.prose hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 2em 0;
}

/* First element no top margin */
.prose > *:first-child {
    margin-top: 0;
}

/* Table of Contents styling inside article content */
.prose > div:has(> h3):has(> ul) {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 2rem;
}
.dark .prose > div:has(> h3):has(> ul) {
    background: #1f2937;
    border-color: #374151;
}
.prose > div:has(> h3):has(> ul) h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
    color: #111827;
}
.dark .prose > div:has(> h3):has(> ul) h3 {
    color: #f9fafb;
}
.prose > div:has(> h3):has(> ul) ul {
    margin: 0;
    padding-left: 1.25rem;
}
.prose > div:has(> h3):has(> ul) li {
    margin-bottom: 0.35rem;
}
.prose > div:has(> h3):has(> ul) a {
    color: #059669;
    text-decoration: none;
    font-weight: 500;
}
.prose > div:has(> h3):has(> ul) a:hover {
    text-decoration: underline;
}

/* Print styles */
@media print {
    header, footer, aside, .no-print {
        display: none !important;
    }
    main {
        margin: 0;
        padding: 0;
    }
}
