/*
 * Landing reclutamiento (landing-reclutamiento.php): 50/50 job description + form over a
 * background image/video, styled like the product hero (.hero-banners_internal).
 * Scoped to .lr. Form field styles come from forminator-forms.css.
 *
 * Layout follows the site nav (.header / .header-custom-child in style.css):
 * - side gutter 30px above 1080px, 20px at 1080px and below; max width 1400px, centered;
 * - 30px inner inset (where the nav logo starts): text aligns with the logo at every size.
 * Breakpoints: desktop > 1080px (50/50), tablet 768–1080px and mobile < 768px (stacked,
 * image as a cover background of the job description, form on a full-width white panel).
 */

.lr {
  /* Spacing tokens (desktop) */
  --lr-gutter: 30px;          /* page side margin, same as the nav */
  --lr-inset: 30px;           /* text inset, same as the nav inner padding (logo) */
  --lr-pad-block: 60px;       /* section top/bottom padding */
  --lr-gap: 60px;             /* gap between the two columns */
  --lr-card-pad-block: 50px;  /* form card top/bottom padding, same as .hero-form */
  --lr-max: 1400px;           /* same max width as the nav */
  --lr-radius: 30px;
  --lr-header-h: 90px;        /* same as the site nav */

  /* Colors */
  --lr-title: #2f347e;
  --lr-text: #1d1d1b;
  --lr-muted: #5a5c74;
  --lr-on-media: #fff;
  --lr-fallback-bg: #2f347e;

  /* Form accent (forminator-forms.css: submit, CV button, focus): same Life teal as the
     clients landing (landing-campana.php), instead of the #706f70 fallback. */
  --color-theme: #35bebb;

  /* Collapsible job description */
  --lr-collapsed-height: 220px;
  --lr-fade-height: 80px;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-sizing: border-box;
  width: calc(100% - 2 * var(--lr-gutter));
  max-width: var(--lr-max);
  min-height: calc(100vh - 2 * var(--lr-gutter));
  margin: var(--lr-gutter) auto;
  padding: var(--lr-pad-block) var(--lr-inset);
  border-radius: var(--lr-radius);
  background-color: var(--lr-fallback-bg);
  font-family: "Hind", sans-serif;
  color: var(--lr-on-media);
}

.lr *,
.lr *::before,
.lr *::after {
  box-sizing: border-box;
}

/* ---------- Background media + legibility gradient (same as the product hero) ---------- */
.lr__media,
.lr__media-item {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lr__media {
  z-index: -2;
  pointer-events: none;
}

.lr__media-item {
  object-fit: cover;
}

/* The video sits over the image (its poster) once it starts playing. */
.lr__video {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.lr__video.is-playing {
  opacity: 1;
}

.lr::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0) 85%);
  pointer-events: none;
}

/* ---------- Layout ---------- */
.lr__container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--lr-gap);
  /* Top-aligned: the form is much taller than the collapsed text, centering would push the title down. */
  align-items: start;
}

/* ---------- Job description (left, over the background) ---------- */
.lr__jd {
  padding-top: var(--lr-card-pad-block);
  text-align: left;
}

.lr__jd-body {
  position: relative;
  overflow: hidden;
}

/* Collapsed state is set by JS only, so the full text stays visible without JavaScript. */
.lr__jd-body.is-collapsible {
  transition: max-height 0.35s ease;
}

/* Fade with a transparency mask: works over any image or video. */
.lr__jd-body.is-collapsed {
  max-height: var(--lr-collapsed-height);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--lr-fade-height)), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - var(--lr-fade-height)), transparent);
}

