/* Custom styles that supplement Tailwind CDN */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* Hero gradient overlay */
.hero-gradient {
    background: linear-gradient(135deg, rgba(15,23,42,0.95) 0%, rgba(30,58,138,0.85) 50%, rgba(37,99,235,0.75) 100%);
}

/* Category badge */
.cat-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
}

/* Card hover effect */
.news-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

/* Ticker */
@keyframes ticker {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.ticker-wrap {
    overflow: hidden;
    white-space: nowrap;
}
.ticker-content {
    display: inline-block;
    animation: ticker 30s linear infinite;
}
.ticker-content:hover { animation-play-state: paused; }

/* Mobile nav overlay */
.mobile-nav-overlay {
    transition: opacity 0.3s ease;
}
.mobile-nav-panel {
    transition: transform 0.3s ease;
}

/* TipTap editor styles */
.tiptap-editor {
    min-height: 400px;
    outline: none;
}
.tiptap-editor:focus {
    outline: none;
}
.tiptap-editor p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    float: left;
    color: #94a3b8;
    pointer-events: none;
    height: 0;
}
.tiptap-editor h1 { font-size: 2em; font-weight: 700; margin: 0.67em 0; }
.tiptap-editor h2 { font-size: 1.5em; font-weight: 700; margin: 0.75em 0; }
.tiptap-editor h3 { font-size: 1.25em; font-weight: 600; margin: 0.75em 0; }
.tiptap-editor ul { list-style: disc; padding-left: 1.5em; margin: 0.5em 0; }
.tiptap-editor ol { list-style: decimal; padding-left: 1.5em; margin: 0.5em 0; }
.tiptap-editor blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1em;
    margin: 1em 0;
    color: #475569;
    font-style: italic;
}
.tiptap-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0;
}
.tiptap-editor a { color: #2563eb; text-decoration: underline; }
.tiptap-editor pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
}
.tiptap-editor code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.tiptap-editor pre code {
    background: none;
    padding: 0;
}
.tiptap-editor table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}
.tiptap-editor td, .tiptap-editor th {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    text-align: left;
}
.tiptap-editor th {
    background: #f8fafc;
    font-weight: 600;
}

