/* Contact: answer "how do I reach the right person?" on the first screen.

   The heading beside the form → or write to a team → pages that may already
   answer it → where to follow along. Chapters, type, buttons, list rows and
   the bridging card come from iac-components.css; this module holds only
   Contact's own layouts and the styling of WPForms form 11. Loaded by the
   saved iac-contact-page marker. */

/* Astra's base text is 14px on phones; the guide's minimum is 16px. */
.iac-site .iac-contact-page {
  --iac-icon-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E");
  --iac-icon-mic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2M12 19v3'/%3E%3C/svg%3E");
  --iac-icon-heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E");
  font-size: 1rem;
}

.iac-contact-page section[id] {
  scroll-margin-top: 1.5rem;
}

/* Text links keep their arrow out of the accessible name (aria-hidden span).
   inline-block keeps the underline on the words. */
.iac-contact-text-link a {
  display: inline-block;
  padding-block: .625rem;
  color: var(--iac-accent-hover);
  font-weight: 700;
  line-height: 1.5;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .3em;
}

.iac-contact-text-link a span {
  display: inline-block;
  margin-inline-start: .35em;
  text-decoration: none;
}

.iac-site .iac-contact-page .iac-contact-note {
  font-size: 1rem;
  line-height: 1.6;
}

/* 1. The opening: what the page is for, beside the form in a white card that
   hangs into the next chapter. One night chapter under the header, as on Home. */
.iac-contact-page .iac-contact-message {
  padding-top: clamp(2.5rem, 5vw, 4.5rem);
}

.iac-contact-page #send-message {
  scroll-margin-top: 1.5rem;
}

.iac-contact-message-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: start;
  column-gap: clamp(2.5rem, 6vw, 6rem);
}

.iac-contact-message .iac-contact-note {
  color: #ffffffd9;
}

.iac-contact-page .iac-contact-form > * {
  margin-block: 0;
}

/* The card's heading is an H2, since the H1 sits beside it, at the size of a card title. */
.iac-site .iac-story .iac-contact-form h2 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.25;
  letter-spacing: -.015em;
}

.iac-contact-page .iac-contact-form .iac-contact-note {
  margin-top: .25rem;
  color: var(--iac-muted);
}

@media (min-width: 901px) {
  /* The form sets this chapter's height, so it ends at the card rather than
     below it; the card then hangs past the edge by --iac-bridge. */
  .iac-contact-page .iac-contact-message {
    padding-bottom: 0;
  }

  .iac-contact-page .iac-contact-form.iac-bridge-card {
    align-self: start;
    translate: 0 var(--iac-bridge);
  }

  /* Smaller than the shared opening size, so "Authors Canada" keeps to one
     line in the copy column beside the form. */
  .iac-site .iac-story .iac-contact-message h1 {
    font-size: clamp(2.5rem, 4.6vw, 4.25rem);
  }
}

/* Form 11 keeps its fields, settings and validation; only its appearance is set here. */
.iac-contact-form #wpforms-11 {
  margin: 1rem 0 0;
  padding: 0;
}

.iac-contact-form div.wpforms-container .wpforms-form .wpforms-field {
  padding-block: .5rem;
}

.iac-contact-form div.wpforms-container .wpforms-form .wpforms-field-label {
  color: var(--iac-ink);
  font-size: 1rem;
  font-weight: 700;
}

.iac-contact-form div.wpforms-container .wpforms-form .wpforms-field-sublabel {
  color: var(--iac-muted);
  font-size: 1rem;
}

.iac-contact-form div.wpforms-container .wpforms-form :is(input[type='text'], input[type='email'], textarea) {
  width: 100%;
  max-width: 100%;
  height: auto;
  font: inherit;
}

.iac-contact-form div.wpforms-container .wpforms-form textarea {
  min-height: 9rem;
  resize: vertical;
}

.iac-contact-form div.wpforms-container .wpforms-form :is(label.wpforms-error, em.wpforms-error) {
  font-size: 1rem;
}

