/* One reading edge for the opener, scenes, and section panels.
   Insets belong to the text, not to the story artwork. */
.wrap {
  --fb-page-gutter: clamp(10px, 2.3vw, 16px);
  --fb-panel-text: clamp(16px, 3.5vw, 32px);
  --fb-picture-radius: clamp(14px, 2.25vw, 23px);
  padding-inline: var(--fb-page-gutter);
  position: relative;
}
.wrap::before,.wrap::after,.wrap .doodle-cluster { display: none; }
.wrap .topsec.top-fill {
  min-height: 0;
  justify-content: flex-start;
  padding-bottom: 0;
}
.wrap .leadpic,.wrap .lesspic,.wrap .bookrow,
.wrap .teach,.wrap .quickjump,.wrap .grownups-block,
.wrap .closing-ritual,.wrap .nextpeek,.wrap .prevnext,
.wrap .closing,.wrap .nextbook { width: 100%; max-width: none; }
.wrap .leadpic > .bigpic,.wrap .lesspic > .bigpic,
.wrap .bookrow > .bigdiagram {
  width:100%; height:auto; max-height:none; object-fit:contain;
}
.wrap .bigpic,.wrap .bigdiagram,.wrap .hero-frame {
  border-radius: var(--fb-picture-radius);
  border: clamp(3px,.5vw,6px) solid #fffdf8;
  outline: 1px solid #d7af7c;
  outline-offset: -1px;
}
.wrap .teach {
  --fb-panel-edge: 2px;
  border-inline-width:var(--fb-panel-edge);
  padding-inline:var(--fb-panel-text);
}
.wrap .teach > :is(.bigpic,.bigdiagram,.storypic) {
  display:block;
  width:calc(100% + 2 * (var(--fb-panel-text) + var(--fb-panel-edge)));
  max-width:none;
  height:auto;
  max-height:none;
  margin-inline:calc(-1 * (var(--fb-panel-text) + var(--fb-panel-edge)));
  border-radius: 0;
  border: 0;
  outline: 0;
  object-fit:contain;
}
.wrap .teach > :is(.bigpic,.bigdiagram,.storypic) + :is(p, div, ol, ul) {
  margin-top: .85rem;
}
.wrap .pagehead h1,.wrap .lessonhead h1 { padding-inline: .5rem; }
.wrap .pagehead,.wrap .lessonhead { overflow-wrap:anywhere; }
.wrap .tile .tt::after { display:none; }
.wrap .tile .tiletitle { padding-right:0; }
/* Fold decorative rails away before they can compete with the reading column. */
.wrap .fb-margin,.wrap .topic-margin { display:none; }
@media (min-width: 1220px) {
  .wrap .fb-margin,.wrap .topic-margin {
    display:block;
    position:absolute;
    z-index:0;
    pointer-events:none;
    top:8.9rem;
    width:min(184px, calc((100vw - 1060px) / 2 - 28px));
  }
  .wrap .fb-margin.left,.wrap .topic-margin.left {
    right:calc(100% - var(--fb-page-gutter) + 9px);
  }
  .wrap .fb-margin.right,.wrap .topic-margin.right {
    left:calc(100% - var(--fb-page-gutter) + 9px);
    top:11.3rem;
  }
  .wrap .fb-margin svg,.wrap .fb-margin img { display:block; width:100%; height:auto; }
  .wrap .fb-margin .ember-margin { position:absolute; top:39%; left:0; transform:rotate(-5deg); }
  .wrap .topic-margin {
    height:clamp(170px,18vw,260px);
    border-top:1px solid #c89468;
    background:linear-gradient(#dfb98d,#dfb98d) left .5rem top .5rem / calc(100% - 1.3rem) 1px no-repeat;
  }
  .wrap .topic-margin.left { border-left:1px solid #d8ae87; border-radius:18px 0 0 0; }
  .wrap .topic-margin.right { border-right:1px solid #d8ae87; border-radius:0 18px 0 0; }
  .wrap .topic-margin .topic-icon {
    display:block; width:min(75px,78%); height:auto; margin:clamp(27px,4vw,55px) auto;
    transform:rotate(-9deg);
  }
  .wrap .topic-margin.right .topic-icon { transform:rotate(8deg); }
}
.wrap .fb-phone-doodle { display:none; }
/* The homepage opener uses the same edges without changing or cropping the painting. */
.fb-hub .hero {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  justify-items:stretch;
  gap:clamp(.7rem,2vw,1.4rem);
  text-align:center;
}
.fb-hub .hero .sub,.fb-hub .hero .tap { margin-inline:auto; }
.fb-hub .hero .hero-frame { width:100%; max-width:none; max-height:none; }
@media (max-width:760px) {
  .wrap .fb-phone-doodle {
    display:inline-block;
    width:1.2em; height:1em; margin-inline-end:.35em; vertical-align:-.12em;
  }
  .wrap .tiles,.wrap .gallery:not(.bookGallery) { grid-template-columns:minmax(0,1fr); }
}
/* Finish the row at every breakpoint. Spare space becomes a featured route,
   never an empty grid cell or a duplicated card. */
@media (min-width:761px) and (max-width:989px) {
  .wrap .tiles { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .wrap .tiles > .tile:last-child:nth-child(odd) { grid-column:1/-1; }
}
@media (min-width:990px) {
  .wrap .tiles:not(.qj-tiles) { grid-template-columns:repeat(6,minmax(0,1fr)); }
  .wrap .tiles:not(.qj-tiles) > .tile { grid-column:span 2; }
  .wrap .tiles:not(.qj-tiles) > .tile:last-child:nth-child(3n+1) { grid-column:1/-1; }
  .wrap .tiles:not(.qj-tiles) > .tile:nth-last-child(2):nth-child(3n+1),
  .wrap .tiles:not(.qj-tiles) > .tile:nth-last-child(2):nth-child(3n+1) + .tile { grid-column:span 3; }
  .wrap .qj-tiles { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .wrap .qj-tiles > .tile:last-child:nth-child(odd) { grid-column:1/-1; }
}
@media (min-width:761px) {
  .wrap .tiles > .tile { container-type:inline-size; }
  .wrap .directory-grid > :last-child:nth-child(odd) { grid-column:1/-1; }
}
@container (min-width:710px) {
  .wrap .tile > img.diagram { display:inline-block; width:50%; vertical-align:middle; aspect-ratio:16/9; }
  .wrap .tile > .tt { display:inline-flex; flex-direction:column; justify-content:center; width:49%; vertical-align:middle; }
}

/* A short or zoomed desktop window must still see the whole homepage opener.
   Resize the reading column with the available height so its edges stay shared. */
@media (min-width:761px) {
  .wrap.fb-hub {
    max-width:min(1060px,max(420px,calc((100svh - 13.5rem) * 1.777 + 2 * var(--fb-page-gutter))));
  }
  .fb-hub .hero { padding-block:clamp(.65rem,1.8svh,1.15rem) .45rem; gap:.65rem; }
  .fb-hub .hero h1 { font-size:clamp(2.2rem,6.3svh,4rem); }
  .fb-hub .hero .sub { max-width:none; font-size:clamp(1.08rem,2.35svh,1.5rem); margin-top:.45rem; }
  .fb-hub .hero .tap { margin-top:.25rem; }
}
@media (max-height:580px) and (min-width:761px) {
  .fb-hub .hero h1 { font-size:clamp(1.85rem,5.9svh,2.7rem); }
  .fb-hub .hero .sub,.fb-hub .hero .tap { font-size:1rem; line-height:1.35; }
}
@media (min-width:1220px) {
  .wrap.fb-hub .fb-margin.left { top:clamp(6rem,15.5svh,9rem); }
  .wrap.fb-hub .fb-margin.right { top:clamp(7.45rem,18svh,10.7rem); }
}
.fb-hub { container-type:inline-size; }
@container (min-width: 530px) and (max-width: 890px) {
  .fb-hub.wrap .tiles:not(.qj-tiles) { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .fb-hub.wrap .tiles:not(.qj-tiles) > .tile:nth-child(n) { grid-column:auto; }
  .fb-hub.wrap .tiles:not(.qj-tiles) > .tile:last-child:nth-child(odd) { grid-column:1/-1; }
}
@container (max-width: 529px) {
  .fb-hub.wrap .tiles:not(.qj-tiles) { grid-template-columns:minmax(0,1fr); }
  .fb-hub.wrap .tiles:not(.qj-tiles) > .tile:nth-child(n) { grid-column:1/-1; }
}

/* The largest next-story links need the original framing and enough pixels. */
.wrap .nextbook > img.diagram { width:100%; height:auto; aspect-ratio:auto; object-fit:contain; }
@media (min-width:761px) {
  .wrap .gallery#fireblitz-special-scenes { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .wrap .gallery#fireblitz-special-scenes > :last-child:nth-child(odd) { grid-column:1/-1; }
}
.wrap .fb-mobile-mark { display:none; }
.wrap .fb-scene-mark {
  display:inline-block; width:clamp(34px,6vw,58px); height:auto;
  margin-left:.55rem; vertical-align:-.32em; pointer-events:none;
}
.wrap .fb-ember-interlude {
  width:100%; display:flex; justify-content:flex-end; padding:0 clamp(14px,2vw,36px);
  margin:.25rem 0 -.35rem; pointer-events:none;
}
.wrap .fb-ember-interlude img { display:block; width:clamp(86px,15vw,126px); height:auto; }
@media (max-width:760px) {
  .wrap .fb-mobile-mark {
    display:inline-block; width:1.45em; height:auto; margin-inline-end:.36em;
    vertical-align:-.16em; pointer-events:none;
  }
  .wrap .fb-scene-mark { width:33px; margin-left:.32rem; }
  .wrap .fb-ember-interlude img { width:clamp(74px,21vw,96px); }
}

/* Fill the space with the story or a purposeful companion, never a blank grid cell. */
.wrap .meet {
  padding:clamp(16px,3vw,31px);
  grid-template-columns:minmax(0,1fr);
  gap:clamp(.55rem,2vw,1.65rem);
}
.wrap .meet:has(.fb-meet-ember) { grid-template-columns:minmax(0,1fr) clamp(112px,22%,205px); }
.wrap .meet .fb-meet-ember { display:block; width:100%; height:auto; border:0; border-radius:0; box-shadow:none; }
@media (max-width:460px) {
  .wrap .meet:has(.fb-meet-ember) { grid-template-columns:minmax(0,1fr); }
  .wrap .meet .fb-meet-ember { width:76px; justify-self:end; margin-top:-.25rem; }
}
.wrap .prevnext > :only-child { grid-column:1/-1; }

/* Family field notes share the chapter palette, with distinct tasks and easy scanning. */
.wrap .grownups-block,.wrap .teach.how-sec {
  border:1px solid #d7b693;
  border-top:clamp(5px,.7vw,9px) solid var(--sec,#bd6241);
  background:linear-gradient(160deg,var(--sec-soft,#f8eedc),#fffaf1 52%);
  color:var(--ink,#2e241a);
  border-radius:var(--fb-picture-radius);
  padding:clamp(18px,3vw,32px);
}
.wrap .grownups-block h2,.wrap .teach.how-sec h2 {
  color:var(--sec-dark,#913017);
  font-size:clamp(1.45rem,3vw,1.95rem);
  line-height:1.2;
  margin:.15rem 0 .95rem;
}
.wrap .grownups-block :is(.fb-grown-try,.fb-grown-ask,.fb-grown-notes) {
  margin:.85rem 0;
  padding:clamp(12px,2vw,19px);
  border-radius:13px;
  border:1px solid #e3ccb0;
  background:#fffaf1;
}
.wrap .grownups-block .fb-grown-try { background:var(--sec-light,#f9e7c7); border-inline-start:4px solid var(--sec,#bd6241); }
.wrap .grownups-block :is(.fb-grown-try,.fb-grown-ask,.fb-grown-notes) > p { margin:0; }
.wrap .grownups-block :is(.fb-grown-ask,.fb-grown-notes) > p > b { color:var(--sec-dark,#913017); font-size:1.05em; }
.wrap .grownups-block :is(.fb-grown-ask,.fb-grown-notes) ul { margin:.58rem 0 .12rem; padding-inline-start:1.3rem; }
.wrap .grownups-block :is(.fb-grown-ask,.fb-grown-notes) li { padding-block:.27rem; }
.wrap .grownups-block :is(.fb-grown-ask,.fb-grown-notes) li::marker { color:var(--sec-dark,#913017); }
.wrap .grownups-block .sources { color:#5f4935; margin-top:.9rem; }
.wrap .teach.how-sec .steps { margin-top:.65rem; }
.wrap .teach.how-sec .steps li { border-bottom:1px solid #dfcbb3; padding-block:.74rem; }
.wrap .teach.how-sec .steps li:last-child { border-bottom:0; }
.wrap .teach.how-sec > ul:not(.steps) { padding-inline-start:1.35rem; }

/* Preserve the native box while responsive next-story artwork is lazy-loaded. */
.wrap .nextbook > img.diagram[width="1536"][height="1024"] { aspect-ratio:1536 / 1024; }
.wrap .nextbook > img.diagram[width="1672"][height="941"] { aspect-ratio:1672 / 941; }

/* The margin keeps a little companion in wide windows, out of the reading path.
   Smaller screens keep the same margin-free story layout. */
.wrap .topic-margin .fb-rail-ember { display:none; }
@media (min-width:1220px) {
  .wrap .topic-margin .fb-rail-ember {
    display:block;
    width:100%;
    height:auto;
    margin:-1.4rem auto 0;
  }
  .wrap .topic-margin.right:has(.fb-rail-ember) {
    height:auto;
    min-height:clamp(190px,22vw,350px);
  }
  .wrap .topic-margin .topic-icon { width:min(98px,82%); }
  .wrap .topic-margin .fb-scene-mark {
    display:block;
    width:min(80px,75%);
    margin:clamp(.7rem,2.2vw,1.7rem) auto 0;
  }
  .wrap .fb-ember-mobile { display:none; }
}
.wrap .meet:has(.fb-meet-pair) { grid-template-columns:minmax(0,1fr) clamp(130px,34%,285px); }
.wrap .meet .fb-meet-pair { width:100%; max-width:285px; justify-self:center; }
@media(max-width:560px){
  .wrap .meet:has(.fb-meet-pair) { grid-template-columns:minmax(0,1fr); }
  .wrap .meet .fb-meet-pair { width:min(62%,210px); margin-top:0; }
}

/* Shared opener behavior for every illustrated entry. Preserve the native painting ratio. */
@media (min-width:761px) {
  .wrap:not(.fb-hub):has(> .topsec) { max-width:min(1060px,var(--fb-fitted-main,1060px)); }
  .wrap.fb-hub:has(> .topsec) {
    max-width:min(1060px,var(--fb-fitted-main,max(420px,calc((100svh - 13.5rem) * 1.777 + 2 * var(--fb-page-gutter)))));
  }
  .wrap .topsec > .pagehead { padding-block:clamp(.65rem,1.9svh,1.25rem) .52rem; }
  .wrap .topsec :is(.pagehead,.lessonhead) h1 { font-size:clamp(2rem,5.8svh,3.2rem); }
  .wrap .topsec > .pagehead p { margin:.25rem auto; font-size:clamp(1rem,2.45svh,1.18rem); }
  .wrap .topsec > .gallery { grid-template-columns:repeat(2,minmax(0,1fr)); margin:.65rem 0 .4rem; }
  .wrap .topsec > .gallery img { width:100%; display:block; height:auto; aspect-ratio:1672 / 941; object-fit:contain; }
}
.wrap .fb-after-opener {
  margin:clamp(.9rem,2vw,1.4rem) 0 0;
  padding:clamp(14px,2.7vw,23px);
  border-radius:var(--fb-picture-radius);
  border:1px solid #dfc299;
  background:linear-gradient(145deg,var(--sec-soft,#f9edd6),#fffaf1);
  color:var(--ink);
  text-align:center;
}
.wrap .fb-after-opener p { margin:.17rem 0 .35rem; font-size:clamp(1rem,2.5vw,1.15rem); }
.wrap .fb-after-opener p:last-child { margin-bottom:.05rem; }
@media (max-width:760px) {
  .wrap .topsec > .pagehead { padding-block:1.1rem .55rem; }
  .wrap .topsec > .pagehead p { font-size:clamp(1rem,3.4vw,1.12rem); }
}

/* Decorative book-margin sketches, attached to the illustrated beat, not fixed to a screen coordinate. */
.wrap .fb-rail-pocket { display:none; }
@media (min-width:1220px) {
 .wrap .fb-rail-pocket { display:block; position:relative; height:0; width:100%; pointer-events:none; }
 .wrap .fb-rail-sketch {
   position:absolute; display:block; width:min(146px,calc((100vw - 1060px)/2 - 31px));
   height:auto; opacity:.92; pointer-events:none;
 }
 .wrap .fb-rail-sketch.left { right:calc(100% + 13px); }
 .wrap .fb-rail-sketch.right { left:calc(100% + 13px); }
 .wrap .fb-rail-story-beat .fb-rail-sketch { top:clamp(42px,6vh,82px); }
 .wrap .fb-rail-opener-end .fb-rail-sketch { bottom:12px; }
 .wrap .fb-rail-opener-end .fb-rail-sketch.left { bottom:clamp(28px,6vh,74px); }
}
@media (max-height:690px) {
 .wrap .fb-rail-opener-end { display:none; } /* Keep short-window artwork in its own space. */
}

/* Meet and the cinematic gallery keep the shared reading width. A short
   window may scroll; it must not shrink these entire pages to one small frame. */
.wrap[data-fb-standard-width]:not(.fb-hub):has(> .topsec){max-width:1060px}
.fb-aligned-rail{display:none}
@media(min-width:1220px) {
 .wrap.fb-rails-ready > :is(.topic-margin,.fb-margin,.fb-lower-rail),
 .wrap.fb-rails-ready .fb-rail-pocket,
 .wrap.fb-rails-ready .teach .fb-scene-mark {display:none}
 .wrap.fb-rails-ready > .fb-aligned-rail {
  --rail-w:clamp(56px,calc((100vw - 1060px)/2 - 29px),154px);
  position:absolute;pointer-events:none;display:block;
  top:var(--rail-start,0px);height:var(--rail-height,0px);width:var(--rail-w);
  border-block:1px solid #d0a479;
 }
 .wrap.fb-rails-ready > .fb-aligned-rail.left {
  right:calc(100% - var(--fb-page-gutter) + 13px);
  border-left:1px solid #deb995;border-radius:18px 0 0 18px;
 }
 .wrap.fb-rails-ready > .fb-aligned-rail.right {
  left:calc(100% - var(--fb-page-gutter) + 13px);
  border-right:1px solid #deb995;border-radius:0 18px 18px 0;
 }
 .fb-aligned-rail .fb-rail-slot {
  position:absolute;inset-inline:4px;top:var(--rail-at);transform:translateY(-50%);
  display:grid;place-items:center;
 }
 .fb-aligned-rail .fb-rail-slot svg{display:block;width:min(100%,126px);height:auto}
 .fb-aligned-rail .fb-rail-slot img{display:block;width:min(100%,126px);height:auto;max-height:105px;object-fit:contain}
}
.wrap .divider-zigzag { background:none; height:1px; border-top:1px solid #dfc49f; }
.wrap .basic::after { display:none; }
.wrap:is(.fb-real-story,.fb-dark-story) { --fb-picture-radius:clamp(14px,2.2vw,23px); }
.wrap.fb-real-story .intro,.wrap.fb-dark-story .hero { padding-block:clamp(.8rem,2vh,1.35rem) .75rem; }
.wrap.fb-real-story .intro h1,.wrap.fb-dark-story .hero h1 { font-size:clamp(2.2rem,7vh,4.05rem); }
.wrap.fb-dark-story :is(.fb-aligned-rail,.fb-rail-pocket,.fb-margin,.topic-margin){display:none!important}

/* One responsive page edge for every Firehouse template. The 4:3 budget
   fits the taller storybook covers without changing width between pages. */
main.wrap {
  --fb-reading-width: 1060px;
  width:min(100%,var(--fb-reading-width));
  max-width:var(--fb-reading-width);
  margin-inline:auto;
}
@media (min-width:761px) {
  main.wrap {
    --fb-reading-width:min(1060px,max(460px,calc((100svh - 11.25rem) * 1.3333 + 2 * var(--fb-page-gutter))));
    --fb-fitted-main:var(--fb-reading-width);
  }
  /* Predictable clearance for a tall cover even in a short desktop window.
     The image remains full-width and intact; exceptionally short screens scroll. */
  main.wrap:has(> .topsec):not(.fb-hub):not(.fb-dark-story),
  main.wrap.fb-hub:has(> .topsec),
  main.wrap.fb-real-story[data-fb-standard-width]:has(> .topsec) {
    max-width:var(--fb-reading-width);
  }
}
main.wrap.directory .directory-intro { max-width:none; }

/* Leave room for a taller portrait-format lesson cover on a short desktop. */
@media(min-width:761px) and (max-height:1000px){
  main.wrap .topsec > .lessonhead{padding-block:.35rem .28rem}
  main.wrap .topsec > .lessonhead h1{margin-block:.24rem 0;font-size:clamp(1.9rem,5.4svh,3.05rem)}
}

/* Equal-height book cards, with the original images shown at their own ratio. */
.theme-book .wrap #fireblitz-special-scenes.gallery{align-items:stretch}
.theme-book .wrap #fireblitz-special-scenes.gallery > .figlink{display:flex;min-width:0}
.theme-book .wrap #fireblitz-special-scenes.gallery > .figlink > figure{display:flex;flex:1;flex-direction:column;min-width:0}
.theme-book .wrap #fireblitz-special-scenes.gallery > .figlink figcaption{flex:1}


/* Picture-book edition. Shared styling only: art, sizing, and lesson routes stay intact. */
:root{
 --ef-book-serif:Georgia,"Liberation Serif",serif;
 --ef-book-ivory:#fbf3e2;
 --ef-book-paper:#fffaf0;
 --ef-book-parchment:#f3e5cc;
 --ef-book-red:#782b23;
 --ef-book-brass:#ad793b;
 --ef-book-line:#d8b78b;
}
body[class^="theme-"],body:has(> main.fb-real-story){background-color:var(--ef-book-ivory)}
body[class^="theme-"] .ember-header:not(.ef-night),body:has(> main.fb-real-story) .ember-header:not(.ef-night){
 --ef-bar:#762b22;--ef-mark:#d4a05e;
 background:linear-gradient(180deg,#7f261c,#612119);box-shadow:none
}
main.wrap:not(.fb-dark-story) :is(.pagehead,.lessonhead,.directory-intro) h1{
 font-family:var(--ef-book-serif);letter-spacing:-.023em;line-height:1.04;font-weight:700
}
main.wrap:not(.fb-dark-story) :is(.teach,.directory-card,.grownups-block,.ef-trail-finish,.closing-ritual,.ef-story-peek,.nextpeek,.meet,.family,.related) h2{
 font-family:var(--ef-book-serif);font-weight:700;letter-spacing:-.015em;line-height:1.14
}
main.wrap:not(.fb-dark-story) :is(.leadpic,.lesspic,.bookrow,.painting) > :is(.bigpic,.bigdiagram){
 border-color:#fff7e6;outline-color:var(--ef-book-brass);outline-offset:-1px;box-shadow:none
}
main.wrap:not(.fb-dark-story) :is(.teach,.directory-card,.ef-story-peek,.ef-trail-finish,.closing-ritual){
 border-color:var(--ef-book-line);box-shadow:none
}
main.wrap:not(.fb-dark-story) .teach > :is(.bigpic,.bigdiagram,.storypic){
 border-block:1px solid color-mix(in srgb,var(--ef-book-line) 74%,transparent)
}
main.wrap:not(.fb-dark-story) :is(.directory-card,.ef-story-peek,.ef-trail-finish,.closing-ritual){background-color:var(--ef-book-paper)}
main.wrap:not(.fb-dark-story) :is(.quickjump,.nextpeek,.family,.related){border-color:var(--ef-book-line)}
main.wrap:not(.fb-dark-story) :is(.ef-grownup-note,.grownups-block){
 border-color:var(--ef-book-line);background-color:#f7ebd5;box-shadow:none
}
main.wrap.directory .directory-jumps{border-color:var(--ef-book-line)}
main.wrap:not(.fb-dark-story) .tiles > a.tile{border-color:var(--ef-book-line);box-shadow:none}
main.wrap:not(.fb-dark-story) :is(.ef-mission,.ef-mission-quiz) :is(.ef-mission-choices button,.ef-mission-choices a){
 min-height:44px;border-color:#b98b55
}
main.wrap:not(.fb-dark-story) :is(.ef-start-list,.ef-mission-choices,.directory-jumps,.prevnext) :is(a,button):focus-visible {
 outline:2px solid var(--ef-book-red);outline-offset:3px
}
/* Keep the cinematic day-and-night exception; echo only editorial type and brass. */
main.wrap.fb-dark-story :is(.hero h1,.story h2,.chapter-lessons h2){
 font-family:var(--ef-book-serif);letter-spacing:-.018em;font-weight:700
}
main.wrap.fb-dark-story :is(.scene-picker,.gallery-toolbar,.chapter-lessons) a:focus-visible{
 outline:2px solid #dfb77f;outline-offset:3px
}

/* The approved illustrated edition: the same type, brass rule, red tags,
   ivory paper and framed painting treatment in each page family. */
@font-face{font-family:"EF Edition Serif";src:url("edition-serif-bold.woff") format("woff");font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:"EF Edition Sans";src:url("edition-sans-regular.woff") format("woff");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"EF Edition Sans";src:url("edition-sans-bold.woff") format("woff");font-weight:700;font-style:normal;font-display:swap}
body.ef-edition-page{--ef-book-serif:"EF Edition Serif",Georgia,serif;--ef-book-sans:"EF Edition Sans",system-ui,sans-serif;font-family:var(--ef-book-sans)}
.ef-edition-page .ember-header:not(.ef-night){background:linear-gradient(180deg,#7f261c,#612119);border-bottom:2px solid #d4a05e;box-shadow:none}
.ef-edition-page .ember-header .ef-edition-brand{display:flex;align-items:center;gap:8px;text-transform:uppercase;font:700 .78rem/1.2 var(--ef-book-sans);letter-spacing:.1em}
.ef-edition-page .ember-header .ef-edition-flame{width:15px;height:18px;flex:none}
.ef-edition-page .ember-header .ef-toggle{border-color:#bf7c54}
.ef-edition-page .ef-edition-eyebrow,.ef-edition-page .fb-hub .ef-front-eyebrow{
 display:flex;align-items:center;justify-content:center;gap:7px;margin:0 0 .35rem;color:#81552f;
 font:700 .63rem/1.3 var(--ef-book-sans);letter-spacing:.14em;text-transform:uppercase;text-align:center
}
.ef-edition-page .ef-edition-eyebrow::before,.ef-edition-page .ef-edition-eyebrow::after,
.ef-edition-page .fb-hub .ef-front-eyebrow::before,.ef-edition-page .fb-hub .ef-front-eyebrow::after{
 content:"";display:inline-block;width:clamp(20px,11vw,54px);height:7px;flex-shrink:1;
 background:no-repeat left center / calc(100% - 10px) 1px linear-gradient(#c7a06e,#c7a06e),
 no-repeat right center / 6px 6px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 6'%3E%3Cpath fill='%23b68340' d='M3 0 6 3 3 6 0 3z'/%3E%3C/svg%3E")
}
.ef-edition-page .ef-edition-eyebrow::after,.ef-edition-page .fb-hub .ef-front-eyebrow::after{transform:scaleX(-1)}
.ef-edition-page main.wrap:not(.fb-hub):not(.fb-dark-story) :is(.pagehead,.lessonhead,.directory-intro){background:none;border-top:0;box-shadow:none}
.ef-edition-page main.wrap:not(.fb-dark-story) :is(.pagehead,.lessonhead,.directory-intro) h1{
 color:#762b22;letter-spacing:0;font-family:var(--ef-book-serif)
}
.ef-edition-page main.wrap .fb-hub .hero h1,.ef-edition-page .fb-hub .hero h1,
.ef-edition-page .fb-hub .hero .tap,.ef-edition-page .fb-hub .fb-safety-start .ef-start-heading{font-family:var(--ef-book-serif)}
.ef-edition-page .fb-hub .hero .sub,.ef-edition-page .fb-hub .ef-home-actions>.ef-forward,
.ef-edition-page .fb-hub .fb-safety-start :is(.ef-start-note,strong,small){font-family:var(--ef-book-sans)}
.ef-edition-page .fb-hub .ef-front-eyebrow{margin-bottom:0}
.ef-edition-page main.wrap:not(.fb-dark-story) :is(.leadpic,.lesspic,.bookrow,.cover,.painting)>.bigpic,
.ef-edition-page main.wrap:not(.fb-dark-story) .bookrow>.bigdiagram{
 border:4px solid #fff7e6;border-radius:12px;outline:1px solid #ad793b;outline-offset:-1px;background:#fff7e6;box-shadow:none
}
.ef-edition-page main.wrap:not(.fb-dark-story) :is(.ef-edition-scene,.directory-card,.ef-mission,.ef-story-peek,.family,.related){
 border:1px solid #d8b78b;border-radius:14px;background:#f3e5cc;box-shadow:none
}
.ef-edition-page main.wrap:not(.fb-dark-story) :is(.ef-edition-scene,.directory-card,.ef-mission,.ef-story-peek,.family,.related) h2{
 color:#702a20
}
.ef-edition-page .ef-edition-stamp{
 display:table;margin:0 0 .4rem;padding:.22rem .62rem;border:0;border-radius:999px;background:#7d2f25;color:#fff0d4;
 font:700 .63rem/1.15 var(--ef-book-sans);text-transform:uppercase;letter-spacing:.12em
}
.ef-edition-page .ef-edition-scene h2{margin-top:.12rem}
.ef-edition-page .directory-intro{border-bottom:1px solid #d0af7e}
.ef-edition-page .directory-grid{gap:clamp(.75rem,3vw,1.25rem)}
.ef-edition-page .directory-card{padding:clamp(12px,3.2vw,20px)}
.ef-edition-page .directory-card h2{margin:.45rem 0 .45rem}
.ef-edition-page .ef-edition-index-cover{margin:0;border:1px solid #ad793b;padding:3px;border-radius:10px;background:#fff7e6;overflow:hidden}
.ef-edition-page .ef-edition-index-cover img{display:block;width:100%;height:auto;border-radius:7px;object-fit:contain}
.ef-edition-page .directory-card :is(ul,ol){display:grid;gap:.36rem;list-style:none;padding-left:0;margin:.75rem 0}
.ef-edition-page .directory-card li a{
 display:flex;align-items:center;justify-content:space-between;gap:.55rem;box-sizing:border-box;
 min-height:44px;padding:.35rem .56rem;border:1px solid #dcc7a8;border-radius:9px;background:#fffaf0;color:#682c21;line-height:1.28
}
.ef-edition-page .directory-card li a:hover,.ef-edition-page .directory-card li a:focus-visible{background:#fff0d5}
.ef-edition-page .ef-edition-chevron{display:block;width:8px;height:12px;flex:none;color:#875735}
.ef-edition-page .directory-card .directory-overview{margin:.25rem 0}
.ef-edition-page .ef-mission-choices button{border-radius:9px;background:#fffaf0;color:#682c21}
.ef-edition-page .ef-mission-choices button[aria-pressed="true"],.ef-edition-page .ef-mission-choices button:focus-visible{outline:2px solid #8a3428;outline-offset:2px}
.ef-edition-page .wrap :is(a,button,summary):focus-visible{outline:2px solid #8a3428;outline-offset:3px}
.ef-edition-page .fb-dark-story :is(a,button,summary):focus-visible{outline-color:#dfb77f}
.ef-edition-page .fb-dark-story .ef-edition-eyebrow{color:#dfb77f}
.ef-edition-page .fb-dark-story .deck .story>.bigpic{outline:1px solid #b58a58;outline-offset:-1px}
@media(max-width:600px){
 .ef-edition-page .ember-header:not(.ef-night){min-height:48px}
 .ef-edition-page .ember-header .ef-edition-brand{font-size:.68rem}
 .ef-edition-page .fb-hub .ef-front-eyebrow{font-size:8.4px;letter-spacing:1.38px;gap:5px}
 .ef-edition-page .fb-hub .ef-front-eyebrow::before,.ef-edition-page .fb-hub .ef-front-eyebrow::after{width:clamp(12px,12.3vw,48px)}
 .ef-edition-page .directory-card li a{font-size:clamp(.84rem,3.6vw,1rem)}
}
.ef-edition-page.theme-hub .fb-hub .hero h1,
.ef-edition-page.theme-hub .fb-hub .hero .tap,
.ef-edition-page.theme-hub .fb-hub .fb-safety-start .ef-start-heading{font-family:var(--ef-book-serif)}
.ef-edition-page.theme-hub .fb-hub :is(.ef-front-eyebrow,.hero .sub,.ef-home-actions>.ef-forward,.fb-safety-start .ef-start-note,.ef-start-list strong,.ef-start-list small){font-family:var(--ef-book-sans)}
.ef-edition-page .directory-card li+li{border-top:0}
.ef-edition-page .directory-card li a:not(:hover):not(:focus-visible){text-decoration:none}
.ef-edition-page .ef-mission-answer>summary{
 box-sizing:border-box;min-height:44px;padding:.55rem .7rem;border:1px solid #dcc7a8;border-radius:9px;background:#fffaf0;color:#682c21
}
.ef-edition-page .ef-mission-answer[open]>summary{background:#fff0d5}
.ef-edition-page .ef-mission-answer[open]>:not(summary){background:#fffaf0;color:#513a2d;border-radius:8px;padding:.35rem .6rem}
.ef-edition-page .ember-header,.ef-edition-page .ember-header .ef-toggle{font-family:var(--ef-book-sans)}

/* Keep navigation pills visually separate from the illustrated lesson label. */
.ef-edition-page main.wrap .lessonhead .lesson-meta{
  gap:.55rem .8rem;
}
.ef-edition-page main.wrap .lessonhead .lesson-meta + .ef-edition-eyebrow{
  margin-block-start:clamp(11px,2.8vw,17px);
  margin-block-end:.45rem;
}
.ef-edition-page main.wrap #a-wag-at-the-tree{
  scroll-margin-top:5rem;
}
