/* =========================================================
   Property Profile Flyer CSS (consolidated, grid-areas edition)
   ========================================================= */

.bwpp-profile {
  --bwpp-accent: #9A63B4;

  /* Screen */
  --bwpp-hero-height: 500px;
  --bwpp-overlay-height: 52%;
  --bwpp-title-offset: 28px;
  --bwpp-price-col: 320px;            /* fixed width for price lane on screen */

  /* Print */
  --bwpp-hero-print-height: 3.25in;
  --bwpp-price-col-print: 2.4in;      /* fixed width for price lane in print */

  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #111;
}

/* Optional on-screen control */
.bwpp-print {
  position: fixed; right: 20px; top: 20px; z-index: 10;
  padding: 8px 14px; background: var(--bwpp-accent); color:#fff;
  border:0; border-radius:8px; cursor:pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}

/* Second control: Unbranded */
.bwpp-print-unbranded{
  right: 160px;               /* sit to the left of the default button */
  background: #444;           /* neutral tone to distinguish */
}

/* If WordPress admin bar is showing, push buttons below it */
body.admin-bar .bwpp-print{ top: 72px; }
@media screen and (max-width: 782px){
  body.admin-bar .bwpp-print{ top: 90px; } /* mobile admin bar is taller */
}

/* -------------------- HERO -------------------- */
.bwpp-hero{
  position: relative;
  height: var(--bwpp-hero-height);
  margin-bottom: 12px;
  border-radius: 0;
  overflow: hidden;
  line-height: 0;
}
.bwpp-hero > img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block; z-index: 0;
}
.bwpp-hero::before{ display:none !important; }
/* use a real element for overlay to improve PDF reliability */
.bwpp-hero::after{ display:none !important; }
.bwpp-hero-overlay{
  position:absolute; left:0; right:0; top:0;
  height: var(--bwpp-overlay-height);
  background: linear-gradient(to bottom, rgba(0,0,0,.75) 0%, rgba(0,0,0,.40) 60%, rgba(0,0,0,0) 100%);
  pointer-events:none; z-index:1;
}
.bwpp-hero-title{
  position:absolute; top: var(--bwpp-title-offset); left:12px; right:12px;
  text-align:center; color:#fff; text-shadow:0 2px 12px rgba(0,0,0,.55);
  z-index:2;
}
.bwpp-hero-title h1{ margin:0; font-size:32px; font-weight:800; letter-spacing:1px; }
.bwpp-hero-title h3{ margin:6px 0 0; font-weight:600; letter-spacing:.4px; opacity:.95; }

/* -------------------- THUMBS (3-up grid) -------------------- */
.bwpp-thumbs{
  display:grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap:12px; margin:12px 0 16px;
}
.bwpp-thumbs img{ width:100%; height:160px; object-fit:cover; border-radius:0; }

/* -------------------- SPECS + OFFERED -------------------- */
/* Force a 3-lane grid with named areas so price NEVER drops below */
.bwpp-specs{
  display:grid !important;
  grid-template-columns: 1fr 1fr var(--bwpp-price-col);
  grid-template-areas: "left right price";
  column-gap:24px !important;
  align-items:start !important;
}
.bwpp-specs-left  { grid-area:left;  }
.bwpp-specs-right { grid-area:right; }
.bwpp-offered     { grid-area:price; }

/* Stack rows in cols, allow them to shrink, and wrap normally */
.bwpp-specs-left,
.bwpp-specs-right{
  min-width:0 !important; width:auto !important;
  display:grid !important;
  grid-auto-rows:min-content !important;
  row-gap:6px !important;
  overflow-wrap:anywhere;             /* prevents long values from forcing width */
}
.bwpp-specs-left > *,
.bwpp-specs-right > *{ display:block !important; }

.bwpp-specs strong{ font-weight:700; }

.bwpp-offered{
  margin:0 !important;
  justify-self:end !important;
  text-align:right !important;
  padding:8px 12px !important;
  border-left:4px solid var(--bwpp-accent) !important;
}
.bwpp-offered-label{ font-weight:800; margin-bottom:6px; color: var(--bwpp-accent); }
.bwpp-price{ font-weight:800; font-size:26px; line-height:1.15; white-space:nowrap; }
.bwpp-price + .bwpp-price{ margin-top:4px; }

/* -------------------- BODY -------------------- */
.bwpp-desc{ margin:16px 0; line-height:1.45; text-align:justify; }
.bwpp-hoa{  margin:12px 0 20px; font-weight:600; }

