/*
 * Hand-edited site overrides.
 *
 * This file is loaded after `assets/styles/tailwind-output.css`,
 * so developers can make normal CSS changes here without running
 * the Tailwind/PostCSS build.
 *
 * Use this file for:
 * - spacing fixes
 * - z-index / positioning fixes
 * - typography tweaks
 * - component-specific overrides
 *
 * A build is only required when markup introduces new Tailwind
 * utility classes that do not already exist in `tailwind-output.css`.
 */

/* YouTube playlist lightbox */
.ytp-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ytp-modal.open {
  display: flex;
}

.ytp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.ytp-frame-wrap {
  position: relative;
  z-index: 1;
  width: min(92vw, 70rem);
  max-height: calc(100vh - 2rem);
  aspect-ratio: 16 / 9;
  background: #000;
}

.ytp-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
}

.ytp-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  background: none;
  border: 0;
  cursor: pointer;
}

@media (max-width: 767px) {
  .ytp-modal {
    padding: 0.75rem;
  }

  .ytp-frame-wrap {
    width: 100%;
    max-height: calc(100vh - 1.5rem);
  }

  .ytp-close {
    top: -2rem;
  }
}

/* More Things to See exhibit cards */
.more-tiles .filter-result-wrapper {
  padding: 5vw 0.625vw 0;
}

.more-tiles .filter-tile {
  padding: 0 0.625vw;
  margin-bottom: 2.5vw;
}

.more-tiles .filter-tile .image-card {
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.more-tiles .filter-tile .image-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.more-tiles .tile-title {
  font-size: var(--text-2xl);
  padding: 1.25vw 0 0;
  min-height: auto;
}

@media (min-width: 768px) {
  .more-tiles .filter-tile.tile-2-7 {
    width: calc(2 / 7 * 100%);
    flex: 0 0 calc(2 / 7 * 100%);
    max-width: calc(2 / 7 * 100%);
  }

  .more-tiles .filter-tile.tile-3-7 {
    width: calc(3 / 7 * 100%);
    flex: 0 0 calc(3 / 7 * 100%);
    max-width: calc(3 / 7 * 100%);
  }
}

/* Pixar hero mobile crop */
@media (max-width: 767px) {
  .component-pixar video {
    object-position: 40% center;
  }
}

/* Explore mobile filter toggle */
.explore-app .explore-filter-toggle {
  display: none;
}

@media (max-width: 767px) {
  .explore-app .explore-inner {
    grid-template-areas: "title num" "toggle toggle" "filters filters";
  }

  .explore-app .explore-filter-toggle {
    display: inline-flex;
    grid-area: toggle;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    cursor: pointer;
  }

  .explore-app .explore-filter-toggle[aria-expanded='false'] {
    background: #000;
    color: #fff;
  }
}

/* Pendulum desktop containment */
@media (min-width: 768px) {
  #pendulum-graphicWrapper {
    overflow-y: hidden;
  }
}

/* Mobile nav overflow and submenu containment */
@media (max-width: 767px) {
  #primary-menu.main-nav {
    top: var(--site-header-offset, 120px) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: calc(100dvh - var(--site-header-offset, 120px)) !important;
    align-content: start !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  #primary-menu.main-nav.submenu-active {
    overflow: hidden !important;
  }

  #primary-menu .nav-dropmenu {
    display: none !important;
  }

  #primary-menu .primary-nav-item.is-submenu-host > .nav-dropmenu {
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 1203 !important;
  }

  #primary-menu .primary-nav-item.is-submenu-host > .nav-dropmenu > .mobile-submenu {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    min-height: auto !important;
    height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding-bottom: calc(7.5rem + env(safe-area-inset-bottom)) !important;
  }
}

/* Calendar ongoing events */
.calendar-ongoing[hidden] {
  display: none !important;
}

.calendar-ongoing {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid #000;
}

.calendar-ongoing-label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #555;
}

.calendar-ongoing-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.calendar-ongoing-item {
  display: flex;
  flex: 1 1 18rem;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.875rem 1rem;
  border: 1px solid #000;
  color: inherit;
  text-decoration: none;
  background: #fff;
}

.calendar-ongoing-item:hover {
  color: inherit;
}

.calendar-ongoing-dot {
  width: 0.75rem;
  height: 0.75rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  flex: none;
  background: #ffb364;
}

.calendar-ongoing-dot--afterdark {
  background: #00b39f;
}

.calendar-ongoing-copy {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.calendar-ongoing-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.15;
  text-transform: uppercase;
}

.calendar-ongoing-meta {
  font-size: 0.875rem;
  line-height: 1.35;
  color: #444;
}

@media (max-width: 1023px) {
  .calendar-ongoing {
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .calendar-ongoing-item {
    flex-basis: 100%;
    padding: 0.75rem 0.875rem;
  }

  .calendar-ongoing-title {
    font-size: 0.95rem;
  }

  .calendar-ongoing-meta {
    font-size: 0.8125rem;
  }
}
