/* V9: responsive geometry and accessible interaction sizes.
   Loaded after theme files; theme files retain colors and decorative styling. */
:root{--page-gutter:clamp(16px,3vw,48px);--content-max:1440px;--header-height:96px}
html{scroll-padding-top:calc(var(--header-height) + 16px)}
body{min-width:0}
.wrap{width:calc(100% - 2 * var(--page-gutter));max-width:var(--content-max);margin-inline:auto}
img,video,iframe{max-width:100%}
img{height:auto}
button,input,select,textarea{max-width:100%;min-width:0}
textarea{resize:vertical}
:where(h1,h2,h3,h4,p,a,strong,summary,label){overflow-wrap:anywhere}
:where(.hero-copy,.welcome-copy,.event-content,.featured-message-copy,.contact-panel,.giving-panel,.footer-top>div,.first-visit-layout>div,.about-layout>div){min-width:0}
:where(.welcome,.about-layout,.first-visit-layout,.contact-grid,.featured-message,.ministry-purpose-grid){grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(24px,5vw,80px)}
:where(.video-grid,.leader-grid,.belief-grid,.schedule-grid,.album-grid){grid-template-columns:repeat(3,minmax(0,1fr))}
.ministry-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.section{padding-block:clamp(48px,6vw,96px)}
.page-heading h1{font-size:clamp(32px,4vw,56px)}
p{line-height:1.8}
#txt-sobre,.ministry-prose{max-width:72ch}
.values-row,.socials,.hero-actions,.footer-bottom,.footer-bottom>div,.gallery-caption,.hero-story-controls{flex-wrap:wrap}
.button,.hero-actions .button{white-space:normal;min-height:44px}
:where(.text-link,.calendar-link,.round-arrow,.menu-toggle,.live-button,.pastor-signature>a){min-height:44px}
.menu-toggle,.round-arrow,.pastor-signature>a{min-width:44px}
.header-inner{min-height:var(--header-height);height:auto;padding-block:12px}
.brand{min-width:0;flex-shrink:1}
.brand>img{flex-shrink:0;object-fit:contain}
.brand strong{white-space:normal}
.hero-inner{display:grid;grid-template-columns:minmax(0,1fr) minmax(245px,320px);gap:clamp(24px,4vw,64px);min-height:640px;padding-block:64px 32px;align-items:center}
.hero-copy{max-width:720px;width:100%}
.hero h1{font-size:clamp(34px,4.2vw,68px)}
.hero-description{max-width:48ch;color:#e0e4e6}
.hero-aside{display:none}
.next-gathering{width:100%;margin:0;min-width:0}
.next-gathering h2{max-width:none}
.gathering-time{position:static;display:flex;margin-top:18px}
.hero-bottom{position:static;grid-column:1/-1;display:flex;gap:16px;margin-top:12px;align-items:center}
.hero-story-controls{gap:clamp(12px,2vw,28px)}
.hero-story-controls>button,.hero-story-controls #hero-pause{min-height:44px;white-space:normal}
.hero-picture{display:contents}
.hero-photo{width:100%;height:100%;object-fit:cover}
.hero-motion{object-position:var(--hero-focus,50% 42%)}
.hero-actions{align-items:stretch}
.hero-link{align-items:center;min-height:44px}
.encounter-intro{max-width:100%}
.home-services{min-width:0;grid-template-columns:repeat(3,minmax(0,1fr))}
.service-mini{min-width:0}
.event-card{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);min-height:0}
.event-image-button{aspect-ratio:4/5;max-height:none;align-self:center}
.event-card .event-image{width:100%;height:100%;max-height:none;object-fit:contain}
.event-content{padding:clamp(20px,3vw,40px)}
.ministry-card-v8 .ministry-image,.ministry-image{aspect-ratio:1;height:auto}
.ministry-cover{aspect-ratio:16/9;max-height:none}
.leader-card img{aspect-ratio:1;height:auto;object-fit:cover;object-position:center 30%}
.album-card img{aspect-ratio:3/2;height:auto;object-fit:cover}
.about-layout>img{aspect-ratio:4/3;height:auto;object-fit:cover}
.welcome-visual>#welcome-main-photo{aspect-ratio:3/4;height:auto;object-fit:cover}
.welcome-photo-detail{aspect-ratio:4/5;height:auto}
.featured-message{gap:0}
.featured-message-image{aspect-ratio:16/9;min-height:0;align-self:center}
.media-band #home-videos{display:grid;overflow:visible;grid-template-columns:repeat(3,minmax(0,1fr))}
.media-band #home-videos .video-card{min-width:0;max-width:none}
.media-band #home-videos .video-thumb{aspect-ratio:16/9}
.gallery-editorial{grid-template-columns:1.125fr 1fr 1fr;grid-template-rows:repeat(2,auto);align-items:stretch}
.gallery-editorial .gallery-story{aspect-ratio:3/2}
.gallery-editorial .gallery-story:first-child{aspect-ratio:3/4;grid-row:span 2}
.gallery-editorial .gallery-story img,.gallery-editorial .gallery-story:first-child img{height:100%}
.gallery-masonry{grid-template-columns:repeat(4,minmax(0,1fr))}
.gallery-masonry img{aspect-ratio:4/3;height:auto;width:100%}
.gallery-story-overlay{opacity:1}
.schedule-card time{position:static;margin-top:16px}
.schedule-card h3{max-width:none}
.footer-top{grid-template-columns:minmax(0,1.4fr) repeat(2,minmax(0,.8fr)) minmax(0,1.2fr);gap:clamp(20px,3vw,48px)}
.modal{overflow-y:auto;padding:clamp(16px,4vw,48px);padding-top:max(60px,env(safe-area-inset-top))}
.video-modal-inner{max-height:calc(100dvh - 100px);overflow:auto}
.modal-close{position:fixed;top:max(8px,env(safe-area-inset-top));right:max(16px,env(safe-area-inset-right));min-width:44px;min-height:44px}
#lightbox{padding:64px 16px 110px}
#lightbox img{max-height:calc(100dvh - 190px);max-width:100%;object-fit:contain}
.lightbox-close,.lightbox-nav,.lightbox-play{min-height:44px;min-width:44px}
.lightbox-nav{top:auto;bottom:max(20px,env(safe-area-inset-bottom));transform:none;padding:10px}
.lightbox-play{max-width:calc(100% - 140px);white-space:normal;bottom:max(20px,env(safe-area-inset-bottom))}
#admin-login{overflow-y:auto;padding:24px 16px}
#admin-login>.glass{width:min(100%,440px)!important;max-height:calc(100dvh - 48px);overflow:auto}
#admin-panel.cms-shell{height:100vh;height:100dvh;min-height:0}
.cms-sidebar,.cms-workspace{min-height:0}
.cms-toolbar,.cms-toolbar-actions,.cms-image-heading,.cms-list-toolbar,.cms-record-footer{flex-wrap:wrap}
.cms-toolbar-actions button,.cms-shell button,.cms-upload{min-height:44px}
.cms-shell input:not([type=checkbox]),.cms-shell textarea,.cms-shell select{font-size:16px}
.cms-image-guide,.cms-image-heading{overflow-wrap:anywhere}
.cms-record-row>div:nth-child(2){min-width:0}
.cms-image-preview img{height:100%;object-fit:contain}
.cms-motion-preview{height:auto}
.cms-picker-overlay{padding:max(16px,env(safe-area-inset-top)) 16px max(16px,env(safe-area-inset-bottom))}
.cms-picker{height:min(85dvh,800px);max-width:100%}
@media(max-width:1100px){
 :root{--header-height:80px}
 .utility{display:none}
 .header-inner{gap:12px}
 .header-inner nav{margin:0}
 .header-inner .brand{margin-right:auto}
 .menu-toggle{display:block}
 #nav-ul{position:absolute;top:100%;left:0;right:0;width:100%;height:auto;max-height:calc(100dvh - var(--header-height));overflow-y:auto;display:none;flex-direction:column;align-items:stretch;gap:0;padding:16px var(--page-gutter) 24px;background:var(--bg);border-bottom:1px solid #dedfd9;transform:none}
 #nav-ul.mobile-open{display:flex}
 #nav-ul a{font-size:16px;padding:12px;min-height:44px}
 #nav-ul a.active:after{display:none}
 .ministry-grid,.video-grid,.leader-grid,.belief-grid,.schedule-grid,.album-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .media-band #home-videos{grid-template-columns:repeat(2,minmax(0,1fr))}
 .ministry-detail-intro{grid-template-columns:1fr;gap:24px}
 .footer-top{grid-template-columns:repeat(2,minmax(0,1fr))}
 .encounter{flex-wrap:wrap}
 .encounter-intro{width:100%}
}
@media(max-width:767px){
 :root{--header-height:76px}
 .hero-inner{grid-template-columns:1fr;min-height:0;padding-block:40px 24px;gap:28px}
 .hero{min-height:0}
 .hero h1{font-size:clamp(34px,6vw,46px);letter-spacing:-1.2px}
 .hero-bottom{display:flex;flex-direction:column;align-items:stretch;margin:0}
 .hero-bottom>a{display:none}
 .hero-story-controls{justify-content:space-between;gap:12px}
 .hero-story-controls>button{flex-wrap:wrap}
 .hero-actions{flex-wrap:wrap;gap:16px}
 .hero-actions .button{font-size:12px}
 .next-gathering h2{display:block;min-height:0;padding:0}
 .gathering-time{display:flex}
 .gathering-time>span{font-size:9px}
 .welcome,.about-layout,.first-visit-layout,.contact-grid,.featured-message,.ministry-purpose-grid{grid-template-columns:1fr}
 .welcome-visual{width:100%;max-width:520px;margin-inline:auto}
 .welcome-photo-detail{right:0;width:43%;bottom:85px}
 .welcome-visual .year-stamp{right:16px;max-width:calc(100% - 24px)}
 .first-visit-layout h2,.welcome h2,.section-heading h2{font-size:clamp(28px,5vw,36px)}
 .event-card{grid-template-columns:1fr}
 .event-image-button{width:100%;max-height:none}
 .gallery-editorial{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:none}
 .gallery-editorial .gallery-story:first-child{grid-column:1/-1;grid-row:auto;aspect-ratio:3/4;max-width:520px;width:100%;justify-self:center}
 .gallery-masonry{grid-template-columns:repeat(2,minmax(0,1fr))}
 .visit-inner{display:block}
 .visit-inner .button{margin-top:24px}
 input,textarea,select{font-size:16px}
 .cms-sidebar{max-height:none;min-height:0}
 .cms-sidebar-brand{padding-right:90px}
 .cms-toolbar{position:relative}
 .cms-toolbar p{font-size:12px;max-width:none}
 .cms-toolbar-actions{width:100%}
 .cms-toolbar-actions button{flex:1;font-size:12px}
 .cms-image-guide p>span{white-space:normal}
 .cms-record-row>div:nth-child(2){min-width:0}
 .cms-sort-row{flex-wrap:wrap}
 .cms-sort-row>.cms-field{flex-basis:100%}
}
@media(max-width:640px){
 .header-inner{gap:8px}
 .brand>img{width:44px;height:40px}
 .brand strong{font-size:clamp(14px,3.8vw,18px);letter-spacing:-.5px}
 .brand small{font-size:6px;letter-spacing:.8px}
 .live-button{min-width:36px;padding:8px;gap:4px}
 .menu-toggle{padding:6px}
 .home-services{grid-template-columns:1fr;flex-basis:100%}
 .service-mini,.service-mini:first-child{grid-template-columns:minmax(55px,.7fr) minmax(0,1.5fr) auto;gap:8px}
 .values-row{gap:12px 20px}
 .video-grid,.leader-grid,.belief-grid,.schedule-grid,.album-grid,.media-band #home-videos{grid-template-columns:1fr}
 .ministry-leaders,.ministry-section .events-grid,.ministry-section .video-grid{grid-template-columns:1fr}
 .ministry-detail-intro h1{font-size:clamp(30px,7vw,42px)}
 .media-toolbar{flex-direction:column}
 .media-toolbar>select{max-width:none}
 .mobile-quick-actions a{min-height:44px;justify-content:center}
 body{padding-bottom:calc(70px + env(safe-area-inset-bottom))}
 #back-to-top{bottom:calc(85px + env(safe-area-inset-bottom));width:44px;height:44px}
 .footer-bottom>div{gap:12px}
 .cms-shell .cms-toolbar-actions button{min-height:44px}
 .cms-record-row{gap:12px}
}
@media(max-width:479px){
 .header-inner{gap:4px}
 .brand{gap:5px}
 .ministry-grid,.gallery-editorial,.ministry-gallery{grid-template-columns:1fr}
 .gallery-editorial .gallery-story:first-child{grid-column:auto}
 .ministry-card-v8 h3{font-size:23px}
 .cms-list-toolbar{align-items:stretch}
 .cms-list-toolbar>.cms-save{width:100%}
 .cms-album-grid,.cms-ministry-library-grid{grid-template-columns:1fr}
 .cms-record-row>img,.cms-record-icon{width:52px;height:52px}
}
@media(max-height:500px) and (orientation:landscape){
 header{position:relative}
 .hero-inner{padding-top:24px}
 .cms-sidebar-brand{padding-block:6px}
 .cms-sidebar-brand img{height:28px}
 #cms-menu{padding-block:4px}
 .cms-sidebar-bottom{top:4px}
}
@media(hover:none){.gallery-story-overlay{opacity:1}.ministry-card:hover,.ministry-card-v8:hover{transform:none}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*:before,*:after{animation:none!important;transition:none!important}}
