/* =========================================================
   EL REPARO — estilos principales
   Paleta cálida, contraste alto y diseño adaptable.
   ========================================================= */

:root {
  --red: #a91f2b;
  --red-dark: #831923;
  --ink: #282725;
  --muted: #625f59;
  --paper: #f7f5f0;
  --cream: #ece7de;
  --white: #ffffff;
  --line: #d8d1c7;
  --shadow: 0 18px 50px rgba(48, 38, 30, 0.08);
  --radius: 18px;
  --content-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

button,
a {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
video:focus-visible {
  outline: 4px solid #e0a52b;
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

/* Estructura de escritorio: navegación angosta + contenido principal. */
.site-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 42px 24px;
  background: var(--red);
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}

.section-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nav-button {
  width: 100%;
  min-height: 68px;
  padding: 16px 18px;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 12px;
  background: transparent;
  color: var(--white);
  font-size: 1.12rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-button:hover {
  background: rgba(255,255,255,0.14);
  transform: translateX(3px);
}

.nav-button.is-active {
  background: var(--white);
  color: var(--red-dark);
  border-color: var(--white);
}

.sidebar-note {
  margin: 0;
  text-align: center;
  letter-spacing: 0.24em;
  font-size: 0.78rem;
  font-weight: 700;
}

.mobile-brand {
  display: none;
}

.main-content {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: 34px clamp(24px, 5vw, 76px) 28px;
  display: flex;
  flex-direction: column;
}

.brand-header {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 190px;
}

.logo-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
}

.logo-link img {
  display: block;
  width: min(320px, 42vw);
  max-height: 220px;
  object-fit: contain;
}

.intro-panel {
  width: min(100%, 900px);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 58px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  animation: appear 350ms ease both;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
  font-weight: 800;
}

.intro-panel h1 {
  margin: 0 0 22px;
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: 0.045em;
}

.presentation-text {
  max-width: 760px;
  margin: 0 auto;
  color: #393733;
  font-size: clamp(1.08rem, 1.5vw, 1.3rem);
  line-height: 1.85;
  text-wrap: pretty;
}

.contact-text {
  margin: 22px 0 0;
  color: var(--red-dark);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.content-section {
  animation: appear 300ms ease both;
}

.section-heading {
  margin: 12px 0 28px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.15;
}

.section-description {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.12rem;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.content-card {
  min-width: 0;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.content-card-body {
  padding: 20px 22px 24px;
}

.content-card h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  line-height: 1.3;
}

.content-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.content-card .metadata {
  color: var(--red-dark);
  font-size: 0.92rem;
  font-weight: 700;
}

.content-card video,
.content-card iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #171717;
  object-fit: contain;
}

.content-card blockquote {
  margin: 0;
  color: #393733;
  font-size: 1.15rem;
  line-height: 1.7;
}

.external-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--red-dark);
  font-weight: 800;
  text-underline-offset: 4px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 42px 24px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.65);
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--red-dark);
  font-size: 1.6rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  margin-top: auto;
  padding-top: 48px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---------- FOTOS: carrusel ---------- */
.photos-section {
  width: min(100%, 900px);
  margin: 34px auto 0;
  animation: appear 350ms ease both;
}

.photos-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 14px;
}

.photos-heading h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.2;
}

.carousel-counter {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  border-radius: var(--radius);
  background: #1d1b19;
  box-shadow: var(--shadow);
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.carousel-photo {
  display: block;
  width: 100%;
  height: clamp(260px, 56vw, 540px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.carousel-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.carousel-arrow,
.lightbox-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--red-dark);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 160ms ease, transform 160ms ease;
}

.carousel-arrow:hover,
.lightbox-arrow:hover {
  background: var(--white);
  transform: translateY(-50%) scale(1.06);
}

.carousel-arrow svg,
.lightbox-arrow svg,
.lightbox-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }

/* ---------- FOTOS: visor ---------- */
body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: rgba(12, 11, 10, 0.96);
  color: var(--white);
  animation: fade-in 180ms ease both;
}

.lightbox-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
}

.lightbox-counter {
  padding-left: 6px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lightbox-actions {
  display: flex;
  gap: 8px;
}

.lightbox-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  cursor: pointer;
  text-decoration: none;
  transition: background 160ms ease;
}

.lightbox-button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.lightbox-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0 72px;
  touch-action: none;
  overflow: hidden;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 220ms ease, opacity 220ms ease;
}

