/* ============================================================
   HISTORIAS PAGE (historias.html) — page-specific layout
   Load AFTER styles/main.css and styles/home.css. Reuses the
   navbar, footer, .section, .section-head, .cta and button
   helpers; this file only carries the historias-specific blocks.
   Consumes design tokens only; no raw hex/px values except
   layout-only aspect ratios. Mobile breakpoint: 768px.
   ============================================================ */

/* ============================================================
   MOBILE NAVBAR — this page has no hero photo behind the bar, so the
   transparent .hero__nav exists only to carry the shared mobile bar +
   hamburger menu (styled in home.css under <=768px). Hide it on
   desktop, where the solid navbar is used instead.
   ============================================================ */
@media (min-width: 769px) {
  .hero__nav { display: none; }
}

/* ============================================================
   HERO — "Historia destacada": text column on the left, the
   featured story image on the right bleeding to the page edge.
   No transparent navbar over a photo here; the solid navbar
   sits above and the image fills its column height.
   ============================================================ */
.story-hero {
  display: grid;
  grid-template-columns: minmax(0, 430fr) minmax(0, 771fr);
  gap: calc(var(--space-24) * 2);
  align-items: stretch;
}

/* Text block vertically centered against the taller image */
.story-hero__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 55ch;
}
.story-hero__body > * + * { margin-top: var(--space-16); }

.story-hero__eyebrow {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-book);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.story-hero__title {
  font-size: var(--font-size-headline-1);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
}

.story-hero__lead { color: var(--color-text-muted); }

/* Push the button a little further from the paragraph */
.story-hero__cta { margin-top: var(--space-24); align-self: start; }

/* Image stretches to match the text column's height, cropped */
.story-hero__media { align-self: stretch; }
.story-hero__media-img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 771 / 500;      /* matches placehold.co/771x500 */
  object-fit: cover;
  background-color: var(--color-grey-light);
}

/* ============================================================
   MAS HISTORIAS — section-head (label + "Filtrar" on the right),
   then a 3-column grid of story cards: landscape image, a
   hairline, then a title and a short description.
   ============================================================ */
.section-head__action {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-book);
  text-transform: uppercase;
  color: var(--color-black);
  transition: color 0.2s ease;
}
.section-head__action:hover { color: var(--color-text); }

.stories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: var(--space-24);
  row-gap: calc(var(--space-24) * 2);
}

.story-card__link {
  display: block;
  color: inherit;
}
.story-card__link:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 4px;
}

.story-card__media {
  aspect-ratio: 378 / 250;      /* matches placehold.co/378x250 */
  overflow: hidden;
  margin-bottom: var(--space-16);
  background-color: var(--color-grey-light);
}
.story-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.story-card__link:hover .story-card__media img,
.story-card__link:focus-visible .story-card__media img {
  transform: scale(1.05);
}

/* Hairline sits between the image and the caption block */
.story-card__body {
  border-top: 0.5px solid var(--color-black);
  padding-top: var(--space-16);
}

.story-card__title {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  margin-bottom: var(--space-8);
  transition: opacity 0.2s ease;
}
.story-card__link:hover .story-card__title { opacity: 0.55; }

.story-card__desc { color: var(--color-text-muted); }

/* ============================================================
   RESPONSIVE  (<= 1024px / <= 768px / <= 520px)
   ============================================================ */
@media (max-width: 1024px) {
  .stories-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Mobile navbar: like the servicios page, this bar sits over a light
     surface (no dark photo hero), so the shared white logo + white
     hamburger would be invisible. Give the bar a solid white surface and
     flip the marks to dark. The open-menu overlay is still handled by
     home.css. */
  body:not(.is-menu-open) .hero__nav {
    background-color: var(--color-grey-light);
  }
  body:not(.is-menu-open) .hero__nav .navbar__brand { mix-blend-mode: normal; }
  body:not(.is-menu-open) .hero__nav .logo-img { filter: invert(1); }
  body:not(.is-menu-open) .nav-toggle__bar { background-color: var(--color-black); }

  /* Hero: image on top, text below */
  .story_hero_container {
    padding-top: var(--space-100) !important;
    padding-bottom: var(--space-100) !important;
    padding-right: var(--space-24) !important;
   }
  .story-hero {
    grid-template-columns: 1fr;
    gap: var(--space-24);
  }
  .story-hero__media { order: -1; }
  .story-hero__body { max-width: none; }
}

@media (max-width: 520px) {
  .stories-grid { grid-template-columns: 1fr; }
}
