:root {
  --primary-color: #d62828;
  --secondary-color: #0077b6;
}

/* PAGE */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  background: #f4f4f4;
}

/* CONTAINER */
.container {
  background: white;
  border: 2px solid var(--secondary-color);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;

  max-width: 500px;
  width: 90%;

  box-shadow: 0 4px 12px rgba(0,0,0,0.15);

  display: flex;
  flex-direction: column;
  align-items: center;
}

/* HEADER */
.header {
  text-align: center;
  padding: 10px;
  background: var(--primary-color);
  color: white;
  font-size: 18px;
  width: 100%;
  border-radius: 8px;
  margin-bottom: 15px;
}

/* IMAGE */
.image-wrapper {
  width: 100%;
}

.image-container {
  position: relative;
  width: 100%;
}

.image-container img {
  display: block;
  width: 100%;
  border-radius: 12px;
}

/* INFO BOX */
.info-box {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%) scale(0.98);

  width: 88%;
  padding: 16px;

  background: rgba(255,255,255,0.85);
  border-radius: 16px;
  backdrop-filter: blur(10px);

  box-shadow: 0 8px 20px rgba(0,0,0,0.15);

  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;

  max-height: 60%;
  overflow-y: auto;
}

.info-box.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* TEXT */
.info-title {
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.info-body {
  text-align: left;
  line-height: 1.5;
}

.info-body ul {
  margin: 0;
  padding-left: 18px;
}

/* CAPTION / LEGEND */
.caption {
  margin-top: 8px;
  color: #555;
  text-align: center;

  display: -webkit-box;
  -webkit-line-clamp: 2; /* 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;

  position: relative;
  cursor: pointer;

  padding-right: 20px; /* space for arrow */
}

/* Show arrow only if truncated */
.caption.truncated::after {
  content: "▼";
  position: absolute;
  right: 0;
  bottom: 0;
  color: var(--secondary-color);
  font-weight: bold;
  font-size: 14px;
  line-height: 1;
  background: white; /* separate from text */
  padding-left: 2px;
}

/* Expanded caption */
.caption.expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.caption.expanded::after {
  display: none;
}

/* PILL SELECTOR */
.selector-row {
  width: 100%;
  margin-top: 12px;
  margin-bottom: 8px;
}

.pill-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  width: 100%;
}

.pill-container::-webkit-scrollbar {
  display: none;
}

.pill {
  flex: 0 0 auto;

  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #ccc;

  background: #f1f1f1;
  color: #333;

  font-size: 14px;
  cursor: pointer;

  white-space: nowrap;

  transition: all 0.2s ease;
}

.pill:hover {
  background: #e0e0e0;
}

.pill.active {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);

  box-shadow: 0 0 0 2px rgba(0,119,182,0.3);
}

/* BUTTON ROW */
.buttons-row {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
  height: 120px;
}

/* LEFT BUTTON: IN A NUTSHELL */
.nutshell-btn {
  flex: 1;
  height: 100%;

  border: none;
  border-radius: 8px;
  background: var(--primary-color);
  color: white;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: background 0.2s ease, transform 0.1s ease;
}

/* NUTSHELL HOVER */
.nutshell-btn:hover {
  background: #b71c1c;
}

/* RIGHT COLUMN BUTTONS */
.buttons {
  flex: 2;
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
}

/* BUTTONS */
.buttons button {
  width: 100%;
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 8px;
  background: #0096c7;
  color: white;
  cursor: pointer;

  transition: background 0.2s ease, transform 0.1s ease;
}

.buttons button:hover {
  background: #0077b6;
}

.buttons button:active,
.nutshell-btn:active {
  transform: scale(0.97);
}

/* ACTIVE BUTTONS */
button.active {
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.6);
}

.buttons button.active {
  background: #005f87;
}

.nutshell-btn.active {
  background: #a61b1b;
}