/* =============================================================================
   GESTOR ITR — Estilos Públicos
   Prefixo: gitr-  (evita conflito com outros plugins/temas)
============================================================================= */

/* --- 1. CONTAINER E TIPOGRAFIA --- */
.gitr-portal-wrapper {
  font-family: "Segoe UI", Roboto, sans-serif;
  text-align: center;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.gitr-title {
  font-size: 2rem;
  color: #1a3a5c;
  font-weight: 300;
  margin-bottom: 10px;
}

.gitr-subtitle {
  color: #666;
  margin-bottom: 30px;
  font-size: 1rem;
}

/* --- 2. GRID DE CARDS --- */
.gitr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 320px));
  gap: 20px;
  justify-content: center;
  margin: 0 auto 30px;
}

.gitr-card {
  background: #fff;
  border: 1px solid #e0e8f0;
  padding: 35px 20px;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
  transition: 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.gitr-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 55, 120, 0.12);
  border-color: #003778;
}

.gitr-icon .dashicons {
  font-size: 44px;
  color: #003778;
  margin-bottom: 12px;
  width: 44px;
  height: 44px;
  line-height: 1;
}

.gitr-text {
  font-size: 13px;
  font-weight: 700;
  color: #003778;
  text-transform: uppercase;
  line-height: 1.4;
  text-align: center;
}

.gitr-card-desc {
  font-size: 11px;
  color: #888;
  margin-top: 8px;
  text-align: center;
}

/* --- 3. BOTÕES --- */
.gitr-btn-back {
  display: inline-block;
  padding: 9px 18px;
  background-color: #eef2f7;
  color: #003778;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: 0.25s;
}

.gitr-btn-back:hover {
  background-color: #003778;
  color: #fff;
}

.gitr-btn-primary {
  display: inline-block;
  padding: 9px 20px;
  background-color: #003778;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: 0.25s;
}

.gitr-btn-primary:hover {
  background-color: #002558;
  color: #fff;
}

/* --- 4. BUSCA / FILTRO --- */
.gitr-search-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 25px;
  max-width: 700px;
  flex-wrap: wrap;
}

.gitr-search-input {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border: 1px solid #ccd8e8;
  border-radius: 4px;
  font-size: 0.95rem;
  outline: none;
  transition: border 0.2s;
}

.gitr-search-input:focus {
  border-color: #003778;
}

.gitr-search-btn {
  padding: 10px 20px;
  background: #003778;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: 0.2s;
}

.gitr-search-btn:hover {
  background: #002558;
}

/* --- 5. LISTA DE DOCUMENTOS --- */
.gitr-list-container {
  max-width: 1000px;
  margin: 0 auto;
  text-align: left;
}

.gitr-card-item {
  background: #fff;
  border: 1px solid #dde6f0;
  padding: 18px 20px;
  margin-bottom: 14px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  transition: border-color 0.2s;
}

.gitr-card-item:hover {
  border-color: #003778;
}

.gitr-item-main {
  flex: 1;
}

.gitr-item-title {
  margin: 0 0 8px;
  color: #003778;
  font-size: 1.05rem;
}

.gitr-item-meta {
  font-size: 0.85rem;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.gitr-item-excerpt {
  font-size: 0.88rem;
  color: #777;
  line-height: 1.5;
}

.gitr-item-excerpt p {
  margin: 0;
}

.gitr-item-action {
  flex-shrink: 0;
}

.gitr-empty {
  text-align: center;
  color: #888;
  padding: 30px 0;
}

/* --- 6. PAGINAÇÃO --- */
.gitr-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.gitr-page-btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid #ccd8e8;
  border-radius: 4px;
  color: #003778;
  text-decoration: none;
  font-size: 0.9rem;
  transition: 0.2s;
}

.gitr-page-btn:hover,
.gitr-page-btn.active {
  background: #003778;
  color: #fff;
  border-color: #003778;
}

