/* =========================================================
   HOMEPAGE
   Destaques + Notícias + Agenda + Publicações + tema atual
   ========================================================= */

/* ---------------------------------------------------------
   Estrutura comum
   --------------------------------------------------------- */

#destaques .home-wide-container,
#agenda .home-wide-container,
#documentos .home-wide-container,
#noticias .home-news-container {
  max-width: 1480px;
}

#destaques .row,
#noticias .home-news-grid {
  --bs-gutter-x: 2rem;
  --bs-gutter-y: 2rem;
}

#agenda .agenda-layout,
#documentos .row {
  width: 100%;
}

/* ---------------------------------------------------------
   Destaques
   --------------------------------------------------------- */

.highlights-section {
  position: relative;
  overflow: hidden;
}

#destaques .highlight-card {
  display: flex;
  flex-direction: column;
  min-height: 530px;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(6, 70, 111, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 11px 30px rgba(6, 70, 111, .08);
  transition: transform .28s ease, box-shadow .28s ease;
}

#destaques .highlight-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 38px rgba(6, 70, 111, .15);
}

#destaques .highlight-image {
  flex: 0 0 340px;
  width: 100%;
  height: 340px;
  min-height: 340px;
  overflow: hidden;
}

#destaques .highlight-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .4s ease;
}

#destaques .highlight-card:hover .highlight-image img {
  transform: scale(1.035);
}

#destaques .highlight-body {
  flex: 1 1 auto;
  min-height: 190px;
  padding: 20px 26px 21px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#destaques .highlight-status {
  display: inline-block;
  padding: 7px 11px;
  margin-bottom: 15px;
  border-radius: 999px;
  font: 700 .68rem "Montserrat", sans-serif;
  letter-spacing: .045em;
}

#destaques .status-green {
  color: #0b7111;
  background: #e8f6e7;
}

#destaques .status-blue {
  color: #0c6398;
  background: #e5f3fb;
}

#destaques .status-orange {
  color: #a44b00;
  background: #fff0df;
}

#destaques .highlight-body h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font: 750 1.25rem/1.35 "Montserrat", sans-serif;
}

#destaques .highlight-deadline {
  color: var(--blue);
  font-size: .88rem;
  font-weight: 750;
}

#destaques .highlight-body a {
  margin-top: auto;
  color: var(--blue);
  text-decoration: none;
  font-weight: 750;
}

#destaques .highlight-body a:hover {
  color: var(--green);
}

/* ---------------------------------------------------------
   Últimas Notícias
   --------------------------------------------------------- */

#noticias .news-card {
  display: flex;
  flex-direction: column;
  min-height: 530px;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(6, 70, 111, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 7px 24px rgba(6, 70, 111, .08);
  transition: transform .22s ease, box-shadow .22s ease;
}

#noticias .news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(6, 70, 111, .13);
}

#noticias .news-image {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: 340px;
  min-height: 340px;
  overflow: hidden;
}

#noticias .news-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  transition: transform .4s ease;
}

#noticias .news-card:hover .news-image img {
  transform: scale(1.035);
}

#noticias .news-body {
  flex: 1 1 auto;
  min-height: 190px;
  padding: 20px 26px 21px;
  display: flex;
  flex-direction: column;
}

#noticias .news-body time {
  font-size: .8rem;
  color: #627b89;
}

#noticias .news-body h3 {
  margin: .55rem 0;
  font-size: 1.15rem;
  line-height: 1.35;
}

#noticias .news-body h3 a {
  color: var(--ink);
  text-decoration: none;
}

#noticias .news-body p {
  font-size: .9rem;
  line-height: 1.5;
}

#noticias .read-more {
  margin-top: auto;
  color: var(--blue);
  text-decoration: none;
  font-weight: 750;
}

/* ---------------------------------------------------------
   Agenda
   --------------------------------------------------------- */

#agenda {
  color: var(--text);
}

#agenda .agenda-heading h2 {
  color: var(--ink);
}

#agenda .agenda-layout {
  display: grid;
  grid-template-columns: minmax(300px, .8fr) minmax(0, 1.5fr);
  gap: 28px;
}

