@tailwind base;
@tailwind components;
@tailwind utilities;

/* ==========================================================================
   AVESSENCE AT CASA DA AZENHA — DESIGN SYSTEM & ARTISAN STYLES
   Paleta Oficial (Brand Book 2026):
   Creme (Fundo):    #FBF6EC | RGB(251, 246, 236)
   Tinta (Texto):    #1E1C1A | RGB(30, 28, 26)
   Amarelo (Sol):    #F2AC05 | RGB(242, 172, 5)
   Verde-água:       #7FBFA8 | RGB(127, 191, 168)
   Coral (Calor):    #EC8079 | RGB(236, 128, 121)
   Oliva (Vinha):    #B7B44E | RGB(183, 180, 78)
   Azul (Rio/Tít.):  #1F6E86 | RGB(31, 110, 134)
   ========================================================================== */

:root {
  --color-creme: #FBF6EC;
  --color-tinta: #1E1C1A;
  --color-amarelo: #F2AC05;
  --color-verdeagua: #7FBFA8;
  --color-coral: #EC8079;
  --color-oliva: #B7B44E;
  --color-azul: #1F6E86;

  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-hand: 'Caveat', cursive;
}

html {
  background-color: var(--color-creme);
  color: var(--color-tinta);
  font-family: var(--font-sans);
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-creme);
  color: var(--color-tinta);
  overflow-x: hidden;
  selection-background-color: var(--color-amarelo);
}

::selection {
  background-color: rgba(242, 172, 5, 0.35);
  color: var(--color-tinta);
}

/* Textura subtil de papel artesanal */
.paper-grain {
  background-image: radial-gradient(rgba(30, 28, 26, 0.035) 1px, transparent 0);
  background-size: 24px 24px;
}

/* Tipografia Fraunces com carácter artesanal */
.font-fraunces {
  font-family: var(--font-serif);
  font-weight: 600;
  font-variation-settings: "SOFT" 50, "WONK" 1;
}

.font-caveat {
  font-family: var(--font-hand);
  font-weight: 600;
}

/* Manchas de cor orgânicas (Brand Book: border-radius orgânico tipo blob) */
.blob-shape-1 {
  border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%;
}

.blob-shape-2 {
  border-radius: 45% 55% 62% 38% / 53% 38% 62% 47%;
}

.blob-shape-3 {
  border-radius: 58% 42% 37% 63% / 44% 59% 41% 56%;
}

.blob-arch {
  border-radius: 140px 140px 24px 24px;
}

/* Molduras fotográficas orgânicas */
.photo-frame {
  position: relative;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-frame:hover {
  transform: translateY(-4px);
}

/* Coerência Cromática & Luz Solar do Douro */
.photo-warmth {
  filter: contrast(1.02) saturate(1.03);
}

/* Cartões dos 4 Pilares (Brand Book página 4: barra superior de cor + fundo branco puro/creme) */
.pillar-card {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(30, 28, 26, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 38px -14px rgba(30, 28, 26, 0.1);
}

/* Foco acessível */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-azul);
  outline-offset: 3px;
}

/* Estrela de 8 pontas — rotação suave ao passar o rato */
.star-eight {
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.group:hover .star-eight {
  transform: rotate(45deg) scale(1.08);
}

/* ==========================================================================
   MENU ATIVO (SCROLLSPY)
   ========================================================================== */
.nav-link {
  position: relative;
  transition: color 0.25s ease;
}
.nav-link.nav-active {
  color: var(--color-azul) !important;
  font-weight: 700;
}
.nav-link.nav-active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: var(--color-amarelo);
  box-shadow: 0 0 8px rgba(242, 172, 5, 0.7);
}

/* ==========================================================================
   SECÇÃO DE GALERIA — SLIDER TICKER CONTÍNUO / AUTO-ROTATIVO
   ========================================================================== */
