/*
 * Template incqs2026 - estilo principal
 *
 * Identidade herdada do template original do INCQS (Joomla 3):
 * folha branca sobre fundo cinza, faixa dupla laranja/pêssego,
 * menu lateral com borda esquerda colorida e rodapé laranja.
 */

/* ---------- Tokens ---------- */

:root {
  --incqs-laranja: #d66900;          /* sobrescrito pelo parâmetro "Cor principal" */
  --incqs-laranja-escuro: #b35a00;   /* texto pequeno e faixa do rodapé (contraste AA com branco) */
  --incqs-pessego: #ffdcb5;
  --incqs-pessego-claro: #fff3e6;
  --incqs-azul: #006699;
  --incqs-hover: #c43c03;
  --incqs-lilas: #8c9bbc;
  --incqs-texto: #333333;
  --incqs-texto-suave: #595959;
  --incqs-fundo: #edeef0;
  --incqs-borda: #cccccc;
  --incqs-foco: #0b4f8a;

  --incqs-fonte: "Rawline", "Raleway", "Segoe UI", Verdana, Arial, sans-serif;
  --incqs-largura: 1200px;
  --incqs-lateral: 260px;
  --incqs-espaco: 1.5rem;
  --incqs-raio: 4px;

  --bs-body-font-family: var(--incqs-fonte);
  --bs-body-color: var(--incqs-texto);
  --bs-link-color: var(--incqs-azul);
  --bs-link-color-rgb: 0, 102, 153;
  --bs-link-hover-color: var(--incqs-hover);
  --bs-link-hover-color-rgb: 196, 60, 3;
}

/* ---------- Base ---------- */

html {
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  background: var(--incqs-fundo) linear-gradient(180deg, #d9dbdf 0, var(--incqs-fundo) 320px) no-repeat;
  color: var(--incqs-texto);
  font-family: var(--incqs-fonte);
  font-size: 1rem;
  line-height: 1.6;
}

a {
  color: var(--incqs-azul);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--incqs-hover);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--incqs-fonte);
  font-weight: 700;
  line-height: 1.3;
  color: var(--incqs-texto);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.1875rem; }

img {
  max-width: 100%;
  height: auto;
}

/* Foco visível em todo o site (WCAG 2.4.7 / 2.4.13) */
:focus-visible {
  outline: 3px solid var(--incqs-foco);
  outline-offset: 2px;
  border-radius: 2px;
}

