/* Contact page only (C). Linked after site.css. Tokens only; Version 1's breakpoints only (48em, 68.75em).
   Version 1's page and layout (vision 4.5), with three lines added under the blocks and the privacy row at the end. */
@layer components {

  /* The lead sentence of Version 1's page, set as the page-head lead on column 5 (desktop). */
  .contact-lead b { font-weight: var(--w-bold); }

  /* Layout: the scheduler first (it is the page's main action), then email and address, then the map, then privacy.
     Phone: one column in that order. Tablet: the scheduler across, details and map side by side, privacy across.
     Desktop: details and map on columns 1 to 4, the scheduler on columns 5 to 12, privacy across all twelve. */
  .contact-page { margin-top: var(--s-8); grid-template-areas: "book" "info" "map" "privacy"; gap: var(--s-7) var(--gutter); }
  .contact-page__book { grid-area: book; display: grid; grid-template-rows: auto auto 1fr; gap: 0.625rem; min-width: 0; }   /* caption, line, box: only the box grows with the column */
  .contact-page__info { grid-area: info; display: grid; gap: var(--s-6); align-content: start; padding-top: var(--s-5); border-top: var(--hair) solid var(--ink); }
  .contact-page__map { grid-area: map; display: flex; flex-direction: column; gap: 0.625rem; min-width: 0; }

  @media (min-width: 48em) {
    .contact-page { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "book book" "info map" "privacy privacy"; }
  }
  @media (min-width: 68.75em) {
    .contact-page {
      grid-template-columns: repeat(12, minmax(0, 1fr));
      grid-template-rows: auto 1fr auto;
      grid-template-areas:
        "info info info info book book book book book book book book"
        "map  map  map  map  book book book book book book book book"
        "privacy privacy privacy privacy privacy privacy privacy privacy privacy privacy privacy privacy";
      margin-top: var(--s-6);
    }
    /* the rule over the email lines up with the rule under the scheduler's caption */
    .contact-page__info { margin-top: calc(2.75rem - var(--hair)); }
  }

  /* captions over the scheduler and under the map: the instrument layer */
  .contact-page__cap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--s-4); min-height: 2.75rem; border-bottom: var(--hair) solid var(--ink); }
  .contact-page__map .contact-page__cap { border-bottom: 0; border-top: 0; min-height: 0; }
  .contact-page__map .contact-page__out { margin-left: auto; }   /* the new address is longer: when the link wraps, it keeps to the right */
  .contact-page__cap b { font-weight: 500; color: var(--ink); }
  .contact-page__out {
    display: inline-flex; align-items: center; gap: 0.45em; min-height: 2.75rem; color: var(--ink);
    text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color var(--dur-2);
  }
  .contact-page__out .icon { transition: translate var(--dur-2) var(--ease-out); }
  .contact-page__out:hover { text-decoration-color: currentColor; }
  .contact-page__out:hover .icon { translate: 2px -2px; }

  /* the line under each block's label or value: who takes the call and what to bring (01), what to email (02),
     where the building is (03). Quieter than the values, never wider than the measure. */
  .contact-page__line, .contact-page__note { font-size: var(--fs-small); line-height: 1.55; color: var(--ink-2); max-width: var(--measure); }
  .contact-page__line { padding-top: var(--s-1); }
  .contact-page__note { margin-top: var(--s-2); }

  /* email and address */
  .contact-page__info .contact__item .mono { margin-bottom: var(--s-2); }
  .contact-page__mail { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-3); }
  .contact-page__mail > a {
    font-size: var(--fs-h4); letter-spacing: -0.012em; text-decoration: underline; text-decoration-color: var(--line);
    text-decoration-thickness: 1px; text-underline-offset: 0.25em; transition: text-decoration-color var(--dur-2);
  }
  .contact-page__mail > a:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
  .contact-page__addr { font-size: var(--fs-h4); font-weight: var(--w-strong); letter-spacing: -0.012em; line-height: 1.45; }
  @media (max-width: 47.99em) {
    .contact-page__mail > a, .contact-page__addr { font-size: var(--fs-body); }
  }

  /* the "Copy" button style is shared (site.css 5.24) */

  /* 04 privacy: a full-width row at the end; the label on columns 1 to 4, the text on columns 5 to 11 (desktop) */
  .contact-page__privacy {
    grid-area: privacy; display: grid; gap: var(--s-3) var(--gutter); align-items: start;
    margin-top: var(--s-6); padding-top: var(--s-5); border-top: var(--hair) solid var(--ink);
  }
  .contact-page__privacy-label { display: block; }
  .contact-page__privacy-text { display: grid; gap: var(--s-3); max-width: var(--measure); }
  .contact-page__privacy-text p { font-size: var(--fs-small); line-height: 1.65; color: var(--ink-2); }
  .contact-page__mailto {
    color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-3);
    text-decoration-thickness: 1px; text-underline-offset: 0.2em; overflow-wrap: anywhere;
  }
  .contact-page__mailto:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
  @media (min-width: 68.75em) {
    .contact-page__privacy { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .contact-page__privacy-label { grid-column: 1 / span 4; padding-top: 0.15rem; }
    .contact-page__privacy-text { grid-column: 5 / span 7; }
  }

  /* the two outside services */
  .contact-page__map .embed--map { flex: 1 0 auto; min-height: 0; aspect-ratio: 4 / 3; }
  @media (min-width: 68.75em) {
    .contact-page__map .embed--map { aspect-ratio: auto; min-height: 18rem; }
  }

  /* #book: every "Book a call" lands on the scheduler's box. The box keeps room above it for the caption and the
     line (--book-head: the caption, the line at two lines from 48em and four below, and the two gaps), so the block
     arrives whole, its caption 24 px under the header (html's scroll-padding-top adds the header and the 24 px). */
  .contact-page__book { --book-head: calc(2.75rem + 2 * 0.625rem + var(--s-1) + 2 * 1.55 * var(--fs-small)); }
  .embed--book { --embed-h: 44rem; scroll-margin-top: var(--book-head); }
  @media (max-width: 47.99em) {
    .contact-page__book { --book-head: calc(2.75rem + 2 * 0.625rem + var(--s-1) + 4 * 1.55 * var(--fs-small)); }
    /* on a phone the scheduler fills the screen under the header and the block's head when Book a call is pressed */
    .embed--book { --embed-h: clamp(34rem, 100svh - var(--header-h) - var(--hair) - var(--s-5) - var(--book-head), 46rem); }
  }

  /* the loading state and the fade-in of the frames are shared (site.css 5.24) */

  @media print {
    .contact-page__privacy { break-inside: avoid; }
    .contact-page .embed { display: none; }       /* an outside service never prints: the box would be an empty grey frame */
  }
}
