body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f4f6f8;
  color: #333;
}

header {
  background: #005fa3;
  color: white;
  padding: 2rem;
  text-align: center;
}

/* ===== IMAGEM INTERATIVA (MONTADA COM PEDAÇOS) ===== */
.imagem-interativa {
  padding: 2rem;
  background: white;
  margin: 2rem auto;
  max-width: 1200px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.imagem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: auto;
  gap: 0;
  width: 100%;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
  font-size: 0;
  align-items: start;
}

.imagem-pedaco {
  position: relative;
  width: 100%;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: #f8f9fa;
  margin: 0;
  padding: 0;
  line-height: 0;
  display: block;
  align-self: start;
}

.imagem-pedaco img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
  margin: 0;
  padding: 0;
  line-height: 0;
  border: none;
  outline: none;
}

.imagem-pedaco:hover {
  transform: scale(1.02);
  z-index: 5;
  box-shadow: 0 4px 15px rgba(0, 95, 163, 0.3);
}

.imagem-pedaco:hover img {
  transform: scale(1.05);
}

.linha-cabecalho {
  cursor: default;
}

.linha-cabecalho:hover {
  transform: none;
  box-shadow: none;
}

.linha-cabecalho:hover img {
  transform: none;
}

/* Responsividade */
@media (max-width: 768px) {
  .imagem-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(12, auto);
  }
}

/* ===== MODAIS ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.3s;
}

.modal.show {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 0;
  border: none;
  border-radius: 10px;
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s;
  display: flex;
  flex-direction: column;
  position: relative;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content h2 {
  margin: 0;
  padding: 1.5rem;
  padding-right: 4.5rem; /* Espaço para o botão de fechar */
  color: white;
  border-radius: 10px 10px 0 0;
  font-size: 1.5rem;
}

/* Cores por coluna */
.modal-col1 .modal-content h2 {
  background: #488f4f; /* Verde claro - Coluna 1 */
}

.modal-col2 .modal-content h2 {
  background: #c49703; /* Amarelo claro - Coluna 2 */
}

.modal-col3 .modal-content h2 {
  background: #416a99; /* Azul claro - Coluna 3 */
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #333;
  background: rgba(255, 255, 255, 0.9);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.8rem;
  font-weight: bold;
  cursor: pointer;
  line-height: 2.5rem;
  text-align: center;
  transition: all 0.2s;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover,
.modal-close:focus {
  background: rgba(255, 255, 255, 1);
  color: #000;
  transform: scale(1.1);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
  line-height: 1.6;
}

.modal-body h3 {
  color: #005fa3;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-body ul,
.modal-body ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.modal-body li {
  margin: 0.5rem 0;
}

.modal-body strong {
  color: #005fa3;
}

.modal-body p {
  margin: 1rem 0;
}

/* Responsividade */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 10% auto;
    max-height: 90vh;
  }

  .modal-content h2 {
    font-size: 1.2rem;
    padding: 1rem;
  }

  .modal-body {
    padding: 1.5rem;
  }
}