.visualmente-oculto {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- Atalhos ("pular para") ---------- */

.atalhos {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2000;
}

.atalhos__link {
  position: absolute;
  left: -9999px;
  padding: 0.75rem 1rem;
  background: var(--incqs-foco);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

.atalhos__link:focus {
  left: 0.5rem;
  top: 0.5rem;
  color: #fff;
  outline-color: #fff;
}

/* ---------- Barra do Governo Federal ---------- */

.barra-govbr {
  min-height: 32px;
  background: #7f7f7f;
}

.barra-govbr__provisoria {
  margin: 0;
  padding: 0 1rem;
  list-style: none;
  line-height: 32px;
}

.barra-govbr__provisoria a {
  color: #fff;
  text-decoration: none;
}

/* ---------- Folha ---------- */

.folha {
  max-width: var(--incqs-largura);
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.04), 0 8px 24px -12px rgb(0 0 0 / 0.25);
}

/* ---------- Barra da Fiocruz ---------- */

.barra-fiocruz {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 33px;
  padding-right: 1rem;
  /* Mesmo degradê da barra original, em CSS, para garantir o contraste do texto */
  background: linear-gradient(180deg, #ffffff 0%, #f1f3f6 55%, #e3e7ec 100%);
  border-bottom: 1px solid #b9c0c8;
  font-size: 0.8125rem;
}

.barra-fiocruz__logo {
  display: flex;
  align-items: center;
  min-height: 33px;
  padding: 0 0.25rem 0 1rem;
  line-height: 0;
}

.barra-fiocruz__logo img {
  width: auto;
  height: 22px;
}

.barra-fiocruz__link {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--incqs-texto);
  font-weight: 600;
  text-decoration: none;
}

.barra-fiocruz__link:hover {
  color: var(--incqs-hover);
  text-decoration: underline;
}

.barra-fiocruz__nome {
  margin-left: auto;
  color: #1c2a4d;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ---------- Cabeçalho ---------- */

.cabecalho {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem var(--incqs-espaco);
  padding: 1rem var(--incqs-espaco);
}

.cabecalho__marca {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: var(--incqs-texto);
  text-decoration: none;
}

.cabecalho__marca:hover {
  color: var(--incqs-texto);
}

.cabecalho__marca:hover .cabecalho__nome {
  text-decoration: underline;
  text-decoration-color: var(--incqs-laranja);
  text-decoration-thickness: 2px;
}

.cabecalho__emblema {
  flex: none;
  width: 82px;
  height: auto;
}

.cabecalho__nome {
  max-width: 28ch;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
  color: #4a4a4a;
}

.cabecalho__acoes {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Busca (mod_finder / mod_search) */
.cabecalho__busca form {
  position: relative;
  margin: 0;
}

.cabecalho__busca label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.cabecalho__busca .awesomplete,
.cabecalho__busca .mod-finder__search {
  display: block;
  width: 100%;
}

.cabecalho__busca input[type="search"],
.cabecalho__busca input[type="text"] {
  width: 18rem;
  max-width: 100%;
  min-height: 44px;
  padding: 0.5rem 1.25rem;
  border: 1px solid #8a8a8a;
  border-radius: 999px;
  background: #fff;
  font: inherit;
  color: var(--incqs-texto);
}

.cabecalho__busca input::placeholder {
  color: #6b6b6b;
  opacity: 1;
}

.cabecalho__busca input:focus {
  border-color: var(--incqs-foco);
  box-shadow: none;
}

.cabecalho__busca .btn,
.cabecalho__busca button {
  min-height: 44px;
}

/* Botão "Menu" (só aparece quando o menu lateral vira offcanvas) */
.botao-menu {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 2px solid var(--incqs-laranja-escuro);
  border-radius: var(--incqs-raio);
  background: #fff;
  color: var(--incqs-laranja-escuro);
  font: inherit;
  font-weight: 700;
}

.botao-menu:hover {
  background: var(--incqs-laranja-escuro);
  color: #fff;
}

.botao-menu__icone,
.botao-menu__icone::before,
.botao-menu__icone::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.botao-menu__icone {
  position: relative;
}

.botao-menu__icone::before,
.botao-menu__icone::after {
  content: "";
  position: absolute;
  left: 0;
}

.botao-menu__icone::before { top: -6px; }
.botao-menu__icone::after  { top: 6px; }

/* ---------- Faixa dupla (assinatura do layout) ---------- */

.faixa {
  display: grid;
  grid-template-columns: var(--incqs-lateral) 1fr;
  min-height: 16px;
}

.faixa__laranja {
  background: var(--incqs-laranja);
}

.faixa__pessego {
  display: flex;
  align-items: center;
  min-height: 16px;
  padding: 0 var(--incqs-espaco);
  background: var(--incqs-pessego);
  font-size: 0.875rem;
}

/* Breadcrumbs (mod_breadcrumbs) dentro da faixa pêssego */
.faixa__pessego .mod-breadcrumbs__wrapper,
.faixa__pessego nav {
  width: 100%;
}

.faixa__pessego .breadcrumb {
  margin: 0;
  padding: 0.3rem 0;
  background: none;
  --bs-breadcrumb-divider-color: var(--incqs-texto-suave);
  --bs-breadcrumb-item-active-color: var(--incqs-texto);
}

.faixa__pessego .breadcrumb a {
  color: #00557f;
}

.faixa__pessego .mod-breadcrumbs__here {
  margin-right: 0.5rem;
  color: var(--incqs-texto-suave);
}

/* ---------- Corpo: lateral + conteúdo ---------- */

.corpo {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
}

.tem-lateral .corpo {
  grid-template-columns: var(--incqs-lateral) minmax(0, 1fr);
}

.conteudo {
  min-width: 0;
  padding: var(--incqs-espaco) var(--incqs-espaco) 2.5rem;
}

.conteudo:focus {
  outline: none;
}

.conteudo__topo .modulo,
.conteudo__rodape .modulo {
  margin-bottom: var(--incqs-espaco);
}

.conteudo__topo img {
  display: block;
  width: 100%;
}

/* Links que envolvem imagens: em bloco, para o contorno de foco envolver a imagem inteira */
.conteudo__topo a:has(> img),
.lateral__modulos a:has(> img) {
  display: block;
}

.conteudo__topo a:has(> img):focus-visible,
.lateral__modulos a:has(> img):focus-visible {
  outline-offset: 3px;
}

/* ---------- Lateral ---------- */

.lateral {
  border-right: 1px solid #ececec;
}

.lateral__topo {
  display: none;
}

.lateral__menu:focus {
  outline: none;
}

.lateral__modulos {
  padding: 1.25rem 1rem;
}

.lateral__modulos .modulo {
  margin-bottom: 1rem;
  text-align: center;
}

.lateral__modulos .modulo a {
  display: inline-block;
}

.lateral__modulos img {
  display: block;
  margin: 0 auto;
}

/* Menu lateral (mod_menu) */
.lateral__menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lateral__menu li {
  margin: 0;
}

.lateral__menu a,
.lateral__menu .mod-menu__heading,
.lateral__menu .mod-menu__separator {
  display: block;
  padding: 0.5rem 0.75rem 0.5rem 0.875rem;
  border-left: 6px solid var(--incqs-laranja);
  border-bottom: 1px solid var(--incqs-borda);
  color: var(--incqs-azul);
  font-size: 0.9375rem;
  line-height: 1.35;
  text-decoration: none;
}

.lateral__menu a:hover {
  background: var(--incqs-pessego-claro);
  color: var(--incqs-hover);
  text-decoration: underline;
}

.lateral__menu a:focus-visible {
  outline-offset: -3px;
}

.lateral__menu .active > a,
.lateral__menu .current > a {
  background: var(--incqs-pessego-claro);
  font-weight: 700;
}

/* Subitens: borda lilás e recuo, como no original */
.lateral__menu ul ul a {
  padding-left: 1.5rem;
  border-left-color: var(--incqs-lilas);
  font-size: 0.875rem;
}

.lateral__menu ul ul ul a {
  padding-left: 2.25rem;
}

/* ---------- Módulos ---------- */

.modulo__titulo {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--incqs-texto-suave);
}

/* ---------- Conteúdo (com_content) ---------- */

.conteudo .page-header h1,
.conteudo .page-header h2,
.conteudo h1 {
  color: var(--incqs-laranja-escuro);
}

.conteudo .page-header h2 a {
  color: var(--incqs-laranja-escuro);
  text-decoration: none;
}

.conteudo .page-header h2 a:hover {
  color: var(--incqs-hover);
  text-decoration: underline;
}

.com-content-article__body,
.item-content {
  max-width: 75ch;
}

/* Layout "Largo" (opt-in no artigo, html/com_content/article/largo.php):
   sem o limite de 75ch, para tabelas largas (ex.: Projetos PD&I) */
.artigo-largo .com-content-article__body {
  max-width: none;
}

/* Tabela larga: rola dentro da própria caixa, sem rolar a página (WCAG 1.4.10).
   A caixa é criada pelo template.js. */
.tabela-rolavel {
  max-width: 100%;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.tabela-rolavel > table {
  margin-bottom: 0;
}

/* Lista de notícias (home e blog): título laranja, data, resumo, "Leia mais" */
.blog-item {
  padding: 0 0 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e3e3e3;
}

.blog-item .item-title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.blog-item .item-title a {
  color: var(--incqs-laranja-escuro);
  text-decoration: none;
}

.blog-item .item-title a:hover {
  color: var(--incqs-hover);
  text-decoration: underline;
}

.article-info {
  margin: 0 0 0.75rem;
  color: var(--incqs-texto-suave) !important;
  font-size: 0.875rem;
}

.article-info dd {
  margin: 0;
}

.readmore {
  margin: 0.75rem 0 0;
}

.readmore .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 40px;
}

.readmore [class^="icon-"] {
  font-size: 0.75em;
}

/* Paginação */
.pagination {
  --bs-pagination-color: var(--incqs-azul);
  --bs-pagination-hover-color: var(--incqs-hover);
  --bs-pagination-active-bg: var(--incqs-azul);
  --bs-pagination-active-border-color: var(--incqs-azul);
  --bs-pagination-focus-box-shadow: none;
  flex-wrap: wrap;
}

.pagination .page-link {
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Lista com marcador quadrado (notícias anteriores) */
.lista-quadrada {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.lista-quadrada li {
  position: relative;
  padding: 0.3rem 0 0.3rem 1.25rem;
}

.lista-quadrada li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.85em;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--incqs-lilas);
}

.lista-quadrada a {
  text-decoration: none;
}

.lista-quadrada a:hover {
  text-decoration: underline;
}

/* Mapa do site: módulo Menu do core (Main Menu, todos os níveis) inserido no artigo
   com {loadmoduleid N}; classe do menu " lista-quadrada mapa-do-site" */
.mapa-do-site .menu-incqs__sub {
  margin: 0.3rem 0 0;
  padding: 0;
  list-style: none;
}

.mapa-do-site .mod-menu__heading {
  color: var(--incqs-texto-suave);
}

.noticias-anteriores .btn {
  min-height: 40px;
}

/* Imagem flutuando no texto do artigo (ex.: Apresentação) */
.com-content-article__body img.float-start {
  margin: 0.25rem 1.25rem 0.75rem 0;
}

.com-content-article__body h2 {
  margin-top: 1.75rem;
  font-size: 1.125rem;
  color: var(--incqs-texto);
}

.btn {
  font-family: var(--incqs-fonte);
}

.btn-secondary,
.readmore .btn {
  --bs-btn-bg: #f5f5f5;
  --bs-btn-border-color: #b3b3b3;
  --bs-btn-color: var(--incqs-azul);
  --bs-btn-hover-bg: var(--incqs-azul);
  --bs-btn-hover-border-color: var(--incqs-azul);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #00557f;
  --bs-btn-active-color: #fff;
}

/* ---------- Formulários (login, busca avançada etc.) ---------- */

.conteudo form label {
  font-weight: 600;
}

.conteudo .form-control,
.conteudo .form-select,
.conteudo .btn {
  min-height: 44px;
}

.conteudo .form-control:focus,
.conteudo .form-select:focus {
  border-color: var(--incqs-foco);
  box-shadow: 0 0 0 3px rgb(11 79 138 / 0.25);
}

.conteudo .control-group,
.conteudo .mb-3 {
  margin-bottom: 1rem;
}

.btn-primary {
  --bs-btn-bg: var(--incqs-azul);
  --bs-btn-border-color: var(--incqs-azul);
  --bs-btn-hover-bg: #00557f;
  --bs-btn-hover-border-color: #00557f;
  --bs-btn-active-bg: #004466;
}

/* Navegação anterior/próximo dos artigos */
.pagenav .btn,
.pagination__wrapper .btn {
  min-height: 40px;
}

/* ---------- Página de erro ---------- */

.pagina-erro__codigo {
  margin-top: 2rem;
  color: var(--incqs-texto-suave);
  font-size: 0.875rem;
}

/* ---------- Rodapé ---------- */

.rodape:focus {
  outline: none;
}

.rodape__links {
  padding: 0.75rem var(--incqs-espaco);
  border-top: 1px solid var(--incqs-borda);
}

.rodape__links ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rodape__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 32px;
  color: var(--incqs-laranja-escuro);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
}

.rodape__links a:hover {
  color: var(--incqs-hover);
  text-decoration: underline;
}

/* Régua de marcas (Manual da Marca Fiocruz 2024): INCQS → Fiocruz → Ministério da Saúde → Governo Federal */
.regua-marcas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 2.5rem;
  margin: 0;
  padding: 1.25rem var(--incqs-espaco);
  list-style: none;
  border-top: 1px solid #e3e3e3;
}

