/**
 * BAC Inicio v1.3.0-J6 — responsive, reflow and accessibility hardening.
 *
 * This layer does not redesign J2–J5. It resolves cross-component behavior at
 * small widths, zoom/reflow, focus, touch, reduced motion and modal states.
 */

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

.bac-home,
.bac-home *,
.bac-contact-dialog,
.bac-contact-dialog *{
  min-inline-size:0;
}

.bac-home :where(h1,h2,h3,h4,p,li,a,button,strong,span),
.bac-contact-dialog :where(h2,p,label,button,input,select){
  overflow-wrap:anywhere;
}

.bac-home-section[tabindex="-1"]:focus,
.bac-home-section[tabindex="-1"]:focus-visible{
  outline:0;
  box-shadow:none;
}

.bac-home-section[tabindex="-1"]:focus .bac-home-section__header h2,
.bac-home-section[tabindex="-1"]:focus-visible .bac-home-section__header h2{
  text-decoration:underline;
  text-decoration-color:var(--accent);
  text-decoration-thickness:.08em;
  text-underline-offset:.18em;
}

.bac-home :where(a,button,input,select,[tabindex]):focus-visible,
.bac-contact-dialog :where(a,button,input,select,[tabindex]):focus-visible{
  outline:3px solid var(--institutional);
  outline-offset:3px;
  box-shadow:0 0 0 2px var(--paper);
}

.bac-home-hero :where(a,button):focus-visible,
.bac-home-office-gallery :where(button,[tabindex]):focus-visible,
.bac-home-exterior :where(button,[tabindex]):focus-visible{
  outline-color:var(--paper);
  box-shadow:0 0 0 3px var(--accent);
}

.bac-home-route,
.bac-home-area__toggle,
.bac-home-penal-group__toggle,
.bac-home-team-selector__button,
.bac-home-team-action,
.bac-home-work-card__toggle,
.bac-home-office-gallery__control,
.bac-home-office-gallery__close,
.bac-home-exterior__close,
.bac-home-directions__maps,
.bac-home-directions__exterior-trigger,
.bac-home-final-action,
.bac-contact-dialog__close{
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}

.bac-home-area__toggle,
.bac-home-penal-group__toggle,
.bac-home-work-card__toggle,
.bac-home-team-selector__button{
  scroll-margin-top:calc(var(--bac-admin-bar-height,0px) + var(--bac-stage-bar-height,0px) + var(--bac-header-height,96px) + 1rem);
}

.bac-home-office-gallery{
  touch-action:pan-y pinch-zoom;
}

.bac-home-office-gallery__control,
.bac-home-office-gallery__close,
.bac-home-exterior__close{
  min-inline-size:48px;
  min-block-size:48px;
}

.bac-home-office-gallery__slide figcaption,
.bac-home-exterior figcaption{
  padding-inline-end:3.5rem;
}

.bac-contact-dialog{
  padding:max(0px,env(safe-area-inset-top)) max(0px,env(safe-area-inset-right)) max(0px,env(safe-area-inset-bottom)) max(0px,env(safe-area-inset-left));
}

.bac-contact-dialog__panel{
  overflow-x:hidden;
}

.bac-contact-dialog__close{
  inset-block-start:max(12px,env(safe-area-inset-top));
}

body.bac-contact-dialog-open{
  overscroll-behavior:none;
}

