:root {
  --pink: #e85d8a;
  --pink-dark: #c94070;
  --cream: #fdf6f0;
  --text: #3a2e2e;
  --border: #ecd9d0;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--cream);
  color: var(--text);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.site-header .brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--pink-dark);
  text-decoration: none;
}
.site-header nav a { color: var(--text); text-decoration: none; }

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

.hero { text-align: center; padding: 2rem 1rem 3rem; }
.hero h1 { font-size: 2.4rem; color: var(--pink-dark); margin-bottom: 0.5rem; }
.hero p { color: #6b5a5a; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.category-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.15s ease;
}
.category-card:hover { transform: translateY(-3px); }
.category-card img { width: 100%; height: 180px; object-fit: cover; display: block; background: var(--border); }
.category-title { display: block; padding: 0.8rem 1rem; font-weight: 600; }

.back-link { color: var(--pink-dark); text-decoration: none; }
.category-detail h1 { color: var(--pink-dark); margin-top: 0.5rem; }
.category-description { white-space: pre-line; color: #6b5a5a; max-width: 70ch; }

.theme-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: center;
  padding: 1rem;
  margin-bottom: 2rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.theme-jump a { color: var(--pink-dark); text-decoration: none; font-size: 0.9rem; }
.theme-jump a:hover { text-decoration: underline; }

.theme-section {
  padding-top: 2rem;
  margin-bottom: 4rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 1rem;
}
.theme-section:first-of-type { border-top: none; }
.theme-section h2 { color: var(--pink-dark); font-size: 1.6rem; margin-bottom: 0.3rem; }

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.image-grid figure { margin: 0; background: #fff; border-radius: 8px; overflow: hidden; }
.image-grid img { width: 100%; height: 200px; object-fit: cover; display: block; }
.image-grid figcaption { padding: 0.5rem; font-size: 0.85rem; color: #6b5a5a; }

.site-footer { text-align: center; padding: 2rem; color: #9b8888; font-size: 0.85rem; }

.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 1000; align-items: center; justify-content: center; cursor: pointer; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; user-select: none; }
.lightbox-close { position: absolute; top: 20px; right: 32px; color: #fff; font-size: 40px; font-weight: 300; line-height: 1; cursor: pointer; user-select: none; }
.lightbox-close:hover { color: var(--pink); }
.image-grid img { cursor: pointer; }

/* --- admin --- */
.admin-body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; background: #f4f0ee; color: var(--text); padding: 2rem; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.admin-header nav a { margin-left: 1rem; color: var(--pink-dark); text-decoration: none; }

.login-form {
  max-width: 320px; margin: 4rem auto; background: #fff; padding: 2rem;
  border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); display: flex; flex-direction: column; gap: 1rem;
}
.login-form h1 { margin: 0 0 0.5rem; font-size: 1.3rem; color: var(--pink-dark); }
.form-error { color: #b3261e; margin: 0; }

label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; }
label.checkbox { flex-direction: row; align-items: center; gap: 0.5rem; }
input[type="text"], input[type="password"], input[type="number"], textarea {
  padding: 0.5rem; border: 1px solid var(--border); border-radius: 6px; font-size: 1rem;
}

button, .btn {
  background: var(--pink); color: #fff; border: none; border-radius: 6px;
  padding: 0.6rem 1.2rem; font-size: 0.95rem; cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { background: var(--pink-dark); }
.btn-danger { background: #b3261e; }
.btn-danger:hover { background: #8f1e18; }
.btn-small { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; margin-top: 1rem; }
.admin-table th, .admin-table td { padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table a { color: var(--pink-dark); text-decoration: none; }

.category-form { display: flex; flex-direction: column; gap: 1rem; max-width: 500px; background: #fff; padding: 1.5rem; border-radius: 10px; margin-top: 1rem; }
.image-upload { margin-top: 2rem; }
.admin-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin-top: 1rem; }
.admin-image-grid figure { margin: 0; background: #fff; border-radius: 8px; overflow: hidden; text-align: center; padding-bottom: 0.5rem; }
.admin-image-grid img { width: 100%; height: 130px; object-fit: cover; display: block; margin-bottom: 0.4rem; }
.hint { color: #6b5a5a; }
