/*
Theme Name: Midia Arena Theme
Description: Tema sob medida da Mídia Arena, construído sobre Bootstrap 5.
Author: Mídia Arena
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 7.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: midia-arena-theme
*/

/* ==========================================================================
   Fontes locais
   ========================================================================== */

@font-face {
  font-family: 'Marines';
  src: url('assets/font/MARINES.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   Bootstrap bridge
   Instead of fighting Bootstrap's Reboot, we feed the brand palette into its
   CSS variables so every Bootstrap component/utility inherits the dark theme.
   ========================================================================== */

:root,
[data-bs-theme='dark'] {
  --bs-body-bg: #000000;
  --bs-body-color: #ddece4;
  --bs-body-color-rgb: 221, 236, 228;
  --bs-body-font-family: 'Inter', Arial, sans-serif;
  --bs-body-font-weight: 300;
  --bs-emphasis-color: #ffffff;
  --bs-heading-color: #ffffff;

  --bs-primary: #00e676;
  --bs-primary-rgb: 0, 230, 118;
  --bs-primary-text-emphasis: #52d087;

  --bs-link-color: #00e676;
  --bs-link-color-rgb: 0, 230, 118;
  --bs-link-hover-color: #52d087;
  --bs-link-hover-color-rgb: 82, 208, 135;

  --bs-border-color: rgba(255, 255, 255, 0.12);
  --bs-border-radius: 0.75rem;
  --bs-border-radius-lg: 1.5rem;

  /* Brand tokens used by the custom sections below. */
  --ma-accent: #00e676;
  --ma-accent-soft: #52d087;
  --ma-navbar-height: 4.5rem;
  /* Fonte de display, usada nos títulos de impacto e na faixa de palavras. */
  --ma-display-font-family: 'Marines', var(--bs-body-font-family);
}

/* ==========================================================================
   Base
   ========================================================================== */

html,
body {
  display: grid;
  overflow-x: hidden;
  /*
   * An `auto` grid track grows to its item's min-content width, so the
   * nowrap rotating words used to stretch the page past the viewport and
   * throw everything (navbar included) off-centre on narrow screens.
   * Capping the track at the available width keeps the layout centred.
   */
  grid-template-columns: minmax(0, 1fr);
}

html {
  height: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html,
  /* O body é o container de scroll (overflow-y: auto), então precisa da regra. */
  body {
    scroll-behavior: smooth;
  }
}

/*
 * Alvos dos links da navbar. O header é absoluto e sobrepõe o conteúdo, logo o
 * scroll precisa parar antes do topo da seção para ela não ficar por baixo.
 */
#bem-vindo,
#solucoes {
  scroll-margin-top: var(--ma-navbar-height);
}

body {
  background: var(--bs-body-bg);
  margin: 0;
  position: relative;
  min-height: 100vh;
  font-family: var(--bs-body-font-family);
  color: var(--bs-body-color);
  overflow-x: hidden;
  overflow-y: auto;
}

/* Accent helper that follows Bootstrap's utility naming. */
.text-accent {
  color: var(--ma-accent) !important;
}

/* ==========================================================================
   Navbar
   Links live on both edges of the bar; the logo is absolutely centred so it
   sits at the true middle regardless of how wide each side's menu is.
   ========================================================================== */

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
}

.site-navbar {
  --bs-navbar-padding-y: 0.5rem;
  --bs-navbar-color: rgba(255, 255, 255, 0.78);
  --bs-navbar-hover-color: var(--ma-accent);
  --bs-navbar-active-color: var(--ma-accent);
  --bs-navbar-toggler-border-color: transparent;
  --bs-navbar-toggler-focus-width: 0.15rem;
  min-height: var(--ma-navbar-height);
  background-color: transparent;
}

.site-navbar-toggler {
  padding-left: 0;
  padding-right: 0;
}

.site-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 0;
  margin: 0;
  z-index: 2;
}

.site-logo {
  display: block;
  width: auto;
  height: 2.1rem;
  max-height: 2.1rem;
  object-fit: contain;
}

.site-nav .nav-link {
  position: relative;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  padding-inline: 0.9rem;
  transition: color 0.2s ease;
}

