/* Bercary Agency - one coherent cover layout, based on index.html.
   All rules limited to four service pages. Minisites are untouched.
   Preserve fonts and text; align content near the bottom of the SAME cover. */

/* Shared typography from index.html */
body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type h1 {
  font-family:Fraunces,Georgia,serif!important;
  font-weight:500!important;
  letter-spacing:-.02em!important;
  line-height:1.12!important;
  font-size:clamp(1.75rem,3vw,3.05rem)!important;
  max-width:870px!important;
  text-wrap:balance;
}
body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type .eyebrow {
  font-family:"Work Sans",Arial,sans-serif!important;
  font-size:11px!important;
  letter-spacing:.18em!important;
  color:#e8ad94!important;
}
body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type p {
  font-family:"Work Sans",Arial,sans-serif!important;
  font-size:clamp(.94rem,1.3vw,1.11rem)!important;
  line-height:1.5!important;
  max-width:680px!important;
}

/* Desktop and landscape tablet: one viewport, minus the measured shared header.
   Do not use min-height:max(520px,...) because that makes the cover taller than the screen. */
@media (min-width:700px) {
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type {
    box-sizing:border-box!important;
    height:calc(100svh - var(--bercary-global-header-height,68px))!important;
    min-height:0!important;
    max-height:none!important;
    width:100%!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:flex-end!important;
    padding-top:clamp(12px,2svh,28px)!important;
    padding-bottom:clamp(20px,3.5svh,40px)!important;
    overflow:hidden!important;
  }
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type>.wrap,
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type>.container {
    flex:0 0 auto!important;
    width:100%!important;
    margin-top:auto!important;
    margin-bottom:0!important;
  }
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type>.hero-copy {
    padding-top:0!important;
    padding-bottom:0!important;
    transform:none!important;
  }
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type .hero-grid {
    min-height:0!important;
    align-content:end!important;
    align-items:end!important;
  }
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type .hero-grid>img {
    max-height:clamp(170px,34svh,290px)!important;
    height:auto!important;
    width:100%;
    object-fit:cover;
  }
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type .hero-copy {
    margin-top:0!important;
    margin-bottom:0!important;
    padding-block:0!important;
  }
}
/* Short Chromebook windows: fit the text with smaller spacing, never make a new full extra screen. */
@media (min-width:700px) and (max-height:650px) {
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type {
    padding-top:10px!important;
    padding-bottom:16px!important;
  }
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type h1 {
    font-size:clamp(1.55rem,2.65vw,2.5rem)!important;
    line-height:1.08!important;
    margin-block:6px 9px!important;
  }
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type p {
    font-size:clamp(.83rem,1.1vw,.96rem)!important;
    line-height:1.35!important;
    margin-bottom:8px!important;
  }
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type .hero-grid>img {
    max-height:30svh!important;
  }
  body[data-service="maps"] main>section.hero:first-of-type .tags {
    margin:8px 0 0!important;
  }
}
/* On narrow phones content may need more than one viewport; keep it readable and never cropped. */
@media (max-width:699px) {
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type {
    box-sizing:border-box!important;
    height:auto!important;
    min-height:calc(100svh - var(--bercary-global-header-height,68px))!important;
    max-height:none!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:flex-end!important;
    padding-top:32px!important;
    padding-bottom:24px!important;
    overflow:visible!important;
  }
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type>.wrap,
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type>.container {
    margin-top:auto!important;
    margin-bottom:0!important;
    width:100%!important;
  }
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type>.hero-copy {
    padding-top:0!important;
    padding-bottom:0!important;
    transform:none!important;
  }
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type h1 {
    font-size:clamp(1.7rem,6.5vw,2.4rem)!important;
  }
  body.bercary-global-main[data-bercary-cover="service"] main>section.hero:first-of-type .hero-grid {
    min-height:0!important;
    align-content:end!important;
  }
}
/* Keep the residential demo compact, without spacer between appointments and leads. */
@media (min-width:821px) {
  body[data-bercary-crm="estate"] #demo .re-layout {--bercary-demo-height:clamp(420px,65svh,475px)!important;}
  body[data-bercary-crm="estate"] #demo .re-chat-panel,
  body[data-bercary-crm="estate"] #demo .re-crm-panel,
  body[data-bercary-crm="estate"] #demo .re-chat-panel>.phone,
  body[data-bercary-crm="estate"] #demo .re-crm-panel>.re-crm {
    height:var(--bercary-demo-height)!important;
    max-height:var(--bercary-demo-height)!important;
    min-height:0!important;
    box-sizing:border-box!important;
  }
}
body[data-bercary-crm="estate"] #demo .re-crm-panel>.re-crm {
  justify-content:flex-start!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  scrollbar-width:thin;
}
body[data-bercary-crm="estate"] #demo .re-crm .re-appointments,
body[data-bercary-crm="estate"] #demo .re-crm .re-prospects {
  flex:0 0 auto!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
}
