/* ====== VARIABLES DE COLOR ====== */
:root {
  --color-bg-primary: #FFFFFF;
  --color-bg-secondary: #0D1B2A;
  --color-text-primary: #0D1B2A;
  --color-text-inverted: #FFFFFF;
  --color-accent: #FF6B35;
  --site-header-height: 70px; /* altura navbar para calcular viewport disponible */
  --app-vh: 100vh; /* se recalcula via JS para Safari */

  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* ====== TIPOGRAFÍA ====== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Space+Grotesk:wght@400;600;700&display=swap');

body {
  font-family: var(--font-body);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  margin: 0;
  padding: 0;
  padding-top: 70px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

footer {
  flex-shrink: 0;
}

/* ====== FOOTER ICONS ====== */
footer i {
  color: white;
}

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

h1, h2, h3, h4, h5 {
  color: var(--color-text-primary);
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ====== BOTONES ====== */
.button {
  background-color: var(--color-accent);
  color: var(--color-text-inverted);
  border: none;
  padding: 12px 24px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.button--secondary {
  background-color: transparent;
  color: var(--color-text-inverted);
  border: 2px solid rgba(255, 255, 255, 0.8);
  transition: border-color 0.3s ease, color 0.3s ease, background-color 0.3s ease;
}

.button--secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
}

/* ====== SECCIONES ====== */
section {
  padding: 60px 20px;
}

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: clamp(520px, 56.25vw, 100vh);
  padding: clamp(120px, 16vh, 200px) clamp(40px, 10vw, 190px) clamp(72px, 14vh, 160px);
  color: var(--color-text-inverted);
  background-color: var(--color-bg-secondary);
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero__video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  aspect-ratio: 16 / 9;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 0;
}

.hero__video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  pointer-events: none;
}

/* ================= HERO FIT (ajusta a viewport menos navbar) ================= */
.hero--fit {
  height: calc(var(--app-vh) - var(--site-header-height));
  min-height: calc(var(--app-vh) - var(--site-header-height));
}

/* Ajuste del vídeo para que siempre llene vertical y solo recorte por los lados */
.hero--fit .hero__video {
  height: 100%;
  width: auto;
  min-width: 100%;
  aspect-ratio: auto;
}

@media (max-width: 767px) {
  .hero--fit {
    height: calc(var(--app-vh) - var(--site-header-height));
    min-height: calc(var(--app-vh) - var(--site-header-height));
    padding: calc(var(--site-header-height) + 16px) 16px 24px; /* compensar navbar + algo de respiro */
  }

  .hero--fit .hero__content {
    margin-bottom: 0;
  }

  .hero--fit .hero__text {
    max-height: 100%;
  }

  /* Forzar que el vídeo llene en vertical y recorte solo por los lados (sin barras negras) */
  .hero--fit .hero__video {
    height: 100%;
    width: calc((var(--app-vh) - var(--site-header-height)) * 16 / 9); /* ancho proporcional a la altura disponible */
    min-width: 100vw; /* aseguramos cobertura mínima horizontal */
  }

  /* Fallback si por cualquier razón el cálculo no cubre: ligera ampliación extra */
  .no-calc .hero--fit .hero__video {
    width: 180vw;
  }
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 27, 42, 0.26) 0%, rgba(13, 27, 42, 0.5) 62%, rgba(13, 27, 42, 0.74) 100%);
  mix-blend-mode: multiply;
}

.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: clamp(320px, 42vw, 560px);
  margin-left: auto;
  margin-right: clamp(24px, 6vw, 130px);
  margin-bottom: clamp(24px, 10vh, 120px);
}

.hero__text {
  max-width: 100%;
  text-align: left;
  padding: clamp(22px, 5vw, 34px);
  border-radius: 18px;
  /* Más transparente aún */
  background: linear-gradient(150deg, rgba(13, 27, 42, 0.25) 0%, rgba(13, 27, 42, 0.08) 100%);
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 18px 60px rgba(13, 27, 42, 0.32);
}

.hero__text h1 {
  color: var(--color-accent);
  font-size: clamp(2.15rem, 4.2vw, 3rem);
  line-height: 1.15;
  text-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  margin-bottom: clamp(18px, 4vw, 26px);
}

