/* AP Stories Theme 4.61 — Stories = Admin Template authority.
   The Theme must not invent/reflow T1 geometry. The plugin Template Manager
   runtime CSS (injected after this file) owns every zone coordinate. */

/* READ: let the six-zone page define its own full physical page. */
.ap-reader-page .ap-reader-read-view .ap-reader-card.ap-reader-card-compact,
.ap-reader-page .ap-reader-read-view .ap-reader-card.ap-t1-readable-card{
  aspect-ratio:auto!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
}
.ap-reader-page .ap-reader-read-view .ap-reader-content{
  position:relative!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  padding:0!important;
  overflow:visible!important;
  white-space:normal!important;
}
.ap-reader-page .ap-reader-read-view .ap-story-canvas.ap-t1-family.ap-layout-template-01,
.ap-reader-page .ap-reader-read-view .ap-story-canvas.ap-six-layout.ap-t1-family{
  display:grid!important;
  grid-template-columns:repeat(12,minmax(0,1fr))!important;
  grid-template-rows:repeat(12,minmax(0,1fr))!important;
  grid-auto-flow:initial!important;
  width:100%!important;
  max-width:100%!important;
  aspect-ratio:7/10!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  gap:var(--ap-t1-gap,4px)!important;
  overflow:hidden!important;
  align-items:stretch!important;
  justify-items:stretch!important;
}
.ap-reader-page .ap-reader-read-view .ap-story-canvas.ap-t1-family>.ap-template-row{display:contents!important;}
.ap-reader-page .ap-reader-read-view .ap-story-canvas.ap-t1-family>.ap-template-row>.ap-six-zone,
.ap-reader-page .ap-reader-read-view .ap-story-canvas.ap-t1-family>.ap-six-zone{
  position:relative!important;
  inset:auto!important;
  width:auto!important;
  height:auto!important;
  min-width:0!important;
  min-height:0!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  align-self:stretch!important;
  justify-self:stretch!important;
  overflow:hidden!important;
  order:initial!important;
}

/* ART is full bleed inside the Template slot. Border is visual only. */
.ap-reader-page .ap-reader-read-view .ap-six-art>.ap-comic-image-box,
.ap-reader-page .ap-reader-read-view .ap-six-art .ap-story-art{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  border-radius:0!important;
  overflow:hidden!important;
}
.ap-reader-page .ap-reader-read-view .ap-six-art .ap-story-art img{
  position:absolute!important;
  inset:0!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  object-fit:cover!important;
  object-position:var(--ap-art-object-position,50% 50%)!important;
}

/* TXT fills exactly the Admin Template slot; no legacy nested card geometry. */
.ap-reader-page .ap-reader-read-view .ap-six-text.ap-paper-text-zone,
.ap-reader-page .ap-reader-read-view .ap-six-text>.ap-six-text-content{
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:100%!important;
  max-height:100%!important;
  margin:0!important;
  box-sizing:border-box!important;
}
.ap-reader-page .ap-reader-read-view .ap-six-text>.ap-six-text-content{
  overflow:auto!important;
}

/* TURN: keep the physical leaf, but do not allow Theme geometry to replace
   the Template Manager coordinates. Runtime CSS is injected after this file. */
.ap-reader-page .ap-reader-shell.ap-flip-single-mode .ap-turn-v3-view .ap-story-canvas.ap-t1-family.ap-layout-template-01,
.ap-reader-page .ap-reader-shell.ap-flip-single-mode .ap-turn-v3-view .ap-story-canvas.ap-six-layout.ap-t1-family{
  display:grid!important;
  grid-template-columns:repeat(12,minmax(0,1fr))!important;
  grid-template-rows:repeat(12,minmax(0,1fr))!important;
  grid-auto-flow:initial!important;
}

/* Mobile READ keeps plugin semantic order; desktop geometry must not leak into it. */
@media(max-width:767px){
  .ap-reader-page .ap-reader-read-view .ap-story-canvas.ap-t1-family.ap-layout-template-01{
    display:flex!important;
    flex-direction:column!important;
    aspect-ratio:auto!important;
    height:auto!important;
    overflow:visible!important;
    gap:10px!important;
  }
  .ap-reader-page .ap-reader-read-view .ap-story-canvas.ap-t1-family>.ap-six-zone{
    position:relative!important;
    width:100%!important;
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    order:var(--ap-mobile-order)!important;
  }
  .ap-reader-page .ap-reader-read-view .ap-six-art>.ap-comic-image-box,
  .ap-reader-page .ap-reader-read-view .ap-six-art .ap-story-art{
    position:relative!important;
    inset:auto!important;
    height:auto!important;
  }
  .ap-reader-page .ap-reader-read-view .ap-six-art .ap-story-art img{
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    height:auto!important;
    object-fit:contain!important;
  }
  .ap-reader-page .ap-reader-read-view .ap-six-text.ap-paper-text-zone,
  .ap-reader-page .ap-reader-read-view .ap-six-text>.ap-six-text-content{
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
  }
}
