/* Este arquivo contém os estilos principais do tema. */

/* Variáveis CSS */
:root {
  /* Tipografia */
  --font-primary: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Cores */
  --color-text: #292929;
  --color-accent: #ffff00;
  --color-background: #e7e4de;

  /* Transições */
  --transition-default: all 0.3s ease;
}

html {
  margin-top: 0 !important;
  scroll-behavior: smooth;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Controla a velocidade do scroll */
  scroll-behavior: smooth;
}

/* Aplica timing mais lento quando clica no botão */
html.is-scrolling-top {
  scroll-behavior: smooth;
}

@media screen and (prefers-reduced-motion: no-preference) {
  html.is-scrolling-top {
    scroll-behavior: smooth;
  }
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-background);
  color: var(--color-text);
  margin: 0;
  padding: 0;
  font-weight: 400;
  overflow-x: hidden;
}

body.admin-bar {
  padding-top: 0 !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-text);
  font-weight: 700;
}

a {
  color: var(--color-text);
  text-decoration: none;
  transition: var(--transition-default);
}

a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.container {
  width: 90%;
  margin: 0 auto;
  padding: 0 20px;
}

.header {
  background-color: #2c3e50;
  color: white;
  padding: 10px 0;
  text-align: center;
}

.footer {
  background-color: #2c3e50;
  color: white;
  padding: 10px 0;
  text-align: center;
}

/* Variações de peso da fonte */
.font-thin {
  font-weight: 200;
}

.font-light {
  font-weight: 300;
}

.font-regular {
  font-weight: 400;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.font-extrabold {
  font-weight: 800;
}

/* Classe utilitária para destacar textos */
.text-highlight {
  color: var(--color-accent);
}

.text-light {
  color: var(--color-background);
}

/* Seção CAPA */
.home-cover {
  position: relative;
  width: 100dvw;
  height: 200dvh;
}

.home-cover__container {
  position: fixed;
  /* Alterado de sticky para fixed */
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  will-change: transform;
  /* Otimização de performance */
}

.home-cover__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: translate3d(0, 0, 0);
  will-change: clip-path;
  backface-visibility: hidden;
  transition: clip-path 0.25s ease;
}

/* Classe adicionada quando passar do limite do scroll */
.home-cover__container--scrolled {
  position: absolute;
  bottom: 0;
  top: auto;
}

.home-name {
  position: absolute;
  top: 0;
  left: 0;
  width: 100dvw;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-name__title {
  color: var(--color-accent);
  text-align: center;
  font-size: min(max(64px, 18vw), 345px);
  line-height: 0.9;
  font-weight: 800;
  margin: 0;
  opacity: 1;
  transition: opacity 1000ms ease;
}

.home-name__title.is-hidden {
  opacity: 0;
}

.home-name__title.is-fading {
  opacity: 1;
}

#works {
  margin-top: 60px;
}

.home-works__container {
  border-top: 4px solid #000;
  border-bottom: 4px solid #000;
  background-color: var(--color-background);
  padding: 0;
  position: relative;
  z-index: 10;
}

.home-works__type-title {
  position: relative;
  transform: translateY(165px);
  /* posição inicial */
  z-index: 1;
  font-size: min(max(42px, 13vw), 175px);
  text-transform: uppercase;
  line-height: 1;
  margin: 0;
  will-change: transform;
  /* otimiza a performance da animação */
}

.home-works__list__wrapper {
  max-height: min(max(160px, 22.7vw), 379px);
  min-height: 385px;
  overflow: auto;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge */
}

/* Webkit (Chrome, Safari, etc) */
.home-works__list__wrapper::-webkit-scrollbar {
  display: none;
}

.home-works__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.home-works__item {
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.home-works__item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.home-works__image {
  height: 0;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
  width: 0;
}

.home-works__title {
  margin: 0;
  font-size: min(max(24px, 2.5vw), 42px);
  line-height: 1.2;
  text-transform: uppercase;
}

.home-works__type+.home-works__type {
  margin-top: 80px;
}

.home-works__image-container {
  position: absolute;
  top: 0;
  right: 0;
  width: min(max(350px, 29vw), 500px);
  height: 100%;
  pointer-events: none;
  z-index: 1;
  padding: 8px 0;
}

.home-works__image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#about {
  background-color: var(--color-text);
  color: var(--color-background);
  font-weight: 600;
  font-size: min(max(20px, 2.2vw), 36px);
  text-align: justify;
  line-height: 1.2;
  margin-top: min(max(80px, 11vw), 120px);
  padding: min(max(80px, 11vw), 120px) 0;
}

