/* ============================================
   GRUPO RB — Custom Styles
   Complementa o Tailwind CSS
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* offset do header fixo */
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---------- Typography helpers ---------- */
.section-eyebrow {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0b8db8;
  margin-bottom: 1rem;
}

.section-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.15;
  color: #0d1f26;
  margin-bottom: 1.25rem;
}

/* ---------- Header states ---------- */
#header {
  background: transparent;
}

#header.scrolled {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1px 20px rgba(6, 60, 78, 0.1);
}

/* Nav link colors */
#header .nav-link { color: rgba(255, 255, 255, 0.9); }
#header.scrolled .nav-link { color: #0d1f26; }
#header.scrolled .nav-link:hover { color: #0b8db8; }

/* Hamburger color */
#header #menu-toggle { color: white; }
#header.scrolled #menu-toggle { color: #0d1f26; }

/* ---------- Mobile Menu ---------- */
#mobile-menu {
  opacity: 0;
  transition: opacity 0.2s ease;
}

#mobile-menu.is-open {
  display: flex !important;
  opacity: 1;
}

#mobile-menu nav {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu.is-open nav {
  transform: translateX(0);
}

/* ---------- Hero ---------- */
.hero-bg { z-index: 0; }

/* ---------- Gallery Grid ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 12px;
}

/* First item spans 2 rows for visual interest */
.gallery-grid .gallery-item:nth-child(1) {
  grid-row: span 2;
  min-height: 400px;
}

.gallery-grid .gallery-item {
  min-height: 190px;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
  }
  .gallery-grid .gallery-item:nth-child(1) {
    grid-row: span 1;
    min-height: 220px;
  }
  .gallery-grid .gallery-item {
    min-height: 180px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .gallery-grid .gallery-item {
    min-height: 220px;
  }
}

/* ---------- Lightbox ---------- */
#lightbox.is-open {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* ---------- Reveal on Scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- WhatsApp Float Pulse ---------- */
.whatsapp-float {
  animation: pulse-whatsapp 2.5s infinite;
}

@keyframes pulse-whatsapp {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
}

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Counter numbers ---------- */
.counter {
  font-variant-numeric: tabular-nums;
  transition: all 0.3s ease;
}

/* ---------- Service card hover ---------- */
.service-card:hover .service-card-img {
  transform: scale(1.05);
}

/* ---------- Segment grid focus ---------- */
.segment-item:focus-within {
  outline: 2px solid #0b8db8;
  outline-offset: 2px;
}

/* ---------- Focus visible (accessibility) ---------- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #0b8db8;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Scrollbar (optional branding) ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f4f8f9; }
::-webkit-scrollbar-thumb { background: #0b8db8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #063c4e; }

/* ---------- Print styles ---------- */
@media print {
  #header, .whatsapp-float, #mobile-menu { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  body { color: #000; }
}

/* ---------- High contrast mode ---------- */
@media (prefers-contrast: high) {
  .section-eyebrow { color: #005a7a; }
  .nav-link { text-decoration: underline; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  html { scroll-behavior: auto; }
}
