/* ==========================================================================
   OpenCode Terminal Brutalist — Content Styling
   Markdown-rendered article content.
   Based on opencode.ai DESIGN.md
   ========================================================================== */

/* -- Content container --------------------------------------------------- */

.content-header {
  margin-bottom: var(--oc-space-lg);
}

.content-header h1 {
  margin-bottom: var(--oc-space-sm);
}

.content-header .post-meta {
  font-family: var(--font-mono-brand);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--oc-ink-subtle);
}

.content-body {
  max-width: 100%;
  line-height: 1.65;
}

/* -- Headings in content ------------------------------------------------- */

.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4,
.content-body h5,
.content-body h6 {
  margin: 48px 0 var(--oc-space-sm);
}

.content-body h1:first-child,
.content-body h2:first-child,
.content-body h3:first-child {
  margin-top: 0;
}

/* -- Paragraphs ---------------------------------------------------------- */

.content-body p {
  margin: 0 0 20px;
}

/* -- Links --------------------------------------------------------------- */

.content-body a {
  color: var(--oc-link);
  text-decoration: none;
}

.content-body a:hover {
  text-decoration: underline;
}

/* -- Strong / Emphasis --------------------------------------------------- */

.content-body strong {
  font-weight: 600;
  color: var(--oc-ink-strong);
}

.content-body em {
  font-style: italic;
}

/* -- Inline code --------------------------------------------------------- */

.content-body code {
  font-family: var(--font-mono-docs);
  font-size: 13px;
  background: var(--oc-surface-raised);
  color: var(--oc-ink-muted);
  padding: 2px 6px;
  border-radius: var(--oc-radius-sm);
  border: 1px solid var(--oc-rule-soft);
}

/* -- Code blocks --------------------------------------------------------- */

.content-body pre {
  background: var(--oc-code-bg);
  border: 1px solid var(--oc-code-border);
  border-radius: 0;
  box-shadow: none;
  padding: 20px 22px;
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono-docs);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--oc-code-fg);
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}

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

/* -- Blockquotes --------------------------------------------------------- */

.content-body blockquote {
  margin: 0 0 var(--oc-space-md);
  padding: var(--oc-space-sm) var(--oc-space-md);
  border-left: 2px solid var(--oc-rule-soft);
  color: var(--oc-ink-muted);
  font-style: normal;
}

.content-body blockquote p:last-child {
  margin-bottom: 0;
}

/* -- Horizontal rules ---------------------------------------------------- */

.content-body hr {
  border: none;
  border-top: 1px solid var(--oc-rule);
  margin: var(--oc-space-xl) 0;
}

/* -- Lists --------------------------------------------------------------- */

.content-body ul,
.content-body ol {
  margin: 0 0 var(--oc-space-md);
  padding-left: var(--oc-space-lg);
}

.content-body li {
  margin-bottom: 4px;
}

.content-body ul ul,
.content-body ul ol,
.content-body ol ul,
.content-body ol ol {
  margin-top: var(--oc-space-xs);
}

.content-body li::marker {
  color: var(--oc-ink-subtle);
}

/* -- Definition lists ---------------------------------------------------- */

.content-body dt {
  font-weight: 600;
  color: var(--oc-ink-strong);
  margin-top: var(--oc-space-md);
}

.content-body dd {
  margin: var(--oc-space-xs) 0 var(--oc-space-md) var(--oc-space-md);
  color: var(--oc-ink-muted);
}

/* -- Tables -------------------------------------------------------------- */

.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--oc-space-md);
  font-size: 14px;
  line-height: 21px;
}

.content-body thead {
  border-bottom: 1px solid var(--oc-rule);
}

.content-body th {
  font-weight: 600;
  color: var(--oc-ink-strong);
  text-align: left;
  padding: var(--oc-space-sm);
  border-bottom: 1px solid var(--oc-rule);
}

.content-body td {
  padding: var(--oc-space-sm);
  border-bottom: 1px solid var(--oc-rule-soft);
  color: var(--oc-ink-muted);
}

.content-body tr:last-child td {
  border-bottom: none;
}

/* -- Images -------------------------------------------------------------- */

