*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --vs-blue: #0e619f; /* primary blue from vs_palette.py */
  --vs-gray-light: #b5b6b5; /* light gray from vs_palette.py */
  --accent: #3857F1;
  --accent-hover: #5671f4;
  --text: #30373e;
  --heading: #23282d;
  --muted: rgba(48,55,62,0.73);
  --border: rgba(0,0,0,0.085);
  --footer-bg: #23282d;
  --footer-text: #9BA1A7;
  --copyright-bg: #4270af;
  --copyright-text: #f7f7f7;
  --max-width: 1200px;
  --font: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.733;
  color: var(--text);
  background: #fff;
}

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

h1, h2, h3, h4, h5, h6 { color: var(--heading); font-weight: 500; }
h1 { font-size: 2.375rem; line-height: 1.1; font-weight: 600; }
h2 { font-size: 1.875rem; line-height: 1.25; }
h3 { font-size: 1.625rem; line-height: 1.25; }
h4 { font-size: 1.25rem; line-height: 1.5; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; }

/* ── Header ── */
#site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

#header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: block;
  padding: 25px 0;
}

.site-logo img {
  max-height: 80px;
  width: auto;
  display: block;
}

nav.site-nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav.site-nav a {
  color: var(--heading);
  font-size: 0.9375rem;
  transition: color 0.15s;
}

nav.site-nav a:hover,
nav.site-nav a.active { color: var(--accent); }

/* hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--heading);
}
.nav-toggle svg { display: block; }

/* ── Main content ── */
#main { padding: 4rem 0; }

/* ── Home hero ── */
.hero {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.hero-text { flex: 1; }

.hero-text h1 { margin-bottom: 1.25rem; }

.hero-text p {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 2rem;
  max-width: 520px;
}

.hero-image { flex-shrink: 0; }
.hero-image img { display: block; width: 468px; max-width: 100%; height: auto; }

/* ── Button ── */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1.4;
  padding: 0.65rem 1.5rem;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.12);
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-hover); }

/* ── Services page ── */
.page-title { margin-bottom: 2.5rem; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
}

.service-card h3 { color: var(--accent); margin-bottom: 0.75rem; }
.service-card p { margin-bottom: 0.75rem; }
.service-card ul { padding-left: 1.25rem; color: var(--text); }
.service-card ul li { margin-bottom: 0.25rem; }

/* ── Portfolio page ── */
.portfolio-intro {
  font-size: 1.0625rem;
  color: var(--muted);
  margin-bottom: 3rem;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.portfolio-item {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
}

.portfolio-item h3 {
  font-size: 1.125rem;
  color: var(--heading);
  margin-bottom: 0.75rem;
  min-height: 3.375rem; /* two lines at 1.125rem × 1.5 line-height */
}

.portfolio-item .img-wrap {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 2px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.portfolio-item .img-wrap img {
  max-width: 100%;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.portfolio-item p { color: var(--text); font-size: 0.9375rem; }

/* ── Footer ── */
#site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 2.5rem 0 0;
}

#site-footer a { color: var(--footer-text); }
#site-footer a:hover { color: #fff; }

.footer-contact {
  text-align: center;
  padding-bottom: 2rem;
}

.footer-contact p { margin-bottom: 1rem; }

#site-copyright {
  background: var(--copyright-bg);
  color: var(--copyright-text);
  text-align: center;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
}

#site-copyright a { color: #fff; }

/* ── Responsive ── */
@media (max-width: 960px) {
  nav.site-nav { display: none; }
  nav.site-nav.open { display: block; }
  nav.site-nav.open ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
  }
  nav.site-nav.open ul li a {
    display: block;
    padding: 0.6rem 0;
    border-bottom: 1px solid #eaeaea;
  }
  .nav-toggle { display: block; }

  .hero {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }
  .hero-text p { max-width: 100%; }
  .hero-image img { width: 100%; max-width: 468px; margin: 0 auto; }
}