.gallery-ticker-wrapper {
  overflow: hidden;
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  mask-image: none !important;
  -webkit-mask-image: none !important;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.gallery-ticker-wrapper:active {
  cursor: grabbing;
}
.gallery-ticker-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  will-change: transform;
}

.gallery-slider-container {
  position: relative;
  width: 100%;
}
.gallery-slider-track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 1.25rem;
  touch-action: pan-x pan-y;
  cursor: grab;
}
.gallery-slider-track:active {
  cursor: grabbing;
}
.gallery-slider-track::-webkit-scrollbar {
  display: none;
}
.gallery-slide {
  scroll-snap-align: center;
  flex: 0 0 320px;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
@media (min-width: 640px) {
  .gallery-slide {
    flex: 0 0 380px;
  }
}
@media (min-width: 1024px) {
  .gallery-slide {
    flex: 0 0 420px;
  }
}
.gallery-slide:hover {
  transform: translateY(-6px);
}

/* Hero Cross-fade Transitions */
.hero-fade-slide {
  opacity: 0;
  transition: opacity 1000ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}
.hero-fade-slide.opacity-100 {
  opacity: 1;
}

/* Lightbox Modal */
#gallery-lightbox {
  transition: opacity 0.25s ease;
}
#gallery-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   SECÇÃO DE IMPRENSA — SLIDER HORIZONTAL / TICKER CONTÍNUO
   ========================================================================== */
.press-ticker-wrapper {
  overflow: hidden;
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  mask-image: none !important;
  -webkit-mask-image: none !important;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.press-ticker-wrapper:active {
  cursor: grabbing;
}
.gallery-ticker-wrapper a,
.gallery-ticker-wrapper img,
.gallery-ticker-wrapper article,
.press-ticker-wrapper a,
.press-ticker-wrapper img,
.press-ticker-wrapper article {
  -webkit-user-drag: none;
  user-drag: none;
}
.press-ticker-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  will-change: transform;
}

/* Suporte a deslizamento manual na imprensa */
.press-manual-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
}
.press-manual-track::-webkit-scrollbar {
  display: none;
}
.press-slide-card {
  scroll-snap-align: start;
  flex: 0 0 320px;
}
@media (min-width: 640px) {
  .press-slide-card {
    flex: 0 0 360px;
  }
}

/* ==========================================================================
   BOTÕES DE ÍCONES SOCIAIS & COMUNIDADE
   ========================================================================== */
.social-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.6rem;
  border-radius: 9999px;
  background-color: #ffffff;
  color: var(--color-tinta);
  border: 1px solid rgba(30, 28, 26, 0.12);
  box-shadow: 0 4px 14px -3px rgba(30, 28, 26, 0.08);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.social-card-btn:hover {
  background-color: var(--color-azul);
  color: #ffffff;
  border-color: var(--color-azul);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 28px -10px rgba(31, 110, 134, 0.45);
}

.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background-color: rgba(30, 28, 26, 0.06);
  color: var(--color-tinta);
  border: 1px solid rgba(30, 28, 26, 0.12);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.social-icon-btn:hover {
  background-color: var(--color-azul);
  color: #ffffff;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 20px -8px rgba(31, 110, 134, 0.4);
}

/* Hero Crossfade com movimento cinemático subtil (Ken Burns Pan & Zoom) */
#hero-crossfade-stage {
  overflow: hidden;
  position: relative;
}

.hero-fade-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 1.8s ease-in-out, transform 7.5s cubic-bezier(0.25, 1, 0.5, 1);
  transform: scale(1.0) translate(0, 0);
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.hero-fade-slide.kenburns-zoom-in {
  transform: scale(1.045) translate(-1%, -0.8%);
}

.hero-fade-slide.kenburns-pan-right {
  transform: scale(1.04) translate(1.2%, -0.5%);
}

.hero-fade-slide.kenburns-zoom-out {
  transform: scale(1.04) translate(-0.8%, 0.8%);
}

.hero-fade-slide.kenburns-pan-left {
  transform: scale(1.045) translate(-1.2%, 0.5%);
}
