/* =========================================
   RICARDO VIANA | STYLE.CSS
   Tema: clean (branco/cinza)
   Responsivo: Desktop / Tablet / Mobile
========================================= */

/* ==================================================
   RESET / BASE
================================================== */
*{ margin:0; padding:0; box-sizing:border-box; }

:root{
  --bg: #ffffff;              /* fundo geral */
  --bg-alt: #f6f7f9;          /* fundo alternativo (seções) */
  --text: #111827;            /* texto principal */
  --muted: #6b7280;           /* texto secundário */
  --line: rgba(17,24,39,.10); /* linhas/bordas */
  --shadow: 0 14px 40px rgba(17,24,39,.10);

  --radius: 16px;

  --container: 1120px;        /* largura máxima */
  --nav-h: 76px;              /* altura base da navbar */
}

html{ scroll-behavior:smooth; }

/* ==================================================
   TRAVA ANTI-SCROLL HORIZONTAL (GLOBAL)
   - evita qualquer overflow lateral no mobile/tablet
================================================== */
html, body{
  max-width: 100%;
  overflow-x: hidden;
}

body{
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;

  /* nav fixa */
  padding-top: var(--nav-h);
}

/* ==================================================
   UTILITÁRIOS
================================================== */
.container{
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
  max-width: 100%;
}

a{ color: inherit; text-decoration: none; }
img{ max-width:100%; display:block; }

.muted{ color: var(--muted); }
.tiny{ font-size: .85rem; }

/* ==================================================
   BOTÕES
================================================== */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.6rem;

  padding:.9rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;

  background: var(--text);
  color: #fff;
  font-weight: 400;

  cursor: pointer;
  transition: 
    transform .15s ease,
    opacity .15s ease,
    background .2s ease,
    color .2s ease,
    border-color .2s ease;

  /* anti-estouro no mobile */
  max-width: 100%;
  white-space: normal;
}

.btn:hover{ transform: translateY(-1px); opacity:.95; }
.btn:active{ transform: translateY(0); }

.btn--ghost{
  background: transparent;
  color: var(--bg-alt);
  border: 3px solid var(--text);
}

.btn--ghost:hover{
  background: var(--text);
  color: #fff;
  border-color: var(--text);
  opacity: 1;
}

/* ==================================================
   NAVBAR (Header fixo)
================================================== */
.header{
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 999;

  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);

  border-bottom: 1px solid var(--line);

  /* anti-scroll lateral */
  max-width: 100%;
  overflow-x: hidden;
}

/* mexe no <nav class="nav container"> */
.nav{
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;

  /* anti-scroll lateral */
  max-width: 100%;
  overflow-x: hidden;
}

/* evita grid estourar por conteúdo (muito comum) */
.brand,
.nav__links,
.nav__whats{
  min-width: 0;
}

/* mexe no nome "Ricardo Viana" */
.brand{
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 1.05rem;
  justify-self: start;
}

/* links do meio */
.nav__links{
  list-style: none;
  display: flex;
  gap: 1.1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.nav__link{
  font-weight: 600;
  color: var(--muted);
  padding: .55rem .7rem;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}

.nav__link:hover{
  color: var(--text);
  background: rgba(17,24,39,.05);
}

/* WhatsApp da direita */
.nav__whats{
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: .55rem;

  padding: .55rem .85rem;
  border-radius: 999px;

  border: 1px solid var(--line);
  background: #fff;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;

  max-width: 100%;
}

.nav__whats:hover{
  transform: translateY(-1px);
  background: rgba(17,24,39,.03);
  border-color: rgba(17,24,39,.18);
}

.icon{ display:block; fill: currentColor; }
.nav__whatsText{
  font-weight: 700;
  font-size: .95rem;
}

/* ==================================================
   HERO (Home)
================================================== */
.hero{
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  overflow: hidden;

  width: 100%;
  max-width: 100%;
}

/* fundo da hero */
.hero__bg{
  position: absolute;
  inset: 0;
  background-image: url("./img/hero.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #e5e7eb;

  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.hero__bg--top{
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

/* overlay */
.hero::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.55),
    rgba(0,0,0,.28),
    rgba(0,0,0,.55)
  );
}

.hero__content{
  position: relative;
  z-index: 1;
  color: #fff;
  max-width: 780px;
  text-align: left;
  padding: 2.2rem 0;

  min-width: 0;
}

.hero__content,
.hero__content *{
  text-shadow:
    0 2px 10px rgba(0,0,0,.60),
    0 6px 24px rgba(0,0,0,.35);
}

.hero__tag{
  display:inline-block;
  font-size: .95rem;
  color: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.25);
  padding: .35rem .7rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  background: rgba(255,255,255,.08);
}

