/* CSS/graduacoes.css - VERSÃO FINAL ABSOLUTA */

/* --- 1. BOTÕES DOS ANOS (TÁTICOS) --- */
.page-graduacoes .year-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 30px 0 0; /* <--- Margem inferior agora é 0 */
  transition: margin-bottom 0.3s ease; /* Transição suave quando expandir */
}

#yearEvents {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 1000px;
  margin: 0 auto;

  /* Estado inicial: Totalmente colado aos botões */
  margin-top: 0;
  opacity: 0;
  transition:
    margin-top 0.4s ease,
    opacity 0.4s ease;
}

/* Quando o contentor tem imagens lá dentro (:not(:empty)) */
#yearEvents:not(:empty) {
  margin-top: 40px; /* O espaço "empurra" o conteúdo para baixo apenas quando existe */
  opacity: 1;
  margin-bottom: 50px; /* Dá espaço antes do footer */
}

/* Esconder o título de vez para não ocupar 1px que seja */
#yearTitle {
  display: none !important;
}

.page-graduacoes .year-buttons.has-content {
  margin-bottom: 40px; /* A distância só aparece aqui */
}

/* Garante que o título fantasma não ocupa espaço */
.page-graduacoes .year-title {
  display: none;
}

.page-graduacoes .year-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0 36px;
  border-radius: var(--r-btn);
  font-family: "Orbitron", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--rim);
  color: #fff;
  transition: all var(--t);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.page-graduacoes .year-btn:hover {
  background: rgba(156, 230, 156, 0.08);
  border-color: rgba(156, 230, 156, 0.5);
  box-shadow: 0 0 25px rgba(156, 230, 156, 0.15);
  transform: translateY(-2px);
}

.page-graduacoes .year-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(156, 230, 156, 0.4);
  transform: translateY(0);
}

/* --- 2. TÍTULO E ANIMAÇÃO ("Registos de...") --- */
.page-graduacoes .year-panel {
  animation: fadeIn 0.4s ease forwards;
}

.page-graduacoes .year-title {
  text-align: center;
  font-family: "Orbitron", sans-serif;
  color: #fff;
  margin-bottom: 30px; /* Mais espaço para respirar */
  font-size: 1.4rem; /* Ligeiramente maior e premium */
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* --- 3. GRID DE EVENTOS E CARTÕES --- */
.page-graduacoes .graduacoes-container {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 1000px;
  margin: 0 auto;
}

.page-graduacoes .item {
  width: 100%;
  padding: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  border-radius: var(--r-card);
  overflow: hidden; /* Mantém a imagem dentro do verde */
  cursor: pointer;
}

.page-graduacoes .item img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  filter: grayscale(100%);
  transition: all 0.4s ease;
}

.page-graduacoes .item:hover img {
  filter: grayscale(0%);
  transform: scale(1.03);
}

.page-graduacoes .descricao {
  padding: 14px;
  background: rgba(12, 12, 12, 0.95);
  border-top: 1px solid rgba(156, 230, 156, 0.3);
  color: #fff;
  font-family: "Orbitron", sans-serif;
  text-align: center;
}

/* --- 4. ALINHAMENTO INTELIGENTE (1 ÚNICO EVENTO NO ANO) --- */
.page-graduacoes .item:only-child {
  grid-column: 1 / -1;
  max-width: 500px;
  margin: 0 auto;
}

/* --- 5. RESPONSIVIDADE E KEYFRAMES --- */
@media (max-width: 768px) {
  .page-graduacoes .graduacoes-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .page-graduacoes .year-btn {
    height: 48px;
    padding: 0 24px;
    font-size: 0.8rem;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
