/* Assume Chaos — Brutalist B&W Blog Theme */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap');

body {
  margin: 0;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.ac-contact-open {
  overflow: hidden;
}

a {
  color: inherit;
}

main {
  min-height: calc(100vh - 8rem);
}

.assumechaos-header {
  /* Header uses the 'dark' variables regardless of site mode */
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  padding: 2rem 1rem 1.75rem;
}

.assumechaos-header--compact {
  padding: 1rem 1rem;
}

.assumechaos-header-inner,
.ac-post-index,
.ac-post-detail {
  width: min(100%, 40rem);
  margin: 0 auto;
}

.assumechaos-header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.assumechaos-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.assumechaos-site-name {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.assumechaos-site-name--compact {
  font-size: 1.25rem;
}

.assumechaos-site-mark {
  color: hsl(var(--primary));
}

.assumechaos-tagline {
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
  font-weight: 300;
}

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

.assumechaos-nav-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font: 400 0.75rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: color 120ms ease;
}

.assumechaos-nav-link:hover,
.assumechaos-nav-link:focus-visible {
  color: hsl(var(--foreground));
  outline: none;
}

.ac-post-index,
.ac-post-detail {
  padding: 2.5rem 1rem 4rem;
}

.ac-featured {
  padding-bottom: 2rem;
}

.ac-label,
.ac-post-nav-label,
.ac-more-posts-label,
.bn-references-label {
  display: block;
  margin-bottom: 0.75rem;
  color: hsl(var(--primary));
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.ac-featured-title,
.ac-post-detail-title {
  margin: 0;
  color: hsl(var(--foreground));
  font-weight: 700;
  letter-spacing: -0.03em;
}

.ac-featured-title {
  font-size: 1.5rem;
  line-height: 1.2;
}

.ac-featured-title a,
.ac-post-nav-item,
.ac-post-row {
  text-decoration: none;
}

.ac-featured-title a:hover,
.ac-post-nav-item:hover .ac-post-nav-title {
  color: hsl(var(--primary));
}

.ac-date,
.ac-post-date,
.ac-post-detail-date {
  color: hsl(var(--muted-foreground));
  font: 400 0.75rem/1.4 var(--font-mono);
}

.ac-featured-excerpt {
  margin: 0.85rem 0 1rem;
  color: hsl(var(--muted-foreground));
  font-size: 1rem;
  line-height: 1.7;
}

.ac-featured-read {
  text-align: right;
}

.ac-featured-read a {
  color: hsl(var(--primary));
  font-size: 0.875rem;
  font-weight: 500;
}

.ac-post-list {
  display: flex;
  flex-direction: column;
}

.ac-post-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid hsl(var(--border));
  transition: background-color 120ms ease, color 120ms ease;
}

.ac-post-row:hover {
  background-color: hsl(var(--muted));
}

.ac-post-row:hover .ac-post-title {
  color: hsl(var(--primary));
}

.ac-post-title,
.ac-post-nav-title {
  color: hsl(var(--foreground));
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.45;
  transition: color 120ms ease;
}

.ac-post-title {
  flex: 1 1 auto;
  min-width: 0;
}

.ac-empty-state,
.ac-render-error {
  margin-top: 1rem;
  padding: 1rem 0;
  color: hsl(var(--muted-foreground));
  border-top: 1px solid hsl(var(--border));
  font-size: 0.9375rem;
}

.ac-render-error {
  color: hsl(var(--primary));
}

.ac-post-detail-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: var(--border-width) solid hsl(var(--foreground));
}

.ac-post-detail-title {
  font-size: clamp(2rem, 4vw, 2.3rem);
  line-height: 1.08;
}

.ac-post-detail-date {
  display: inline-block;
  margin-top: 0.65rem;
}

.ac-post-body {
  color: hsl(var(--muted-foreground));
  font-size: 1rem;
  line-height: 1.75;
}

.ac-post-body p,
.ac-post-body ul,
.ac-post-body ol,
.ac-post-body blockquote,
.ac-post-body pre,
.ac-post-body figure,
.ac-post-body details,
.ac-post-body .bn-statement,
.ac-post-body .bn-references {
  margin: 0 0 1.4rem;
}

.ac-post-body h1,
.ac-post-body h2,
.ac-post-body h3,
.ac-post-body h4,
.ac-post-body h5,
.ac-post-body h6 {
  color: hsl(var(--foreground));
  font-weight: 700;
  line-height: 1.2;
}

.ac-post-body h2 {
  margin: 2.5rem 0 0.85rem;
  font-size: 1.25rem;
}

.ac-post-body h3 {
  margin: 2rem 0 0.7rem;
  font-size: 1.05rem;
}

.ac-post-body a {
  color: hsl(var(--primary));
  text-decoration: none;
}

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

