/* ============================================================
   MESA content pages (phase 2b)
   About, franchise, contact, careers, news and their singles.
   Loaded with the inner-page bundle, after pages.css. Tokens only.

   1. Fluent Forms bridge: Fluent Forms' markup inside the mockup's
      .form-card, restyled to the mockup's .field / .input / .btn look
      (pages.css, FORMS). Ported from mesa2026/assets/css/pages.css and
      extended for the multi-step job application (form 4).
   2. Small additions the static mockup did not need.
   ============================================================ */

/* === 1. FLUENT FORMS BRIDGE === */

.form-card .fluentform,
.form-card .fluentform .frm-fluent-form {
  width: 100%;
}

.form-card .fluentform .frm-fluent-form,
.form-card .fluentform .frm-fluent-form fieldset,
.form-card .fluentform .fluentform-step,
.form-card .fluentform .ff-step-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

/* Single-step forms (contact 1, franchise 5): short fields pair up two to a
   row as in the mockup (email + phone, department + subject); everything
   else takes the full row. One column on phones. */
.form-card .fluentform .frm-fluent-form:not(.ff-form-has-steps) fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-card .fluentform .frm-fluent-form:not(.ff-form-has-steps) fieldset > * {
  grid-column: 1 / -1;
}

.form-card .fluentform .frm-fluent-form:not(.ff-form-has-steps) fieldset > .ff-el-group:has(input[type="email"], input[type="tel"], select, input[name="subject"], input[name^="input_text"]) {
  grid-column: auto;
}

@media (max-width: 575px) {
  /* minmax(0, …): plain 1fr has an auto minimum, so reCAPTCHA's fixed
     304px box widened the column and pushed every field past the card. */
  .form-card .fluentform .frm-fluent-form:not(.ff-form-has-steps) fieldset {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Hidden steps must stay hidden: Fluent Forms toggles .active. */
.form-card .fluentform .ff-form-has-steps .fluentform-step:not(.active) {
  display: none;
}

/* Fluent Forms' step script writes an inline style="display: block" on each
   step it shows (step 2 onwards), which drops the flex gap above: fields and
   the Previous / Next row end up touching. Only !important beats inline. */
.form-card .fluentform .ff-form-has-steps .fluentform-step.active {
  display: flex !important;
}

.form-card .fluentform .ff-el-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin: 0;
}

.form-card .fluentform .ff-el-input--label {
  display: flex;
  margin: 0;
  padding: 0;
}

/* Fluent Forms' clearfix pseudo-elements would become flex and grid items
   and take a gap each. */
.form-card .fluentform .ff-el-group::before,
.form-card .fluentform .ff-el-group::after,
.form-card .fluentform .ff-t-container::before,
.form-card .fluentform .ff-t-container::after,
.form-card .fluentform fieldset::before,
.form-card .fluentform fieldset::after {
  display: none;
}

.form-card .fluentform .ff-el-input--label label {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dark-muted);
}

.form-card .fluentform .ff-el-is-required.asterisk-right label::after {
  color: var(--primary);
}

/* Two-up rows (name fields, column containers), stacked on phones. */
.form-card .fluentform .ff-t-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-s);
  margin: 0;
}

.form-card .fluentform .ff-t-cell {
  flex-basis: auto !important; /* Fluent Forms sets an inline flex-basis. */
  margin: 0;
  padding: 0;
  min-width: 0;
}

.form-card .fluentform .ff-el-form-control {
  width: 100%;
  padding: var(--btn-padding-block) var(--space-s);
  font-family: var(--font-body);
  font-size: var(--text-s);
  line-height: var(--text-line-height);
  color: var(--text-dark);
  background: var(--bg-light);
  border: var(--border);
  border-radius: var(--radius-m);
  box-shadow: none;
  transition: border-color var(--duration-fast) ease;
}

.form-card .fluentform .ff-el-form-control:focus {
  outline: none;
  border-color: var(--primary);
}

.form-card .fluentform .ff-el-form-control:focus-visible {
  outline: var(--border-width) solid var(--primary);
  outline-offset: var(--border-width);
}

.form-card .fluentform textarea.ff-el-form-control {
  min-height: 14rem;
  resize: vertical;
}

.form-card .fluentform select.ff-el-form-control {
  appearance: auto;
}

.form-card .fluentform .ff-el-form-control::placeholder {
  color: var(--text-dark-muted);
  opacity: 0.7;
}

/* Consent and option checkboxes: the mockup's .form-consent. */
.form-card .fluentform .ff-el-form-check {
  margin: 0;
}

.form-card .fluentform .ff-el-form-check-label,
.form-card .fluentform .ff_tc_label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-dark-muted);
}

.form-card .fluentform .ff-el-form-check-input {
  accent-color: var(--primary);
}

.form-card .fluentform .ff-el-help-message,
.form-card .fluentform .ff_tc_checkbox + div,
.form-card .fluentform .ff-el-form-check-label a {
  font-size: var(--text-xs);
  color: var(--text-dark-muted);
}

.form-card .fluentform .ff-el-form-check-label a {
  color: var(--secondary);
  text-decoration: underline;
}

/* Section breaks inside the job application steps. */
.form-card .fluentform .ff-el-section-break {
  gap: var(--space-xs);
}

