/*
 * Universal Contact Widget - one shared card (web.partials.contact-widget)
 * appearing on Kontakt, Login, Report, About, Terms, Privacy and every Add-a-Business/Claim step.
 *
 * 2026-11-21 restyle (owner handoff "IP Handoff: Contact Card", Option A, docs/IP-Reference.md section CX): the card is the claim card's
 * family (public/css/ip-listing-claim-card.css) - a white card with a 1px border, the page's own corner and no shadow - with a heading in the
 * business-name style, everything else in the body style, an icon in front of each row instead of a label, the copy button as the design
 * system's outline icon button (.btn.btn-tertiary.btn-md.btn-icon-only) and the Primary Regular button (.btn.btn-primary.btn-md) that opens the
 * contact form (not printed on the Kontakt page itself). THE PAGE'S OWN LOOK WINS OVER THE BOARD (owner's standing rule, 2026-11-19 / 2026-11-20): the
 * handoff draws the card with a 16px corner, a shadow and a 12px map corner; the claim card - which it says to match - is live with the map's corner
 * (--radius-md, 8px) and no shadow after the owner's own correction (docs section CI), and the contact map has always had that corner too, so those
 * are the values used here. Since the owner handoff "One Sidebar Layout Standard for the Whole Site" (2026-11-21, docs section DA) what this card and the claim
 * card SHARE - the box: the surface, the 1px border, the map's corner, no shadow, ink text, Lato, and the 20px - is written once, as the .sidebar-card class in
 * web.css, which both cards carry; this file keeps only what is the contact card's own. The numbers with no token are kept as the handoff gives them: the 20px
 * padding - also the gap between the two columns of the tablet layout - is the one custom property --sidebar-card-pad of that class (read here as
 * --contact-card-space), so the owner can round it to the scale in one place, the icons' 20px and the map's three heights (150 / 170 / 220px); everything else is a token.
 * Type: Lato (--font-sans) - the heading is the business-name style (--listing-title-*: 20 / 24, weight 400), the subline is the body style (--body-size,
 * --body-line-height: 16 / 24), and the e-mail and the address are 14px (owner 2026-11-21, on the live card: "Make a highlighted text size 14, not 16"; their
 * line height stays the body style's 24px). The design system has no 14px body-text token: the Regular button's size, --button-md-size, is the one 14px
 * token, so the two rows read it. No weight is written for any of them - it is INHERITED from the page.
 *
 * LAYOUT, by the width of the CARD (a container query, not the screen's - the card lives in the sidebar column of the site's one sidebar layout, col-lg-4 col-md-4:
 * 360px from 1200px of screen, 293px from 992 to 1199px, and below 992px the column goes under the page's content and gives the card the whole row, up to 720px):
 * stacked - heading + subline, the rows, the map, the button -
 * on a phone (under 700px) and in any column narrower than 480px of card; from 700px of screen and 480px of card the heading, the rows and the button
 * are the left column and the map is the right one, as tall as the left (220px at least), 20px apart. The map is 150px high on a phone and 170px
 * from 700px of screen when stacked. (The handoff's 1024px breakpoint needs no rule of its own: from 992px every host column is 360px or less and stays stacked; below 992px the card
 * has the whole row, where the two columns are the better fit.)
 * In a browser with no container-query support the @container rule is simply skipped and every width stays on the plain stacked layout.
 */
.contact-widget-card {
  --contact-card-space: var(--sidebar-card-pad);   /* the card's padding and the tablet layout's column gap: the 20px every sidebar card shares (.sidebar-card, web.css) - no token (the scale is 16 / 24) */
  container-type: inline-size;
  width: 100%;
  padding: var(--contact-card-space);
}

/* The four blocks, 16px apart: heading + subline, the rows, the map, the button. The left column (.contact-widget-main) is not a box while the card is
   stacked (display: contents), so the map can sit between the rows and the button; the button's own `order` puts it last. */
.contact-widget-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4, 16px);
}
.contact-widget-main {
  display: contents;
}

