/* Abrigo com Deus — Núcleo v0.10.12
 * Responsividade + acessibilidade: toque confortável, foco visível,
 * modais utilizáveis por teclado, tipografia ampliada e prevenção de estouro.
 * Esta camada é deliberadamente conservadora: melhora comportamento sem
 * redesenhar as páginas já homologadas.
 */

/* ---------- Base resiliente ---------- */
body.acd-core-a11y-v01012,
body.acd-core-a11y-v01012 *{box-sizing:border-box}
body.acd-core-a11y-v01012 :where(.acd-shell,.acd-hub-page,.acd-share-page,main,article,section,nav,header,footer){min-width:0}
body.acd-core-a11y-v01012 :where(h1,h2,h3,h4,p,a,button,span,strong,small,label){overflow-wrap:break-word}
body.acd-core-a11y-v01012 img,
body.acd-core-a11y-v01012 video,
body.acd-core-a11y-v01012 iframe{max-width:100%}

/* Link de salto aparece só ao receber foco. */
body.acd-core-a11y-v01012 .acd-skip-link{
  position:fixed;left:16px;top:12px;z-index:100000;
  transform:translateY(-160%);padding:12px 16px;border-radius:10px;
  background:#fff8ea;color:#5f0b1c!important;border:2px solid #d4af37;
  font-weight:850;text-decoration:none!important;box-shadow:0 8px 24px rgba(0,0,0,.18)
}
body.acd-core-a11y-v01012 .acd-skip-link:focus{transform:translateY(0)}
html[data-theme="dark"] body.acd-core-a11y-v01012 .acd-skip-link{background:#172837;color:#fff7ec!important}

/* ---------- Foco e áreas de toque ---------- */
body.acd-core-a11y-v01012 :where(
  .acd-header-circle-button,.acd-theme-toggle,.acd-mobile-menu-toggle,.acd-pray-button,
  .acd-overlay-close,.acd-video-close,.acd-share-card-action,.acd-share-today-action,
  .acd-hub-button,.acd-hub-text-link,.acd-hub-clear,.acd-sticker-month-action,
  .acd-share-filter,.acd-share-intent-links a,.acd-hub-theme-card,.acd-hub-see-grid a
){min-height:44px}
body.acd-core-a11y-v01012 :where(button,[role="button"],a,input,select,textarea):focus-visible{
  outline:3px solid #d6b44b!important;outline-offset:3px!important
}
body.acd-core-a11y-v01012 :where(input,select,textarea){font-size:max(16px,1em)}
body.acd-core-a11y-v01012 select{min-height:46px}

/* Controles de fonte: 44px reais para toque sem crescer visualmente demais. */
body.acd-core-a11y-v01012 .acd-font-controls button{min-width:40px!important;min-height:40px!important}

/* ---------- Cabeçalho resiliente ao zoom/texto grande ---------- */
body.acd-core-a11y-v01012 .acd-header-inner{gap:14px}
body.acd-core-a11y-v01012 .acd-header-actions{flex-wrap:wrap;justify-content:flex-end}
body.acd-core-a11y-v01012 .acd-main-nav{min-width:0}
body.acd-core-a11y-v01012 .acd-main-nav a{white-space:normal}

/* ---------- Cards e grades: nunca estourar horizontalmente ---------- */
body.acd-core-a11y-v01012 :where(
  .acd-hub-theme-grid,.acd-hub-post-grid,.acd-video-grid,.acd-share-grid,
  .acd-share-today-grid,.acd-hub-see-grid,.acd-contextual-share-grid
)>*{min-width:0}
body.acd-core-a11y-v01012 :where(.acd-hub-heading,.acd-share-today-head,.acd-sticker-month-main){min-width:0}
body.acd-core-a11y-v01012 :where(.acd-hub-heading,.acd-share-today-head){flex-wrap:wrap}

/* ---------- Modais: cabem no viewport e permanecem roláveis ---------- */
body.acd-core-a11y-v01012 :where(.acd-modal-overlay,.acd-video-modal,.acd-core-liturgical-modal){overscroll-behavior:contain}
body.acd-core-a11y-v01012 :where(.acd-search-panel,.acd-pray-panel,.acd-video-dialog,.acd-core-liturgical-dialog){
  max-width:min(94vw,980px);max-height:calc(100dvh - 32px);overflow:auto;-webkit-overflow-scrolling:touch
}
body.acd-core-a11y-v01012 .acd-video-frame{aspect-ratio:16/9;min-height:0}
body.acd-core-a11y-v01012 .acd-video-frame iframe{display:block;width:100%;height:100%;border:0}

/* ---------- Tablets / notebooks menores ---------- */
@media (max-width:1100px){
  body.acd-core-a11y-v01012 .acd-header-inner{flex-wrap:wrap}
  body.acd-core-a11y-v01012 .acd-header-actions{margin-left:auto}
  body.acd-core-a11y-v01012 .acd-hub-hero-copy{max-width:min(680px,72vw)}
  body.acd-core-a11y-v01012 .acd-hub-featured,
  body.acd-core-a11y-v01012 .acd-hub-intro-grid{min-width:0}
}

/* ---------- Mobile ---------- */
@media (max-width:782px){
  body.acd-core-a11y-v01012{overflow-x:hidden}
  body.acd-core-a11y-v01012 .acd-shell{width:min(100% - 28px,var(--acd-content-width,1180px))!important}
  body.acd-core-a11y-v01012 .acd-header-inner{gap:10px}
  body.acd-core-a11y-v01012 .acd-brand{min-width:0;max-width:calc(100% - 58px)}
  body.acd-core-a11y-v01012 .acd-header-actions{width:100%;justify-content:flex-start;gap:8px}
  body.acd-core-a11y-v01012 .acd-pray-button{margin-left:auto}
  body.acd-core-a11y-v01012 .acd-font-controls{height:46px!important}
  body.acd-core-a11y-v01012 .acd-theme-toggle{min-height:46px!important}

  body.acd-core-a11y-v01012 .acd-hub-hero-copy{max-width:100%!important}
  body.acd-core-a11y-v01012 .acd-hub-hero-actions{display:flex;flex-direction:column;align-items:stretch;gap:10px}
  body.acd-core-a11y-v01012 .acd-hub-hero-actions .acd-hub-button{width:100%;justify-content:center}

  body.acd-core-a11y-v01012 .acd-hub-heading{align-items:flex-start;gap:10px}
  body.acd-core-a11y-v01012 .acd-hub-clear{width:auto}

  body.acd-core-a11y-v01012 :where(.acd-search-panel,.acd-pray-panel,.acd-video-dialog,.acd-core-liturgical-dialog){
    width:calc(100vw - 24px)!important;max-width:none!important;max-height:calc(100dvh - 24px);margin:12px
  }
  body.acd-core-a11y-v01012 .acd-overlay-close,
  body.acd-core-a11y-v01012 .acd-video-close{min-width:44px;min-height:44px}

  body.acd-core-a11y-v01012 .acd-share-intent-links a,
  body.acd-core-a11y-v01012 .acd-hub-theme-card{white-space:normal!important}
}

@media (max-width:520px){
  body.acd-core-a11y-v01012 .acd-shell{width:calc(100% - 22px)!important}
  body.acd-core-a11y-v01012 .acd-header-actions{display:grid;grid-template-columns:auto auto 1fr;align-items:center}
  body.acd-core-a11y-v01012 .acd-font-controls{grid-column:1/3}
  body.acd-core-a11y-v01012 .acd-pray-button{grid-column:3;grid-row:1/3;align-self:stretch}
  body.acd-core-a11y-v01012 .acd-hub-page h1{font-size:clamp(42px,13vw,64px)!important}
  body.acd-core-a11y-v01012 .acd-hub-page h2{font-size:clamp(30px,9vw,42px)}
  body.acd-core-a11y-v01012 .acd-hub-page h3{font-size:clamp(23px,7vw,30px)}
}

/* ---------- Texto aumentado / zoom ---------- */
@media (max-width:900px){
  body.acd-core-a11y-v01012 :where(.acd-share-calendar,.acd-sticker-filter-bar){max-width:100%;overflow:visible}
}

/* ---------- Preferências do sistema ---------- */
@media (prefers-reduced-motion:reduce){
  body.acd-core-a11y-v01012 *,
  body.acd-core-a11y-v01012 *::before,
  body.acd-core-a11y-v01012 *::after{
    scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important
  }
}
@media (prefers-contrast:more){
  body.acd-core-a11y-v01012 :where(.acd-hub-card,.acd-video-card,.acd-share-card,.acd-hub-theme-card){border-width:2px!important}
  body.acd-core-a11y-v01012 :where(p,small){opacity:1!important}
}
