/* Variables y Reset */
:root {
  --color-bg: #ffffff;
  --color-text: #101010;
  --color-accent: #bfd3f4; /* Azul de la marca actualizado */
  --color-grey: #cecece;
  --font-main: 'Poppins', system-ui, -apple-system, sans-serif;
  --max-width: 1100px;
}

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

html {
  font-size: 62.5%; /* 1rem = 10px */
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--color-text);
  
  /* Textura Papel Craft Realista */
  background-color: #e2c5a7;
  background-image: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.5'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='fiberFilter'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.5' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23fiberFilter)' opacity='0.35'/%3E%3C/svg%3E"),
    radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, rgba(0,0,0,0.1) 100%);
  background-blend-mode: multiply, overlay, normal;
  background-attachment: fixed;

  font-size: 1.6rem;
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
}

#eventos {
  background-color: var(--color-bg);
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Utilidades */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.4rem;
  cursor: pointer;
  border: 2px solid #000000;

}

.btn-primary {
  background: #c8d3ef;
  color: #000000;
}

.btn-primary:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text);
}

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

.btn-outline:hover {
  background: var(--color-text);
  color: #fff;
}

.btn-review {
  background: #4285f4;
  color: #fff;
  border-color: #4285f4;
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
  margin-top: 20px;
}

.btn-review:hover {
  background: #3367d6;
  border-color: #3367d6;
  transform: translateY(-2px);
  color: #fff;
}

.section-title {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  text-align: center;
  margin-bottom: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.divider {
  height: 6px;
  background: var(--color-text);
  mask-image: linear-gradient(90deg, #000 45%, transparent 45%);
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 45%);
  mask-size: 18px 6px;
  -webkit-mask-size: 18px 6px;
  border-radius: 3px;
  margin: 0 auto 4rem;
  width: 100px;
}

/* Header & Nav */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: transparent; /* Fondo transparente inicial */
  transition: background 0.3s ease;
  z-index: 1000;
  border-bottom: none;
  padding: 15px 0;
}

