/* Contact page — Team / Publications-styled hero, a Services-styled
   picker grid, and a Fluent Forms embed restyled to match AP brand. */

.page-contact {
  --pc-bg: #ffffff;
  --pc-bg-soft: #f3f4f6;
  --pc-text: #0e1116;
  --pc-text-soft: #57606a;
  --pc-border: rgba(14, 17, 22, 0.18);
  --pc-border-strong: #0e1116;
  --pc-accent-green: #7ed321;

  background: var(--pc-bg);
  color: var(--pc-text);
  padding: 0 0 140px;
  font-family: 'Neurial Grotesk', system-ui, sans-serif;
}

.page-contact * {
  font-family: inherit;
}

.page-contact__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
}

.page-contact__inner--narrow {
  max-width: 820px;
}

@media (max-width: 820px) {
  .page-contact__inner {
    padding: 0 24px;
  }
}

/* ── Hero ───────────────────────────────────────────────────── */

.page-contact__hero {
  background: var(--pc-bg-soft);
  padding: 180px 0 200px;
  margin-bottom: -60px;
  position: relative;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 120px));
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 120px));
}

@media (max-width: 1024px) {
  .page-contact__hero {
    padding: 140px 0 170px;
  }
}

@media (max-width: 820px) {
  .page-contact__hero {
    padding: 110px 0 140px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 80px));
    -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 80px));
  }
}

.page-contact__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--pc-text);
  margin: 0 0 24px;
}

/* Plain (non-chip) variant used in the hero — no black chip background. */
.page-contact__eyebrow--plain .page-contact__step-num {
  background: transparent;
  color: var(--pc-text);
  padding: 0;
}

.page-contact__step-num {
  background: var(--pc-text);
  color: var(--pc-bg);
  padding: 6px 10px 5px;
  letter-spacing: 0.08em;
  border-radius: 0;
}

.page-contact__step-dot {
  opacity: 0.4;
}

.page-contact__step-label {
  color: var(--pc-text);
}

.page-contact__title {
  font-weight: 700;
  font-style: normal;
  font-size: 70px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--pc-text);
  margin: 0 0 28px;
  max-width: 900px;
}

@media (max-width: 1024px) { .page-contact__title { font-size: 56px; } }
@media (max-width: 820px)  { .page-contact__title { font-size: 46px; } }
@media (max-width: 520px)  { .page-contact__title { font-size: 34px; } }

.page-contact__subtitle {
  font-weight: 700;
  font-style: normal;
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--pc-text);
  margin: 8px 0 16px;
  max-width: 900px;
}

@media (max-width: 1024px) { .page-contact__subtitle { font-size: 30px; } }
@media (max-width: 820px)  { .page-contact__subtitle { font-size: 26px; } }
@media (max-width: 520px)  { .page-contact__subtitle { font-size: 22px; } }

.page-contact__intro {
  font-weight: 400;
  font-size: 18px;
  line-height: 1.55;
  color: var(--pc-text);
  max-width: 720px;
}

.page-contact__intro p { margin: 0 0 16px; }
.page-contact__intro p:last-child { margin-bottom: 0; }

/* Body intro paragraph that sits right after a Step 0X chip eyebrow,
   before the cards / form. Used in both picker and form sections. */
.page-contact__section-intro {
  font-size: 18px;
  line-height: 1.55;
  color: var(--pc-text-soft);
  margin: 0 0 40px;
  max-width: 720px;
}

@media (max-width: 820px) {
  .page-contact__section-intro {
    font-size: 16px;
    margin-bottom: 28px;
  }
}

/* Legacy hook kept in case any older markup still references it. */
.page-contact__picker-sub {
  font-size: 18px;
  line-height: 1.55;
  color: var(--pc-text-soft);
  margin: 0 0 16px;
  max-width: 720px;
}

/* ── Services picker grid ────────────────────────────────────
   Visually mirrors the Services page cards: thin black border, white
   bg, icon at top-left, large title, description below. Hover state
   turns the icon green and lifts the card. */

.page-contact__picker-section {
  padding: 80px 0 0;
}

