/*=====================================================================================================
  TEMA UFBA BOOTSTRAP - ADAPTADO PARA O LATER (MODELO NEPGREG / MAPEAMENTO CULTURAL UFBA)
======================================================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700&display=swap');

:root {
  /* Cores Institucionais UFBA */
  --cor-primaria: #0b3667;
  --cor-secundaria: #1b4e86;
  --cor-terciaria: #1b4e86;
  --cor-destaque: #3b82f6;
  --cor-verde-nepgreg: #55c26c;

  /* Cores do Menu */
  --cor-bg-menu: #0b3667;
  --cor-texto-menu: #ffffff;
  --cor-borda-menu: #2c629e;
  --cor-hover-menu: #154881;
}

body {
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #333333;
  background-color: #edf2f7;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

a {
  color: #0d8acd;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

a:hover, a:focus {
  color: #085d8c;
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  color: var(--cor-primaria);
}

/*-----------------------------------------------------------------------------------------------------
  1. BARRA BRASIL (GOVERNO FEDERAL)
-------------------------------------------------------------------------------------------------------*/
#barra-brasil {
  background: #7F7F7F;
  height: 28px;
  padding: 4px 15px 0 15px;
  display: block;
  font-size: 11px;
  border-bottom: 1px solid #666;
}

#menu-barra-temp {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

#menu-barra-temp li {
  display: inline-block;
  margin-right: 15px;
  padding-right: 15px;
  border-right: 1px solid #EDEDED;
}

#menu-barra-temp li:last-child {
  border-right: none;
}

#menu-barra-temp a {
  font-family: sans-serif;
  text-decoration: none;
  color: #ffffff;
  font-weight: 500;
}

#menu-barra-temp a:hover {
  text-decoration: underline;
}

/*-----------------------------------------------------------------------------------------------------
  2. CABEÇALHO PRINCIPAL (.header-main)
-------------------------------------------------------------------------------------------------------*/
.header-main {
  background: linear-gradient(var(--cor-primaria), var(--cor-secundaria));
  background-repeat: no-repeat;
  color: #ffffff;
  padding-bottom: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-main .container {
  position: relative;
}

/* Atalhos e Acessibilidade */
ul.atalho, ul.acessibilidade {
  list-style-type: none;
  margin: 8px 0;
  padding: 0;
}

ul.atalho li, ul.acessibilidade li {
  display: inline;
  margin-right: 10px;
}

ul.atalho li a, ul.acessibilidade li a {
  color: #cdecff;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 500;
}

ul.atalho li a:hover, ul.acessibilidade li a:hover {
  color: #ffffff;
  text-decoration: none;
}

ul.acessibilidade {
  float: right;
  border-bottom: 1px dotted #cdecff;
  padding-bottom: 3px;
}

ul.atalho .numero-atalho {
  background: #3286cc;
  padding: 1px 5px;
  color: #ffffff;
  border-radius: 3px;
  font-size: 10px;
  margin-left: 3px;
}

/* Área de Logos e Identidade */
.header-brand-row {
  padding: 15px 0 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.brand-info {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
}

.brand-info:hover, .brand-info:focus {
  text-decoration: none;
}

.brand-badge {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  letter-spacing: 2px;
  display: inline-block;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0;
  max-width: 600px;
}

.brand-subtitle {
  color: #cdecff;
  font-size: 13px;
  font-weight: 400;
  margin-top: 4px;
}

.ufba-coat-logo img {
  height: 105px;
  width: auto;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2));
  transition: transform 0.2s ease;
}

.ufba-coat-logo img:hover {
  transform: scale(1.03);
}

/*-----------------------------------------------------------------------------------------------------
  3. MENU DE NAVEGAÇÃO PRINCIPAL (#navbar)
-------------------------------------------------------------------------------------------------------*/
#navbar {
  background: var(--cor-bg-menu);
  border-bottom: 2px solid var(--cor-borda-menu);
  min-height: 44px;
  margin-bottom: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

