/* /conoce_chincha — menú izquierdo + contenido */
.historia-page {
  --historia-sidebar: 260px;
  --historia-gap: 1.5rem;
  --historia-ink: #1a1a1a;
  --historia-muted: #5c5c5c;
  --historia-line: #e5e5e5;
  --historia-accent: var(--color-brand-gold, #0b6bcb);
  --historia-bg: #f7f7f5;
  padding: 24px 0 48px;
  background: var(--color-background, #f5f5f5);
  box-sizing: border-box;
}

.historia-panel {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
  text-align: left;
}

.historia-layout {
  display: grid;
  grid-template-columns: var(--historia-sidebar) minmax(0, 1fr);
  gap: var(--historia-gap);
  align-items: start;
}

.historia-sidebar {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--historia-bg);
  border: 1px solid var(--historia-line);
  border-radius: 8px;
  padding: 1rem;
  box-sizing: border-box;
}

.historia-sidebar__title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--historia-ink);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.historia-sidebar__title i,
.historia-empty h1 i {
  color: var(--color-brand-gold, #B9984B);
  font-size: 1em;
  flex-shrink: 0;
}

.historia-empty h1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* El menú es un <nav>; anula el fondo rojo global de `nav` que
   asomaba por las esquinas redondeadas de los enlaces. */
.historia-menu {
  background: transparent;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.historia-menu::-webkit-scrollbar {
  width: 6px;
}

.historia-menu::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 999px;
}

.historia-menu::-webkit-scrollbar-track {
  background: transparent;
}

.historia-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.historia-menu__link {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  color: var(--historia-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

.historia-menu__link:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--historia-ink);
}

.historia-menu__link.is-active {
  background: var(--historia-accent);
  color: #fff;
}

.historia-content {
  min-width: 0;
  text-align: left;
}

.historia-content__title {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.2;
  color: var(--historia-ink);
}

.historia-content__main {
  display: block;
}

.historia-content__main--con-galeria {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 1.25rem;
  align-items: start;
}

.historia-content__body {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--historia-ink);
  min-width: 0;
}

.historia-content__body > *:first-child {
  margin-top: 0;
}

.historia-content__body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.historia-galeria {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 200px;
}

.historia-galeria__item {
  display: block;
  width: 200px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--historia-line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--historia-bg);
  cursor: zoom-in;
  line-height: 0;
}

.historia-galeria__item:hover,
.historia-galeria__item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(185, 152, 75, 0.35);
  border-color: var(--color-brand-gold, #B9984B);
}

.historia-galeria__item img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: cover;
}

.conoce-lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.conoce-lightbox[hidden] {
  display: none !important;
}

.conoce-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.conoce-lightbox__box {
  position: relative;
  z-index: 1;
  width: min(90vw, 90%);
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.conoce-lightbox__img {
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  background: #111;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.conoce-lightbox__close {
  position: absolute;
  top: -12px;
  right: -12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.conoce-lightbox__close:hover {
  background: var(--color-brand-gold, #B9984B);
  color: #fff;
}

body.conoce-lightbox-open {
  overflow: hidden;
}

.historia-empty {
  text-align: left;
}

.historia-empty h1 {
  margin: 0 0 0.75rem;
}

@media (max-width: 860px) {
  .historia-layout {
    grid-template-columns: 1fr;
  }

  .historia-sidebar {
    position: static;
    order: -1;
    max-height: min(42vh, 320px);
  }

  .historia-menu__list {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.25rem;
  }

  .historia-menu__link {
    font-size: 0.82rem;
  }

  .historia-content__main--con-galeria {
    grid-template-columns: 1fr;
  }

  .historia-galeria {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .historia-galeria__item {
    width: calc(50% - 5px);
    max-width: 200px;
  }
}
