/* =========================================================
   MARGABY — Salón de Eventos
   Álbum digital fotográfico. Mobile-first.
   ========================================================= */

:root{
  /* Paleta */
  --c-bg:        #FBF8F5;
  --c-bg-alt:    #F3EBE4;
  --c-text:      #2B2724;
  --c-text-soft: #7C7168;
  --c-line:      #E6DACF;
  --c-rose:      #DCB9AE;
  --c-rose-deep: #C89685;
  --c-gold:      #AD8752;
  --c-white:     #FFFFFF;

  /* Tipografía */
  --f-display: "Cormorant Garamond", serif;
  --f-body: "Jost", sans-serif;

  /* Espaciado */
  --gap: 10px;
  --pad: 20px;
  --header-h: 64px;

  --ease: cubic-bezier(.22,.61,.36,1);
}

*, *::before, *::after{ box-sizing: border-box; }

html{
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body{
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3{
  font-family: var(--f-display);
  font-weight: 500;
  margin: 0;
  color: var(--c-text);
}

img{ max-width: 100%; display: block; }

a{ color: inherit; text-decoration: none; }

button{ font-family: inherit; }

/* =========================================================
   HEADER
   ========================================================= */

.site-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--header-h);
  background: rgba(251,248,245,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}

.site-header.scrolled{
  border-bottom-color: var(--c-line);
}

.header-inner{
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo{
  font-family: var(--f-display);
  font-size: 1.5rem;
  letter-spacing: 0.14em;
  font-weight: 500;
  color: var(--c-text);
}

/* Hamburger */
.menu-toggle{
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  z-index: 210;
}

.menu-toggle span{
  display: block;
  height: 1px;
  background: var(--c-text);
  transition: transform .3s var(--ease), opacity .3s var(--ease), width .3s var(--ease);
  width: 24px;
}
.menu-toggle span:nth-child(1){ width: 24px; }
.menu-toggle span:nth-child(2){ width: 18px; }
.menu-toggle span:nth-child(3){ width: 24px; }

.menu-toggle.open span:nth-child(1){
  transform: translateY(7px) rotate(45deg);
  width: 24px;
}
.menu-toggle.open span:nth-child(2){ opacity: 0; }
.menu-toggle.open span:nth-child(3){
  transform: translateY(-7px) rotate(-45deg);
  width: 24px;
}

.nav{
  position: fixed;
  top: var(--header-h);
  right: 0;
  width: min(78vw, 320px);
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 34px var(--pad);
  transform: translateX(100%);
  transition: transform .38s var(--ease);
  border-left: 1px solid var(--c-line);
}

.nav.open{ transform: translateX(0); }

.nav-link{
  font-size: 1.05rem;
  padding: 12px 4px;
  width: 100%;
  border-bottom: 1px solid var(--c-line);
  color: var(--c-text);
  letter-spacing: 0.02em;
}

.nav-link:last-child{ border-bottom: none; }


/* =========================================================
   PHOTO base
   ========================================================= */

.photo {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c-bg-alt), var(--c-rose) 140%);
  border-radius: 4px;
  transition: transform 0.4s var(--ease);
}

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

/* Placeholder shown while real photos aren't in place yet */
.photo::after {
  content: attr(data-placeholder);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  font-family: var(--f-display);
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: rgba(43,39,36,0.45);
  pointer-events: none;
}

.photo img[data-loaded="true"] ~ *::after,
.photo.has-image::after {
  content: none;
}
/* =========================================================
   HERO
   ========================================================= */

.hero{
  position: relative;
  width: 100%;
  height: 92vh;
  height: 92dvh;
  min-height: 460px;
  margin-top: 0;
}

.hero-photo{
  position: absolute;
  inset: 0;
  border-radius: 0;
}

.hero::before{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,17,15,0.10) 0%, rgba(20,17,15,0.05) 45%, rgba(20,17,15,0.45) 100%);
  z-index: 1;
  pointer-events: none;
}

.hero-caption{
  position: absolute;
  left: 0; right: 0;
  bottom: 8%;
  z-index: 2;
  text-align: center;
  color: var(--c-white);
  padding: 0 var(--pad);
}

.hero-caption h1{
  font-size: 2.8rem;
  letter-spacing: 0.18em;
  color: var(--c-white);
  text-shadow: 0 2px 18px rgba(0,0,0,0.25);
}

.hero-caption p{
  margin: 6px 0 0;
  font-size: 0.95rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 300;
  color: rgba(255,255,255,0.92);
}

/* =========================================================
   SECTIONS
   ========================================================= */