.navbar-nav > li > a {
  color: var(--cor-texto-menu) !important;
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  padding: 12px 14px;
  border-right: 1px solid var(--cor-borda-menu);
  letter-spacing: 0.3px;
}

.navbar-nav > li:first-child > a {
  border-left: 1px solid var(--cor-borda-menu);
}

.navbar-nav > li > a:hover,
.navbar-nav > li > a:focus,
.navbar-nav > .active > a,
.navbar-nav > .active > a:hover,
.navbar-nav > .open > a {
  background-color: var(--cor-hover-menu) !important;
  color: #ffffff !important;
}

/* Dropdown Menu */
.navbar-nav .dropdown-menu {
  background-color: #ffffff;
  border-radius: 0;
  border: 1px solid #ddd;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 5px 0;
}

.navbar-nav .dropdown-menu > li > a {
  color: #333333;
  font-size: 13px;
  padding: 8px 18px;
  font-weight: 500;
  border-bottom: 1px solid #f0f0f0;
}

.navbar-nav .dropdown-menu > li:last-child > a {
  border-bottom: none;
}

.navbar-nav .dropdown-menu > li > a:hover {
  background-color: #eef5fc;
  color: var(--cor-primaria);
}

/*-----------------------------------------------------------------------------------------------------
  4. FAIXA SUPERIOR DE CATEGORIAS (SUB-BARRA SLIDER/SUPERFISH)
-------------------------------------------------------------------------------------------------------*/
.sub-nav-ribbon {
  background: #edf2f7;
  padding: 10px 0;
  border-bottom: 1px solid #dde5ed;
}

.sub-nav-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sub-nav-tags li a {
  display: inline-block;
  background: #ffffff;
  color: var(--cor-primaria);
  border: 1px solid #c9d8e7;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.sub-nav-tags li a:hover {
  background: var(--cor-primaria);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(11, 54, 103, 0.25);
}

/*-----------------------------------------------------------------------------------------------------
  5. ÁREA DE CONTEÚDO PRINCIPAL (.main-container)
-------------------------------------------------------------------------------------------------------*/
.main-container {
  background-color: #edf2f7;
  padding: 25px 0 40px 0;
  min-height: 500px;
}

/* Cabeçalho da página (Estilo NEPGREG) */
.main-container h1.page-header {
  background-color: var(--cor-verde-nepgreg);
  color: #ffffff;
  padding: 16px 22px;
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  letter-spacing: 0.3px;
}

/* Card Principal do Conteúdo (#block-system-main) */
#block-system-main {
  background-color: #ffffff;
  padding: 30px;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid #e1e7ee;
  border-top: none;
}

/* Campos Estruturados (Campos do Drupal / NEPGREG) */
.node-grupo-de-pesquisa .field {
  margin-bottom: 18px;
  font-size: 14.5px;
  line-height: 1.6;
}

.field-label-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}

.field-label-inline .field-label {
  font-weight: 700;
  color: #1b4e86;
  min-width: 195px;
  padding-right: 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.field-label-inline .field-items {
  flex: 1;
  min-width: 250px;
}

.field-label-above .field-label {
  font-weight: 700;
  color: #1b4e86;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
  border-bottom: 2px solid #edf2f7;
  padding-bottom: 4px;
}

.field-item {
  color: #333333;
}

.field-item a {
  color: #0b3667;
  font-weight: 600;
}

.field-item a:hover {
  color: #085d8c;
  text-decoration: underline;
}

.field-item p {
  margin-bottom: 12px;
  text-align: justify;
}

/* Badges e Destaques */
.tag-pill {
  display: inline-block;
  background: #e9f3fb;
  color: #165691;
  border: 1px solid #bed6ee;
  border-radius: 4px;
  padding: 3px 9px;
  margin: 2px 4px 2px 0;
  font-size: 13px;
  font-weight: 500;
}

/* Bloco de Mídias e Banners do LATER */
.later-showcase-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 20px;
  margin-top: 25px;
  margin-bottom: 15px;
}

.later-showcase-box h3 {
  font-size: 18px;
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--cor-primaria);
  border-left: 4px solid var(--cor-verde-nepgreg);
  padding-left: 10px;
}