.hero__title{
  margin-top: 1rem;
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -.02em;
}

.hero__subtitle{
  margin-top: .8rem;
  font-size: 1.05rem;
  color: rgba(255,255,255,.88);
  max-width: 60ch;
}

.hero__cta{
  margin-top: 1.4rem;
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  max-width: 100%;
}

/* ==================================================
   SEÇÕES (Sobre / Portfólio / Contato)
================================================== */
.section{
  padding: 4.5rem 0;
  max-width: 100%;
  overflow-x: hidden;
}

.section--alt{
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section h2{
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.section__grid{
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 2rem;
  align-items: start;
  margin-top: 1rem;
  max-width: 100%;
}

.section__grid > *{ min-width: 0; }

/* lista do sobre */
.bullets{
  margin-top: 1rem;
  padding-left: 1.1rem;
  color: var(--muted);
}
.bullets li{ margin: .35rem 0; }

/* card */
.card{
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem;

  max-width: 100%;
}

.card h3{ font-size: 1.1rem; }
.card p{ color: var(--muted); margin-top: .45rem; }

.card__miniGrid{
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: .9rem;
}

.mini{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .9rem;
  background: rgba(17,24,39,.02);
  max-width: 100%;
}
.mini strong{ display:block; font-size:.95rem; }
.mini span{ color: var(--muted); font-size:.9rem; }

/* ==================================================
   PORTFÓLIO
================================================== */
.section__head{
  display: grid;
  gap: .35rem;
  margin-bottom: 1.5rem;
  max-width: 100%;
}

.gallery{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1.1rem;
  max-width: 100%;
}

.gallery > *{ min-width: 0; }

.work{
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(17,24,39,.06);
  transition: transform .15s ease, box-shadow .15s ease;
  max-width: 100%;
}

.work:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(17,24,39,.10);
}

.work__media{
  height: 180px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #e5e7eb;
  max-width: 100%;
}

/* imagens */
.media-cozinha{ background-image: url("./img/cozinha2-portfolio.webp"); }
.media-dormitorio{ background-image: url("./img/dormitorio-portfolio.webp"); }
.media-sala{ background-image: url("./img/sala-portfolio.webp"); }
.media-projeto{ background-image: url("./img/projeto-portfolio.webp"); }
.media-escritorio{ background-image: url("./img/home-office-portfolio.webp"); }
.media-comercial{ background-image: url("./img/home-office2-portfolio.webp"); }

.work__info{
  padding: 1rem 1rem 1.2rem;
}

.work__info h3{
  font-size: 1.05rem;
  line-height: 1.2;
}

.work__info p{
  margin-top: .35rem;
  color: var(--muted);
}

/* ==================================================
   CONTATO
================================================== */
.contact{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-top: 1rem;
  max-width: 100%;
}

.contact > *{ min-width: 0; }

.contact__cards{
  margin-top: 1.2rem;
  display: grid;
  gap: .8rem;
}

.contact__card{
  display: grid;
  gap: .15rem;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
  max-width: 100%;
}

.contact__card:hover{
  transform: translateY(-1px);
  border-color: rgba(17,24,39,.18);
  background: rgba(17,24,39,.02);
}

/* form */
.form{
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem;
  max-width: 100%;
}

.form h3{ font-size: 1.15rem; }

.field{
  display: grid;
  gap: .35rem;
  margin-top: .9rem;
}

.field span{
  font-weight: 700;
  font-size: .92rem;
}

.field input,
.field textarea{
  width: 100%;
  padding: .85rem .95rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  outline: none;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
  font: inherit;
}

.field input:focus,
.field textarea:focus{
  border-color: rgba(17,24,39,.25);
  box-shadow: 0 0 0 4px rgba(17,24,39,.06);
}

.form .btn{
  margin-top: 1rem;
  width: 100%;
}

/* ==================================================
   FOOTER
================================================== */
.footer{
  border-top: 1px solid var(--line);
  padding: 1.6rem 0;
  background: #fff;

  max-width: 100%;
  overflow-x: hidden;
}

.footer__inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;

  max-width: 100%;
}

.footer-link{
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover{
  text-decoration: underline;
}

/* ==================================================
   LIGHTBOX
================================================== */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  place-items: center;
  background: rgba(0,0,0,.75);
  padding: 2rem 1rem;

  /* evita overflow lateral em alguns browsers */
  max-width: 100vw;
  overflow-x: hidden;
}

.lightbox.is-open{ display: grid; }

