/* ============================================================
   BEZMA STUDIO — style.css
   Última revisión: producción
   ============================================================ */


/* ============================================================
   1. RESET & VARIABLES
   ============================================================ */

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

:root {
  --color-bg:       #ffffff;
  --color-text:     #111111;
  --color-muted:    #444444;
  --color-border:   #111111;
  --color-footer-bg:#f9f9f9;
  --font-display:   'Playfair Display', serif;
  --font-body:      'Inter', sans-serif;
  --transition-base: 0.4s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  opacity: 1;
  transition: opacity 0.5s;
  will-change: opacity;
}

/* Fade in/out para page transitions */
body.is-loading,
body.fade-out {
  opacity: 0;
}


/* ============================================================
   2. MENÚ
   ============================================================ */

.menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  z-index: 10000;
  padding: 30px 4%;
  display: flex;
  justify-content: flex-end;
  background: transparent;
  transition: opacity 0.5s ease, background 0.4s ease;
}

.menu ul {
  list-style: none;
  display: flex;
  gap: 32px;
}

.menu a {
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color var(--transition-base), opacity var(--transition-base);
}

.menu a:hover {
  opacity: 0.6;
}

/* Colores adaptativos en Home */
.menu.light a { color: #ffffff; }
.menu.dark  a { color: #111111; }

/* Páginas internas — fondo blanco fijo */
body.about-page   .menu,
body.contact-page .menu {
  background: var(--color-bg);
}

body.about-page   .menu a,
body.contact-page .menu a {
  color: var(--color-text);
}


/* ============================================================
   3. HOME — SLIDESHOW
   ============================================================ */

.slideshow-section {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.slideshow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 2s ease;
  /* Evita taint en canvas para getBrightness */
  cross-origin: anonymous;
}

.slideshow img.active {
  opacity: 1;
}


/* ============================================================
   4. HERO
   ============================================================ */

.hero-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  will-change: transform;
  pointer-events: none;
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(44px, 8vw, 80px);
  font-weight: 500;
  letter-spacing: 3px;
  line-height: 1.1;
}

.hero-text p {
  font-family: var(--font-body);
  font-size: clamp(13px, 2vw, 18px);
  margin-top: 16px;
  letter-spacing: 3px;
  font-weight: 300;
  text-transform: uppercase;
}

.adaptive-text.light { color: #f5f5f5; }
.adaptive-text.dark  { color: #111111; }


/* ============================================================
   5. BOOKS
   ============================================================ */

section {
  scroll-margin-top: 100px;
}

#books {
  min-height: 100vh;
  padding: 100px 8% 80px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

#books h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 500;
  letter-spacing: 3px;
  margin-bottom: 60px;
  text-transform: uppercase;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 60px;
}

.book img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16; /* proporción vertical 1080×1920 */
  object-fit: cover;
  transition: transform var(--transition-base);
  cursor: pointer;
  display: block;
}

.book img:hover {
  transform: scale(1.03);
}

.book h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin-top: 20px;
  font-weight: 400;
}

.book p {
  font-family: var(--font-body);
  font-size: 14px;
  margin: 8px 0 16px;
  color: var(--color-muted);
  letter-spacing: 0.5px;
}

.book button {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 10px 24px;
  border: 1px solid var(--color-border);
  background: transparent;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}

.book button:hover {
  background: var(--color-text);
  color: var(--color-bg);
}


/* ============================================================
   6. EDITORIAL — CARRUSEL INFINITO
   ============================================================ */

.editorial-section {
  padding: 120px 0 100px;
  overflow: hidden;
  background: var(--color-bg);
}

.section-title {
  text-align: center;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 8px;
  font-weight: 400;
  text-transform: uppercase;
  margin-bottom: 80px;
  color: var(--color-muted);
}

.editorial-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  cursor: grab;
}

.editorial-wrapper:active {
  cursor: grabbing;
}

.editorial-track {
  display: flex;
  gap: 32px;
  will-change: transform;
}

.editorial-card {
  flex: 0 0 38%;
  text-decoration: none;
  color: inherit;
  display: block;
}

.editorial-card img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  transition: transform 0.6s ease;
  display: block;
}

.editorial-card:hover img {
  transform: scale(1.04);
}

.editorial-card h3 {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 2px;
  font-weight: 400;
  text-align: center;
}


