/* nord.css — trimmed theme styles for systemhalted.in */

:root {
  --font-sans: "Rubik", "Noto Sans", "Helvetica Neue", Helvetica, sans-serif;
  --font-display: "Rubik", "Noto Sans", "Helvetica Neue", Helvetica, sans-serif;
  --font-mono: "Source Code Pro", "Fira Code", Menlo, Monaco, "Courier New", monospace;
}

.theme-nord-light {
  color-scheme: light;
  --nord0: #2e3440;
  --nord1: #3b4252;
  --nord2: #434c5e;
  --nord3: #4c566a;
  --nord4: #d8dee9;
  --nord5: #e5e9f0;
  --nord6: #eceff4;
  --nord7: #8fbcbb;
  --nord8: #88c0d0;
  --nord9: #81a1c1;
  --nord10: #5e81ac;
  --nord11: #bf616a;
  --nord12: #d08770;
  --nord13: #ebcb8b;
  --nord14: #a3be8c;
  --nord15: #b48ead;
  --bg: var(--nord6);
  --bg-alt: var(--nord5);
  --surface: var(--nord6);
  --surface-strong: var(--nord5);
  --border: var(--nord4);
  --text: var(--nord3);
  --text-strong: var(--nord0);
  --muted: var(--nord3);
  --link: var(--nord10);
  --link-hover: var(--nord9);
  --accent: var(--nord8);
  --accent-strong: var(--nord10);
  --on-accent: var(--nord6);
  --shadow: 0 12px 28px rgba(46, 52, 64, 0.12);
  --shadow-strong: 0 16px 36px rgba(46, 52, 64, 0.18);
  --code-bg: var(--nord5);
  --code-text: var(--nord11);
  --code-border: var(--nord4);
  --sidebar-bg: var(--nord0);
  --sidebar-text: var(--nord4);
  --sidebar-link: var(--nord6);
  --sidebar-border: var(--nord2);
  --footer-bg: var(--nord5);
}

.theme-nord-dark {
  color-scheme: dark;
  --nord0: #2e3440;
  --nord1: #3b4252;
  --nord2: #434c5e;
  --nord3: #4c566a;
  --nord4: #d8dee9;
  --nord5: #e5e9f0;
  --nord6: #eceff4;
  --nord7: #8fbcbb;
  --nord8: #88c0d0;
  --nord9: #81a1c1;
  --nord10: #5e81ac;
  --nord11: #bf616a;
  --nord12: #d08770;
  --nord13: #ebcb8b;
  --nord14: #a3be8c;
  --nord15: #b48ead;
  --bg: var(--nord0);
  --bg-alt: var(--nord1);
  --surface: var(--nord1);
  --surface-strong: var(--nord2);
  --border: var(--nord2);
  --text: var(--nord4);
  --text-strong: var(--nord6);
  --muted: var(--nord4);
  --link: var(--nord8);
  --link-hover: var(--nord7);
  --accent: var(--nord8);
  --accent-strong: var(--nord10);
  --on-accent: var(--nord6);
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  --shadow-strong: 0 16px 36px rgba(0, 0, 0, 0.45);
  --code-bg: var(--nord1);
  --code-text: var(--nord6);
  --code-border: var(--nord2);
  --sidebar-bg: var(--nord1);
  --sidebar-text: var(--nord4);
  --sidebar-link: var(--nord6);
  --sidebar-border: var(--nord2);
  --footer-bg: var(--nord1);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
}

@media (min-width: 38em) {
  html {
    font-size: 19px;
  }
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

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

a:hover,
a:focus {
  color: var(--link-hover);
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0.5rem 0;
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--text-strong);
  font-weight: 700;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 1rem;
}

h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
}

h4,
h5,
h6 {
  font-size: 1rem;
  margin-top: 1rem;
}

p {
  margin: 0 0 1rem;
}