@media (max-width: 600px) {
  #main { padding: 2.5rem 0; }
  .services-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
}

/* ── Blog listing ── */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 760px;
}

.blog-card {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}
.blog-list .blog-card:last-child { border-bottom: none; }

.blog-card-title { font-size: 1.5rem; margin: 0.25rem 0 0.75rem; }
.blog-card-title a { color: var(--heading); }
.blog-card-title a:hover { color: var(--accent); }
.blog-card p { color: var(--text); margin-bottom: 0.5rem; }

.post-meta {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

/* ── Blog post ── */
.post-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 790px);
  gap: 0;
  align-items: stretch;
  max-width: 1110px;
}

.post-sidebar {
  position: sticky;
  top: 2rem;
  align-self: start;
  font-size: 0.875rem;
  padding-right: 1.75rem;
}

.post-layout article {
  border-left: 1px solid var(--vs-gray-light);
  padding-left: 1.75rem;
}

.post-sidebar h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.post-sidebar ul { list-style: none; }
.post-sidebar li {
  margin-bottom: 0.7rem;
  line-height: 1.45;
}
.post-sidebar a { color: var(--text); }
.post-sidebar a:hover { color: var(--accent); }
.post-sidebar li.current a { color: var(--vs-blue); font-weight: 600; }

/* mobile: hide the sidebar and divider entirely — just the article.
   Must come AFTER the desktop .post-layout rules above to win the cascade. */
@media (max-width: 960px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-sidebar { display: none; }
  .post-layout article {
    border-left: none;
    padding-left: 0;
  }
}
.post-back { margin-bottom: 1rem; font-size: 0.9375rem; }
.post-header .page-title { margin-bottom: 0.5rem; }
.post-header { margin-bottom: 2rem; }

.post-body { font-size: 1.0625rem; line-height: 1.8; }
.post-body h2 { font-size: 1.5rem; margin: 2rem 0 0.75rem; }
.post-body h3 { font-size: 1.25rem; margin: 1.75rem 0 0.5rem; }
.post-body p { margin-bottom: 1.25rem; }
.post-body ul, .post-body ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.post-body li { margin-bottom: 0.4rem; }
.post-body img { max-width: 100%; height: auto; border-radius: 4px; }
.post-body blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.post-body .table-scroll { overflow-x: auto; margin: 2rem 0; }
.post-body table {
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.5;
}
.post-body th, .post-body td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.post-body tr:first-child td, .post-body th {
  background: #f4f6f9;
  font-weight: 500;
  color: var(--heading);
}

.post-body figure { margin: 2rem 0; }
.post-body figcaption {
  font-size: 0.875rem;
  color: var(--vs-blue);
  line-height: 1.6;
  margin-top: 0.75rem;
}

/* ── Comments & forms ── */
.post-comments { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.post-comments h2 { font-size: 1.5rem; margin-bottom: 1.25rem; }

.comment { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.comment-meta { color: var(--muted); font-size: 0.875rem; margin-bottom: 0.25rem; }
.comment-body { white-space: pre-wrap; }

#comment-form, #contact-form { margin-top: 2rem; max-width: 640px; }
.contact-container { max-width: 760px; }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-row { display: flex; gap: 1rem; }
.form-row label { flex: 1; }

#comment-form label, #contact-form label {
  display: block;
  font-size: 0.875rem;
  color: var(--heading);
  margin-bottom: 1rem;
}

#comment-form input:not(.hp-field), #contact-form input:not(.hp-field),
#comment-form textarea, #contact-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  border: 1px solid var(--vs-gray-light);
  border-radius: 2px;
}

#comment-form input:focus, #comment-form textarea:focus,
#contact-form input:focus, #contact-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

#comment-status, #contact-status { margin-top: 0.75rem; font-size: 0.9375rem; color: var(--vs-blue); }

@media (max-width: 600px) {
  .form-row { flex-direction: column; gap: 0; }
}
