/* raw.gif ruotato */
.raw-left { transform: rotate(180deg); }

/* GRIGLIA ANNI: 6 colonne fisse */
#grid {
  display: grid;
  grid-template-columns: repeat(6, 140px);
  gap: 12px;
  justify-content: center;
  margin: 20px 0;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

/* bottoni anni: altezza 28px richiesta */
.site-button {
  background: #f2f2f2;
  border: 1px solid #ccc;
  text-align: center;
  font-weight: bold;
  padding: 0 8px;
  font-size: 0.9rem;
  cursor: pointer;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.site-button.active {
  background: maroon;
  color: white;
}

/* wrapper thumb-row: span full grid and use same 6 columns */
.thumb-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, 140px);
  gap: 12px;
  justify-content: center;
  margin: 8px 0 18px 0;
  box-sizing: border-box;
  z-index: 2;
  background: transparent;
}

/* thumb cells */
.thumb-box {
  text-align: center;
  cursor: pointer;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  padding: 6px 4px;
}

.thumb-box.empty { background: transparent; min-height: 120px; }

.thumb-img {
  width: 140px;
  height: 120px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  background: #f6f6f6;
}

.thumb-caption {
  font-size: 0.85rem;
  margin-top: 6px;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Accessibility focus */
.site-button:focus { outline: 2px solid #b56565; outline-offset: 2px; }
.thumb-img:focus { outline: 2px solid #b56565; outline-offset: 2px; }

/* responsive fallback */
@media (max-width: 640px) {
  #grid { grid-template-columns: repeat(2, 1fr); }
  .thumb-row { grid-template-columns: repeat(2, 1fr); }
  .thumb-img { width: 100%; height: auto; }
}