.site-nav .nav-link::after {
  content: '';
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.3rem;
  height: 1px;
  background-color: var(--ma-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

/* Sem sublinhado no hover: a cor de destaque já sinaliza a interação. */
.site-nav .nav-link.active::after,
.site-nav .current-menu-item > .nav-link::after {
  transform: scaleX(1);
}

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

/* Desktop: menus pushed to the edges, logo floating in the middle. */
@media (min-width: 992px) {
  .site-navbar-collapse {
    justify-content: space-between;
    gap: 11rem;
  }

  .site-nav--left,
  .site-nav--right {
    flex: 1 1 0;
    justify-content: space-evenly;
  }

  .site-logo {
    height: 2.5rem;
    max-height: 2.5rem;
  }
}

/* Mobile: toggler on the left, logo centred, menus stacked underneath. */
@media (max-width: 991.98px) {
  .site-navbar-collapse {
    padding-block: 0.75rem 1.25rem;
    text-align: center;
  }

  .site-nav--right {
    margin-top: 0;
    padding-top: 0;
  }

  .site-nav .nav-link {
    padding-block: 0.6rem;
  }

  .site-nav .nav-link::after {
    left: 50%;
    right: auto;
    width: 2rem;
    margin-left: -1rem;
    bottom: 0.35rem;
    transform-origin: center center;
  }
}

/* Mobile: o botão do menu acompanha o scroll, ancorado no canto direito. */
@media (max-width: 991.98px) {
  .site-navbar-toggler {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1040;
    background-color: rgba(0, 0, 0, 0.55);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
  }

  /* O painel aberto segue o botão, senão ficaria no topo da página. */
  .site-navbar-collapse.show,
  .site-navbar-collapse.collapsing {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1039;
    background-color: rgba(0, 0, 0, 0.92);
    padding-inline: 1.5rem;
    /* Espaço no topo para o painel passar por baixo do botão do menu. */
    padding-block: 4rem 1.5rem;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.scene,
.a3d {
  display: grid;
}

.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 1.5rem;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

/*
 * The title is the landing page's first block: it sits between the navbar and
 * the carousel, so it needs its own grid cell instead of riding along with
 * .hero-copy (which is pulled up over the carousel).
 */
.hero-title {
  max-width: 42rem;
  padding: 0 1.5rem;
  position: absolute;
  top:6rem;
  z-index: 2;
}

.hero-copy {
  max-width: 55rem;
  text-align: center;
  display: grid;
  gap: 1rem;
  padding: 0 1.5rem 2rem;
  margin-top: -22rem;
  position: relative;
  z-index: 5;
}

.hero-title h1,
.hero-copy h1 {
  margin: 0;
  font-family: var(--bs-body-font-family);
  font-weight: 700;
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: inherit;
}

.hero-title h1 {
  font-family: var(--ma-display-font-family);
  letter-spacing: 0.01em;
  font-weight: 100;
}

.hero-title .accent,
.hero-copy .accent {
  color: var(--ma-accent);
}

.rotating-words {
  display: inline-block;
  position: relative;
  vertical-align: baseline;
  margin-left: 0.01em;
  line-height: 1;
  height: 0.93em;
}

.rotating-words .words {
  display: inline-block;
  position: relative;
  min-width: 11.4rem;
  height: 0.93em;
  vertical-align: baseline;
  margin-bottom: .18rem;
}

.rotating-words .word-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: max-content;
  height: 1.15em;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.rotating-words .word {
  display: inline-block;
  line-height: 1;
  transform: translateY(0);
  will-change: transform, opacity;
}

.hero-copy p {
  margin: 0;
  font-family: var(--bs-body-font-family);
  font-weight: 300;
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  line-height: 1.7;
  max-width: 38rem;
  margin-inline: auto;
}

.hero-copy--text {
  margin-top: 0.7rem;
}

.hero-copy--text p + p {
  margin-top: 1.1rem;
}

/* CTA do hero: leva para a seção de soluções. */
.hero-cta {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  padding: 0.85rem 1.75rem;
  --ma-cta-chanfro: 0.3rem;
  border-radius: 0;
  clip-path: polygon(
    var(--ma-cta-chanfro) 0,
    calc(100% - var(--ma-cta-chanfro)) 0,
    100% var(--ma-cta-chanfro),
    100% calc(100% - var(--ma-cta-chanfro)),
    calc(100% - var(--ma-cta-chanfro)) 100%,
    var(--ma-cta-chanfro) 100%,
    0 calc(100% - var(--ma-cta-chanfro)),
    0 var(--ma-cta-chanfro)
  );
  background-color: var(--ma-accent);
  color: #000000;
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.hero-cta:hover,
.hero-cta:focus-visible {
  background-color: var(--ma-accent-soft);
  color: #000000;
}

.hero-cta__arrow {
  transition: transform 0.2s ease;
}

.hero-cta:hover .hero-cta__arrow,
.hero-cta:focus-visible .hero-cta__arrow {
  transform: translateX(0.25rem);
}

@media (prefers-reduced-motion: reduce) {
  .hero-cta,
  .hero-cta__arrow {
    transition: none;
  }

  .hero-cta:hover .hero-cta__arrow,
  .hero-cta:focus-visible .hero-cta__arrow {
    transform: none;
  }
}

@media (max-width: 700px) {
  .hero-title h1,
  .hero-copy h1 {
    font-size: clamp(1.25rem, 5.8vw, 1.75rem);
  }

  .rotating-words .words {
    min-width: 3.5em;
  }
}

/* ==========================================================================
   3D carousel
   Note: the image class is namespaced (.ma-card) on purpose — `.card` is a
   Bootstrap component and would inject borders/background onto these images.
   ========================================================================== */

.scene {
  width: 100%;
  margin-top: 3rem;
  max-width: 100%;
  overflow: hidden;
  perspective: 35em;
  perspective-origin: center center;
  height: 90vh;
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  mask: linear-gradient(90deg, #0000, #000 20% 80%, #0000);
  z-index: 4;
}

.a3d {
  place-self: center;
  transform-style: preserve-3d;
  transform-origin: center center;
  will-change: transform;
  width: 100%;
  justify-items: center;
  position: relative;
  z-index: 1;
}

.ma-card {
  --w: 17.5em;
  --ba: calc(1turn / var(--n));
  grid-area: 1 / 1;
  width: var(--w);
  aspect-ratio: 7 / 10;
  object-fit: cover;
  border-radius: 1.5em;
  backface-visibility: hidden;
  transform: rotateY(calc(var(--i) * var(--ba)))
             translateZ(calc(-1 * (0.5 * var(--w) + 0.5em) / tan(0.5 * var(--ba))));
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

/*
 * Telas baixas e deitadas (desktop 1280x720, notebooks 1366x768 e celular na
 * horizontal): o hero de tela cheia não cabe, então a sobreposição usada nas
 * telas altas (título absoluto + .hero-copy puxada para cima do carrossel) dá
 * lugar a um empilhamento natural: título -> carrossel -> texto com botão.
 * O conteúdo pode passar da primeira dobra e ser alcançado no scroll.
 *
 * A condição combina altura e proporção para não atingir o desktop 1920x1080
 * (viewport acima de 800px de altura) nem o celular na vertical (proporção
 * menor que 1).
 *
 * O `body` volta a ser block aqui porque, como grid, o Chrome dimensiona a
 * linha do hero pela sua min-height e ignora a altura do conteúdo empilhado —
 * o hero ficaria com a altura só do padding e a seção seguinte subiria por
 * cima dele.
 */
@media (min-aspect-ratio: 1 / 1) and (max-height: 800px) {
  body {
    display: block;
  }

  .hero {
    min-height: 0;
    align-items: start;
    justify-items: center;
    gap: 0;
    padding-top: calc(var(--ma-navbar-height) + 2.5rem);
    padding-bottom: 3rem;
  }

  .hero-title {
    position: static;
    top: auto;
    margin-top: 0 !important;
  }

  .scene {
    height: 22rem;
    margin-top: 0.5rem;
    perspective: 60em;
    mask-image:
      linear-gradient(90deg, #0000, #000 28% 72%, #0000),
      linear-gradient(180deg, #0000, #000 12% 88%, #0000);
    mask-composite: intersect;
    -webkit-mask-composite: source-in;
  }

  .hero-copy {
    margin-top: 0;
    padding-bottom: 0;
  }

  .ma-card {
    --w: 12em;
  }
}

/* Celular na horizontal: carrossel menor para caber junto com o título. */
@media (min-aspect-ratio: 1 / 1) and (max-height: 520px) {
  .hero {
    padding-top: calc(var(--ma-navbar-height) + 1rem);
  }

  .scene {
    height: 17rem;
    margin-top: 0.25rem;
  }

  .ma-card {
    --w: 9.5em;
  }
}

.bem-vindo {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  position: relative;
}

.bem-vindo__content,
.bem-vindo__maraca {
  grid-area: 1 / 1;
  min-width: 0;
}

.bem-vindo__content {
  z-index: 2;
  padding: 2rem 1rem;
}

.bem-vindo__maraca {
  z-index: 1;
  overflow: clip;
}

.bem-vindo__maraca img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.bem-vindo__title img {
  width: 100%;
  max-width: 900px;
  height: auto;
}

.bem-vindo__text {
  max-width: 38rem;
}

@media (max-width: 991.98px) {
  .bem-vindo__maraca {
    grid-area: 2 / 1;
  }

  .bem-vindo__content {
    grid-area: 1 / 1;
  }

  .bem-vindo__maraca img {
    width: 200%;
    margin-left: -50%;
  }
}

.faixa-palavras {
  width: 100%;
  overflow: clip;
  z-index: 3;
}

.faixa-palavras__track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: faixa-palavras-direita 90s linear infinite;
}

.faixa-palavras__conjunto {
  flex: 0 0 auto;
}

.faixa-palavras__conjunto--item {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 0 0 auto;
  white-space: nowrap;
  font-family: var(--ma-display-font-family);
  font-weight: 100;
  font-size: clamp(3rem, 4.2vw, 4.25rem);
  padding: 0 0.5rem;
  letter-spacing: 0.01em;
}

.faixa-palavras__conjunto--item img {
  display: block;
  height: 0.55em;
  width: auto;
  flex: 0 0 auto;
}

@keyframes faixa-palavras-direita {
  from {
    transform: translateX(-50%);
  }

  to {
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .faixa-palavras__track {
    animation: none;
  }
}

.content-width {
  width: 90rem;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 0% 2rem;
}

/*
 * Círculo radial decorativo ao lado do título de "Nossas Soluções".
 * Fica em um pseudo-elemento absoluto (fora do fluxo) para não deslocar nada.
 * O SVG já vem cortado: o centro do círculo está 10% da largura à esquerda da
 * borda do arquivo, então o deslocamento extra coloca esse centro exatamente na
 * borda esquerda da viewport, deixando visível só a metade direita.
 */
.solucoes .titulo {
  position: relative;
}

.solucoes .titulo::before {
  --ma-radial-width: min(34rem, 60vw);
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--ma-radial-width);
  aspect-ratio: 575 / 1265;
  margin-left: calc(-50vw - (var(--ma-radial-width) * 0.1));
  transform: translateY(-50%);
  background: url('assets/radial-solucoes.svg') no-repeat left center / contain;
  pointer-events: none;
  z-index: -1;
}

@media (max-width: 991.98px) {
  .solucoes .titulo::before {
    --ma-radial-width: min(20rem, 70vw);
  }
}

.titulo--subtitulo {
  font-family: var(--bs-body-font-family);
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--bs-primary);
}

.section-margin {
  margin-top: 16rem;
}

@media (max-width: 991.98px) {
  .section-margin {
    margin-top: 6rem;
  }
}

.titulo--principal {
  font-family: var(--ma-display-font-family);
  font-weight: 100;
  font-size: clamp(3rem, 4.2vw, 4.25rem);
  line-height: 1.05;
}

.titulo--texto-auxiliar {
  max-width: 100%;
}

@media (min-width: 992px) {
  .titulo--texto-auxiliar {
    max-width: 15rem;
  }
}

.solucoes-cards__card {
  width: 100%;
}

@media (max-width: 991.98px) {
  .solucoes-cards {
    row-gap: 3rem;
  }
}

.solucoes-cards__card__title {
  font-family: var(--bs-body-font-family);
  font-weight: 400;
  font-size: clamp(1.15rem, 2.5vw, 1.65rem);  line-height: 1.05;
  color: var(--bs-primary);
}

.solucoes-cards__card__cta {
  font-family: var(--bs-body-font-family);
  font-weight: 400;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--bs-primary);
}
.site-footer {
  background-color: #090c0c;
  margin-top: 16rem;
}

.site-footer__logo-img {
  width: 240px;
  height: auto;
}

.site-footer__menu {
  gap: 0.5rem 2rem;
  margin-bottom: 0;
}

.site-footer__nav .nav-link {
  padding: 0;
}

.site-footer__social-icon {
  width: 24px;
  height: 24px;
}

.site-footer__copy {
  color: #7a867f;
}
