/* -----------------------------------------------------------------------------
 * Wealth Castle — Print stylesheet
 *
 * Applies on print only. Strips site chrome, resets type to ink-friendly,
 * shows URLs alongside links so the printed page is referenceable, and adds
 * @page margins + a running letterhead for the long-form legal pages.
 *
 * Loaded via wp_enqueue_style with media="print" so it never affects screen.
 * -------------------------------------------------------------------------- */

/* ---------- Page geometry ---------- */

@page {
  size: A4;
  margin: 22mm 18mm 22mm 22mm;
}
@page :first {
  margin-top: 28mm; /* room for the first-page letterhead block */
}

/* ---------- Reset to black-on-white ink ---------- */

html, body {
  background: #ffffff !important;
  color: #1a1a1a;
  font-family: "Cormorant Garamond", "Times New Roman", Times, serif;
  font-size: 10.5pt;
  line-height: 1.55;
  -webkit-print-color-adjust: economy;
  print-color-adjust: economy;
}

main, article, section {
  background: #ffffff !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ---------- Hide site chrome ---------- */

.site-header,
.site-footer,
.wc-sticky-cta,
.wc-cookie-banner,
.phase-anchor-nav,
.wc-lead-magnet,
.wc-inline-cta,
.skip-link,
nav.primary-nav,
.mobile-nav,
.mobile-nav-toggle {
  display: none !important;
}

/* ---------- Typography for print ---------- */

h1 {
  font-family: "Cormorant Garamond", "Times New Roman", Times, serif;
  font-size: 24pt;
  font-weight: 400;
  letter-spacing: -0.005em;
  margin: 0 0 6mm;
  color: #0F1F38;
  page-break-after: avoid;
}

h2 {
  font-family: "Cormorant Garamond", "Times New Roman", Times, serif;
  font-size: 14pt;
  font-weight: 400;
  margin: 8mm 0 3mm;
  color: #0F1F38;
  page-break-after: avoid;
  page-break-inside: avoid;
}

h3 {
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 9.5pt;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6B6963;
  margin: 5mm 0 2mm;
  page-break-after: avoid;
}

p {
  margin: 0 0 3mm;
  orphans: 3;
  widows: 3;
}

p.lead, p.meta {
  font-size: 11pt;
  color: #2c2c2c;
  margin-bottom: 5mm;
}

.eyebrow {
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 8pt;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #6B6963;
}

ul, ol {
  margin: 0 0 4mm;
  padding-left: 6mm;
  page-break-inside: avoid;
}
ul li, ol li {
  margin-bottom: 1.5mm;
}

blockquote {
  margin: 4mm 0 4mm 6mm;
  padding-left: 4mm;
  border-left: 1pt solid #C9A45C;
  font-style: italic;
  color: #2c2c2c;
  page-break-inside: avoid;
}

table {
  page-break-inside: avoid;
  border-collapse: collapse;
  width: 100%;
  margin: 3mm 0 5mm;
  font-size: 10pt;
}
th, td {
  padding: 1.5mm 2mm;
  border-bottom: 0.4pt solid #c0c0c0;
  text-align: left;
}

img {
  max-width: 100%;
  page-break-inside: avoid;
}

/* ---------- Links — show URLs in print ---------- */

a:link, a:visited {
  color: #0F1F38;
  text-decoration: underline;
}

/* Show URL after external links so the printed page is referenceable.
   Skip internal anchors (#...) and tel:/mailto: links where the visible
   text is already the destination. */
a[href^="http"]:after,
a[href^="https"]:after {
  content: " <" attr(href) ">";
  font-size: 8.5pt;
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #6B6963;
  word-break: break-all;
}
a[href^="mailto:"]:after,
a[href^="tel:"]:after,
a[href^="#"]:after {
  content: "";
}

/* ---------- Legal-page specifics ---------- */

body.legal-page-template article.legal-page {
  max-width: none;
  padding: 0;
}

.legal-page > header {
  border-bottom: 0.4pt solid #C9A45C;
  margin-bottom: 8mm;
  padding-bottom: 4mm;
}
.legal-page > header .eyebrow {
  display: block;
  margin-bottom: 2mm;
}
.legal-page > header .meta {
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 8.5pt;
  color: #6B6963;
}

.legal-page h2 .num {
  display: inline-block;
  margin-right: 2mm;
  color: #C9A45C;
  font-weight: 300;
}

address {
  font-style: normal;
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 10pt;
  line-height: 1.6;
  margin: 2mm 0 4mm;
}

/* ---------- Running letterhead on the first page ----------
 *
 * For the legal pages, prepend a small letterhead block to the body so the
 * printed page identifies the practice + document. The ::before content is
 * inserted in the @page margin box on supporting browsers.
 *
 * Chromium-based browsers + Safari support @page margin boxes.
 * Firefox supports a subset. Where unsupported, the header simply doesn't
 * appear — the body content still prints fine.
 * --------------------------------------------------------- */

body.legal-page-template {
  counter-reset: page;
}

@page {
  @top-right {
    content: "Wealth Castle FZCO";
    font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 8.5pt;
    color: #6B6963;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  @bottom-right {
    content: counter(page) " of " counter(pages);
    font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 8.5pt;
    color: #6B6963;
  }
  @bottom-left {
    content: "thewealthcastle.com";
    font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 8.5pt;
    color: #6B6963;
  }
}

/* ---------- Avoid awkward breaks ---------- */

section, article {
  page-break-inside: auto;
}

.card, .insight-card {
  page-break-inside: avoid;
}

/* ---------- Defensive: hide elements the screen styles position absolutely
 *  off-page (the visually-hidden helper, honeypot fields, etc.) so they
 *  don't smear into the printed output.
 * --------------------------------------------------------- */

.visually-hidden,
input[name="company_size"],
[aria-hidden="true"] {
  display: none !important;
}

/* Forms shouldn't print at all — counsel won't fax them back. */
form {
  display: none !important;
}
