/* =========================================================
   CABEÇALHO, LAYOUT GERAL E SEÇÕES PRINCIPAIS
========================================================= */

/* Header fixo no topo */
header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--brand-blue);
  border-bottom: 3px solid var(--header-border);
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  height: var(--header-h);
}

.header-container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 0 clamp(14px,2vw,24px);
}

/* Esquerda (Home/Biomapa), Centro (Título), Direita (Logos) */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.site-title {
  grid-column: 2;
  justify-self: center;
  text-align: center;
  margin: 0;
  color: #fff;
  font-weight: 800;
  font-size: clamp(14px,1.7vw,20px);
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-logos {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px, 1.4vw, 16px);
  min-width: 0;
}

.header-logos__divider {
  flex-shrink: 0;
  align-self: center;
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.35);
}

.ministry-brand {
  display: flex;
  align-items: stretch;
  max-width: clamp(148px, 20vw, 260px);
  padding-left: 10px;
  border-left: 3px solid var(--header-border);
}

.ministry-brand__name {
  margin: 0;
  color: #fff;
  font-weight: 700;
  font-size: clamp(9px, 0.95vw, 11px);
  line-height: 1.25;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: right;
}

.ministry-brand__line {
  display: block;
  white-space: nowrap;
}

.partner-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.partner-brand__logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 40px;
  padding: 0 4px;
  background: transparent;
  border-radius: 0;
}

.partner-brand__logo {
  display: block;
  height: 32px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Home: títulos e textos */
.home-title {
  margin: 10px 0 6px;
  text-align: center;
  font-weight: 800;
  font-size: clamp(38px,5vw,56px);
  line-height: 1.05;
}

.home-subtitle {
  margin: 2px 0 6px;
  text-align: center;
  font-weight: 700;
  font-size: clamp(16px,2.4vw,22px);
  color: #1f2937;
}

.home-states {
  margin: 0 0 36px;
  text-align: center;
  color: #64748b;
  font-size: clamp(12px,1.4vw,14px);
}

.home-intro {
  font-size: var(--home-body-size);
  line-height: var(--home-body-line);
}

.home-kicker {
  font-weight: 400;
  font-size: var(--home-body-size);
  line-height: var(--home-body-line);
  margin: 12px auto 14px;
}

/* Grid de cards da home */
.cards-section {
  padding: 0 var(--site-pad) 28px;
}

.card-grid {
  max-width: var(--site-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12,1fr);
  gap: clamp(12px,1.6vw,20px);
}

.hero-card {
  grid-column: span 6;
}

@media (max-width:860px) {
  .hero-card {
    grid-column: 1 / -1;
  }
}

.hero-card {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 220px;
  border-radius: 18px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0,0,0,.14);
  isolation: isolate;
  background: #111;
  transition: transform .25s, box-shadow .25s;
}

@media (min-width:1100px) {
  .hero-card { min-height: 250px; }
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: center/cover no-repeat var(--bg);
  filter: brightness(.8) saturate(1.05);
  transform: scale(1);
  transition: transform .6s;
  z-index: -2;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,rgba(0,0,0,.08) 0%,rgba(0,0,0,.58) 80%);
  z-index: -1;
}

.hero-card__content {
  position: absolute;
  inset: auto 18px 16px 18px;
}

.hero-card__title {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: clamp(22px,2.5vw,32px);
  line-height: 1.05;
  text-shadow: 0 2px 12px rgba(0,0,0,.35);
}

.hero-card__desc {
  margin: 0 0 10px;
  font-size: clamp(14px,1.6vw,16px);
}

.hero-card__cta {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 999px;
  background: #1fb690;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(31,182,144,.35);
}

.hero-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(0,0,0,.18);
}

.hero-card:hover::after {
  transform: scale(1.05);
}

.hero-card--map {
  --bg: url('../img/Brasil.png');
}

.hero-card--patentes {
  --bg: url('../img/ip.jpg');
}

.hero-card--composicao {
  --bg: url('../img/apli.jpg');
}

.hero-card--aplicacoes {
  --bg: url('../img/res.jpg');
}

/* Containers alinhados com o máximo do site */
.home-hero,
#etapasCarousel,
.cards-section {
  max-width: var(--site-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--site-pad);
  padding-right: var(--site-pad);
}

.home-states { margin-bottom: 50px; }
.home-intro { margin-bottom: 40px; }
.home-hero .home-kicker { margin-bottom: 30px; }
.home-hero .home-title { margin-bottom: 12px; }
.home-page .home-title {
  margin-top: clamp(24px,3vw,60px);
}

/* Header responsivo */
@media (max-width:540px) {
  .nav-button,
  .dropbtn {
    width: auto;
    height: auto;
    padding: 8px 12px;
  }
  .ministry-brand {
    max-width: 128px;
    padding-left: 8px;
    border-left-width: 2px;
  }

  .ministry-brand__name {
    font-size: 8px;
    letter-spacing: 0.02em;
  }

  .header-logos__divider {
    height: 30px;
  }

  .partner-brand__logo-wrap {
    height: 34px;
    padding: 0 3px;
  }

  .partner-brand__logo {
    height: 28px;
    max-width: 88px;
  }
}