#agenda .calendar-panel,
#agenda .event-panel {
  border: 1px solid rgba(6, 70, 111, .09);
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 12px 32px rgba(6, 70, 111, .09);
}

#agenda .calendar-panel {
  padding: 24px;
}

#agenda .calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

#agenda .calendar-toolbar h3 {
  margin: 0;
  color: var(--ink);
  font: 700 1.2rem "Montserrat", sans-serif;
}

#agenda .calendar-toolbar button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(23, 109, 168, .22);
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
  font-size: 1.7rem;
}

#agenda .calendar-toolbar button:hover {
  background: var(--blue);
  color: #fff;
}

#agenda .calendar-weekdays,
#agenda .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}

#agenda .calendar-weekdays span {
  text-align: center;
  color: #78909b;
  font-size: .68rem;
  font-weight: 800;
}

#agenda .calendar-day {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #82939c;
  font-weight: 650;
}

#agenda .calendar-day.empty {
  display: block;
}

#agenda .calendar-day.has-event {
  background: rgba(23, 109, 168, .1);
  color: var(--ink);
  cursor: pointer;
}

#agenda .calendar-day.has-event::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  transform: translateX(-50%);
}

#agenda .calendar-day.selected {
  background: var(--blue);
  color: #fff;
}

#agenda .calendar-day.selected::after {
  background: #fff;
}

#agenda .calendar-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: .82rem;
}

#agenda .calendar-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

#agenda .event-panel {
  display: grid;
  grid-template-columns: minmax(220px, 38%) 1fr;
  min-height: 390px;
  overflow: hidden;
}

#agenda .event-poster {
  min-height: 390px;
  background: #e6eef2;
}

#agenda .event-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#agenda .event-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 34px;
}

#agenda .event-content > :first-child {
  margin-top: 0;
}

#agenda .event-topline {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

#agenda .event-big-date {
  width: 70px;
  height: 70px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--orange), #ff8b1a);
  color: #fff;
}

#agenda .event-big-date strong {
  font-size: 1.7rem;
  line-height: 1;
}

#agenda .event-big-date span {
  font-size: .7rem;
  font-weight: 800;
}

#agenda #eventCategory {
  color: var(--blue);
  font: 700 .72rem "Montserrat", sans-serif;
  letter-spacing: .06em;
}

#agenda .event-content h3 {
  color: var(--ink);
  font: 800 2rem "Montserrat", sans-serif;
}

#agenda .event-meta {
  color: var(--blue);
  font-weight: 700;
}

#agenda #eventLink {
  color: var(--blue);
  text-decoration: none;
  font-weight: 750;
}

/* ---------------------------------------------------------
   Editais e Publicações
   --------------------------------------------------------- */

#documentos .publication-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
  border: 1px solid rgba(6, 70, 111, .09);
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(6, 70, 111, .06);
  transition: transform .22s ease;
}

#documentos .publication-card:hover {
  transform: translateY(-4px);
}

#documentos .publication-card span {
  color: var(--green);
  font: 700 .7rem "Montserrat", sans-serif;
}

#documentos .publication-card strong {
  margin: 7px 0;
  color: var(--ink);
}

#documentos .publication-card small {
  color: #708691;
}

/* ---------------------------------------------------------
   Tema atual dos fundos
   --------------------------------------------------------- */

/* Retira ondas/fundos antigos que possam interferir. */
#destaques::before,
#destaques::after,
#noticias::before,
#noticias::after,
#agenda::before,
#agenda::after,
#documentos::before,
#documentos::after,
.section-wave::before,
.section-wave::after,
.news-section::before,
.news-section::after,
.highlights-section::before,
.highlights-section::after,
.agenda-section::before,
.agenda-section::after,
.recent-docs-section::before,
.recent-docs-section::after {
  content: none !important;
  display: none !important;
}

#destaques {
  background: linear-gradient(
    180deg,
    #e4f3fb 0%,
    #e8f6f3 52%,
    #edf7ec 100%
  ) !important;
}

#noticias {
  background: linear-gradient(
    180deg,
    #edf7ec 0%,
    #f4f8ef 48%,
    #faf6e9 100%
  ) !important;
}

