/* ============================================================
   CONTACT.CSS
   Page-specific styles for contact.html.
   Shared tokens, reset, layout, and components come from:
   base.css → layout.css → components.css → utilities.css
   Form wrapper styles (cta-form-wrap, cta-form-grid, etc.)
   come from home.css — loaded before this file in contact.html.
   ============================================================ */


/* ── 1. HERO ──────────────────────────────────────────────── */

/* White background, 3px gold left accent bar. Mirrors about page hero structure. */
.contact-hero {
  background: var(--color-white);
  padding: 28px var(--page-padding-inline) 36px;
  border-bottom: 0.5px solid var(--color-border);
}

.contact-hero__inner {
  max-width: var(--max-width);
  margin-inline: auto;
  border-left: 3px solid var(--color-gold);
  padding-left: 20px;
}

.contact-hero__eyebrow {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(10, 37, 117, 0.65); /* was rgba(238,204,26,0.6) ~1.3:1 — navy at 0.65 passes WCAG AA 4.5:1 */
  margin-bottom: 10px;
}

.contact-hero__heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--color-navy);
  line-height: var(--line-height-heading);
  margin-bottom: 8px;
}

.contact-hero__sub {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: clamp(1.15rem, 1.15rem + ((1vw - 0.2rem) * 1.25), 1.75rem);
  color: rgba(10, 37, 117, 0.5);
}


/* ── 2. CONTACT SECTION ───────────────────────────────────── */

/*
 * Matches homepage .cta-section exactly:
 * same background, padding, box-shadow, clip-path.
 * Sticky footer reveal shadow pattern — identical to
 * .cta-section in home.css and .about-cta-strip in about.css.
 */
.contact-section {
  background: var(--color-bg-light);
  padding: min(4rem, 5vw) var(--page-padding-inline);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  clip-path: inset(0 -60px -60px -60px);
}

/* Two-column: 1fr 2fr. Left: contact details. Right: enquiry form. */
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: min(4rem, 5vw);
  max-width: 1280px;
  margin-inline: auto;
  align-items: start;
}


/* ── 3. CONTACT DETAILS — left column ────────────────────── */

.contact-details-heading {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.25;
  margin-bottom: 10px;
}

.contact-details-desc {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: var(--line-height-body);
  margin-bottom: 28px;
}

/* Contact detail rows — email and phone */
.cd-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.cd-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 3px;
  color: rgba(10, 37, 117, 0.35);
}

.cd-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cd-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(10, 37, 117, 0.65); /* was 0.38 — increased to pass WCAG AA 4.5:1 at 10px */
}

.cd-value {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-navy);
  text-decoration: none;
  line-height: 1.4;
}

@media (prefers-reduced-motion: no-preference) {
  .cd-value {
    transition: color 0.15s ease;
  }
}

.cd-value:hover {
  color: var(--color-navy-dark);
  text-decoration: none;
}


/* ── 4. ADDRESS CARD ──────────────────────────────────────── */

/* Separate white card — visually distinct from the email/phone rows above. */
.cd-address-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 22px 18px;
  margin-top: 4px;
}

.cd-address-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(10, 37, 117, 0.65); /* was 0.38 — increased to pass WCAG AA 4.5:1 at 10px */
  margin-bottom: 10px;
}

/*
 * <address> element — correct semantic element for contact info.
 * font-style: normal overrides browser default italic on <address>.
 */
.cd-address-lines {
  font-family: var(--font-body);
  font-size: 14px;
  font-style: normal;
  color: var(--color-navy);
  line-height: 1.75;
  margin-bottom: 14px;
}

.cd-maps-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: rgba(10, 37, 117, 0.65); /* was 0.45 — increased to pass WCAG AA 4.5:1 at 12px */
  text-decoration: none;
}

@media (prefers-reduced-motion: no-preference) {
  .cd-maps-link {
    transition: color 0.15s ease;
  }
}

.cd-maps-link:hover {
  color: var(--color-navy);
  text-decoration: none;
}


/* ── 5. RESPONSIVE ────────────────────────────────────────── */

/* Tablet — 768px to 1023px */
@media (min-width: 768px) and (max-width: 1023px) {

  .contact-hero {
    padding: 28px var(--page-padding-inline) 36px;
  }

  .contact-section {
    padding: min(4rem, 5vw) var(--page-padding-inline);
  }

  /*
   * .contact-inner stays 1fr 2fr at tablet —
   * same as homepage .cta-inner (no tablet override there either).
   */

}

/* Mobile — below 768px */
@media (max-width: 767px) {

  .contact-hero {
    padding: 24px 24px 32px;
  }

  .contact-section {
    padding: 2.5rem 24px;
  }

  /* Single column: details stack above form */
  .contact-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

}


/* ── 6. FORM VALIDATION — error states ───────────────────── */

/*
 * All new classes — conflict with nothing in components.css.
 * .has-error is added to .form-group by contact.js.
 * .form-error-msg is a <p> injected by contact.js below each invalid field.
 */

.form-group.has-error > input[type="text"],
.form-group.has-error > input[type="email"],
.form-group.has-error > input[type="tel"],
.form-group.has-error > select,
.form-group.has-error > textarea {
  border-color: #c0392b;
  box-shadow: none;
}

/* Phone field: error border on .phone-wrap container, not inner input */
.form-group.has-error .phone-wrap {
  border-color: #c0392b;
  box-shadow: none;
}

/* Error message text — appears directly below the invalid field */
.form-error-msg {
  font-family: var(--font-body);
  font-size: 11px;
  color: #c0392b;
  padding-left: 4px;
  margin-top: 2px;
  display: block;
}


/* ── 7. FORM SUCCESS STATE ────────────────────────────────── */

/*
 * Replaces .cta-form-wrap content after successful fetch() submit.
 * Matches the form wrap's border-radius and background so the
 * transition from form to success is visually seamless.
 */
.form-success {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(10, 37, 117, 0.5);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 32px;
  min-height: 320px;
}

.form-success__icon {
  width: 48px;
  height: 48px;
  background: rgba(39, 174, 96, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  flex-shrink: 0;
  color: #27ae60;
}

.form-success__icon svg {
  width: 24px;
  height: 24px;
}

.form-success__heading {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 10px;
  line-height: 1.3;
}

.form-success__msg {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--color-text-muted);
  line-height: 1.65;
  max-width: 34ch;
}


/* ── 8. SUBMISSION ERROR BANNER ───────────────────────────── */

/*
 * Shown when fetch() fails (network error or server 500).
 * Distinct from per-field errors — this is a form-level problem.
 * Hidden by default; .is-visible toggled by contact.js.
 */
.form-submit-error {
  font-family: var(--font-body);
  font-size: 12px;
  color: #922b21;
  background: rgba(192, 57, 43, 0.07);
  border: 1px solid rgba(192, 57, 43, 0.2);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 0 25px 4px;
  display: none;
}

.form-submit-error.is-visible {
  display: block;
}