.content-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: var(--oc-space-md) 0;
}

/* -- Figures ------------------------------------------------------------- */

.content-body figure {
  margin: 0 0 var(--oc-space-md);
}

.content-body figcaption {
  font-family: var(--font-mono-docs);
  font-size: 13px;
  line-height: 19.5px;
  color: var(--oc-ink-subtle);
  margin-top: var(--oc-space-xs);
}

/* -- Selection ----------------------------------------------------------- */

::selection {
  background: var(--oc-selection-bg);
  color: var(--oc-selection-fg);
}

.content-body pre::selection,
.content-body pre *::selection {
  background: var(--oc-code-selection);
  color: inherit;
}

/* -- Post list on section pages ------------------------------------------ */

.post {
  margin-bottom: var(--oc-space-xl);
  padding-bottom: var(--oc-space-lg);
  border-bottom: 1px solid var(--oc-rule);
}

.post:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.post-date {
  display: block;
  margin-top: 8px;
  color: var(--oc-ink-subtle);
  font-size: 13px;
}

.content-body .highlight {
  margin: 0 0 20px;
}

.content-body .code-block {
  margin: 0 0 20px;
  background: var(--oc-code-bg);
}

.content-body .code-block--named {
  border: 1px solid var(--oc-code-border);
}

.content-body .code-block .highlight {
  margin: 0;
}

.content-body .code-block__filename {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--oc-code-border);
  background: transparent;
  color: var(--oc-ink);
  font-family: var(--font-mono-docs);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6875;
}

.content-body .code-block__filename span {
  display: inline-block;
  padding: 5px 16px;
  border-right: 1px solid var(--oc-code-border);
  color: var(--oc-code-fg);
}

.content-body .code-block--named .highlight pre,
.content-body .code-block--named > pre {
  margin: 0;
  border: 0;
}

.content-body figure.code-block .highlight pre,
.content-body figure.code-block > pre {
  padding: 12px 16px;
  background: var(--oc-code-bg);
  border-color: var(--oc-code-border);
  line-height: 1.6875;
}

.content-body .highlight pre {
  background: var(--oc-code-bg);
  border: 1px solid var(--oc-code-border);
  border-radius: 0;
  box-shadow: none;
  line-height: 1.6;
  margin: 0;
  padding: 20px 22px;
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}

.content-body :not(pre) > code {
  background: var(--oc-surface-raised);
  border-color: var(--oc-rule-soft);
  color: var(--oc-ink-muted);
}

/* Hugo emits its configured palette inline. Override it with the exact paired
   syntax colours used by opencode.ai/docs in both modes. */
.content-body .highlight pre,
.content-body .highlight code {
  color: var(--oc-code-fg) !important;
  background-color: var(--oc-code-bg) !important;
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}

.content-body .highlight [style*="color:#e6edf3"] {
  color: var(--oc-code-fg) !important;
}

.content-body .highlight [style*="color:#ff7b72"] {
  color: var(--oc-syntax-red) !important;
}

.content-body .highlight [style*="color:#79c0ff"] {
  color: var(--oc-syntax-blue) !important;
}

.content-body .highlight [style*="color:#a5d6ff"] {
  color: var(--oc-syntax-cyan) !important;
}

.content-body .highlight [style*="color:#d2a8ff"] {
  color: var(--oc-syntax-purple) !important;
}

.content-body .highlight [style*="color:#8b949e"] {
  color: var(--oc-syntax-grey) !important;
}

.content-body .highlight [style*="color:#f0883e"] {
  color: var(--oc-syntax-orange) !important;
}

.content-body .highlight [style*="color:#7ee787"] {
  color: var(--oc-syntax-green) !important;
}

/* -- Home --------------------------------------------------------------- */

.home-hero {
  overflow: hidden;
  padding: 48px 40px 40px;
  position: relative;
  border: 1px solid var(--oc-rule);
  background:
    linear-gradient(90deg, var(--oc-rule-soft) 1px, transparent 1px),
    linear-gradient(var(--oc-rule-soft) 1px, transparent 1px),
    var(--oc-surface-data);
  background-size: 32px 32px;
}

