/* =============================================================================
   GESTOR UBS — Estilos Públicos
   Prefixo: gubs- (evita conflito com outros plugins/temas)
============================================================================= */

/* --- 1. CONTAINER E TIPOGRAFIA --- */
.gubs-portal-wrapper {
  font-family: "Segoe UI", Roboto, sans-serif;
  text-align: center;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.gubs-title {
  font-size: 2rem;
  color: #1a3a5c;
  font-weight: 300;
  margin-bottom: 10px;
}

.gubs-subtitle {
  color: #666;
  margin-bottom: 30px;
  font-size: 1rem;
}

/* --- 2. GRID DE CARDS --- */
.gubs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 320px));
  gap: 20px;
  justify-content: center;
  margin: 0 auto 30px;
}

.gubs-card {
  background: #fff;
  border: 1px solid #e0e8f0;
  padding: 35px 20px;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(0,0,0,.06);
  transition: .25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.gubs-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,55,120,.12);
  border-color: #003778;
}

.gubs-icon .dashicons {
  font-size: 44px;
  color: #003778;
  margin-bottom: 12px;
  width: 44px;
  height: 44px;
  line-height: 1;
}

.gubs-text {
  font-size: 13px;
  font-weight: 700;
  color: #003778;
  text-transform: uppercase;
  line-height: 1.4;
  text-align: center;
}

.gubs-card-desc {
  font-size: 11px;
  color: #888;
  margin-top: 8px;
  text-align: center;
}

/* --- 3. BOTÕES --- */
.gubs-btn-back {
  display: inline-block;
  padding: 9px 18px;
  background-color: #eef2f7;
  color: #003778;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: .9rem;
  transition: .25s;
}

