/* =====================================================================
   Black Archlord — Heaven's Hell guide (heaven-hell.php)
   Índice de capítulos a la izquierda y un capítulo (.guide-section) a la
   derecha. Los capítulos traen estilos en línea propios; aquí se adaptan
   al tema nuevo (por eso algunos !important).
   ===================================================================== */

.hh-guide-container {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  padding-bottom: 60px;
}

/* ---------- Índice ---------- */

/* El panel no hace scroll: lo hace la lista (.hh-nav-list). Con el scroll en
   el panel, sus esquinas decorativas (.nw-panel::before/::after) se movían con
   el contenido y aparecía una barra de scroll horizontal. */
.hh-guide-container .guide-nav {
  position: sticky;
  top: calc(var(--nw-header-h) + 16px);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--nw-header-h) - 32px);
  padding-bottom: 10px;
}

.hh-nav-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 16px 18px 12px;
  border: 0;
  border-bottom: 1px solid var(--nw-line-soft);
  color: #fff;
  background: transparent;
  text-align: left;
  cursor: default;
}

.hh-nav-heading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--nw-font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hh-nav-heading i {
  color: var(--nw-gold);
  font-size: 14px;
}

.hh-nav-current,
.hh-nav-caret {
  display: none;
}

.hh-nav-list {
  display: grid;
  align-content: start;
  gap: 2px;
  min-height: 0;
  padding: 10px 10px 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 145, 88, 0.4) transparent;
}

.hh-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-left: 2px solid transparent;
  color: #d9ccc6;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.hh-nav-link i {
  width: 16px;
  color: var(--nw-gold-soft);
  font-size: 13px;
  text-align: center;
}

.hh-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.hh-nav-link.is-active {
  border-left-color: var(--nw-red-hot);
  color: #fff;
  background: linear-gradient(90deg, rgba(227, 52, 42, 0.22), rgba(227, 52, 42, 0.04));
}

.hh-nav-link.is-active i {
  color: var(--nw-red-hot);
}

/* ---------- Capítulos ---------- */

.hh-chapters {
  min-width: 0;
}

.hh-guide-container .guide-section {
  position: relative;
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  margin: 0 !important;
  padding: 30px 34px !important;
  border: 1px solid var(--nw-frame) !important;
  border-radius: 0 !important;
  background: linear-gradient(180deg, rgba(20, 13, 14, 0.94), rgba(9, 7, 8, 0.94)) !important;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5) !important;
  color: #d9ccc6;
  animation: hh-chapter-in 0.28s ease both;
}

/* esquinas doradas como .nw-panel */
.hh-guide-container .guide-section::before,
.hh-guide-container .guide-section::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--nw-gold);
  border-style: solid;
  opacity: 0.8;
  pointer-events: none;
}

.hh-guide-container .guide-section::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.hh-guide-container .guide-section::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 2px 2px 0;
}

.hh-guide-container .guide-section:not(.is-active) {
  display: none !important;
}

