/* TFD mobile 2026 — desktop-like open welcome, not a boxed app card.
   Visual / navigation enhancement only: all existing services, events, PWA,
   forms, payments, destination links and logo/handwriting animation preserved. */
.tfdm-topbar{display:none}
@media screen and (max-width:1023px){
  html{scroll-padding-top:78px}
  .page{overflow:visible!important;isolation:isolate!important;}

  /* Compact navigation derived from the desktop header. */
  .tfdm-topbar{
    position:relative!important;z-index:9!important;display:flex!important;
    align-items:center;justify-content:space-between;gap:12px;
    min-height:65px;padding:9px 1px 11px;margin-bottom:0;
    border-bottom:1px solid rgba(26,49,67,.095);
    background:rgba(250,249,247,.90);
  }
  .tfdm-brand{display:inline-flex;align-items:center;gap:8px;
    text-decoration:none;color:#1a3143;min-height:44px;flex-shrink:0}
  .tfdm-brand img{display:block;width:40px;height:40px;object-fit:contain}
  .tfdm-brand span{font:700 29px/1 'Cormorant Garamond',Georgia,serif;letter-spacing:-.045em}
  .tfdm-nav-menu{position:relative;display:block;margin-left:auto;border:0;background:transparent;}
  .tfdm-nav-menu>summary{
    display:flex!important;align-items:center!important;justify-content:center!important;
    min-height:42px!important;padding:8px 9px!important;gap:6px;
    list-style:none;cursor:pointer;border-radius:100px;
    color:#1a3143;font:700 12px/1 'DM Sans',system-ui,sans-serif;
    border:1px solid #e6e4de;background:#fff;
  }
  .tfdm-nav-menu>summary::-webkit-details-marker{display:none}
  .tfdm-nav-menu>summary svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-linecap:round;stroke-width:1.8}
  .tfdm-nav-menu[open]>summary,.tfdm-nav-menu>summary:is(:hover,:focus-visible){
    background:#e9f5fb!important;border-color:#a9cfe1;color:#194d69;
  }
  .tfdm-nav-menu>summary:focus-visible{outline:2px solid #448fbd;outline-offset:2px}
  .tfdm-menu-links{position:absolute;z-index:10;right:0;top:calc(100% + 9px);
    width:min(280px,calc(100vw - 38px));padding:8px;
    border:1px solid #e7e2d9;border-radius:16px;background:#fff;
    box-shadow:0 15px 35px rgba(26,49,67,.12);display:grid;gap:3px;}
  .tfdm-menu-links :is(a,button){
    display:flex;justify-content:flex-start;align-items:center;width:100%;
    min-height:43px;padding:10px 13px;border:0;border-radius:10px;
    background:#fff;color:#1a3143;text-decoration:none;
    font:650 14px/1.35 'DM Sans',system-ui,sans-serif;text-align:left;cursor:pointer;
  }
  .tfdm-menu-links :is(a,button):is(:hover,:focus-visible){background:#edf7fc;color:#1c638a}
  .tfdm-menu-links .tfdm-menu-contact{color:#8a6537;border-top:1px solid #f1eae0;border-radius:0;padding-top:13px;margin-top:4px}

  /* Keep original Share / Refresh actions and put them in the compact header row. */
  .masthead #shareButton,.masthead #tfdAppRefresh{
    position:absolute!important;top:-54px!important;z-index:12!important;
    width:39px!important;height:39px!important;border-radius:50%!important;
    background:#fff!important;border:1px solid #e4e8ea!important;
    box-shadow:none!important;transform:none!important;
  }
  .masthead #shareButton{right:86px!important}
  .masthead #tfdAppRefresh{right:132px!important}
  .masthead #shareButton:is(:hover,:focus-visible),.masthead #tfdAppRefresh:is(:hover,:focus-visible){background:#e9f5fc!important;border-color:#a7cadc!important}

  /* Remove old mobile card completely. Welcome itself is open editorial content. */
  .masthead{
    position:relative!important;isolation:auto!important;
    min-height:0!important;margin:0 auto!important;
    padding:35px 3px 29px!important;
    border:0!important;border-radius:0!important;
    background:transparent!important;background-image:none!important;
    box-shadow:none!important;filter:none!important;overflow:visible!important;
    text-align:center!important;
  }
  .masthead .masthead-rule,.masthead .logo-stage,.masthead .church-title{
    display:none!important;
  }
  .masthead::before{
    display:block!important;content:'BIENVENIDO A TFD'!important;
    margin-bottom:13px!important;color:#997341!important;
    font:750 10px/1.45 'DM Sans',system-ui,sans-serif!important;
    letter-spacing:.27em!important;
  }
  .masthead::after{display:none!important;content:none!important;background:none!important;}
  .masthead h1{
    max-width:100%!important;width:100%!important;margin:0 auto 10px!important;
    padding:0!important;font:600 clamp(35px,9vw,59px)/1.13 'Cormorant Garamond',Georgia,serif!important;
    letter-spacing:-.038em!important;color:#1a3143!important;
    text-wrap:balance!important;overflow:visible!important;
  }
  /* DO NOT change #tfdLugarHandwritten animation or built-in SVG backup. */
  .masthead #tfdLugarHandwritten{
    font-family:'Allura','Brush Script MT',cursive!important;
    font-weight:400!important;overflow:visible!important;
    margin:0 .025em!important;
  }
  /* Underline uses ::before so it can coexist with the SVG/fallback asset in ::after. */
  #welcomeTitle #tfdLugarHandwritten::before{
    content:''!important;position:absolute!important;display:block!important;
    left:18%!important;right:8%!important;bottom:.02em!important;
    height:0!important;border-top:2.5px solid #bf914b!important;
    border-radius:60%;transform:rotate(-4deg);pointer-events:none;
  }
  #welcomeTitle #tfdLugarHandwritten::after{
    border-top:0!important;/* original image-backed fallback still works */
  }
  .tfd-welcome-values{
    display:flex!important;justify-content:center!important;align-items:center!important;
    flex-wrap:wrap!important;gap:5px 8px!important;
    color:#3c586b!important;font:500 clamp(11px,2.9vw,14px)/1.4 'DM Sans',system-ui,sans-serif!important;
    letter-spacing:.04em!important;margin:0 auto 17px!important;
  }
  .tfd-welcome-values span{color:#b9975d!important}
  .masthead .pastors{
    background:rgba(255,255,255,.91)!important;
    border:1px solid #d9c39f!important;
    border-radius:100px!important;box-shadow:none!important;
    padding:9px 11px!important;max-width:100%!important;
  }
  .masthead .pastors-caption{font-size:9px!important;letter-spacing:.09em!important}
  .masthead .pastors-names{font:650 clamp(11px,2.95vw,14px)/1.35 'DM Sans',system-ui,sans-serif!important}

  /* Full-bleed art: actual mountain emerges from the same blue wave behind open hero.
     Both masks taper to transparency before reaching their element boundaries. */
  .tfd-welcome-art{
    position:absolute!important;z-index:0!important;top:65px!important;
    left:50%!important;right:auto!important;
    width:100vw!important;height:355px!important;max-width:100vw!important;
    transform:translateX(-50%)!important;
    overflow:visible!important;pointer-events:none!important;
  }
  .tfd-branch{
    left:0!important;top:4px!important;width:clamp(108px,23vw,185px)!important;
    opacity:.28!important;filter:saturate(.76)!important;
    -webkit-mask-image:radial-gradient(ellipse 85% 85% at 25% 22%,#000 13%,rgba(0,0,0,.70) 54%,transparent 100%)!important;
    mask-image:radial-gradient(ellipse 85% 85% at 25% 22%,#000 13%,rgba(0,0,0,.70) 54%,transparent 100%)!important;
  }
  .tfd-blue-wave{
    top:150px!important;bottom:auto!important;right:0!important;
    width:82%!important;height:180px!important;
    background:linear-gradient(110deg,rgba(232,245,252,0),rgba(225,242,251,.53) 38%,rgba(207,230,245,.77))!important;
    border-radius:95% 0 0 0 / 85% 0 0 0!important;
    transform:none!important;opacity:.72!important;
    -webkit-mask-image:linear-gradient(to bottom,transparent 0%,#000 21%,#000 64%,transparent 100%)!important;
    mask-image:linear-gradient(to bottom,transparent 0%,#000 21%,#000 64%,transparent 100%)!important;
  }
  .tfd-mountain-photo{
    top:168px!important;bottom:auto!important;right:0!important;
    width:69%!important;height:169px!important;
    background-image:url('https://upload.wikimedia.org/wikipedia/commons/f/f7/Mount_Rainier_seen_from_Enumclaw_WA.jpg')!important;
    background-position:center 30%!important;background-size:cover!important;background-repeat:no-repeat!important;
    opacity:.60!important;filter:saturate(.57) contrast(.95) brightness(1.08)!important;
    -webkit-mask-image:radial-gradient(ellipse 74% 80% at 58% 49%,#000 4%,rgba(0,0,0,.86) 46%,rgba(0,0,0,.32) 71%,transparent 100%)!important;
    mask-image:radial-gradient(ellipse 74% 80% at 58% 49%,#000 4%,rgba(0,0,0,.86) 46%,rgba(0,0,0,.32) 71%,transparent 100%)!important;
  }
  /* Shortcut cards remain interactive, but sit below the open welcome section. */
  .tfdp-shortcuts{position:relative;z-index:1; margin-top:17px!important;}
}
@media screen and (max-width:479px){
  .masthead{padding-top:32px!important;padding-bottom:25px!important;}
  .masthead h1{font-size:clamp(34px,9.2vw,44px)!important;line-height:1.12!important;}
  .tfd-welcome-art{height:330px!important;}
  .tfd-blue-wave{top:149px!important;height:161px!important;width:91%!important;}
  .tfd-mountain-photo{top:165px!important;height:148px!important;width:76%!important;opacity:.55!important;}
}
@media screen and (min-width:700px) and (max-width:1023px){
  .masthead{padding-top:49px!important;padding-bottom:47px!important;}
  .masthead h1{font-size:clamp(52px,6.4vw,66px)!important;}
  .tfd-welcome-art{height:400px!important;}
  .tfd-blue-wave{top:160px!important;height:210px!important;width:69%!important;}
  .tfd-mountain-photo{top:165px!important;height:206px!important;width:56%!important;}
  .tfdp-shortcuts{margin-top:20px!important;}
}
@media screen and (max-width:340px){
  .masthead h1{font-size:33px!important;}
  .masthead .pastors{gap:5px!important;padding-inline:7px!important;}
  .masthead .pastors-caption{font-size:8px!important;}
  .masthead .pastors-names{font-size:11px!important;}
  .masthead #shareButton{right:77px!important;}
  .masthead #tfdAppRefresh{right:122px!important;}
  .tfdm-nav-menu>summary{padding-inline:7px!important;}
}
@media(prefers-reduced-motion:reduce){
  .tfdm-menu-links :is(a,button){transition:none!important;}
}

/* One installed-app action set at a time: the desktop navbar owns the
   buttons at desktop width; the original masthead buttons own them on mobile.
   Higher specificity is necessary to override the legacy standalone !important
   rules that previously displayed both copies. */
@media screen and (min-width:1024px){
  html .masthead #shareButton,html .masthead #tfdAppRefresh,
  html.tfd-installed-app .masthead #shareButton,
  html.tfd-installed-app .masthead #tfdAppRefresh {display:none!important;visibility:hidden!important;pointer-events:none!important;}
  .tfdp-navbar .tfdp-share:not(.tfdp-app-refresh){display:grid!important;}
  .tfdp-navbar .tfdp-app-refresh{display:none!important;}
  html.tfd-installed-app .tfdp-navbar .tfdp-app-refresh{display:grid!important;}
}
@media (display-mode:standalone) and (min-width:1024px),
       (display-mode:fullscreen) and (min-width:1024px),
       (display-mode:minimal-ui) and (min-width:1024px){
  .tfdp-navbar .tfdp-app-refresh{display:grid!important;}
}
@media screen and (max-width:1023px){
  .tfdp-navbar .tfdp-share,.tfdp-navbar .tfdp-app-refresh{display:none!important;}
}