.gubs-btn-back:hover { background-color: #003778; color: #fff; }

.gubs-btn-primary {
  display: inline-block;
  padding: 9px 20px;
  background-color: #003778;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
  transition: .25s;
}

.gubs-btn-primary:hover { background-color: #002558; color: #fff; }

/* --- 4. BUSCA --- */
.gubs-search-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 25px;
  max-width: 700px;
  flex-wrap: wrap;
}

.gubs-search-input {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border: 1px solid #ccd8e8;
  border-radius: 4px;
  font-size: .95rem;
  outline: none;
  transition: border .2s;
}

.gubs-search-input:focus { border-color: #003778; }

.gubs-search-btn {
  padding: 10px 20px;
  background: #003778;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: .95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: .2s;
}

.gubs-search-btn:hover { background: #002558; }

/* --- 5. LISTA DE DOCUMENTOS --- */
.gubs-list-container { max-width: 1000px; margin: 0 auto; text-align: left; }

.gubs-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,.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  transition: border-color .2s;
}

.gubs-card-item:hover { border-color: #003778; }

.gubs-item-main { flex: 1; }

.gubs-item-title { margin: 0 0 8px; color: #003778; font-size: 1.05rem; }

.gubs-item-meta {
  font-size: .85rem;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.gubs-item-excerpt { font-size: .88rem; color: #777; line-height: 1.5; }
.gubs-item-excerpt p { margin: 0; }
.gubs-item-action { flex-shrink: 0; }

.gubs-empty { text-align: center; color: #888; padding: 30px 0; }

/* --- 6. PAGINAÇÃO --- */
.gubs-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.gubs-page-btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid #ccd8e8;
  border-radius: 4px;
  color: #003778;
  text-decoration: none;
  font-size: .9rem;
  transition: .2s;
}

.gubs-page-btn:hover,
.gubs-page-btn.active { background: #003778; color: #fff; border-color: #003778; }

/* --- 7. ABAS (TABS) --- */
.gubs-tabs {
  display: flex;
  justify-content: center;
  background-color: #f4f7fb;
  border: 1px solid #ccd8e8;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

.gubs-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: .2s;
}

.gubs-tab-link .dashicons { font-size: 22px; margin-bottom: 4px; }
.gubs-tab-link:hover { background-color: #dce7f5; }
.gubs-tab-link.active { background-color: #003778; color: #fff; }

.gubs-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,.05);
  margin-bottom: 40px;
}

.gubs-tab-content { display: none; padding: 16px 0; animation: gubsFadeIn .35s ease; }
.gubs-tab-content.active { display: block !important; }

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

/* --- 8. TABELA DE DETALHES --- */
.gubs-table-detalhes { width: 100%; border-collapse: collapse; margin-bottom: 20px; }

.gubs-table-detalhes th,
.gubs-table-detalhes td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  font-size: .95rem;
}

.gubs-table-detalhes th { width: 30%; color: #555; font-weight: 600; background: #f8fafd; }

.gubs-descricao { margin-top: 24px; text-align: left; line-height: 1.7; color: #444; }

/* --- 9. TIMELINE --- */
.gubs-timeline-container { padding: 10px 0; text-align: left; }

.gubs-timeline-item {
  position: relative;
  border-left: 3px solid #003778;
  padding-left: 24px;
  padding-bottom: 28px;
}

.gubs-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;
}

.gubs-timeline-item:last-child { border-left: 3px solid transparent; }

.gubs-timeline-date {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: #003778;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.gubs-timeline-title { font-size: 1rem; font-weight: 600; color: #333; margin-bottom: 8px; }

.gubs-timeline-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef2f7;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: .88rem;
  color: #003778;
  text-decoration: none;
  transition: .2s;
}

.gubs-timeline-link:hover { background: #003778; color: #fff; }

/* --- 10. BADGES --- */
.gubs-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.gubs-badge.publicado    { background: #28a745; }
.gubs-badge.vigente      { background: #17a2b8; }
.gubs-badge.em_andamento,
.gubs-badge.em-andamento { background: #ffc107; color: #333; }
.gubs-badge.suspenso     { background: #dc3545; }
.gubs-badge.retificado   { background: #6f42c1; }
.gubs-badge.encerrado,
.gubs-badge.arquivado    { background: #6c757d; }
.gubs-badge.substituido  { background: #fd7e14; }

/* --- 11. BREADCRUMB --- */
.gubs-breadcrumb {
  padding: 8px 0;
  margin-bottom: 20px;
  font-size: .88rem;
  color: #888;
  text-align: left;
}

.gubs-breadcrumb a { color: #003778; text-decoration: none; }
.gubs-breadcrumb a:hover { text-decoration: underline; }
.gubs-breadcrumb .sep { margin: 0 7px; color: #ccc; }
.gubs-breadcrumb span { color: #333; font-weight: 600; }

/* =========================================================================
   PAINEL INFORMATIVO
   ========================================================================= */

/* Wrapper geral */
.gubs-informativo-wrapper { font-family: "Segoe UI", Roboto, sans-serif; }

/* ---- Painel Destaque ---- */
.gubs-painel-destaque {
  border-radius: 10px;
  padding: 36px 28px;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
  margin-bottom: 16px;
  transition: box-shadow .3s;
}

.gubs-painel-titulo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.gubs-painel-data {
  font-size: .85rem;
  opacity: .75;
  margin: 0 0 24px;
}

/* Grade de estatísticas */
.gubs-painel-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

.gubs-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.gubs-stat-valor {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
}

.gubs-stat-label {
  font-size: .78rem;
  font-weight: 600;
  opacity: .85;
  margin-top: 6px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.gubs-painel-rodape {
  font-size: .8rem;
  opacity: .65;
  margin: 0 0 4px;
}

.gubs-painel-fonte {
  font-size: .75rem;
  opacity: .55;
  margin: 0 0 20px;
  font-style: italic;
}

/* Botão "Ver informativos antigos" */
.gubs-btn-antigos {
  display: inline-block;
  padding: 10px 28px;
  border: 2px solid currentColor;
  border-radius: 30px;
  background: transparent;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .3px;
  transition: .25s;
}

.gubs-btn-antigos:hover {
  background: rgba(255,255,255,.15);
  transform: translateY(-2px);
}

/* ---- Modal ---- */
.gubs-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gubs-modal-box {
  background: #fff;
  border-radius: 10px;
  padding: 28px;
  max-width: 860px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: gubsFadeIn .25s ease;
}

.gubs-modal-close {
  display: block;
  margin-left: auto;
  margin-bottom: 16px;
  background: #eef2f7;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  color: #003778;
  transition: .2s;
}

.gubs-modal-close:hover { background: #003778; color: #fff; }

.gubs-modal-titulo { margin: 0 0 20px; color: #1a3a5c; font-size: 1.3rem; text-align: center; }

/* Lista de informativos antigos (dentro do modal ou lista direta) */
.gubs-antigos-lista {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.gubs-antigo-card {
  border-radius: 8px;
  padding: 18px 16px;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}

.gubs-antigo-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  font-size: .9rem;
}

.gubs-antigo-header strong { line-height: 1.3; }

.gubs-antigo-header span {
  font-size: .75rem;
  opacity: .7;
  white-space: nowrap;
}

.gubs-antigo-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 10px;
}

.gubs-antigo-stat {
  text-align: center;
  min-width: 60px;
}

.gubs-antigo-stat .val { font-size: 1.6rem; font-weight: 900; line-height: 1; }
.gubs-antigo-stat .lbl { font-size: .65rem; opacity: .8; margin-top: 3px; text-transform: uppercase; }

.gubs-antigo-rodape { font-size: .72rem; opacity: .6; margin: 6px 0 0; text-align: center; }

/* Lista direta (sem modal) */
.gubs-lista-direta { margin-top: 16px; }
.gubs-lista-direta .gubs-modal-titulo { text-align: left; color: #1a3a5c; }

/* --- 12. RESPONSIVIDADE --- */
@media (max-width: 768px) {
  .gubs-tabs { flex-wrap: wrap; background: transparent; border: none; }
  .gubs-tab-link { flex: 1 1 45%; margin: 2px; border: 1px solid #ccd8e8; border-radius: 8px; background: #fff; }
  .gubs-card-item { flex-direction: column; align-items: flex-start; }
  .gubs-item-action { width: 100%; text-align: right; }
  .gubs-table-detalhes th { width: 40%; }
  .gubs-search-form { flex-direction: column; align-items: stretch; }
  .gubs-search-btn { justify-content: center; }
  .gubs-painel-stats { gap: 20px; }
  .gubs-stat-valor { font-size: 2.2rem; }
  .gubs-antigos-lista { grid-template-columns: 1fr; }
  .gubs-modal-box { padding: 18px; }
}
