/* Additions on top of the design system stylesheet.
 *
 * Covers the states the old React runtime produced at render time and that the
 * design system therefore never needed a class for: form errors, form success,
 * and the open/closed state of the mobile nav drawer.
 */

/* The logo and drawer links used to be <button>s, so the design system never gave
   them link styling to suppress. As <a>s they now pick up the default underline. */
.nav__logo,
.nav__logo:hover,
.nav__drawer-link,
.nav__drawer-link:hover,
.nav__drawer-cta,
.nav__drawer-cta:hover {
  text-decoration: none;
}

/* The drawer becomes display:flex at <=960px, so hiding it needs the extra weight. */
.nav__drawer[hidden] {
  display: none !important;
}

/* Nav sizing. The inline links keep each label on one line and never shrink, so
   the brand lockup gives up the space instead of sliding underneath them. */
.nav__links {
  flex: 0 0 auto;
}

.nav__link {
  white-space: nowrap;
}

.nav__logo {
  min-width: 0;
  overflow: hidden;
}

/* Short link labels. The drawer keeps the long ones, where width is not scarce. */
.nav__label-short {
  display: none;
}

@media (max-width: 1180px) and (min-width: 901px) {
  /* Between the widest layout and the drawer there is not room for both the
     parish names and seven links, so the circle mark carries the brand. */
  .nav__logo-words {
    display: none;
  }

  .nav__link .nav__label-long {
    display: none;
  }

  .nav__link .nav__label-short {
    display: inline;
  }
}

.form__error {
  margin: 6px 0 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-lit-red);
}

.form__input[aria-invalid='true'],
.form__textarea[aria-invalid='true'] {
  border-color: var(--color-lit-red);
}

.form__success,
.footer__signup-thanks[role='status'] {
  margin: 0;
  padding: 20px 24px;
  border-radius: 4px;
  background: var(--color-warm-cream);
  border-left: 3px solid var(--color-gold-screen);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-charcoal);
}

.form__conditional:empty {
  display: none;
}

/* The footer sits on navy, where the red error tone falls below contrast. */
.footer__signup-form .form__error {
  color: var(--color-gold-screen);
}

/* Language toggle. Sits in the utility bar next to the phone and email, and is
   cloned into the mobile drawer by site.js. */
.utility-bar__lang {
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav__drawer-contact .utility-bar__lang {
  padding-left: 0;
  border-left: 0;
  text-decoration: underline;
}

@media (max-width: 1000px) {
  .utility-bar__contact {
    gap: 12px;
  }

  .utility-bar__contact a {
    padding-right: 0;
    padding-left: 0;
  }

  .utility-bar__contact .utility-bar__lang {
    padding-left: 12px;
  }
}

@media (max-width: 900px) {
  .nav__logo-sep {
    display: none;
  }
}

@media (max-width: 380px) {
  /* The design system hides the last utility-bar link on the narrowest phones.
     The toggle is now last, and matters more there than the address, which the
     drawer also carries. */
  .utility-bar__contact a:last-child { display: inline; }
  .utility-bar__contact a[href^='mailto:'] { display: none; }
}