.form-card .fluentform .ff-el-section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--h5);
  font-weight: 600;
  color: var(--text-dark);
}

.form-card .fluentform .ff-el-section-break hr {
  margin: 0;
  border: 0;
  border-top: var(--border);
}

.form-card .fluentform .ff-section_break_desk {
  font-size: var(--text-s);
  color: var(--text-dark-muted);
}

/* Step progress bar. */
.form-card .fluentform .ff-step-header,
.form-card .fluentform .ff-el-progress-status {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dark-muted);
}

.form-card .fluentform .ff-el-progress {
  background: var(--bg-light);
  border-radius: var(--radius-round);
}

.form-card .fluentform .ff-el-progress-bar {
  background: var(--primary);
  border-radius: var(--radius-round);
}

/* File upload: the mockup's .file-input look. */
.form-card .fluentform .ff_upload_btn.ff-btn {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-s);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-light);
  background: var(--tertiary);
  border: 0;
  border-radius: var(--radius-round);
  cursor: pointer;
}

/* Repeater table (work history). */
.form-card .fluentform .ff_repeater_table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 var(--space-xs);
}

.form-card .fluentform .ff_repeater_table th {
  padding: 0;
  text-align: left;
}

.form-card .fluentform .ff_repeater_table td {
  padding: 0 var(--space-xs) 0 0;
  vertical-align: top;
}

/* Buttons: the mockup's .btn .btn--primary, equal width, full on phones. */
.form-card .fluentform .ff_submit_btn_wrapper,
.form-card .fluentform .step-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin: 0;
}

.form-card .fluentform .ff-btn-submit:not(.ff_btn_no_style),
.form-card .fluentform .ff-btn-next:not(.ff_btn_no_style),
.form-card .fluentform .ff-btn-prev:not(.ff_btn_no_style) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  float: none;
  width: auto;
  min-width: 22rem;
  padding: var(--btn-padding-block) var(--btn-padding-inline);
  font-family: var(--btn-font-family);
  font-size: var(--text-xs);
  font-weight: var(--btn-font-weight);
  line-height: var(--btn-line-height);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-light);
  background: var(--primary);
  border: var(--btn-border-width) solid var(--primary);
  border-radius: var(--btn-border-radius);
  box-shadow: none;
  cursor: pointer;
  transition: var(--transition);
}

.form-card .fluentform .ff-btn-submit:not(.ff_btn_no_style):hover,
.form-card .fluentform .ff-btn-next:not(.ff_btn_no_style):hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: var(--shadow-glow-primary);
  transform: translateY(-2px);
}

.form-card .fluentform .ff-btn-prev:not(.ff_btn_no_style) {
  color: var(--primary);
  background: transparent;
}

.form-card .fluentform .ff-btn-prev:not(.ff_btn_no_style):hover {
  color: var(--text-light);
  background: var(--primary);
}

.form-card .fluentform .ff-btn:focus-visible {
  outline: var(--btn-border-width) solid var(--tertiary);
  outline-offset: var(--btn-border-width);
}

/* Validation and success messages. */
.form-card .fluentform .ff-el-is-error .ff-el-form-control {
  border-color: var(--secondary);
}

.form-card .fluentform .error.text-danger {
  font-size: var(--text-xs);
  color: var(--secondary);
}

.form-card .fluentform .ff-message-success {
  padding: var(--space-s);
  font-size: var(--text-s);
  color: var(--text-dark);
  background: var(--bg-light);
  border: var(--border);
  border-radius: var(--radius-m);
  box-shadow: none;
}

.form-card .fluentform .ff-errors-in-stack {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .form-card .fluentform .ff-btn-submit:not(.ff_btn_no_style):hover,
  .form-card .fluentform .ff-btn-next:not(.ff_btn_no_style):hover {
    transform: none;
  }
}

@media (max-width: 575px) {
  .form-card .fluentform .ff-btn-submit:not(.ff_btn_no_style),
  .form-card .fluentform .ff-btn-next:not(.ff_btn_no_style),
  .form-card .fluentform .ff-btn-prev:not(.ff_btn_no_style) {
    width: 100%;
    min-width: 0;
  }
}

/* === 2. ADDITIONS === */

/* News tile titles are links; the mockup inlined color: inherit. */
.news-tile__title a {
  color: inherit;
}

/* The share row's "Copy link" chip is a <button>. */
button.share-chip {
  font-family: inherit;
  line-height: inherit;
  background: transparent;
  cursor: pointer;
}

/* Optional on-the-job trainee form under the positions note. The wrapper
   owns the distance from the note, so the form card needs no margin. */
.positions__apply {
  display: flex;
  justify-content: center;
  padding-top: var(--space-l);
}

.positions__apply .form-card {
  width: 100%;
  max-width: var(--container-width-narrow);
}

/* Grid children default to min-width: auto, so a Fluent Forms widget with a
   fixed width (reCAPTCHA is 304px) would push the column past a phone's
   width. Let the columns shrink; the widget may use the card's padding. */
.contact__grid > *,
.job__grid > *,
.job__main > * {
  min-width: 0;
}

.form-card .fluentform iframe {
  max-width: 100%;
}

/* Old posts embed YouTube with a fixed height="315"; keep it 16:9 at any
   width. */
.article-prose iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
}
