/*
 * Age Care Bathrooms Room Colour Planner: the card, the repeat button and the full screen overlay.
 *
 * Everything is scoped to .acb-planner-* so nothing here can affect the rest of the page, and so
 * the theme's own styling for a, p, button and img cannot reshape any of it.
 *
 * Type sizes are all 1rem or above on purpose. Our customers are 55+, so nothing here shrinks
 * text for the sake of density.
 */

.acb-planner-embed, .acb-planner-embed *,
.acb-planner-overlay, .acb-planner-overlay *,
.acb-planner-inline, .acb-planner-inline * { box-sizing: border-box; }

.acb-planner-embed, .acb-planner-overlay, .acb-planner-inline {
  font-family: 'Raleway', system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.55;
}

/* ---- the card ---- */
.acb-planner-embed { margin: 0 0 1.5rem; }

.acb-planner-card {
  display: flex; align-items: stretch; gap: 0;
  text-decoration: none; color: #31404F;
  background: #fff; border: 2px solid #D7DEE5; border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .07);
}
.acb-planner-card:hover, .acb-planner-card:focus-visible {
  border-color: #046BD2; box-shadow: 0 6px 18px rgba(4, 107, 210, .18);
  text-decoration: none;
}
.acb-planner-card:focus-visible { outline: 3px solid #046BD2; outline-offset: 3px; }

.acb-planner-card-media {
  flex: 0 0 42%; position: relative; min-height: 220px;
  background: #046BD2;   /* shows through if the photo is missing, so it still looks deliberate */
}
.acb-planner-card-img {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; border: 0; max-width: none;
}
.acb-planner-card--nomedia .acb-planner-card-media { display: none; }
.acb-planner-card-body {
  flex: 1 1 auto; display: block; padding: 1.6rem 1.8rem;
}
.acb-planner-card-title {
  display: block; font-size: 1.6rem; font-weight: 700; color: #1B2B3A;
  line-height: 1.2; margin: 0 0 .6rem;
}
.acb-planner-card-text {
  display: block; font-size: 1.0625rem; margin: 0 0 1.2rem; color: #31404F;
}
.acb-planner-card-note {
  display: block; font-size: 1rem; color: #5A6B7B; margin: .7rem 0 0;
}

/* ---- the button, used on the card, on its own, and in the fallback ---- */
/* #4790CD is Owen's call. It is lighter than the #046BD2 it replaces, and white on it measures
   3.42:1 where the old blue was 5.20:1. That is below the 4.5:1 WCAG AA needs for normal text, so
   the type is 1.25rem at weight 700 rather than 1.125rem at 600. At 20px bold this counts as large
   text, where the threshold is 3:1, so it passes on that basis instead. Do not shrink it back or
   lighten the weight without either darkening the fill or switching to dark text. Larger and
   bolder suits our 55+ customers anyway.
   font-family: inherit matters because this class is used on a <button> in the fallback, and a
   button does not inherit the page font on its own. */
.acb-planner-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: .7rem 1.6rem;
  background: #4790CD; color: #fff !important;
  font-family: inherit; font-size: 1.25rem; font-weight: 700;
  text-align: center; text-decoration: none;
  border: 0; border-radius: 10px; cursor: pointer;
}
.acb-planner-card:hover .acb-planner-btn { background: #3A7AB0; }

.acb-planner-inline { margin: 1.2rem 0 2rem; text-align: center; }
.acb-planner-btn--inline { width: 100%; max-width: 480px; }
.acb-planner-btn--inline:hover { background: #3A7AB0; }
.acb-planner-btn:focus-visible { outline: 3px solid #1B2B3A; outline-offset: 3px; }

/* ---- the full screen overlay ---- */
.acb-planner-overlay {
  /* !important on the handful of properties a theme could break catastrophically. The overlay is
     reparented to <body> on open, because an Elementor ancestor carrying transform, filter or
     will-change would otherwise make position:fixed resolve against that ancestor instead of the
     viewport, and the overlay would quietly stop covering the screen. */
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  width: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;   /* keeps the bottom of the planner clear of the iOS Safari URL bar */
  margin: 0 !important; padding: 0 !important;
  z-index: 2147483000 !important;   /* Elementor sticky headers 999, popups 9999, admin bar 99999 */
  display: flex !important; flex-direction: column;
  background: #fff;
}
.acb-planner-overlay[hidden] { display: none !important; }

.acb-planner-bar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 12px;
  background: #046BD2; color: #fff;
}
.acb-planner-title {
  margin: 0; font-size: 1.125rem; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Below 560px the full name does not fit beside the Beta chip and the Close button, so the short
   name is used instead of letting it truncate to "Room Colour Pl...". */
.acb-planner-title-short { display: none; }
@media (max-width: 560px) {
  .acb-planner-title-full { display: none; }
  .acb-planner-title-short { display: inline; }
}
/* "Beta", visible for as long as the planner is open, on every device. A translucent chip on the
   blue bar rather than a loud badge: the customer needs to know it is a work in progress, not be
   warned. Never shrinks below 1rem, and never shrinks the Close button to fit. */
.acb-planner-beta {
  flex: 0 0 auto;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .65);
  color: #fff; font-size: 1rem; font-weight: 700; letter-spacing: .05em; line-height: 1.35;
  text-transform: uppercase;
}

/* The spacer still earns its place: it pushes Close to the right now that nothing sits between
   them. .acb-planner-phone is gone, along with every other phone number in the planner. */
.acb-planner-bar-spacer { flex: 1 1 auto; }
.acb-planner-close {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 1.1rem;
  background: #fff; color: #04407F;
  font-family: inherit; font-size: 1.0625rem; font-weight: 700;
  border: 0; border-radius: 10px; cursor: pointer;
}
.acb-planner-close:hover { background: #E8F1FB; }
.acb-planner-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.acb-planner-close-x { font-size: 1.2rem; line-height: 1; }

.acb-planner-frame { position: relative; flex: 1 1 auto; min-height: 0; }
.acb-planner-frame iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  border: 0; display: block;
}

/* Sits over the frame until the planner reports it is ready. */
.acb-planner-msg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .4rem; padding: 24px; text-align: center;
  background: #F4F6F8; color: #31404F; font-size: 1.125rem;
}
.acb-planner-msg[hidden], .acb-planner-msg-fail[hidden] { display: none !important; }
.acb-planner-msg p { margin: 0 0 .8rem; }
/* The one sentence that says what has happened, so it reads first rather than competing with the
   explanation underneath it. Not styled as a warning: nothing the customer did is wrong. */
.acb-planner-msg-lead { font-size: 1.25rem; font-weight: 700; color: #1B2B3A; }
.acb-planner-msg-note { font-size: 1rem; color: #5A6B7B; }

@media (min-width: 901px) {
  .acb-planner-bar { min-height: 64px; padding: 10px 20px; }
  .acb-planner-title { font-size: 1.25rem; }
}

@media (max-width: 700px) {
  .acb-planner-card { display: block; }
  .acb-planner-card-media { min-height: 190px; }
  .acb-planner-card-img { position: relative; height: 190px; }
  .acb-planner-card-body { padding: 1.3rem 1.2rem; }
  .acb-planner-card-title { font-size: 1.35rem; }
  .acb-planner-btn { width: 100%; }
}

/* In the Elementor editor the overlay must never cover the canvas, or the widget becomes
   impossible to select and the page looks broken to whoever is building it. */
body.elementor-editor-active .acb-planner-overlay { display: none !important; }
