/* Dark Mode Modern - Custom Styles */

:root {
    --bg-primary: #121212;
    --bg-surface: #1E1E1E;
    --bg-surface-hover: #2A2A2A;
    --text-primary: #F5F5F5;
    --text-secondary: #A0A0A0;
    --accent: #2979FF;
    --accent-hover: #448AFF;
    --border: #2A2A2A;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Sticky nav backdrop blur */
nav {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-color: rgba(18, 18, 18, 0.85);
    border-bottom: 1px solid var(--border);
}

/* Nav link active state */
.nav-link.active {
    color: var(--accent);
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--accent);
    border-radius: 1px;
}

/* Nav link hover */
.nav-link {
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--accent);
}

/* Mobile menu */
#mobile-menu {
    border-top: 1px solid var(--border);
}

#mobile-menu .nav-link.active::after {
    display: none;
}

#mobile-menu .nav-link.active {
    border-left: 2px solid var(--accent);
    padding-left: 0.75rem;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    background-color: var(--bg-surface);
}

footer .admin-link {
    color: var(--text-secondary);
    opacity: 0.4;
    font-size: 0.75rem;
    transition: opacity 0.2s ease;
}

footer .admin-link:hover {
    opacity: 1;
    color: var(--accent);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Selection color */
::selection {
    background-color: var(--accent);
    color: var(--text-primary);
}

/* Line clamp utilities (Tailwind CDN may not include these) */
.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;
}

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

/* Masonry column break */
.break-inside-avoid {
    break-inside: avoid;
}

/* Form focus glow */
input:focus, textarea:focus {
    box-shadow: 0 0 0 1px var(--accent);
}

/* ------------------------------------------------------------------ */
/* Prose — rich text content rendered from Quill on blog single view   */
/* ------------------------------------------------------------------ */

.prose-custom h1 { font-size: 2rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.6em; }
.prose-custom h2 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-top: 1.6em; margin-bottom: 0.6em; }
.prose-custom h3 { font-size: 1.25rem; font-weight: 600; color: var(--text-primary); margin-top: 1.4em; margin-bottom: 0.5em; }
.prose-custom p  { margin-bottom: 1em; line-height: 1.8; }
.prose-custom a  { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose-custom a:hover { color: var(--accent-hover); }
.prose-custom strong { color: var(--text-primary); font-weight: 600; }
.prose-custom em { font-style: italic; }
.prose-custom s  { text-decoration: line-through; opacity: 0.7; }

.prose-custom ul,
.prose-custom ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.prose-custom ul { list-style-type: disc; }
.prose-custom ol { list-style-type: decimal; }
.prose-custom li { margin-bottom: 0.35em; line-height: 1.7; }

.prose-custom blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1em;
    margin: 1.5em 0;
    color: var(--text-secondary);
    font-style: italic;
}

.prose-custom pre {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1em;
    overflow-x: auto;
    margin: 1.5em 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--text-primary);
}

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

/* ------------------------------------------------------------------ */
/* Quill Editor — Dark Theme Overrides                                 */
/* ------------------------------------------------------------------ */

.quill-dark {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
}

/* Toolbar */
.quill-dark .ql-toolbar.ql-snow {
    background-color: var(--bg-surface);
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
}

.quill-dark .ql-toolbar .ql-stroke {
    stroke: var(--text-secondary);
}

.quill-dark .ql-toolbar .ql-fill {
    fill: var(--text-secondary);
}

.quill-dark .ql-toolbar .ql-picker-label {
    color: var(--text-secondary);
}

.quill-dark .ql-toolbar button:hover .ql-stroke,
.quill-dark .ql-toolbar .ql-picker-label:hover .ql-stroke {
    stroke: var(--accent);
}

.quill-dark .ql-toolbar button:hover .ql-fill,
.quill-dark .ql-toolbar .ql-picker-label:hover .ql-fill {
    fill: var(--accent);
}

.quill-dark .ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--accent);
}

.quill-dark .ql-toolbar button.ql-active .ql-fill {
    fill: var(--accent);
}

.quill-dark .ql-toolbar .ql-picker-label:hover,
.quill-dark .ql-toolbar .ql-picker-label.ql-active {
    color: var(--accent);
}

/* Picker dropdowns */
.quill-dark .ql-toolbar .ql-picker-options {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 4px 0;
}

.quill-dark .ql-toolbar .ql-picker-item {
    color: var(--text-secondary);
}

.quill-dark .ql-toolbar .ql-picker-item:hover {
    color: var(--accent);
}

/* Editor body */
.quill-dark .ql-container.ql-snow {
    background-color: var(--bg-primary);
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-primary);
    min-height: 280px;
}

.quill-dark .ql-editor {
    min-height: 280px;
    padding: 1.25rem;
    line-height: 1.7;
}

.quill-dark .ql-editor.ql-blank::before {
    color: rgba(160, 160, 160, 0.4);
    font-style: normal;
}

/* Editor content styles */
.quill-dark .ql-editor h1,
.quill-dark .ql-editor h2,
.quill-dark .ql-editor h3 {
    color: var(--text-primary);
    margin-bottom: 0.5em;
}

.quill-dark .ql-editor p {
    margin-bottom: 0.75em;
}

.quill-dark .ql-editor blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1em;
    color: var(--text-secondary);
}

.quill-dark .ql-editor pre.ql-syntax {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    padding: 1em;
}

.quill-dark .ql-editor a {
    color: var(--accent);
}

/* Tooltip (link editor) */
.ql-snow .ql-tooltip {
    background-color: var(--bg-surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.5rem !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
}

.ql-snow .ql-tooltip input[type="text"] {
    background-color: var(--bg-primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.375rem !important;
    color: var(--text-primary) !important;
    padding: 4px 8px !important;
}

.ql-snow .ql-tooltip a.ql-action,
.ql-snow .ql-tooltip a.ql-remove {
    color: var(--accent) !important;
}

/* ------------------------------------------------------------------ */
/* Dashboard table row hover                                            */
/* ------------------------------------------------------------------ */

#posts-tbody tr {
    transition: background-color 0.15s ease;
}

/* Custom toggle (peer utility for Tailwind CDN) */
.peer:checked ~ .peer-bg {
    background-color: var(--accent);
}
