/* ==========================================================
   PORTAL DA TRANSPARÊNCIA - APAE (CSS COMPLETO)
   - Página inicial (hub)
   - Páginas internas (listagens)
   - Botão VOLTAR no topo direito
   Arquivo: assets/css/style.css
========================================================== */

/* ---------- Base / Variáveis ---------- */
:root{
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #142033;
  --muted: #66758b;
  --line: #e7edf5;

  --brand: #1559A2;
  --brand2: #0b3f78;
  --accent: #0ea5e9;

  --shadow: 0 14px 34px rgba(16,24,40,.10);
  --shadow2: 0 10px 24px rgba(16,24,40,.08);

  --radius: 18px;
  --radius2: 14px;

  --max: 1240px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Arial, "Noto Sans", sans-serif;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }

body{
  margin:0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 520px at 10% -10%, rgba(21,89,162,.14), transparent 60%),
    radial-gradient(800px 500px at 90% 0%, rgba(14,165,233,.10), transparent 55%),
    var(--bg);
}

/* ==========================================================
   LAYOUT PADRÃO (PÁGINAS INTERNAS) — FAIXA + CONTEÚDO CENTRALIZADO
========================================================== */

/* Página base */
.page{
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Limitador central: use o mesmo max-width do header */
.content-limit{
  width: 100%;
  max-width: 1100px;          /* ajuste para bater com seu header */
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

/* ===== Faixa do título (cinza) ===== */
.title-band{
  width: 100%;
  background: #f3f4f6;
  padding: 26px 0;
}

/* Aumentos somente para páginas internas (título dentro da faixa cinza) */
.title-band .pageTitle{
  margin: 0;
}

.title-band .pageTitle h1{
  margin: 0 0 10px 0;
  font-size: 2rem;            /* maior */
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.title-band .pageTitle p{
  margin: 0;
  font-size: 1.1rem;          /* maior */
  line-height: 1.7;
  color: #374151;
}

/* ===== Faixa do conteúdo (branco) ===== */
.api-band{
  width: 100%;
  background: #ffffff;
  padding: 22px 0;
  border-top: 1px solid rgba(0,0,0,.06);
}

/* Garante que qualquer conteúdo interno não force largura */
.api-band *{
  box-sizing: border-box;
  max-width: 100%;
}

/* Espaço extra no final (opcional, evita “encostar” no rodapé) */
.api-band{
  padding-bottom: 30px;
}

/* ===== Responsivo ===== */
@media (max-width: 768px){
  .title-band{
    padding: 18px 0;
  }

  .title-band .pageTitle h1{
    font-size: 1.55rem;
    line-height: 1.25;
  }

  .title-band .pageTitle p{
    font-size: 1rem;
    line-height: 1.65;
  }
}

/* ===== Telas muito grandes (opcional) ===== */
@media (min-width: 1400px){
  .content-limit{
    max-width: 1240px;        /* se seu header “abre” mais em telas grandes */
  }
}

/* ==========================================================
   HEADER (com logo + botão voltar opcional)
========================================================== */

.header{
  background: rgba(255,255,255,.80);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

/* Força layout do header para evitar conflitos de template */
.header .header__inner{
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important; /* esquerda / direita */
  gap: 14px !important;

  /* CENTRALIZA COMO O RESTO DO SITE */
  max-width: var(--max) !important;
  margin: 0 auto !important;
  padding: 14px 16px !important;
  width: 100% !important;
}

/* Marca */
.brand{
  display:flex;
  align-items:center;
  gap: 12px;
}

.brand__logoWrap{
  height: 70px;          /* controla o tamanho da logo */
  width: auto;
  display:flex;
  align-items:center;
  overflow: visible;      /* remove o corte */
  background: none;
  border: 0;
  box-shadow: none;
}

.brand__logoImg{
  max-height: 70px;
  height: auto;
  width: auto;
  object-fit: contain;
  display:block;
}

.brand__text{
  line-height:1.15;
  min-width: 0;
}

.brand__title{
  display:block;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}

.brand__subtitle{
  display:block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

/* -------- Botões (base) -------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 16px;
  border-radius: 10px; /* retangular com leve arredondamento */
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .3px;
  text-decoration: none;
  white-space: nowrap;

  color:#fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: var(--shadow2);
  transition: all .15s ease;
}

.btn:hover{
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.btn:active{
  transform: translateY(0);
}

/* Botão VOLTAR */
.header .btn--top{
  margin-left: 0 !important; /* não precisa mais auto */
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 620px){
  .header .header__inner{
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .header .btn--top{
    align-self: flex-end !important;
    margin-top: 8px !important;
  }
}

@media (max-width:768px){
  .brand__logoWrap{ height:70px; }
  .brand__logoImg{ max-height:70px; }
}

/* ==========================================================
   TÍTULOS / SEÇÕES
========================================================== */

.pageTitle{
  padding: 18px 0 10px 0;
}

.pageTitle h1{
  margin:0 0 6px 0;
  font-size: 20px;
  letter-spacing: -.2px;
}

.pageTitle p{
  margin:0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.55;
}

/* ==========================================================
   GRID (Página inicial / HUB)
========================================================== */

.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 10px 0 22px 0;
}

@media (max-width: 980px){
  .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px){
  .grid{ grid-template-columns: 1fr; }
}

/* Box categoria */
.box{
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  overflow: hidden;
}

/* cabeçalho do box */
.box__head{
  display:flex;
  gap: 12px;
  padding: 14px 14px 10px 14px;
  border-bottom: 1px dashed rgba(102,117,139,.35);
  align-items:flex-start;
}

.box__icon{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display:grid;
  place-items:center;
  font-size: 20px;
  background: linear-gradient(135deg, rgba(21,89,162,.12), rgba(14,165,233,.10));
  border: 1px solid rgba(21,89,162,.14);
  flex: 0 0 auto;
}

.box__headText{
  min-width: 0;
}
.box__headText h2{
  margin: 0 0 4px 0;
  font-size: 15px;
  letter-spacing: -.2px;
}
.box__headText p{
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 12.5px;
  line-height: 1.45;
}

/* links do box */
.links{
  display:flex;
  flex-direction: column;
  padding: 6px;
}

.linkRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 12px 12px;
  margin: 6px;
  border-radius: 14px;
  border: 1px solid rgba(231,237,245,.95);
  background: #fff;
  text-decoration:none;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.linkRow:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow2);
  border-color: rgba(21,89,162,.22);
}

.linkRow__label{
  font-weight: 800;
  color: #2a3950;
  font-size: 13px;
  line-height: 1.35;
}

.linkRow__arrow{
  color: var(--brand2);
  font-weight: 900;
}

/* ==========================================================
   FOOTER (logo Agência New sem borda)
========================================================== */

/* Faixa do rodapé */
.footer-band{
  width: 100%;
  background: #f3f4f6;      /* mesmo cinza da barra do topo */
  padding: 18px 0;
}

/* Conteúdo interno alinhado e centralizado */
.footer__inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Texto do rodapé */
.footer__text{
  margin: 0;
  font-size: .95rem;
  color: #111827;           /* texto preto */
}

.footer__text .sep{
  margin: 0 6px;
  opacity: .6;
}

/* Logo Agência New */
.footer__brand img{
  height: 22px;
  width: auto;
  display: block;
}

/* Responsivo */
@media (max-width: 768px){
  .footer__inner{
    flex-direction: column;
    text-align: center;
  }
  .footer__brand img{
    height: 30px;
  }
}

/* ==========================================================
   Ajustes gerais para compatibilidade com templates
========================================================== */

/* Evita que algum CSS global transforme imagens em inline com espaço */
img{ vertical-align: middle; }

/* Evita que algum template coloque padding extra em main/section */
main, section{ display:block; }

/* Mantém links internos sem sublinhado por padrão */
a{ text-decoration: none; }
a:hover{ text-decoration: none; }

/* ==========================================================
   Botão voltar ao topo
========================================================== */
/* Botão voltar ao topo */
#backToTop{
  position: fixed;
  bottom: 80px;              /* mais alto para não colidir com o rodapé */
  right: 22px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: #14559C;       /* azul solicitado */
  color: #ffffff;            /* seta branca */
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  transition: opacity .25s ease, transform .25s ease, background .25s ease;
  z-index: 999;
}

#backToTop:hover{
  background: #0f4278;       /* azul um pouco mais escuro no hover */
  transform: translateY(-3px);
}

/* =========================
   SUBMENU INTERNO 
========================= */
/* Remove bolinhas de QUALQUER li dentro do submenu (inclusive li solto antes do CAPA) */
.subnav li{
  list-style: none;
  margin: 0;
  padding: 0;
}

.subnav{
  width: 100%;
  background: #f3f4f6; /* mesmo cinza do topo */
  border-top: 1px solid rgba(0,0,0,.06);
  border-bottom: 1px solid rgba(0,0,0,.06);
  position: relative;
  z-index: 50;         /* fica acima do conteúdo */
}

.subnav__inner{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;

  /* centralização na largura do conteúdo */
  max-width: var(--max);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* CAPA */
.subnav__home{
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .4px;
  color: #111827;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.subnav__home:hover{
  background: rgba(0,0,0,.05);
}

/* LISTA PRINCIPAL */
.subnav__list{
  list-style: none;
  padding: 0;
  margin: 0;

  display: flex;
  align-items: center;
  gap: 10px;

  flex: 1;
  min-width: 0;

  flex-wrap: wrap;     /* quebra linha ao invés de scroll */
  overflow: visible;   /* NÃO corta o dropdown */
}

/* ITEM (IMPORTANTE: padding-bottom cria "ponte" de hover) */
.subnav__item{
  position: relative;
  padding-bottom: 6px; /* evita o "buraco" entre botão e dropdown */
}

/* Links e botões */
.subnav__link,
.subnav__btn{
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: #111827;

  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;

  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;

  text-decoration: none;
}

.subnav__link:hover,
.subnav__btn:hover{
  background: rgba(0,0,0,.05);
}

.subnav__chev{
  font-size: 12px;
  opacity: .75;
}

/* DROPDOWN (IMPORTANTE: top 100% para encostar, sem gap "mortal") */
.subnav__drop{
  position: absolute;
  left: 0;
  top: 100%;            /* encosta no botão */
  margin-top: 6px;      /* respiro visual SEM criar buraco de hover */

  min-width: 320px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
  padding: 8px;

  display: none;
  z-index: 9999;
}

.subnav__drop a{
  display: block;
  padding: 10px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: #111827;
  font-weight: 600;
  line-height: 1.25;
}

.subnav__drop a:hover{
  background: rgba(0,0,0,.05);
}

/* Abre no hover (desktop) */
.subnav__item:hover .subnav__drop{
  display: block;
}

/* MOBILE */
@media (max-width: 900px){
  .subnav__inner{
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .subnav__list{
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .subnav__item{
    width: 100%;
    padding-bottom: 0; /* no mobile não precisa "ponte" */
  }

  .subnav__link,
  .subnav__btn{
    width: 100%;
    justify-content: space-between;
  }

  /* no mobile o dropdown fica abaixo, não flutuante */
  .subnav__drop{
    position: static;
    min-width: 100%;
    margin-top: 6px;
    box-shadow: none;
  }

  /* mobile não abre por hover */
  .subnav__item:hover .subnav__drop{
    display: none;
  }
}
