/*
Theme Name: JensDufour Minimal
Theme URI: https://github.com/jensdufour/blog
Author: Jens Du Four
Author URI: https://jensdufour.be
Description: A minimalist FSE blog theme with dark/light mode toggle.
Version: 2.2.0
Requires at least: 6.2
Tested up to: 6.7
Requires PHP: 8.0
License: MIT
Text Domain: jensdufour-minimal
*/

/* ── Dark / Light mode ── */
:root {
  --text: #1a1a1a;
  --bg: #fafafa;
  --accent: #0366d6;
  --muted: #586069;
  --border: #e1e4e8;
  --code-bg: #f6f8fa;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #c9d1d9;
    --bg: #0d1117;
    --accent: #58a6ff;
    --muted: #8b949e;
    --border: #30363d;
    --code-bg: #161b22;
    --wp--preset--color--text: #c9d1d9;
    --wp--preset--color--background: #0d1117;
    --wp--preset--color--accent: #58a6ff;
    --wp--preset--color--muted: #8b949e;
    --wp--preset--color--border: #30363d;
    --wp--preset--color--code-bg: #161b22;
  }
}

[data-theme="dark"] {
  --text: #c9d1d9;
  --bg: #0d1117;
  --accent: #58a6ff;
  --muted: #8b949e;
  --border: #30363d;
  --code-bg: #161b22;
  --wp--preset--color--text: #c9d1d9;
  --wp--preset--color--background: #0d1117;
  --wp--preset--color--accent: #58a6ff;
  --wp--preset--color--muted: #8b949e;
  --wp--preset--color--border: #30363d;
  --wp--preset--color--code-bg: #161b22;
}

[data-theme="light"] {
  --text: #1a1a1a;
  --bg: #fafafa;
  --accent: #0366d6;
  --muted: #586069;
  --border: #e1e4e8;
  --code-bg: #f6f8fa;
  --wp--preset--color--text: #1a1a1a;
  --wp--preset--color--background: #fafafa;
  --wp--preset--color--accent: #0366d6;
  --wp--preset--color--muted: #586069;
  --wp--preset--color--border: #e1e4e8;
  --wp--preset--color--code-bg: #f6f8fa;
}

/* ── Base ── */
body {
  color: var(--text);
  background: var(--bg);
  transition: color 0.25s ease, background 0.25s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Accent highlight for post titles ── */
.wp-block-post-title a:hover,
.wp-block-heading a:hover {
  color: var(--accent);
}

.wp-block-post-date {
  color: var(--muted);
}

/* ── Header ── */
.wp-block-heading a {
  text-decoration: none;
}

.wp-site-tagline {
  margin-top: 0.15rem;
}

/* ── Theme toggle button ── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--muted);
  background: var(--code-bg);
}

/* ── Images ── */
img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

/* ── Code blocks ── */
pre {
  background: var(--code-bg) !important;
  overflow-x: auto;
  border-radius: 8px;
  font-size: 0.875rem;
}

code {
  font-size: 0.875em;
}

/* ── Blockquotes ── */
blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

th {
  background: var(--code-bg);
  font-weight: 600;
}

/* ── Certificate badges in footer ── */
.cert-badge img {
  border-radius: 0;
  width: 80px;
  height: 80px;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.cert-badge:hover img {
  opacity: 1;
}

/* ── Navigation links (dark mode aware) ── */
.wp-block-navigation a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.wp-block-navigation a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ── Post list ── */
.wp-block-post-title a {
  text-decoration: none;
}

.wp-block-post-title a:hover {
  color: var(--accent);
}

/* ── Sessionize embed: hide its generated heading (theme already shows page title) ── */
.wp-block-post-content .sz-caption {
  display: none;
}

/* ── Footer ── */
.site-footer {
  position: relative;
}

.footer-accent-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #a371f7, var(--accent));
  border-radius: 2px;
  margin-bottom: 0.5rem;
}

.cert-grid {
  opacity: 0.9;
}

.site-footer a:hover {
  color: var(--accent) !important;
}

/* ── Social links icons ── */
.site-footer .wp-block-social-links .wp-social-link {
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.85;
}

.site-footer .wp-block-social-links .wp-social-link:hover {
  transform: scale(1.15);
  opacity: 1;
}

.site-footer .wp-block-social-links .wp-social-link:hover svg {
  fill: var(--accent);
}

/* ── Comments ── */
.wp-block-comments {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.wp-block-comment-template li {
  list-style: none;
  border-bottom: 1px solid var(--border);
}

.wp-block-comment-template li:last-child {
  border-bottom: none;
}

.wp-block-avatar img {
  border-radius: 50%;
}

.comment-reply-link {
  color: var(--accent);
  font-weight: 500;
}

.wp-block-post-comments-form textarea {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  width: 100%;
  transition: border-color 0.2s;
}

.wp-block-post-comments-form textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.wp-block-post-comments-form input[type="text"],
.wp-block-post-comments-form input[type="email"],
.wp-block-post-comments-form input[type="url"] {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.wp-block-post-comments-form input[type="text"]:focus,
.wp-block-post-comments-form input[type="email"]:focus,
.wp-block-post-comments-form input[type="url"]:focus {
  border-color: var(--accent);
  outline: none;
}

.wp-block-post-comments-form .form-submit input[type="submit"] {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.wp-block-post-comments-form .form-submit input[type="submit"]:hover {
  opacity: 0.85;
}