/* ============================================
   Design System — bdavey619.github.io
   Minimalist, text-first, personal library feel
   ============================================ */

:root {
  /* Colors */
  --bg: #fafaf8;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --link: #1a1a1a;
  --link-hover: #4a4a4a;
  --border: #e0e0dc;
  --code-bg: #f0f0ec;
  --tag-bg: #eeeee9;
  --tag-active-bg: #1a1a1a;
  --tag-active-text: #fafaf8;

  /* Typography */
  --font-body: Georgia, "Times New Roman", Times, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* Spacing */
  --max-width: 640px;
  --gutter: 1.5rem;

  /* Sizes */
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
}

[data-theme="dark"] {
  --bg: #1a1a1a;
  --text: #e0e0dc;
  --text-muted: #999;
  --link: #e0e0dc;
  --link-hover: #bbb;
  --border: #333;
  --code-bg: #252525;
  --tag-bg: #2a2a2a;
  --tag-active-bg: #e0e0dc;
  --tag-active-text: #1a1a1a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1a1a;
    --text: #e0e0dc;
    --text-muted: #999;
    --link: #e0e0dc;
    --link-hover: #bbb;
    --border: #333;
    --code-bg: #252525;
    --tag-bg: #2a2a2a;
    --tag-active-bg: #e0e0dc;
    --tag-active-text: #1a1a1a;
  }
}

/* ---- Reset & Base ---- */

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---- Layout ---- */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- Header & Nav ---- */

header {
  padding: 2.5rem 0 1rem;
}

.site-title {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.site-name {
  font-family: var(--font-ui);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}

.site-status {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

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

nav a {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--text);
}

/* ---- Nav Actions (toggle + menu) ---- */

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ---- Dark Mode Toggle ---- */

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--text);
}

/* ---- Mobile Menu ---- */

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding: 0.25rem 0;
}

.menu-toggle:hover {
  color: var(--text);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem 0 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.mobile-nav a {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
}

.mobile-nav a:hover {
  color: var(--text);
}

.mobile-nav[hidden] {
  display: none;
}

/* ---- Main Content ---- */

main {
  padding: 1rem 0 2.5rem;
}

main > .section:first-child {
  margin-top: -0.25rem;
}

h1 {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 0.75rem;
}

h2 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: 1.3;
  margin: 1.5rem 0 0.75rem;
}

h3 {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

p {
  margin: 0 0 1.25rem;
}

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

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

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

ul, ol {
  padding-left: 1.5rem;
  margin: 0 0 1.25rem;
}

li {
  margin-bottom: 0.35rem;
}

/* ---- Horizontal Rules ---- */

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

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

pre code {
  background: none;
  padding: 0;
}

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

blockquote {
  margin: 0 0 1.25rem;
  padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--border);
  color: var(--text-muted);
}

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

/* ---- Section Helpers ---- */

.section {
  margin-bottom: 0;
}

.section-label {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a8f98;
  margin: 0 0 0.875rem;
  display: flex;
  align-items: center;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: #c7ccd1;
  margin-right: 10px;
  flex-shrink: 0;
}

[data-theme="dark"] .section-label {
  color: #9ca0a8;
}

[data-theme="dark"] .section-label::before {
  background: #3e4249;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .section-label {
    color: #9ca0a8;
  }

  :root:not([data-theme="light"]) .section-label::before {
    background: #3e4249;
  }
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: var(--text-sm);
}

/* ---- Entry List (shared pattern) ---- */

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

.entry {
  padding: 1.25rem 0;
  border-bottom: 1.5px solid var(--border);
}

.entry:first-child {
  padding-top: 0;
}

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

.entry-title {
  font-family: inherit;
  font-weight: 600;
  margin: 0 0 0.2rem;
}

.entry-meta {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.entry-desc {
  font-family: var(--font-ui);
  font-style: normal;
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.entry-links {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  margin: 0;
}

.entry-links a {
  text-decoration: none;
}

.entry-links a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.entry-link-primary {
  font-weight: 600;
}

.entry-sep {
  color: var(--text-muted);
  margin: 0 0.4rem;
}

/* ---- Article / Post ---- */

article .post-date {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.5rem;
}

/* ---- Quotes ---- */

.quote-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-ui);
}

