/* Ebook Shop widgets identify this composition whether or not its optional banner is present. */
@scope (:is(.fw-layout,.fw-canvas):has([data-fys-part])) {
 :scope:has([data-fys-part]), :scope.fw-mobile:has([data-fys-part]) {
  --bk-ebook-inset:clamp(12px,1.5cqw,24px);
  --bk-ebook-soft:color-mix(in srgb,var(--accent) 6%,var(--paper));
  --bk-ebook-art:color-mix(in srgb,var(--accent) 10%,var(--paper));
  --bk-ebook-title:Georgia,serif;
  display:flex;flex-direction:column;align-items:stretch;gap:0;background:var(--paper);
 }
 :scope:has([data-fys-part])>.fw-section:not(:has(.fpl-bk-hero)){
  width:100%;box-sizing:border-box;padding-inline:var(--bk-ebook-inset);grid-area:auto;
 }
 :scope:has([data-fys-part])>.fw-section:has(.fpl-bk-title){margin-bottom:4px}
 :scope:has([data-fys-part])>.fw-section:has(.fpl-bk-sidebar-anchor){margin:0}
 :scope:has([data-fys-part])>.fw-section:first-of-type:has(.fbp-featured-slider,.fw-homepage-preview,.fpl-bk-hero){padding-inline:var(--bk-ebook-inset);margin-block:8px 20px}
 :scope:has([data-fys-part]).fw-layout>.fw-section:has(.fpl-bk-main-anchor):not(:has(.fw-widget:not(:has(.fpl-bk-main-anchor)))){display:none}
 .fpl-bk-ebook-note{
  margin:0 0 20px;padding:10px 12px;text-align:center;line-height:1.35;
  background:var(--bk-ebook-soft);border-bottom:1px solid var(--line);font-size:.86rem;font-weight:600;
 }
 :scope:has([data-fys-part]) .fpl-bk-title[data-bk-surface] .fpl-bk-ebook-intro{
  display:grid;grid-template-columns:minmax(0,4fr) minmax(108px,1fr);gap:18px;
  align-items:center;min-height:202px;box-sizing:border-box;padding:22px 26px;border:0;
  border-radius:4px;background:var(--bk-row-bg,var(--bk-ebook-soft));
 }
 .fpl-bk-title .fpl-bk-ebook-intro h1{
  font-family:var(--bk-ebook-title);font-size:clamp(1.6rem,2.3cqw,2rem);
  font-weight:700;line-height:1.18;letter-spacing:-.025em;margin:0 0 15px;
 }
 .fpl-bk-title .fpl-bk-ebook-intro p:not(.over){font-size:.97rem;line-height:1.55;max-width:77ch;margin:0}
 .fpl-bk-ebook-copy a{color:var(--accent);text-decoration:underline;text-underline-offset:3px}
 .fpl-bk-ebook-device{
  width:min(100%,106px);aspect-ratio:10/17;padding:8px 4px;box-sizing:border-box;
  background:#fff;color:#24212a;justify-self:center;transform:rotate(-8deg);
  border:4px solid #28282e;border-radius:16px;box-shadow:0 10px 18px #150b2926;
 }
 .fpl-bk-ebook-device strong{display:block;font-size:.49rem;line-height:1.15;margin:4px 0 6px}
 .fpl-bk-ebook-device>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px}
 .fpl-bk-ebook-device img{width:100%;aspect-ratio:2/3;object-fit:contain}
 .fpl-bk-ebook-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:15px 0 16px}
 .fpl-bk-ebook-tile{
  border:1px solid var(--line);border-radius:5px;display:grid;grid-template-columns:1fr 1fr;
  overflow:hidden;min-width:0;min-height:205px;background:var(--paper);
 }
 .fpl-bk-ebook-tile>div{min-width:0;display:flex;flex-direction:column;align-items:flex-start;padding:clamp(12px,2cqw,25px)}
 .fpl-bk-ebook-tile h2{font:700 clamp(1.13rem,2.1cqw,1.65rem)/1.16 var(--bk-ebook-title);margin:0 0 9px}
 .fpl-bk-ebook-tile h2 a{color:inherit;text-decoration:none}
 .fpl-bk-ebook-tile p{font-size:.78rem;line-height:1.28;margin:0 0 14px;color:var(--muted)}
 .fpl-bk-ebook-tile p span{display:inline-grid;place-content:center;background:var(--accent);color:var(--contrast);border-radius:50%;width:20px;height:20px;margin-inline-end:3px;font-weight:800}
 .fpl-bk-ebook-view{margin-top:auto;color:var(--ink);font-size:.86rem;text-decoration:underline;text-decoration-color:var(--accent);text-underline-offset:4px}
 .fpl-bk-ebook-tile-images{
  display:flex;align-items:center;justify-content:center;background:var(--bk-ebook-art);
  padding:12px 7px;min-width:0;isolation:isolate;text-decoration:none;
 }
 .fpl-bk-ebook-tile-images img{box-sizing:border-box;width:31%;aspect-ratio:2/3;height:auto;object-fit:contain;filter:drop-shadow(0 5px 4px #08081644);margin-inline:-2%}
 .fpl-bk-ebook-tile-images img:nth-child(1){transform:rotate(-11deg) translateY(6%)}
 .fpl-bk-ebook-tile-images img:nth-child(2){transform:scale(1.09);z-index:1}
 .fpl-bk-ebook-tile-images img:nth-child(3){transform:rotate(9deg) translateY(6%)}
 .fpl-bk-ebook-tile-images img:nth-child(n+4){display:none}
 .fpl-bk-part[data-bk-surface] .topic{border:0;padding:7px 0 0;margin-bottom:27px}
 :scope:has([data-fys-part]) .fpl-bk-part[data-bk-surface] .topic-head{position:relative;min-height:44px;padding-bottom:7px;margin-bottom:8px;border:0}
 .fpl-bk-part .topic-head h2{font:700 clamp(1.25rem,2.05cqw,1.75rem)/1.22 var(--bk-ebook-title);letter-spacing:-.02em}
 .fpl-bk-part .fpl-bk-shelf-nav a {text-decoration:underline;text-decoration-color:var(--accent);text-underline-offset:4px}
 .fpl-bk-part .shelf[data-bk-track]{--bk-auto-cols:8;gap:8px}
 .fpl-bk-part[data-bk-surface] .fpl-bk-card{padding:2px;background:var(--bk-card-bg,transparent)}
 .fpl-bk-part[data-bk-surface] .fpl-bk-card .cover{height:clamp(114px,15.9cqw,201px);padding:0;border:0;border-radius:3px;background:transparent}
 .fpl-bk-part .shelf h3{font-size:.78rem;font-weight:620}
 .fpl-bk-part[data-bk-surface] .filters{border:0;padding:0 0 10px;margin:0}
 .fpl-bk-refine aside form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) auto;gap:8px;align-items:end}
 .fpl-bk-refine aside form label,.fpl-bk-refine aside form .primary{margin:0}
 .fpl-bk-refine aside .side-end{display:none}
 @container(max-width:1050px){.fpl-bk-part .shelf[data-bk-track]{--bk-auto-cols:6}}
 @container(max-width:700px){
  :scope:has([data-fys-part]) .fpl-bk-title[data-bk-surface] .fpl-bk-ebook-intro{min-height:0;padding:14px 12px;grid-template-columns:minmax(0,1fr) 65px;gap:10px}
  .fpl-bk-title .fpl-bk-ebook-intro h1{font-size:1.42rem;margin-bottom:8px}
  .fpl-bk-title .fpl-bk-ebook-intro p:not(.over){font-size:.83rem}
  .fpl-bk-ebook-note{margin-bottom:12px;font-size:.74rem}
  .fpl-bk-ebook-device{border-width:3px;border-radius:10px;padding:4px 2px}
  .fpl-bk-ebook-device strong{font-size:.39rem;margin:2px 0 4px}
  .fpl-bk-ebook-tiles{grid-template-columns:1fr;gap:10px;margin-top:11px}
  .fpl-bk-ebook-tile{min-height:128px;grid-template-columns:minmax(110px,.9fr) minmax(0,1.1fr)}
  .fpl-bk-part .shelf[data-bk-track]{--bk-auto-cols:3}
  .fpl-bk-refine aside form{grid-template-columns:1fr 1fr}
 }
}
/* Local Yaad composition. Keep the section order saved in Yaad. */
:is(.fw-layout,.fw-canvas):has([data-fys-part])>.fw-section {box-sizing:border-box;grid-row:auto;grid-column:auto;}
:is(.fw-layout,.fw-canvas):has([data-fys-part])>.fw-section:has(.fys-feature) {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;
  padding-inline:var(--bk-ebook-inset,20px);margin-block:15px 16px;
}
:is(.fw-layout,.fw-canvas):has([data-fys-part])>.fw-section:has(.fys-feature)>header {grid-column:1/-1}
:is(.fw-layout,.fw-canvas):has([data-fys-part])>.fw-section:has(.fys-feature)>.fw-widget{grid-column:auto}
.fys-feature .fpl-bk-ebook-tile{background:var(--fys-feature-bg,var(--paper,#fff))}
.fys-shelf .fys-byline{margin:-5px 0 10px;color:var(--muted);font-size:.78rem}
.fys-shelf .fys-byline b{display:inline-grid;place-content:center;width:21px;height:21px;border-radius:50%;background:var(--accent);color:var(--contrast);margin-inline-end:4px}
body:has(.fw-layout [data-fys-part]) .page_content_wrap>.content_wrap,
body:has(.fw-layout [data-fys-part]) .page_content_wrap>.content_wrap>.content,
body:has(.fw-layout [data-fys-part]) article.fbp-page:has(.fw-layout [data-fys-part]){width:min(100%,1360px);max-width:1360px;margin-inline:auto}
body:has(.fw-layout [data-fys-part]) .content>.fbp-public-page-heading{display:none}
@container(max-width:700px){:is(.fw-layout,.fw-canvas):has([data-fys-part])>.fw-section:has(.fys-feature){grid-template-columns:minmax(0,1fr);gap:10px}}
#fiweh-widget-app [data-fys-internal]{display:none!important}
.fys-fields {display:grid;gap:8px;}

.fys-setup-form{display:inline-flex;align-items:center;margin:0}

/* Bookshop-style open shelves, including the compact series card variant. */
.fw-layout:has([data-fys-part]),body:has(.fw-layout [data-fys-part]) .fw-template {
 width:100%;max-width:1360px;box-sizing:border-box;margin-inline:auto;
}
:is(.fw-layout,.fw-canvas):has([data-fys-part]) .fys-shelf.fpl-bk-part[data-bk-surface] :is(.fpl-bk-card,.cover) {
 border:0!important;outline:0;box-shadow:none!important;
}
:is(.fw-layout,.fw-canvas):has([data-fys-part]) .fys-shelf .fpl-bk-card :is(a, h3, img) {border:0;box-shadow:none}
:is(.fw-layout,.fw-canvas):has([data-fys-part]) .fys-shelf .fpl-bk-card :is(a):focus-visible,
:is(.fw-layout,.fw-canvas):has([data-fys-part]) .fys-shelf a.fpl-bk-card:focus-visible {
 outline:2px solid currentColor;outline-offset:2px;
}
.fys-shelf .fpl-bk-card :is(.caption,small){display:none}

.fys-fields label[hidden]{display:none!important}

/* Ebook shelf dimensions measured against Bookshop.org: 176px below
   1024px and 224px from 1024px. Use fixed card tracks so the handset
   swipes to the next cover instead of squeezing three into the viewport. */
.fys-shelf[data-bk-surface]{--fys-cover-height:176px;--fys-shelf-slot:118px}
@media(min-width:1024px){
 .fys-shelf[data-bk-surface]{--fys-cover-height:224px;--fys-shelf-slot:150px}
 .fw-canvas.fw-mobile .fys-shelf[data-bk-surface]{--fys-cover-height:176px;--fys-shelf-slot:118px}
}
.fys-shelf[data-bk-surface]:not([data-bk-shelf-layout=arrows]){--fys-cover-height:150px}
.fys-shelf[data-bk-surface][data-bk-shelf-layout=arrows] [data-bk-track]{
 gap:8px;grid-auto-columns:min(100%,var(--fys-shelf-slot));max-width:100%;min-width:0;
}
@media(min-width:701px){
 :is(.fw-layout,.fw-canvas:not(.fw-mobile)) .fys-shelf[data-bk-surface][style*="--bk-cols:"] [data-bk-track]{
  grid-auto-columns:calc((100% - (var(--bk-cols) - 1)*8px)/var(--bk-cols));
 }
}
@media(max-width:700px){
 .fw-layout .fys-shelf[data-bk-surface][style*="--bk-cols-mobile:"] [data-bk-track]{
  grid-auto-columns:calc((100% - (var(--bk-cols-mobile) - 1)*8px)/var(--bk-cols-mobile));
 }
}
.fw-canvas.fw-mobile .fys-shelf[data-bk-surface][style*="--bk-cols-mobile:"] [data-bk-track]{
 grid-auto-columns:calc((100% - (var(--bk-cols-mobile) - 1)*8px)/var(--bk-cols-mobile));
}
:is(.fw-layout,.fw-canvas):has([data-fys-part]) .fys-shelf[data-bk-surface] .fpl-bk-card{
 padding:0;min-width:0;
}
:is(.fw-layout,.fw-canvas):has([data-fys-part]) .fys-shelf[data-bk-surface] .fpl-bk-card .cover{
 height:var(--fys-cover-height);min-height:0;max-height:none;width:100%;padding:0;
}
:is(.fw-layout,.fw-canvas):has([data-fys-part]) .fys-shelf[data-bk-surface] .cover>img{
 display:block;width:auto;height:100%;max-width:100%;object-fit:contain;place-self:center;
}
:is(.fw-layout,.fw-canvas):has([data-fys-part]) .fys-shelf[data-bk-surface] .series .fpl-bk-card{
 display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:5px;text-align:center;
}
:is(.fw-layout,.fw-canvas):has([data-fys-part]) .fys-shelf[data-bk-surface] .series .fpl-bk-card>img{
 display:block;width:auto;height:var(--fys-cover-height);max-width:100%;object-fit:contain;
}

/* Shorten the gap before the standard Reader promo on this Ebook Shop only. */
body:has(.fw-layout [data-fys-part]):has(.fbp-footer-reader-promo) .page_content_wrap{
 padding-bottom:0!important;
}
body:has(.fw-layout [data-fys-part]):has(.fbp-footer-reader-promo) .page_content_wrap .fw-template:has([data-fys-part]){
 margin-bottom:0!important;
}
body:has(.fw-layout [data-fys-part]) .page_wrap>.fbp-footer-reader-promo{
 padding-top:6px;
}

/* The Ebook Shop banner keeps its artwork beside the copy at wide widths. */
@scope (:is(.fw-layout,.fw-canvas):has([data-fys-part])) {
 @container(max-width:700px) {
  :scope .fys-banner.fpl-bk-title[data-bk-surface] .fpl-bk-ebook-intro{
   grid-template-columns:minmax(0,1fr);grid-template-areas:"art" "copy";
   gap:16px;padding:18px 16px;
  }
  .fys-banner .fpl-bk-ebook-copy{grid-area:copy}
  .fys-banner .fpl-bk-ebook-device{grid-area:art;width:min(100%,86px)}
 }
 :scope.fw-mobile .fys-banner.fpl-bk-title[data-bk-surface] .fpl-bk-ebook-intro{
  grid-template-columns:minmax(0,1fr);grid-template-areas:"art" "copy";
  gap:16px;padding:18px 16px;
 }
 :scope.fw-mobile .fys-banner .fpl-bk-ebook-copy{grid-area:copy}
 :scope.fw-mobile .fys-banner .fpl-bk-ebook-device{grid-area:art;width:min(100%,86px)}
}

/* Books and Stories feature cards: larger cover collages, side by side or stacked. */
@scope (:is(.fw-layout,.fw-canvas):has([data-fys-part])) {
 .fys-feature .fpl-bk-ebook-tile{
  display:grid;
  grid-template-columns:var(--fys-feature-columns,minmax(0,1.3fr) minmax(0,1fr));
  grid-template-areas:var(--fys-feature-areas,"art copy");
  min-height:var(--fys-feature-height,222px);
 }
 .fys-feature .fpl-bk-ebook-tile>div{grid-area:copy}
 .fys-feature .fpl-bk-ebook-tile-images{
  grid-area:art;box-sizing:border-box;
  min-height:var(--fys-feature-art-height,0px);padding:18px 10px;
 }
 .fys-feature .fpl-bk-ebook-tile-images>img{
  width:min(31%,132px);max-width:none;height:auto;max-height:188px;flex:0 0 auto;object-fit:contain;
 }
 @container(max-width:700px){
  .fys-feature{
   --fys-feature-columns:minmax(0,1fr);
   --fys-feature-areas:"art" "copy";
   --fys-feature-height:0px;
   --fys-feature-art-height:154px;
  }
 }
 @media(max-width:700px){
  .fys-feature{
   --fys-feature-columns:minmax(0,1fr);
   --fys-feature-areas:"art" "copy";
   --fys-feature-height:0px;
   --fys-feature-art-height:154px;
  }
 }
 :scope.fw-mobile .fys-feature{
  --fys-feature-columns:minmax(0,1fr);
  --fys-feature-areas:"art" "copy";
  --fys-feature-height:0px;
  --fys-feature-art-height:154px;
 }
}
@media(max-width:700px){
 :is(.fw-layout,.fw-canvas):has([data-fys-part])>.fw-section:has(.fys-feature){
  grid-template-columns:minmax(0,1fr);gap:10px;
 }
}
.fw-canvas.fw-mobile:has([data-fys-part])>.fw-section:has(.fys-feature){
 grid-template-columns:minmax(0,1fr);gap:10px;
}
