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

:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --card: #0f3460;
  --accent: #e94560;
  --text: #eee;
  --text-muted: #aaa;
  --radius: 8px;
  --photo-max-width: 65%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 2px solid var(--accent);
  padding: 1rem 2rem;
}

.site-header nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.site-title:hover { color: var(--accent); text-decoration: none; }

.site-logo {
  height: 32px;
  width: auto;
  vertical-align: middle;
  margin-right: 0.5rem;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--surface);
}

/* Page Header */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 2rem; margin-bottom: 0.5rem; }

/* Build Grid */
.build-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.build-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  color: var(--text);
  display: block;
}

.build-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  text-decoration: none;
}

.card-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 1rem 1.2rem;
}

.card-body h2 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.card-body time {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.card-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Single Build Page */
.build-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--surface);
}

.build-header h1 { font-size: 2rem; margin-bottom: 0.3rem; }
.build-header time { color: var(--text-muted); display: block; margin-bottom: 0.5rem; }

.kit-info {
  display: inline-block;
  background: var(--surface);
  padding: 0.2rem 0.7rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
  color: var(--text-muted);
}

.build-content { font-size: 1rem; line-height: 1.8; }
.build-content p { margin-bottom: 1rem; }
.build-content h2 { font-size: 1.4rem; margin: 2rem 0 0.5rem; }
.build-content h3 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; }

/* Photo Shortcode */
.photo {
  margin: 1.5rem auto;
  max-width: var(--photo-max-width);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.photo img {
  width: 100%;
  display: block;
  cursor: zoom-in;
}

/* Lightbox Overlay */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.photo-badge { max-width: fit-content; background: none;}
.photo-badge img { width: auto; max-width: 100%; }

.photo figcaption {
  padding: 0.6rem 1rem;
  font-size: 1rem;
  color: var(--text-muted);
  text-align: center;
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background: #c73650;
}

/* Responsive */
@media (max-width: 600px) {
  .site-header { padding: 0.8rem 1rem; }
  .site-header nav { gap: 1rem; }
  .site-title { font-size: 1.1rem; }
  .build-grid { grid-template-columns: 1fr; }
  .page-header h1, .build-header h1 { font-size: 1.5rem; }
  main { padding: 1rem; }
}