.quote-tags button {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  background: var(--tag-bg);
  color: var(--text);
  border: none;
  padding: 0.3rem 0.75rem;
  border-radius: 3px;
  cursor: pointer;
}

.quote-tags button:hover {
  opacity: 0.8;
}

.quote-tags button.active {
  background: var(--tag-active-bg);
  color: var(--tag-active-text);
}

.quote-text {
  font-size: var(--text-base);
  line-height: 1.5;
  margin-bottom: 0.35rem;
}

.quote-attr {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.quote-note {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-style: italic;
}

/* ---- Principles ---- */

.principles {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 0.25rem;
  margin-bottom: 0;
  line-height: 1.3;
}

/* ---- Season Meta ---- */

.season-meta {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: -0.25rem 0 0.5rem;
}


/* ---- Season Photo Strip ---- */

.season-photo-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.season-photo-slot {
  aspect-ratio: 3 / 2;
  background: var(--tag-bg);
  border-radius: 2px;
}

@media (max-width: 600px) {
  .season-photo-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Monthly Lead / Archive ---- */

.monthly-title {
  font-size: var(--text-lg);
  font-family: var(--font-body);
  font-weight: 400;
  margin: 0.15rem 0 0.4rem;
  line-height: 1.3;
}

.monthly-body {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.monthly-body + .monthly-body {
  margin-top: 1.25rem;
}

.monthly-link {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  margin: 0;
}

.monthly-link a {
  text-decoration: none;
}

.monthly-link a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- Photos intro ---- */

.photos-intro {
  margin-bottom: 0;
}

/* ---- Shipped Link ---- */

.shipped-link {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- Build List ---- */

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

.build-item {
  margin-bottom: 0.9rem;
}

.build-title {
  font-family: inherit;
  font-weight: 400;
}

.build-note {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.35;
}

/* ---- Projects Page Spacing ---- */

.projects-main .section-label {
  margin-top: 40px;
  margin-bottom: 12px;
}

.projects-main .section-label:first-child {
  margin-top: 0.5rem;
}

.projects-main .entry:last-child {
  padding-bottom: 8px;
}

/* ---- Project Context ---- */

.project-context {
  font-family: var(--font-ui);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--text-muted);
  opacity: 0.8;
  margin: 5px 0 0.5rem;
  line-height: 1.5;
}

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

.contact-links {
  display: flex;
  gap: 1.25rem;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
}

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

footer {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

footer p {
  margin: 0;
}

.footer-status {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
  :root {
    --text-base: 1rem;
    --text-2xl: 1.5rem;
    --text-xl: 1.15rem;
    --gutter: 1.25rem;
  }

  header {
    padding: 1.25rem 0 0.5rem;
  }

  main {
    padding: 1rem 0 2rem;
  }

  .nav-links {
    display: none !important;
  }

  .menu-toggle {
    display: block;
  }

  hr {
    margin: 1.25rem 0;
  }

  .build-item {
    margin-bottom: 0.7rem;
  }

  footer {
    padding: 0.75rem 0;
  }
}

/* ---- Photo Grid ---- */

.container--wide {
  max-width: 960px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 1.5rem;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.photo-grid img:hover {
  opacity: 0.85;
}

@media (max-width: 700px) {
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Lightbox ---- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.25rem;
  font-family: var(--font-ui);
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  padding: 0;
}

.lightbox-close:hover {
  opacity: 0.5;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font-ui);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 1rem;
  z-index: 10;
  opacity: 0.35;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-prev { left: 0.5rem; }
.lightbox-next { right: 0.5rem; }

/* ---- Print ---- */

@media print {
  body {
    background: white;
    color: black;
    font-size: 11pt;
  }

  .theme-toggle,
  .quote-tags {
    display: none !important;
  }

  a {
    color: black;
  }

  footer {
    border-top: 1px solid #ccc;
  }
}