#agenda {
  background: linear-gradient(
    180deg,
    #faf6e9 0%,
    #f2f7f2 45%,
    #e6f3f9 100%
  ) !important;
}

#documentos,
.documentos-section,
.publicacoes-section {
  background: linear-gradient(
    180deg,
    #e6f3f9 0%,
    #edf7f3 50%,
    #f2f8ef 100%
  ) !important;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 1199px) {
  #destaques .highlight-card,
  #noticias .news-card {
    min-height: 480px;
  }

  #destaques .highlight-image {
    flex-basis: 300px;
    height: 300px;
    min-height: 300px;
  }

  #noticias .news-image {
    height: 300px;
    min-height: 300px;
  }

  #destaques .highlight-body,
  #noticias .news-body {
    min-height: 180px;
  }
}

@media (max-width: 991px) {
  #destaques .highlight-card,
  #noticias .news-card {
    min-height: 460px;
  }

  #destaques .highlight-image {
    flex-basis: 280px;
    height: 280px;
    min-height: 280px;
  }

  #noticias .news-image {
    height: 280px;
    min-height: 280px;
  }

  #agenda .agenda-layout {
    grid-template-columns: 1fr;
  }

  #agenda .event-panel {
    grid-template-columns: 36% 1fr;
  }
}

@media (max-width: 767px) {
  #destaques .highlight-card,
  #noticias .news-card {
    min-height: 0;
  }

  #destaques .highlight-image {
    flex-basis: 250px;
    height: 250px;
    min-height: 250px;
  }

  #noticias .news-image {
    height: 250px;
    min-height: 250px;
  }

  #destaques .highlight-body,
  #noticias .news-body {
    min-height: 150px;
  }
}

@media (max-width: 650px) {
  #agenda .event-panel {
    grid-template-columns: 1fr;
  }

  #agenda .event-poster {
    min-height: 300px;
  }

  #agenda .event-content {
    padding: 25px;
  }
}

/* Número/referência opcional nas publicações do WordPress. */
#documentos .publication-number {
	display: block;
	margin-top: 3px;
	color: #708691;
	font-size: .78rem;
	font-weight: 600;
}

/* =========================================================
   DESTAQUES — CARDS HORIZONTAIS
   Imagem à esquerda / conteúdo à direita.
   Cantos inferiores retos.
   ========================================================= */

/* Um destaque por linha para dar espaço ao layout horizontal. */
#destaques .row > [class*="col-"] {
  width: 100%;
  max-width: 100%;
  flex: 0 0 100%;
}

/* Card horizontal. */
#destaques .highlight-card {
  flex-direction: row;
  min-height: 320px;
  height: auto;

  /* topo arredondado, base reta */
  border-radius: 12px 12px 0 0;
}

/* Imagem ocupa sensivelmente 42% do card. */
#destaques .highlight-image {
  flex: 0 0 42%;
  width: 42%;
  height: 320px;
  min-height: 320px;
}

/* A imagem acompanha o formato do card. */
#destaques .highlight-image img {
  border-radius: 11px 0 0 0;
}

/* Conteúdo ao lado da imagem. */
#destaques .highlight-body {
  flex: 1 1 58%;
  min-height: 320px;
  padding: 32px 38px;
  justify-content: flex-start;
}

#destaques .highlight-body h3 {
  max-width: 720px;
  font-size: 1.4rem;
}

#destaques .highlight-body > p:not(.highlight-deadline) {
  max-width: 760px;
  line-height: 1.65;
}

/* O botão continua encostado à base do bloco de texto. */
#destaques .highlight-body > a {
  margin-top: auto;
}

/* Tablet: imagem um pouco mais estreita. */
@media (max-width: 991px) {
  #destaques .highlight-card {
    min-height: 285px;
  }

  #destaques .highlight-image {
    flex-basis: 40%;
    width: 40%;
    height: 285px;
    min-height: 285px;
  }

  #destaques .highlight-body {
    min-height: 285px;
    padding: 26px 30px;
  }
}

