/**
 * ============================================
 * SchoolWeb CMS - Custom Styles
 * ============================================
 */

/* ========================================
   Base Styles
   ======================================== */

/* Line Clamp Utility */
.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 Styles for Article Content
   ======================================== */
.prose {
    color: #374151;
    max-width: 65ch;
    font-size: 1.125rem;
    line-height: 1.75;
}

.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
}

.prose h2 {
    color: #1e293b;
    font-weight: 700;
    font-size: 1.5em;
    margin-top: 2em;
    margin-bottom: 1em;
    line-height: 1.3333333;
}

.prose h3 {
    color: #1e293b;
    font-weight: 600;
    font-size: 1.25em;
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    line-height: 1.6;
}

.prose a {
    color: #4f46e5;
    text-decoration: underline;
    font-weight: 500;
}

.prose a:hover {
    color: #4338ca;
}

.prose strong {
    color: #1e293b;
    font-weight: 600;
}

.prose ul,
.prose ol {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.625em;
}

.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.prose ul>li {
    padding-left: 0.375em;
}

.prose ul>li::marker {
    color: #6b7280;
}

.prose ol>li::marker {
    color: #6b7280;
    font-weight: 400;
}

.prose blockquote {
    font-style: italic;
    color: #1e293b;
    border-left-width: 4px;
    border-left-color: #e5e7eb;
    padding-left: 1em;
    margin-top: 1.6em;
    margin-bottom: 1.6em;
}

.prose img {
    margin-top: 2em;
    margin-bottom: 2em;
    border-radius: 0.5rem;
}

.prose pre {
    background-color: #1e293b;
    color: #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    font-size: 0.875em;
    margin-top: 1.7142857em;
    margin-bottom: 1.7142857em;
}

.prose code {
    background-color: #f1f5f9;
    color: #1e293b;
    padding: 0.25rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-weight: 500;
}

.prose pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-weight: 400;
}

.prose table {
    width: 100%;
    table-layout: auto;
    text-align: left;
    margin-top: 2em;
    margin-bottom: 2em;
    font-size: 0.875em;
    line-height: 1.7142857;
    /* Allow user's inline styles to take precedence */
    border-collapse: collapse;
}

/* Responsive table wrapper - tables will scroll horizontally on mobile */
.prose .table-responsive,
.prose table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
    .prose table {
        display: table;
        overflow-x: visible;
    }
}

/* Only apply minimal styling if user hasn't set inline styles */
.prose thead {
    border-bottom-width: 1px;
    border-bottom-color: #e5e7eb;
}

.prose thead th {
    font-weight: 600;
    padding: 0.5714286em;
    vertical-align: bottom;
}

.prose tbody tr {
    border-bottom-width: 1px;
    border-bottom-color: #e5e7eb;
}

.prose tbody td,
.prose tbody th {
    padding: 0.5714286em;
    vertical-align: top;
}

/* Support for user-styled tables with borders */
.prose table[border],
.prose table.table-bordered {
    border: inherit;
}

.prose table[border] td,
.prose table[border] th,
.prose .table-bordered td,
.prose .table-bordered th {
    border: inherit;
    padding: 0.75em;
}

/* ========================================
   Animation Classes
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slideUp 0.4s ease-out;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* ========================================
   Custom Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================
   Focus Styles
   ======================================== */
*:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* ========================================
   Form Styles
   ======================================== */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {

    nav,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    .prose {
        max-width: none;
    }
}