/* --- 7. ABAS (TABS) --- */
.gitr-tabs {
  display: flex;
  justify-content: center;
  background-color: #f4f7fb;
  border: 1px solid #ccd8e8;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

.gitr-tab-link {
  flex: 1;
  background: inherit;
  border: none;
  cursor: pointer;
  padding: 22px 16px;
  font-size: 15px;
  color: #003778;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: 0.2s;
}

.gitr-tab-link .dashicons {
  font-size: 22px;
  margin-bottom: 4px;
}

.gitr-tab-link:hover {
  background-color: #dce7f5;
}

.gitr-tab-link.active {
  background-color: #003778;
  color: #fff;
}

.gitr-tab-container {
  background: #fff;
  border: 1px solid #ccd8e8;
  padding: 28px;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 40px;
}

.gitr-tab-content {
  display: none;
  padding: 16px 0;
  animation: gitrFadeIn 0.35s ease;
}

.gitr-tab-content.active {
  display: block !important;
}

@keyframes gitrFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- 8. TABELA DE DETALHES --- */
.gitr-table-detalhes {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.gitr-table-detalhes th,
.gitr-table-detalhes td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  font-size: 0.95rem;
}

.gitr-table-detalhes th {
  width: 30%;
  color: #555;
  font-weight: 600;
  background: #f8fafd;
}

.gitr-descricao {
  margin-top: 24px;
  text-align: left;
  line-height: 1.7;
  color: #444;
}

/* --- 9. LINHA DO TEMPO (ARQUIVOS / HISTÓRICO) --- */
.gitr-timeline-container {
  padding: 10px 0;
  text-align: left;
}

.gitr-timeline-item {
  position: relative;
  border-left: 3px solid #003778;
  padding-left: 24px;
  padding-bottom: 28px;
}

.gitr-timeline-item::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 2px;
  width: 16px;
  height: 16px;
  background: #003778;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #003778;
}

.gitr-timeline-item:last-child {
  border-left: 3px solid transparent;
}

.gitr-timeline-date {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #003778;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.gitr-timeline-title {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.gitr-timeline-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef2f7;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.88rem;
  color: #003778;
  text-decoration: none;
  transition: 0.2s;
}

.gitr-timeline-link:hover {
  background: #003778;
  color: #fff;
}

/* --- 10. BADGES DE STATUS --- */
.gitr-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.gitr-badge.publicado {
  background: #28a745;
}
.gitr-badge.vigente {
  background: #17a2b8;
}
.gitr-badge.em_andamento,
.gitr-badge.em-andamento {
  background: #ffc107;
  color: #333;
}
.gitr-badge.suspenso {
  background: #dc3545;
}
.gitr-badge.retificado {
  background: #6f42c1;
}
.gitr-badge.encerrado,
.gitr-badge.arquivado {
  background: #6c757d;
}
.gitr-badge.substituido {
  background: #fd7e14;
}

/* --- 11. BREADCRUMB --- */
.gitr-breadcrumb {
  padding: 8px 0;
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: #888;
  text-align: left;
}

.gitr-breadcrumb a {
  color: #003778;
  text-decoration: none;
}

.gitr-breadcrumb a:hover {
  text-decoration: underline;
}

.gitr-breadcrumb .sep {
  margin: 0 7px;
  color: #ccc;
}

.gitr-breadcrumb span {
  color: #333;
  font-weight: 600;
}

/* --- 12. RESPONSIVIDADE --- */
@media (max-width: 768px) {
  .gitr-tabs {
    flex-wrap: wrap;
    background: transparent;
    border: none;
  }

  .gitr-tab-link {
    flex: 1 1 45%;
    margin: 2px;
    border: 1px solid #ccd8e8;
    border-radius: 8px;
    background: #fff;
  }

  .gitr-card-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .gitr-item-action {
    width: 100%;
    text-align: right;
  }

  .gitr-table-detalhes th {
    width: 40%;
  }

  .gitr-search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .gitr-search-btn {
    justify-content: center;
  }
}
