/* Header Shell - Repelis */

:root {
  --ink-900: #090909;
  --ink-800: #121214;
  --ember-500: #FF3B30;
  --cloud-100: #E2E8F0;
  --cloud-200: #CBD5E1;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --transition-base: 0.2s ease;
  --font-heading: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
}

body {
  background-color: var(--ink-900);
  color: var(--cloud-100);
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
}

/* Global Container */
.repelis-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: border-box;
}

/* Header Base */
.repelis-header {
  background-color: var(--ink-900);
  width: 100%;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.repelis-header__inner {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.repelis-header__logo {
  text-decoration: none;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2.7px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.repelis-brand__re { color: var(--ember-500); }
.repelis-brand__pelis { color: #f7f8fa; }
.repelis-brand__24 {
  color: var(--ember-500);
  margin-left: 2px;
  font-size: 0.72em;
  letter-spacing: 0.5px;
  vertical-align: 0.28em;
}

/* Desktop Navigation */
.repelis-header__nav-desktop {
  display: flex;
  flex-grow: 1;
  margin-left: 64px;
}

.repelis-nav-list {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.repelis-nav-list > li {
  display: flex;
  align-items: center;
  position: relative;
}

.repelis-nav-list > li > a {
  color: var(--cloud-100);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  display: flex;
  align-items: center;
  transition: color var(--transition-base);
  padding: 8px 0;
  position: relative;
}

.repelis-nav-list > li > a svg {
  margin-left: 6px;
  opacity: 0.6;
}

.repelis-nav-list > li > a:hover {
  color: #fff;
}

/* Active State - Red Underline */
.repelis-nav-list > li.active > a,
.repelis-nav-list > li.current-menu-item > a,
.repelis-nav-list > li.current-menu-ancestor > a {
  color: #fff;
  font-weight: 600;
}

.repelis-nav-list > li.active > a::after,
.repelis-nav-list > li.current-menu-item > a::after,
.repelis-nav-list > li.current-menu-ancestor > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--ember-500);
}

/* WordPress submenus: keyboard users can open them with focus, mouse users with hover. */
.repelis-nav-list > li.menu-item-has-children > a { padding-right: 17px; }
.repelis-nav-list > li.menu-item-has-children > a::before {
  position: absolute;
  top: 50%;
  right: 1px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: '';
  opacity: .7;
  transform: translateY(-65%) rotate(45deg);
  transition: transform var(--transition-base), opacity var(--transition-base);
}
.repelis-nav-list .sub-menu {
  display: none !important;
  position: absolute;
  z-index: 120;
  top: calc(100% + 6px);
  left: -15px;
  min-width: 196px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 10px;
  background: rgba(15,15,17,.98);
  box-shadow: 0 16px 30px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.04);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-7px);
  transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base);
}
.repelis-nav-list .sub-menu::before { position: absolute; top: -5px; left: 27px; width: 9px; height: 9px; border-top: 1px solid rgba(255,255,255,.11); border-left: 1px solid rgba(255,255,255,.11); background: #0f0f11; content: ''; transform: rotate(45deg); }
.repelis-nav-list .sub-menu li { position: relative; z-index: 1; display: block; }
.repelis-nav-list .sub-menu a { display: block; padding: 9px 10px; border-radius: 6px; color: #c9ced3; font-size: 13px; font-weight: 650; line-height: 1.3; text-decoration: none; transition: background var(--transition-base), color var(--transition-base); }
.repelis-nav-list .sub-menu a:hover,
.repelis-nav-list .sub-menu a:focus-visible { background: rgba(255,255,255,.07); color: #fff; outline: none; }
.repelis-nav-list > li.menu-item-has-children.is-open > .sub-menu { display: block !important; opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); animation: repelis-submenu-in 180ms ease-out; }
.repelis-nav-list > li.menu-item-has-children.is-open > a::before { opacity: 1; transform: translateY(-35%) rotate(225deg); }
.repelis-nav-submenu-toggle { position: absolute; z-index: 2; top: 4px; right: -6px; width: 28px; height: 30px; padding: 0; border: 0; background: transparent; color: transparent; cursor: pointer; }
.repelis-nav-submenu-toggle:focus-visible { outline: 2px solid var(--ember-500); outline-offset: 2px; border-radius: 5px; }
@keyframes repelis-submenu-in { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: translateY(0); } }

/* The shell owns the transition to the footer; page templates never need a spacer. */
.repelis-main { margin: 0; padding: 0; }
.repelis-main { font-size: 0; line-height: 0; }
.repelis-main > * { font-size: initial; line-height: normal; }
.repelis-footer { margin: 0; padding: 34px 0 24px; border-top: 1px solid rgba(255,255,255,.08); background: #0b0b0d; color: #aeb4bb; }
.repelis-footer__inner { display: grid; gap: 27px; }
.repelis-footer__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.repelis-footer__brand { max-width: 310px; }
.repelis-footer__logo { display: inline-block; margin-bottom: 10px; color: #fff; font: 900 24px/1 var(--font-heading); letter-spacing: 2.2px; text-decoration: none; }
.repelis-footer__brand p { margin: 0; color: #98a0a8; font-size: 13px; line-height: 1.55; }
.repelis-footer__nav { max-width: 440px; }
.repelis-footer-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.repelis-footer-nav li { margin: 0; padding: 0; }
.repelis-footer-nav a { color: #c5cbd0; font-size: 12px; font-weight: 700; text-decoration: none; }
.repelis-footer-nav a:hover,.repelis-footer-nav a:focus-visible { color: #fff; }
.repelis-footer__bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.07); color: #777f87; font-size: 11px; }
.repelis-footer__bottom a { color: #abb2b8; font-weight: 700; text-decoration: none; }
.repelis-footer__bottom a:hover { color: #fff; }

/* Header Actions */
.repelis-header__actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Search Form Desktop */
.repelis-search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.repelis-search-input {
  background-color: var(--ink-800);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  width: 320px;
  height: 42px;
  padding: 0 16px 0 44px;
  color: #fff;
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition-base);
}

.repelis-search-input::placeholder {
  color: #94A3B8;
}

.repelis-search-input:focus {
  border-color: rgba(255,255,255,0.25);
}

.repelis-search-btn {
  position: absolute;
  left: 14px;
  background: none;
  border: none;
  padding: 0;
  color: #94A3B8;
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* Bookmark Button */
.repelis-bookmark-btn {
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity var(--transition-base);
}

.repelis-bookmark-btn:hover {
  opacity: 1;
}

/* Mobile Menu Trigger & Mobile Elements */
.repelis-mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  padding: 0;
  cursor: pointer;
}

.repelis-header__mobile-row {
  display: none;
}



/* Media Query Mobile */
@media (max-width: 900px) {
  .repelis-container {
    padding: 0 20px;
  }
  
  .repelis-header__inner {
    height: 64px;
  }

  .repelis-footer { padding: 28px 0 21px; }
  .repelis-footer__top { display: grid; gap: 24px; }
  .repelis-footer-nav { justify-content: flex-start; gap: 9px 17px; }
  .repelis-footer__bottom { align-items: flex-start; flex-direction: column; gap: 9px; }

  .repelis-header__nav-desktop {
    display: none;
  }

  /* Hide desktop search */
  .repelis-search-form {
    display: none;
  }
  
  /* Hide desktop bookmark */
  .repelis-header__actions .repelis-bookmark-btn {
    display: none;
  }

  .repelis-mobile-menu-btn {
    display: flex;
  }

  /* Mobile Search Row */
  .repelis-header__mobile-row {
    display: flex;
    align-items: center;
    padding: 0 20px 16px 20px;
    gap: 16px;
  }

  .repelis-search-form-mobile {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
  }

  .repelis-search-input-mobile {
    background-color: var(--ink-800);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    width: 100%;
    height: 42px;
    padding: 0 16px 0 44px;
    color: #fff;
    font-size: 14px;
    outline: none;
  }
  
  .repelis-search-input-mobile::placeholder {
    color: #94A3B8;
  }

  .repelis-search-btn-mobile {
    position: absolute;
    left: 14px;
    background: none;
    border: none;
    padding: 0;
    color: #94A3B8;
    display: flex;
    align-items: center;
  }

  .repelis-bookmark-btn-mobile {
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
}


/* =========================================
   MOBILE DRAWER NAVIGATION
========================================= */

/* Body scroll lock class */
body.drawer-open {
    overflow: hidden;
}

.repelis-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.repelis-drawer-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.repelis-drawer {
    position: fixed;
    top: 0;
    right: 0; /* from the right */
    width: 88vw;
    max-width: 360px;
    height: 100%;
    background-color: var(--ink-900); /* solid navy */
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
}

@media (prefers-reduced-motion: reduce) {
    .repelis-drawer {
        transition: none;
    }
    .repelis-drawer-overlay {
        transition: none;
    }
}

.repelis-drawer.is-active {
    transform: translateX(0);
}

.repelis-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.repelis-drawer__logo {
    color: var(--primary);
    font-weight: 900;
    font-size: 20px;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.repelis-drawer__close {
    background: transparent;
    border: none;
    color: var(--white);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: -12px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.repelis-drawer__close:hover,
.repelis-drawer__close:focus {
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.repelis-drawer__close:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.repelis-drawer__content {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Nav Main Links */
.repelis-drawer__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.repelis-drawer__link {
    display: flex;
    align-items: center;
    color: var(--white);
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    min-height: 48px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.repelis-drawer__link.active {
    color: var(--primary);
    background: rgba(229, 9, 20, 0.1);
}

.repelis-drawer__link:hover,
.repelis-drawer__link:focus {
    background: rgba(255, 255, 255, 0.05);
    outline: none;
}
.repelis-drawer__link:focus-visible {
    outline: 2px solid var(--primary);
}

/* Sections */
.repelis-drawer__section-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 16px 12px;
    font-weight: 700;
}

/* Grid Exploración */
.repelis-drawer__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.repelis-drawer__grid-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    background: var(--ink-800);
    border-radius: 12px;
    padding: 16px;
    color: var(--white);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    min-height: 80px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.repelis-drawer__grid-item svg {
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s;
}

.repelis-drawer__grid-item:hover,
.repelis-drawer__grid-item:focus {
    background: var(--ink-700);
    outline: none;
}
.repelis-drawer__grid-item:focus-visible {
    border-color: var(--primary);
}
.repelis-drawer__grid-item:hover svg,
.repelis-drawer__grid-item:focus svg {
    color: var(--primary);
}

/* Accordion */
.repelis-drawer__accordion-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    padding: 12px;
    min-height: 48px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    font-family: inherit;
}

.repelis-drawer__accordion-btn:hover,
.repelis-drawer__accordion-btn:focus {
    background: rgba(255, 255, 255, 0.05);
    outline: none;
}

.repelis-drawer__accordion-btn:focus-visible {
    outline: 2px solid var(--primary);
}

.repelis-drawer__accordion-btn .accordion-icon {
    transition: transform 0.2s ease;
}

.repelis-drawer__accordion-btn[aria-expanded="true"] .accordion-icon {
    transform: rotate(180deg);
}

.repelis-drawer__accordion-content {
    padding: 8px 12px;
}

.repelis-drawer__genres-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.repelis-drawer__genres-list a {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    min-height: 40px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.repelis-drawer__genres-list a:hover,
.repelis-drawer__genres-list a:focus {
    color: var(--white);
    background: rgba(255, 255, 255, 0.05);
    outline: none;
}
.repelis-drawer__genres-list a:focus-visible {
    outline: 2px solid var(--primary);
}

.repelis-drawer__all-genres {
    display: inline-block;
    margin-top: 16px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 8px;
    min-height: 44px;
    display: flex;
    align-items: center;
}
.repelis-drawer__all-genres:focus-visible {
    outline: 2px solid var(--primary);
    border-radius: 4px;
}

/* Hide drawer strictly on desktop */
@media (min-width: 901px) {
    .repelis-drawer, .repelis-drawer-overlay {
        display: none !important;
    }
}