@media (hover:none){
  .bac-home-route:hover{
    padding-inline:0;
    background:transparent;
    color:var(--paper);
  }
  .bac-home-route:hover .bac-home-route__copy>span:last-child{color:#c7d4d9}
  .bac-home-route:hover .bac-home-route__arrow{transform:none;color:#f0b9a8}
}

/* 200% zoom on a common desktop viewport resolves close to 640 CSS px. */
@media (max-width:640px){
  .bac-home-section{padding-block:clamp(3.6rem,12vw,4.5rem)}
  .bac-home-section__header{margin-bottom:2.25rem}

  .bac-home-hero__inner,
  .bac-home-team-actions,
  .bac-home-final-actions,
  .bac-home-directions__actions{
    grid-template-columns:minmax(0,1fr);
  }

  .bac-home-route{
    grid-template-columns:minmax(0,1fr) 2rem;
  }

  .bac-home-area__toggle,
  .bac-home-work-card__toggle{
    gap:.75rem;
  }

  .bac-home-area__toggle>span:first-child,
  .bac-home-work-card__toggle>span:first-child{
    max-inline-size:calc(100% - 3.5rem);
  }

  .bac-home-team-selector{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .bac-home-team-action,
  .bac-home-final-action,
  .bac-home-directions__maps,
  .bac-home-directions__exterior-trigger{
    inline-size:100%;
  }

  .bac-home-final-action--contact,
  .bac-home-team-action--tertiary{
    justify-self:stretch;
  }

  .bac-home-work-step{
    grid-template-columns:1.75rem minmax(0,1fr);
  }

  .bac-home-office-gallery__status{
    inset-inline-start:1rem;
    transform:none;
  }

  .bac-home-office-gallery__slide figcaption,
  .bac-home-exterior figcaption{
    inset-inline-end:4.3rem;
  }
}

@media (max-width:380px){
  :root{--shell:calc(100vw - 1.5rem)}

  .bac-home-hero h1{
    font-size:clamp(2.55rem,13vw,3.5rem);
  }

  .bac-home-route strong,
  .bac-home-area__toggle>span:first-child{
    hyphens:auto;
  }

  .bac-home-team-selector__button{
    padding-inline:.45rem;
    font-size:.77rem;
  }

  .bac-home-professional__content{
    padding-inline:.25rem;
  }

  .bac-home-work-card__chevron{
    inline-size:2.35rem;
    block-size:2.35rem;
  }

  .bac-home-office-gallery__control--previous{inset-inline-start:.35rem}
  .bac-home-office-gallery__control--next{inset-inline-end:.35rem}
  .bac-home-office-gallery__close{inset-inline-end:.35rem}

  .bac-contact-dialog .bac-contact-form-section{
    padding-inline:8px;
  }
}

@media (max-width:767px) and (max-height:600px){
  .bac-contact-dialog__panel{
    min-block-size:100dvh;
  }

  .bac-contact-dialog__close{
    position:fixed;
    inset-block-start:max(8px,env(safe-area-inset-top));
    inset-inline-end:max(8px,env(safe-area-inset-right));
    inset-inline-start:auto;
    margin:0;
  }

  .bac-home-office-gallery,
  .bac-home-office-gallery__viewport,
  .bac-home-office-gallery__slide,
  .bac-home-office-gallery__image,
  .bac-home-office-gallery__slide>img,
  .bac-home-office-gallery__slide>.bac-home-media-placeholder{
    min-height:17rem;
    height:70dvh;
    max-height:70dvh;
  }
}

@media (orientation:landscape) and (max-width:959px){
  .bac-home-office-gallery,
  .bac-home-office-gallery__viewport,
  .bac-home-office-gallery__slide,
  .bac-home-office-gallery__image,
  .bac-home-office-gallery__slide>img,
  .bac-home-office-gallery__slide>.bac-home-media-placeholder{
    min-height:18rem;
    height:min(72dvh,32rem);
    max-height:72dvh;
  }
}

@media (prefers-reduced-motion:reduce){
  .bac-home *,
  .bac-home *::before,
  .bac-home *::after,
  .bac-contact-dialog *,
  .bac-contact-dialog *::before,
  .bac-contact-dialog *::after{
    scroll-behavior:auto!important;
    transition-duration:.01ms!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
  }
}

@media (prefers-contrast:more){
  .bac-home-route,
  .bac-home-area,
  .bac-home-service,
  .bac-home-team-selector,
  .bac-home-professional,
  .bac-home-work-card,
  .bac-home-office-gallery,
  .bac-home-exterior,
  .bac-contact-dialog__panel{
    border-color:var(--ink);
  }

  .bac-home :where(a,button,input,select,[tabindex]):focus-visible,
  .bac-contact-dialog :where(a,button,input,select,[tabindex]):focus-visible{
    outline-width:4px;
  }
}

@media (forced-colors:active){
  .bac-home :where(a,button,input,select,[tabindex]):focus-visible,
  .bac-contact-dialog :where(a,button,input,select,[tabindex]):focus-visible{
    outline:3px solid Highlight;
    box-shadow:none;
  }

  .bac-home-media-placeholder,
  .bac-home-contact-example blockquote,
  .bac-contact-dialog__panel{
    border:1px solid CanvasText;
    background:Canvas;
    color:CanvasText;
  }
}

@media print{
  .bac-home-area__panel[hidden],
  .bac-home-penal-group__panel[hidden],
  .bac-home-work-card__panel[hidden],
  .bac-home-team-panel__header[hidden],
  .bac-home-team-actions[hidden],
  .bac-home-professional[hidden]{
    display:block!important;
  }

  .bac-home-route-map,
  .bac-home-team-selector,
  .bac-home-office-gallery__control,
  .bac-home-office-gallery__close,
  .bac-home-exterior__close,
  .bac-home-final-actions,
  .bac-contact-dialog{
    display:none!important;
  }
}
