/* ===== Zac S. Blog — Multi-Theme System ===== */

/* ===== Theme: Canopy (default) ===== */
:root, [data-theme="canopy"] {
  --color-bg: #fafaf5;
  --color-surface: #ffffff;
  --color-text: #2c3422;
  --color-text-secondary: #6b6b5e;
  --color-accent: #3a5a2a;
  --color-accent-light: #e4edda;
  --color-border: #e5e2d8;
  --color-border-light: #f0ede6;
}

/* ===== Theme: Shoreline ===== */
[data-theme="shoreline"] {
  --color-bg: #faf8f5;
  --color-surface: #ffffff;
  --color-text: #2a2430;
  --color-text-secondary: #7a7280;
  --color-accent: #e84825;
  --color-accent-light: #fde8e1;
  --color-border: #e2ddd6;
  --color-border-light: #f0ece6;
}

/* ===== Theme: Golden Hour ===== */
[data-theme="golden-hour"] {
  --color-bg: #faf9f5;
  --color-surface: #ffffff;
  --color-text: #2e2a24;
  --color-text-secondary: #7a7268;
  --color-accent: #8b5e2a;
  --color-accent-light: #f4ead6;
  --color-border: #e5e0d5;
  --color-border-light: #f0ebe0;
}

/* ===== Fonts ===== */
:root {
  --font-body: 'Source Serif 4', 'Georgia', serif;
  --font-heading: 'DM Sans', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 720px;
  --max-width-wide: 960px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--color-text); }

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

/* ===== Typography ===== */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

h1 { font-size: 2.2rem; letter-spacing: -0.02em; margin-bottom: 0.5em; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; margin-top: 2em; margin-bottom: 0.5em; }
h3 { font-size: 1.15rem; margin-top: 1.5em; margin-bottom: 0.4em; }

p { margin-bottom: 1.2em; }

blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.2em 0 0.2em 1.2em;
  margin: 1.5em 0;
  color: var(--color-text-secondary);
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-border-light);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 1.2em 1.5em;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5em 0;
  line-height: 1.5;
}
pre code { background: none; padding: 0; color: inherit; }

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5em 0;
}

ul, ol { margin-bottom: 1.2em; padding-left: 1.4em; }
li { margin-bottom: 0.3em; }

/* ===== Layout ===== */
.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 1.2em 2em;
  background: var(--color-surface);
  transition: background 0.3s, border-color 0.3s;
}

.header-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.site-title:hover { color: var(--color-accent); }

.site-nav { display: flex; gap: 1.8em; align-items: center; }
.site-nav a {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: 0.01em;
}
.site-nav a:hover { color: var(--color-text); }
.site-nav a.active { color: var(--color-accent); }

/* ===== Theme Switcher ===== */
.theme-switcher {
  display: flex;
  gap: 6px;
  margin-left: 1.2em;
  padding-left: 1.2em;
  border-left: 1px solid var(--color-border);
}

.theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.theme-dot:hover { transform: scale(1.2); }
.theme-dot.active { border-color: var(--color-text); }

.theme-dot[data-set="canopy"] { background: #3a5a2a; }
.theme-dot[data-set="shoreline"] { background: #e84825; }
.theme-dot[data-set="golden-hour"] { background: #8b5e2a; }

/* Mobile nav */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5em; }
.nav-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--color-text); margin: 4px 0;
  transition: 0.3s;
}

.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3em 2em 5em;
}

.wide-content {
  max-width: var(--max-width-wide);
}

/* ===== Home Page ===== */
.home-intro {
  margin-bottom: 3em;
}
.home-intro p {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  max-width: 560px;
}

.section-label {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: 1em;
}

.home-section { margin-bottom: 3.5em; }

/* ===== Cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2em;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.4em 1.5em;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.3em;
  color: var(--color-text);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 0.6em;
}

.card-meta {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
}

.tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--color-accent-light);
  color: var(--color-accent);
  padding: 0.2em 0.6em;
  border-radius: 3px;
  margin-right: 0.4em;
}

/* ===== Post / Essay List ===== */
.post-list { list-style: none; padding: 0; }

.post-item {
  padding: 1.2em 0;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5em;
}
.post-item:last-child { border-bottom: none; }

.post-item-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
}
.post-item-title:hover { color: var(--color-accent); }

.post-item-date {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.post-item-category {
  font-size: 0.78rem;
  color: var(--color-accent);
  font-family: var(--font-heading);
}

/* ===== Article Layout ===== */
.article-header { margin-bottom: 2.5em; }
.article-header h1 { margin-bottom: 0.3em; }

.article-meta {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  display: flex;
  gap: 1.5em;
  flex-wrap: wrap;
}

.article-content { font-size: 1.05rem; }
.article-content p:first-of-type {
  font-size: 1.12rem;
  color: var(--color-text-secondary);
}

/* ===== About / Now ===== */
.page-header { margin-bottom: 2em; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2em;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  transition: border-color 0.3s;
}
.site-footer a { color: var(--color-text-secondary); }
.site-footer a:hover { color: var(--color-accent); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  html { font-size: 16px; }
  .site-header { padding: 1em 1.2em; }
  .main-content { padding: 2em 1.2em 3em; }

  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 1em 1.5em;
    gap: 0.8em;
  }
  .site-nav.open { display: flex; }

  .theme-switcher {
    border-left: none;
    margin-left: 0;
    padding-left: 0;
    padding-top: 0.6em;
    border-top: 1px solid var(--color-border);
    margin-top: 0.4em;
  }

  .header-inner { position: relative; }
  h1 { font-size: 1.7rem; }
  .card-grid { grid-template-columns: 1fr; }
  .post-item { flex-direction: column; gap: 0.2em; }
}