.hero__text p {
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  margin-bottom: clamp(22px, 5vw, 32px);
}

.hero__actions {
  display: flex;
  gap: clamp(16px, 2.6vw, 22px);
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

.hero__content .button {
  min-width: 180px;
}

@media (max-width: 767px) {
  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(84px, 16vh, 120px) 20px 28px;
    align-items: flex-end;
  }

  .hero__overlay {
    background: linear-gradient(180deg, rgba(13, 27, 42, 0.36) 0%, rgba(13, 27, 42, 0.68) 100%);
  }

  .hero__content {
    max-width: 100%;
    margin: 0 auto 0;
    padding: 0 10px;
  }

  .hero__text {
    text-align: center;
    /* Versión móvil aún más ligera para que se vea más el video */
    background: linear-gradient(160deg, rgba(13, 27, 42, 0.30) 0%, rgba(13, 27, 42, 0.12) 100%);
    padding: clamp(20px, 5.5vw, 26px) clamp(16px, 4.5vw, 22px);
    border-radius: 16px;
    margin: 0 auto;
    max-width: min(360px, 100%);
  }

  .hero__text h1 {
    font-size: clamp(1.7rem, 6.4vw, 2.2rem);
  }

  .hero__text p {
    font-size: clamp(0.9rem, 3.8vw, 1.05rem);
  }

  .hero__actions {
    justify-content: center;
    gap: 16px;
  }

  .hero__content .button {
    min-width: 140px;
  }

  .hero__video {
    width: auto;
    min-width: 100vw;
    height: 100dvh;
  }

}

@media (max-width: 991px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(48px, 12vh, 96px) clamp(24px, 8vw, 96px) clamp(28px, 10vh, 72px);
    align-items: flex-end;
    justify-content: flex-end;
  }

  .hero__content {
    max-width: clamp(260px, 48vw, 392px);
    margin: 0 clamp(18px, 7vw, 70px) clamp(16px, 10vh, 54px);
  }

  .hero__text {
    padding: 14px clamp(14px, 3.2vw, 20px);
  }

  .hero__text h1 {
    font-size: clamp(1.55rem, 2.9vw, 2rem);
  }

  .hero__text p {
    font-size: clamp(0.86rem, 2vw, 1.02rem);
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__video {
    width: auto;
    min-width: 100vw;
    height: 100vh;
  }

}

@media (prefers-reduced-motion: reduce) {
  .hero__media {
    display: none;
  }

  .hero {
    background-image: linear-gradient(160deg, rgba(13, 27, 42, 0.9), rgba(13, 27, 42, 0.75));
  }
}

.section-dark {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-inverted);
}

.section-dark h1, .section-dark h2, .section-dark h3 {
  color: var(--color-text-inverted);
}

/* ====== NAVBAR ====== */
.navbar-brand {
  padding: 0;
}

.navbar-brand img {
  margin: 0;
  display: block;
  height: 56px; /* default desktop size */
  width: auto;
}

@media (max-width: 767px) {
  .navbar-brand img {
    height: 44px; /* smaller on mobile */
  }
}

/* ====== SERVICE CARDS ====== */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.service-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.service-card .card-text {
    display: none;
    text-align: center;
    margin-top: 1rem;
}

.service-card:hover .card-text {
    display: block;
}

/* ====== FORMATIONS AND FILMS ====== */
.formations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 2rem;
  margin-bottom: 2rem;
}

.formation-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0 1rem;
  align-items: start;
}

.formation-year {
  text-align: right;
  padding-right: 1rem;
}

