/*
Theme Name: Lab Notes
Theme URI: https://example.com/lab-notes
Author: Steve D
Description: A dark modular lab-notes theme with terminal-inspired windows for posts, projects, and skills.
Version: 0.1.0
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 8.0
Text Domain: lab-notes
*/

:root {
  color-scheme: dark;
  --bg: var(--wp--preset--color--background, #090909);
  --text: var(--wp--preset--color--text, #eeeeea);
  --muted: var(--wp--preset--color--muted, #9aa3a3);
  --body: var(--wp--preset--color--body, #b9beb9);
  --line: rgba(255, 255, 255, 0.075);
  --line: color-mix(in srgb, var(--text) 8%, transparent);
  --accent: var(--wp--preset--color--accent, #d7e82a);
  --panel: var(--wp--preset--color--panel, #090909);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --radius: 6px;
  --sans: "Noto Sans", "Inter", "Helvetica Neue", Arial, ui-sans-serif, system-ui, sans-serif;
  --mono: "Noto Sans Mono", "Roboto Mono", "SFMono-Regular", "Cascadia Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

.app-shell {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 54px;
}

.app-shell > *,
.dashboard > *,
.main-grid > *,
.wp-block-template-part {
  margin-block-start: 0;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(243px, 342px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 54px;
  display: grid;
  gap: 24px;
  min-width: 0;
  max-width: 100%;
  padding-top: 88px;
}

.profile,
.stack-card {
  display: grid;
  gap: 22px;
}

.portrait {
  overflow: hidden;
  width: 90px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f5f5f0;
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile h2,
.feature-body h2,
.entry-copy h3,
.repo h3,
.timeline-item h3,
.post-title,
.related-item h3 {
  margin: 0;
  color: var(--text);
  font-weight: 560;
  letter-spacing: -0.02em;
}

.profile h2 {
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  line-height: 1.15;
}

.handle,
.window-title,
.stack-title,
.note-meta,
.date,
.count,
.mini-pill,
.post-meta,
.eyebrow,
.related-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 430;
  line-height: 1.35;
  text-transform: uppercase;
}

.handle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--accent);
}

.handle.is-offline {
  color: var(--muted);
}

.handle.is-offline .status-dot {
  background: #5f6462;
}

.profile-copy,
.repo p,
.timeline-item p,
.entry-copy p,
.post-dek,
.post-body p,
.post-body li,
.post-note p,
.related-item p {
  margin: 0;
  color: var(--body);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.48;
}

.post-dek,
.post-body p,
.post-body li,
.post-note p {
  font-size: 0.88rem;
  line-height: 1.62;
}

.path-list {
  display: grid;
  gap: 12px;
}

.stack-title {
  font-family: var(--mono);
}

.style-list {
  display: grid;
  gap: 10px;
}

.path-link,
.style-link {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.style-link {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-decoration: none;
}

.style-link:hover,
.style-link[aria-current="true"] {
  color: var(--text);
}

.style-swatch {
  width: 30px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background:
    linear-gradient(135deg, var(--style-bg) 0 48%, var(--style-accent) 48% 68%, var(--style-text) 68% 100%);
}

.style-link[aria-current="true"] .style-swatch {
  border-color: var(--accent);
}

.style-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-pill,
.note-meta span,
.read-link,
.post-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
}

.read-link,
.back-link {
  color: var(--accent);
}

.back-link {
  font-family: var(--sans);
  text-transform: none;
  white-space: nowrap;
}

.main-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px;
  min-width: 0;
}

.single .main-grid {
  grid-template-columns: minmax(0, 1fr);
}

.wide {
  grid-column: 1 / -1;
}

.window {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  padding: 0 18px;
  background: var(--panel);
}

.window-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-family: var(--mono);
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.window-nav-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-separator {
  color: var(--muted);
}

.lights {
  position: relative;
  flex: 0 0 auto;
  width: 37px;
  height: 7px;
}

.lights::before {
  position: absolute;
  inset: 0 auto auto 0;
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 3px;
  background: #d9d9d4;
  box-shadow: 15px 0 0 #d9d9d4, 30px 0 0 #d9d9d4;
}

.window-body {
  padding: 18px;
}

.feature-body {
  display: grid;
  align-content: start;
  gap: 16px;
}

.note-meta,
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-body h2 {
  max-width: 760px;
  font-size: clamp(1.4rem, 2.35vw, 2.3rem);
  line-height: 1.1;
}

.feature-title-link {
  color: inherit;
}

.feature-body p {
  max-width: 720px;
  margin: 0;
  color: var(--body);
  font-size: 0.9rem;
  line-height: 1.55;
}

.article-list,
.repo-grid,
.timeline,
.related-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.article-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) max-content;
  gap: 14px;
  align-items: start;
  min-height: 104px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.article-row:last-child,
.repo:last-child,
.timeline-item:last-child,
.related-item:last-child {
  border-bottom: 0;
}

.entry-copy,
.related-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.entry-copy h3,
.repo h3,
.timeline-item h3,
.related-item h3 {
  font-size: 0.92rem;
  line-height: 1.38;
}

.entry-copy h3 {
  font-weight: 450;
}

.type-dot {
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.type-dot.note {
  background: #d7e82a;
}

.type-dot.project {
  background: #7db7ff;
}

.type-dot.skill {
  background: #b890ff;
}

.type-dot.long {
  background: #f2a65a;
}

.count {
  text-align: right;
  white-space: nowrap;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}

.repo {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 170px;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.repo:last-child {
  border-right: 0;
}

.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline {
  display: grid;
}

.timeline-item,
.related-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.timeline-dot {
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 3px;
  background: var(--accent);
}

.post-shell {
  display: grid;
  gap: 24px;
  max-width: 920px;
}

.post-header {
  display: grid;
  gap: 18px;
}

.post-title {
  max-width: 780px;
  font-size: clamp(1.8rem, 4vw, 3.45rem);
  line-height: 1.03;
}

.post-dek {
  max-width: 720px;
  font-size: clamp(0.98rem, 1.5vw, 1.12rem);
  line-height: 1.56;
}

.post-feature-image {
  max-width: 820px;
  margin: 0 0 10px;
}

.post-feature-image img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.post-body {
  display: grid;
  gap: 20px;
  max-width: 700px;
}

.post-body h2,
.post-body h3,
.post-body h4 {
  margin: 14px 0 0;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.post-body ul,
.post-body ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 1.1rem;
}

.post-body blockquote {
  margin: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  color: var(--body);
}

.post-body code {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.84em;
}

.post-body pre,
.post-body .wp-block-code,
.post-body [class*="code-block"] {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto !important;
  overflow-y: visible !important;
}

.post-body pre,
.post-body pre code,
.post-body pre code *,
.post-body .wp-block-code,
.post-body .wp-block-code code,
.post-body .wp-block-code code *,
.post-body [class*="code-block"] pre,
.post-body [class*="code-block"] pre *,
.post-body [class*="code-block"] code,
.post-body [class*="code-block"] code * {
  white-space: pre-wrap !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-note {
  display: grid;
  gap: 10px;
  max-width: 700px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

@media (max-width: 1200px) {
  .app-shell {
    padding: 28px;
  }

  .dashboard {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    padding-top: 0;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 12px;
  }

  .dashboard,
  .main-grid,
  .window {
    min-width: 0;
  }

  .main-grid,
  .repo-grid {
    grid-template-columns: 1fr;
  }

  .window-title,
  .feature-body h2,
  .entry-copy h3,
  .repo h3,
  .timeline-item h3,
  .post-title,
  .related-item h3 {
    overflow-wrap: anywhere;
  }

  .feature-body h2 {
    font-size: clamp(1.25rem, 8vw, 1.75rem);
  }

  .feature-body {
    min-height: 0;
  }

  .style-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .style-link {
    display: inline-flex;
    width: 30px;
    height: 22px;
  }

  .style-name {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .style-swatch {
    width: 30px;
    height: 22px;
  }

  .article-row,
  .repo,
  .timeline-item {
    border-right: 0;
  }

  .repo {
    border-bottom: 1px solid var(--line);
  }
}
