/* Verbault blog — self-contained stylesheet.
   Loaded only by blog pages (post + list). Does NOT inherit the SPA styles. */

/* ─── Design tokens ─── */
:root {
  --ink:        #17202a;
  --muted:      #627083;
  --surface:    #ffffff;
  --bg:         #F8F4ED;
  --border:     #dfe6df;
  --accent:     #267d84;
  --gold:       #B8915D;
  --radius:     6px;
  --radius-lg:  10px;
  --max-post:   720px;
  --max-list:   1080px;
  --font-body:  Georgia, "Times New Roman", serif;
  --font-ui:    system-ui, -apple-system, sans-serif;
}

:root[data-theme="dark"] {
  --ink:      #ece6da;
  --muted:    #a9978a;
  --surface:  #221d16;
  --bg:       #15110c;
  --border:   #3a332a;
  --accent:   #3fa8b0;
  --gold:     #c9a06e;
}

/* Secondary fallback: respect OS dark preference when data-theme is not forced to light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:      #ece6da;
    --muted:    #a9978a;
    --surface:  #221d16;
    --bg:       #15110c;
    --border:   #3a332a;
    --accent:   #3fa8b0;
    --gold:     #c9a06e;
  }
}

/* ─── Reset / base ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  text-decoration: underline;
}

/* ─── Header ─── */
.vb-blog-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.vb-blog-brand {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.vb-blog-brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.vb-blog-header nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.vb-blog-header nav a {
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.vb-blog-header nav a:hover {
  opacity: 1;
  text-decoration: none;
  color: var(--accent);
}

/* ─── Main containers ─── */
main {
  flex: 1;
}

.vb-blog-post {
  max-width: var(--max-post);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.vb-blog-list {
  max-width: var(--max-list);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.vb-blog-list > h1 {
  font-size: 1.75rem;
  font-family: var(--font-ui);
  margin-bottom: 1.75rem;
  color: var(--ink);
}

/* ─── Post article ─── */
.vb-blog-post article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.75rem;
}

.vb-blog-post h1 {
  font-size: 2rem;
  font-family: var(--font-body);
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.vb-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.vb-cover {
  display: block;
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 0 0 1.75rem;
}

/* ─── Article body typography ─── */
.vb-body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink);
  margin-top: 1.5rem;
}

.vb-body h2 {
  font-size: 1.45rem;
  margin: 2rem 0 0.6rem;
  line-height: 1.3;
}

.vb-body h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem;
  line-height: 1.3;
}

.vb-body p {
  margin: 0.9rem 0;
}

.vb-body ul,
.vb-body ol {
  margin: 0.9rem 0 0.9rem 1.5rem;
}

.vb-body li {
  margin: 0.3rem 0;
}

.vb-body blockquote {
  border-left: 4px solid var(--gold);
  margin: 1.25rem 0;
  padding: 0.5rem 1rem;
  color: var(--muted);
  font-style: italic;
}

.vb-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.875em;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border-radius: 3px;
  padding: 0.15em 0.35em;
}

.vb-body pre {
  background: color-mix(in srgb, var(--ink) 5%, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.vb-body pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.vb-body a {
  color: var(--accent);
  text-decoration: underline;
}

.vb-body a:hover {
  color: var(--gold);
}

.vb-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
  margin: 1rem auto;
}

.vb-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.925rem;
}

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

.vb-body th {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  font-weight: 600;
}

/* ─── Tags ─── */
.vb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
  align-items: center;
}

.vb-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-family: var(--font-ui);
  background: color-mix(in srgb, var(--gold) 15%, var(--surface));
  color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  border-radius: 999px;
  padding: 0.2em 0.65em;
  text-decoration: none;
  transition: background 0.15s;
}

.vb-tag:hover {
  background: color-mix(in srgb, var(--gold) 25%, var(--surface));
  text-decoration: none;
}

/* ─── Share buttons ─── */
.vb-share {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
  align-items: center;
}

.vb-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.vb-share-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.vb-share-btn:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ─── Comments ─── */
.vb-comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.vb-comments h2 {
  font-size: 1.2rem;
  font-family: var(--font-ui);
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--ink);
}

.vb-comment-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.vb-comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.vb-comment b {
  font-weight: 600;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.vb-comment time {
  font-size: 0.78rem;
  color: var(--muted);
  float: right;
}

.vb-comment > div {
  margin-top: 0.5rem;
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--ink);
  clear: both;
}

/* Comment form */
.vb-comment-form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.vb-comment-form[hidden] {
  display: none;
}

.vb-comment-form textarea {
  width: 100%;
  min-height: 5em;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.925rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.vb-comment-form textarea:focus {
  border-color: var(--accent);
}

.vb-comment-form button[type="submit"] {
  align-self: flex-start;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  padding: 0.5em 1.25em;
  cursor: pointer;
  transition: opacity 0.15s;
}

.vb-comment-form button[type="submit"]:hover {
  opacity: 0.88;
}

.vb-comment-login {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ─── Blog list / cards ─── */
.vb-cards {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
}

.vb-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 9%, transparent);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.vb-card a:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--ink) 16%, transparent);
  text-decoration: none;
}

.vb-card-thumb {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  display: block;
  background: var(--bg);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}

.vb-card-thumb--empty {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 24%, var(--surface)),
      color-mix(in srgb, var(--gold) 30%, var(--surface)));
}

.vb-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.1rem 1.3rem 1.3rem;
}

.vb-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.vb-card p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vb-cat {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.7rem;
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ─── Footer ─── */
.vb-blog-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.vb-blog-footer a {
  color: var(--muted);
  margin: 0 0.4rem;
  text-decoration: none;
}

.vb-blog-footer a:hover {
  color: var(--accent);
}

.vb-blog-footer p {
  margin-top: 0.5rem;
}

/* ─── Mobile ─── */
@media (max-width: 640px) {
  .vb-blog-header {
    padding: 0.6rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .vb-blog-header nav {
    gap: 0.75rem;
  }

  .vb-blog-post {
    padding: 1.25rem 0.75rem 3rem;
  }

  .vb-blog-post article {
    padding: 1.5rem 1.25rem;
  }

  .vb-blog-post h1 {
    font-size: 1.5rem;
  }

  .vb-blog-list {
    padding: 1.25rem 0.75rem 3rem;
  }

  .vb-share {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .vb-cards {
    grid-template-columns: 1fr;
  }

  .vb-comments {
    margin-top: 2rem;
    padding-top: 1.5rem;
  }
}
