/* Import Rubik font weight 400 */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400&display=swap');

/* ---------- Design tokens ---------- */
:root {
  /* Light mode */
  --bg: #f6f7f9;            /* page background */
  --bg-elev: #ffffff;       /* elevated surfaces (cards, inputs) */
  --fg: #0f172a;            /* primary text */
  --muted: #64748b;         /* secondary text */
  --border: #e5e7eb;        /* subtle borders */
  --link: #0ea5e9;          /* accent/link color */
  --link-hover: #0284c7;

  --radius: 12px;
  --shadow: 0 8px 30px rgba(2, 6, 23, 0.08);

  --font-sans: 'Rubik','Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
  --font-mono: 'Ubuntu Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

  --container: 85ch;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid #eee;
}

.pagination-link {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    text-decoration: none;
    color: #007bff;
}

.pagination-link:hover {
    background: #e9ecef;
}

.pagination-info {
    color: #6c757d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;          /* slate-900 */
    --bg-elev: #111827;     /* slate-800 */
    --fg: #e5e7eb;          /* slate-200 */
    --muted: #94a3b8;       /* slate-400 */
    --border: #1f2937;      /* slate-700 */
    --link: #7dd3fc;        /* sky-300 */
    --link-hover: #38bdf8;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  }
}

/* ---------- Base ---------- */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 1024px) {
  html { font-size: 17px; } /* comfortable reading size on wide screens */
}

/* subtle depth for the whole page */
body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  background:
    radial-gradient(1200px 600px at 20% -10%, color-mix(in srgb, var(--link) 6%, transparent), transparent 60%),
    radial-gradient(800px 400px at 110% 10%, color-mix(in srgb, var(--muted) 8%, transparent), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

::selection {
  background: color-mix(in srgb, var(--link) 40%, transparent);
  color: #fff;
}

/* ---------- Layout ---------- */
main {
  max-width: var(--container);
  margin: 2.75rem auto 4rem auto;
  padding: 0 1.25rem;
}

/* Keep any existing nav partial looking sane */
header, nav {
  max-width: var(--container);
  margin: 1.25rem auto 0 auto;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  justify-content: flex-start;
  padding: 0 1.25rem;
}

nav ul {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  opacity: 0.9;
}
nav a:hover,
nav a.active { opacity: 1; text-decoration: underline; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  color: var(--fg);
  font-weight: 800;
  margin-top: 1.6rem;
  margin-bottom: 0.6rem;
  line-height: 1.2;
}
h1 { font-size: clamp(2rem, 3vw, 2.4rem); margin-top: 0; }
h2 { font-size: clamp(1.5rem, 2.2vw, 1.85rem); }
h3 { font-size: 1.25rem; }

p { margin: 1rem 0; color: var(--fg); }
.small, .meta { color: var(--muted); font-size: .95rem; }

/* Links */
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }
a:focus-visible { outline: 3px solid color-mix(in srgb, var(--link) 40%, transparent); outline-offset: 2px; border-radius: 4px; }

/* Buttons (used by search etc.) */
button, input[type="submit"] {
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55em 0.95em;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
button:hover, input[type="submit"]:hover { transform: translateY(-1px); }
button:active, input[type="submit"]:active { transform: translateY(0); }

/* ---------- Intro / hero ---------- */
.blog-header {
  padding: 1.25rem 0 1.75rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
}

/* Float-style avatar inside first paragraph */
.intro {
  display: flow-root; /* contains the float */
}
.intro .avatar {
  float: left;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  margin: .15rem .9rem .25rem 0;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}
@media (min-width: 640px) {
  .intro .avatar { width: 84px; height: 84px; }
}

.red-strike {
  position: relative;
  color: #a3a3a3; /* subtle grey */
  display: inline-block;
}
.red-strike::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 55%;
  height: 0.10em; /* thicker line */
  background: #ff3b3b; /* strong red */
  border-radius: 2px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}

/* ---------- Search (if used in header/nav) ---------- */
.search-form {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-left: auto;
}
.search-form input[type="text"] {
  padding: 0.55em 0.9em;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 1rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-form input[type="text"]:focus {
  border-color: var(--link);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 25%, transparent);
}
.search-form button {
  background: var(--link);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.55em 1.1em;
  font-size: 1rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.2s;
}
.search-form button:hover { background: var(--link-hover); }

/* ---------- Post list grid + cards ---------- */
/* Stack posts in a single column for all screen sizes */
.blog-list,
.posts {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  max-width: var(--container);
  margin-inline: auto;
}

article {
  padding: 1.1rem 1.15rem;
  margin-bottom: 2rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .2s ease;
}
article:hover { transform: translateY(-2px); }

article h2 {
  margin: .25rem 0 .35rem 0;
}
.post-title-link {
  color: var(--fg);
  text-decoration: none;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
.post-title-link:hover { text-decoration: underline; }

.meta {
  color: var(--muted);
  font-size: .95rem;
  margin-top: .1rem;
  margin-bottom: .6rem;
}
.meta .dot::before { content: "·"; padding: 0 .35rem; color: var(--muted); }

/* Tags */
.tags { margin-bottom: .6rem; }
.tag {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--link) 10%, var(--bg-elev));
  border: 1px solid color-mix(in srgb, var(--link) 22%, var(--border));
  color: var(--fg);
  font-size: .85rem;
  margin-right: .4rem;
  opacity: .95;
  transition: transform .12s ease, opacity .2s ease;
}
.tag:hover { transform: translateY(-1px); opacity: 1; }

/* Read more */
.read-more {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 600;
}

/* ---------- Code blocks ---------- */
code, pre { font-family: var(--font-mono); }
code {
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  color: inherit;
  border-radius: 6px;
  padding: 0.15em 0.4em;
}
pre {
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  overflow-x: auto;
  box-shadow: var(--shadow);
}

/* ---------- Blockquotes ---------- */
blockquote {
  border-left: 4px solid var(--link);
  background: color-mix(in srgb, var(--link) 8%, var(--bg));
  color: var(--fg);
  margin: 1.5em 0;
  padding: 1em 1.25em;
  border-radius: 10px;
}

/* ---------- Lists, media, rules ---------- */
ul, ol { padding-left: 1.25rem; }
img { max-width: 100%; display: block; margin: 1.25rem 0; border-radius: 10px; }
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ---------- Accessibility & motion ---------- */
:focus-visible { outline: 3px solid color-mix(in srgb, var(--link) 40%, transparent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