/* -------------------- FOOTER -------------------- */
.bwpp-footer{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-top:6px; }
.bwpp-agent{ display:flex; align-items:flex-start; gap:12px; }
.bwpp-agent-photo{ width:80px; height:80px; border-radius:999px; object-fit:cover; flex:0 0 80px; }
.bwpp-agent-lines{ line-height:1.35; }
.bwpp-agent-title{ font-weight:700; }
.bwpp-agent-line a{ color:inherit; text-decoration:none; border-bottom:1px solid #ddd; }
.accent{ color: var(--bwpp-accent); }
.bwpp-qr img{ width:140px; height:140px; }

/* -------------------- LEGAL -------------------- */
.bwpp-legal{ margin-top:16px; font-size:10px; color:#555; }
.bwpp-legal-unbranded{ display:none; margin-top:16px; font-size:10px; color:#555; }

/* Unbranded mode toggled on the root container */
.bwpp-profile.unbranded .bwpp-footer{ display:none !important; }
.bwpp-profile.unbranded .bwpp-legal{ display:none !important; }
.bwpp-profile.unbranded .bwpp-legal-unbranded{ display:block !important; }

/* -------------------- UTILITIES -------------------- */
.nowrap{ white-space:nowrap; }

/* -------------------- PRINT (single page) -------------------- */
@media print{
  @page { size: Letter; margin: 0.45; }

  .bwpp-profile{
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
    margin:0 !important; padding:0 !important; color:#111;
  }

  /* Hide on print */
  .bwpp-print, .bwpp-download, [data-print-hide]{ display:none !important; visibility:hidden !important; }

  /* Keep blocks together */
  .bwpp-hero, .bwpp-thumbs, .bwpp-specs, .bwpp-desc, .bwpp-hoa, .bwpp-footer, .bwpp-legal{
    break-inside: avoid; page-break-inside: avoid;
  }

  /* Hero (print) */
  .bwpp-hero{ height: var(--bwpp-hero-print-height) !important; margin-bottom: 0.18in !important; }
  .bwpp-hero > img{ z-index:0 !important; }
  /* Default: show live overlay element in print */
  .bwpp-hero-overlay{
    display:block !important;
    /* Use raster gradient to avoid Acrobat dropping CSS gradients */
    background: none !important;
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAEACAYAAAByPhyYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFwSURBVDhPPcRXOxBgAIbhj+xRiOyyUpRRKsqopIxKUUZRKmVVokmiZKRQyU5DCNEkhPDXXM/Jex/cxhizZowxq2qF/qtlWqJF+qcWaF7N0V+apRn1h36rX/STftB3NU1T6htN0gSNq680pkZphL7QsPpMn9RH+kBD9F4N0oDqpz7qpR7VTe9UF72lN/RadVKHaqdX9JLa1AtqVS3UTE30XDXSM/WUGqienqg6eqxqqYYe0UP1gO6re3SXqqlK3aFKdZtu0U2qUOVUpkqphG7QdVVM19RVukJFdFldokIqUBfpAuWrPMqlHHWezlG2yqKzdEZl0mk6pU5SBqWrNEqlE+o4pdAxlUxH6Yg6TEmUqBIong6pgxRHseoA7ad9Kob20h4VTVEqkiJoN+1S4RSmdtIOCqXtKoSCVRAFUgBtU1vJX/mRL/mQt/IiT7WFPMidNis3clUutIk2krNyIkflQPZkR7bKhqyVFW0gS7JQZh2H6l+ZP/xmpwAAAABJRU5ErkJggg==");
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
    background-position: top left !important;
  }
  /* If we baked the overlay into the image, hide the live element to avoid double-darkening */
  .bwpp-hero.baked-overlay .bwpp-hero-overlay{ display:none !important; }
  /* If compositing failed, ensure overlay shows */
  .bwpp-hero.has-fallback-overlay .bwpp-hero-overlay{ display:block !important; height: var(--bwpp-overlay-height) !important; }
  .bwpp-hero-title{ top: 0.40in !important; }
  .bwpp-hero-title,
  .bwpp-hero-title h1,
  .bwpp-hero-title h3{ color:#fff !important; text-shadow:0 2px 12px rgba(0,0,0,.55) !important; }
  .bwpp-hero-title h1{ font-size: 22pt !important; font-weight:800 !important; letter-spacing:1px !important; }
  .bwpp-hero-title h3{ font-size: 12pt !important; font-weight:600 !important; letter-spacing:.4px !important; }

  /* Thumbs (print) */
  .bwpp-thumbs{ gap: 0.12in !important; margin: 0.12in 0 0.18in !important; }
  .bwpp-thumbs img{ height: 1.05in !important; border-radius:0 !important; }

  /* Specs row (print): same grid, fixed price lane */
  .bwpp-specs{
    grid-template-columns: 1fr 1fr var(--bwpp-price-col-print) !important;
    column-gap: 0.20in !important;
    margin-bottom: 0.12in !important;
  }
  .bwpp-specs-left,
  .bwpp-specs-right{
    row-gap: 0.06in !important;
    font-size: 11pt !important; line-height: 1.25 !important;
  }
  .bwpp-specs strong{ font-size: 11pt !important; font-weight:700 !important; }

  .bwpp-offered{
    padding: 0.06in 0.12in !important;
    border-left: 0.06in solid var(--bwpp-accent) !important;
  }
  .bwpp-price{ font-size: 18pt !important; line-height:1.1 !important; white-space:nowrap !important; }

  /* Body + HOA: compact so everything fits one page */
  .bwpp-desc{ font-size: 10.5pt !important; line-height: 1.35 !important; margin: 0.12in 0 !important; text-align: justify !important; }
  .bwpp-hoa {  font-size: 11pt !important; margin: 0.08in 0 0.12in !important; }

  /* Footer + legal */
  .bwpp-agent-photo{ width: 0.9in !important; height: 0.9in !important; }
  .bwpp-qr img{ width: 1.2in !important; height: 1.2in !important; }
  /* Legal: normal flow, small spacing to save space */
  .bwpp-legal,
  .bwpp-legal-unbranded{
    position: static !important;
    font-size: 8pt !important; line-height: 1.3 !important; color:#555 !important;
    margin-top: 0.06in !important; margin-bottom: 0 !important; padding: 0 !important;
  }

  /* Footer: trim spacing at bottom */
  .bwpp-footer{ margin-top: 0.08in !important; margin-bottom: 0 !important; }

  /* Don't append raw URLs like (mailto:...) */
  a[href]:after, a[href^="mailto:"]::after, a[href^="http"]::after { content:none !important; }
}



/* ===== Prices in red (screen + print) ===== */
.bwpp-price, .bwpp-offered-label { color: var(--bwpp-accent); }

/* ===== Footer: 3-column grid (Agent | Logo | QR) ===== */
.bwpp-footer{
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;    /* left and right take equal space; logo stays centered */
  align-items: end !important;
  gap: 16px !important;
}
.bwpp-agent{ justify-self: start; display:flex; align-items:flex-start; gap:12px; }
.bwpp-logo{ justify-self: center; }
.bwpp-logo img{width: auto; display:block; }
.bwpp-qr{ justify-self: end; }
.bwpp-qr img{ width: 120px; height: 120px; }

/* Keep agent name red in print too */
@media print{
  .accent{ color: var(--bwpp-accent) !important; }

  /* Smaller QR in print for cleaner alignment */
  .bwpp-qr img{ width: 1.05in !important; height: 1.05in !important; }

  /* If logo looks small on your printer, bump here */
  .bwpp-logo img{ height: 0.5in !important; }
}


/* Screen – already red, keep it consistent */
.bwpp-price, .bwpp-offered-label { color: var(--bwpp-accent); }
.bwpp-offered { border-left-color: var(--bwpp-accent); }

/* Print – force accent colors */
@media print {
  .bwpp-profile { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .bwpp-price, .bwpp-offered-label { color: var(--bwpp-accent) !important; }
  .bwpp-offered { border-left-color: var(--bwpp-accent) !important; }
  .accent { color: var(--bwpp-accent) !important; }
}



/* Logo size controls (screen + print) */
.bwpp-profile {
  --bwpp-logo-h: 55px;      /* screen height */
  --bwpp-logo-h-print: 0.50in; /* print height */
}

.bwpp-footer .bwpp-logo { line-height: 0; }  /* remove inline-gap */
.bwpp-footer .bwpp-logo img{
  height: var(--bwpp-logo-h) !important;
  width: auto !important;
  max-height: none !important;
  display: block !important;
}

@media print{
  .bwpp-footer .bwpp-logo img{
    height: var(--bwpp-logo-h-print) !important;
  }
}




/* ---------- Thumbnail sizing knobs ---------- */
.bwpp-profile{
  --bwpp-thumb-h: 160px;     /* screen height (matches your page look) */
  --bwpp-thumb-h-print: 1.60in;  /* print height; bump to 1.65–1.75in if you want larger */
}

/* Screen */
.bwpp-thumbs img{
  height: var(--bwpp-thumb-h);
}

/* Print */
@media print{
  .bwpp-thumbs{
    gap: 0.12in !important;
    margin: 0.14in 0 0.18in !important;
  }
  .bwpp-thumbs img{
    height: var(--bwpp-thumb-h-print) !important;
  }
}


/* SUPER ADD TO ADD TO ADD */


/* --- Footer: center logo between agent and QR --- */
.bwpp-footer{
  display: grid !important;
  grid-template-columns: auto 1fr auto !important; /* agent | (gap) | QR */
  align-items: end !important;                     /* sit on the same baseline */
  gap: 16px !important;
}

.bwpp-agent{ justify-self: start !important; }
.bwpp-logo{ justify-self: center !important; line-height: 0 !important; }
.bwpp-qr{ justify-self: end !important; }

.bwpp-logo img{
  height: var(--bwpp-logo-h, 15px) !important;
  width: auto !important;
  display: block !important;   /* remove inline-gap */
}

@media print{
  .bwpp-footer{
    grid-template-columns: auto 1fr auto !important; /* same logic in print */
  }
  .bwpp-logo img{ height: var(--bwpp-logo-h-print, 0.50in) !important; }
}