.lr__jd-content {
  font-size: 18px;
  line-height: 1.6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.lr__jd-content > :first-child {
  margin-top: 0;
}

.lr__jd-content > :last-child {
  margin-bottom: 0;
}

.lr__jd-content h1,
.lr__jd-content h2,
.lr__jd-content h3,
.lr__jd-content a {
  color: var(--lr-on-media);
}

/* First heading = hero title, like the product hero H1. */
.lr__jd-content > h1:first-child,
.lr__jd-content > h2:first-child {
  margin-bottom: 20px;
  font-size: 56px;
  font-weight: 700;
  line-height: 1.05;
}

.lr__jd-content h2,
.lr__jd-content h3 {
  margin: 24px 0 8px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

/* The theme resets paragraph margins and shrinks <p> on tablet; restore both for long-form text. */
.lr__jd-content p,
.lr__jd-content ul,
.lr__jd-content ol {
  margin: 0 0 14px;
}

.lr__jd-content p,
.lr__jd-content li,
.lr__form-description p {
  font-size: inherit;
  line-height: inherit;
}

.lr__jd-content ul,
.lr__jd-content ol {
  padding-left: 1.25em;
}

.lr__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 22px;
  border: 2px solid var(--lr-on-media);
  border-radius: 999px;
  background: transparent;
  color: var(--lr-on-media);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lr__toggle[hidden] {
  display: none;
}

/* Chevron: points down when collapsed, up when expanded. */
.lr__toggle::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.lr__toggle[aria-expanded="true"]::after {
  transform: translateY(2px) rotate(-135deg);
}

.lr__toggle:hover {
  background-color: var(--lr-on-media);
  color: var(--lr-title);
}

.lr__toggle:focus-visible {
  outline: 2px solid var(--lr-on-media);
  outline-offset: 3px;
}

/* ---------- Form card (right) ---------- */
.lr__card {
  border-radius: var(--lr-radius);
  background-color: #fff;
  padding: var(--lr-card-pad-block) var(--lr-inset);
  color: var(--lr-text);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

.lr__form-title {
  margin: 0 0 8px;
  color: var(--lr-title);
  font-size: 28px;
  line-height: 1.2;
  text-align: left;
}

.lr__form-description {
  margin-bottom: 24px;
  color: var(--lr-muted);
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}

.lr__form-description > :last-child {
  margin-bottom: 0;
}

/* ---------- Tablet + mobile (<= 1080px, same breakpoint as the nav) ----------
 * Stacked columns, full-bleed section. The image is a CSS background of the job description
 * (cover; no video). The form sits on a full-width white panel, rounded on top, that
 * runs to the bottom of the section.
 */
@media (max-width: 1080px) {
  .lr {
    --lr-gutter: 20px;
    --lr-pad-block: 48px;
    --lr-gap: 32px;
    --lr-card-pad-block: 40px;
    --lr-radius: 20px;
    --lr-collapsed-height: 200px;
    --lr-panel-radius: 30px;    /* rounded top of the white form panel */

    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: var(--lr-gutter) var(--lr-gutter) var(--lr-pad-block);
    border-radius: 0;
  }

  /* The section-wide media layer is replaced by a background on the job description. */
  .lr__media,
  .lr::after {
    display: none;
  }

  /* The form panel grows to fill the remaining height of the section. */
  .lr__container {
    flex: 1 0 auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 0;
  }

  /* Job description = the background section: full bleed, extended up to the top of the
   * page and down under the rounded top of the form panel. The image (--lr-jd-bg, set inline
   * by the template) covers the whole section; the brand color shows only without an image.
   * Text keeps the nav's 30px inset, like the text inside the form card. */
  .lr__jd {
    margin: calc(-1 * var(--lr-gutter)) calc(-1 * var(--lr-gutter)) 0;
    padding: calc(var(--lr-gutter) + var(--lr-pad-block)) calc(var(--lr-gutter) + var(--lr-inset)) calc(var(--lr-gap) + var(--lr-panel-radius));
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.35) 100%),
      var(--lr-jd-bg, none) center / cover no-repeat var(--lr-fallback-bg);
  }

  /* Form parent: white, edge to edge and down to the bottom of the section, rounded on top. */
  .lr__card {
    align-self: stretch;
    position: relative;
    margin: calc(-1 * var(--lr-panel-radius)) calc(-1 * var(--lr-gutter)) calc(-1 * var(--lr-pad-block));
    padding: var(--lr-card-pad-block) calc(var(--lr-gutter) + var(--lr-inset));
    border-radius: var(--lr-panel-radius) var(--lr-panel-radius) 0 0;
    box-shadow: none;
  }

  .lr__jd-content > h1:first-child,
  .lr__jd-content > h2:first-child {
    font-size: 44px;
  }
}

@media (max-width: 767px) {
  .lr {
    --lr-pad-block: 32px;
    --lr-gap: 24px;
    --lr-card-pad-block: 32px;
  }

  .lr__jd-content {
    font-size: 16px;
  }

  .lr__jd-content > h1:first-child,
  .lr__jd-content > h2:first-child {
    font-size: 36px;
  }

  .lr__form-title {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lr__jd-body.is-collapsible,
  .lr__toggle,
  .lr__toggle::after,
  .lr__video {
    transition: none;
  }
}