@media (max-width: 820px) {
  .page-contact__picker-section { padding: 50px 0 0; }
}

.page-contact__picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 1024px) {
  .page-contact__picker-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .page-contact__picker-grid { grid-template-columns: 1fr; }
}

.page-contact__service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  align-items: flex-start;
  gap: 0;
  padding: 32px 28px 28px;
  min-height: 320px;
  background: var(--pc-bg);
  border: 1px solid var(--pc-border-strong);
  border-radius: 0;
  color: var(--pc-text);
  cursor: pointer;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.page-contact__service-card:hover,
.page-contact__service-card:focus-visible,
.page-contact__service-card.is-selected {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(14, 17, 22, 0.12);
  outline: none;
}

.page-contact__service-card.is-selected {
  border-color: var(--pc-accent-green);
}

.page-contact__service-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  margin-bottom: 36px;
  color: var(--pc-text);
  transition: color 220ms ease;
}

.page-contact__service-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.page-contact__service-card:hover .page-contact__service-icon,
.page-contact__service-card:focus-visible .page-contact__service-icon,
.page-contact__service-card.is-selected .page-contact__service-icon {
  color: var(--pc-accent-green);
}

.page-contact__service-title {
  display: block;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  color: var(--pc-text);
}

@media (max-width: 820px) {
  .page-contact__service-title { font-size: 24px; }
}

.page-contact__service-desc {
  display: block;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  color: var(--pc-text-soft);
  margin-bottom: 24px;
}

.page-contact__service-cta {
  margin-top: auto;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pc-text);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.page-contact__service-card:hover .page-contact__service-cta,
.page-contact__service-card:focus-visible .page-contact__service-cta,
.page-contact__service-card.is-selected .page-contact__service-cta {
  opacity: 1;
  transform: translateY(0);
}

.page-contact__service-cta-arrow {
  display: inline-block;
  margin-left: 6px;
  transition: transform 220ms ease;
}

.page-contact__service-card:hover .page-contact__service-cta-arrow,
.page-contact__service-card:focus-visible .page-contact__service-cta-arrow {
  transform: translateX(3px);
}

/* ── Form section ─────────────────────────────────────────── */

.page-contact__form-section {
  padding: 100px 0 0;
  scroll-margin-top: 80px;
}

@media (max-width: 820px) {
  .page-contact__form-section { padding: 60px 0 0; }
}

.page-contact__form-heading {
  font-weight: 700;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  color: var(--pc-text);
}

/* "You selected: XXX [change selection]" badge — populated by JS once
   the user picks a service card. Hidden by default via the `hidden`
   attribute; JS removes that attr to reveal. */
.page-contact__selected-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  margin: 0 0 28px;
  background: var(--pc-bg-soft);
  border-left: 3px solid var(--pc-accent-green);
  font-size: 15px;
  color: var(--pc-text);
}

.page-contact__selected-badge[hidden] {
  display: none;
}

.page-contact__selected-badge-label {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--pc-text-soft);
}

.page-contact__selected-badge-value {
  font-weight: 700;
  font-size: 16px;
  color: var(--pc-text);
}

