/* ══════════════════════════════════════════════════
   historia.css — Página Historia · IBG
   Scope: .page-template-page-historia .hist-page
   ══════════════════════════════════════════════════ */

* { box-sizing: border-box; }

/* ── Tipografía scopeada ── */
.page-template-page-historia .hist-page h1,
.page-template-page-historia .hist-page h2 {
  text-transform: none !important;
  letter-spacing: normal;
}

/* ── Inner container ── */
.hist-inner {
  max-width: 896px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Títulos de sección ── */
.page-template-page-historia .hist-page .hist-section-title {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #3E3838;
  margin: 0.5rem 0 1.75rem;
  text-transform: none !important;
}

/* ── Secciones ── */
.hist-section {
  background: #fff;
  padding: 4rem 0;
  border-bottom: 0.5px solid #e8e0d8;
}
.hist-section--gray {
  background: #F5F4F0;
  border-top: 0.5px solid #e8e0d8;
}

/* ── Cuerpo de texto ── */
.hist-body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 2.5rem;
}
.hist-body p {
  font-size: 16px;
  color: #555;
  line-height: 1.75;
  margin: 0;
}
.hist-body em {
  color: #3E3838;
  font-style: italic;
}
.hist-link-inline {
  color: #FF5C1B;
  text-decoration: none;
  border-bottom: 1px solid #FFCDB8;
  transition: border-color 0.15s;
}
.hist-link-inline:hover {
  border-color: #FF5C1B;
}

/* ── Link botón ── */
.hist-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #3E3838;
  text-decoration: none;
  border-bottom: 1px solid #e8e8e8;
  padding-bottom: 2px;
  transition: border-color 0.15s, color 0.15s;
  margin-bottom: 2.5rem;
}
.hist-link-btn:hover {
  border-color: #FF5C1B;
  color: #FF5C1B;
}

/* ── Galería mosaic ── */
.hist-gallery-wrap {
  max-width: 960px;
  margin: 3rem auto 0;
  padding: 0 2rem;
}

.hist-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* Botón reset (Kava lo sobreescribe) */
.page-template-page-historia .hist-page .hist-gallery-item {
  appearance: none;
  -webkit-appearance: none;
  background: #ddd8d0 !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  margin: 0 !important;
  padding: 0;
  position: relative;
  width: 100%;
  display: block;
  border-radius: 18px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.35s ease;
}
.page-template-page-historia .hist-page .hist-gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.2) !important;
}
.page-template-page-historia .hist-page .hist-gallery-item:focus-visible {
  outline: 2px solid #FF5C1B !important;
  outline-offset: 3px !important;
}

/* Ciclo de 5: algunos ocupan 2 columnas, alturas variadas
   Para 10 fotos el grid queda:
   Fila 1 → [span2 wide] [retrato] [retrato]
   Fila 2 → [cuadrado] [paisaje] [span2 wide]
   Fila 3 → [retrato] [retrato] [cuadrado] [paisaje]          */
.page-template-page-historia .hist-page .hist-gallery-item:nth-child(5n+1) { grid-column: span 2; aspect-ratio: 16 / 9; } /* ancha + paisaje */
.page-template-page-historia .hist-page .hist-gallery-item:nth-child(5n+2) { aspect-ratio: 3 / 4; }                       /* retrato         */
.page-template-page-historia .hist-page .hist-gallery-item:nth-child(5n+3) { aspect-ratio: 3 / 4; }                       /* retrato         */
.page-template-page-historia .hist-page .hist-gallery-item:nth-child(5n+4) { aspect-ratio: 1 / 1; }                       /* cuadrado        */
.page-template-page-historia .hist-page .hist-gallery-item:nth-child(5n)   { aspect-ratio: 4 / 3; }                       /* paisaje suave   */

/* Imagen de fondo */
.hist-gallery-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: block;
}
.hist-gallery-item:hover .hist-gallery-bg {
  transform: scale(1.06);
}