/* Heading + subline, 2px apart (the boxes' own gap). */
.contact-widget-intro {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.contact-widget-card .contact-widget-heading {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;      /* the type of every box on the side (owner 2026-11-28: "adjust Questions? Write to us to fit the typography of the other boxes", "across the entire site", then "size 16, font weight 500,
                           the line below size 13, the e-mail and address too"): heading 16 / 22 weight 500, */
  line-height: 22px;
  font-weight: 500;
  color: var(--ink, #44555b);
}
.contact-widget-card .contact-widget-message {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;      /* the line under it 13 / 18, */
  line-height: 18px;
  color: var(--ink, #44555b);
}

/* The rows, 12px apart: an icon, 8px, the text, vertically centred - the e-mail row ends with the copy button. */
.contact-widget-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 12px);
}
.contact-widget-row {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  min-width: 0;
}
.contact-widget-row > .ph {
  flex: none;
  font-size: 20px;
  line-height: 1;
  color: var(--ink, #44555b);
}
/* position:relative + the ::before below give the e-mail link a real 44px-tall tap target (IP-Help-Widget.md §3's own locked phone-check rule) without
   visually growing the compact row itself - the pseudo-element is an invisible, absolutely-positioned overlay centered on the link's own line, not
   extra padding/line-height that would push the next row further apart. A long address wraps (break anywhere - the markup also offers a soft break
   after the @) so the copy button beside it is never pushed out of the card. */
.contact-widget-link {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 18px;
  color: var(--brand-blue, #3270a2);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.contact-widget-link::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  min-height: 44px;
  transform: translateY(-50%);
}
.contact-widget-link:hover {
  color: var(--link-hover, #3c77a6);
  text-decoration: underline;
}
.contact-widget-link:focus-visible {
  outline: 2px solid var(--focus-ring, #3270a2);
  outline-offset: 2px;
}
.contact-widget-text {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 18px;
  color: var(--ink, #44555b);
  overflow-wrap: anywhere;
}

/* The copy button is the design system's outline icon button (.btn.btn-tertiary.btn-md.btn-icon-only: 40 x 40, radius-lg, white fill, 1px border, ink
   icon, the light-blue hover - web.css and ip-outline.css own all of that). Only what the legacy .btn base would otherwise add is taken off here: its
   10px margin, the side padding of .btn.btn-md and the 15px margin it puts after an icon; the icon is 20px. The selector has THREE classes on purpose:
   most host pages link this stylesheet BEFORE web.css, and a tie with .btn.btn-md (two classes) would be won by web.css and leave its 16px side padding on. */
.contact-widget-card .contact-widget-row .contact-widget-copy-btn {
  flex: none;
  margin: 0;
  padding: 0;
}
/* The copy button is a ROUND 32 x 32 icon button (owner handoff "Listing Page: Contact Card", 2026-11-27 - on every page that carries the card): a circle (radius-pill), white fill, the 1px #dedede border (the outline
   family's, ip-outline.css) and the copy icon at 18px (as the close X and the scroll-to-top). It is the design system's small Tertiary button (.btn.btn-tertiary.btn-sm, 32px high) made square and round - no longer the legacy
   .btn-icon-only, whose radius is !important. The clickable area stays 44px (the invisible ::before, as the close buttons have) without growing the 32px circle. */
.contact-widget-card .contact-widget-row .contact-widget-copy-btn {
  position: relative;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--radius-pill, 999px);
}
.contact-widget-card .contact-widget-row .contact-widget-copy-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
.contact-widget-row .contact-widget-copy-btn .ph {
  margin: 0;
  font-size: 18px;   /* the icon size of the other round icon buttons (the close X, the scroll-to-top) - owner 2026-11-27, was 20px */
  line-height: 1;
}
/* The two feedback states of the click (the script swaps the icon and the aria-label too) keep their own colors, and restate them on :hover so the
   family's light-blue hover doesn't paint over the confirmation while the pointer is still on the button. */
.contact-widget-row .contact-widget-copy-btn.is-copied,
.contact-widget-row .contact-widget-copy-btn.is-copied:hover {
  border-color: var(--secondary-dark, #47810f);
  background: var(--success-bg, #f3f8ee);
  color: var(--secondary-dark, #47810f);
}
.contact-widget-row .contact-widget-copy-btn.is-error,
.contact-widget-row .contact-widget-copy-btn.is-error:hover {
  border-color: var(--danger-text, #9e4a46);
  color: var(--danger-text, #9e4a46);
}

/* The button that opens the contact form: the Primary Regular button, full width of its column, last of the blocks while the card is stacked. Regular is
   the design system's 14 / 18 / 600 (--button-md-*), the same three tokens the claim card's buttons take. */
.contact-widget-card .contact-widget-form-btn {
  order: 1;
  margin: 0;
  font-size: var(--button-md-size, 14px);
  line-height: var(--button-md-line-height, 18px);
  font-weight: var(--button-md-weight, 600);
}

/* The map: the existing Google map, its native controls and its marker. 150px high on a phone, 170px from 700px of screen when stacked, and the
   height of the left column (220px at least) in the tablet layout below. */
.contact-widget-map {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 150px;
  border: 1px solid var(--border, #dedede);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
}
@media (min-width: 700px) {
  .contact-widget-map {
    height: 170px;
  }
  /* Two equal columns - heading, subline, rows and the button on the left, the map on the right - once the card itself has the room (480px of card:
     each column is then at least 230px). A narrow column stays stacked at any screen width. */
  @container (min-width: 480px) {
    .contact-widget-body {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      column-gap: var(--contact-card-space);
    }
    .contact-widget-main {
      display: flex;
      flex-direction: column;
      gap: var(--space-4, 16px);
      min-width: 0;
    }
    .contact-widget-map {
      height: auto;
      min-height: 220px;
    }
  }
}

/* The modifier of the sidebar column that hosts this card (Kontakt, Log in, Forgot password, Verify, Report, About, Terms, Privacy, every Add-a-Business and
   Claim step). The column itself is the site's one sidebar layout - sidebar-content col-lg-4 col-md-4 beside page-content col-lg-8 col-md-8 (docs section DA);
   its width is the grid's and nothing here sets one - it used to (360px, and 100% below 992px), which beat the grid on the pages that load this file after
   web.css (Terms, Privacy, About) and made the same card 300 / 330 / 360px wide. What is left is the card's own spacing: below 992px the column is under the
   content, and the card sits 24px below it. The widget fills whatever this (or any other) container gives it. */
@media (max-width: 991px) {
  .contact-widget-col {
    margin-top: var(--space-5, 24px);
  }
}
