/* Rusty Camper — Light/Dark Editorial Theme */

:root, [data-theme="light"] {
  --bg: #fafaf8;
  --bg-card: #fff;
  --bg-hover: rgba(0,0,0,0.03);
  --bg-table-head: #f4f2ee;
  --bg-table-hover: #faf8f4;
  --text: #444;
  --text-heading: #333;
  --text-meta: #999;
  --text-excerpt: #777;
  --text-table-note: #777;
  --text-table-qty: #888;
  --text-table-link: #999;
  --link: #333;
  --link-hover: #000;
  --border: #e0ddd5;
  --border-light: #eee;
  --border-table: #f0eeea;
  --rule: #ccc;
  --shadow: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-list: 0 1px 8px rgba(0,0,0,0.08);
  --overlay: rgba(0,0,0,0.85);
  --dropcap: #333;
  --blockquote-border: #ddd;
  --blockquote-text: #666;
  --caption: #888;
  --toggle-bg: #e0ddd5;
  --toggle-dot: #fff;
}

[data-theme="dark"] {
  --bg: #1a1a1a;
  --bg-card: #242424;
  --bg-hover: rgba(255,255,255,0.04);
  --bg-table-head: #2a2a2a;
  --bg-table-hover: #2a2a2a;
  --text: #c8c8c8;
  --text-heading: #e0e0e0;
  --text-meta: #777;
  --text-excerpt: #888;
  --text-table-note: #888;
  --text-table-qty: #777;
  --text-table-link: #777;
  --link: #d0d0d0;
  --link-hover: #fff;
  --border: #333;
  --border-light: #2a2a2a;
  --border-table: #333;
  --rule: #444;
  --shadow: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-list: 0 1px 8px rgba(0,0,0,0.3);
  --overlay: rgba(0,0,0,0.92);
  --dropcap: #e0e0e0;
  --blockquote-border: #444;
  --blockquote-text: #aaa;
  --caption: #888;
  --toggle-bg: #444;
  --toggle-dot: #1a1a1a;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Lora', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); transition: color 0.2s; }
a:hover { color: var(--link-hover); }

/* Layout */
.site-header {
  max-width: 42em;
  margin: 0 auto;
  padding: 3em 1.5em 2em;
  text-align: center;
  position: relative;
}
.site-badge {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-meta);
  margin-bottom: 0.5em;
}
.site-title {
  font-family: 'Lora', serif;
  font-size: 2.4em;
  font-style: italic;
  font-weight: 400;
  color: var(--text-heading);
  line-height: 1.1;
}
.site-title a { text-decoration: none; color: inherit; }
.site-header .rule {
  width: 2em;
  height: 1px;
  background: var(--rule);
  margin: 0.8em auto;
}
.site-tagline {
  font-family: 'Lora', serif;
  font-size: 1em;
  font-style: italic;
  color: var(--text-excerpt);
}
.site-main {
  max-width: 42em;
  margin: 0 auto;
  padding: 0 1.5em;
}
.site-footer {
  max-width: 42em;
  margin: 0 auto;
  padding: 2em 1.5em;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75em;
  color: var(--text-meta);
  text-align: center;
}

/* Theme Toggle */
.theme-toggle {
  position: absolute;
  top: 3em;
  right: 1.5em;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4em;
  line-height: 1;
  padding: 0.2em;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}
.theme-toggle:hover { opacity: 1; }
.theme-toggle::after { content: '☀️'; }
[data-theme="dark"] .theme-toggle::after { content: '🌙'; }

