/* ==============================================
   HIDER · historia.css
   Ubicación: /frontend/css/historia.css
   Descripción: Estilos para la página de historia de Hider, enfocándose en una estética orgánica, cálida y artesanal, con tipografías elegantes y una paleta de colores terrosos.
   Página Historia · editorial · orgánico
   ============================================== */

/* ── Hero ────────────────────────────────────── */
.historia-hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}

.historia-hero__img {
  position: absolute;
  inset: 0;
}

.historia-hero__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  animation: heroZoom 8s var(--ease-out) forwards;
}

@keyframes heroZoom {
  from { transform: scale(1.08); }
  to   { transform: scale(1); }
}

.historia-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(30, 18, 8, 0.55) 0%,
    rgba(91, 66, 52, 0.35) 60%,
    rgba(30, 18, 8, 0.2) 100%
  );
  display: flex;
  align-items: flex-end;
  padding-bottom: 100px;
}

.historia-eyebrow {
  color: var(--gold-light) !important;
  opacity: 0.9;
}

.historia-hero__title {
  font-family: var(--font-display);
  font-size: clamp(56px, 9vw, 110px);
  font-weight: 300;
  color: var(--cream);
  line-height: 1;
  margin-top: 20px;
}

.historia-hero__title em {
  font-style: italic;
  color: var(--gold-light);
}

.historia-hero__scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(252, 244, 232, 0.6);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: rgba(252, 244, 232, 0.4);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(0.6); }
}

/* ── Apertura ────────────────────────────────── */
.historia-apertura {
  padding: 100px 0;
}

.apertura-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.apertura-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 300;
  color: var(--brown-deep);
  line-height: 1.1;
}

.apertura-title em {
  display: block;
  color: var(--brown);
}

.apertura-text p {
  font-size: 17px;
  line-height: 1.85;
  color: var(--muted);
  margin-bottom: 20px;
}

.apertura-text p em {
  color: var(--brown-deep);
  font-style: italic;
}

.apertura-text p:last-child { margin-bottom: 0; }

/* ── Imagen grande ───────────────────────────── */
.historia-fullimg {
  position: relative;
  height: 70vh;
  min-height: 400px;
  overflow: hidden;
  margin-bottom: 0;
}

.historia-fullimg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}

.historia-fullimg:hover img {
  transform: scale(1.03);
}

.historia-fullimg__caption {
  position: absolute;
  bottom: 24px;
  right: 32px;
  background: rgba(30, 18, 8, 0.6);
  color: var(--cream);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

/* ── Valores ─────────────────────────────────── */
.historia-valores {
  background: var(--cream-soft);
  padding: 90px 0 100px;
}

.hvalores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-top: 56px;
}

.hvalor__num {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 300;
  color: var(--line-soft);
  line-height: 1;
  margin-bottom: 20px;
}

.hvalor__img {
  aspect-ratio: 4/3;
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.hvalor__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hvalor__title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--brown-deep);
  margin-bottom: 12px;
}

.hvalor__desc {
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
}

/* ── Quote oscura ────────────────────────────── */
.historia-quote-section {
  background: var(--brown-deep);
  padding: 100px 0;
}

.historia-blockquote {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  color: var(--cream);
}

.historia-blockquote__mark {
  font-family: var(--font-display);
  font-size: 120px;
  line-height: 0.6;
  display: block;
  color: var(--gold-light);
  opacity: 0.4;
  margin-bottom: 24px;
}

.historia-blockquote p {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 48px);
  font-weight: 300;
  line-height: 1.3;
  font-style: italic;
  margin-bottom: 28px;
}

.historia-blockquote p em {
  font-style: normal;
  color: var(--gold-light);
}

.historia-blockquote footer {
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(252, 244, 232, 0.5);
}

/* ── Artesanos ───────────────────────────────── */
.historia-artesanos { padding: 100px 0; }

.artesanos-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.artesanos-text {
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
}

.artesanos-imgs {
  position: relative;
  height: 560px;
  flex-shrink: 0;
  min-height: 560px;
}

