/* ============================================
   MVR Studios — Components
   ============================================ */

/* =============================================
   Hamburger Toggle
   ============================================= */
.nav-toggle__bar {
  display: block;
  width: 28px;
  height: 2px;
  background: var(--color-text);
  transition: transform var(--duration-normal) var(--ease-out-expo),
              opacity var(--duration-fast) ease;
}

.nav-toggle__bar:nth-child(1) {
  transform: translateY(-5px);
}

.nav-toggle__bar:nth-child(2) {
  opacity: 1;
}

.nav-toggle__bar:nth-child(3) {
  transform: translateY(5px);
}

/* Morph to X when active */
.nav-toggle.is-active .nav-toggle__bar:nth-child(1) {
  transform: translateY(0) rotate(45deg);
}

.nav-toggle.is-active .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-active .nav-toggle__bar:nth-child(3) {
  transform: translateY(0) rotate(-45deg);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* =============================================
   Close Button
   ============================================= */
.nav-close {
  font-size: 1.5rem;
  color: var(--color-text-muted);
  transition: color var(--duration-fast) ease,
              transform var(--duration-fast) ease;
}

.nav-close:hover {
  color: var(--color-text);
  transform: scale(1.1);
}

.nav-close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* =============================================
   Tab Bar
   ============================================= */
.nav-tabs [role="tab"] {
  position: relative;
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text-muted);
  transition: color var(--duration-fast) ease;
  white-space: nowrap;
}

.nav-tabs [role="tab"]::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.nav-tabs [role="tab"][aria-selected="true"] {
  color: var(--color-text);
}

.nav-tabs [role="tab"][aria-selected="true"]::after {
  transform: scaleX(1);
}

.nav-tabs [role="tab"]:hover {
  color: var(--color-text);
}

.nav-tabs [role="tab"]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* =============================================
   Faction Accordion (Characters)
   ============================================= */
.faction {
  border-bottom: 1px solid var(--color-border);
}

.faction:last-child {
  border-bottom: none;
}

.faction__header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) 0;
  color: var(--color-text-muted);
  transition: color var(--duration-fast) ease;
  text-align: left;
}

.faction__header::after {
  content: '+';
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 300;
  color: var(--color-text-muted);
  transition: transform var(--duration-normal) var(--ease-out-expo),
              color var(--duration-fast) ease;
}

.faction__header[aria-expanded="true"]::after {
  content: '−';
  color: var(--color-accent);
}

.faction__header:hover,
.faction__header[aria-expanded="true"] {
  color: var(--color-text);
}

.faction__header:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.faction__content {
  overflow: hidden;
  height: 0;
}

.faction__content[hidden] {
  display: block;
  height: 0;
  visibility: hidden;
}

/* =============================================
   Character & Place Items
   ============================================= */
.character-list,
.place-list {
  padding-bottom: var(--space-lg);
}

.character-item,
.place-item {
  padding: var(--space-sm) 0;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--duration-fast) ease,
              transform var(--duration-fast) var(--ease-out-expo);
  user-select: none;
}

.character-item:hover,
.character-item.is-active,
.place-item:hover,
.place-item.is-active {
  color: var(--color-text);
  transform: translateX(8px);
}

.character-item:hover,
.character-item.is-active {
  text-shadow: 0 0 40px rgba(232, 197, 71, 0.3);
}

.place-item:hover,
.place-item.is-active {
  text-shadow: 0 0 40px rgba(232, 197, 71, 0.3);
}

/* =============================================
   Video Embeds (Trailers)
   ============================================= */
.trailer-item {
  margin-bottom: var(--space-2xl);
}

.trailer-item h3 {
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  background: var(--color-bg-elevated);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Placeholder state before iframe loads */
.video-embed::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-bg-elevated);
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) ease;
}

.video-embed:not(.is-loaded)::before {
  opacity: 1;
}

/* =============================================
   Placeholder Content (Team / Contact)
   ============================================= */
.placeholder-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  font-style: italic;
}
