/*
Theme Name: Cinematic Hero Theme
Theme URI: https://zuoxiaoning.com
Author: Zuoning Wang
Author URI: https://zuoxiaoning.com
Description: Immersive, full-screen cinematic video hero section with liquid-glass effects, fully customizable from the admin dashboard. Supports Custom Post Type "Cinematic Slides" with ACF field integration for dynamic slide content management.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cinematic-hero
Tags: cinematic, video-background, responsive, layout-animations, full-viewport, premium-glass, custom-post-type, acf
*/


/*
 * Layout uses a small local utility layer plus custom cinematic components.
 * Liquid-glass border effect, responsive sizing, and animations live in this stylesheet.
 */

/* ─── Reset & Base ─── */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #050505;
  color: #fff;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

/* ─── Local Utility Layer (replaces Tailwind Play CDN for this theme) ─── */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { inset: 0; }
.inset-x-0 { left: 0; right: 0; }
.inset-y-0 { top: 0; bottom: 0; }
.top-0 { top: 0; }
.top-1\/2 { top: 50%; }
.bottom-0 { bottom: 0; }
.right-0 { right: 0; }
.right-4 { right: 1rem; }
.left-5 { left: 1.25rem; }
.-top-12 { top: -3rem; }
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.z-\[150\] { z-index: 150; }
.z-\[200\] { z-index: 200; }
.mx-auto { margin-inline: auto; }
.mx-4 { margin-inline: 1rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-10 { margin-bottom: 2.5rem; }
.flex { display: flex; }
.hidden { display: none; }
.block { display: block; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }
.h-2\.5 { height: 0.625rem; }
.h-5 { height: 1.25rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.w-2\.5 { width: 0.625rem; }
.w-5 { width: 1.25rem; }
.w-8 { width: 2rem; }
.w-9 { width: 2.25rem; }
.w-full { width: 100%; }
.w-screen { width: 100vw; }
.max-w-md { max-width: 28rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-7xl { max-width: 80rem; }
.max-h-\[50vh\] { max-height: 50vh; }
.shrink-0 { flex-shrink: 0; }
.select-none { user-select: none; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.object-cover { object-fit: cover; }
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }
.cursor-pointer { cursor: pointer; }
.rounded-full { border-radius: 9999px; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.bg-black { background: #000; }
.bg-white { background: #fff; }
.bg-white\/80 { background: rgba(255,255,255,0.8); }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-black { color: #000; }
.text-white { color: #fff; }
.text-white\/30 { color: rgba(255,255,255,0.3); }
.text-white\/40 { color: rgba(255,255,255,0.4); }
.text-white\/50 { color: rgba(255,255,255,0.5); }
.text-white\/60 { color: rgba(255,255,255,0.6); }
.text-white\/75 { color: rgba(255,255,255,0.75); }
.text-white\/80 { color: rgba(255,255,255,0.8); }
.text-white\/90 { color: rgba(255,255,255,0.9); }
.text-\[10px\] { font-size: 10px; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.font-sans { font-family: inherit; }
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.leading-relaxed { line-height: 1.625; }
.leading-snug { line-height: 1.375; }
.tracking-tight,
.tracking-wide,
.tracking-widest { letter-spacing: 0; }
.shadow-lg { box-shadow: 0 10px 24px rgba(0,0,0,0.24); }
.transition-all { transition: all 0.2s ease; }
.focus\:outline-none:focus { outline: none; }
.hover\:bg-gray-100:hover { background: #f3f4f6; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pt-24 { padding-top: 6rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pl-14 { padding-left: 3.5rem; }
.pr-6 { padding-right: 1.5rem; }
.-translate-y-1\/2 { transform: translateY(-50%); }

@media (min-width: 640px) {
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:gap-4 { gap: 1rem; }
}

@media (min-width: 768px) {
  .md\:flex-row { flex-direction: row; }
  .md\:w-auto { width: auto; }
  .md\:max-w-2xl { max-width: 42rem; }
  .md\:justify-end { justify-content: flex-end; }
  .md\:px-12 { padding-left: 3rem; padding-right: 3rem; }
  .md\:py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  .md\:mb-6 { margin-bottom: 1.5rem; }
  .md\:mb-10 { margin-bottom: 2.5rem; }
}

@media (min-width: 1024px) {
  .lg\:hidden { display: none; }
  .lg\:flex { display: flex; }
}

@media (max-width: 1023px) {
  .lg\:hidden { display: flex; }
}

@media (min-width: 1280px) {
  .xl\:gap-2 { gap: 0.5rem; }
}

#cinematic-showcase-app {
  height: 100dvh;
  min-height: 100svh;
  background: #050505;
  letter-spacing: 0;
}

#cinematic-showcase-app * {
  letter-spacing: 0;
}

.admin-bar #cinematic-showcase-app {
  height: calc(100dvh - 32px);
}

/* ─── WP Custom Logo ─── */
.cinematic-logo-img .custom-logo-link img {
  max-height: clamp(28px, 3vw, 34px);
  width: auto;
  filter: brightness(1) drop-shadow(0 1px 4px rgba(0,0,0,0.5));
}

/* ─── Motion & Glass ─── */
@keyframes blurFadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.animate-blur-fade-up {
  opacity: 0;
  animation: blurFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.liquid-glass {
  background: rgba(255, 255, 255, 0.03);
  background-blend-mode: luminosity;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.4px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.45) 0%,
    rgba(255,255,255,0.15) 20%,
    rgba(255,255,255,0) 40%,
    rgba(255,255,255,0) 60%,
    rgba(255,255,255,0.15) 80%,
    rgba(255,255,255,0.45) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.scale-102 {
  transform: scale(1.02);
}

.slide-transition {
  animation: blurFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

.animate-pulse {
  animation: pulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

::-webkit-scrollbar {
  display: none;
}

/* ─── Header & Navigation ─── */
.cinematic-site-title {
  display: inline-block;
  max-width: min(42vw, 18rem);
  overflow: hidden;
  color: #fff;
  font-size: clamp(0.68rem, 0.56rem + 0.32vw, 0.9rem);
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cinematic-menu-link,
.cinematic-menu-btn,
.cinematic-menu-sub-link {
  color: rgba(255,255,255,0.74);
  font-size: clamp(0.76rem, 0.72rem + 0.14vw, 0.86rem) !important;
  font-weight: 700 !important;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.cinematic-menu-link:hover,
.cinematic-menu-btn:hover,
.cinematic-menu-sub-link:hover,
.cinematic-menu-link:focus-visible,
.cinematic-menu-btn:focus-visible,
.cinematic-menu-sub-link:focus-visible {
  color: #fff;
}

.cinematic-menu-parent {
  position: relative;
}

.cinematic-menu-btn {
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  outline: none;
  padding: 7px 13px;
}

.cinematic-menu-link {
  border-radius: 6px;
  padding: 7px 13px;
}

.cinematic-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 100;
  min-width: 170px;
  padding: 6px 0;
  border-radius: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.cinematic-menu-parent:hover .cinematic-menu-dropdown,
.cinematic-menu-parent:focus-within .cinematic-menu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cinematic-menu-sub-link {
  display: block;
  margin: 0 4px;
  border-radius: 4px;
  padding: 7px 16px;
}

.cinematic-menu-sub-link:hover,
.cinematic-menu-sub-link:focus-visible {
  background: rgba(255,255,255,0.08);
}

.menu-arrow {
  margin-left: 2px;
  font-size: 10px;
  opacity: 0.6;
}

.cinematic-search-button {
  min-height: 38px;
  font-weight: 700;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.cinematic-search-button:hover {
  background: rgba(255,255,255,0.08);
}

.cinematic-search-button:active,
.cinematic-control-btn:active,
.cinematic-mobile-menu-toggle:active {
  transform: translateY(1px) scale(0.98);
}

.cinematic-mobile-menu-toggle {
  min-width: 38px;
  min-height: 38px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

#cinematic-mobile-menu {
  display: none;
  margin: 0 auto;
  width: calc(100% - 2rem);
  max-width: 48rem;
  border-radius: 12px;
  padding: 0.5rem;
}

#cinematic-mobile-menu.is-open {
  display: block;
}

.cinematic-mobile-menu-link {
  display: block;
  border-radius: 8px;
  padding: 0.78rem 0.9rem;
  color: rgba(255,255,255,0.82);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.cinematic-mobile-menu-link:hover,
.cinematic-mobile-menu-link:focus-visible {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.cinematic-mobile-menu-link-depth-1 {
  padding-left: 1.5rem;
  color: rgba(255,255,255,0.68);
}

.cinematic-mobile-menu-link-depth-2 {
  padding-left: 2.1rem;
  color: rgba(255,255,255,0.62);
}

/* ─── Hero Layout ─── */
.cinematic-main-inner {
  padding-bottom: clamp(4rem, 9vh, 5.8rem);
}

.cinematic-hero-layout {
  gap: clamp(1.5rem, 5vw, 6rem);
}

.cinematic-hero-copy {
  max-width: min(44rem, 100%);
}

.cinematic-hero-meta {
  gap: clamp(0.5rem, 1.2vw, 1.15rem);
  font-size: clamp(0.72rem, 0.66rem + 0.28vw, 0.9rem);
  font-weight: 500;
}

.cinematic-hero-title {
  max-width: min(11ch, 100%);
  font-size: clamp(2rem, 1.32rem + 3.08vw, 4.75rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.04;
  text-wrap: balance;
}

.cinematic-hero-desc {
  max-width: min(40rem, 100%);
  color: rgba(255,255,255,0.68);
  font-size: clamp(0.9rem, 0.82rem + 0.36vw, 1.12rem);
  font-weight: 400;
  line-height: 1.68;
  text-wrap: pretty;
}

.cinematic-action-btn {
  min-height: clamp(2.55rem, 2.3rem + 0.8vw, 3rem);
  padding-inline: clamp(1.15rem, 2vw, 2rem);
  font-size: clamp(0.86rem, 0.8rem + 0.22vw, 0.96rem);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.cinematic-action-btn:active {
  transform: translateY(1px) scale(0.99);
}

.cinematic-controls {
  gap: clamp(0.85rem, 1.4vw, 1.35rem);
  margin-left: clamp(1rem, 5vw, 5rem);
  padding-right: clamp(0.25rem, 1.8vw, 1.5rem);
}

.cinematic-control-btn {
  width: clamp(2.8rem, 3.1vw, 3.35rem);
  height: clamp(2.8rem, 3.1vw, 3.35rem);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.cinematic-control-btn:hover {
  background: rgba(255,255,255,0.08);
}

.carousel-dot {
  flex: 0 0 auto;
}

.cinematic-bottom-shade {
  z-index: 1;
  background:
    linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.32) 34%, transparent 66%);
}

.cinematic-copyright {
  position: absolute;
  left: 50%;
  bottom: clamp(0.55rem, 1.8vh, 1.15rem);
  z-index: 30;
  max-width: min(92vw, 46rem);
  transform: translateX(-50%);
  color: rgba(255,255,255,0.5);
  font-size: clamp(0.68rem, 0.62rem + 0.2vw, 0.78rem);
  font-weight: 500;
  line-height: 1.45;
  pointer-events: none;
  text-align: center;
  text-wrap: balance;
}

/* ─── Overlays ─── */
#cinematic-search-overlay,
#cinematic-watch-modal {
  display: none;
}

#cinematic-search-overlay.is-open,
#cinematic-watch-modal.is-open {
  display: flex;
}

#cinematic-search-input::placeholder {
  color: rgba(255,255,255,0.42);
}

#cinematic-search-input {
  min-height: 56px;
}

#cinematic-learn-panel {
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#cinematic-learn-panel.is-open {
  transform: translateX(0);
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(255,255,255,0.72);
  outline-offset: 3px;
}

/* ─── Responsive ─── */
@media (max-width: 1023px) {
  #cinematic-showcase-app {
    min-height: 560px;
  }

  .cinematic-site-title {
    max-width: 34vw;
  }

  .cinematic-main-inner {
    padding-bottom: clamp(3rem, 7vh, 4rem);
  }

  .cinematic-hero-layout {
    align-items: flex-start;
    gap: clamp(1.1rem, 3.5vh, 2rem);
  }

  .cinematic-controls {
    width: min(100%, 20rem);
    justify-content: space-between;
    margin-left: 0;
    padding-right: 0;
  }
}

@media (min-width: 1024px) {
  #cinematic-mobile-menu {
    display: none !important;
  }
}

@media (max-width: 782px) {
  .admin-bar #cinematic-showcase-app {
    height: calc(100dvh - 46px);
  }
}

@media (max-width: 640px) {
  .cinematic-logo-img .custom-logo-link img {
    max-height: 28px;
  }

  .cinematic-site-title {
    max-width: 40vw;
    font-size: 0.68rem;
  }

  .cinematic-hero-meta {
    margin-bottom: 0.7rem;
  }

  .cinematic-hero-title {
    max-width: 10ch;
    margin-bottom: 0.75rem;
  }

  .cinematic-hero-desc {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 1.25rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .cinematic-actions {
    gap: 0.65rem;
  }

  .cinematic-action-btn {
    flex: 1 1 auto;
    min-width: min(10rem, 100%);
  }

  #cinematic-search-overlay {
    padding-top: 5.5rem;
  }

  #cinematic-learn-panel {
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  .cinematic-site-title {
    max-width: 32vw;
  }

  .cinematic-search-button {
    padding-inline: 0.85rem;
  }

  .cinematic-search-label {
    display: none;
  }

  .cinematic-controls {
    width: 100%;
  }
}

@media (max-height: 560px) and (max-width: 900px) {
  html,
  body {
    overflow-y: auto;
  }

  #cinematic-showcase-app {
    min-height: 640px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
