/*
Theme Name: Online Rekenmachine Blog
Theme URI: https://gratisrekenmachine.com/blog
Author: Online Rekenmachine
Description: Custom theme matching the Online Rekenmachine.com design system — same colors, fonts, header, footer and dark mode as the main site, so the blog feels like part of the same product.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: mijnrekenmachine
*/

/* ── Design tokens — copied verbatim from src/app/globals.css and
   tailwind.config.ts on the main Next.js site. Keep these two files in sync
   if the main site's palette ever changes. ────────────────────────────── */
:root {
  --background: 0 0% 100%;
  --foreground: 222 47% 11%;
  --muted: 215 20% 96%;
  --muted-foreground: 215 16% 40%;
  --border: 214 20% 90%;
  --brand-50: #eef4ff;
  --brand-100: #d9e6ff;
  --brand-200: #bcd3ff;
  --brand-300: #8eb6ff;
  --brand-400: #598dff;
  --brand-500: #3366ff;
  --brand-600: #1f47f5;
  --brand-700: #1836e1;
  --brand-800: #1a2fb6;
  --brand-900: #1c2f8f;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --background: 222 47% 7%;
    --foreground: 210 40% 98%;
    --muted: 217 33% 14%;
    --muted-foreground: 215 20% 72%;
    --border: 217 33% 20%;
    color-scheme: dark;
  }
}
:root.dark {
  --background: 222 47% 7%;
  --foreground: 210 40% 98%;
  --muted: 217 33% 14%;
  --muted-foreground: 215 20% 72%;
  --border: 217 33% 20%;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}
html.theme-ready body,
html.theme-ready body :not(button):not(input):not(select):not(a) {
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

body {
  margin: 0;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans), 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-weight: 700;
}

.mrm-container {
  max-width: 72rem; /* matches Tailwind's `max-w-content` on the main site */
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 640px) {
  .mrm-container { padding-inline: 1.5rem; }
}

.mrm-surface {
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
}
.mrm-card-shadow {
  box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 4px 16px rgba(16,24,40,0.06);
}
.mrm-muted { color: hsl(var(--muted-foreground)); }
.mrm-bg-muted { background-color: hsl(var(--muted)); }

.mrm-btn {
  display: inline-block;
  border-radius: 0.75rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  background-color: var(--brand-600);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}
.mrm-btn:hover { background-color: var(--brand-700); }

.mrm-btn-outline {
  display: inline-block;
  border-radius: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  cursor: pointer;
}
.mrm-btn-outline:hover { background-color: hsl(var(--muted)); }

/* ── Header ──────────────────────────────────────────────────────────── */
.mrm-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--background) / 0.8);
  backdrop-filter: blur(8px);
}
.mrm-header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 4rem;
}
.mrm-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.mrm-logo-mark {
  display: grid;
  place-items: center;
  height: 2rem;
  width: 2rem;
  border-radius: 0.5rem;
  background-color: var(--brand-600);
  color: #fff;
  font-size: 1.1rem;
}
.mrm-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}
@media (min-width: 1280px) {
  .mrm-nav { display: flex; }
}
.mrm-nav a {
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.mrm-nav a:hover {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}
.mrm-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mrm-theme-toggle {
  display: flex;
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
  overflow: hidden;
}
.mrm-theme-toggle button {
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 0.875rem;
}
.mrm-theme-toggle button[aria-pressed="true"] {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}

/* ── Blog content ────────────────────────────────────────────────────── */
.mrm-blog-header {
  padding-block: 3rem 2rem;
}
.mrm-blog-header h1 {
  font-size: 2.25rem;
}
.mrm-post-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  padding-block: 2rem;
}
.mrm-post-card {
  border-radius: 1rem;
  border: 1px solid hsl(var(--border));
  padding: 1.25rem;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.mrm-post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(16,24,40,0.06), 0 12px 32px rgba(16,24,40,0.10);
}
.mrm-post-card h2 {
  font-size: 1.125rem;
  margin: 0.5rem 0;
}
.mrm-post-card .mrm-excerpt {
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
}
.mrm-post-meta {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

article.single-post {
  max-width: 48rem;
  margin-inline: auto;
  padding-block: 2rem 4rem;
}
article.single-post h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
article.single-post .mrm-post-meta {
  margin-bottom: 2rem;
}
article.single-post .entry-content {
  line-height: 1.75;
  font-size: 1.05rem;
}
article.single-post .entry-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
}
article.single-post .entry-content h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
}
article.single-post .entry-content p { margin: 1rem 0; }
article.single-post .entry-content img {
  border-radius: 0.75rem;
  margin: 1.5rem 0;
}
article.single-post .entry-content a {
  color: var(--brand-600);
  text-decoration: underline;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.mrm-footer {
  margin-top: 5rem;
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted) / 0.4);
}
.mrm-footer-inner {
  padding-block: 3rem;
}
.mrm-footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .mrm-footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .mrm-footer-grid { grid-template-columns: repeat(4, 1fr); }
}
.mrm-footer-col h2 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.75rem;
}
.mrm-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mrm-footer-col a {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.mrm-footer-col a:hover { color: hsl(var(--foreground)); }
.mrm-footer-bottom {
  margin-top: 2.5rem;
  border-top: 1px solid hsl(var(--border));
  padding-top: 1.5rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 639px) {
  .mrm-blog-header h1 { font-size: 1.75rem; }
  article.single-post h1 { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
