/* Additions to the original site styles: offer photos, the home page search width and the mobile menu. */

/*
 * Offer photos are already cropped in the panel. The original campaigns.css forces "object-fit: fill" on
 * .campaign-photo images (made for flyers framed with percentages), which stretches them in fixed-height boxes.
 */
.campaign-photo img.cms-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  object-position: center;
}

.search-wrap {
  max-width: 1040px;
  box-sizing: border-box;
}

/* Application form: sending result and the field that catches spam bots. */
.apply-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.apply-status {
  margin: 14px 0 0;
  color: #a3261d;
  font-weight: 700;
}

/* Form field with an error: red frame and the reason right under the field. */
label.has-error input,
label.has-error select,
label.has-error textarea {
  border-color: #a3261d !important;
  box-shadow: 0 0 0 1px #a3261d;
  background-color: #fdf3f2;
}

.field-error {
  display: block;
  color: #a3261d;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
}

.apply-success {
  padding: 28px;
  border: 1px solid var(--line, #1a3c5b26);
  border-left: 0;
  background: #f3faf9;
  outline: none;
}

.apply-success h3 {
  margin: 0 0 8px;
  color: var(--navy, #1a3c5b);
}

.apply-success p {
  margin: 0;
}

.nav-toggle,
.nav-languages {
  display: none;
}

@media (max-width: 780px) {
  /* The logo row stays in the same place whether the menu is open or closed. */
  header {
    align-content: flex-start;
    min-height: 0;
    padding-top: 11px;
    padding-bottom: 16px;
  }

  header .brand {
    order: 1;
  }

  header > .languages {
    display: none;
  }

  .nav-toggle {
    order: 2;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line, #1a3c5b26);
    border-radius: 999px;
    background: #fff;
    color: var(--navy, #1a3c5b);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }

  .nav-toggle-icon,
  .nav-toggle-icon::before,
  .nav-toggle-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .nav-toggle-icon {
    position: relative;
  }

  .nav-toggle-icon::before,
  .nav-toggle-icon::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .nav-toggle-icon::before {
    top: -6px;
  }

  .nav-toggle-icon::after {
    top: 6px;
  }

  header.menu-open .nav-toggle-icon {
    background: transparent;
  }

  header.menu-open .nav-toggle-icon::before {
    transform: translateY(6px) rotate(45deg);
  }

  header.menu-open .nav-toggle-icon::after {
    transform: translateY(-6px) rotate(-45deg);
  }

  header nav {
    order: 3;
    display: none !important;
  }

  header.menu-open nav {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin: 0;
    padding: 6px 0 2px !important;
    gap: 0 !important;
  }

  header.menu-open nav > a {
    display: block;
    padding: 13px 2px;
    font-size: 15px !important;
  }

  /* The menu already has a line above it, so only the following items get one. */
  header.menu-open nav > a + a,
  header.menu-open .nav-languages {
    border-top: 1px solid var(--line, #1a3c5b26);
  }

  header.menu-open .nav-languages {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 0 6px;
  }

  header.menu-open .nav-languages a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 44px;
    padding: 0 12px;
    box-sizing: border-box;
    border: 1px solid var(--line, #1a3c5b26);
    border-radius: 999px;
    color: var(--navy, #1a3c5b);
    font-size: 15px !important;
    font-weight: 700;
    text-decoration: none;
  }

  header.menu-open .nav-languages a.current {
    border-color: var(--navy, #1a3c5b);
    background: var(--navy, #1a3c5b);
    color: #fff;
  }
}

@media (max-width: 780px) and (prefers-reduced-motion: reduce) {
  .nav-toggle-icon,
  .nav-toggle-icon::before,
  .nav-toggle-icon::after {
    transition: none;
  }
}

/* Footer: the tagline sits next to the logo, separated by a thin line. */
.footer-brand {
  display: flex;
  align-items: center;
  gap: 22px;
}

.footer-top .footer-tagline {
  display: block;
  margin: 0;
  padding-left: 22px;
  border-left: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--navy);
  max-width: none;
}

@media (max-width: 780px) {
  .footer-brand {
    gap: 16px;
  }

  .footer-top .footer-tagline {
    padding-left: 16px;
    font-size: 13px;
  }
}