/* A corrected field's error keeps its line, invisibly. Pressing Send takes focus
   from the last field; WPForms then re-checks it and hides its error, which used
   to lift the button by a line between mouse down and up, so the click missed
   and nothing was sent (found 2026-11-15). WPForms also empties the hidden
   error, so a space holds its line. The space goes on the next submit or page
   load. */
.iac-contact-form div.wpforms-container .wpforms-form :is(label.wpforms-error, em.wpforms-error)[style*='display: none'] {
  display: block !important;
  visibility: hidden;
}

.iac-contact-form div.wpforms-container .wpforms-form :is(label.wpforms-error, em.wpforms-error)[style*='display: none']::before {
  content: '\00a0';
}

.iac-contact-form div.wpforms-container .wpforms-form .wpforms-submit-container {
  padding-top: .75rem;
}

/* 2. Or write to a team. Every row has the same parts in the same places and
   the height of the tallest. */
.iac-contact-page .iac-contact-routes {
  container-type: inline-size;
  grid-auto-rows: 1fr;
  gap: .75rem;
  margin: clamp(2rem, 4vw, 3rem) 0 0;
}

.iac-contact-page .iac-contact-routes > *,
.iac-contact-page .iac-contact-route > *,
.iac-contact-route .iac-list-row-copy > *,
.iac-contact-route-reach > * {
  margin-block: 0;
}

.iac-site .iac-contact-page .iac-contact-route {
  position: relative;
  grid-template-columns: 3rem minmax(0, 1fr) 21.5rem;
  align-items: start;
  column-gap: clamp(1rem, 2vw, 1.75rem);
  padding: 1rem 1.25rem;
}

@media (hover: hover) and (pointer: fine) {
  .iac-contact-page .iac-contact-route:hover {
    box-shadow: none;
  }
}

.iac-contact-route::before,
.iac-contact-route::after {
  content: '';
  grid-area: 1 / 1;
  width: 3rem;
  height: 3rem;
}

.iac-contact-route::before {
  border-radius: 50%;
  background: var(--iac-paper-soft);
}

.iac-contact-route::after {
  background: var(--iac-accent);
  -webkit-mask: var(--iac-contact-route-icon) center / 1.5rem no-repeat;
  mask: var(--iac-contact-route-icon) center / 1.5rem no-repeat;
}

.iac-contact-route.is-general { --iac-contact-route-icon: var(--iac-icon-mail); }
.iac-contact-route.is-speaking { --iac-contact-route-icon: var(--iac-icon-mic); }
.iac-contact-route.is-sponsors { --iac-contact-route-icon: var(--iac-icon-heart); }

/* Level with the address, whose link has padding for a 44px target. */
.iac-contact-route .iac-list-row-copy {
  grid-column: 2;
  grid-row: 1;
  padding-top: .5rem;
}

.iac-site .iac-contact-page .iac-contact-route h3 {
  font-size: 1.25rem;
}

.iac-contact-page .iac-contact-route .iac-list-row-copy p {
  margin-top: .125rem;
  color: var(--iac-muted);
  line-height: 1.5;
}

.iac-contact-page .iac-contact-route-reach {
  grid-column: 3;
  grid-row: 1;
  display: grid;
  justify-content: start;
  gap: 0;
}

