/* LayerScene Editions: six approved visual designs (preview branch only).
   Intentionally scoped: no homepage Hero, custom section or backend styling changes. */

.edition-flow .edition-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:30px 22px}
.edition-custom-note{display:grid;grid-template-columns:minmax(180px,.34fr) 1fr;gap:24px;align-items:center;padding:19px 22px;margin:-4px 0 30px;border:1px solid rgba(36,79,136,.12);background:#f8f9f7}
.edition-custom-note strong{font:400 24px/1.08 "EB Garamond",Georgia,serif;color:var(--ink)}
.edition-custom-note span{font:18px/1.55 Georgia,serif;color:#667e96}
.template-card .edition-preview{display:block}
.edition-image-frame{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:1.43;background:#f4f3f0;overflow:hidden;border:1px solid rgba(36,79,136,.15);box-shadow:0 8px 20px rgba(20,34,46,.065)}
.edition-image-frame img{width:100%;height:100%;object-fit:contain;display:block}
.edition-image-overlay{position:absolute;right:12px;bottom:12px;padding:7px 12px;font-size:10px;letter-spacing:.12em;color:#244f88;background:rgba(255,255,255,.95);opacity:0;transform:translateY(4px);transition:opacity .2s,transform .2s;pointer-events:none}
.template-preview-button:hover .edition-image-overlay,.template-preview-button:focus-visible .edition-image-overlay{opacity:1;transform:none}
.template-preview-button:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
.template-card.is-selected .edition-image-frame{outline:2px solid var(--ink);outline-offset:3px}
.template-card .edition-meta{grid-template-columns:26px minmax(0,1fr);gap:10px;padding:13px 2px}
.template-card .edition-meta h3{font-size:25px;margin:0}
.template-card .edition-meta p{max-width:none;margin:3px 0 0;line-height:1.5}
.edition-sample{font-size:10px;line-height:1.5;color:#8292a1;display:block;margin-top:5px}
.template-card .template-swatches{margin-top:11px}
.template-card .edition-actions{grid-column:2;display:flex;justify-content:flex-start;gap:8px;margin-top:7px}
.template-card .edition-actions button{cursor:pointer;min-width:88px;min-height:35px;padding:8px 15px;border:1px solid rgba(36,79,136,.30);font:600 10px/1.2 "DM Sans",Arial,sans-serif;letter-spacing:.11em;white-space:nowrap}
.template-card .edition-view{background:white;color:var(--ink)}
.template-card .edition-choose{background:#244f88;color:white;border-color:#244f88}
.template-card .edition-choose:hover{background:#183e70}
.template-card .edition-actions button:focus-visible{outline:2px solid #b86145;outline-offset:3px}

.template-preview-dialog{width:min(1180px,96vw);max-height:92vh;max-height:92dvh;overflow:hidden}
.template-preview-stage{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(270px,.65fr);max-height:92vh;max-height:92dvh;overflow:hidden}
.template-preview-large{display:grid;gap:20px;align-content:start;overflow-y:auto;padding:26px;background:#f0f2f2}
.edition-preview-page{margin:0;min-width:0}
.edition-preview-page figcaption{font-size:10px;letter-spacing:.17em;font-weight:600;color:#71849a;margin:0 0 8px}
.edition-preview-page-frame{width:100%;aspect-ratio:1.45;background:white;display:flex;align-items:center;justify-content:center;border:1px solid rgba(36,79,136,.14);overflow:hidden}
.edition-preview-page-frame img{display:block;width:100%;height:100%;object-fit:contain}
.template-preview-info{padding:58px 30px 30px;min-height:0;overflow-y:auto}
.template-preview-info h3{font-size:38px}
.template-preview-info p{margin-bottom:15px}
.template-customization{padding:20px 0 16px;margin:8px 0 22px;border-top:1px solid var(--line)}
.template-customization strong{font:400 24px/1.2 "EB Garamond",Georgia,serif;color:var(--ink)}
.template-customization p{font-size:12px;margin:10px 0 0}
.template-customization .template-customization-small{font-size:11px;color:#8a7e77}
.template-preview-info .preview-choose{margin-top:auto;flex-shrink:0}
@media(max-width:980px){.edition-flow .edition-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.template-preview-stage{grid-template-columns:1fr;overflow-y:auto}.template-preview-large{overflow:visible}.template-preview-info{overflow:visible;padding:24px 26px 28px}.edition-custom-note{grid-template-columns:1fr}}
@media(max-width:620px){.edition-flow .edition-grid{grid-template-columns:1fr}.edition-image-frame{aspect-ratio:1.43}.template-preview-dialog{width:96vw}.template-preview-large{padding:14px;gap:12px}.edition-preview-page-frame{aspect-ratio:1.4}.template-preview-info{padding:20px}.edition-custom-note{padding:16px;margin-bottom:22px}}

/* Desktop modal regression: the grid's implicit auto row expanded beyond the
   dialog's height and its overflow:hidden clipped both the second page and CTA.
   Give the row a definite, shrinkable height and let each pane scroll itself. */
@media(min-width:981px){
  .template-preview-stage{
    height:min(92dvh,900px);
    grid-template-rows:minmax(0,1fr);
  }
  .template-preview-large,
  .template-preview-info{
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  .template-preview-large{scrollbar-gutter:stable}
}

/* Approved long-page previews (1200 × 2200). Card thumbnails intentionally
   show the top of the homepage; the View dialog displays every pixel of both
   full-length pages. No image is resized/cropped on disk or stretched in CSS. */
.edition-image-frame{display:block}
.edition-image-frame img{
  position:absolute;
  inset:0 auto auto 0;
  width:100%;
  height:auto;
  max-width:none;
  object-fit:initial;
}
.edition-preview-page-frame{
  display:block;
  aspect-ratio:auto;
  height:auto;
  overflow:visible;
}
.edition-preview-page-frame img{
  display:block;
  width:100%;
  height:auto;
  max-width:100%;
  object-fit:initial;
}

/* Match Editions explanatory copy to the existing main intro type scale. */
@media(max-width:760px){.edition-custom-note span{font-size:16px}}
