/**
 * MBFF custom styles
 * Loaded after the theme styles (see functions.php), so rules here override the theme.
 */

/* Brand colors */
:root {
  --mbff-navy: #002756;
  --mbff-navy-dark: #001631;
  --mbff-navy-darker: #000c1c;
  --mbff-red: #b60000;
  --mbff-red-dark: #8f0000;
  --mbff-blue: #1e73be;
}

/* ==========================================================================
   Header
   ========================================================================== */

/* Keep the top menu on one line. While the web font is still loading the wider
   fallback font pushed "Donate to MBFF" onto a second row, doubling the header to 210px */
@media (min-width: 992px) {
  header.haru-main-header .haru-header-nav-wrap .header-navigation .menu-wrap .haru-main-menu {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  header.haru-main-header .haru-header-nav-wrap .header-navigation .menu-wrap .haru-main-menu .sub-menu {
    white-space: normal;
  }
}

/* Top-level menu links, at the top of the page and when sticky. The sticky
   selectors match the theme's sticky_light/sticky_dark rules so these win.
   Hover is on the li (like the theme) so the link stays blue over its dropdown */
header.haru-main-header .haru-header-nav-wrap .header-navigation .menu-wrap .haru-main-menu > li > a,
header.haru-main-header.header-sticky.sticky .haru-header-nav-wrap.nav-sticky .header-navigation .menu-wrap .haru-main-menu > li > a {
  color: var(--mbff-navy);
}

header.haru-main-header .haru-header-nav-wrap .header-navigation .menu-wrap .haru-main-menu > li:hover > a,
header.haru-main-header .haru-header-nav-wrap .header-navigation .menu-wrap .haru-main-menu > li > a:focus-visible,
header.haru-main-header.header-sticky.sticky .haru-header-nav-wrap.nav-sticky .header-navigation .menu-wrap .haru-main-menu > li:hover > a,
header.haru-main-header.header-sticky.sticky .haru-header-nav-wrap.nav-sticky .header-navigation .menu-wrap .haru-main-menu > li > a:hover,
header.haru-main-header.header-sticky.sticky .haru-header-nav-wrap.nav-sticky .header-navigation .menu-wrap .haru-main-menu > li > a:focus-visible {
  color: var(--mbff-blue);
}

/* ==========================================================================
   Headings (WPBakery Custom Heading)
   ========================================================================== */

/* Heading style 9: line behind the heading text */
.vc_custom_heading.heading_style_9:before {
  background-color: var(--mbff-red);
}

/* ==========================================================================
   Single film page
   ========================================================================== */

/* Header image */
.single-video.style_1 .single-video-thumbnail .video-image.ratio-169,
.single-video.style_2 .single-video-thumbnail .video-image.ratio-169 {
  padding-bottom: 40%;
}

/* Page background */
.single-video.style_2 {
  background-color: var(--mbff-navy-darker);
}

/* Style 2: the image/trailer is the top row inside the content container,
   so drop the theme's overlap and line its edges up with the content box */
.single-video.style_2 .single-video-content {
  margin-top: 0;
}

.single-video.style_2 .single-video-content .single-video-thumbnail {
  margin: 0;
}

/* Content box */
.single-video.style_1 .single-video-content .video-content-wrap,
.single-video.style_2 .single-video-content .video-content-wrap {
  padding: 40px;
}

.single-video.style_2 .single-video-content .video-content-wrap {
  background-color: var(--mbff-navy);
  box-shadow: none;
}

/* Sidebar */
.single-video.style_2 .single-video-content .video-information {
  border-left: 5px solid var(--mbff-red-dark);
}

/* Shared button styles: Buy Tickets + Watch Trailer */
.single-video .video-ticket-button,
.single-video .video-content-left .view-video-button {
  position: relative;
  display: inline-block;
  overflow: hidden;
  color: #fff !important;
  border: 0;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

/* Shine that sweeps across on hover */
.single-video .video-ticket-button::before,
.single-video .video-content-left .view-video-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}

.single-video .video-ticket-button:hover::before,
.single-video .video-content-left .view-video-button:hover::before {
  left: 125%;
}

.single-video .video-ticket-button:hover,
.single-video .video-ticket-button:focus-visible,
.single-video .video-content-left .view-video-button:hover,
.single-video .video-content-left .view-video-button:focus-visible {
  transform: translateY(-2px);
}

.single-video .video-ticket-button:active,
.single-video .video-content-left .view-video-button:active {
  transform: translateY(0);
}

.single-video .video-ticket-button:focus-visible,
.single-video .video-content-left .view-video-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Buy Tickets button: Watch Trailer style, in red */
.single-video .video-ticket-button {
  padding: 14px 34px;
  background-color: var(--mbff-red);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.single-video .video-ticket-button:hover,
.single-video .video-ticket-button:focus-visible {
  background-color: var(--mbff-red-dark);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.single-video .video-ticket-button:active {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* Buy Tickets + Watch Trailer row under the title */
.single-video .video-content-left .video-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 5px 0 25px;
}

.single-video .video-content-left .video-icon {
  display: flex;
}

/* Same size for both buttons in the row */
.single-video .video-content-left .video-ticket-button,
.single-video .video-content-left .view-video-button {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 10px;
  font-size: 9px;
  line-height: 1;
}

/* Watch Trailer button */
.single-video .video-content-left .view-video-button {
  background-color: var(--mbff-navy-dark);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* Play icon after the text */
.single-video .video-content-left .view-video-button::after {
  content: "";
  display: inline-block;
  margin-left: 10px;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent currentColor;
  transition: transform 0.3s ease;
}

.single-video .video-content-left .view-video-button:hover::after {
  transform: translateX(3px);
}

.single-video .video-content-left .view-video-button:hover,
.single-video .video-content-left .view-video-button:focus-visible {
  background-color: var(--mbff-navy-darker);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.single-video .video-content-left .view-video-button:active {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   Ticket redirect popup (see assets/js/mbff-custom.js)
   ========================================================================== */

.mbff-redirect {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 12, 28, 0.75);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mbff-redirect.is-open {
  opacity: 1;
  visibility: visible;
}

.mbff-redirect__box {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px 32px;
  background: var(--mbff-navy);
  border-top: 5px solid var(--mbff-red);
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  color: #fff;
  text-align: center;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.25s ease;
}

.mbff-redirect.is-open .mbff-redirect__box {
  transform: none;
}

.mbff-redirect__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--mbff-navy-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.mbff-redirect__title {
  margin: 0 0 10px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.mbff-redirect__text {
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}

/* 2 second progress bar */
.mbff-redirect__progress {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--mbff-navy-darker);
}

.mbff-redirect__progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--mbff-red);
}

.mbff-redirect.is-open .mbff-redirect__progress span {
  animation: mbff-redirect-progress 2s linear forwards;
}

@keyframes mbff-redirect-progress {
  to { width: 100%; }
}

/* Fallback button, only shown if the browser blocks the new window */
.mbff-redirect .mbff-redirect__continue {
  display: none;
  margin-top: 22px;
  padding: 12px 28px;
  background-color: var(--mbff-red);
  color: #fff;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: background-color 0.3s ease;
}

.mbff-redirect .mbff-redirect__continue:hover,
.mbff-redirect .mbff-redirect__continue:focus-visible {
  background-color: var(--mbff-red-dark);
  color: #fff;
}

.mbff-redirect .mbff-redirect__continue:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.mbff-redirect.is-blocked .mbff-redirect__continue {
  display: inline-block;
}

.mbff-redirect.is-blocked .mbff-redirect__progress {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .mbff-redirect,
  .mbff-redirect__box {
    transition: none;
  }
}

/* ==========================================================================
   Videos slideshow
   ========================================================================== */

/* Title/meta overlay: clear at the top, fading to navy at the bottom */
.video-slideshow-shortcode-wrapper.slick .video-list .video-item .video-image .video-meta {
  padding: 80px 20px 40px;
  text-align: left;
  background: linear-gradient(to bottom, rgba(0, 39, 86, 0), var(--mbff-navy-darker));
}

/* Left-align the text. The theme centers it with style-specific selectors, so match those */
.video-slideshow-shortcode-wrapper.slick .video-list .video-item.style_1 .video-image .video-meta,
.video-slideshow-shortcode-wrapper.slick .video-list .video-item.style_2 .video-image .video-meta,
.video-slideshow-shortcode-wrapper .video-list .video-item .video-meta .video-title,
.video-slideshow-shortcode-wrapper .video-list .video-item .video-meta .video-description {
  text-align: left;
}

/* Pin the overlay to the bottom edge so the gradient ends at the slide edge */
.video-slideshow-shortcode-wrapper.slick .video-list .video-item.style_2 .video-image .video-meta {
  bottom: 0;
}

/* Keep slide images at their own width instead of the theme's width: 100% */
.video-slideshow-shortcode-wrapper.slick .video-list .video-item.style_2 .video-image img {
  width: 885px;
}

/* Hide the slider dots */
.video-slideshow-shortcode-wrapper .slick-dots {
  display: none !important;
}

/* Description under the title (ACF homepage_feature_description or excerpt) */
.video-slideshow-shortcode-wrapper .video-meta .video-description {
  max-width: 640px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  line-height: 1.5;
}

.video-slideshow-shortcode-wrapper .video-meta .video-description p {
  margin: 0 0 10px;
}

.video-slideshow-shortcode-wrapper .video-meta .video-description p:last-child {
  margin-bottom: 0;
}

/* Red rule under the title */
.video-slideshow-shortcode-wrapper .video-meta h3.video-title {
  padding-bottom: 5px;
  border-bottom: 5px solid var(--mbff-red);
}

/* Release year after the title (ACF movie_release_year) */
.video-slideshow-shortcode-wrapper .video-meta .video-title .video-release-year {
  margin-left: 6px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.5em;
  font-weight: 400;
  letter-spacing: 1px;
  vertical-align: middle;
}

/* Read More + Buy Tickets row under the description */
.video-slideshow-shortcode-wrapper .video-meta .video-slide-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.video-slideshow-shortcode-wrapper .video-slide-actions .video-read-more,
.video-slideshow-shortcode-wrapper .video-slide-actions .video-ticket-button {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 18px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

/* Read More + Buy Tickets: white outline */
.video-slideshow-shortcode-wrapper .video-slide-actions .video-read-more,
.video-slideshow-shortcode-wrapper .video-slide-actions .video-ticket-button {
  color: #fff !important;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: transparent;
}

.video-slideshow-shortcode-wrapper .video-slide-actions .video-read-more:hover,
.video-slideshow-shortcode-wrapper .video-slide-actions .video-read-more:focus-visible,
.video-slideshow-shortcode-wrapper .video-slide-actions .video-ticket-button:hover,
.video-slideshow-shortcode-wrapper .video-slide-actions .video-ticket-button:focus-visible {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

/* ==========================================================================
   Film calendar ([mbff_film_calendar] shortcode, see functions.php)
   ========================================================================== */

/* One column per day; scrolls sideways if the columns don't fit */
.mbff-film-calendar {
  display: grid;
  grid-template-columns: repeat(var(--mbff-calendar-days, 7), minmax(160px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.mbff-film-calendar__day {
  background: #fff;
  border: 1px solid rgba(0, 39, 86, 0.15);
}

.mbff-film-calendar__date {
  margin: 0;
  padding: 12px;
  background: var(--mbff-navy);
  color: #fff;
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-align: center;
}

.mbff-film-calendar__films {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mbff-film-calendar__film {
  border-bottom: 1px solid rgba(0, 39, 86, 0.1);
}

.mbff-film-calendar__film:last-child {
  border-bottom: 0;
}

/* The whole item (title + time) is the link */
.mbff-film-calendar__link {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.mbff-film-calendar__link:hover,
.mbff-film-calendar__link:focus {
  background-color: rgba(0, 39, 86, 0.06);
  text-decoration: none;
}

.mbff-film-calendar__title {
  display: block;
  color: var(--mbff-navy);
  font-weight: 700;
  line-height: 1.3;
}

.mbff-film-calendar__link:hover .mbff-film-calendar__title,
.mbff-film-calendar__link:focus .mbff-film-calendar__title {
  color: var(--mbff-red);
}

.mbff-film-calendar__time {
  display: block;
  margin-top: 4px;
  color: var(--mbff-red);
  font-size: 14px;
}

.mbff-film-calendar__empty {
  margin: 0;
  padding: 10px 12px;
  color: #777;
  font-style: italic;
}

/* Phones: stack the days */
@media (max-width: 767px) {
  .mbff-film-calendar {
    grid-template-columns: 1fr;
  }
}