/* ============================================================
   7. MODAL
   ============================================================ */

.modal {
  display: none;
  position: fixed;
  z-index: 50000;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-content {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 48px 40px;
  border-radius: 4px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  text-align: left;
  position: relative;
}

.modal-content h3 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 16px;
}

.modal-content p {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-muted);
  margin-bottom: 10px;
}

.modal .close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-text);
  font-weight: 300;
  line-height: 1;
  transition: opacity var(--transition-base);
}

.modal .close:hover {
  opacity: 0.5;
}


/* ============================================================
   8. ABOUT
   ============================================================ */

.about-section {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 120px 8% 80px;
  box-sizing: border-box;
}

.about-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(40px, 6vw, 100px);
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.about-image {
  flex: 0 0 auto;
}

.about-image img {
  width: clamp(180px, 25vw, 320px);
  height: auto;
  object-fit: cover;
  display: block;
}

.about-text {
  flex: 1;
  min-width: 0;
  max-width: 500px;
}

.about-text h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  margin-bottom: 28px;
}

.about-text p {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.85;
  margin-bottom: 18px;
  color: var(--color-muted);
}


/* ============================================================
   9. CONTACT
   ============================================================ */

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main.contact-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 8% 60px;
}

.contact-section {
  text-align: center;
}

.contact-section h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  margin-bottom: 24px;
}

.contact-section p {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 14px;
  color: var(--color-muted);
}

.social-links {
  margin-top: 32px;
}

.social-links a {
  font-family: var(--font-body);
  display: inline-block;
  color: var(--color-text);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-text);
  padding-bottom: 2px;
  transition: opacity var(--transition-base);
}

.social-links a:hover {
  opacity: 0.5;
}


/* ============================================================
   10. FOOTER
   ============================================================ */

footer.footer-line {
  padding: 24px 8%;
  background: var(--color-footer-bg);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--color-text);
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  text-align: center;
}

footer.footer-line a {
  color: var(--color-text);
  text-decoration: none;
  transition: opacity var(--transition-base);
}

footer.footer-line a:hover {
  opacity: 0.5;
}


/* ============================================================
   11. RESPONSIVE
   ============================================================ */

@media screen and (max-width: 900px) {
  .editorial-card { flex: 0 0 60%; }
  .editorial-card img { height: 280px; }
}

@media screen and (max-width: 600px) {
  /* Menú */
  .menu {
    padding: 18px 5%;
  }
  .menu ul {
    gap: 20px;
  }
  .menu a {
    font-size: 11px;
    letter-spacing: 1px;
  }

  /* About */
  .about-container {
    flex-direction: column;
    text-align: center;
  }
  .about-text p {
    font-size: 14px;
  }

  /* Editorial */
  .editorial-card { flex: 0 0 85%; }
  .editorial-card img { height: 260px; }

  /* Footer — legible en móvil */
  .footer-content {
    gap: 16px;
    font-size: 11px;
  }
  footer.footer-line {
    padding: 20px 5%;
  }

  /* Modal */
  .modal-content {
    padding: 36px 24px;
  }
}


/* ============================================================
   MODAL — lista de descripción
   ============================================================ */

#modal-description ul {
  list-style: none;
  margin-top: 8px;
}

#modal-description ul li {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-muted);
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding-left: 16px;
  position: relative;
}

#modal-description ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: #bbb;
}


/* ============================================================
   MODAL — botón Agendar (WhatsApp)
   ============================================================ */

.whatsapp-btn {
  display: inline-block;
  margin-top: 28px;
  padding: 12px 32px;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-bg);
  background: var(--color-text);
  border: 1px solid var(--color-text);
  transition: background 0.3s ease, color 0.3s ease;
  cursor: pointer;
}

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


/* ============================================================
   BOOKS — card Polas centrada arriba
   ============================================================ */

.books-grid--top {
  display: flex;
  justify-content: center;
  margin-bottom: 60px;
}

.books-grid--top .book {
  width: 100%;
  max-width: 340px;
}


/* ============================================================
   MODAL — aparición suave
   ============================================================ */

.modal {
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.modal.is-open {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  transform: translateY(18px);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
  opacity: 0;
}

.modal.is-open .modal-content {
  transform: translateY(0);
  opacity: 1;
}