:root {
  --bg: #0c1016;
  --panel: #131922;
  --panel-border: #1f2733;
  --text: #d7dee6;
  --text-dim: #7c8896;
  --amber: #e8a33d;
  --green: #5ec78b;
  --red: #e05c5c;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  padding: 0 0 4rem;
}
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 1.5rem; }

nav.site-nav {
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 2rem;
}
nav.site-nav .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}
nav.site-nav .brand {
  font-weight: 600;
  color: var(--text);
  margin-right: auto;
}
nav.site-nav a {
  color: var(--text-dim);
  font-size: 0.9rem;
}
nav.site-nav a.active { color: var(--amber); }

h1 { font-size: 1.4rem; font-weight: 600; margin: 0 0 1.5rem; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.gallery-tile {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  overflow: hidden;
  display: block;
}
.gallery-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.gallery-tile .caption { padding: 0.75rem 0.9rem; }
.gallery-tile .caption .title { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.gallery-tile .caption .date { font-family: var(--mono); font-size: 0.7rem; color: var(--text-dim); margin-top: 0.2rem; }
.empty-state { color: var(--text-dim); font-size: 0.95rem; padding: 3rem 0; text-align: center; }

.photo-detail img { width: 100%; border-radius: 6px; border: 1px solid var(--panel-border); }
.photo-detail .title { font-size: 1.3rem; font-weight: 600; margin: 1.25rem 0 0.5rem; }
.photo-detail .date { font-family: var(--mono); font-size: 0.8rem; color: var(--text-dim); margin-bottom: 1rem; }
.photo-detail .description { line-height: 1.6; white-space: pre-wrap; }
.back-link { display: inline-block; margin-bottom: 1.5rem; font-size: 0.9rem; }

.upload-form {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 1.5rem;
  max-width: 480px;
}
.upload-form label { display: block; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 0.4rem; margin-top: 1rem; }
.upload-form label:first-child { margin-top: 0; }
.upload-form input[type="text"], .upload-form textarea, .upload-form input[type="file"] {
  width: 100%;
  background: #0c1016;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  color: var(--text);
  padding: 0.6rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.95rem;
}
.upload-form textarea { min-height: 100px; resize: vertical; }
.upload-form button {
  margin-top: 1.5rem;
  background: var(--amber);
  color: #1a1206;
  border: none;
  border-radius: 4px;
  padding: 0.7rem 1.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.upload-form button:hover { opacity: 0.9; }
.flash {
  background: rgba(94, 199, 139, 0.15);
  border: 1px solid var(--green);
  color: var(--green);
  padding: 0.8rem 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* Weather dashboard specific */
.site {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.site h2 { margin: 0 0 1rem; font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 0.6rem; }
.site h2 .loc { color: var(--text-dim); font-weight: 400; font-size: 0.85rem; }
.readout-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; font-family: var(--mono); }
.readout { background: #0c1016; border: 1px solid var(--panel-border); border-radius: 4px; padding: 0.7rem 0.9rem; }
.readout .label { font-size: 0.7rem; color: var(--text-dim); margin-bottom: 0.3rem; }
.readout .value { font-size: 1.15rem; }
.value.clear, .value.dry, .value.calm { color: var(--green); }
.value.cloudy, .value.windy, .value.wet, .value.very-cloudy, .value.very-windy, .value.rain { color: var(--amber); }
.image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.image-tile { background: #0c1016; border: 1px solid var(--panel-border); border-radius: 4px; padding: 0.6rem; }
.image-tile img { width: 100%; display: block; border-radius: 3px; cursor: zoom-in; }
.image-tile .label { font-family: var(--mono); font-size: 0.7rem; color: var(--text-dim); margin-top: 0.5rem; }
.image-tile .missing { font-family: var(--mono); font-size: 0.75rem; color: var(--red); padding: 1.5rem 0; text-align: center; }
.stale-note { font-family: var(--mono); font-size: 0.75rem; color: var(--text-dim); margin-top: 0.9rem; }
.raw-line { font-family: var(--mono); font-size: 0.7rem; color: var(--text-dim); margin-top: 1rem; word-break: break-all; }
.local-time { font-family: var(--mono); color: var(--amber); font-size: 1.8rem; font-weight: 600; letter-spacing: 0.03em; margin-bottom: 1rem; }
.countdown { font-family: var(--mono); font-size: 0.8rem; color: var(--text-dim); margin-top: 0.2rem; }
.countdown span { color: var(--amber); }
.roof-badge { display: inline-block; font-family: var(--mono); font-size: 1rem; font-weight: 600; padding: 0.3rem 0.8rem; border-radius: 4px; margin-bottom: 1rem; letter-spacing: 0.03em; }
.roof-badge.open { background: rgba(94, 199, 139, 0.15); color: var(--green); border: 1px solid var(--green); }
.roof-badge.closed { background: rgba(255,255,255,0.05); color: var(--text-dim); border: 1px solid var(--panel-border); }
.roof-badge.opening, .roof-badge.closing { background: rgba(232, 163, 61, 0.15); color: var(--amber); border: 1px solid var(--amber); }
.roof-badge.error, .roof-badge.unknown { background: rgba(224, 92, 92, 0.15); color: var(--red); border: 1px solid var(--red); }
.updated { font-family: var(--mono); font-size: 0.8rem; color: var(--text-dim); }

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 9, 0.9);
  z-index: 50;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 2rem;
}
#lightbox.open { display: flex; }
#lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
