/* =========================================================
   EL TIEMPO A LA DERIVA
========================================================= */

.drift-intro {
  width: 100%;
  max-width: 920px;
  margin: 0 auto 52px auto;
}

.drift-poster {
  width: min(760px, 100%);
  margin: 0 auto 38px auto;
}

.drift-poster img {
  width: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
}

/* =========================================================
   TEXTO PRINCIPAL
========================================================= */

.drift-text {
  max-width: 760px;
  margin: 0 auto;
  color: rgba(0,0,0,0.78);
}

.drift-text p {
  margin: 0 0 22px 0;

  font-size: var(--text-base);
  font-weight: 300;
  line-height: var(--leading-base);
  letter-spacing: var(--tracking-base);

  text-align: justify;
  text-justify: inter-word;

  hyphens: none;
  -webkit-hyphens: none;
  -ms-hyphens: none;

  word-break: normal;
  overflow-wrap: normal;
}

.drift-text strong,
.drift-text b {
  font-weight: 500;
}

/* =========================================================
   GALERÍA DE THUMBNAILS
========================================================= */

.drift-gallery-section {
  width: 100%;
  max-width: 980px;
  margin: 0 auto 58px auto;
}

.drift-thumb-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.drift-thumb-item {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

.drift-thumb-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
  opacity: 0.92;
  transition:
    opacity 0.28s ease,
    transform 0.32s ease;
}

.drift-thumb-item:hover img {
  opacity: 1;
  transform: scale(1.035);
}

.drift-thumb-item.is-active img {
  opacity: 0.5;
}

/* =========================================================
   CRÉDITOS
========================================================= */

.drift-credits {
  max-width: 760px;
  margin: 0 auto 42px auto;
  color: rgba(0,0,0,0.72);
}

.drift-credits p {
  margin: 0 0 20px 0;

  font-size: var(--text-caption);
  font-weight: 300;
  line-height: 1.22;
  letter-spacing: var(--tracking-small);

  text-align: justify;
  text-justify: inter-word;

  hyphens: none;
  -webkit-hyphens: none;
  -ms-hyphens: none;

  word-break: normal;
  overflow-wrap: normal;
}

.drift-credits strong,
.drift-credits b {
  font-weight: 500;
}

/* =========================================================
   BOTONES
========================================================= */

.drift-actions {
  max-width: 760px;
  margin: 0 auto 24px auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drift-video-btn,
.drift-external-link {
  display: block;
  width: fit-content;
  padding: 0;
  border: none;
  background: none;
  color: #00008b;
  text-decoration: none;
  cursor: pointer;

  font-family: var(--font-main);
  font-size: var(--text-base);
  font-weight: 300;
  line-height: var(--leading-base);
  letter-spacing: var(--tracking-base);
}

.drift-video-btn:hover,
.drift-external-link:hover {
  text-decoration: underline;
}

/* =========================================================
   MODAL
========================================================= */

.drift-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  background: rgba(0,0,0,0.95);
  padding: 18px;
}

.drift-modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.drift-modal-panel {
  position: relative;
  width: 96vw;
  height: 94vh;
  color: #ffffff;
  display: grid;
  grid-template-rows: 1fr auto;
  /*background: #050505;
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);*/
  overflow: hidden;
}

.drift-modal-content {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px 56px 22px 56px;
}

.drift-modal-media {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drift-modal-media iframe {
  width: 100%;
  max-width: 1180px;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
  background: #000000;
}

.drift-modal-media img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 82vh;
  display: block;
  object-fit: contain;
  object-position: center center;
}

/* CERRAR */

.drift-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 30;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

/* FLECHAS */

.drift-modal-arrow {
  position: absolute;
  top: 45%;
  z-index: 20;
  width: 38px;
  height: 54px;
  border: none;
  border-radius: 4px;
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.55;
}

.drift-modal-arrow:hover {
  opacity: 1;
  background: rgba(255,255,255,0.22);
}

.drift-modal-prev {
  left: 14px;
}

.drift-modal-next {
  right: 14px;
}

/* THUMBS MODAL */

.drift-modal-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 58px;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 56px 18px 56px;
  background: #050505;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.drift-modal-thumb {
  width: 58px;
  height: 58px;
  padding: 0;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  overflow: hidden;
  opacity: 0.55;
}

.drift-modal-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}

.drift-modal-thumb.is-active {
  opacity: 1;
  border-color: rgba(255,255,255,0.75);
  transform: translateY(-2px);
}

/* =========================================================
   TABLETA
========================================================= */

@media (max-width: 1024px) {
  .drift-thumb-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .drift-modal-panel {
    width: 97vw;
    height: 95vh;
  }
}

/* =========================================================
   MÓVIL
========================================================= */

@media (max-width: 768px) {
  .drift-poster {
    width: min(320px, 100%);
    margin-bottom: 30px;
  }

  .drift-text p {
    font-size: var(--text-base);
    font-weight: 300;
    line-height: var(--leading-base);
    letter-spacing: var(--tracking-small);

    text-align: justify;
    text-justify: inter-word;

    hyphens: none;
    -webkit-hyphens: none;
    -ms-hyphens: none;

    word-break: normal;
    overflow-wrap: normal;
  }

  .drift-gallery-section {
    margin-bottom: 42px;
  }

  .drift-thumb-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .drift-credits p {
    font-size: var(--text-caption);
    line-height: 1.22;
    letter-spacing: var(--tracking-small);
  }

  .drift-video-btn,
  .drift-external-link {
    font-size: var(--text-base);
    line-height: var(--leading-base);
    letter-spacing: var(--tracking-small);
  }

  .drift-modal {
    padding: 0;
    overflow-x: hidden;
  }

  .drift-modal-panel {
    width: 100%;
    height: 100svh;
    max-height: none;
    display: grid;
    grid-template-rows: 1fr auto auto;
    overflow-x: hidden;
  }

  .drift-modal-content {
    width: 100%;
    min-height: 0;
    padding: 48px 14px 8px 14px;
    overflow-x: hidden;
  }

  .drift-modal-media {
    width: 100%;
    min-height: 0;
    padding: 0 8px;
    align-items: center;
    overflow-x: hidden;
  }

  .drift-modal-media iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .drift-modal-media img {
    max-width: 100%;
    max-height: 72svh;
  }

  .drift-modal-close {
    top: 10px;
    right: 10px;
    width: 46px;
    height: 46px;
    font-size: 2rem;
  }

  .drift-modal-prev,
  .drift-modal-next {
    position: fixed;
    transform: none;
    bottom: 66px;
    z-index: 35;
  }

  .drift-modal-arrow {
    top: auto;
    width: 38px;
    height: 34px;
    font-size: 1.1rem;
  }

  .drift-modal-prev {
    left: 12px;
  }

  .drift-modal-next {
    right: 12px;
  }

  .drift-modal-thumbs {
    grid-auto-columns: 46px;
    gap: 7px;
    padding: 46px 12px 14px 12px;
    border-top: 1px solid rgba(255,255,255,0.12);
  }

  .drift-modal-thumb {
    width: 46px;
    height: 46px;
  }
}