/* TFD seamless photographic masking and mobile control fixes.
   This is a PRESENTATION-only patch: existing calendar data, dynamic meeting-photo
   mapping, SVG handwriting, links, forms, API endpoints and PWA scripts are untouched. */

/* Mobile controls are REAL buttons, inside the mobile topbar's hit-test layer.
   No opacity driven by the masthead's scroll-collapse custom property. */
@media screen and (max-width:1023px){
  .tfdm-topbar{isolation:isolate!important;z-index:70!important;gap:7px!important;}
  .tfdm-topbar > #shareButton,
  .tfdm-topbar > #tfdAppRefresh{
    display:grid!important;position:relative!important;inset:auto!important;
    top:auto!important;right:auto!important;left:auto!important;bottom:auto!important;
    z-index:2!important;flex:0 0 38px!important;width:38px!important;height:38px!important;
    margin:0!important;padding:0!important;place-items:center!important;
    opacity:1!important;visibility:visible!important;pointer-events:auto!important;
    background:#fff!important;color:#2d657f!important;
    border:1px solid #d9e6ec!important;border-radius:50%!important;
    box-shadow:none!important;filter:none!important;transform:none!important;
    cursor:pointer!important;touch-action:manipulation!important;
    transition:background-color .18s,border-color .18s,color .18s!important;
  }
  .tfdm-topbar > #shareButton svg,
  .tfdm-topbar > #tfdAppRefresh svg{
    display:block;width:19px!important;height:19px!important;
    stroke:currentColor!important;stroke-width:1.8!important;fill:none!important;
    opacity:1!important;visibility:visible!important;
  }
  .tfdm-topbar > #shareButton:is(:hover,:focus-visible,:active),
  .tfdm-topbar > #tfdAppRefresh:is(:hover,:focus-visible,:active){
    background:#e7f4fb!important;border-color:#8bbbd6!important;color:#154b6d!important;
  }
  .tfdm-topbar > :is(#shareButton,#tfdAppRefresh):focus-visible{
    outline:2px solid #428eb9!important;outline-offset:2px!important;
  }
  .tfdm-brand{margin-right:auto!important;}
  .tfdm-nav-menu{margin-left:0!important;flex:0 0 auto!important;}
  .tfdm-nav-menu > summary{padding-inline:9px!important;}
  .masthead{z-index:1!important;}
}
@media screen and (max-width:365px){
  .tfdm-topbar{gap:5px!important;}
  .tfdm-brand{gap:4px!important;}
  .tfdm-brand img{width:32px!important;height:32px!important;}
  .tfdm-brand span{font-size:24px!important;}
  .tfdm-topbar > #shareButton,.tfdm-topbar > #tfdAppRefresh{
    flex-basis:35px!important;width:35px!important;height:35px!important;
  }
  .tfdm-nav-menu > summary{min-height:38px!important;font-size:11px!important;padding-inline:7px!important;}
}
/* Desktop owns only the desktop navbar controls; the old pair is hidden
   inside a mobile-only parent, so there are no duplicates. */
@media screen and (min-width:1024px){
  .tfdm-topbar{display:none!important;}
}

/* Consistent edge treatment: a genuine feather on all four sides.  Use an
   elliptical closest-side radius so opacity approaches ZERO at every edge,
   including the formerly abrupt TOP edge. No hard rectangular seams. */
.tfd-welcome-art .tfd-mountain-photo{
  -webkit-mask-image:radial-gradient(ellipse closest-side at 50% 50%,
    #000 8%,rgba(0,0,0,.97) 33%,rgba(0,0,0,.78) 52%,rgba(0,0,0,.36) 73%,transparent 100%)!important;
  mask-image:radial-gradient(ellipse closest-side at 50% 50%,
    #000 8%,rgba(0,0,0,.97) 33%,rgba(0,0,0,.78) 52%,rgba(0,0,0,.36) 73%,transparent 100%)!important;
  -webkit-mask-repeat:no-repeat!important;mask-repeat:no-repeat!important;
  background-repeat:no-repeat!important;
  mix-blend-mode:multiply!important;
  border:0!important;border-radius:0!important;
}
/* The blue wave also dissolves vertically rather than beginning/ending
   as a cropped rectangular gradient. Its curved left silhouette is retained. */
.tfd-welcome-art .tfd-blue-wave{
  -webkit-mask-image:linear-gradient(to bottom,
    transparent 0%,rgba(0,0,0,.22) 11%,#000 36%,#000 70%,transparent 100%)!important;
  mask-image:linear-gradient(to bottom,
    transparent 0%,rgba(0,0,0,.22) 11%,#000 36%,#000 70%,transparent 100%)!important;
  -webkit-mask-repeat:no-repeat!important;mask-repeat:no-repeat!important;
}
.tfd-welcome-art .tfd-branch{
  -webkit-mask-image:radial-gradient(ellipse closest-side at 48% 48%,
    #000 8%,rgba(0,0,0,.83) 38%,rgba(0,0,0,.32) 71%,transparent 100%)!important;
  mask-image:radial-gradient(ellipse closest-side at 48% 48%,
    #000 8%,rgba(0,0,0,.83) 38%,rgba(0,0,0,.32) 71%,transparent 100%)!important;
}
/* The NEXT MEETING photo is context-sensitive. This overrides the old two
   competing pseudo-element photo rules, while preserving the data-driven
   --tfd-meeting-photo value populated by tfd-service-visuals.js. */
.events-section #tfdUpcomingService::before{
  content:""!important;display:block!important;
  position:absolute!important;inset:0 0 0 auto!important;
  width:62%!important;height:100%!important;
  background-image:linear-gradient(90deg,rgba(245,250,255,.83),rgba(245,250,255,0) 66%),var(--tfd-meeting-photo,none)!important;
  background-repeat:no-repeat!important;background-size:cover!important;
  background-position:center!important;
  opacity:.76!important;filter:saturate(.72) contrast(.92)!important;
  -webkit-mask-image:radial-gradient(ellipse closest-side at 50% 50%,
    #000 4%,rgba(0,0,0,.96) 34%,rgba(0,0,0,.63) 58%,rgba(0,0,0,.23) 77%,transparent 100%)!important;
  mask-image:radial-gradient(ellipse closest-side at 50% 50%,
    #000 4%,rgba(0,0,0,.96) 34%,rgba(0,0,0,.63) 58%,rgba(0,0,0,.23) 77%,transparent 100%)!important;
  -webkit-mask-repeat:no-repeat!important;mask-repeat:no-repeat!important;
  pointer-events:none!important;border:0!important;border-radius:0!important;
  z-index:0!important;
}
.events-section #tfdUpcomingService[data-tfd-photo-type="none"]::before{opacity:0!important;}
.events-section #tfdUpcomingService > *{position:relative!important;z-index:1!important;}
@media screen and (max-width:1023px){
  .events-section #tfdUpcomingService::before{width:58%!important;opacity:.49!important;}
}
@media screen and (max-width:479px){
  .events-section #tfdUpcomingService::before{width:66%!important;opacity:.34!important;}
  .tfd-welcome-art .tfd-mountain-photo{mix-blend-mode:normal!important;}
}
