:root {
  --ff-sans: 'Inter', sans-serif;
  --ff-display: 'DM Serif Display', serif;
  --clr-bg: #fff;
  --clr-text: #222;
  --clr-accent: #4f46e5;
  --clr-light: #f5f5f5;
  --space: 1.5rem;
  --radius: 8px;
  --transition: 0.2s ease;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  display: flex;
  min-height: 100vh;
  font-family: var(--ff-sans);
  color: var(--clr-text);
  background: var(--clr-light);
}

/* — Sidebar — */
#sidebar {
  width: 220px;
  background: var(--clr-bg);
  border-right: 1px solid #e0e0e0;
  padding: var(--space);
}
#sidebar ul { list-style:none; }
#sidebar li {
  margin-bottom: var(--space);
  cursor: pointer;
  font-weight: 600;
  color: #555;
  transition: color var(--transition);
}
#sidebar li.active,
#sidebar li:hover { color: var(--clr-accent); }

/* — Panels — */
#content {
  flex: 1;
  padding: calc(var(--space)*1.5);
  overflow-y: auto;
}
.panel {
  max-width: 720px;
  margin: 0 auto calc(var(--space)*2);
}
.hidden { display: none !important; }

/* — Typography — */
h1 {
  font-family: var(--ff-display);
  font-size: 3rem;
  margin-bottom: var(--space);
}
h2 {
  font-family: var(--ff-display);
  font-size: 2rem;
  margin-bottom: var(--space);
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5rem;
}
.lede {
  font-size: 1.25rem;
  margin-bottom: var(--space);
  color: #444;
}
p,label { line-height: 1.6; margin-bottom: var(--space); }
a { color: var(--clr-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* — Cards & Forms — */
.card {
  background: var(--clr-bg);
  border-radius: var(--radius);
  padding: var(--space);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: var(--space);
}
.form-card label { display: block; margin-bottom: var(--space); }
.form-card input,
.form-card textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  font-family: var(--ff-sans);
  margin-top: 0.5rem;
}
.form-card button {
  background: var(--clr-accent);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}
.form-card button:hover { background: #3730a3; }
.link-button {
  background: none;
  border: none;
  color: var(--clr-accent);
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: var(--space);
}

/* — Snake Game — */
#gameCanvas {
  display: block;
  margin: var(--space) auto;
  background: #000;
  border-radius: var(--radius);
}

/* — Photo Gallery — */
.upload-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: var(--space);
}
#galleryContainer.masonry {
  column-count: 3;
  column-gap: 1rem;
}
#galleryContainer img {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  display: block;
}
@media (max-width: 768px) { #galleryContainer.masonry { column-count: 2; } }
@media (max-width: 500px) { #galleryContainer.masonry { column-count: 1; } }

/* — Blog List & Detail — */
.post-list button {
  width: 100%;
  text-align: left;
  padding: 0.75rem;
  border: none;
  background: var(--clr-light);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: background var(--transition);
}
.post-list button:hover { background: #eaeaea; }
.post-detail h3 { margin-bottom: 0.5rem; }
.post-detail article { margin-bottom: var(--space); }

/* — Daily panel centering — */
#daily {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;               /* override .panel margins */
  padding-top: var(--space);
  padding-bottom: var(--space);
}
/* constrain the card widths */
#daily .card {
  width: 100%;
  max-width: 600px;
}

/* — Responsive — */
@media (max-width: 900px) {
  #sidebar { display: none; }
  body { flex-direction: column; }
  #content { padding: var(--space); }
}
