/* Header / Logo shared styles consolidated from multiple pages */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #203a43f6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: padding 500ms ease, background-color 500ms ease;
  padding: 4px 0px 4px 0px;
  box-sizing: border-box;
}

.header-inner {
  width: 1000px;
  max-width: calc(100% - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: justify-content 500ms ease;
}

.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 500ms ease;
}

.logo-wrap img {
  width: 340px;
  height: auto;
  object-fit: contain;
  transition: transform 500ms cubic-bezier(.2,.9,.2,1), margin 500ms ease, opacity 300ms ease;
  transform-origin: center center;
  display: block;
}

.logo-text {
  font-weight: 700;
  font-size: 1.2rem;
  color: white;
  margin: 0;
  transition: opacity 250ms ease, transform 300ms ease, max-height 350ms ease;
  opacity: 1;
  transform: translateY(0);
  white-space: nowrap;
}

/* scrolled state */
body.scrolled header {
  padding: 4px 6px;
}

body.scrolled .header-inner {
  justify-content: flex-start;
  width: 100%;
  max-width: none;
  padding-left: 6px;
  box-sizing: border-box;
}

body.scrolled .logo-wrap {
  align-items: flex-start;
  padding-top: 0px;
  padding-bottom: 0px;
  gap: 4px;
}

body.scrolled .logo-wrap img {
  width: 140px;
  height: auto;
  margin-right: 0;
  transform: none;
  transform-origin: left center;
  display: block;
  /* suaviza o desaparecimento visual quando o header é recolhido */
  opacity: 1.0;
}

body.scrolled .logo-text {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* mobile adjustments */
@media (max-width: 600px) {
  .logo-wrap img {
    width: 260px;
    height: auto;
    transform-origin: center center;
  }

  .logo-text {
    display: block;
  }

  body.scrolled .logo-wrap img {
    width: 143px;
    height: auto;
    transform: none;
    opacity: 1.0;
  }

  .container {
    padding-top: 120px;
  }

  body.scrolled header {
    /* keep previous mobile rule (note: small typo preserved if present in origin) */
    padding: 4px10px;
  }

  body.scrolled .logo-wrap {
    padding-top: 2px;
    padding-bottom: 2px;
  }
}

/* default container spacing to avoid content under fixed header */
.container {
  max-width: 1000px;
  margin: auto;
  padding: 30px 20px;
  padding-top: 150px;
  box-sizing: border-box;
}

/* Submenu buttons spacing (desktop + mobile) */
.submenu {
  display: flex;
  flex-wrap: wrap;
  gap: 12px; /* horizontal + vertical gap between buttons */
  align-items: center;
  margin: 12px 0;
}

.submenu button {
  background-color: #007acc;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
}

.submenu button:hover {
  background-color: #005fa3;
}

@media (max-width: 600px) {
  .submenu {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .submenu button {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}