#about p:last-child {
  margin-bottom: 0;
}

#about p a {
  color: var(--color-accent);
}

#about p a:hover,
#about p a:focus {
  text-decoration: underline;
}

#about .entry-content {
  padding: 15px 0;
  border-top: 4px solid;
  border-bottom: 4px solid;
}

.home-about__header h2,
.home-about__header a {
  color: var(--color-background);
}

.home-about__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.home-about__title {
  margin: 0;
  font-size: min(max(24px, 2.2vw), 36px);
  font-weight: 500;
}

.home-about__download {
  font-size: min(max(18px, 2.2vw), 24px);
  font-weight: 400;
  text-decoration: underline;
}

/* Menu da home */
.home-nav {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;

  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

body:not(.home) .home-nav {
  display: none !important;
}

.home-nav.is-visible {
  opacity: 1;
  visibility: visible;
}

.home-nav.is-hidden {
  transform: translate(-50%, -20px);
  opacity: 0;
  visibility: hidden;
}

.home-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 40px;
}

.home-nav__link {
  color: var(--color-text);
  font-size: min(max(16px, 1.5vw), 24px);
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 700;
  transition: color 0.3s ease;
}

.home-nav__link:hover,
.home-nav__link:focus,
.home-nav__link:active {
  color: var(--color-accent);
  text-decoration: none;
}

/* Estado do menu quando #cover está visível */
.home-nav--over-cover .home-nav__link {
  color: var(--color-background);
}

/* Estado do menu quando sobre #about */
.home-nav--over-about .home-nav__link {
  color: var(--color-background);
}

.home-nav--search {
  position: absolute;
  right: 30px;
}

/* Efeito de entrada fadeInUp */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Efeito fade-in */
.fade-in {
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: opacity;
}

.fade-in.is-visible {
  opacity: 1;
}

#work-section-1 {
  padding: 40px 0 80px;
}

#work-section-2 {
  padding: 80px 0;
  background-color: #FFF;
}

#work-section-2 .entry-content {
  column-count: 2;
  font-size: min(max(18px, 1.5vw), 24px);
}

#work-section-1 .entry-title {
  font-size: min(max(26px, 2.5vw), 42px);
  line-height: 1.2;
  padding-bottom: 10px;
  border-bottom: 3px solid #000;
  margin-bottom: 20px;
}

/* Imagem de capa da obra */
.work-cover__container {
  margin: 40px 0 0;
  display: flex;
}

.work-cover {
  width: 100%;
  height: auto;
}

/* Ficha Técnica */
.work-info {
  margin-top: 60px;
}

.work-info:first-of-type {
  margin-top: 0;
}

.work-info__title {
  font-size: min(max(22px, 2vw), 32px);
  margin-bottom: 30px;
}

.work-info__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.work-info__item {
  display: flex;
  gap: 20px;
  margin: 0;
  font-size: min(max(16px, 1.5vw), 24px);
  justify-content: space-between;
  flex-wrap: nowrap;
  border-top: 2px solid #000;
  padding: 3px 0;
}

.work-info__label {
  flex: 0 0 50%;
  font-weight: 600;
  line-height: 1.2;
}

.work-info__content {
  flex: 1;
  text-align: right;
  line-height: 1.2;
  white-space: preserve-breaks;
}

/* Galeria */
.work-gallery {
  margin-top: 60px;
}

.work-gallery__title {
  font-size: min(max(24px, 2vw), 32px);
  margin-bottom: 30px;
}

.work-gallery__list {
  display: grid;
  gap: 40px;
}

.work-gallery__item img {
  width: 100%;
  height: auto;
}

#inner-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background-color: var(--color-background);
  position: sticky;
  top: 0;
  font-size: min(max(18px, 2vw), 24px);
  font-weight: bold;
  z-index: 150;
}

/* Transição de página */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  background-color: var(--color-text);
  z-index: 9999;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition.is-active {
  height: 100%;
}

/* Previne scroll durante transição */
body.is-transitioning {
  overflow: hidden;
}

#work-section-2 .entry-content p:last-child {
  margin-bottom: 0;
}

/* === Início: Estilos da Busca === */
.search-wrapper {
  position: relative;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 18px;
}

.search-open {
  position: absolute;
  left: 8px;
  transform: translateY(-50%);
  top: 50%;
}