.home-hero::before {
  content: "~/notes";
  display: block;
  width: fit-content;
  margin-bottom: 24px;
  padding: 3px 8px;
  border: 1px solid var(--oc-rule-soft);
  border-radius: var(--oc-radius-sm);
  background: var(--oc-canvas);
  color: var(--oc-ink-subtle);
  font-size: 13px;
  line-height: 1.5;
}

.home-hero--bio .home-bio {
  max-width: 760px;
}

.home-hero--bio .home-bio p {
  margin-bottom: 16px;
  color: var(--oc-ink-muted);
  line-height: 1.65;
}

.home-hero--bio .home-bio p:first-child {
  margin-bottom: 20px;
  color: var(--oc-ink-strong);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
}

.home-hero--bio .home-bio p:last-child {
  margin-bottom: 0;
}

.home-experience h2 {
  margin-bottom: 32px;
  color: var(--oc-ink-subtle);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  text-transform: uppercase;
}

.experience-timeline {
  margin-left: 8px;
}

.experience-item {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  padding: 0 0 36px 34px;
}

.experience-item::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 16px;
  height: 16px;
  border: 2px solid var(--oc-rule-soft);
  border-radius: 50%;
  background: var(--oc-canvas);
}

.experience-item::after {
  content: "";
  position: absolute;
  top: 23px;
  bottom: -16px;
  left: 8px;
  border-left: 1px solid var(--oc-rule);
}

.experience-item:last-child::after {
  display: none;
}

.experience-period {
  color: var(--oc-ink-subtle);
  line-height: 1.6;
}

.experience-details h3 {
  margin-bottom: 10px;
  color: var(--oc-ink-strong);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
}

.experience-organisation {
  color: var(--oc-ink-muted);
  font-weight: 400;
}

.experience-details > p {
  max-width: 620px;
  color: var(--oc-ink-muted);
  line-height: 1.65;
}

/* -- Framed post lists -------------------------------------------------- */

.post-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-list li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--oc-rule);
  background: var(--oc-surface-data);
  list-style: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.post-list li:hover {
  border-color: var(--oc-ink-subtle);
  background: var(--oc-surface-raised);
  transform: translateX(4px);
}

.post-list li a {
  color: var(--oc-ink-strong);
  text-decoration: none;
}

.post-list li time,
.post-list li span {
  color: var(--oc-ink-subtle);
  font-size: 13px;
  white-space: nowrap;
}

.post-list li:last-child {
  border-bottom: 1px solid var(--oc-rule);
}

/* -- Theme-aware illustrations ----------------------------------------- */

.theme-illustration {
  margin: 0 0 20px;
}

.theme-illustration__image {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  .home-hero {
    padding: 32px 20px;
  }

  .home-experience h2 {
    margin-bottom: 24px;
  }

  .experience-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-left: 30px;
  }

  .experience-details h3 {
    font-size: 16px;
  }

  .post-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.post-header {
  margin-bottom: var(--oc-space-sm);
}

.post-header h3 {
  margin-bottom: var(--oc-space-xs);
}

.post-header h3 a {
  color: var(--oc-ink-strong);
  text-decoration: none;
}

.post-header h3 a:hover {
  color: var(--oc-link);
}

.post-summary {
  margin-top: var(--oc-space-sm);
}

/* -- Social links -------------------------------------------------------- */

.social-links {
  list-style: none;
  display: flex;
  gap: var(--oc-space-md);
  padding: 0;
  margin: 0;
}

.social-links li {
  list-style: none;
}

.social-links a {
  color: var(--oc-ink-subtle);
  text-decoration: none;
  font-size: 20px;
  padding: var(--oc-space-xs);
}

.social-links a:hover {
  color: var(--oc-ink);
}

/* -- Footer -------------------------------------------------------------- */

.page-footer {
  padding: var(--oc-space-xl) 0;
  border-top: 1px solid var(--oc-rule);
}

.footer-copyright {
  font-family: var(--font-mono-docs);
  font-size: 13px;
  line-height: 19.5px;
  color: var(--oc-ink-subtle);
}