.formation-desc {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.formation-year {
    font-weight: bold;
    color: var(--color-text-primary);
    text-align: right;
    padding-right: 1rem;
}

.formation-desc {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.formation-desc i {
    color: var(--color-accent);
    font-size: 1.2rem;
}

/* Highlight ECAM degree */
.ecam-degree .formation-desc span {
  font-weight: 700;
  color: var(--color-accent);
  background: rgba(255,107,53,0.08);
  padding: 6px 10px;
  border-radius: 6px;
}

.film-grid .film-item {
    text-align: center;
}

.film-caption {
    line-height: 1.4;
}

/* ====== PORTAFOLIO ====== */
.portfolio-intro {
  max-width: 720px;
  margin: 0 auto clamp(24px, 5vw, 38px);
}

.portfolio-intro p {
  color: rgba(13, 27, 42, 0.7);
  margin-bottom: 0;
}

.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: clamp(24px, 4vw, 36px);
}

.filter-btn {
  border-radius: 999px;
  padding: 0.45rem 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.filter-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(13, 27, 42, 0.08);
}

.filter-btn.active,
.filter-btn:focus-visible {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  box-shadow: 0 12px 25px rgba(255, 107, 53, 0.35);
}

.portfolio-gallery {
  display: grid;
  gap: clamp(20px, 4vw, 32px);
  grid-template-columns: minmax(0, 1fr);
}

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

.portfolio-item {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.portfolio-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 35px rgba(13, 27, 42, 0.12);
}

.portfolio-item[data-category="reel"] {
  grid-column: 1 / -1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.portfolio-item.is-hidden {
  display: none !important;
}

.media-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(13, 27, 42, 0.08);
  padding: clamp(16px, 3vw, 28px);
  box-shadow: 0 12px 30px rgba(13, 27, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 3vw, 24px);
}

.media-card--reel {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}


.media-card__frame--reel {
  position: relative;
}

.player-control {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #fff;
  background: rgba(13, 27, 42, 0.78);
  box-shadow: 0 12px 28px rgba(13, 27, 42, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  z-index: 3;
  font-size: 1.05rem;
}

/* Play button overlay (center) — smaller and consistent with side controls */
.player-play {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(13,27,42,0.35);
  font-size: 1.05rem;
  background: rgba(0,0,0,0.82) !important;
  backdrop-filter: blur(4px) saturate(140%);
  -webkit-backdrop-filter: blur(4px) saturate(140%);
}

.player-play span[aria-hidden="true"] {
  transform: translateX(2px); /* slightly move the triangle for optical centering */
}
/* SVG outline triangle inside play button */
.player-play svg.player-play__icon {
  width: 26px;
  height: 26px;
  display: block;
}

.player-play svg.player-play__icon path {
  fill: rgba(255,255,255,0.04);
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.55));
}

.player-play:hover,
.player-play:focus-visible {
  background: rgba(0,0,0,0.9) !important;
  box-shadow: 0 14px 34px rgba(13,27,42,0.5);
}

/* Center the play overlay inside the video container */
.player-overlay.player-play {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  right: auto;
}

.player-control span[aria-hidden="true"] {
  line-height: 1;
}

.player-control:hover,
.player-control:focus-visible {
  transform: translateY(-1px);
  background: rgba(13, 27, 42, 0.88);
  box-shadow: 0 16px 32px rgba(13, 27, 42, 0.32);
}

.player-fullscreen,
.player-sound {
  top: clamp(18px, 4vw, 30px);
}

.player-fullscreen {
  right: clamp(18px, 4vw, 30px);
}

.player-sound {
  right: calc(clamp(18px, 4vw, 30px) + 52px);
}

.player-sound[data-state="muted"] {
  background: rgba(255, 107, 53, 0.78);
  box-shadow: 0 14px 30px rgba(255, 107, 53, 0.32);
}

.player-sound[data-state="unmuted"] {
  background: rgba(13, 27, 42, 0.8);
}

.player-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.player-icon--text {
  font-size: inherit;
  line-height: 1;
}

.player-icon--sound path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.player-icon--sound .player-icon__speaker {
  stroke-linejoin: round;
}

.player-icon--sound .player-icon__wave,
.player-icon--sound .player-icon__slash {
  transition: opacity 0.2s ease;
}

.player-icon--sound .player-icon__slash {
  opacity: 0;
}

.player-sound[data-state="muted"] .player-icon__slash {
  opacity: 1;
}

.player-sound[data-state="muted"] .player-icon__wave {
  opacity: 0;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: radial-gradient(circle at center, rgba(13, 27, 42, 0.55) 0%, rgba(13, 27, 42, 0.05) 60%, rgba(13, 27, 42, 0) 100%);
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(2.75rem, 8vw, 4.75rem);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, opacity 0.25s ease;
  z-index: 2;
  /* Hidden by default; shown only when .is-paused is present */
  opacity: 0;
  pointer-events: none;
}

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