.iac-contact-email a {
  display: inline-block;
  padding-block: .625rem;
  color: var(--iac-ink);
  font-weight: 700;
  line-height: 1.5;
  text-decoration: underline;
  text-decoration-color: var(--iac-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: .3em;
}

.iac-contact-email a:hover {
  color: var(--iac-accent-hover);
}

.iac-site .iac-contact-page .iac-contact-routes-note {
  margin-top: 1rem;
  color: var(--iac-muted);
  font-size: 1rem;
}

/* The rows follow their own width in rem, so doubled text stacks them too. */
@container (max-width: 56rem) {
  .iac-site .iac-contact-page .iac-contact-route {
    grid-template-columns: 3rem minmax(0, 1fr);
    padding: 1rem;
  }

  .iac-contact-page .iac-contact-route .iac-contact-route-reach {
    grid-column: 2;
    grid-row: 2;
  }
}

/* A long address needs the width the icon column would take. */
@container (max-width: 34rem) {
  .iac-contact-page .iac-contact-route .iac-contact-route-reach {
    grid-column: 1 / -1;
  }
}

/* Doubled text on a narrow screen: the icon gets its own line. */
@container (max-width: 17rem) {
  .iac-site .iac-contact-page .iac-contact-route {
    grid-template-columns: minmax(0, 1fr);
  }

  .iac-contact-page .iac-contact-route .iac-list-row-copy {
    grid-column: 1;
    grid-row: 2;
  }

  .iac-contact-page .iac-contact-route .iac-contact-route-reach {
    grid-row: 3;
  }
}

/* Stacked rows take their natural height: equal heights would open a gap
   under the shorter sentences. Matches the width at which they stack. */
@media (max-width: 975px) {
  .iac-contact-page .iac-contact-routes {
    grid-auto-rows: auto;
  }
}

/* 3. Pages that may answer the question. Open columns, so a shorter list of
   links leaves no empty box; subgrid lines up titles, text and links. */
.iac-contact-help .iac-shell {
  container-type: inline-size;
}

.iac-contact-help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(1.5rem, 4vw, 3.5rem);
  margin-top: clamp(2rem, 4vw, 3rem);
}

.iac-contact-page .iac-contact-help-card {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  row-gap: .5rem;
  padding-top: 1rem;
  border-top: 3px solid var(--iac-accent);
}

.iac-contact-page .iac-contact-help-card > * {
  margin-block: 0;
}

.iac-contact-help-card > p {
  color: var(--iac-muted);
}

.iac-contact-page .iac-contact-help-links > * {
  margin-block: 0;
}

@container (max-width: 40rem) {
  .iac-contact-help-grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2rem;
  }

  .iac-contact-page .iac-contact-help-card {
    grid-row: auto;
    grid-template-rows: none;
  }
}

/* 4. Where to follow along. The newsletter box below is white too, so the two
   join by spacing. Its curve rises into this chapter by --iac-arc and would
   cover the photo's outline without that much room. */
.iac-contact-page .iac-contact-social {
  padding-bottom: calc(var(--iac-arc) + 1.75rem);
}

.iac-contact-social-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 6rem);
}

/* Room for the red outline offset behind the photo. */
.iac-contact-page .iac-contact-social-grid .iac-photo {
  margin-inline-start: 1.25rem;
  margin-block-end: 1.25rem;
}

.iac-contact-page .iac-contact-social .wp-block-social-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1.5rem;
  padding: 0;
}

.iac-contact-page .iac-contact-social .wp-social-link {
  margin: 0;
  border: 1px solid var(--iac-line);
  border-radius: var(--iac-site-radius);
  color: var(--iac-ink);
  background: var(--iac-paper);
}

.iac-contact-page .iac-contact-social .wp-social-link:hover {
  border-color: var(--iac-ink);
  transform: none;
}

.iac-contact-page .iac-contact-social .wp-social-link a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .625rem;
  min-height: 48px;
  padding: .75rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

.iac-contact-page .iac-contact-social .wp-social-link svg {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
}

/* Core sizes these labels at .65em of the icon size. */
.iac-site .iac-contact-page .iac-contact-social .wp-social-link .wp-block-social-link-label {
  padding: 0;
  font-size: 1rem;
}

@media (max-width: 900px) {
  .iac-contact-message-grid,
  .iac-contact-social-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .iac-contact-page .iac-contact-form.iac-bridge-card {
    margin-top: 2rem;
  }

}

@media (max-width: 600px) {
  .iac-contact-page .iac-contact-social-grid .iac-photo {
    margin-inline-start: .75rem;
    margin-block-end: .75rem;
  }

  .iac-contact-form div.wpforms-container .wpforms-form .wpforms-field-row-block {
    float: none;
    width: 100%;
    margin-left: 0;
  }

  .iac-contact-form div.wpforms-container .wpforms-form .wpforms-field-row-block + .wpforms-field-row-block {
    margin-top: 1rem;
  }
}
