/* TFD Premium Mobile — responsive adaptation of the approved desktop design.
   Uses ORIGINAL envelope/doors/logo and preserves interactive backend features. */
@media screen and (max-width:1023px){
  :root{--tfdm-navy:#1a3143;--tfdm-blue:#82bfe1;--tfdm-gold:#b9975d;--tfdm-border:#eadfd0;--tfdm-pearl:#faf9f7;}
  html{scroll-padding-top:18px}
  body{background:var(--tfdm-pearl);color:var(--tfdm-navy);font-family:'DM Sans','Segoe UI',sans-serif;}
  .page{width:min(calc(100% - 28px),600px);margin-inline:auto;padding:13px 0 36px;}
  .tfdp-navbar{display:none!important}
  /* The approved home screen: an editorial hero, not a cramped desktop nav. */
  .masthead{position:relative;min-width:0;padding:20px 17px 24px;background:#fff;border:1px solid #e7e2d9;border-radius:21px;box-shadow:0 11px 30px rgba(26,49,67,.045);overflow:hidden;}
  .masthead .logo-stage{height:91px;margin-bottom:4px;}
  .masthead .hero-symbol{width:99px;height:99px;}
  .masthead .church-title{margin:10px 0 12px;}
  .masthead .church-title strong{font:700 9px/1.35 'DM Sans',sans-serif;letter-spacing:1.5px;color:#4b6577;}
  .masthead h1{font:600 clamp(34px,9vw,48px)/1.03 'Cormorant Garamond',Georgia,serif;letter-spacing:-.035em;color:var(--tfdm-navy);margin:0 auto 17px;max-width:490px;}
  .masthead h1 em{display:inline-block;font:400 1.33em/.72 'Allura','Brush Script MT',cursive;color:#448fbd;vertical-align:-.04em;letter-spacing:0;padding:0 .02em;}
  .masthead .pastors{background:#fffdf9;border:1px solid #ddc6a5;max-width:100%;padding:9px 12px;min-height:36px;box-shadow:none;}
  .masthead .pastors-names{font:600 clamp(11px,3.3vw,14px)/1.3 'DM Sans',sans-serif;}
  .masthead .pastors-caption{font:800 9px/1.3 'DM Sans',sans-serif;letter-spacing:.08em;}
  .masthead .share{width:37px;height:37px;border-radius:11px;top:10px;right:10px;}

  /* Four genuinely responsive shortcut tiles. Never display raw/unstyled HTML. */
  .tfdp-shortcuts{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;margin:18px 0 18px;align-items:stretch;}
  .tfdp-card{position:relative;isolation:isolate;display:flex;flex-direction:column;gap:9px;align-items:flex-start;justify-content:flex-start;min-width:0;min-height:158px;width:100%;padding:16px 15px 20px;background:#fff;border:1px solid #eaded0;border-radius:18px;color:var(--tfdm-navy);box-shadow:0 8px 24px rgba(26,49,67,.038);font:inherit;text-align:left;text-decoration:none;cursor:pointer;overflow:visible;touch-action:manipulation;transition:background .24s,transform .28s,border-color .25s,box-shadow .28s;}
  .tfdp-card:is(:hover,:focus-visible),.tfdp-card.is-previewing,.tfdp-card[aria-expanded=true]{border-color:#a8cfe3;background:#f8fcff;box-shadow:0 11px 26px rgba(26,49,67,.075)}
  .tfdp-card:active{transform:scale(.985)}
  .tfdp-card:focus-visible{outline:2px solid var(--tfdm-blue);outline-offset:3px}
  .tfdp-icon{display:grid;place-items:center;position:relative;flex:0 0 66px;width:66px;height:66px;min-width:0;margin:0;transform-origin:50% 70%;transition:transform .38s cubic-bezier(.18,.75,.3,1)}
  .tfdp-card:is(:hover,:focus-visible),.tfdp-card.is-previewing{color:var(--tfdm-navy)}
  .tfdp-card:is(:hover,:focus-visible) .tfdp-icon,.tfdp-card.is-previewing .tfdp-icon{transform:translateY(-3px)}
  .tfdp-icon > .envelope-illustration{display:block;transform:scale(.73);transform-origin:center;}
  .tfdp-icon > .portal-illustration{display:block;transform:scale(.81);transform-origin:center;}
  .tfdp-icon > .access-symbol{display:block;transform:scale(1.13);transform-origin:center;}
  .tfdp-icon > .family-groups-icon{display:grid;place-items:center;width:61px;height:61px;border-radius:15px;flex:0 0 auto}
  .tfdp-icon > .family-groups-icon .tfd-scene-svg{width:44px;height:44px}
  .tfdp-card-content{display:block;min-width:0;width:100%;padding-right:9px;margin-top:1px;}
  .tfdp-card-content strong{display:block;font:600 clamp(21px,5.45vw,28px)/1.06 'Cormorant Garamond',Georgia,serif;letter-spacing:-.012em;overflow-wrap:break-word;}
  .tfdp-card-arrow{position:absolute;right:13px;bottom:15px;color:#b9975d;font-size:23px;font-weight:400;line-height:1;transition:transform .3s;}
  .tfdp-card:is(:hover,:focus-visible) .tfdp-card-arrow,.tfdp-card.is-previewing .tfdp-card-arrow{transform:translateX(3px)}
  .tfdp-card:is(:hover,:focus-visible) .envelope-flap,.tfdp-card.is-previewing .envelope-flap{transform:rotateX(150deg)}
  .tfdp-card:is(:hover,:focus-visible) .envelope-paper,.tfdp-card.is-previewing .envelope-paper{transform:translateY(-9px)}
  .tfdp-card:is(:hover,:focus-visible) .portal-left,.tfdp-card.is-previewing .portal-left{transform:rotateY(-65deg)}
  .tfdp-card:is(:hover,:focus-visible) .portal-right,.tfdp-card.is-previewing .portal-right{transform:rotateY(65deg)}
  .tfdp-card:is(:hover,:focus-visible) .portal-medallion,.tfdp-card.is-previewing .portal-medallion{opacity:0;transform:scale(.7)}
  .tfdp-card:is(:hover,:focus-visible) .portal-light,.tfdp-card.is-previewing .portal-light{opacity:1}
  .tfdp-portal-card:is(:hover,:focus-visible) .access-door-left,.tfdp-portal-card.is-previewing .access-door-left{transform:rotateY(-65deg)}
  .tfdp-portal-card:is(:hover,:focus-visible) .access-door-right,.tfdp-portal-card.is-previewing .access-door-right{transform:rotateY(65deg)}
  .tfdp-portal-card:is(:hover,:focus-visible) .access-vault-lock,.tfdp-portal-card.is-previewing .access-vault-lock{opacity:0;transform:translateY(-12px) scale(.65)}
  .tfdp-portal-card:is(:hover,:focus-visible) .access-vault-light,.tfdp-portal-card.is-previewing .access-vault-light{opacity:1}

  /* Retain exactly ONE copy of each original expandable section.
     They open below the four tile shortcuts; the original contents/logic remain. */
  .details-section{display:none;border:0;margin:0 0 18px;background:transparent;overflow:visible;animation:none;}
  .details-section:has(>details[open]){display:block}
  .details-section>details:not([open]){display:none}
  .details-section>details[open]{display:block;margin-bottom:10px}
  .details-section>details>summary{display:none}
  .details-section .letter-reveal,.details-section .portal-reveal{border:1px solid #e8dfd2;border-radius:17px;background:#fff;box-shadow:0 8px 23px rgba(26,49,67,.05);overflow:hidden}
  .details-section .letter-sheet,.details-section .portal-gallery{max-width:none}

  /* Calendar, announcement and menu surface follows the same palette as desktop. */
  .events-section{margin-top:11px}
  .events-heading{padding:0 3px 8px;display:flex;align-items:center;gap:9px;justify-content:space-between}
  .events-heading-title{font:600 clamp(25px,7vw,36px)/1.05 'Cormorant Garamond',Georgia,serif;letter-spacing:-.03em;color:var(--tfdm-navy)}
  .events-month{font:750 9px/1.3 'DM Sans',sans-serif;letter-spacing:.1em;color:#9b7845;border-radius:100px;background:#f6efe4;padding:7px 10px;white-space:nowrap}
  .events-list{display:grid;gap:8px}
  .events-list .event{background:#fff;border:1px solid #e8e1d7;border-radius:16px;min-height:76px;padding:13px 11px;box-shadow:0 5px 18px rgba(26,49,67,.03);margin:0}
  .events-list .event::before{background:#c7a46e}
  .events-list .date{border-color:#e6d4b7;background:#fffaf3;border-radius:12px}
  .events-list .event-text strong{color:var(--tfdm-navy);font:700 13px/1.3 'DM Sans',sans-serif}
  .events-list .event-text small{font:500 11px/1.5 'DM Sans',sans-serif;color:#667f91}
  .tfd-upcoming-service{padding:20px 20px;margin:12px 0 12px;border:1px solid #24485f;border-radius:17px;background:linear-gradient(128deg,#173a55,#1d4765);box-shadow:0 9px 24px rgba(26,49,67,.095);gap:6px}
  .tfd-upcoming-service strong{font:600 clamp(28px,7vw,39px)/1.08 'Cormorant Garamond',Georgia,serif;letter-spacing:-.018em}
  .tfd-upcoming-service .tfd-next-eyebrow{font-family:'DM Sans',sans-serif;font-size:10px;letter-spacing:.18em;color:#e9c999}
  .tfd-upcoming-service small{font:500 12px/1.55 'DM Sans',sans-serif}
  .tfd-sunday-menu{margin:12px 0 15px;padding:16px;gap:12px;border:1px solid #cfe1eb;border-radius:17px;background:#f3f9fc;box-shadow:0 8px 23px rgba(26,49,67,.035)}
  .tfd-menu-title{font-family:'DM Sans',sans-serif!important;font-weight:700!important}
  .tfd-sunday-menu .tfd-menu-info{line-height:1.55}

  /* Consistent containers and headings throughout the phone app. */
  .main-section,.social-section,.tfd-contact-section,.tfd-message-section{margin-top:31px}
  .main-section h2,.social-section h2,.tfd-contact-section h2,.tfd-message-section h2{
    font:600 clamp(28px,7.5vw,39px)/1.05 'Cormorant Garamond',Georgia,serif;
    letter-spacing:-.025em;color:var(--tfdm-navy);margin-bottom:17px;
  }
  .main-section h2::before,.social-section h2::before,.tfd-contact-section h2::before,.tfd-message-section h2::before{height:20px;width:2px;background:var(--tfdm-gold);vertical-align:-2px}
  .main-section .list{display:grid;grid-template-columns:1fr;gap:11px}
  .main-section .link,.social-section .social-link{background:#fff;border:1px solid #e8e0d6;border-radius:16px;box-shadow:0 7px 22px rgba(26,49,67,.035)}
  .main-section .link{min-height:78px;padding:12px 14px;gap:15px}
  .main-section .link-label strong{font-family:'DM Sans',sans-serif;font-size:14px}
  .main-section .ico{width:49px;height:49px;flex:0 0 49px;border-radius:13px}
  .social-section .social-grid{gap:11px}
  .social-section .social-link{min-height:72px}
  .section-heading span{font:800 9px/1.4 'DM Sans',sans-serif;letter-spacing:.12em;color:#8da0ad}
  .tfd-contact-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .tfd-contact-intro{border-radius:17px 17px 0 0}
  .tfd-contact-card{min-width:0;border-radius:13px}
  .tfd-contact-grid .tfd-contact-email{grid-column:1/-1}
  .tfd-message-card{width:100%;max-width:none;margin-inline:0;border-radius:18px;overflow:hidden}
  .tfd-install-choice{margin-top:28px}
  .scroll-brand{border-color:#decaad;box-shadow:0 7px 22px rgba(26,49,67,.13)}
}
@media screen and (max-width:479px){
 .tfd-contact-grid{grid-template-columns:1fr}
 .tfd-contact-grid .tfd-contact-card{width:100%;padding:13px 15px}
 .tfdp-shortcuts{gap:10px}
 .tfdp-card{padding:15px 13px 17px;min-height:156px}
 .tfdp-icon{flex-basis:62px;width:62px;height:62px}
 .tfdp-card-content strong{font-size:clamp(21px,5.9vw,25px)}
 .tfdp-icon > .access-symbol{transform:scale(1.05)}
 .tfdp-icon > .family-groups-icon{width:57px;height:57px}
}
@media screen and (max-width:349px){
 .page{width:calc(100% - 20px)}
 .tfdp-card{min-height:151px;padding:13px 11px;gap:5px}
 .tfdp-card-content strong{font-size:21px}
 .masthead h1{font-size:31px}
 .masthead .church-title strong{letter-spacing:.8px;font-size:8px}
}
@media screen and (min-width:700px) and (max-width:1023px){
 .page{width:min(calc(100% - 44px),870px)}
 .tfdp-shortcuts{grid-template-columns:repeat(4,minmax(0,1fr))}
 .tfdp-card{padding:17px 13px 22px;min-height:157px}
 .tfdp-card-content strong{font-size:24px}
 .main-section .list{grid-template-columns:repeat(2,minmax(0,1fr))}
 .main-section .list>details[open]{grid-column:1/-1}
 .tfd-message-card{max-width:none}
}
@media (prefers-reduced-motion:reduce){
 .tfdp-card,.tfdp-icon,.tfdp-card-arrow{transition:none!important}
}

/* Grupos Familiares — new house illustration replaces road icon. */
@media screen and (max-width:1023px){
 .tfdp-icon > .family-groups-icon{overflow:visible;}
 .tfdp-icon > .family-groups-icon .family-house-svg{width:100%;height:100%;}
}