.lightbox__content{
  max-width: min(1000px, 92vw);
  max-height: 82vh;
  margin: 0;
  position: relative;
}

.lightbox__img{
  width: 100%;
  height: auto;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  background: #111;
  display: block;
}

.lightbox__caption{
  margin-top: .75rem;
  text-align: center;
  color: rgba(255,255,255,.85);
  font-size: .95rem;
}

.lightbox__close{
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}

.lightbox__close:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.18);
}

.lightbox__nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}

.lightbox__nav:hover{
  transform: translateY(-50%) scale(1.03);
  background: rgba(255,255,255,.18);
}

.lightbox__prev{ left: 18px; }
.lightbox__next{ right: 18px; }

/* ==================================================
   CONTATO CENTRALIZADO (mantido)
================================================== */
.contato-central{
  display: flex;
  justify-content: center;
  max-width: 100%;
}

.contato-form{
  width: 100%;
  max-width: 520px;
  text-align: center;
}

.contato-form h2{ margin-bottom: .4rem; }
.contato-form .muted{ margin-bottom: 1.2rem; }
.contato-form .btn{ width: 100%; margin-top: 1rem; }

/* Centraliza o form de contato atual (sem mexer no HTML) */
#contato{ padding: 4.5rem 0; }

#contato .form{
  max-width: 720px;
  margin: 0 auto;
}

#contato .form .btn{ width: 100%; }

/* ==================================================
   RESPONSIVO — BREAKPOINTS DO PROJETO
   Mobile:  ≤ 575.98px
   Tablet:  576px — 991.98px
   Desktop: 992px — 1199.98px
   XL:      ≥ 1200px (default)
================================================== */

/* ================================
   DESKTOP (992px — 1199.98px)
================================ */
@media (min-width: 992px) and (max-width: 1199.98px){
  :root{ --container: 1040px; }
  .section{ padding: 4.2rem 0; }
}

/* ================================
   TABLET (576px — 991.98px)
================================ */
@media (min-width: 576px) and (max-width: 991.98px){

  /* Navbar em 2 linhas */
  .header{ height: auto; }

  .nav{
    height: auto;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand whats"
      "links links";
    padding: .85rem 0;
    width: 100%;
  }

  .brand{ grid-area: brand; }
  .nav__whats{ grid-area: whats; }

  .nav__links{
    grid-area: links;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: .55rem;
    padding-top: .55rem;
  }

  /* Compensa a header */
  body{ padding-top: 118px; }

  /* HERO */
  .hero__content{ padding: 2rem 0; }

  /* SOBRE */
  .section__grid{ grid-template-columns: 1fr; }

  /* PORTFÓLIO */
  .gallery{ grid-template-columns: repeat(2, minmax(0,1fr)); }

  /* CONTATO */
  .contact{ grid-template-columns: 1fr; }

  /* Lightbox */
  .lightbox__prev{ left: 10px; }
  .lightbox__next{ right: 10px; }
}

/* ================================
   MOBILE (≤ 575.98px)
================================ */
@media (max-width: 575.98px){

  /* Navbar compacta */
  .header{ height: auto; }

  .nav{
    height: auto;
    grid-template-columns: 1fr auto;
    padding: .75rem 0;
    width: 100%;
  }

  /* esconde links do meio no mobile */
  .nav__links{ display: none; }

  /* Whats menor e seguro */
  .nav__whats{ padding: .55rem .7rem; }
  .nav__whatsText{ display: none; }

  /* Compensa header no mobile */
  body{ padding-top: 92px; }

  /* HERO */
  .hero{ min-height: 78vh; }

  .hero__content{
    max-width: 100%;
    padding: 1.7rem 0;
  }

  .hero__subtitle{ font-size: 1rem; }

  .hero__cta{
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
  }

  .hero__cta .btn{
    width: 100%;
    justify-content: center;
  }

  /* SEÇÕES */
  .section{ padding: 3.6rem 0; }
  .section h2{ font-size: 1.75rem; }

  /* SOBRE */
  .section__grid{ grid-template-columns: 1fr; }
  .card__miniGrid{ grid-template-columns: 1fr; }

  /* PORTFÓLIO */
  .gallery{
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .work__media{ height: 180px; }

  /* CONTATO */
  .contact{ grid-template-columns: 1fr; gap: 1rem; }

  /* FOOTER centralizado */
  .footer__inner{
    justify-content: center;
    text-align: center;
  }

  /* Lightbox: botões menores */
  .lightbox__nav{
    width: 40px;
    height: 40px;
    font-size: 28px;
  }
  .lightbox__close{
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .lightbox__prev{ left: 10px; }
  .lightbox__next{ right: 10px; }
}
