/* Page chrome only — component styles live in shadow DOM */

* {
  box-sizing: border-box;
}

:root {
  --bg: #1a1a1a;
  --bg-soft: #222222;
  --text: #d0d0d0;
  --muted: #828282;
  --border: #333;
  --link: #ff6600;
  --link-dim: #ff8533;
  --title: #e6e6e6;
}

html {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Verdana, Geneva, sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link);
}

a:visited {
  color: var(--link-dim);
}

#wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 12px 0;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
}

main {
  flex: 1 0 auto;
}

header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 6px 0 8px;
  margin: 0 -12px 16px;
  padding-left: 12px;
  padding-right: 12px;
}

header a.site-title {
  font-weight: bold;
  color: var(--title);
  text-decoration: none;
  margin-right: 12px;
}

header nav a {
  margin-right: 10px;
  text-decoration: none;
  color: var(--text);
}

header nav a:hover {
  text-decoration: underline;
  color: var(--link);
}

header nav a.nav-rss {
  color: var(--link);
  font-size: 12px;
}

header nav a.nav-rss:hover {
  color: var(--link-dim);
}

h1 {
  font-size: 15px;
  font-weight: bold;
  color: var(--title);
  margin: 0 0 10px;
}

h2 {
  font-size: 13px;
  font-weight: bold;
  color: var(--title);
  margin: 18px 0 8px;
}

p {
  margin: 0 0 10px;
}

ul {
  margin: 0 0 10px;
  padding-left: 20px;
}

/* Home profile (page layout, not a component) */
.home-profile {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.home-profile img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  flex-shrink: 0;
}

.home-profile .intro {
  color: var(--muted);
  margin: 0;
}

.home-profile h1 {
  margin-bottom: 6px;
}

/* List wrapper for feed-item */
.posts {
  margin: 0;
}

.project-group {
  margin: 0 0 22px;
}

.project-group:last-child {
  margin-bottom: 0;
}

.project-group h2 {
  margin: 0 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pager {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.pager a {
  margin-right: 12px;
}

.blog-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.blog-list-head h1 {
  margin: 0;
}

/* Language switch (blog list + post) */
.post-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 8px;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.lang-btn {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  text-decoration: none;
  color: var(--muted);
  border-right: 1px solid var(--border);
}

.lang-btn:last-child {
  border-right: none;
}

.lang-btn:visited {
  color: var(--muted);
}

.lang-btn:hover {
  color: var(--link);
}

.lang-btn.is-active {
  color: var(--title);
  background: #2a2a2a;
}

.post-meta {
  color: var(--muted);
  font-size: 11px;
  margin: -6px 0 12px;
}

.post-body {
  margin-top: 8px;
}

.post-body img,
.cover-image {
  border: 1px solid var(--border);
  margin: 0 0 12px;
  display: block;
}

.cover-image {
  max-width: 100%;
  height: auto;
}

/* Body images: cap height too. !important beats CKEditor inline size. */
.post-body img {
  max-width: 100% !important;
  max-height: 70vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}

.external-link {
  margin: 0 0 12px;
  font-size: 12px;
}

.project-responsibilities {
  margin-top: 18px;
}

.project-responsibilities h2 {
  margin: 0 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-responsibilities ul {
  margin: 0;
  padding-left: 20px;
}

.project-responsibilities li {
  margin: 0 0 6px;
}

.project-responsibilities li:last-child {
  margin-bottom: 0;
}

/* Comments (flat list + quote replies) */
.comments {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.comments-title {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--title);
}

.comments-count {
  color: var(--muted);
  font-weight: normal;
  font-size: 12px;
}

.comments-empty {
  color: var(--muted);
}

.comment-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.comment {
  margin: 0 0 14px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
}

.comment:last-child {
  border-bottom: none;
}

.comment-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.comment-author {
  color: var(--title);
  font-weight: bold;
  margin-right: 8px;
}

.comment-date {
  margin-right: 8px;
}

.comment-reply {
  color: var(--muted);
  text-decoration: none;
}

.comment-reply:hover {
  color: var(--link);
  text-decoration: underline;
}

.comment-quote {
  margin: 0 0 8px;
  padding: 6px 10px;
  border-left: 2px solid var(--border);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 12px;
}

.comment-quote-ref {
  color: var(--link);
  text-decoration: none;
  font-weight: bold;
  margin-right: 6px;
}

.comment-quote-ref:hover {
  text-decoration: underline;
}

.comment-quote-body {
  margin-top: 2px;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-body {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.comment-form {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.comment-form-title {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--title);
}

.comment-form-title a {
  color: var(--link);
}

.comment-cancel-reply {
  color: var(--muted);
  font-weight: normal;
  font-size: 12px;
}

.comment-error {
  color: #e07070;
  margin: 0 0 10px;
}

.comment-field {
  display: block;
  margin: 0 0 10px;
}

.comment-field span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.comment-field input,
.comment-field textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}

.comment-field textarea {
  resize: vertical;
  min-height: 100px;
}

.comment-submit {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--title);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.comment-submit:hover {
  border-color: var(--link);
  color: var(--link);
}

/* Honeypot — hidden from people, not from dumb bots */
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Resume page layout */
.resume-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.btn-pdf {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--title);
  text-decoration: none;
  font-size: 12px;
}

.btn-pdf:visited {
  color: var(--title);
}

.btn-pdf:hover {
  border-color: var(--link);
  color: var(--link);
}

.resume-doc {
  max-width: 720px;
}

.resume-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.resume-avatar {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  flex-shrink: 0;
}

.resume-name {
  font-size: 20px;
  margin: 0 0 4px;
  color: var(--title);
}

.resume-headline {
  margin: 0;
  color: var(--link);
  font-size: 13px;
}

.resume-contacts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 6px;
  max-width: 100%;
}

.resume-section {
  margin-bottom: 18px;
  page-break-inside: avoid;
}

.resume-section h2 {
  margin: 0 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.resume-summary {
  color: var(--text);
  line-height: 1.5;
}

.resume-summary p:last-child {
  margin-bottom: 0;
}

footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 10px 0 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

@media print {
  body {
    background: #fff;
    color: #111;
    font-size: 11pt;
  }

  html, body {
    height: auto;
    min-height: 0;
    display: block;
  }

  #wrap {
    max-width: none;
    margin: 0;
    padding: 0;
    min-height: 0;
    display: block;
  }

  main {
    flex: none;
  }

  body > #wrap > header,
  body > #wrap > footer,
  .no-print,
  .resume-toolbar {
    display: none !important;
  }

  a {
    color: #111;
    text-decoration: none;
  }

  .resume-header {
    border-bottom-color: #ccc;
  }

  .resume-name {
    color: #000;
  }

  .resume-headline {
    color: #333;
  }

  .resume-section h2 {
    color: #333;
    border-bottom-color: #ccc;
  }

  .resume-avatar {
    border-color: #ccc;
  }

  .resume-section {
    break-inside: avoid;
  }
}
