/*
Theme Name: KG Blog
Theme URI: https://kevingoedecke.com
Author: Kevin Goedecke
Author URI: https://kevingoedecke.com
Description: Minimal blog theme matching the kevingoedecke.com landing page.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL v2 or later
Text Domain: kg-blog
*/

:root {
  --bg: #0f172a;
  --bg-elev: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: #1e293b;
  --link-hover: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: underline; text-decoration-color: var(--text-dim); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--link-hover); }

img { max-width: 100%; height: auto; }

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}
@media (min-width: 640px) {
  .container { padding: 6rem 1.5rem; }
}

/* Header — nav-only, right-aligned (matches landing) */
.site-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4rem;
  font-size: 0.875rem;
}
.site-nav { display: flex; gap: 1.5rem; }
.site-nav a { color: var(--text-muted); text-decoration: none; }
.site-nav a:hover { color: var(--text); }

/* Page title — matches landing's H1 (text-2xl / semibold / tracking-tight) */
.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 2rem 0;
  color: var(--text);
}

/* Archive sub-label */
.archive-label {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
}
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list-item { padding: 1.5rem 0; border-bottom: 1px solid var(--border); }
.post-list-item:first-child { padding-top: 0; }
.post-list-item:last-child { border-bottom: none; }
.post-list-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 200ms ease-out;
}
.post-list-link:hover { transform: translateX(4px); }
.post-list-thumb {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}
.post-list-text { flex: 1; min-width: 0; }
.post-list-link h2 { font-size: 1.0625rem; font-weight: 500; margin: 0 0 0.25rem 0; color: var(--text); line-height: 1.35; }
.post-list-link time { color: var(--text-dim); font-size: 0.875rem; }

/* Single post featured image */
.post-featured-image {
  margin: 0 0 2rem 0;
}
.post-featured-image img {
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

/* Responsive embeds (YouTube, Vimeo, etc.) */
.post-content > * { max-width: 100%; }
.post-content iframe,
.post-content video,
.post-content embed,
.post-content object { max-width: 100%; }
.post-content figure.wp-block-embed {
  margin: 1.5rem 0;
  max-width: 100%;
}
.post-content .wp-block-embed__wrapper {
  position: relative;
  width: 100%;
}
.post-content .wp-block-embed.wp-has-aspect-ratio iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
  border-radius: 6px;
}
.post-content .wp-block-embed.wp-embed-aspect-16-9 .wp-block-embed__wrapper { aspect-ratio: 16 / 9; }
.post-content .wp-block-embed.wp-embed-aspect-4-3 .wp-block-embed__wrapper { aspect-ratio: 4 / 3; }
.post-content .wp-block-embed.wp-embed-aspect-1-1 .wp-block-embed__wrapper { aspect-ratio: 1 / 1; }
.post-content .wp-block-embed.wp-embed-aspect-9-16 .wp-block-embed__wrapper { aspect-ratio: 9 / 16; }
.post-content figure.wp-block-embed:not(.wp-has-aspect-ratio) iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 6px;
}
.post-content figcaption,
.post-content .wp-element-caption {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  text-align: center;
}

/* Single */
.post-header { margin-bottom: 2rem; }
.post-header h1 { font-size: 1.75rem; font-weight: 600; line-height: 1.25; margin: 0 0 0.5rem 0; letter-spacing: -0.015em; }
.post-meta { color: var(--text-dim); font-size: 0.875rem; }
.post-meta a { color: var(--text-muted); text-decoration: none; }
.post-meta a:hover { color: var(--text); }

.post-content { color: var(--text); }
.post-content p { margin: 0 0 1.25rem 0; }
.post-content h2 { font-size: 1.25rem; font-weight: 600; margin: 2rem 0 0.75rem 0; }
.post-content h3 { font-size: 1.0625rem; font-weight: 600; margin: 1.75rem 0 0.5rem 0; }
.post-content ul, .post-content ol { padding-left: 1.25rem; margin: 0 0 1.25rem 0; }
.post-content li { margin-bottom: 0.25rem; }
.post-content img { border-radius: 6px; margin: 1rem 0; }
.post-content pre { background: var(--bg-elev); border: 1px solid var(--border); padding: 1rem; border-radius: 6px; overflow-x: auto; font-size: 0.875rem; margin: 1rem 0; }
.post-content code { background: var(--bg-elev); padding: 0.125rem 0.375rem; border-radius: 3px; font-size: 0.875em; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.post-content pre code { background: transparent; padding: 0; }
.post-content blockquote { border-left: 3px solid var(--border); padding-left: 1rem; margin: 1.5rem 0; color: var(--text-muted); }
.post-content a { color: var(--text); text-decoration: underline; text-decoration-color: var(--text-dim); }
.post-content a:hover { text-decoration-color: var(--text); }
.post-content hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.post-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.875rem; }
.post-content th, .post-content td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; }
.post-content th { color: var(--text-muted); font-weight: 600; }

.post-tags { margin-top: 2rem; color: var(--text-dim); font-size: 0.875rem; }
.post-tags a { color: var(--text-muted); text-decoration: none; }
.post-tags a:hover { color: var(--text); }

.pagination { display: flex; justify-content: space-between; align-items: center; margin: 3rem 0 0 0; font-size: 0.875rem; }
.pagination a { color: var(--text); text-decoration: none; padding: 0.5rem 0.75rem; margin: 0 -0.5rem; border-radius: 4px; transition: background 200ms; }
.pagination a:hover { background: var(--bg-elev); }
.pagination .spacer { flex: 1; }

/* Comments */
.comments { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.comments-title { font-size: 1rem; font-weight: 600; margin: 0 0 1.5rem 0; color: var(--text-muted); }
.comment-list { list-style: none; padding: 0; margin: 0 0 2rem 0; }
.comment-list .comment { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.comment-list .children { list-style: none; padding-left: 1rem; margin-top: 1rem; border-left: 1px solid var(--border); }
.comment-author { color: var(--text); font-weight: 600; font-size: 0.875rem; }
.comment-meta { color: var(--text-dim); font-size: 0.75rem; }
.comment-body p { margin: 0.5rem 0; }

.comment-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }
.comment-form p { margin: 0; }
.comment-form label { display: block; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea { width: 100%; background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); padding: 0.5rem 0.75rem; border-radius: 4px; font-family: inherit; font-size: 0.9375rem; }
.comment-form textarea { min-height: 6rem; resize: vertical; }
.comment-form input[type="submit"] { background: var(--text); color: var(--bg); border: none; padding: 0.5rem 1rem; border-radius: 4px; font-weight: 500; cursor: pointer; font-family: inherit; width: fit-content; }
.comment-form input[type="submit"]:hover { opacity: 0.9; }
.no-comments { color: var(--text-muted); font-size: 0.875rem; }

.site-footer { margin-top: 5rem; padding-top: 2rem; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 0.875rem; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

.error-page { padding: 4rem 0; text-align: center; }
.error-page h1 { font-size: 2rem; margin: 0 0 1rem 0; }
.error-page p { color: var(--text-muted); }

.alignleft { float: left; margin-right: 1rem; }
.alignright { float: right; margin-left: 1rem; }
.aligncenter { display: block; margin: 1rem auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.875rem; color: var(--text-muted); text-align: center; margin-top: 0.5rem; }
.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; }