.lightbox-image.is-dragging {
  transition: none;
}

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

.lightbox-caption {
  margin: 0;
  padding: 10px 20px calc(16px + env(safe-area-inset-bottom));
  text-align: center;
  color: #e6e1da;
}

.lightbox-caption[hidden] {
  display: block !important;
  visibility: hidden;
  padding-top: 0;
}

.lightbox.is-fullscreen {
  background: #000;
}

/* ---------- VIDEOS ---------- */
.video-frame {
  position: relative;
  background: #171717;
}

.video-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #171717;
  object-fit: contain;
}

.video-error {
  margin: 0;
  padding: 10px 22px 0;
  color: var(--red-dark) !important;
  font-weight: 700;
}

/* ---------- REPORTAJES ---------- */
.pdf-card {
  display: flex;
  flex-direction: column;
}

.pdf-card .content-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pdf-preview {
  height: 340px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.pdf-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.pdf-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 140px;
  background: linear-gradient(135deg, var(--cream), #f6efe5);
  border-bottom: 1px solid var(--line);
  color: var(--red);
  font-weight: 800;
  letter-spacing: 0.18em;
}

.pdf-cover svg {
  width: 46px;
  height: 58px;
  fill: var(--white);
  stroke: var(--red);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
}

.pdf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border: 2px solid var(--red);
  border-radius: 10px;
  color: var(--red-dark);
  font-weight: 800;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.pdf-button:hover {
  background: var(--cream);
}

.pdf-button-primary {
  background: var(--red);
  color: var(--white);
}

.pdf-button-primary:hover {
  background: var(--red-dark);
  color: var(--white);
}

/* Mensaje y reproductor del modo evento. */
.event-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #090909;
  color: white;
}

.event-screen video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #090909;
}

.event-message {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 24px;
  background: rgba(0,0,0,0.86);
  text-align: center;
}

.event-message p,
.event-message h1 {
  margin: 0;
}

.event-message > p:first-child {
  color: #f2c9c9;
  letter-spacing: 0.25em;
  font-weight: 800;
}

.event-message h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
}

.event-start-button {
  margin-top: 12px;
  padding: 16px 28px;
  border: 0;
  border-radius: 10px;
  background: var(--red);
  color: white;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
}

.event-start-button:hover {
  background: var(--red-dark);
}

.event-status {
  min-height: 1.5em;
  color: #f2c9c9;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes appear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tablet y celular: una columna y navegación fija inferior. */
@media (max-width: 760px) {
  body {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .site-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
    display: block;
    box-shadow: 0 -8px 28px rgba(30, 20, 20, 0.18);
  }

  .section-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-button {
    min-width: 0;
    min-height: 58px;
    padding: 10px 5px;
    border-radius: 9px;
    text-align: center;
    font-size: clamp(0.78rem, 3.2vw, 0.98rem);
  }

  .nav-button:hover {
    transform: none;
  }

  .sidebar-note {
    display: none;
  }

  .main-content {
    padding: 16px 16px 26px;
  }

  .brand-header {
    min-height: 150px;
  }

  .logo-link img {
    width: min(230px, 65vw);
    max-height: 145px;
  }

  .intro-panel {
    padding: 28px 20px;
  }

  .presentation-text {
    font-size: 1.04rem;
    line-height: 1.72;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .photos-section {
    margin-top: 24px;
  }

  .carousel-photo {
    height: clamp(240px, 78vw, 420px);
  }

  .carousel-arrow {
    width: 40px;
    height: 40px;
  }

  .carousel-prev { left: 8px; }
  .carousel-next { right: 8px; }

  /* En el celular se pasa de foto deslizando; las flechas quedan chicas a los costados. */
  .lightbox-stage {
    padding: 0;
  }

  .lightbox-arrow {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.18);
    color: var(--white);
    box-shadow: none;
  }

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

  .section-heading {
    margin-top: 10px;
  }

  .site-footer {
    padding-top: 30px;
    flex-direction: column;
    text-align: center;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* En pantallas grandes, el contenido gana espacio y legibilidad. */
@media (min-width: 1500px) {
  .site-shell {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .nav-button {
    min-height: 82px;
    font-size: 1.35rem;
  }

  .presentation-text {
    font-size: 1.55rem;
  }

  .intro-panel h1 {
    font-size: 5rem;
  }
}
