/* KBS Engineering: responsive polish layer.
   Loaded after kbs.css (compiled Tailwind, no source on the host), so it only refines.
   Breakpoints match kbs.css: tablet = 768-1023px, desktop = 1024px and up. */

/* ---- type and wrapping --------------------------------------------- */
h1, h2, h3 { text-wrap: balance; }
p, li, dd, figcaption { text-wrap: pretty; }

/* Long emails break only when they cannot fit, never mid-word by default. */
.pz-wrap { overflow-wrap: anywhere; }

/* On phones, and in narrow cards, buttons wrap instead of being clipped. */
.btn > svg { flex-shrink: 0; }
@media (max-width: 639px) {
  .btn { max-width: 100%; white-space: normal; text-wrap: balance; }
}

/* ---- navigation ------------------------------------------------------ */
/* Landscape phones: the open menu scrolls instead of running off screen. */
#mobile-menu { max-height: calc(100dvh - 6.5rem); overflow-y: auto; overscroll-behavior: contain; }

/* ---- touch targets (44px) ------------------------------------------- */
@media (pointer: coarse) {
  .nav-icon-btn { width: 2.75rem; height: 2.75rem; }
  #navbar .btn-sm { min-height: 2.75rem; }
  .mobile-link { min-height: 3rem; }
  .nav-link { min-height: 2.75rem; }
  .btn-text { min-height: 2.75rem; }
  .pz-social > a { min-height: 2.75rem; padding-inline: 1rem; }
  .pz-links a { display: inline-block; padding-block: .75rem; }
  .pz-contact a { display: inline-block; padding-block: .375rem; }
}

/* ---- footer ---------------------------------------------------------- */
.pz-links > * + * { margin-top: .625rem; }
@media (pointer: coarse) { .pz-links > * + * { margin-top: 0; } }

/* The animated CTA gradient passes through light cyan; a navy scrim keeps
   white text above 4.5:1 at every frame. */
.footer-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(3, 26, 46, .38);
  pointer-events: none;
}

/* Phones: Pages and What we do sit side by side instead of stacking. */
@media (max-width: 767px) {
  .pz-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; row-gap: 2.5rem; }
  .pz-footer-grid > :first-child,
  .pz-footer-grid > :last-child { grid-column: 1 / -1; }
}

/* ---- homepage news card --------------------------------------------- */
@media (min-width: 1024px) {
  .pz-news {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 3.5rem;
    align-items: start;
  }
  .pz-news h2 { margin-bottom: 0; }
  .pz-news-body { padding-left: 3.5rem; border-left: 1px solid #334155; }
}

/* ---- rental cards ---------------------------------------------------- */
.pz-card-cta .btn { width: 100%; white-space: normal; text-wrap: balance; }
@media (min-width: 768px) and (max-width: 1279px) {
  .pz-card-cta .btn { padding-inline: 1rem; font-size: .9375rem; }
}

/* ---- tablet layouts --------------------------------------------------- */
/* Single-column stacks waste a 768-1023px screen: pair copy with its media. */
@media (min-width: 768px) and (max-width: 1023px) {
  .pz-tab-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; align-items: start; }
  .pz-tab-2 > .pz-tab-span { grid-column: 1 / -1; }
  .pz-tab-2 > .card { align-self: stretch; }
  /* media beside long copy stays in view while the copy scrolls */
  .pz-tab-2 > figure,
  .pz-tab-2 > .reveal-media { position: sticky; top: 7rem; }
  .pz-tab-2 > [class*="order-"] { order: 0; }
  /* label/value spec lists stack inside half-width cards */
  .pz-tab-2 .spec { grid-template-columns: minmax(0, 1fr); }
}

/* Side-by-side button pairs wrap to a new line rather than squeezing (and
   clipping) a shimmer button narrower than its label. */
.pz-btn-row { flex-wrap: wrap; }
.pz-btn-row > .btn { flex-shrink: 0; }

/* ---- contact form ----------------------------------------------------- */
/* The submit button has overflow:hidden (shimmer), so in a row it could shrink
   below its text and clip it. Keep it whole; stack the note under it until xl. */
.pz-submit-row .btn { flex-shrink: 0; }
@media (min-width: 640px) and (max-width: 1279px) {
  .pz-submit-row { flex-direction: column; align-items: flex-start; }
}
