/*
 * Mantovani Investimentos — refinamentos finais
 * Esta camada estabiliza os componentes legados sem alterar a arquitetura
 * estática do projeto. Os breakpoints seguem uma única ordem de cascata.
 */

:root {
  --header-height: 80px;
}

html,
body {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

html.menu-open,
body.menu-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.site-header__inner {
  grid-template-columns: 220px minmax(0, 1fr) auto auto;
  gap: 22px;
  min-height: var(--header-height);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: auto;
  min-width: 0;
}

.site-brand .site-brand__symbol {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.site-brand__wordmark {
  display: grid;
  color: var(--blue-strong);
  line-height: 1;
}

.site-brand__wordmark strong {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 850;
  letter-spacing: .055em;
}

.site-brand__wordmark small {
  margin-top: 5px;
  color: var(--red);
  font-family: var(--font-display);
  font-size: .52rem;
  font-weight: 800;
  letter-spacing: .19em;
}

.site-nav {
  min-width: 0;
}

.site-nav a {
  white-space: nowrap;
}

.hero {
  min-height: 780px;
  padding: 0;
  background:
    radial-gradient(circle at 78% 18%, rgba(179, 32, 42, .10), transparent 24%),
    linear-gradient(115deg, #fff 0 57%, #f3f5fb 57% 100%);
}

.hero-grid {
  grid-template-columns: minmax(0, 1.22fr) minmax(390px, 430px);
  align-items: center;
  gap: clamp(52px, 6vw, 86px);
  min-height: 780px;
  padding-top: 32px;
  padding-bottom: 32px;
}

.hero-copy {
  width: auto;
  max-width: 720px;
  padding: 0;
}

.hero-copy h1 {
  max-width: 720px;
  font-size: clamp(3.5rem, 4.4vw, 4rem);
  line-height: .97;
}

.hero-copy > p {
  max-width: 610px;
}

.hero-copy > .hero-legal-note {
  max-width: 600px;
  margin: -12px 0 24px;
  color: #747986;
  font-size: .75rem;
  line-height: 1.5;
}

.hero .simulator-card {
  width: 100%;
  margin: 0;
  align-self: center;
}

.about-preview__visual--photo-slot,
.story-visual--photo-slot {
  min-height: 500px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

.about-preview__visual--photo-slot {
  background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 30px 72px rgba(4, 12, 34, .24);
}

.story-visual--photo-slot {
  background: linear-gradient(135deg, #eceef3, #d8dce5);
  border: 1px solid rgba(18,27,66,.10);
  box-shadow: 0 24px 58px rgba(16,31,68,.12);
}

.home-page .section {
  padding-top: 96px;
  padding-bottom: 96px;
}

.home-page .articles-grid--three {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 900px;
  margin-inline: auto;
}

.metrics-note {
  margin-top: -1px;
  padding: 12px 24px 14px;
  color: #7a7e89;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: .72rem;
  line-height: 1.45;
}

.metrics-grid > div:last-child {
  border-right: 1px solid var(--line);
}

.text-link,
.service-card > a,
.article-card__body > a {
  min-height: 44px;
  align-items: center;
}

.footer-links a,
.footer-contact a {
  min-height: 36px;
  display: flex;
  align-items: center;
}

.floating-whatsapp {
  transition: opacity .2s, transform .2s, background .18s, box-shadow .18s;
}

@media (width <= 1180px) {
  .site-header__inner {
    grid-template-columns: 205px minmax(0, 1fr) auto;
    gap: 18px;
  }

  .header-socials {
    display: none;
  }

  .site-nav {
    gap: 18px;
  }

  .site-nav a {
    font-size: .82rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(350px, 390px);
    gap: 42px;
  }

  .hero-copy h1 {
    font-size: 3.45rem;
  }
}

@media (width <= 980px) {
  :root {
    --header-height: 72px;
  }

  .site-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: var(--header-height);
  }

  .site-brand {
    width: max-content;
    max-width: 100%;
  }

  .site-nav {
    z-index: 60;
    top: calc(var(--header-height) + 8px);
    left: 18px;
    right: 18px;
    max-height: calc(100dvh - var(--header-height) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .site-nav a {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
  }

  .hero {
    min-height: 0;
    padding: 34px 0 58px;
    background:
      radial-gradient(circle at 88% 12%, rgba(179, 32, 42, .09), transparent 24%),
      linear-gradient(180deg, #fff, #f6f7fb);
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    min-height: 0;
    padding: 0;
  }

  .hero-copy {
    width: min(100%, 700px);
    max-width: 700px;
    margin-inline: auto;
    padding: 18px 0 0;
  }

  .hero .simulator-card {
    width: min(100%, 680px);
    margin: 0 auto;
  }

  .inner-hero__grid {
    min-height: 360px;
  }

  .about-preview__visual--photo-slot,
  .story-visual--photo-slot {
    width: min(100%, 620px);
    min-height: 430px;
  }

  .floating-whatsapp {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    justify-content: center;
    width: 58px;
    height: 58px;
    min-height: 58px;
    padding: 6px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(.94);
  }

  .floating-whatsapp.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .floating-whatsapp strong {
    display: none;
  }

  .floating-whatsapp span {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }
}

@media (width <= 640px) {
  :root {
    --header-height: 68px;
  }

  .shell {
    width: min(calc(100% - 30px), var(--shell));
  }

  .section,
  .home-page .section {
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .site-header__inner {
    min-height: var(--header-height);
  }

  .site-brand {
    gap: 8px;
  }

  .site-brand .site-brand__symbol {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }

  .site-brand__wordmark strong {
    font-size: .88rem;
  }

  .site-brand__wordmark small {
    margin-top: 4px;
    font-size: .43rem;
  }

  .menu-toggle {
    width: 44px;
    height: 44px;
  }

  .site-nav {
    position: fixed;
    top: calc(var(--header-height) + 8px);
    left: 12px;
    right: 12px;
    padding: 10px;
  }

  .site-nav a {
    justify-content: flex-start;
    min-height: 48px;
    padding: 11px 14px;
  }

  .hero {
    padding: 26px 0 48px;
  }

  .hero-grid {
    gap: 28px;
    padding: 0;
  }

  .hero-copy {
    order: 1;
    padding: 0;
  }

  .hero-copy h1 {
    margin: 18px 0 18px;
    font-size: clamp(2.45rem, 12vw, 3rem);
    line-height: 1.01;
  }

  .hero-copy > p {
    margin-bottom: 18px;
    font-size: 1rem;
    line-height: 1.6;
  }

  .hero-checks {
    margin-bottom: 18px;
  }

  .hero-copy > .hero-legal-note {
    margin: -4px 0 20px;
    font-size: .7rem;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-actions .text-link {
    width: 100%;
    justify-content: center;
  }

  .hero .simulator-card {
    order: 2;
    width: 100%;
    margin: 0;
    padding: 22px 18px;
  }

  .simulator-goals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .simulator-goals button {
    grid-template-columns: 1fr;
    justify-items: center;
    min-width: 0;
    min-height: 78px;
    padding: 9px 3px;
    text-align: center;
    font-size: .68rem;
    line-height: 1.15;
  }

  .simulator-value {
    flex-direction: row;
    align-items: flex-end;
  }

  .metrics-note {
    width: 100%;
    padding-inline: 18px;
    text-align: left;
  }

  .metrics-grid > div:last-child {
    border-right: 1px solid var(--line) !important;
  }

  .inner-hero {
    padding: 50px 0;
  }

  .inner-hero__grid {
    min-height: 0;
    gap: 24px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .inner-hero h1 {
    font-size: clamp(2.45rem, 12vw, 3.2rem);
    line-height: 1.02;
  }

  .inner-hero__line {
    display: none;
  }

  .inner-hero__aside {
    width: 100%;
    padding: 20px 22px;
  }

  .section-heading--centered {
    margin-bottom: 32px;
  }

  .filter-row {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0 -15px 30px;
    padding: 0 15px 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }

  .filter-row button {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .about-preview__visual--photo-slot,
  .story-visual--photo-slot {
    min-height: 340px;
    height: 340px;
  }

  .home-page .articles-grid--three {
    grid-template-columns: 1fr;
  }

  .floating-whatsapp {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: 56px;
    height: 56px;
    min-height: 56px;
    padding: 5px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(.94);
  }

  .floating-whatsapp.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .floating-whatsapp span {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

  .contact-cards > a,
  .footer-links a,
  .footer-contact a {
    min-height: 44px;
  }

  .cta-band__inner .button {
    width: 100%;
  }
}

@media (width <= 360px) {
  .shell {
    width: min(calc(100% - 24px), var(--shell));
  }

  .site-brand__wordmark strong {
    font-size: .8rem;
  }

  .site-brand__wordmark small {
    font-size: .39rem;
    letter-spacing: .14em;
  }

  .hero-copy h1,
  .inner-hero h1 {
    font-size: 2.25rem;
  }

  .eyebrow {
    letter-spacing: .12em;
  }

  .button {
    padding-inline: 16px;
    font-size: .78rem;
  }

  .simulator-card {
    padding-inline: 14px;
  }

  .simulator-goals button {
    font-size: .62rem;
  }

  .simulator-value strong {
    font-size: 1.2rem;
  }

  .floating-whatsapp {
    width: 52px;
    height: 52px;
    min-height: 52px;
  }

  .floating-whatsapp span {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-whatsapp,
  .site-nav {
    transition: none;
  }
}
