/* Model Mosaic — style.css */

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

body {
  background: #111;
  color: #e0e0e0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

/* --- Header --- */

header {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}

header h1 {
  font-family: "Courier New", monospace;
  font-size: 2.4rem;
  letter-spacing: 0.35em;
  color: #fff;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.08);
}

.tagline {
  font-size: 0.95rem;
  color: #888;
  margin-top: 0.25rem;
  font-style: italic;
}

/* --- Toolbar --- */

.toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
  background: #1a1a1a;
  border-top: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.toolbar-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
}

.toolbar select,
.toolbar button {
  background: #252525;
  color: #e0e0e0;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.toolbar select:hover,
.toolbar button:hover {
  border-color: #666;
}

.toolbar button {
  background: #2a2a2a;
}

.toolbar button:active {
  background: #333;
}

/* --- Main layout --- */

main {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

/* --- Canvas area --- */

.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.canvas-wrapper {
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  padding: 8px;
  display: inline-block;
  overflow: auto;
  max-width: min(78vw, 720px);
  max-height: 75vh;
  cursor: grab;
  user-select: none;
  overscroll-behavior: contain;
}

.canvas-wrapper.dragging {
  cursor: grabbing;
}

#mosaic-canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  max-width: none;
  height: auto;
}

.tooltip {
  margin-top: 0.5rem;
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  color: #888;
  min-height: 1.2em;
  text-align: center;
}

.status-message {
  margin-top: 0.35rem;
  min-height: 1.2em;
  font-size: 0.8rem;
  color: #7e7e7e;
  text-align: center;
}

.status-message[data-type="warning"] {
  color: #d4b26a;
}

.status-message[data-type="error"] {
  color: #e28585;
}

/* --- Layer panel --- */

.layer-panel {
  width: 200px;
  flex-shrink: 0;
}

.layer-panel h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #666;
  margin-bottom: 0.5rem;
}

#layer-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#layer-list button {
  background: #1a1a1a;
  color: #aaa;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  font-family: "Courier New", monospace;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#layer-list button:hover {
  background: #252525;
  color: #e0e0e0;
}

#layer-list button.active {
  background: #2a2a2a;
  color: #fff;
  border-color: #555;
}

.layer-annotation {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #999;
  line-height: 1.5;
  font-style: italic;
  border-left: 2px solid #333;
  padding-left: 0.5rem;
}

/* --- Placard (gallery commentary) --- */

.placard {
  max-width: 700px;
  margin: 0 auto 2rem;
  padding: 1.5rem 2rem;
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
}

.placard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.placard h2 {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 1.3rem;
  color: #fff;
  font-style: italic;
}

.placard-subtitle {
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.15rem;
}

.placard-toggle-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.placard-toggle-btn:hover {
  color: #aaa;
}

.placard-text {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 0.95rem;
  line-height: 1.8;
  color: #ccc;
  white-space: pre-line;
}

/* --- Footer --- */

footer {
  text-align: center;
  padding: 1rem;
  border-top: 1px solid #2a2a2a;
}

.info-bar {
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.credits {
  font-size: 0.75rem;
  color: #555;
}

.credits a {
  color: #888;
  text-decoration: none;
}

.credits a:hover {
  color: #bbb;
  text-decoration: underline;
}

/* --- Responsive --- */

@media (max-width: 768px) {
  main {
    flex-direction: column;
    align-items: center;
  }

  .layer-panel {
    width: 100%;
    max-width: 400px;
  }

  #layer-list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  header h1 {
    font-size: 1.6rem;
    letter-spacing: 0.2em;
  }

  .placard {
    margin: 0 1rem 2rem;
    padding: 1rem;
  }

  .canvas-wrapper {
    max-width: calc(100vw - 2rem);
  }
}