.player-overlay:not(.is-paused) {
  background: rgba(13, 27, 42, 0);
  color: rgba(255, 255, 255, 0);
}

/* When explicitly paused, show the overlay (play button) */
.player-overlay.is-paused {
  opacity: 1;
  pointer-events: auto;
}

.player-overlay:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 4px;
}

/* ====== AUDIO HINT (autoplay reel) ====== */

.media-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

@media (min-width: 576px) {
  .media-card__header {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
  }
}

.media-card__tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--color-accent);
}

.media-card__title {
  margin: 0;
  font-size: clamp(1.25rem, 2.3vw, 1.65rem);
  color: var(--color-text-primary);
}

.media-card__description {
  margin: 0;
  color: rgba(13, 27, 42, 0.7);
}

.media-card__frame {
  position: relative;
  width: 100%;
}

.media-card__frame iframe,
.media-card__frame img {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  background: #0D1B2A;
  margin: 2rem 0;
}

.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Permitir que los clics lleguen al contenedor para pausar/reanudar y no bloquear botones superpuestos */
  pointer-events: none;
}

.media-card--reel .video-container {
  margin: 0;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(13, 27, 42, 0.22);
}

/* Vimeo placeholder (poster) used while iframe is created lazily */
.vimeo-placeholder {
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 */
  background-size: cover;
  background-position: center center;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.vimeo-placeholder.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13,27,42,0.04), rgba(13,27,42,0.08));
}
.vimeo-placeholder iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Make poster image fill and crop exactly like the iframe */
.vimeo-placeholder .vimeo-poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vimeo-placeholder .vimeo-poster-img {
  transition: opacity 240ms ease-in-out;
}

/* Letterbox bars on the poster to mimic player's black bars. Adjust --bar-size as needed. */
.vimeo-placeholder{
  --bar-size: 9%; /* tweak this to match the visible black bars of the player */
}
.vimeo-placeholder::before,
.vimeo-placeholder::after{
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: var(--bar-size);
  background: #000;
  z-index: 2; /* above poster image */
  pointer-events: none;
  border-radius: 12px; /* match placeholder rounding so corners are black too */
}
.vimeo-placeholder::before{ top: 0; }
.vimeo-placeholder::after{ bottom: 0; }

/* Slight fade for the bars when poster fades */
.vimeo-placeholder::before,
.vimeo-placeholder::after{
  transition: opacity 240ms ease-in-out;
}

/* When poster is being removed, fade the bars too */
.vimeo-placeholder.poster-hidden::before,
.vimeo-placeholder.poster-hidden::after{
  opacity: 0;
}

/* Re-usable letterbox overlay for images (top+bottom black bars). */
.letterbox{
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  --bar-size: 9%;
}
.letterbox img{
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}
.letterbox::before,
.letterbox::after{
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: var(--bar-size);
  background: #000;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  transition: opacity 240ms ease-in-out;
}
.letterbox::before{ top: 0; }
.letterbox::after{ bottom: 0; }

.media-card__frame--image {
  border-radius: 14px;
  overflow: hidden;
  background: #111;
  aspect-ratio: 16 / 9;
  box-shadow: inset 0 0 0 1px rgba(13, 27, 42, 0.08);
}

.media-card__frame--image img {
  object-fit: cover;
}

#reel {
  scroll-margin-top: 110px;
}

/* WhatsApp uses standard Bootstrap button styles (btn btn-outline-primary) */

/* ====== BOTÓN WHATSAPP VERDE ====== */
.btn-whatsapp {
  --bs-btn-color: #25D366;
  --bs-btn-bg: transparent;
  --bs-btn-border-color: #25D366;
  color: #25D366 !important;
  border-color: rgba(37,211,102,0.15) !important;
}
.btn-whatsapp i {
  color: #25D366;
}
.btn-whatsapp:hover, .btn-whatsapp:focus {
  background-color: rgba(37,211,102,0.06);
  color: #1aa44a !important;
  border-color: rgba(37,211,102,0.25) !important;
}

/* Responsive adjustments for About page */
@media (max-width: 767px) {
  .formations-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem 0;
  }
  .formation-year {
    text-align: left;
    padding-right: 0;
  }
  .img-fluid.rounded-circle {
    width: 160px !important;
    height: 160px !important;
  }
}