/* Admin sidebar */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}
.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}
.sidebar-link.active {
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.sidebar-link.active i, .sidebar-link.active svg {
    color: #ffffff;
}

/* Toolbar button for TipTap */
.toolbar-btn {
    padding: 6px 8px;
    border-radius: 6px;
    color: #475569;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.toolbar-btn:hover { background: #f1f5f9; color: #1e293b; }
.toolbar-btn.is-active { background: #dbeafe; color: #2563eb; }

/* Loading spinner */
.spinner {
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    transform: translateX(120%);
    transition: transform 0.3s ease;
}
.toast.show { transform: translateX(0); }
.toast-success { background: #22c55e; color: white; }
.toast-error { background: #ef4444; color: white; }

/* ==========================================================================
   FRONT-END POST PRESENTATION TYPOGRAPHY (.tiptap-content)
   Optimized UX for Editorial Articles, Headings, Subheadings & Nested Lists
   ========================================================================== */

.tiptap-content {
    font-size: 1.125rem; /* 18px */
    line-height: 1.85;
    color: #334155; /* slate-700 */
    word-break: break-word;
}

/* Paragraphs */
.tiptap-content p {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    line-height: 1.85;
    color: #334155;
}
.tiptap-content p:first-child {
    margin-top: 0;
}

/* Headings & Subheadings */
.tiptap-content h1,
.tiptap-content h2,
.tiptap-content h3,
.tiptap-content h4,
.tiptap-content h5,
.tiptap-content h6 {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #0f172a; /* slate-900 */
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.02em;
    scroll-margin-top: 5rem;
}

.tiptap-content h1 {
    font-size: 2.25rem; /* 36px */
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    font-weight: 800;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 0.5rem;
}

.tiptap-content h2 {
    font-size: 1.75rem; /* 28px */
    margin-top: 2.25rem;
    margin-bottom: 1rem;
    font-weight: 700;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.4rem;
}

.tiptap-content h3 {
    font-size: 1.375rem; /* 22px */
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: #1e293b;
}

.tiptap-content h4 {
    font-size: 1.15rem; /* 18.4px */
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: #334155;
}

/* Lists: Bullet Lists & Nested Sub-bullets */
.tiptap-content ul {
    list-style-type: disc !important;
    padding-left: 1.75rem !important;
    margin-top: 1.25rem !important;
    margin-bottom: 1.5rem !important;
}

.tiptap-content ul > li {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    padding-left: 0.25rem;
    line-height: 1.75;
    color: #334155;
}

.tiptap-content ul > li::marker {
    color: #2563eb; /* blue-600 */
    font-size: 1.15em;
}

/* Sub-bullets (Level 2 Nested) */
.tiptap-content ul ul,
.tiptap-content ol ul {
    list-style-type: circle !important;
    padding-left: 1.75rem !important;
    margin-top: 0.4rem !important;
    margin-bottom: 0.4rem !important;
}

.tiptap-content ul ul > li::marker,
.tiptap-content ol ul > li::marker {
    color: #3b82f6; /* blue-500 */
}

/* Sub-sub-bullets (Level 3 Nested) */
.tiptap-content ul ul ul,
.tiptap-content ol ul ul,
.tiptap-content ul ol ul {
    list-style-type: square !important;
    padding-left: 1.75rem !important;
    margin-top: 0.35rem !important;
    margin-bottom: 0.35rem !important;
}

.tiptap-content ul ul ul > li::marker {
    color: #64748b; /* slate-500 */
}

/* Ordered / Numbered Lists */
.tiptap-content ol {
    list-style-type: decimal !important;
    padding-left: 1.75rem !important;
    margin-top: 1.25rem !important;
    margin-bottom: 1.5rem !important;
}

.tiptap-content ol > li {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    padding-left: 0.25rem;
    line-height: 1.75;
    color: #334155;
}

.tiptap-content ol > li::marker {
    font-weight: 700;
    color: #2563eb;
}

/* Sub-numbered lists */
.tiptap-content ol ol {
    list-style-type: lower-alpha !important;
    padding-left: 1.75rem !important;
    margin-top: 0.4rem !important;
    margin-bottom: 0.4rem !important;
}

.tiptap-content ol ol ol {
    list-style-type: lower-roman !important;
    padding-left: 1.75rem !important;
    margin-top: 0.35rem !important;
    margin-bottom: 0.35rem !important;
}

/* Blockquotes / Pull Quotes */
.tiptap-content blockquote {
    border-left: 4px solid #2563eb;
    background: #f8fafc;
    padding: 1.25rem 1.75rem;
    margin: 2rem 0;
    border-radius: 0 1rem 1rem 0;
    font-style: italic;
    color: #1e293b;
    font-size: 1.15rem;
    line-height: 1.8;
}
.tiptap-content blockquote p {
    margin: 0;
    color: #1e293b;
    font-style: italic;
}

/* Links */
.tiptap-content a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
    transition: color 0.15s ease;
}
.tiptap-content a:hover {
    color: #1d4ed8;
    text-decoration-thickness: 2px;
}

/* Images & Media */
.tiptap-content img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
}

/* Code & Preformatted */
.tiptap-content code {
    background: #f1f5f9;
    color: #0f172a;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.88em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    border: 1px solid #e2e8f0;
}

.tiptap-content pre {
    background: #0f172a;
    color: #f8fafc;
    padding: 1.25rem 1.5rem;
    border-radius: 0.875rem;
    overflow-x: auto;
    margin: 1.75rem 0;
    font-size: 0.925rem;
    line-height: 1.7;
    border: 1px solid #1e293b;
}

.tiptap-content pre code {
    background: transparent;
    padding: 0;
    border: none;
    color: inherit;
    font-size: inherit;
}

/* Tables */
.tiptap-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    font-size: 0.95rem;
}

.tiptap-content th {
    background: #f1f5f9;
    padding: 0.875rem 1rem;
    font-weight: 700;
    text-align: left;
    border-bottom: 2px solid #cbd5e1;
    color: #0f172a;
}

.tiptap-content td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.tiptap-content tr:nth-child(even) td {
    background: #f8fafc;
}

/* Horizontal Rule / Divider */
.tiptap-content hr {
    border: 0;
    border-top: 2px solid #f1f5f9;
    margin: 2.5rem 0;
}