.ac-post-body blockquote {
  padding-left: 1rem;
  border-left: 3px solid hsl(var(--primary));
  color: hsl(var(--muted-foreground));
  font-style: italic;
}

.ac-post-body code,
.ac-post-body pre,
.ac-post-body .bn-references li::before {
  font-family: var(--font-mono);
}

.ac-post-body code {
  padding: 0.15rem 0.35rem;
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
  font-size: 0.8125rem;
}

.ac-post-body pre {
  overflow-x: auto;
  padding: 1.1rem 1.15rem;
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
  font-size: 0.8125rem;
  line-height: 1.65;
}

.ac-post-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.ac-post-body ul,
.ac-post-body ol {
  padding-left: 1.35rem;
}

.ac-post-body li {
  margin-bottom: 0.4rem;
}

.ac-post-body img,
.ac-post-body video {
  display: block;
  width: 100%;
  height: auto;
}

.ac-post-body figcaption {
  margin-top: 0.6rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
}

.ac-post-body table {
  width: 100%;
  border-collapse: collapse;
}

.ac-post-body th,
.ac-post-body td {
  padding: 0.7rem 0.8rem;
  border: 1px solid hsl(var(--border));
  text-align: left;
  vertical-align: top;
}

.ac-post-body th {
  color: hsl(var(--foreground));
  font-weight: 600;
}

.ac-post-body details summary {
  color: hsl(var(--foreground));
}

.ac-post-body .check-list-item input {
  margin-top: 0.2rem;
}

.ac-post-body .bn-statement {
  margin-left: -1rem;
  margin-right: -1rem;
  padding: 1.35rem 1.5rem;
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.ac-post-body .bn-statement p:last-child {
  margin-bottom: 0;
}

.ac-post-body .bn-references {
  padding-top: 1.25rem;
  border-top: var(--border-width) solid hsl(var(--foreground));
}

.ac-post-body .bn-references ol {
  list-style: none;
  counter-reset: ac-references;
  margin: 0;
  padding: 0;
}

.ac-post-body .bn-references li {
  position: relative;
  padding-left: 2rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
  line-height: 1.6;
}

.ac-post-body .bn-references li::before {
  content: counter(ac-references);
  counter-increment: ac-references;
  position: absolute;
  left: 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
}

.ac-post-nav,
.ac-more-posts {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
}

.ac-post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  border-top: var(--border-width) solid hsl(var(--foreground));
}

.ac-post-nav-next {
  text-align: right;
}

.ac-post-nav-item {
  display: inline-block;
}

.ac-post-nav-item--next {
  text-align: right;
}

.ac-post-nav-label {
  color: hsl(var(--muted-foreground));
}

.ac-more-posts {
  border-top: 1px solid hsl(var(--border));
}

.ac-post-list--more .ac-post-row:first-child {
  border-top: 0;
}

.ac-contact-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 1000;
}

.ac-contact-overlay[hidden] {
  display: none;
}

.ac-contact-modal {
  position: relative;
  width: min(100%, 27.5rem);
  padding: 2rem;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

.ac-contact-close {
  position: absolute;
  top: 0.85rem;
  right: 0.95rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.ac-contact-title {
  margin: 0 0 1rem;
  color: hsl(var(--foreground));
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ac-contact-form {
  display: grid;
  gap: 0.9rem;
}

.ac-contact-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.8rem 0;
  border: 0;
  border-bottom: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--foreground));
  font: 400 0.95rem/1.5 var(--font-body);
  outline: none;
}

.ac-contact-input::placeholder {
  color: hsl(var(--muted-foreground));
}

.ac-contact-input:focus {
  border-bottom-color: hsl(var(--primary));
}

.ac-contact-textarea {
  min-height: 8rem;
  resize: vertical;
}

.ac-contact-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.25rem;
}

.ac-contact-submit {
  padding: 0.8rem 1.2rem;
  border: 0;
  background-color: hsl(var(--foreground));
  color: hsl(var(--background));
  font: 500 0.875rem/1 var(--font-body);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.ac-contact-submit:hover,
.ac-contact-submit:focus-visible {
  background-color: hsl(var(--primary));
  outline: none;
}

.ac-contact-response,
.assumechaos-form-error,
.assumechaos-form-success {
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
  line-height: 1.5;
}

.assumechaos-form-error {
  color: hsl(var(--primary));
}

.assumechaos-form-success {
  color: hsl(var(--foreground));
}

@media (max-width: 42rem) {
  .assumechaos-header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .assumechaos-header-nav {
    gap: 1rem;
  }

  .ac-post-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .ac-post-nav {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .ac-post-nav-next,
  .ac-post-nav-item--next {
    text-align: left;
  }

  .ac-contact-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