/* Mobile: volta a empilhar verticalmente. */
@media (max-width: 767px) {
  #destaques .highlight-card {
    flex-direction: column;
    min-height: 0;
    border-radius: 12px 12px 0 0;
  }

  #destaques .highlight-image {
    flex: 0 0 auto;
    width: 100%;
    height: 250px;
    min-height: 250px;
  }

  #destaques .highlight-image img {
    border-radius: 11px 11px 0 0;
  }

  #destaques .highlight-body {
    min-height: 0;
    padding: 22px 24px 26px;
  }

  #destaques .highlight-body h3 {
    font-size: 1.22rem;
  }
}



/* =========================================================
   FUNDO APROVADO — NEUTRO ELEGANTE
   ========================================================= */
/* =========================================================
   HOMEPAGE — OVERRIDE DE FUNDOS
   Colocar este ficheiro DEPOIS do style.css principal.
   ========================================================= */

/* Remove ondas/manchas decorativas antigas entre secções */
#destaques::before,
#destaques::after,
#noticias::before,
#noticias::after,
#agenda::before,
#agenda::after,
#documentos::before,
#documentos::after,
.section-wave::before,
.section-wave::after,
.news-section::before,
.services-section::before {
  content: none !important;
  display: none !important;
}

/* Evita que fundos antigos com !important continuem a ganhar */
#destaques,
#noticias,
#agenda,
#documentos,
.documentos-section,
.publicacoes-section {
  background-image: none !important;
}


/* =========================================================
   VERSÃO 2 — NEUTRO ELEGANTE
   ========================================================= */

:root {
  --home-bg-1: #f7f9fa;
  --home-bg-2: #ffffff;
  --home-bg-3: #f3f7f9;
  --home-bg-4: #fafbfc;
}

#destaques {
  background: var(--home-bg-1) !important;
}

#noticias {
  background: var(--home-bg-2) !important;
}

#agenda {
  background: var(--home-bg-3) !important;
}

#documentos,
.documentos-section,
.publicacoes-section {
  background: var(--home-bg-4) !important;
}