/* Homepage — Hero Post */
.hero {
  padding: 2em 0;
  border-bottom: 1px solid var(--border);
}
.hero-image {
  width: 100%;
  height: 350px;
  object-fit: cover;
  margin-bottom: 1em;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hero .post-date {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7em;
  color: var(--text-excerpt);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hero .post-title {
  font-size: 1.8em;
  font-style: italic;
  font-weight: 400;
  color: var(--text-heading);
  margin: 0.3em 0;
  line-height: 1.3;
}
.hero-link { text-decoration: none; color: inherit; display: block; }
.hero-link:hover .post-title { color: var(--link-hover); }
.hero .post-excerpt {
  font-size: 1em;
  color: var(--text-excerpt);
  line-height: 1.7;
  margin-top: 0.5em;
}

/* Homepage — Post List */
.post-list { list-style: none; }
.post-item {
  border-bottom: 1px solid var(--border-light);
}
.post-item:last-child { border-bottom: none; }
.post-item a.post-link {
  display: flex;
  align-items: flex-start;
  gap: 1.2em;
  padding: 1.5em 0.8em;
  margin: 0 -0.8em;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.post-item a.post-link:hover,
.post-item a.post-link:focus-visible {
  background-color: var(--bg-hover);
  box-shadow: var(--shadow-list);
}
.post-item a.post-link:hover .post-title,
.post-item a.post-link:focus-visible .post-title {
  color: var(--link-hover);
}
.post-thumb {
  width: 140px;
  height: 95px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 6px;
  margin-top: 1.4em;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.post-info { flex: 1; min-width: 0; }
.post-date {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7em;
  color: var(--text-excerpt);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.post-title {
  font-size: 1.2em;
  font-style: italic;
  font-weight: 400;
  color: var(--text-heading);
  margin: 0.2em 0;
  line-height: 1.3;
}
.post-excerpt {
  font-size: 0.9em;
  color: var(--text-excerpt);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Post Page — Image Strip */
.image-strip-wrap {
  margin: 2em auto;
  max-width: 50em;
  padding: 0 1.5em;
  text-align: center;
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.image-strip {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.image-strip:hover,
.hero-image:hover,
.article-body img:hover,
.post-thumb:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
}
.image-strip-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--overlay);
  z-index: 100;
  cursor: pointer;
  justify-content: center;
  align-items: center;
}
.image-strip-overlay.active {
  display: flex;
}
.image-strip-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

/* Post Page — Article */
.article-header {
  max-width: 42em;
  margin: 2em auto 0;
  padding: 0 1.5em;
}
.article-header .post-date {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7em;
  color: var(--text-excerpt);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.article-header .post-title {
  font-size: 2em;
  font-style: italic;
  font-weight: 400;
  color: var(--text-heading);
  margin: 0.3em 0 0.5em;
  line-height: 1.3;
}
.article-header .rule {
  width: 2em;
  height: 2px;
  background: var(--rule);
}
.article-body {
  max-width: 42em;
  margin: 1.5em auto;
  padding: 0 1.5em;
}
.article-body p { margin: 1.2em 0; }
.article-body .dropcap::first-letter {
  font-family: 'Lora', serif;
  font-size: 2.6em;
  float: left;
  line-height: 1;
  margin: 0 0.08em 0 0;
  padding-top: 0.05em;
  color: var(--dropcap);
}
.article-body blockquote {
  border-left: 3px solid var(--blockquote-border);
  padding-left: 1.2em;
  margin: 1.5em 0;
  color: var(--blockquote-text);
  font-style: italic;
}
.article-body figure {
  margin: 1.5em 0;
  text-align: center;
}
.article-body img {
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.article-body figcaption {
  font-size: 0.8em;
  color: var(--caption);
  margin-top: 0.5em;
  font-style: italic;
}
.packing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
  margin: 1.5em 0;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.packing-table th {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-excerpt);
  text-align: left;
  padding: 0.8em 1em;
  background: var(--bg-table-head);
  border-bottom: 2px solid var(--border);
}
.packing-table td {
  padding: 0.6em 1em;
  border-bottom: 1px solid var(--border-table);
  vertical-align: top;
}
.packing-table td:nth-child(2) {
  text-align: center;
  color: var(--text-table-qty);
  white-space: nowrap;
}
.packing-table td:nth-child(3) {
  font-size: 0.9em;
  color: var(--text-table-note);
  font-style: italic;
}
.packing-table tbody tr:last-child td { border-bottom: none; }
.packing-table tbody tr:hover { background: var(--bg-table-hover); }
.packing-table a {
  color: var(--text-table-link);
  font-size: 0.85em;
  text-decoration: none;
  border-bottom: 1px dotted var(--rule);
}
.packing-table a:hover { color: var(--link-hover); border-bottom-color: var(--text-meta); }
.article-body h1, .article-body h2, .article-body h3 {
  font-family: 'Lora', serif;
  font-weight: 700;
  color: var(--text-heading);
  margin: 1.5em 0 0.5em;
}

/* Comments */
.comments {
  max-width: 42em;
  margin: 3em auto;
  padding: 0 1.5em;
  border-top: 1px solid var(--border-light);
}
.comments h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-meta);
  margin: 1.5em 0 1em;
}
.comment {
  margin-bottom: 1.5em;
  padding-bottom: 1.5em;
  border-bottom: 1px solid var(--border-light);
}
.comment:last-child { border-bottom: none; }
.comment-author {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8em;
  font-weight: 500;
  color: var(--text-heading);
}
.comment-date {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7em;
  color: var(--text-meta);
}
.comment-body { margin-top: 0.5em; font-size: 0.9em; }

/* Navigation */
.post-nav {
  max-width: 42em;
  margin: 0 auto;
  padding: 2em 1.5em;
  display: flex;
  justify-content: space-between;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8em;
  border-top: 1px solid var(--border-light);
}
.post-nav a { text-decoration: none; color: var(--text-excerpt); }
.post-nav a:hover { color: var(--text-heading); }

/* Responsive */
@media (max-width: 600px) {
  body { font-size: 18px; }
  .site-header { padding: 2em 1em 1.5em; }
  .site-tagline { font-size: 1.05em; }
  .site-main { padding: 0 1em; }
  .site-footer { padding: 2em 1em; }
  .hero-image { height: 200px; }
  .hero .post-title { font-size: 1.3em; }
  .post-item a.post-link { flex-direction: column; gap: 0.8em; padding: 1.2em 0.5em; margin: 0 -0.5em; }
  .post-thumb { width: 100%; height: 180px; margin-top: 0; }
  .image-strip-wrap { width: auto; position: static; left: auto; transform: none; padding: 0; }
  .image-strip { height: auto; }
  .article-header { padding: 0 1em; }
  .article-header .post-title { font-size: 1.5em; }
  .article-body { padding: 0 1em; line-height: 1.7; }
  .article-body h1 { font-size: 1.3em; }
  .article-body h2 { font-size: 1.15em; }
  .article-body h3 { font-size: 1.05em; }
  .comments { padding: 0 1em; }
  .post-excerpt { font-size: 1em; line-height: 1.4; }
  .post-date { font-size: 0.75em; }
  .post-nav { padding: 2em 1em; font-size: 0.8em; }
  .theme-toggle { top: 2em; right: 1em; font-size: 1em; }
}