/* Clase para header sólido al hacer scroll (se añadiría con JS si fuera necesario, o simplemente se deja transparente si el fondo global lo permite) 
   Para asegurar legibilidad en otras secciones, lo ideal es mantener el blur o color si no estamos en Hero.
   Por simplicidad y para ajustar al diseño "papel", asumiremos que el fondo general combina.
   Si se necesita scroll, se ajustará luego.
   Pero el diseño original tenía fondo blanco. Vamos a poner un fondo ligero color papel si se quiere.
*/
.site-header.scrolled {
   background: rgba(232, 221, 203, 0.95);
   box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.main-nav ul {
  display: flex;
  gap: 30px;
}

.main-nav a {
  font-weight: 600;
  font-size: 1.4rem;
  text-transform: uppercase;
}

.main-nav a:hover {
  color: #666;
}

.mobile-toggle {
  display: none;
  font-size: 2.4rem;
  cursor: pointer;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  position: relative;
  text-align: center;
  /* Fondo craft heredado de body o re-aplicado si se desea integridad, 
     pero al ser el mismo, podemos dejarlo transparente o quitarlo
     para que use el del body */
  background: transparent; 
}

/* Indicador de Scroll (Flecha) */
.scroll-indicator {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.6;
}

.scroll-indicator span {
  display: block;
  width: 20px;
  height: 20px;
  border-bottom: 2px solid #555;
  border-right: 2px solid #555;
  transform: rotate(45deg);
  margin: -10px;
  animation: scrollFade 2s infinite;
}

.scroll-indicator span:nth-child(2) {
  animation-delay: -0.2s;
}

.scroll-indicator span:nth-child(3) {
  animation-delay: -0.4s;
}

@keyframes scrollFade {
  0% {
    opacity: 0;
    transform: rotate(45deg) translate(-20px, -20px);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(45deg) translate(20px, 20px);
  }
}

.hero-logo {
    display: block;
    margin: 0 auto 30px auto;
    max-width: 300px; /* Ajustar según tamaño deseado */
    width: 80%;
    height: auto;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.hero p {
  font-size: clamp(1.6rem, 3vw, 2rem);
  color: #101010;
  max-width: 600px;
  margin: 0 auto 40px;
}

.hero-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

/* Features / About */
.features {
  padding: 80px 0;
  background: #fff;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

.feature-card {
  padding: 30px;
  background: #fff;
  border: 1px solid #eee;
  border-left: 4px solid var(--color-accent);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.feature-card h3 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: var(--color-text);
  font-weight: 700;
}

/* Instagram / Gallery Preview */
.gallery {
  padding: 80px 0;
  background-color: transparent; /* Antes #f8f9fa, ahora transparente para ver el craft */
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px; /* Reducir gap para que se parezca más a Instagram */
}

@media (min-width: 768px) {
  .gallery-grid {
    gap: 20px; /* Más espacio en desktop */
  }
}

.gallery-item {
  display: block;
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Location & Hours */
.location {
  padding: 80px 0;
}

.location-container {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

@media (min-width: 768px) {
  .location-container {
    flex-direction: row;
    align-items: start;
  }
}

.info-box {
  flex: 1;
  background: #fff;
  padding: 20px;
      border-radius: 12px; /* Ajustar el radio de borde */

}

.map-box {
  flex: 1;
  min-height: 300px;
  background: #eee;
  border-radius: 12px;
  overflow: hidden;
}

.map-box iframe {
  width: 100%;
  height: 100%;
  min-height: 350px;
  border: 0;
}

/* ───────── Horarios (Estilo Carta) ───────── */
.horarios-table { 
  width: 100%; 
  max-width: 520px; 
  margin: 0 auto; 
  border-collapse: separate; 
  border-spacing: 0; 
  font-size: 1.4rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #cecece;
}
.horarios-table th { background: #97c6f0; color: #101010; padding: 10px 8px; border-bottom: 2px solid #cecece; font-weight: 700; }
.horarios-table td { padding: 10px 8px; border-bottom: 1px solid #cecece; text-align: center; }
.horarios-table tr:last-child td { border-bottom: none; }
.horario-dia { text-align: left; font-weight: 700; color: #101010; }
.horario-horas { color: #101010; }
.horario-row.today { background: #ffffff; color: #000000; }
.horario-row.today .horario-dia, .horario-row.today .horario-horas { color: #000000; }

/* Footer Image */
.footer-image-section { width: 100%; margin-top: 24px; padding: 0; max-width: 100%; }
.footer-img { width: 100%; height: auto; display: block; max-width: 100%; }

/* Footer */
.site-footer {
  background: var(--color-text);
  color: #fff;
  padding: 60px 0 30px;
  text-align: center;
}

.footer-logo {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 20px;
  display: inline-block;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: all 0.3s ease;
  color: #fff;
}

.social-links svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.social-links a:hover {
  background: var(--color-accent);
  color: var(--color-text);
  transform: translateY(-3px);
}

.copyright {
  color: #888;
  font-size: 1.2rem;
  border-top: 1px solid #333;
  padding-top: 20px;
}

/* Mobile Nav */
@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }

  .main-nav {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 20px;
    border-bottom: 2px solid var(--color-text);
    transform: translateY(-150%);
    transition: transform 0.3s ease;
    z-index: 999;
  }

  .main-nav.active {
    transform: translateY(0);
  }

  .main-nav ul {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}

/* Logo en Header */
.header-logo {
  max-height: 45px;
  width: auto;
  display: block;
}

/* Destacado en Menú */
.main-nav a.nav-highlight {
  background-color: var(--color-text);
  color: #fff;
  padding: 8px 20px;
  border-radius: 999px;
  transition: all 0.3s ease;
}

.main-nav a.nav-highlight:hover {
  background-color: var(--color-accent);
  color: var(--color-text);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Ajuste para móvil si es necesario */
@media (max-width: 768px) {
  .main-nav a.nav-highlight {
    background-color: transparent;
    color: var(--color-text);
    padding: 15px 0;
    border-radius: 0;
    font-weight: 700;
    color: var(--color-accent);
  }
  
  .main-nav a.nav-highlight:hover {
    background-color: transparent;
    color: var(--color-text);
    transform: none;
    box-shadow: none;
  }
}

/* Estilos para el botón flotante del mapa */
.map-box {
  position: relative;
}

.map-link {
  display: block;
  position: relative;
}

.map-overlay-btn {
  position: absolute;
  top: 59%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  color: var(--color-text);
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  animation: pulse-float 2s infinite ease-in-out;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--color-text);
  z-index: 5;
  transition: all 0.3s ease;
}

.map-link:hover .map-overlay-btn {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: translate(-50%, -50%) scale(1.05);
}

@keyframes pulse-float {
  0% {
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  }
  50% {
    transform: translate(-50%, -60%);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
  }
  100% {
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  }
  
}

/* Gallery Placeholder */
.gallery-placeholder {
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 2rem;
}

/* Event Form */
.event-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.event-form label {
    font-weight: 600;
    margin-bottom: -15px;
    display: block;
}
.event-form input, .event-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 1.6rem;
}
.event-form button {
    align-self: flex-start;
}

/* Calendar */
.calendar-wrapper {
    max-width: 800px;
    margin: 0 auto;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 20px;
    background: #eee;
    padding: 5px;
    border-radius: 8px;
}
.calendar-header {
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
    background: #fff;
    font-size: 1.2rem;
    text-transform: uppercase;
}
.calendar-day {
    min-height: 80px;
    background: #fff;
    padding: 8px;
    position: relative;
    font-size: 1.4rem;
}
.calendar-day.empty {
    background: transparent;
}
.day-number {
    font-weight: 700;
    color: var(--color-text);
}
.day-content {
    font-size: 1rem;
    color: #666;
    margin-top: 5px;
}
.calendar-day.today {
    background: #f0f7ff;
    border: 1px solid var(--color-accent);
}



/* Que nos define Section */
.about-section {
  padding: 100px 20px;
  text-align: center;
}

.about-text {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.8rem;
  line-height: 1.8;
  color: #333;
}

.about-text strong {
  color: var(--color-text);
  font-weight: 700;
}

/* Mobile Gallery Styles */
@media (max-width: 768px) {
  /* Ensure this overrides subsequent rules by being more specific or using !important if necessary, 
     or better, we will fix the subsequent rule to not apply on mobile */
  .gallery-grid {
    grid-template-columns: 1fr !important; /* Force 1 column on mobile */
    gap: 30px; 
  }
}

/* --- New Styles for Admin/Gallery/Events --- */

/* Gallery Index Fixes */
.gallery-grid {
    display: grid;
    /* Default mobile-first should be 1fr ideally, but since we have legacy code above, 
       we'll just use the media query above with !important OR fix this base rule: */
    grid-template-columns: 1fr; /* Base mobile */
    gap: 15px;
}

@media (min-width: 600px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

.gallery-item.desktop-only { display: none; }
@media (min-width: 768px) {
    .gallery-item.desktop-only { display: block; }
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1; /* Square crop for grid consistency */
    border-radius: 4px;
}

/* Calendar Event Style - Craft with Neon Border */
.calendar-day.has-event {
    /* Removing direct background to use ::after for masking */
    background: transparent;
    cursor: pointer;
    font-weight: bold;
    border: none;
    position: relative;
    overflow: hidden; /* Clips the spinning gradient */
    border-radius: 6px;
    z-index: 1; /* Stacking context */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* The Spinning Gradient (The Neon Border) */
.calendar-day.has-event::before {
    content: '';
    position: absolute;
    width: 250%; /* Large enough to cover rotation */
    height: 250%;
    top: -75%;
    left: -75%;
    z-index: -2;
    background: conic-gradient(
        from 0deg, 
        transparent 0deg, 
        transparent 90deg, 
        #cbb89a 180deg, 
        #97c6f0 270deg, 
        transparent 360deg
    );
    animation: neonRotate 4s linear infinite;
}

/* The Inner Background (Masking the center) */
.calendar-day.has-event::after {
    content: '';
    position: absolute;
    inset: 3px; /* Determines border thickness */
    background-color: #e2c5a7; /* Craft Paper Color */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.3'/%3E%3C/svg%3E");
    border-radius: 4px;
    z-index: -1;
}

.calendar-day.has-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3); /* Neon glow on hover */
}

@keyframes neonRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Upcoming Events List */
.upcoming-events {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}
.upcoming-event-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: 0.2s;
}
.upcoming-event-item:hover {
    background-color: #fafafa;
    padding-left: 10px;
}
.up-date {
    font-weight: bold;
    color: var(--color-accent); /* Using root var */
    margin-right: 15px;
    min-width: 50px;
}
.up-title {
    font-weight: 600;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s;
}
.close-modal {
    position: absolute;
    top: 10px; right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}
.modal-date {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
}
.modal-desc {
    white-space: pre-wrap; /* Maintain paragraphs */
    line-height: 1.6;
}