.later-img-container {
  text-align: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.later-img-container img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  max-height: 420px;
  object-fit: contain;
}

/* Lista de Projetos e Plataformas */
.project-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.project-card {
  background: #ffffff;
  border: 1px solid #e1e8ed;
  border-radius: 6px;
  padding: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: #b7d1ea;
}

.project-card h4 {
  font-size: 15px;
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--cor-primaria);
}

.project-card p {
  font-size: 13px;
  color: #555555;
  margin-bottom: 12px;
}

.project-card .btn-card {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  color: #0b3667;
  background: #eef4fa;
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid #c9dcf0;
  text-decoration: none;
}

.project-card .btn-card:hover {
  background: #0b3667;
  color: #ffffff;
  text-decoration: none;
}

/*-----------------------------------------------------------------------------------------------------
  6. RODAPÉ INSTITUCIONAL (#rodape.rodape)
-------------------------------------------------------------------------------------------------------*/
.rodape {
  background: var(--cor-secundaria);
  border-top: 5px solid var(--cor-primaria);
  padding: 30px 0 20px 0;
  color: #ffffff;
  font-size: 13px;
}

.rodape a {
  color: #cdecff;
  text-decoration: underline;
}

.rodape a:hover {
  color: #ffffff;
}

.rodape p {
  margin-bottom: 6px;
  font-size: 13px;
  color: #e0eeff;
}

.rodape-address-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.footer-partners {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-partners img {
  max-height: 65px;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 10px;
  border-radius: 4px;
}

.rodape-copy {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 20px;
  padding-top: 15px;
  text-align: center;
  font-size: 12px;
  color: #bddcff;
}

/*-----------------------------------------------------------------------------------------------------
  7. MODO ALTO CONTRASTE (.highcontrast)
-------------------------------------------------------------------------------------------------------*/
body.highcontrast {
  background-color: #000000 !important;
  color: #ffffff !important;
}

body.highcontrast * {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
}

body.highcontrast a {
  color: #ffff00 !important;
  text-decoration: underline !important;
}

body.highcontrast a:hover {
  color: #00ffff !important;
}

body.highcontrast .header-main,
body.highcontrast #navbar,
body.highcontrast #block-system-main,
body.highcontrast .rodape,
body.highcontrast .later-showcase-box,
body.highcontrast .project-card,
body.highcontrast .sub-nav-ribbon {
  background-color: #000000 !important;
  border-color: #ffffff !important;
}

body.highcontrast h1.page-header {
  background-color: #000000 !important;
  color: #ffff00 !important;
  border: 2px solid #ffffff !important;
}

body.highcontrast .field-label-inline .field-label,
body.highcontrast .field-label-above .field-label {
  color: #ffff00 !important;
}

body.highcontrast .brand-badge {
  border-color: #ffffff !important;
  color: #ffff00 !important;
}

/*-----------------------------------------------------------------------------------------------------
  8. RESPONSIVIDADE (MEDIA QUERIES)
-------------------------------------------------------------------------------------------------------*/
@media (max-width: 991px) {
  .header-brand-row {
    flex-direction: column;
    text-align: center;
  }
  .brand-info {
    flex-direction: column;
    margin-bottom: 15px;
  }
  .brand-title {
    font-size: 17px;
  }
  .ufba-coat-logo {
    margin-top: 10px;
  }
  .footer-partners {
    justify-content: flex-start;
    margin-top: 20px;
  }
}

@media (max-width: 767px) {
  ul.acessibilidade, ul.atalho {
    display: none !important;
  }
  .main-container h1.page-header {
    font-size: 18px;
    padding: 12px 16px;
  }
  #block-system-main {
    padding: 16px;
  }
  .field-label-inline {
    flex-direction: column;
  }
  .field-label-inline .field-label {
    min-width: 100%;
    margin-bottom: 4px;
  }
  .navbar-nav > li > a {
    border-right: none;
    border-bottom: 1px solid var(--cor-borda-menu);
  }
}