.section{
  padding: 64px var(--pad) 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-alt{
  background: var(--c-bg-alt);
  max-width: none;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.section-alt > *{
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.section-head{
  text-align: center;
  margin-bottom: 30px;
}

.section-head h2{
  font-size: 2rem;
  letter-spacing: 0.1em;
  position: relative;
  display: inline-block;
  padding-bottom: 14px;
}

.section-head h2::after{
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 1px;
  background: var(--c-gold);
}

.section-lede{
  margin: 14px auto 0;
  max-width: 30ch;
  color: var(--c-text-soft);
  font-size: 1rem;
}



/* Foto grande apilada — sección EL SALÓN */
.photo-stack{
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.photo-lg{ aspect-ratio: 4 / 3; }

/* Categorías (Espacios / Decoraciones) */
/* Categorías (Espacios / Decoraciones / Buffet) */
.category { margin-bottom: 44px; }
.category:last-child { margin-bottom: 0; }

.category-title {
  font-family: var(--f-display);
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Línea decorativa sutil al lado del título */
.category-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-line);
}

/* Grilla por defecto (2 columnas) */
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.photo-feature {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 10;
}

.category-grid .photo:not(.photo-feature) {
  aspect-ratio: 1 / 1;
}

/* CARRUSEL HORIZONTAL EN MOBILE CON AUTOPLAY */
.category-grid.scroll-x {
  display: flex !important;
  overflow-x: auto !important;
  padding-bottom: 10px;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Sacamos el scroll-snap para que el avance por JS sea 100% fluido */
}

.category-grid.scroll-x::-webkit-scrollbar {
  display: none;
}

.category-grid.scroll-x .photo {
  flex: 0 0 75% !important;
  min-width: 75% !important;
  aspect-ratio: 4 / 3;
}

/* =========================================================
   GALERÍA — masonry
   ========================================================= */

.masonry{
  columns: 2 180px;
  column-gap: var(--gap);
}

.masonry .photo{
  break-inside: avoid;
  margin-bottom: var(--gap);
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
}

.masonry .photo img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.masonry .photo:nth-child(4n+1){ aspect-ratio: 3/4; }
.masonry .photo:nth-child(4n+2){ aspect-ratio: 1/1; }
.masonry .photo:nth-child(4n+3){ aspect-ratio: 4/5; }
.masonry .photo:nth-child(4n+4){ aspect-ratio: 1/1; }


/* Oculta los placeholders vacíos dentro de la galería */
.masonry .photo::after {
  display: none !important;
}
/* =========================================================
   CONTACTO
   ========================================================= */

.contact{
  text-align: center;
  padding-top: 72px;
  padding-bottom: 72px;
}

.contact h2{
  font-size: 1.9rem;
  letter-spacing: 0.04em;
  margin-bottom: 30px;
}

.contact-buttons{
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 300px;
  margin: 0 auto;
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 24px;
  border-radius: 2px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  border: 1px solid var(--c-text);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}

.btn-primary{
  background: var(--c-rose-deep);
  border-color: var(--c-rose-deep);
  color: var(--c-white);
}

.btn-primary:hover{ background: var(--c-gold); border-color: var(--c-gold); }

.btn-outline{
  background: transparent;
  border-color: var(--c-line);
  color: var(--c-text);
}

.btn-outline:hover{ border-color: var(--c-text); }

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer{
  text-align: center;
  padding: 24px var(--pad) 32px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--c-text-soft);
}

/* =========================================================
   WHATSAPP FLOTANTE
   ========================================================= */
.whatsapp-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #3FA24A;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  z-index: 150;
  transition: transform .25s var(--ease);
}

/* Botón Instagram  */
.instagram-float {
  position: fixed;
  right: 18px;
  bottom: 78px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  z-index: 150;
  transition: transform .25s var(--ease);
}

/* Botón Facebook*/
.facebook-float {
  position: fixed;
  right: 18px;
  bottom: 138px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #1877F2;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  z-index: 150;
  transition: transform .25s var(--ease);
}

/* Efecto hover compartido */
.whatsapp-float:hover,
.instagram-float:hover,
.facebook-float:hover { 
  transform: scale(1.06); 
}

/* =========================================================
   LIGHTBOX
   ========================================================= */

.lightbox{
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(20,17,15,0.96);
  display: none;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.lightbox.open{ display: flex; }

.lightbox-stage{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 16px;
  overflow: hidden;
}

.lightbox-stage img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  border-radius: 2px;
}

.lightbox-close{
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
}

.lightbox-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-prev{ left: 10px; }
.lightbox-next{ right: 10px; }

@media (max-width: 480px){
  .lightbox-nav{ width: 38px; height: 38px; }
}

/* =========================================================
   TABLET  ≥ 700px
   ========================================================= */

@media (min-width: 700px){
  :root{ --pad: 40px; --gap: 14px; }

  .hero-caption h1{ font-size: 3.6rem; }
  .hero-caption p{ font-size: 1.05rem; }

  .photo-stack{
    flex-direction: row;
  }
  .photo-lg{ flex: 1; aspect-ratio: 1/1; }

  .masonry{ columns: 3 200px; }

  .contact-buttons{
    flex-direction: row;
    max-width: none;
    justify-content: center;
  }

  .btn{ min-width: 160px; }
}

/* =========================================================
   LAPTOP / PC  ≥ 1024px
   ========================================================= */

@media (min-width: 1024px){
  :root{ --header-h: 76px; }

  /* Desactiva el carrusel y lo convierte en grilla recién en monitores grandes */
  .category-grid.scroll-x {
    display: grid;
    overflow-x: visible;
  }

  .logo{ font-size: 1.7rem; }

  .menu-toggle{ display: none; }

  .nav{
    position: static;
    height: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 34px;
    padding: 0;
    background: none;
    border-left: none;
    transform: none;
  }

  .nav-link{
    width: auto;
    padding: 6px 0;
    border-bottom: none;
    font-size: 0.92rem;
    position: relative;
  }

  .nav-link::after{
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 0;
    height: 1px;
    background: var(--c-gold);
    transition: width .25s var(--ease);
  }

  .nav-link:hover::after{ width: 100%; }

  .section-head h2{ font-size: 2.3rem; }

  /* Ajuste de galería para monitores anchos */
  .masonry{ 
    columns: 4 220px; 
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .category-grid { 
    gap: 20px; 
  }

  /* Alineación de los 3 botones flotantes en PC */
  .whatsapp-float  { right: 28px; bottom: 28px; }
  .instagram-float { right: 28px; bottom: 90px; }
  .facebook-float  { right: 28px; bottom: 152px; }
}

/* =========================================================
   ACCESIBILIDAD
   ========================================================= */

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; scroll-behavior: auto !important; }
}

a:focus-visible,
button:focus-visible{
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}