@keyframes hh-chapter-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.hh-guide-container .guide-section h3,
.hh-guide-container .guide-section h4,
.hh-guide-container .guide-section h5 {
  color: var(--nw-gold) !important;
  font-family: var(--nw-font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hh-guide-container .guide-section > h3 {
  color: #fff !important;
  font-size: clamp(24px, 3vw, 32px) !important;
}

.hh-guide-container .guide-section p,
.hh-guide-container .guide-section li,
.hh-guide-container .guide-section td,
.hh-guide-container .guide-section th {
  color: #d9ccc6 !important;
}

.hh-guide-container .guide-section strong {
  color: #fff;
}

.hh-guide-container .guide-section ul {
  padding-left: 22px;
}

/* El tema pone img { display:block }; el contenido usa imágenes en línea */
:where(.hh-guide-container .guide-section) img {
  display: inline;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.hh-guide-container .guide-section img:not(.hh-mob-img):not(.hh-boss-img) {
  border-color: var(--nw-line-soft);
}

.hh-guide-container .p-4 {
  padding: 1.5rem;
}

.hh-guide-container table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--nw-line-soft) !important;
  background: rgba(6, 4, 5, 0.55) !important;
}

.hh-guide-container table th {
  border-color: var(--nw-line-soft) !important;
  color: var(--nw-gold) !important;
  background: rgba(120, 18, 12, 0.22) !important;
}

.hh-guide-container table td {
  border-color: var(--nw-line-soft) !important;
  background: rgba(255, 255, 255, 0.02) !important;
}

/* Tarjetas del contenido */
.hh-mob-card,
.hh-boss-card,
.hh-set-panel,
.hh-unique-ring-card,
.hh-unique-necklace-card,
.hh-recipe-card,
.hh-refinery-card {
  border-color: var(--nw-line-soft) !important;
  border-radius: 0 !important;
  background: linear-gradient(180deg, rgba(120, 18, 12, 0.1), rgba(6, 4, 5, 0.6) 60%) !important;
  box-shadow: none !important;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.hh-mob-card:hover,
.hh-boss-card:hover,
.hh-set-panel:hover,
.hh-unique-ring-card:hover,
.hh-unique-necklace-card:hover {
  border-color: var(--nw-frame) !important;
  transform: translateY(-3px);
}

.hh-mob-img,
.hh-boss-img,
.zoom-img {
  cursor: zoom-in;
}

.hh-mob-title,
.hh-boss-title {
  color: var(--nw-gold) !important;
  font-family: var(--nw-font-display);
}

/* Botones del contenido (sets, refinería, "ver más") */
.hh-set-btn,
.ref-btn,
.hh-refinery-btn,
.hh-guide-container .guide-section button {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: var(--nw-radius) !important;
  color: #e8dcd6 !important;
  background: linear-gradient(180deg, #1c1314, #120c0d) !important;
  font-family: var(--nw-font-body);
  font-weight: 600;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.hh-set-btn:hover,
.ref-btn:hover,
.hh-refinery-btn:hover,
.hh-guide-container .guide-section button:hover {
  border-color: rgba(255, 90, 60, 0.6) !important;
  color: #fff !important;
}

.hh-set-btn.active,
.hh-refinery-btn.active,
.ref-btn.active {
  border-color: rgba(255, 120, 90, 0.7) !important;
  color: #fff !important;
  background: linear-gradient(180deg, #e3342a, #8c1410) !important;
  box-shadow: 0 0 16px rgba(227, 52, 42, 0.35);
}

/* Visor de imagen */
.hh-image-viewer {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
}

.hh-image-viewer img {
  max-width: min(96vw, 1200px);
  max-height: 90vh;
  border: 1px solid var(--nw-frame);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  object-fit: contain;
  cursor: default;
}

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
  .hh-guide-container {
    grid-template-columns: 1fr;
  }

  .hh-guide-container .guide-nav {
    position: relative;
    top: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .hh-nav-toggle {
    padding: 14px 16px;
    border-bottom: 0;
    cursor: pointer;
  }

  .hh-nav-current {
    display: block;
    min-width: 0;
    margin-left: auto;
    overflow: hidden;
    color: var(--nw-red-hot);
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hh-nav-caret {
    display: block;
    flex: 0 0 auto;
    color: var(--nw-muted);
    font-size: 12px;
    transition: transform 0.2s ease;
  }

  .hh-nav-list {
    display: none;
    padding-bottom: 12px;
    border-top: 1px solid var(--nw-line-soft);
  }

  .guide-nav.is-open .hh-nav-list {
    display: grid;
  }

  .guide-nav.is-open .hh-nav-caret {
    transform: rotate(180deg);
  }

  .hh-guide-container .guide-section {
    padding: 24px 22px !important;
  }

  /* Rejillas del contenido de 2-4 columnas en línea */
  .hh-unique-ring-grid,
  .hh-unique-necklace-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .hh-guide-container .guide-section {
    padding: 20px 14px !important;
  }

  .hh-guide-container .guide-section p,
  .hh-guide-container .guide-section li {
    font-size: 15px !important;
  }

  .hh-guide-container table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
}

/* Refinería Superior: panel de recetas con el fondo del tema */
#refinery .refinery-content {
  border-color: var(--nw-line-soft) !important;
  border-radius: 0 !important;
  background: rgba(6, 4, 5, 0.6) !important;
}

/* Nuevos jefes CF: rejilla de 3 columnas en línea */
@media (max-width: 991px) {
  #stones > div[style*="repeat(3"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  #stones > div[style*="repeat(3"] {
    grid-template-columns: 1fr !important;
  }

  #refinery .refinery-menu {
    width: 100% !important;
  }

  #refinery .refinery-content {
    min-width: 0 !important;
    padding: 14px !important;
  }

  #refinery .hh-refinery-list {
    grid-template-columns: minmax(0, 1fr);
  }
}
