/* ============================================
   RhondaJ Creative Hub — Brand Styles
   Primary:    #3D5A3E  (deep forest green)
   Accent:     #C49A3C  (warm gold)
   Sage light: #D8DECB
   Sage dark:  #85954F
   Cream:      #F5F0E8
   ============================================ */

/* --- Prose / rich text --- */
.prose p { margin-bottom: 1em; }
.prose h2 { font-size: 1.25rem; font-weight: 700; margin: 1.5em 0 0.5em; color: #3D5A3E; }
.prose h3 { font-size: 1.1rem; font-weight: 600; margin: 1.25em 0 0.4em; color: #3D5A3E; }
.prose ul { list-style: disc; padding-left: 1.5em; margin-bottom: 1em; }
.prose ol { list-style: decimal; padding-left: 1.5em; margin-bottom: 1em; }
.prose a { color: #3D5A3E; text-decoration: underline; }
.prose code { background: #f3f4f6; padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.875em; }

/* --- Line clamp --- */
.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; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D8DECB; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #85954F; }

/* --- Like button --- */
.like-btn.liked svg { fill: #ef4444; stroke: #ef4444; }
.like-btn.liked { color: #ef4444; }

/* --- Tier badges --- */
.badge-free  { background: #f3f4f6; color: #6b7280; }
.badge-basic { background: #D8DECB; color: #3D5A3E; }
.badge-pro   { background: #3D5A3E; color: #fff; }

/* --- Gold accent elements --- */
.gold-text { color: #C49A3C; }
.gold-bg   { background: #C49A3C; }
.gold-border { border-color: #C49A3C; }

/* --- Cream background for guest pages --- */
.bg-cream { background-color: #F5F0E8; }

/* --- Primary color utilities (forest green #3D5A3E) --- */
.bg-primary         { background-color: #3D5A3E; }
.bg-primary:hover   { background-color: #2e4430; }
.text-primary       { color: #3D5A3E; }
.border-primary     { border-color: #3D5A3E; }
.ring-primary       { --tw-ring-color: #3D5A3E; }
.focus\:ring-primary:focus { --tw-ring-color: #3D5A3E; }
.hover\:bg-primary:hover   { background-color: #3D5A3E; }
.hover\:text-primary:hover { color: #3D5A3E; }

/* --- Sidebar font size --- */
.main-sidebar, .main-sidebar * { font-size: 0.8125rem; }
.right-sidebar-desktop, .right-sidebar-desktop * { font-size: 0.8125rem; }
.right-sidebar-mobile, .right-sidebar-mobile * { font-size: 0.8125rem; }

/* --- Rich text post content (Quill output) --- */
.ql-content { font-size: 1.0625rem; line-height: 1.8; color: #374151; font-family: 'Poppins', sans-serif; }
.ql-content p { margin-bottom: 0.6em; }
.ql-content p:last-child { margin-bottom: 0; }
.ql-content ul { list-style: disc; padding-left: 1.5em; margin-bottom: 0.75em; }
.ql-content ol { list-style: decimal; padding-left: 1.5em; margin-bottom: 0.75em; }
.ql-content li { margin-bottom: 0.2em; }
.ql-content strong { font-weight: 600; }
.ql-content em { font-style: italic; }
.ql-content u { text-decoration: underline; }
.ql-content s { text-decoration: line-through; }
.ql-content a { color: #3D5A3E; text-decoration: underline; }
.ql-content h1 { font-size: 1.4rem; font-weight: 700; margin: 0.75em 0 0.3em; }
.ql-content h2 { font-size: 1.2rem; font-weight: 700; margin: 0.75em 0 0.3em; }
.ql-content h3 { font-size: 1.05rem; font-weight: 600; margin: 0.5em 0 0.2em; }
.ql-content blockquote { border-left: 3px solid #D8DECB; padding-left: 1em; color: #6b7280; font-style: italic; margin: 0.75em 0; }
.ql-content pre { background: #f3f4f6; padding: 0.75em 1em; border-radius: 6px; font-size: 0.875em; overflow-x: auto; margin: 0.75em 0; }

/* --- Post title size --- */
.post-title { font-size: 1.1rem; font-weight: 700; line-height: 1.3; color: #3D5A3E; font-family: 'Poppins', sans-serif; }


/* --- Feed cards (list layout: home feed + space feeds) ---
   --sc is the space color, set inline on each card. */
.feed-list { display: flex; flex-direction: column; gap: 1.5rem; }
.feed-card {
    background: #fff;
    border: 1px solid #D8DECB;
    border-left: 4px solid var(--sc, #85954F);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(61,90,62,0.05), 0 6px 16px -10px rgba(61,90,62,0.25);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.feed-card:hover {
    border-color: #85954F;
    border-left-color: var(--sc, #85954F);
    box-shadow: 0 2px 4px rgba(61,90,62,0.06), 0 12px 26px -12px rgba(61,90,62,0.35);
}
.feed-card.is-pinned { background: #FFFDF7; border-color: #E9CF8E; border-left-color: #C49A3C; }
.feed-card-body { padding: 1.25rem 1.5rem 1rem; }
.feed-card-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.35;
    color: #3D5A3E;
    margin: 0.15rem 0 0.5rem;
    transition: color .15s ease;
}
.feed-card:hover .feed-card-title { color: #2e4430; }
.feed-card .feed-card-preview { font-size: 0.95rem; line-height: 1.7; color: #4b5563; }
.feed-card .feed-card-preview.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feed-read-more { display: inline-block; margin-top: 0.35rem; font-size: 0.8rem; font-weight: 500; color: #3D5A3E; }
.feed-space-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 10px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 500; line-height: 1.5;
    background: #EEF1E6;
    background: color-mix(in srgb, var(--sc, #85954F) 14%, #fff);
    color: #3D5A3E;
}
.feed-space-pill::before { content: ''; width: 7px; height: 7px; border-radius: 999px; background: var(--sc, #85954F); flex-shrink: 0; }
.feed-card-media { padding: 0 1.5rem 1rem; }
.feed-card-footer {
    display: flex; align-items: center; gap: 1.25rem;
    padding: 0.65rem 1.5rem;
    background: #F8F5EE;
    border-top: 1px solid #EDE7DA;
}
@media (max-width: 640px) {
    .feed-list { gap: 1rem; }
    .feed-card-body { padding: 1rem 1rem 0.85rem; }
    .feed-card-media { padding: 0 1rem 0.85rem; }
    .feed-card-footer { padding: 0.6rem 1rem; }
    .feed-card-title { font-size: 1.15rem; }
}

/* ============================================================
   DARK MODE
   Turned on by the "dark" class on <html> (set in layout.php).
   Background:  #141A15   Surface: #1C241D   Surface 2: #253026
   Border:      #34412F   Text:    #ECE6DA   Muted:     #A9B39C
   Green text:  #B5C68E   Gold:    #D4AA4C
   ============================================================ */

html.dark { color-scheme: dark; }

/* --- Page backgrounds --- */
html.dark body,
html.dark main,
html.dark .bg-cream { background: #141A15 !important; color: #ECE6DA; }
html.dark .guest-bg { background: linear-gradient(135deg, #1C241D 0%, #141A15 60%, #1f1b12 100%) !important; }

/* --- Header and sidebars --- */
html.dark .top-header { background: #1C241D !important; border-bottom-color: #34412F !important; }
html.dark .main-sidebar { background: #1C241D !important; border-right-color: #34412F !important; }
html.dark .sidebar-link.active { background: #2E3B2C !important; }
html.dark .sidebar-link:hover:not(.active) { background: #253026 !important; }
html.dark .sidebar-group-label { color: #9DAE66; }

/* --- Top nav --- */
html.dark .top-nav-link { color: #A9B39C; }
html.dark .top-nav-link:hover { background: #2E3B2C; color: #CFE0A8; }
html.dark .top-nav-link.active { background: #3D5A3E; color: #fff; }
html.dark .top-nav-link.admin-link { color: #D4AA4C; }
html.dark .top-nav-link.admin-link:hover { background: rgba(196,154,60,0.15); color: #E3BD63; }
html.dark .top-nav-link.admin-link.active { background: #C49A3C; color: #fff; }

/* --- Points badge, menus, flash messages --- */
html.dark .points-badge { background: rgba(196,154,60,0.15); color: #E3BD63; border-color: rgba(196,154,60,0.4); }
html.dark #avatar-menu a:hover,
html.dark #avatar-menu button.theme-toggle:hover { background: #253026 !important; }
html.dark .flash-success { background: rgba(61,90,62,0.35); border-color: #85954F; color: #CFE0A8; }
html.dark .flash-error   { background: rgba(220,38,38,0.15); border-color: #dc2626; color: #fca5a5; }
html.dark .flash-info    { background: #2E3B2C; border-color: #85954F; color: #CFE0A8; }

/* --- Brand color classes --- */
html.dark .bg-primary { background-color: #4A6B4B !important; color: #fff !important; }
html.dark .hover\:bg-primary:hover { background-color: #557A56 !important; }
html.dark .text-primary,
html.dark .hover\:text-primary:hover { color: #B5C68E !important; }
html.dark .border-primary { border-color: #85954F !important; }
html.dark .gold-text { color: #D4AA4C; }
html.dark .hover\:bg-sage-light:hover { background-color: #2E3B2C !important; }
html.dark .bg-sage-light { background-color: #2E3B2C !important; }

/* --- Tier badges --- */
html.dark .badge-free  { background: #2B332C; color: #A9B39C; }
html.dark .badge-basic { background: #2E3B2C; color: #CFE0A8; }
html.dark .badge-pro   { background: #4A6B4B; color: #fff; }

/* --- Tailwind white and gray classes --- */
html.dark .bg-white { background-color: #1C241D !important; }
html.dark .bg-gray-50 { background-color: #182019 !important; }
html.dark .bg-gray-100 { background-color: #253026 !important; }
html.dark .bg-gray-200 { background-color: #2E3A2F !important; }
html.dark .hover\:bg-white:hover,
html.dark .hover\:bg-gray-50:hover,
html.dark .hover\:bg-gray-100:hover { background-color: #253026 !important; }
html.dark .hover\:bg-gray-200:hover { background-color: #2E3A2F !important; }
html.dark .text-gray-900,
html.dark .text-gray-800 { color: #ECE6DA !important; }
html.dark .text-gray-700 { color: #D9D3C6 !important; }
html.dark .text-gray-600 { color: #B9B3A5 !important; }
html.dark .text-gray-500 { color: #9E988B !important; }
html.dark .text-gray-400 { color: #8C877C !important; }
html.dark .text-black { color: #ECE6DA !important; }
html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-gray-300,
html.dark .divide-gray-100 > * + *,
html.dark .divide-gray-200 > * + * { border-color: #34412F !important; }

/* --- Light tinted backgrounds (notices, unread highlights) --- */
html.dark .bg-amber-50, html.dark .bg-yellow-50 { background-color: rgba(196,154,60,0.12) !important; }
html.dark .bg-green-50 { background-color: rgba(133,149,79,0.15) !important; }
html.dark .bg-red-50 { background-color: rgba(220,38,38,0.12) !important; }
html.dark .bg-blue-50 { background-color: rgba(59,130,246,0.12) !important; }

/* --- Inline brand colors used across pages --- */
html.dark [style*="color:#3D5A3E" i]:not([style*="background-color:#3D5A3E" i]),
html.dark [style*="color: #3D5A3E" i]:not([style*="background-color: #3D5A3E" i]) { color: #B5C68E !important; }
html.dark [style*="color:#5a6b5b" i],
html.dark [style*="color: #5a6b5b" i],
html.dark [style*="color:#374151" i],
html.dark [style*="color: #374151" i] { color: #A9B39C !important; }
html.dark [style*="color:#C49A3C" i]:not([style*="background" i]),
html.dark [style*="color: #C49A3C" i]:not([style*="background" i]) { color: #D4AA4C !important; }
html.dark [style*="background:#F5F0E8" i],
html.dark [style*="background: #F5F0E8" i],
html.dark [style*="background-color:#F5F0E8" i],
html.dark [style*="background-color: #F5F0E8" i] { background: #253026 !important; }
html.dark [style*="background:#D8DECB" i],
html.dark [style*="background: #D8DECB" i] { background: #2E3B2C !important; }
html.dark [style*="background:#fef9ee" i],
html.dark [style*="background: #fef9ee" i] { background: rgba(196,154,60,0.15) !important; }
html.dark [style*="background:#fff;" i], html.dark [style$="background:#fff" i],
html.dark [style*="background: #fff;" i], html.dark [style$="background: #fff" i],
html.dark [style*="background:#ffffff" i], html.dark [style*="background: #ffffff" i],
html.dark [style*="background-color:#fff;" i], html.dark [style$="background-color:#fff" i],
html.dark [style*="background-color: #fff;" i], html.dark [style$="background-color: #fff" i],
html.dark [style*="background:white" i], html.dark [style*="background: white" i] { background: #1C241D !important; }
html.dark [style*="solid #D8DECB" i],
html.dark [style*="solid #F5F0E8" i],
html.dark [style*="solid #e5e7eb" i] { border-color: #34412F !important; }

/* Inline hover effects that set light backgrounds with JavaScript */
html.dark [onmouseover*="#F5F0E8" i]:hover,
html.dark [onmouseover*="#eef0ea" i]:hover { background: #253026 !important; }
html.dark [onmouseover*="#fef9ee" i]:hover { background: rgba(196,154,60,0.15) !important; }

/* --- Form fields --- */
html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="submit"]):not([type="button"]):not([type="file"]),
html.dark textarea,
html.dark select {
    background-color: #253026 !important;
    color: #ECE6DA !important;
    border-color: #3A4836 !important;
}
html.dark input::placeholder,
html.dark textarea::placeholder { color: #7F8A74 !important; }

/* --- Scrollbar --- */
html.dark ::-webkit-scrollbar-thumb { background: #34412F; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #85954F; }

/* --- Post text, titles, rich text --- */
html.dark .post-title { color: #CFE0A8; }
html.dark .prose h2, html.dark .prose h3 { color: #CFE0A8; }
html.dark .prose a { color: #B5C68E; }
html.dark .prose code { background: #253026; color: #ECE6DA; }
html.dark .ql-content { color: #D9D3C6; }
html.dark .ql-content a { color: #B5C68E; }
html.dark .ql-content blockquote { border-left-color: #85954F; color: #A9B39C; }
html.dark .ql-content pre { background: #253026; color: #ECE6DA; }

/* --- Quill editor (posts, comments, lessons) --- */
html.dark .ql-toolbar.ql-snow { background: #253026; border-color: #34412F !important; }
html.dark .ql-container.ql-snow { border-color: #34412F !important; }
html.dark .ql-editor { color: #ECE6DA; }
html.dark .ql-editor.ql-blank::before { color: #7F8A74 !important; }
html.dark .ql-snow .ql-stroke { stroke: #A9B39C !important; }
html.dark .ql-snow .ql-fill { fill: #A9B39C !important; }
html.dark .ql-snow .ql-picker { color: #A9B39C !important; }
html.dark .ql-snow.ql-toolbar button:hover .ql-stroke,
html.dark .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: #CFE0A8 !important; }
html.dark .ql-snow.ql-toolbar button:hover .ql-fill,
html.dark .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: #CFE0A8 !important; }
html.dark .ql-snow .ql-picker-options { background: #1C241D !important; border-color: #34412F !important; }
html.dark .ql-snow .ql-tooltip { background: #1C241D; color: #ECE6DA; border-color: #34412F; box-shadow: 0 2px 8px rgba(0,0,0,0.5); }

/* --- Feed cards --- */
html.dark .feed-card { background: #1C241D; border-color: #34412F; border-left-color: var(--sc, #85954F); box-shadow: none; }
html.dark .feed-card:hover { border-color: #85954F; border-left-color: var(--sc, #85954F); box-shadow: 0 10px 24px -14px rgba(0,0,0,0.7); }
html.dark .feed-card.is-pinned { background: #212418; border-color: #6B5A2C; border-left-color: #C49A3C; }
html.dark .feed-card-title { color: #CFE0A8; }
html.dark .feed-card:hover .feed-card-title { color: #E1EDC2; }
html.dark .feed-card .feed-card-preview { color: #D9D3C6; }
html.dark .feed-read-more { color: #B5C68E; }
html.dark .feed-space-pill { background: #2E3B2C; background: color-mix(in srgb, var(--sc, #85954F) 24%, #1C241D); color: #CFE0A8; }
html.dark .feed-card-footer { background: #182019; border-top-color: #2B3528; }
html.dark .feed-card-footer .text-gray-300,
html.dark .feed-card-footer [style*="#d1d5db" i] { color: #6F7A66 !important; }
