/* =============================================================================
   Address Profile V1.1 — page-level Share + Download
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Screen — action bar
   ----------------------------------------------------------------------------- */
.coc-address-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}

.coc-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--color-dark);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}
.coc-action:hover {
  border-color: var(--color-slate);
  background: var(--color-bg);
}
.coc-action:active { transform: translateY(1px); }
.coc-action:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.coc-action svg { flex: 0 0 auto; }

/* Download is the primary action — coral, filled */
.coc-action--download {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  margin-left: auto;   /* push to the right on wide screens */
}
.coc-action--download:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: #fff;
}

/* Copy-link feedback states */
.coc-action--copy.is-copied {
  background: var(--color-green-bg);
  border-color: var(--color-green);
  color: var(--color-green);
}
.coc-action--copy.is-error {
  background: var(--color-pink-bg);
  border-color: var(--color-pink-border);
  color: var(--color-primary-deep);
}

@media (max-width: 640px) {
  .coc-address-actions {
    gap: 6px;
    padding-top: 14px;
    margin-top: 14px;
  }
  .coc-action {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  .coc-action--download {
    margin-left: 0;
    width: 100%;
    justify-content: center;
    order: 99;
  }
}

/* The print-only footer is invisible on screen. */
.coc-print-footer {
  display: none;
}

/* =============================================================================
   Print — turns /address/{slug}/ into a clean printable PDF when the
   user clicks Download (which calls window.print()). Tested target: any
   browser's "Save as PDF" destination.
   ============================================================================= */
@media print {
  /* Use full margins on the printed page so headers/footers don't clip text. */
  @page {
    size: Letter;
    margin: 0.6in 0.5in;
  }

  /* Strip site chrome that has no value in a printed profile. */
  .site-header,
  .nav-overlay,
  .nav-drawer,
  .breadcrumb-strip,
  .coc-address-actions,
  .skip-link,
  footer.site-footer,
  .claim-band {
    display: none !important;
  }

  /* Force a white background and dark text — the screen UI uses tinted
     backgrounds that don't print well. */
  html, body {
    background: #fff !important;
    color: #111 !important;
    font-size: 11pt;
    line-height: 1.4;
  }

  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Tighten container padding so cards take the full printable width. */
  .container {
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Card section padding — collapse the section vertical padding so we
     don't waste sheets of paper on whitespace. */
  .section { padding: 0 !important; }
  main.coc-address-page { padding: 0 !important; }

  /* Title block at the top of the print. */
  .coc-address-page__head {
    border-bottom: 2px solid #111;
    padding: 0 0 14pt 0 !important;
    margin: 0 0 14pt 0 !important;
  }
  .coc-address-page__title {
    font-size: 18pt;
    margin: 0 0 4pt 0;
    color: #111;
  }
  .coc-address-page__sub {
    font-size: 11pt;
    color: #444;
    margin: 0;
  }

  /* Cards: stack vertically, single column, no shadows. */
  .coc-card,
  .coc-address-card,
  .coc-address-page > * {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    border-radius: 4pt !important;
    background: #fff !important;
    color: #111 !important;
    margin: 0 0 10pt 0 !important;
    padding: 10pt !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Force a clean break after the hero map so the data cards start on a
     new page — keeps the map legible without crowding card 1's KPI. */
  .coc-card--hero-map {
    page-break-after: always;
    break-after: page;
  }

  /* ECharts canvases sometimes render bigger than printable area —
     constrain to the printed column width. */
  .coc-card canvas,
  .coc-card svg,
  .coc-card .echarts,
  .coc-address-card canvas,
  .coc-address-card svg {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Suppress hover/animation effects in print. */
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  /* Hide any "Loading..." spinners that may still be visible — the print
     should show the final rendered state. */
  .profile-biz-spinner,
  .coc-card__loading,
  .coc-address-card__loading {
    display: none !important;
  }

  /* Print-only footer reveal — attribution + disclaimer + permalink + date. */
  .coc-print-footer {
    display: block !important;
    margin-top: 18pt !important;
    padding-top: 14pt !important;
    border-top: 2px solid #111 !important;
    font-size: 9pt;
    color: #333;
    line-height: 1.45;
    page-break-inside: avoid;
  }
  .coc-print-footer p {
    margin: 0 0 6pt 0;
  }
  .coc-print-attribution {
    font-weight: 700;
    color: #111;
  }
  .coc-print-disclaimer {
    font-style: italic;
  }
  .coc-print-permalink span,
  .coc-print-date span {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 9pt;
    color: #111;
  }

  /* Make external links not print their URL after the anchor text (Chrome
     adds these by default and it's noisy in a card-heavy page). The
     permalink/footer URLs are already spelled out in the footer block. */
  a[href]::after { content: none !important; }
}
