/* =========================
   BASE
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1f4d77;
  --primary-dark: #163a59;
  --accent: #e0822f;
  --white: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --bg: #f8fbff;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* =========================
   HERO
========================= */
.hero {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 32%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.16), transparent 35%),
    linear-gradient(135deg, #1f4d77, #e0822f);
  color: var(--white);
  padding: 100px 8%;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin-bottom: 15px;
  font-weight: 800;
}

.hero p {
  max-width: 850px;
  margin: 0 auto;
  opacity: 0.9;
  font-size: 1.05rem;
}

.hero {
  position: relative;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.18), transparent 26%),
    radial-gradient(circle at 85% 75%, rgba(224, 130, 47, 0.75), transparent 34%),
    linear-gradient(135deg, #1f4d77 0%, #1f4d77 45%, #2d6f9f 68%, #e0822f 100%);
  color: var(--white);
  padding: 120px 8% 100px;
  text-align: center;
}

.hero-logo {
  position: absolute;
  top: 28px;
  left: 8%;
  z-index: 2;
}

.hero-logo img {
  width: 220px;
  height: auto;
  display: block;
}

/* =========================
   GALERÍA
========================= */
.gallery {
  padding: 80px 8%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

/* =========================
   CARD
========================= */
.card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 28px 55px rgba(0, 0, 0, 0.16);
}

/* =========================
   IMAGEN / PREVIEW
========================= */
.thumb {
  height: 180px;
  overflow: hidden;
  background: #e2e8f0;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.card:hover .thumb img {
  transform: scale(1.05);
}

/* =========================
   CONTENIDO
========================= */
.card-content {
  padding: 25px;
  text-align: center;
}

.card h3 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1.25rem;
  font-weight: 800;
}

.card p {
  color: #555;
  margin-bottom: 18px;
  font-size: 0.96rem;
}

/* =========================
   BOTÓN
========================= */
.btn {
  background: var(--accent);
  color: var(--white);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  display: inline-block;
  transition: transform 0.2s ease, background 0.2s ease;
}

.card:hover .btn {
  transform: scale(1.04);
  background: #c96f24;
}

/* =========================
   MODAL
========================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 999;
}

.modal.active {
  display: flex;
}

.modal-content {
  width: min(1200px, 96vw);
  height: min(760px, 86vh);
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.modal iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* CERRAR MODAL */
.close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: var(--white);
  font-size: 30px;
  line-height: 38px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s ease, transform 0.2s ease;
}

.close:hover {
  background: var(--accent);
  transform: rotate(90deg);
}

/* =========================
   ANIMACIÓN
========================= */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   FOOTER
========================= */
.footer {
  background: var(--primary);
  color: var(--white);
  text-align: center;
  padding: 20px 8%;
  font-size: 0.95rem;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
  .hero {
    padding: 80px 6%;
  }

  .gallery {
    padding: 55px 6%;
    gap: 24px;
  }

  .thumb {
    height: 165px;
  }

  .card-content {
    padding: 22px;
  }

  .modal {
    padding: 12px;
  }

  .modal-content {
    width: 100%;
    height: 82vh;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 70px 6%;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 0.98rem;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .thumb {
    height: 155px;
  }

  .modal-content {
    height: 78vh;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 110px 6% 75px;
  }

  .hero-logo {
    top: 22px;
    left: 6%;
  }

  .hero-logo img {
    width: 135px;
  }
}