.search-field button.search-close {
  display: none;
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  top: 50%;
}

.search-input {
  width: 200px;
  padding: 5px 12px 5px 30px;
  border: 1px solid;
  border-radius: 11px;
  background: transparent;
  font-family: var(--font-primary);
  font-size: 14px;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  background: white;
}

/* Estado ativo - com resultados */
.search-wrapper.has-results .search-input {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid var(--color-text);
  border-top: 0;
  border-bottom-left-radius: 11px;
  border-bottom-right-radius: 11px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  /* Esconde completamente quando inativo */
}

.search-results.is-active {
  max-height: 300px;
  opacity: 1;
  visibility: visible;
}

.search-result-item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-text);
  transition: background 0.3s ease;
  font-size: 14px;
  line-height: 1.3;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item a {
  color: var(--color-text);
  text-decoration: none;
  display: block;
}

.search-result-item:hover {
  background: #ffff001f;
}

.search-no-results {
  color: var(--color-text);
}

.home-nav--over-cover .search-input {
  color: var(--color-background);
  border-color: var(--color-background);
}

.home-nav--over-cover .search-field svg {
  border-color: var(--color-background);
  fill: var(--color-background);
}

.home-nav--over-cover .search-input:focus {
  color: var(--color-text);
  border-color: var(--color-text);
}

.home-nav--over-cover .search-input:focus+svg {
  fill: var(--color-text);
}

.home-nav--over-about .search-input {
  color: var(--color-background);
}

.home-nav--over-about .search-field svg {
  fill: var(--color-background);
}

.home-nav--over-about .search-input:focus {
  color: var(--color-text);
  border-color: var(--color-text);
}

.home-nav--over-about .search-input:focus+svg {
  fill: var(--color-text);
}

.search-wrapper.has-focus .search-input {
  background: white;
  color: var(--color-text);
  border-color: var(--color-text);
}

.search-wrapper.has-focus .search-field svg {
  fill: var(--color-text);
}

/* === Fim: Estilos da Busca === */

.main-footer {
  padding-top: 350px;
  padding-bottom: 40px;
}

.main-footer button,
.main-footer a {
  font-family: inherit;
  font-size: inherit;
  background-color: transparent;
  border: none;
  cursor: pointer;
}

.main-footer .container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.main-footer--col {
  display: flex;
}

.main-footer--col.col2 {
  justify-content: center;
}

.main-footer--col.col3 {
  justify-content: flex-end;
}

.main-footer--go-to-top button {
  display: flex;
}

.main-footer--go-to-top svg {
  width: 19px;
  height: 25px;
}

@media(max-width: 992px) {
  .search-input {
    width: 0;
    padding-right: 3px;
    transition: all 0.3s ease;
  }

  .search-close {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .home-nav--search {
    position: absolute;
    right: 20px;
    transition: all 0.3s ease;
  }

  .home-nav__list {
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  /* Estado expandido */
  .search-wrapper.is-expanded .search-input {
    width: 250px;
    padding-right: 30px;
  }

  .search-wrapper.is-expanded .search-close {
    opacity: 1;
    visibility: visible;
    display: flex;
  }

  .home-nav--search.is-centered {
    right: 50%;
    transform: translateX(50%);
  }
}

@media(max-width: 768px) {
  .home-nav__list {
    gap: 20px;
    align-items: center;
    justify-content: center;
  }

  .home-nav.is-visible:not(.home-nav--over-cover) {
    background-color: var(--color-background);
  }

  .home-works__image-container {
    display: none;
  }

  .home-nav {
    top: 0;
    width: 100dvw;
    left: 0;
    transform: initial;
    text-align: center;
    padding: 13px 20px;
  }

  .home-nav.is-visible:not(.home-nav--over-cover).home-nav--over-about {
    background-color: var(--color-text);
  }

  #work-section-2 .entry-content {
    column-count: 1;
  }

  #work-section-1 {
    padding: 40px 0;
  }

  .work-cover__container {
    margin: 30px 0 0;
  }

  #work-section-2 {
    padding: 50px 0;
  }

  .work-gallery__list {
    gap: 25px;
  }

  .work-info__title {
    margin-bottom: 20px;
  }

  .main-footer {
    padding-top: 150px;
    padding-bottom: 20px;
  }
}

@media(max-width: 580px) {
  .container {
    padding: 0;
  }

  #about {
    line-height: 1.3;
  }

  .home-nav {
    justify-content: left;
  }
}