/*
  Blog theme layer. Loaded by index.cfm on every blog page; everything is scoped to .blog-scope, so it cannot
  change the rest of the site.  Pick the theme with  theme : "light" | "dark"  in includes/config.cfm.

  The COLORS live in the variable block of each theme (right below). Change those first.
  The rules after them only apply the variables to the Bootstrap classes the blog templates use.
*/

/* ---------------------------------------------------------------- light: leaves the site theme alone */
.blog-theme-light { }

/* ---------------------------------------------------------------- dark: edit the colors here */
.blog-theme-dark {
	--blog-bg:        #000000;   /* page background behind the blog */
	--blog-surface:   #141414;   /* cards, sidebar boxes, comment form */
	--blog-surface-2: #1d1d1d;   /* inputs, hover */
	--blog-border:    #333333;
	--blog-text:      #cfcfcf;   /* body text */
	--blog-strong:    #ffffff;   /* headings, names, dates */
	--blog-muted:     #9a9a9a;   /* small grey text */
	--blog-link:      #d9b26a;   /* links (the accent) */
	--blog-link-hover:#f0d092;
	--blog-danger:    #ff8d8d;

	color: var(--blog-text);
	background-color: var(--blog-bg);
}

.blog-theme-dark h1, .blog-theme-dark h2, .blog-theme-dark h3,
.blog-theme-dark h4, .blog-theme-dark h5, .blog-theme-dark h6,
.blog-theme-dark .h1, .blog-theme-dark .h2, .blog-theme-dark .h3,
.blog-theme-dark .h4, .blog-theme-dark .h5, .blog-theme-dark .h6 { color: var(--blog-strong); }

.blog-theme-dark a { color: var(--blog-link); }
.blog-theme-dark a:hover, .blog-theme-dark a:focus { color: var(--blog-link-hover); }
.blog-theme-dark .card-title a,
.blog-theme-dark h2 a, .blog-theme-dark h3 a { color: var(--blog-strong); }
.blog-theme-dark .card-title a:hover,
.blog-theme-dark h2 a:hover, .blog-theme-dark h3 a:hover { color: var(--blog-link-hover); }

/* the templates use these light-theme helpers; map them to the palette */
.blog-theme-dark .text-dark,
.blog-theme-dark .text-color { color: var(--blog-strong) !important; }
.blog-theme-dark .text-muted,
.blog-theme-dark .small.text-muted { color: var(--blog-muted) !important; }
.blog-theme-dark .text-danger { color: var(--blog-danger) !important; }
.blog-theme-dark .bg-white,
.blog-theme-dark .bg-light { background-color: var(--blog-surface) !important; }
.blog-theme-dark .border-bottom,
.blog-theme-dark .border-top,
.blog-theme-dark .border { border-color: var(--blog-border) !important; }
.blog-theme-dark hr { border-color: var(--blog-border); opacity: 1; }

/* cards (post grid) */
.blog-theme-dark .card { background-color: var(--blog-surface); color: var(--blog-text); border-color: var(--blog-border); }
.blog-theme-dark .card-meta { color: var(--blog-muted); font-size: .8rem; }
.blog-theme-dark .box-shadow { box-shadow: 0 2px 14px rgba(0, 0, 0, .6); }

/* breadcrumb + pagination */
.blog-theme-dark .breadcrumb-item,
.blog-theme-dark .breadcrumb-item + .breadcrumb-item::before { color: var(--blog-muted); }
.blog-theme-dark .breadcrumb-item.active { color: var(--blog-text); }
.blog-theme-dark .page-link { background-color: var(--blog-surface); border-color: var(--blog-border); color: var(--blog-link); }
.blog-theme-dark .page-link:hover { background-color: var(--blog-surface-2); color: var(--blog-link-hover); }
.blog-theme-dark .page-item.active .page-link { background-color: var(--blog-link); border-color: var(--blog-link); color: #000; }
.blog-theme-dark .page-item.disabled .page-link { background-color: var(--blog-surface); color: var(--blog-muted); border-color: var(--blog-border); }

/* forms (search box, comment form) */
.blog-theme-dark .form-control,
.blog-theme-dark .form-select,
.blog-theme-dark .input-group-text { background-color: var(--blog-surface-2); color: var(--blog-strong); border-color: var(--blog-border) !important; }
.blog-theme-dark .form-control::placeholder { color: var(--blog-muted); }
.blog-theme-dark .form-control:focus { background-color: var(--blog-surface-2); color: var(--blog-strong); border-color: var(--blog-link) !important; box-shadow: 0 0 0 .2rem rgba(217, 178, 106, .25); }
.blog-theme-dark .form-label { color: var(--blog-text); }

/* notices */
.blog-theme-dark .alert-success { background-color: #12261a; border-color: #1f5c33; color: #b9e6c6; }
.blog-theme-dark .alert-danger  { background-color: #2b1414; border-color: #6b2b2b; color: #f4c2c2; }
.blog-theme-dark .alert-warning { background-color: #2b2410; border-color: #6b5a1f; color: #f0dfa0; }

/* the post text written in the admin editor */
.blog-theme-dark .post-body { color: var(--blog-text); }
.blog-theme-dark .post-body h1, .blog-theme-dark .post-body h2, .blog-theme-dark .post-body h3,
.blog-theme-dark .post-body h4, .blog-theme-dark .post-body strong { color: var(--blog-strong); }
.blog-theme-dark .post-body blockquote { border-left: 3px solid var(--blog-link); color: var(--blog-muted); padding-left: 1rem; }
.blog-theme-dark .post-body table { color: var(--blog-text); border-color: var(--blog-border); }
.blog-theme-dark .post-body td, .blog-theme-dark .post-body th { border-color: var(--blog-border); }
/* text saved with an explicit dark color by the editor stays readable */
.blog-theme-dark .post-body [style*="color: rgb(0, 0, 0)"],
.blog-theme-dark .post-body [style*="color:#000"],
.blog-theme-dark .post-body [style*="color: #000"],
.blog-theme-dark .post-body [style*="color:black"] { color: var(--blog-text) !important; }