.page-contact__selected-badge-change {
  margin-left: auto;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--pc-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-contact__selected-badge-change:hover {
  color: var(--pc-accent-green);
}

.page-contact__form {
  background: var(--pc-bg);
  padding: 40px;
  border: 1px solid var(--pc-border-strong);
  border-radius: 0;
}

@media (max-width: 820px) {
  .page-contact__form { padding: 24px; }
}

/* Hide the Services Inquiry dropdown — the user already picked it in
   Step 01 (the card grid), and the value is set programmatically by
   page-contact.js. The form still submits the value normally because
   the <select> element stays in the DOM, just visually hidden along
   with its surrounding Fluent Forms wrapper.
   Uses :has() — supported in all modern browsers as of 2024. */
.page-contact__form .ff-el-group:has(select) {
  display: none !important;
}

/* ── Fluent Forms restyle (scoped + !important to win over plugin CSS) ── */

.page-contact__form .fluentform .ff-el-input--label label,
.page-contact__form .fluentform label {
  font-family: 'Neurial Grotesk', system-ui, sans-serif !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: var(--pc-text) !important;
  margin-bottom: 8px !important;
}

.page-contact__form .fluentform input[type="text"],
.page-contact__form .fluentform input[type="email"],
.page-contact__form .fluentform input[type="tel"],
.page-contact__form .fluentform input[type="url"],
.page-contact__form .fluentform input[type="number"],
.page-contact__form .fluentform select,
.page-contact__form .fluentform textarea {
  font-family: 'Neurial Grotesk', system-ui, sans-serif !important;
  font-size: 16px !important;
  color: var(--pc-text) !important;
  background: var(--pc-bg) !important;
  border: 1px solid var(--pc-border) !important;
  border-radius: 0 !important;
  padding: 14px 16px !important;
  box-shadow: none !important;
  transition: border-color 160ms ease, box-shadow 160ms ease !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.page-contact__form .fluentform input[type="text"]:focus,
.page-contact__form .fluentform input[type="email"]:focus,
.page-contact__form .fluentform input[type="tel"]:focus,
.page-contact__form .fluentform input[type="url"]:focus,
.page-contact__form .fluentform input[type="number"]:focus,
.page-contact__form .fluentform select:focus,
.page-contact__form .fluentform textarea:focus {
  outline: none !important;
  border-color: var(--pc-border-strong) !important;
  box-shadow: 0 0 0 2px rgba(14, 17, 22, 0.08) !important;
}

.page-contact__form .fluentform textarea {
  min-height: 140px !important;
  resize: vertical !important;
}

/* Submit button — kill the default blue, match AP outline-button look */
.page-contact__form .fluentform .ff-btn-submit,
.page-contact__form .fluentform button[type="submit"],
.page-contact__form .fluentform .ff-btn.ff-btn-submit {
  font-family: 'Neurial Grotesk', system-ui, sans-serif !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  background: var(--pc-text) !important;
  background-color: var(--pc-text) !important;
  background-image: none !important;
  color: var(--pc-bg) !important;
  border: 1px solid var(--pc-text) !important;
  border-radius: 0 !important;
  padding: 18px 36px !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: background 160ms ease, color 160ms ease !important;
}

.page-contact__form .fluentform .ff-btn-submit:hover,
.page-contact__form .fluentform button[type="submit"]:hover,
.page-contact__form .fluentform .ff-btn.ff-btn-submit:hover {
  background: var(--pc-bg) !important;
  background-color: var(--pc-bg) !important;
  color: var(--pc-text) !important;
}

/* Required-asterisk colour stays subtle */
.page-contact__form .fluentform .ff-el-is-required.asterisk-right label:after,
.page-contact__form .fluentform .ff_el_label_required label:after,
.page-contact__form .fluentform .required-mark {
  color: var(--pc-text) !important;
  opacity: 0.4 !important;
}

/* Validation error text */
.page-contact__form .fluentform .error,
.page-contact__form .fluentform .ff-el-is-error .text-danger,
.page-contact__form .fluentform .ff-el-form-check-label.error {
  color: #b32424 !important;
  font-size: 13px !important;
  margin-top: 6px !important;
}

/* Success message after submit */
.page-contact__form .fluentform .ff-message-success,
.page-contact__form .fluentform .ff_form_success {
  background: var(--pc-bg-soft) !important;
  border: 1px solid var(--pc-border-strong) !important;
  border-radius: 0 !important;
  color: var(--pc-text) !important;
  padding: 24px !important;
  font-size: 16px !important;
  font-family: 'Neurial Grotesk', system-ui, sans-serif !important;
}

/* Fallback message styling */
.page-contact__form-fallback {
  padding: 32px;
  border: 1px solid var(--pc-border-strong);
  background: var(--pc-bg-soft);
  font-size: 16px;
  color: var(--pc-text);
}

.page-contact__form-fallback p { margin: 0 0 12px; }
.page-contact__form-fallback p:last-child { margin-bottom: 0; }
.page-contact__form-fallback a {
  color: var(--pc-text);
  text-decoration: underline;
}