ul,
ol,
dl {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

dt {
  font-weight: 700;
}

dd {
  margin: 0 0 0.5rem;
}

strong {
  color: var(--text-strong);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

abbr {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  border-bottom: 1px dotted var(--border);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 0 1rem;
  border-radius: 6px;
}

code,
pre {
  font-family: var(--font-mono);
}

code {
  padding: 0.2em 0.4em;
  font-size: 0.85em;
  color: var(--code-text);
  background: var(--code-bg);
  border-radius: 4px;
}

pre {
  margin: 0 0 1rem;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  overflow-x: auto;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

blockquote {
  padding: 0.6rem 1rem;
  margin: 1rem 0;
  color: var(--text);
  background: var(--surface);
  border-left: 4px solid var(--border);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

td,
th {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
}

tbody tr:nth-child(odd) td,
tbody tr:nth-child(odd) th {
  background: var(--surface);
}

.message {
  margin-bottom: 1rem;
  padding: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.wrap {
  position: relative;
  width: 100%;
}

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.masthead {
  padding: 1rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.masthead .container {
  padding-left: calc(5.5rem + env(safe-area-inset-left));
  padding-right: calc(1rem + env(safe-area-inset-right));
}

.masthead-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.masthead-title {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.6rem;
  font-weight: 800;
}

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

.masthead-title small {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: 0.35rem;
  display: inline;
}

.theme-toggle {
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-strong);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  background: var(--surface-strong);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-toggle-label {
  display: inline-block;
}

@media (max-width: 48em) {
  .masthead .container {
    padding-left: calc(5rem + env(safe-area-inset-left));
    padding-right: calc(1rem + env(safe-area-inset-right));
  }

  .masthead-title small {
    display: block;
    margin-left: 0;
  }

  .theme-toggle {
    margin-left: 0;
  }
}

.sidebar-checkbox {
  position: absolute;
  opacity: 0;
  user-select: none;
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: -14rem;
  width: 14rem;
  visibility: hidden;
  overflow-y: auto;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--sidebar-text);
  background: var(--sidebar-bg);
  transition: all 0.3s ease-in-out;
}

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

.sidebar-item {
  padding: 1rem;
}

.sidebar-item p:last-child {
  margin-bottom: 0;
}

.sidebar-nav {
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-nav-item {
  display: block;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-nav-item.active,
a.sidebar-nav-item:hover,
a.sidebar-nav-item:focus {
  text-decoration: none;
  background: var(--sidebar-border);
  color: var(--sidebar-link);
}

.sidebar-toggle {
  position: absolute;
  top: 0.8rem;
  left: 1rem;
  display: flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  color: var(--text-strong);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  cursor: pointer;
}

.sidebar-toggle::before {
  content: "";
  width: 24px;
  height: 16px;
  margin-right: 0.35rem;
  background-image:
    linear-gradient(currentColor 0 0),
    linear-gradient(currentColor 0 0),
    linear-gradient(currentColor 0 0);
  background-size: 24px 2px;
  background-position: center top, center, center bottom;
  background-repeat: no-repeat;
}

.sidebar-toggle:active,
#sidebar-checkbox:focus ~ .sidebar-toggle,
#sidebar-checkbox:checked ~ .sidebar-toggle {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--on-accent);
}

.sidebar-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap,
.sidebar,
.sidebar-toggle {
  backface-visibility: hidden;
  transition: transform 0.3s ease-in-out;
}

#sidebar-checkbox:checked + .sidebar {
  visibility: visible;
}

#sidebar-checkbox:checked ~ .sidebar,
#sidebar-checkbox:checked ~ .wrap,
#sidebar-checkbox:checked ~ .sidebar-toggle {
  transform: translateX(14rem);
}

@media (min-width: 30em) {
  .sidebar-toggle {
    position: fixed;
  }
}

@media print {
  .sidebar-toggle {
    display: none;
  }
}

.page,
.post {
  margin-bottom: 4rem;
}

.content .post,
.content .page {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.page-title,
.post-title,
.post-title a {
  color: var(--text-strong);
}

.page-title,
.post-title {
  margin-top: 0;
}

.post-date {
  display: block;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  color: var(--muted);
}

.post-featured {
  margin: 1rem 0 1.5rem;
}

.post-featured figcaption {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.post-categories,
.post-tags {
  margin-top: 1rem;
  font-size: 0.95rem;
}

.post-categories a,
.post-tags a {
  display: inline-block;
  margin: 0 0.35rem 0.35rem 0;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.post-categories a:hover,
.post-tags a:hover {
  background: var(--surface-strong);
  text-decoration: none;
}

.related {
  padding-top: 2rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--border);
}

.related-posts {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.related-posts h3 {
  margin-top: 0;
}

.related-posts li {
  margin-bottom: 0.6rem;
}

.related-posts li small {
  font-size: 0.8rem;
  color: var(--muted);
}

.post-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.post-list li {
  margin-bottom: 0.5rem;
}

.post-list-date {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 1rem 0 2rem;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

.card-media {
  display: block;
  position: relative;
  padding-top: 62%;
  background: linear-gradient(135deg, var(--nord9), var(--nord10));
  overflow: hidden;
}

.card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-accent);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 1px;
}

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

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.card-title {
  margin: 0.25rem 0 0.35rem;
  font-size: 1.2rem;
  line-height: 1.3;
}

.card-title a {
  color: var(--text-strong);
}

.card-excerpt {
  margin: 0 0 0.65rem;
  color: var(--text);
  line-height: 1.45;
  font-size: 0.98rem;
  flex: 1;
}

.card-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.author-name {
  color: var(--text-strong);
  font-weight: 600;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 0.4rem 0.7rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-strong);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.page-btn:hover,
.page-btn:focus {
  background: var(--surface-strong);
  text-decoration: none;
}

.page-btn.active {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--on-accent);
}

.page-btn.disabled {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--border);
  cursor: not-allowed;
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  color: var(--muted);
  font-weight: 600;
}

.collection-list,
.category-posts {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.collection-item {
  margin-bottom: 1.2rem;
}

.collection-item-date {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.2;
}

.collection-item-title a {
  display: inline-block;
  margin-top: 0.1rem;
}

.category-block {
  margin-bottom: 1.25rem;
}

.category-block summary {
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
}

.category-block summary::marker {
  content: "";
}

.category-block summary::-webkit-details-marker {
  display: none;
}

.category-count {
  color: var(--muted);
  font-weight: 500;
  margin-left: 0.25rem;
}

.category-posts {
  margin: 0.5rem 0 0;
}

.category-posts li {
  display: flex;
  align-items: baseline;
  margin: 0.2rem 0;
}

.category-posts .post-list-date {
  white-space: nowrap;
  margin-right: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.tag-box {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-box.inline {
  display: flex;
}

.tag-box a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.tag-box a:hover {
  background: var(--surface-strong);
  text-decoration: none;
}

.archive-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 1.5rem;
}

.archive-controls label {
  font-size: 0.9rem;
  color: var(--muted);
}

.archive-sort {
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-strong);
}

.archive-year {
  margin-bottom: 1.5rem;
}

.archive-year-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.archive-year-summary::marker,
.archive-post-summary::marker {
  content: "";
}

.archive-year-summary::-webkit-details-marker,
.archive-post-summary::-webkit-details-marker {
  display: none;
}

.archive-year-summary::after {
  content: "";
  margin-left: auto;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.archive-year-summary:focus-visible,
.archive-post-summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.archive-year-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-strong);
}

.archive-year-count {
  font-size: 0.75em;
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.25rem;
}

.archive-year[open] > .archive-year-summary {
  background: var(--surface-strong);
  box-shadow: 0 6px 16px rgba(46, 52, 64, 0.08);
}

.archive-year[open] > .archive-year-summary::after {
  transform: rotate(-135deg);
}

.archive-posts {
  list-style: none;
  padding-left: 0;
  margin: 0.75rem 0 0;
}

.archive-post-details {
  margin: 0.5rem 0;
}

.archive-post-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.archive-post-summary::after {
  content: "";
  margin-left: auto;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.archive-post-details[open] > .archive-post-summary {
  background: var(--surface-strong);
  border-color: var(--border);
}

.archive-post-details[open] > .archive-post-summary::after {
  transform: rotate(-135deg);
}

.archive-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.archive-post-title {
  color: var(--text-strong);
  font-weight: 600;
  text-decoration: none;
}

.archive-post-title:hover {
  color: var(--link-hover);
  text-decoration: none;
}

.archive-post-description {
  margin: 0.4rem 0 0.6rem 1.2rem;
  padding-left: 0.8rem;
  border-left: 2px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer {
  margin-top: 3rem;
  padding: 2.5rem 0 2rem;
  border-top: 1px solid var(--border);
  background: var(--footer-bg);
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  align-items: start;
}

.footer-brand {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.footer-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--nord9), var(--nord10));
  color: var(--on-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
}

.footer-title {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-strong);
}

.footer-subtitle {
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.footer-description {
  margin: 0.15rem 0 0.5rem;
  color: var(--text);
  line-height: 1.5;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-heading {
  font-weight: 800;
  color: var(--text-strong);
  margin-bottom: 0.35rem;
}

.footer-column a,
.footer-subscribe a {
  color: var(--text-strong);
}

.footer-subscribe {
  display: flex;
  flex-direction: column;
}

.footer-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  background: var(--accent-strong);
  color: var(--on-accent);
  border: 1px solid var(--accent-strong);
}

.footer-button.ghost {
  background: transparent;
  color: var(--accent-strong);
  border-color: var(--accent-strong);
}

.footer-meta {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.alignleft {
  float: left;
  margin: 0.25rem 1rem 0.75rem 0;
}

.alignright {
  float: right;
  margin: 0.25rem 0 0.75rem 1rem;
}

.aligncenter {
  display: block;
  margin: 0.5rem auto 1rem;
}

.wp-caption {
  max-width: 100%;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem;
}

.wp-caption-text,
.wp-caption-dd {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.pull-quote {
  font-size: 1.1rem;
  font-style: italic;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-left: 4px solid var(--accent);
  background: var(--surface);
}

.org-src-container {
  margin: 1rem 0;
}

.org-ul {
  margin: 0 0 1rem;
}
