/* ==========================================================================
   TRAIL — "Nossa trilha de ensino": filtros, grade de tecnologias e painel
   ========================================================================== */

.trail-header {
  padding: 40px 20px 30px;
  text-align: center;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
}

.filter-btn {
  --filter-color: var(--text-secondary);

  padding: 8px 18px;
  border: 2px solid var(--filter-color);
  border-radius: 32px;
  background: var(--surface);
  color: var(--filter-color);
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.filter-btn--blue {
  --filter-color: #57dce5;
}

.filter-btn--green {
  --filter-color: #15ffa9;
}

.filter-btn--yellow {
  --filter-color: #eba417;
}

.filter-btn--pink {
  --filter-color: #d757e5;
}

.filter-btn:hover {
  transform: translateY(-3px);
}

.filter-btn[aria-pressed="true"] {
  background: #fff;
  border-color: #fff;
  color: var(--dark);
}

.trail-layout {
  display: grid;
  grid-template-columns: 1fr 600px;
  gap: 40px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 50px;
}

/* ---------- Grade de tecnologias ---------- */

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 16px;
  align-content: start;
}

.tech-badge {
  --brand-color: #fff;

  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid var(--border-strong);
  border-radius: 12px;
  background-color: var(--surface);
  color: #777;
  font-size: 40px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-badge:hover,
.tech-badge:focus-visible,
.tech-badge[aria-pressed="true"] {
  z-index: 10;
  transform: translateY(-3px) scale(1.05);
  border-color: var(--brand-color);
  background-color: #111;
  color: var(--brand-color);
}

/* ---------- Painel de detalhes ---------- */

.details-panel {
  --tech-color: var(--border-default);

  position: sticky;
  top: calc(var(--header-height) + 20px);
  display: flex;
  flex-direction: column;
  min-height: 500px;
  padding: 40px;
  overflow-y: auto;
  border: 2px solid var(--tech-color);
  border-radius: 12px;
  background: var(--surface);
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.details-panel::-webkit-scrollbar {
  width: 5px;
}

.details-panel::-webkit-scrollbar-thumb {
  background-color: #333;
  border-radius: 5px;
}

.panel-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.panel-content[hidden] {
  display: none;
}

.p-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border-default);
}

.p-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: var(--tech-color);
  transition: all 0.3s ease;
}

.p-title-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Clareia a cor da marca para manter contraste em fundo escuro */
.p-category,
.p-learn-subtitle {
  color: var(--tech-color);
  color: color-mix(in srgb, var(--tech-color) 70%, white);
  transition: color 0.3s ease;
}

.p-category {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.p-title {
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
}

.p-learn-subtitle {
  margin-bottom: 15px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.p-desc {
  margin-bottom: 25px;
  font-size: 17px;
  line-height: 1.6;
  color: #d1d1d1;
}

.p-learn-list {
  font-size: 15px;
  line-height: 1.8;
  color: #d1d1d1;
}

.p-learn-list li {
  position: relative;
  margin-bottom: 10px;
  padding-left: 20px;
}

.p-learn-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  font-weight: bold;
  color: var(--tech-color);
}

@media (max-width: 960px) {
  .trail-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .details-panel {
    position: relative;
    top: 0;
    min-height: 350px;
    padding: 30px 20px;
  }

  .tech-grid {
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  }
}