.artesanos-img {
  position: absolute;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.artesanos-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artesanos-img--main {
  width: 80%;
  height: 440px;
  top: 0;
  right: 0;
}

.artesanos-img--secondary {
  width: 52%;
  height: 240px;
  bottom: 0;
  left: 0;
  border: 6px solid var(--white);
}

/* ── Números ─────────────────────────────────── */
.historia-nums {
  padding: 80px 0;
  background: var(--brown-deep);
}

.hnums-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.hnum {
  padding: 32px 24px;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.hnum:last-child { border-right: none; }

.hnum__n {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 300;
  color: var(--cream);
  margin-bottom: 8px;
}

.hnum__l {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(252, 244, 232, 0.5);
}

/* ── Fundadora ───────────────────────────────── */
.historia-fundadora { padding: 100px 0; }

.fundadora-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.fundadora-img {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.fundadora-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fundadora-tag {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-radius: var(--r);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--brown-deep);
  font-weight: 500;
}

.fundadora-text {
  font-size: 16px;
  line-height: 1.85;
  color: var(--muted);
}

.fundadora-firma {
  font-family: var(--font-display);
  font-size: 36px;
  font-style: italic;
  color: var(--brown);
  font-weight: 300;
}

/* ── CTA Final ───────────────────────────────── */
.historia-cta {
  position: relative;
  height: 80vh;
  min-height: 500px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.historia-cta__img {
  position: absolute;
  inset: 0;
}

.historia-cta__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.historia-cta__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(30, 18, 8, 0.5),
    rgba(30, 18, 8, 0.65)
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

.historia-cta__content {
  text-align: center;
  color: var(--cream);
}

.historia-cta__title {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 300;
  line-height: 1;
  margin-bottom: 20px;
}

.historia-cta__title em {
  font-style: italic;
  color: var(--gold-light);
}

.historia-cta__content p {
  font-size: 18px;
  color: rgba(252, 244, 232, 0.75);
  margin-bottom: 36px;
}

.historia-cta__btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-cream {
  background: var(--cream);
  color: var(--brown-deep);
  border-color: var(--cream);
}

.btn-cream:hover {
  background: var(--white);
  border-color: var(--white);
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 960px) {
  .apertura-grid,
  .artesanos-layout,
  .fundadora-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hvalores-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px;
    margin-top: 48px;
  }

  .hnums-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hnum:nth-child(2) { border-right: none; }
  .hnum:nth-child(3) { border-right: 1px solid rgba(255,255,255,.1); }
  .hnum:nth-child(1),
  .hnum:nth-child(2) {
    border-bottom: 1px solid rgba(255,255,255,.1);
  }

  .artesanos-imgs {
    height: 460px;
    min-height: 0;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
  }

  .artesanos-img--main {
    height: 400px;
  }

  .artesanos-img--secondary {
    height: 200px;
    width: 48%;
  }

  .historia-apertura { padding: 72px 0; }
  .historia-artesanos,
  .historia-fundadora { padding: 72px 0; }

  .historia-valores .section-head {
    text-align: center;
    justify-content: center;
    margin-bottom: 48px;
  }

  .historia-valores .section-head .eyebrow {
    justify-content: center;
  }

  .historia-valores .section-title {
    font-size: clamp(32px, 5vw, 52px);
  }

  .hvalor__num {
    font-size: 48px;
    margin-bottom: 14px;
  }

  .hvalor__title { font-size: 20px; }

  .hvalor__desc { font-size: 14px; }

  /* En 2 columnas: último ítem impar va centrado */
  .hvalores-grid .hvalor:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: calc(50% - 18px);
    margin: 0 auto;
    width: 100%;
  }
  .historia-valores .section-title {
    font-size: clamp(40px, 5vw, 64px);
    }
}

@media (max-width: 600px) {
  .historia-hero__title {
    font-size: clamp(44px, 12vw, 72px);
  }

  /* En móvil 1 columna: resetear centrado del último ítem */
  .hvalores-grid .hvalor:last-child:nth-child(odd) {
    grid-column: auto;
    max-width: 100%;
    margin: 0;
    width: 100%;
  }

  .historia-hero__overlay { padding-bottom: 64px; }

  .historia-fullimg { height: 50vw; min-height: 240px; }

  .hnums-grid { grid-template-columns: repeat(2, 1fr); }

  .artesanos-imgs {
    position: relative;
    height: 340px;
    min-height: 0;
    width: 100%;
    display: block;
    overflow: visible;
  }

  .artesanos-img {
    position: absolute;
  }

  .artesanos-img--main {
    width: 75%;
    height: 300px;
    top: 0;
    right: 0;
    left: auto;
    bottom: auto;
  }

  .artesanos-img--secondary {
    width: 52%;
    height: 180px;
    bottom: 0;
    left: 0;
    top: auto;
    right: auto;
    border: 5px solid var(--white);
    z-index: 2;
  }

  .historia-cta { height: 60vh; }
  .historia-cta__btns { flex-direction: column; align-items: center; }
  .hvalores-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 440px;
    margin: 40px auto 0;
  }

  .historia-valores {
    padding: 64px 0 72px;
  }
}

/* ══ DARK MODE — historia ══ */
[data-theme="dark"] .historia-hero            { background: var(--bg-soft); }
[data-theme="dark"] .historia-section__title  { color: var(--text); }
[data-theme="dark"] .historia-section__body   { color: var(--muted); }
[data-theme="dark"] .historia-timeline        { border-left-color: var(--line); }
[data-theme="dark"] .timeline-dot             { background: var(--gold-light); border-color: var(--surface); }
[data-theme="dark"] .timeline-year            { color: var(--gold-light); }
[data-theme="dark"] .historia-values          { background: var(--surface); }

/* Apertura */
[data-theme="dark"] .apertura-title           { color: var(--text); }
[data-theme="dark"] .apertura-text p          { color: var(--muted); }

/* Valores */
[data-theme="dark"] .historia-valores         { background: var(--bg); }
[data-theme="dark"] .hvalor__num              { color: var(--border); }
[data-theme="dark"] .hvalor__title            { color: var(--text); }
[data-theme="dark"] .hvalor__desc             { color: var(--muted); }

/* Quote */
[data-theme="dark"] .historia-blockquote p    { color: var(--cream); }

/* Sección artesanos / equipo */
[data-theme="dark"] .artesanos-text           { color: var(--muted); }
[data-theme="dark"] .artesanos-img--secondary { border-color: var(--surface-2); }

/* Números */
[data-theme="dark"] .hnum__n                  { color: var(--gold-light); }
[data-theme="dark"] .hnum__l                  { color: var(--muted); }

/* Fundadores */
[data-theme="dark"] .fundadora-text           { color: var(--muted); }
[data-theme="dark"] .fundadora-tag            { background: rgba(28,23,20,0.75); color: var(--cream); }
[data-theme="dark"] .fundadora-firma          { color: var(--text); }

/* Caption imagen */
[data-theme="dark"] .historia-fullimg__caption { background: rgba(0,0,0,0.55); color: var(--cream); }