.regua-marcas__item {
  line-height: 0;
}

.regua-marcas__item a {
  display: inline-block;
}

.regua-marcas__item img {
  width: auto;
}

.regua-marcas__item--unidade img   { height: 44px; }
.regua-marcas__item--fiocruz img   { height: 30px; }
.regua-marcas__item--ministerio img { height: 30px; }
.regua-marcas__item--governo img   { height: 46px; }

.rodape__faixa {
  padding: 1.25rem var(--incqs-espaco);
  background: var(--incqs-laranja-escuro);
  color: #fff;
  font-size: 0.875rem;
}

.rodape__faixa p {
  margin: 0 0 0.75rem;
}

.rodape__faixa p:last-child {
  margin-bottom: 0;
}

.rodape__faixa a {
  color: #fff;
  text-decoration: underline;
}

.rodape__faixa a:hover {
  color: var(--incqs-pessego);
}

.rodape__faixa :focus-visible {
  outline-color: #fff;
}

/* ---------- Responsivo ---------- */

@media (min-width: 992px) {
  .botao-menu {
    display: none;
  }

  .lateral {
    position: static;
    visibility: visible !important;
    transform: none !important;
    background: transparent;
  }
}

@media (max-width: 991.98px) {
  .faixa,
  .tem-lateral .corpo {
    grid-template-columns: 1fr;
  }

  .faixa__laranja {
    display: none;
  }

  .faixa__pessego {
    border-top: 6px solid var(--incqs-laranja);
  }

  .lateral {
    --bs-offcanvas-width: min(320px, 88vw);
    border-right: 0;
  }

  .lateral__topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 6px solid var(--incqs-laranja);
  }

  .lateral__titulo {
    margin: 0;
    font-size: 1.125rem;
  }

  .lateral__topo .btn-close {
    width: 44px;
    height: 44px;
    padding: 0;
  }

  .lateral__conteudo {
    overflow-y: auto;
  }
}

@media (max-width: 767.98px) {
  :root {
    --incqs-espaco: 1rem;
  }

  .cabecalho__marca {
    gap: 0.75rem;
  }

  .cabecalho__emblema {
    width: 60px;
  }

  .cabecalho__nome {
    font-size: 1.125rem;
  }

  .cabecalho__acoes {
    width: 100%;
  }

  .cabecalho__busca {
    flex: 1;
  }

  .cabecalho__busca input[type="search"],
  .cabecalho__busca input[type="text"] {
    width: 100%;
  }

  .barra-fiocruz__nome {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .atalhos,
  .barra-govbr,
  .barra-fiocruz,
  .cabecalho__acoes,
  .faixa,
  .lateral,
  .rodape__links,
  [vw] {
    display: none !important;
  }

  .tem-lateral .corpo {
    grid-template-columns: 1fr;
  }

  .folha {
    box-shadow: none;
  }
}
