/* Islands of Home review app, hand-written CSS */
:root {
  --teal: #0ea5a5;
  --fuchsia: #e91e63;
  --cream: #fff9e6;
  --paper: #f5ecc8;
  --ink: #2a2419;
  --muted: #6b6356;
  --line: #e6dec3;
  --bg: #faf6e8;
  --amber: #c9a449;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}
.titles h1 { font-size: 20px; margin: 0 0 4px; font-weight: 700; }
.titles .sub { margin: 0; color: var(--muted); font-size: 13px; max-width: 720px; }
.reviewer { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.reviewer select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; background: white; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: var(--cream); }
.chip {
  padding: 6px 12px; font-size: 12px; border: 1px solid var(--line);
  background: white; color: var(--ink); border-radius: 999px; cursor: pointer;
}
.chip.active { background: var(--teal); color: white; border-color: var(--teal); }
.chip:hover:not(.active) { background: var(--paper); }

.grid {
  display: grid; gap: 14px; padding: 18px 28px 40px;
  grid-template-columns: repeat(6, 1fr);
}
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); padding: 12px 14px 32px; } }

.tile {
  background: white; border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  transition: transform 0.12s, box-shadow 0.12s;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.tile:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.tile-img-wrap { aspect-ratio: 4 / 3; background: var(--paper); position: relative; }
.tile-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-blocked {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: #e8e3d0; color: var(--muted); font-size: 11px; font-weight: 600;
  text-align: center; padding: 12px; letter-spacing: 0.04em;
}
.tile-cap { padding: 8px 10px 10px; font-size: 12px; }
.tile-id { font-weight: 700; color: var(--ink); font-size: 11px; }
.tile-meta { color: var(--muted); font-size: 11px; margin-top: 2px; }
.tile-badges { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.badge {
  display: inline-block; font-size: 10px; padding: 2px 6px; border-radius: 3px;
  background: var(--paper); color: var(--ink);
}
.badge.note-count { background: var(--teal); color: white; }
.badge.note-count.zero { background: var(--line); color: var(--muted); }
.badge.survivor { background: var(--fuchsia); color: white; }
.badge.blocked { background: var(--amber); color: white; }

.lightbox {
  position: fixed; inset: 0; background: rgba(20, 16, 8, 0.88);
  z-index: 100; display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
#lb-img[hidden], #lb-blocked[hidden] { display: none; }
.lb-close, .lb-nav {
  position: absolute; background: rgba(255,255,255,0.12); color: white;
  border: 1px solid rgba(255,255,255,0.25); cursor: pointer;
  font-size: 24px; line-height: 1;
}
.lb-close { top: 14px; right: 18px; width: 38px; height: 38px; border-radius: 50%; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,0.22); }

.lb-inner {
  display: flex; gap: 20px; padding: 40px 70px;
  width: 100%; max-width: 1500px; height: 100%; max-height: 100vh;
}
.lb-figure {
  flex: 1; margin: 0; display: flex; align-items: center; justify-content: center;
  background: var(--paper); border-radius: 6px; overflow: hidden; position: relative;
  min-width: 0;
}
.lb-figure img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.lb-blocked {
  font-size: 18px; font-weight: 600; color: var(--muted); padding: 30px; text-align: center;
  letter-spacing: 0.05em;
}
.lb-panel {
  width: 380px; background: white; border-radius: 6px;
  padding: 18px 20px; overflow-y: auto; flex-shrink: 0;
}
.lb-panel h2 { margin: 0 0 4px; font-size: 16px; }
.lb-meta { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.lb-pitch { font-size: 13px; color: var(--ink); margin: 0 0 12px; }
.survivor-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 0 0 12px; padding: 8px; background: var(--cream); border-radius: 4px; cursor: pointer; }
.lb-panel h3 { font-size: 13px; margin: 14px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.notes { list-style: none; padding: 0; margin: 0 0 12px; }
.notes li { font-size: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 6px; background: var(--cream); }
.notes .note-head { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 4px; font-size: 11px; color: var(--muted); }
.notes .sev { display: inline-block; padding: 1px 6px; border-radius: 3px; font-weight: 600; font-size: 10px; }
.notes .sev.fix-needed { background: #fce4e4; color: #b00020; }
.notes .sev.inconsistency { background: #fff4d6; color: #8a6500; }
.notes .sev.suggestion { background: #e0f1f1; color: #0a6e6e; }
.notes .sev.approved { background: #e3f3e2; color: #2e7d32; }
.note-form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.note-form label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.note-form select, .note-form textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; }
.note-form textarea { resize: vertical; }
.note-form button { padding: 8px 12px; background: var(--teal); color: white; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; font-size: 13px; }
.note-form button:hover { background: #0c8e8e; }
.form-msg { font-size: 12px; color: var(--muted); margin: 4px 0 0; min-height: 16px; }
.form-msg.error { color: #b00020; }
.form-msg.ok { color: #2e7d32; }

@media (max-width: 860px) {
  .lb-inner { flex-direction: column; padding: 50px 14px 14px; gap: 12px; }
  .lb-figure { flex: 0 1 50%; min-height: 220px; }
  .lb-panel { width: 100%; max-height: 50%; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
}
