@tailwind base;
@tailwind components;
@tailwind utilities;

/* === TYPOGRAPHY SYSTEM === */

/* Base Settings */
body {
    font-family: 'Inter', sans-serif;
    color: #334155; /* Slate 700 - Softer than black */
    line-height: 1.6; /* Ample breathing room */
    -webkit-font-smoothing: antialiased;
}

/* Headings: The "Legal Authority" Voice */
h1, h2, h3, h4, h5, h6, .serif-header {
    font-family: 'Merriweather', serif;
    color: #0f172a; /* Slate 900 - Sharp and authoritative */
    line-height: 1.3;
    font-weight: 700;
}

/* Subtitles / Lead Text */
.lead {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #475569;
}

/* === LEGAL PROSE UTILITY === */
/* Applied to Terms, Disclaimers, and SEO Content */
.prose-legal, .seo-content {
    max-width: 65ch; 
    margin-left: auto;
    margin-right: auto;
    font-size: 1rem;
    line-height: 1.75; 
}

.prose-legal p, .seo-content p { margin-bottom: 1.5em; }

.prose-legal h2, .seo-content h2 {
    font-size: 1.5rem;
    margin-top: 2em;
    margin-bottom: 0.75em;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.25em;
    font-family: 'Merriweather', serif; /* Ensure serif */
    color: #0f172a;
}

.prose-legal h3, .seo-content h3 { 
    font-size: 1.25rem; 
    margin-top: 1.5em; 
    margin-bottom: 0.5em; 
    font-family: 'Merriweather', serif;
    color: #0f172a;
}

.prose-legal ul, .seo-content ul { list-style-type: disc; padding-left: 1.5em; margin-bottom: 1.5em; }
.prose-legal li, .seo-content li { margin-bottom: 0.5em; }
.prose-legal strong, .seo-content strong { color: #0f172a; font-weight: 600; }

.prose-legal a, .seo-content a {
    color: #0f172a;
    text-decoration: underline;
    text-decoration-color: #cbd5e1;
    text-underline-offset: 3px;
    transition: all 0.2s;
}
.prose-legal a:hover, .seo-content a:hover {
    text-decoration-color: #0f172a;
    background-color: #f1f5f9;
}

.prose-button, a.prose-button:hover {
    color: #f1f5f9 !important;
    background-color: rgb(30 41 59 / var(--tw-bg-opacity, 1));
    text-decoration: none !important;
    transition: all 0.2s;
}

/* === UI COMPONENTS === */
.custom-scroll::-webkit-scrollbar { width: 6px; }
.custom-scroll::-webkit-scrollbar-track { background: #f1f5f9; }
.custom-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* === MOBILE AGENDA VIEW === */
@media (max-width: 640px) {
    .calendar-grid-header {
        display: none !important;
    }
    
    .calendar-grid-body {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .calendar-day-cell {
        min-height: auto !important;
        height: auto !important;
        flex-direction: row !important;
        align-items: center;
        padding: 0.75rem !important;
        border-radius: 0.5rem !important;
        border: 1px solid rgba(0,0,0,0.05);
    }
    
    .calendar-day-number {
        position: static !important;
        width: 30px;
        font-size: 1rem !important;
        font-weight: bold;
        opacity: 0.7 !important;
    }
    
    .calendar-day-content {
        flex-grow: 1;
        text-align: left !important;
        padding-left: 1rem;
    }
    
    .calendar-day-weekday {
        display: inline-block;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: rgba(255,255,255,0.7);
        margin-right: 0.5rem;
    }
    
    /* Ensure colors persist */
    .bg-slate-800 { background-color: #1e293b; color: white; }
    .bg-emerald-600 { background-color: #059669; color: white; }
}

/* === PRINT OPTIMIZATION (COURT READY) === */
@media print {
    @page {
        margin: 1.5cm;
    }

    body {
        background: white;
        color: black;
        font-size: 11pt; /* Standard legal font size */
        font-family: 'Merriweather', serif; /* Force serif for print */
    }
    
    /* Ensure Header Fonts */
    h1, h2, h3, .serif-header {
        font-family: 'Merriweather', serif !important;
        color: black !important;
    }

    /* Hide Web Elements */
    .no-print {
        display: none !important;
    }
    
    /* Exact Color Reproduction */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Container Reset for Page Width */
    #calendar-container {
        /*border: 2px solid #000; *//* Formal border */
        box-shadow: none;
        break-inside: avoid;
        width: 100%;
        margin-top: 20px;
    }
    
    .min-h-\[100px\] {
        min-height: 70px !important; /* Compact rows to fit month on 1 page */
    }

    /* Remove interactive borders/hovers */
    .hover\:brightness-110:hover {
        filter: none !important;
    }
}

/* === INTERACTION POLISH === */
#calendar-container .group:hover {
    z-index: 10;
}