/* Overlay degradado + ícono */
.hist-gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.45) 0%,
    rgba(0,0,0,0) 50%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.35s ease;
  color: #fff;
  pointer-events: none;
  opacity: 0;
}
.hist-gallery-overlay svg {
  transform: scale(0.75) translateY(6px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
  opacity: 0;
}
.hist-gallery-item:hover .hist-gallery-overlay {
  opacity: 1;
}
.hist-gallery-item:hover .hist-gallery-overlay svg {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ── Hero ── */
.hist-hero {
  position: relative;
  height: 580px;
  background-color: #024555;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
/* overlay: usa .ibg-hero-overlay de ibg-base.css, igual que home y visitanos */
.hist-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem 3.5rem;
}
/* Hero eyebrow: hereda el naranja de ibg-base.css, igual que home */
.hist-page .ibg-hero-eyebrow {
  margin-bottom: 0.75rem;
}
.page-template-page-historia .hist-page .hist-hero-title {
  font-size: 46px;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0 0 1rem;
  text-transform: none !important;
}
.hist-hero-sub {
  font-size: 17px;
  color: rgba(255,255,255,0.75);
  line-height: 1.65;
  max-width: 520px;
  margin: 0;
}

/* ── Fade-up ── */
.hist-fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.hist-fade-up.hist-visible {
  opacity: 1;
  transform: translateY(0);
}
.hist-fade-up:nth-child(2) { transition-delay: 0.06s; }
.hist-fade-up:nth-child(3) { transition-delay: 0.12s; }
.hist-fade-up:nth-child(4) { transition-delay: 0.18s; }
.hist-fade-up:nth-child(5) { transition-delay: 0.24s; }
.hist-fade-up:nth-child(6) { transition-delay: 0.28s; }

/* ── Lightbox ── */
.hist-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.hist-lightbox[hidden] { display: none; }
.hist-lightbox-img {
  max-width: min(90vw, 900px);
  max-height: 85vh;
  border-radius: 10px;
  object-fit: contain;
  display: block;
}
.hist-lightbox-close,
.hist-lightbox-prev,
.hist-lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.12) !important;
  background-image: none !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  box-shadow: none !important;
  border-radius: 50% !important;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0 !important;
  margin: 0 !important;
}
.hist-lightbox-close:hover,
.hist-lightbox-prev:hover,
.hist-lightbox-next:hover {
  background: rgba(255,255,255,0.25) !important;
}
.hist-lightbox-close { top: 1.25rem; right: 1.25rem; }
.hist-lightbox-prev  { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.hist-lightbox-next  { right: 1.25rem; top: 50%; transform: translateY(-50%); }

/* ── Identidad: Misión y Visión ── */
.hist-mv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 2rem 0 2.5rem;
}

.hist-mv-card {
  background: #F5F4F0;
  border: 0.5px solid #e8e0d8;
  border-radius: 16px;
  padding: 1.5rem;
}

.page-template-page-historia .hist-page .hist-mv-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #FF5C1B !important;
  text-transform: uppercase !important;
  letter-spacing: 0.09em !important;
  margin: 0 0 0.6rem !important;
}

.hist-mv-text {
  font-size: 14px;
  color: #555;
  line-height: 1.75;
  margin: 0;
}

/* ── Identidad: Pilares ── */
.hist-pilares-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.page-template-page-historia .hist-page .hist-pilar-card {
  background: #F5F4F0;
  border: 0.5px solid #e8e0d8;
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.page-template-page-historia .hist-page .hist-pilar-card:hover {
  border-color: #FFCDB8;
  box-shadow: 0 4px 24px rgba(255,92,27,0.07);
}

.hist-pilar-num {
  font-size: 36px;
  font-weight: 700;
  color: #FFCDB8;
  line-height: 1;
  letter-spacing: -0.02em;
}

.page-template-page-historia .hist-page .hist-pilar-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #3E3838 !important;
  line-height: 1.35 !important;
  margin: 0 !important;
  text-transform: none !important;
}

.hist-pilar-desc {
  font-size: 13px;
  color: #555;
  line-height: 1.7;
  margin: 0;
}

.hist-pilar-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hist-pilar-bullets li {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
  padding-left: 1rem;
  position: relative;
}

.hist-pilar-bullets li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: #FF5C1B;
  font-weight: 700;
}

.hist-pilar-texts {
  font-size: 11.5px;
  color: #bbb;
  line-height: 1.6;
  margin: 0;
}

.hist-pilar-summary {
  font-size: 13px;
  font-style: italic;
  color: #777;
  margin: 0;
  padding-top: 0.75rem;
  border-top: 0.5px solid #e8e0d8;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .hist-inner { padding: 0; }

  .hist-section { padding: 3rem 1.25rem; }
  .hist-section--gray { padding: 3rem 1.25rem; }

  .hist-hero { height: 520px; }
  .hist-hero-content { padding: 0 1.25rem 2.5rem; }
  .page-template-page-historia .hist-page .hist-hero-title { font-size: 34px; }
  .hist-hero-sub { font-size: 16px; }

  .page-template-page-historia .hist-page .hist-section-title { font-size: 30px; }

  .hist-gallery-wrap {
    padding: 0 1.25rem;
    margin-top: 2rem;
  }
  .hist-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .page-template-page-historia .hist-page .hist-gallery-item:nth-child(5n+1) {
    grid-column: span 2;
    aspect-ratio: 16 / 9;
  }
  .page-template-page-historia .hist-page .hist-gallery-item {
    border-radius: 12px;
  }

  .hist-lightbox-prev { left: 0.5rem; }
  .hist-lightbox-next { right: 0.5rem; }

  /* Identidad */
  .hist-mv-grid      { grid-template-columns: 1fr; }
  .hist-pilares-grid { grid-template-columns: 1fr; }
}