/* v0.45.6.17 — menu transparente na página principal. */
body.home .sticky-site-header .main-navbar {
  background: rgba(238,249,253,.12) !important;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
body.home .main-navbar::after { content: none !important; display: none !important; }


/* v0.45.6.19 — menu escuro translúcido conforme a referência. */
body.home .sticky-site-header .main-navbar {
  background: rgba(15, 31, 42, .53) !important;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .13);
}
body.home .main-navbar .nav-link,
body.home .main-navbar .nav-link:hover,
body.home .main-navbar .nav-link:focus,
body.home .main-navbar .nav-link.active {
  color: #fff !important;
  text-shadow: none !important;
}
body.home .navbar-brand img { filter: none !important; }
body.home .main-navbar .nav-link::after { background: #9bd690; }
@media (max-width: 991px) {
  body.home .main-navbar .navbar-collapse .nav-link,
  body.home .main-navbar .navbar-collapse .nav-link:hover,
  body.home .main-navbar .navbar-collapse .nav-link:focus {
    color: #082f4a !important;
  }
}

/* v0.45.6.20 — fundos harmonizados, sem modificar o rodapé. */
body.home { --home-bg-1: #eaf6fd; --home-bg-2: #f6fbfe; --home-bg-3: #eaf4fa; --home-bg-4: #e6f4f2; }
#destaques { background: linear-gradient(180deg, #eaf6fd 0%, #f2faff 100%) !important; }
#noticias { background: linear-gradient(180deg, #f6fbfe 0%, #f8fcff 100%) !important; }
#agenda { background: linear-gradient(180deg, #eaf4fa 0%, #edf7fb 100%) !important; }
#documentos { background: linear-gradient(180deg, #e9f5fb 0%, #e6f4ee 100%) !important; }
/* Fundo do menu um pouco mais claro do que na versão anterior. */



/* v0.45.6.23: vence as antigas definições fixas do fundo do menu. */
body.home .sticky-site-header .main-navbar {
  background: var(--jf-hero-menu, rgba(20,53,85,.61)) !important;
}

/* v0.45.6.24 — transições suaves, sem faixa entre ondas e destaques. */
body.home #destaques { background: #eaf6fd !important; }
body.home #noticias { background: linear-gradient(180deg,#f7fbfe,#f8fcff) !important; }
body.home #agenda { background: linear-gradient(180deg,#edf6fb,#edf8f8) !important; }
body.home #documentos { background: linear-gradient(180deg,#edf8f9,#e4f3e9) !important; }
body.home .hero-shell { margin-bottom:0; border-bottom:0; }
body.home .jfssm-home-hero-waves { bottom:-1px; }

/* v0.45.6.25: base predominantemente branca, sem faixa entre ondas e secções. */
body.home #destaques { background: #f8fcfe !important; }
body.home #noticias { background: #fbfdff !important; }
body.home #agenda { background: #f4f9fc !important; }
body.home #documentos { background: linear-gradient(180deg,#f9fcfe 0%,#f5faf7 100%) !important; }


/* v0.45.6.26 — homepage com gradiente vertical contínuo */
body.home main {
  background: linear-gradient(
    180deg,
    #f8fcfe 0%,
    #fbfdff 30%,
    #f6fbfe 55%,
    #f5faf9 78%,
    #f3f9f6 100%
  ) !important;
}

body.home #destaques,
body.home #noticias,
body.home #agenda,
body.home #documentos,
body.home .documentos-section,
body.home .publicacoes-section,
body.home .highlights-section,
body.home .news-section,
body.home .agenda-section,
body.home .recent-docs-section {
  background: transparent !important;
}

body.home .home-section {
  background: transparent !important;
}


/* v0.45.6.28: elementos da homepage acompanham a cor das ondas. */
body.home {
  --jf-accent: #176da8;
  --jf-accent-pale: rgba(23,109,168,.13);
}
body.home #destaques { padding-top:20px; }
body.home .outline-link,
body.home #agenda #eventLink,
body.home #destaques .highlight-body > a,
body.home #noticias .read-more {
  color: var(--jf-accent) !important;
  border-color: var(--jf-accent) !important;
  transition:background-color .7s, border-color .7s, color .7s;
}
body.home .outline-link:hover,
body.home #agenda #eventLink:hover,
body.home #agenda .calendar-toolbar button:hover,
body.home #agenda .calendar-day.selected {
  background:var(--jf-accent) !important;
  color:#fff !important;
}
body.home #agenda .calendar-toolbar button { color:var(--jf-accent);border-color:var(--jf-accent); }
body.home #agenda .calendar-day.has-event {background:var(--jf-accent-pale);}
body.home #agenda .calendar-day.has-event::after {background:var(--jf-accent);}
body.home #destaques .highlight-status {box-shadow:inset 0 0 0 1px var(--jf-accent-pale);}
body.home #documentos .publication-card:hover,
body.home #noticias .news-card:hover {border-color:var(--jf-accent-pale);}

/* v0.45.6.29 — ações com a cor ativa do hero, preenchidas por defeito. */
body.home .outline-link,
body.home #agenda #eventLink,
body.home #destaques .highlight-body > a,
body.home #noticias .read-more {
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  padding:.65rem 1.1rem;border:1px solid var(--jf-accent);
  border-radius:9px;background:var(--jf-accent)!important;
  color:#fff!important;text-decoration:none;
  transition:background-color .4s,color .4s,border-color .4s,transform .2s;
}
body.home .outline-link:hover,
body.home #agenda #eventLink:hover,
body.home #destaques .highlight-body > a:hover,
body.home #noticias .read-more:hover {
  background:transparent!important;color:var(--jf-accent)!important;
}
body.home .mini-colors i:first-child,
body.home #agenda .calendar-day.selected,
body.home #agenda .event-big-date,
body.home #agenda .calendar-toolbar button:hover {background:var(--jf-accent)!important;}
body.home #documentos .publication-card:hover,
body.home #destaques .highlight-card:hover,
body.home #noticias .news-card:hover {border-color:var(--jf-accent)!important;}
body.home #destaques {padding-top:35px;}
@media(max-width:767px){body.home #destaques{padding-top:25px;}}

/* v0.45.6.32 — elimina a faixa na união do hero e destaques. */
body.home #destaques {background:transparent!important;position:relative;}
body.home main {background:linear-gradient(180deg,#f8fcfe 0%,#fbfdff 34%,#f5faf8 100%)!important;}
