body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0f1419 0%, #1a202c 100%);
  margin: 0;
  padding: 20px 0;
  min-height: 100vh;
}

#painel {
  width: 90%;
  max-width: 900px;
  max-height: 380px;
  margin: 0 auto;
  background: linear-gradient(145deg, #1e1e1e, #2a2a2a);
  border-radius: 20px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.tabela {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
}

.item {
  position: relative;
  background: linear-gradient(135deg, #222222 0%, #1a1a1a 100%);
  padding: 20px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
  height: calc((380px - 4px) / 3); /* Altura exata dividida por 3 items */
  box-sizing: border-box;
  flex-shrink: 0; /* Impede que o item encolha */
}

.item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #D5A30E, #f7d94c);
  transform: translateX(-4px);
  transition: transform 0.3s ease;
}

.item:hover {
  background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
  transform: translateY(-2px);
  box-shadow: 
    0 10px 30px rgba(213, 163, 14, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.item:hover::before {
  transform: translateX(0);
}

.item:last-child {
  border-bottom: none;
}

.item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.item-content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.item h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 10px 0;
  margin-right: 100px;
  color: #ffffff;
  line-height: 1.3;
  text-align: left;
  transition: color 0.3s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.3em * 2);
  word-wrap: break-word;
  hyphens: auto;
}

.item:hover h2 {
  color: #f7d94c;
}

.item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
}

.item-source {
  font-size: 0.8rem;
  color: #D5A30E;
  font-weight: 500;
  margin: 0;
  padding: 4px 12px;
  background: rgba(213, 163, 14, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(213, 163, 14, 0.2);
  transition: all 0.3s ease;
}

.item:hover .item-source {
  background: rgba(213, 163, 14, 0.2);
  border-color: rgba(213, 163, 14, 0.4);
}

.item-date {
  font-size: 0.75rem;
  color: #888;
  font-weight: 400;
  margin: 0;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  white-space: nowrap;
}

#dados {
  opacity: 1;
  transition: opacity 0.6s ease-in-out;
}

#dados.fade-out {
  opacity: 0;
}

/* Animação de entrada */
.item {
  animation: slideIn 0.6s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

.item:nth-child(1) { animation-delay: 0.1s; }
.item:nth-child(2) { animation-delay: 0.2s; }
.item:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- INÍCIO DO BLOCO RESPONSIVO OTIMIZADO --- */

@media (max-width: 768px) {
  /* 1. AJUSTES GERAIS NO PAINEL E ITEM */
  #painel {
    width: 95%;
    max-height: 420px;
    border-radius: 15px;
  }
  
  .item {
    padding: 15px 20px;
    height: calc(100% / 3);
    box-sizing: border-box;
  }
  
  /* 2. OTIMIZAÇÃO DO TÍTULO */
  .item h2 {
    font-size: 0.9rem;
    margin-right: 0; /* REMOVE a margem que roubava espaço */
    line-height: 1.4;
    -webkit-line-clamp: 3;
    max-height: calc(1.4em * 3);
  }
  
  /* 3. META-DADOS: FONTE À ESQUERDA, DATA À DIREITA */
  .item-meta {
    /* Mantém o layout em linha, mas garante que ele ocupe todo o espaço */
    width: 100%; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
  }
  
  .item-source, .item-date {
    font-size: 0.7rem;
  }
}
/* --- ESTILOS PARA O MODO EMBUTIDO (IFRAME) --- */

/* 1. Define a base: html e body devem ter 100% de altura */
html.embed-mode, body.embed-mode {
  height: 100%;
  margin: 0;
  padding: 0px;
  background: #1D2127;
}

/* 2. O painel deve herdar 100% da altura do body */
body.embed-mode #painel {
  width: 100%;
  height: 100%;
  margin: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 3. Cada item deve ocupar 1/3 da altura do painel */
body.embed-mode .item {
  height: calc(100% / 3);
}
