/* The Demo Library on esremedia.co.uk: library page, entry pages and the film page, generated by
   build-demos.mjs from _templates/. Research and decision: Demos/_library/demo-library-report.md
   (DEL-DESIGN-RESEARCH). ESRE's own look: white, deep navy, Outfit and Inter, rounded corners.
   The site centres all text on phones with !important (styles.css), so lists and steps here say
   text-align: left !important. */

/* ---------- the library page ---------- */
.edemo-hero .hero__title { text-wrap: balance; }
.elib-toc { display: none; margin-top: 28px; }
.elib-toc__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.elib-toc__list a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid rgba(255,255,255,0.35); border-radius: 6px; font-size: 15px; font-weight: 500; color: var(--white); }
.elib-toc__list a:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.section.elib-showcase { padding: 72px 0 24px; }
.section.elib { padding: 24px 0 96px; }
.elib__body { max-width: 920px; margin: 0 auto; padding: 0 24px; }
/* the Demos bar stays under the main navigation when the page scrolls (owner, 16 October 2026); it shows
   above 768px, so the offsets below add its height there */
.demos-nav { position: sticky; top: var(--nav-height); z-index: 999; }
:root { --demos-nav-height: 0px; }
@media (min-width: 769px) { :root { --demos-nav-height: 49px; } }
.section.elib .elib__head { margin-top: 48px; margin-bottom: 0; }
.elib__head + .elib-cat { margin-top: 48px; }
.elib-cat { margin-top: 64px; scroll-margin-top: calc(var(--nav-height) + var(--demos-nav-height) + 16px); }
.elib-cat__head { padding-bottom: 12px; border-bottom: 1px solid var(--navy); }
.elib-cat .elib-cat__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.35rem, 2.2vw, 1.6rem); line-height: 1.2; color: var(--navy); }
.elib-cat .elib-cat__line { margin: 6px 0 0; max-width: 680px; font-size: 0.95rem; line-height: 1.55; color: var(--text-secondary); text-wrap: pretty; }

/* "Watch the film" at the end of the Shared records heading; the film plays over the page and can be
   minimised to the corner of the window (owner, 22 October 2026; js/film-player.js) */
.elib-cat__head--film { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; align-items: center; scroll-margin-top: calc(var(--nav-height) + var(--demos-nav-height) + 16px); }
.elib-cat__head--film > .elib-cat__title, .elib-cat__head--film > .elib-cat__line { grid-column: 1; }
.efilm-tile { grid-column: 2; grid-row: 1 / span 2; display: inline-flex; align-items: center; gap: 14px; font-size: 0.95rem; color: var(--navy); }
.efilm-tile__thumb { position: relative; display: block; width: 144px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #060d16; }
.efilm-tile__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.efilm-tile__thumb i { position: absolute; inset: 0; margin: auto; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,0.92); color: var(--navy); font-size: 20px; transition: transform 0.2s; }
.efilm-tile:focus-visible { outline: 2px solid var(--navy); outline-offset: 4px; border-radius: 8px; }
@media (hover: hover) and (pointer: fine) { .efilm-tile:hover .efilm-tile__thumb i { transform: scale(1.1); } }
.efilm-player { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0,12,57,0.85); }
.efilm-player[hidden] { display: none; }
.efilm-player__box { width: min(1100px, 100%); }
.efilm-player__bar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.efilm-player__btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 8px; background: rgba(255,255,255,0.14); color: var(--white); font-size: 18px; cursor: pointer; }
.efilm-player__btn:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .efilm-player__btn:hover { background: rgba(255,255,255,0.26); } }
.efilm-player video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 120px); border-radius: 12px; background: #060d16; }
/* minimised: the corner of the window, above the WhatsApp button; the page stays in use */
.efilm-player[data-state="mini"] { inset: auto 24px 88px auto; display: block; padding: 0; background: none; }
.efilm-player[data-state="mini"] .efilm-player__box { position: relative; width: clamp(320px, 36vw, 560px); border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,12,57,0.35); }
.efilm-player[data-state="mini"] .efilm-player__bar { position: absolute; top: 8px; right: 8px; z-index: 1; margin: 0; }
.efilm-player[data-state="mini"] .efilm-player__btn { width: 32px; height: 32px; font-size: 15px; background: rgba(0,12,57,0.72); }
.efilm-player[data-state="mini"] video { border-radius: 0; }
@media (max-width: 768px) {
  .elib-cat__head--film { grid-template-columns: minmax(0, 1fr); }
  .efilm-tile { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 16px; }
}
@media (max-width: 640px) {
  .efilm-player { padding: 16px; }
  .efilm-player[data-state="mini"] { inset: auto 16px 88px 16px; }
  .efilm-player[data-state="mini"] .efilm-player__box { width: auto; }
}
.elib-list { list-style: none; margin: 0; padding: 0; }
.elib-row { border-bottom: 1px solid var(--border); }
.elib-row__link { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 32px; column-gap: 16px; padding: 16px 12px; margin: 0 -12px; border-radius: 12px; color: var(--navy); text-decoration: none; }
.elib-row__link > span { grid-column: 1; }
.elib-row__title { font-family: var(--font-body); font-weight: 500; font-size: 1.0625rem; line-height: 1.35; text-wrap: balance; }
.elib-row__claim { margin-top: 4px; max-width: 70ch; font-size: 0.9375rem; line-height: 1.55; color: var(--text-secondary); text-wrap: pretty; }
.elib-row__glance { margin-top: 4px; font-size: 0.95rem; line-height: 1.6; color: var(--text-secondary); text-wrap: pretty; }
.elib-row__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 0.8125rem; font-weight: 400; color: var(--text-secondary); }
.elib-row__systems span + span::before { content: ', '; }
.elib-row__go { grid-column: 2; grid-row: 1 / span 4; align-self: center; justify-self: end; font-size: 16px; color: var(--text-secondary); }
.elib-row__link:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .elib-row__link:hover { background: var(--off-white); }
  .elib-row__link:hover .elib-row__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
}
.elib__cta { margin: 64px 0 0; text-align: center; }

/* ---------- an entry page ---------- */
.hero--page.edemo-hero { min-height: auto; }
.edemo-hero .edemo-hero__cat { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 8px; font-size: 14px; font-weight: 600; letter-spacing: 0.02em; color: rgba(255,255,255,0.7); }
.edemo-hero .edemo-hero__cat:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .edemo-hero .edemo-hero__cat:hover { color: var(--white); } }
.edemo-hero .edemo-hero__claim { max-width: 720px; margin: 0 auto; text-wrap: pretty; }
.edemo { display: block; padding: 0 0 96px; }
.edemo .edemo-h2 { margin: 0 0 18px; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.15; color: var(--navy); }
.edemo-see { max-width: 760px; margin: 72px auto 0; padding: 0 24px; }
.edemo-see:has(.edemo-see__list:empty) .edemo-see__list, .edemo-see:has(.edemo-see__list:empty) > h2 { display: none; }
.edemo-see__list { list-style: none; margin: 0; padding: 0; counter-reset: see; border-top: 1px solid var(--border); }
.edemo-see__list > li { counter-increment: see; display: grid; grid-template-columns: 40px minmax(0,1fr); align-items: baseline; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border); font-size: 1.125rem; line-height: 1.55; color: var(--navy); text-wrap: pretty; }
.edemo-see__list > li::before { content: counter(see); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: var(--white); font-family: var(--font-body); font-weight: 700; font-size: 0.9rem; transform: translateY(4px); }
.edemo-see .edemo-see__note { margin: 16px 0 0; font-size: 1rem; line-height: 1.6; color: var(--text-secondary); }
.edemo-see .edemo-see__note:empty { display: none; }

/* steps beside the live systems: one column below 900px (systems under the steps, a tab per
   system); from 900px steps at the left, systems held under the menu; from 1280px two systems side
   by side; layout "wide" keeps the steps above a full-width frame */
.bench { counter-reset: step; display: grid; grid-template-columns: minmax(0,1fr); grid-template-areas: "h" "steps" "systems"; column-gap: 32px; max-width: 1440px; margin: 72px auto 0; padding: 0 24px; }
.bench .bench__h { grid-area: h; }
.bench .steps { grid-area: steps; list-style: none; margin: 0 0 32px; padding: 0; }
.bench .systems { grid-area: systems; min-width: 0; scroll-margin-top: calc(var(--nav-height) + var(--demos-nav-height) + 8px); }
.steps > .step { counter-increment: step; padding: 28px 0 0; border-top: 1px solid var(--border); }
.steps > .step + .step { margin-top: 28px; }
/* a step brought back into view ("Back to steps") stops below the sticky bars, so its heading shows */
.steps > .step { scroll-margin-top: calc(var(--nav-height) + var(--demos-nav-height) + 8px); }
.step .step__title { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 14px; font-family: var(--font-body); font-weight: 600; font-size: 1.25rem; line-height: 1.3; color: var(--navy); text-wrap: balance; }
.step .step__n { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: var(--white); font-size: 0.9rem; font-weight: 700; }
.step .step__n::before { content: counter(step); }
.step .step__show { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 0 14px; padding: 0 16px; border: 1.5px solid var(--navy); border-radius: 8px; background: var(--white); color: var(--navy); cursor: pointer; font-size: 14px; font-weight: 600; }
.step .step__show[hidden] { display: none; }
.step .step__show:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.step .step__actions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.step .step__actions > li { position: relative; padding-left: 22px; font-size: 1.0625rem; line-height: 1.6; color: var(--navy); text-wrap: pretty; }
.step .step__actions > li::before { content: ''; position: absolute; left: 0; top: 0.68em; width: 8px; height: 8px; border-radius: 50%; background: var(--navy); opacity: 0.35; }
.step .step__result { margin: 16px 0 0; padding: 12px 16px; border-left: 3px solid var(--navy); border-radius: 0 8px 8px 0; background: var(--light-gray); font-size: 1.0625rem; line-height: 1.6; color: var(--navy); text-wrap: pretty; }
.step .step__result-label { display: block; margin-bottom: 2px; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; color: var(--text-secondary); }
.step b { font-weight: 600; }
.systems .systems__tabs { display: flex; flex-wrap: nowrap; gap: 0 20px; margin: 0 0 14px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.systems .systems__tabs[hidden] { display: none; }
.systems .systems__tab { flex: none; white-space: nowrap; min-height: 44px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--text-secondary); }
.systems .systems__tab[aria-selected="true"] { color: var(--navy); font-weight: 600; border-bottom-color: var(--navy); }
.systems .systems__tab:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .systems .systems__tab:hover { color: var(--navy); }
  .step .step__show:hover { background: var(--navy); color: var(--white); }
  .systems .system__open:hover { text-decoration: underline; }
}
.systems .system { margin: 0 0 16px; min-width: 0; }
.systems .system__name { margin: 0 0 10px; font-family: var(--font-body); font-weight: 600; font-size: 1.15rem; color: var(--navy); }
.system__frame { position: relative; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #F4F5F7; box-shadow: 0 20px 50px rgba(0,12,57,0.08); }
.system__frame iframe { display: block; width: 100%; height: clamp(420px, calc(100vh - 200px), 860px); border: 0; }
@supports (height: 100svh) { .system__frame iframe { height: clamp(420px, calc(100svh - 200px), 860px); } }
.system__state { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; padding: 24px; text-align: center !important; background: #F4F5F7; color: var(--text-secondary); font-size: 1.0625rem; }
.system__state[hidden] { display: none; }
.system__state p { margin: 0; }
.system__state a { color: var(--navy); font-weight: 600; text-decoration: underline; }
.systems .system__open { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--navy); }
.systems .system__open i { font-size: 12px; }
.systems .system__open:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.systems .systems__note { margin: 0; font-size: 0.95rem; color: var(--text-secondary); }
.systems .systems__back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 0 12px; padding: 0 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); color: var(--navy); cursor: pointer; font-size: 14px; font-weight: 600; }
.systems .systems__back[hidden] { display: none; }
.systems .systems__back:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.systems.is-tabbed .system { display: none; }
.systems.is-tabbed .system.is-on { display: block; }
.systems.is-tabbed .system__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.bench--wide .system__frame iframe { height: 860px; }
@media (min-width: 900px) {
  .bench:not(.bench--wide) { grid-template-columns: minmax(300px, 380px) minmax(0,1fr); grid-template-rows: auto 1fr; grid-template-areas: "h systems" "steps systems"; }
  .bench:not(.bench--wide) .systems { position: sticky; top: calc(var(--nav-height) + var(--demos-nav-height) + 16px); align-self: start; }
  .bench:not(.bench--wide) .steps { margin-bottom: clamp(240px, calc(100vh - 300px), 520px); }
  .bench:not(.bench--wide) .system__frame iframe { height: clamp(440px, calc(100vh - 290px), 860px); }
  .bench--wide .steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 32px; }
  .bench--wide .steps > .step + .step { margin-top: 0; }
  .systems .systems__back { display: none; }
}
@supports (height: 100svh) { @media (min-width: 900px) { .bench:not(.bench--wide) .system__frame iframe { height: clamp(440px, calc(100svh - 290px), 860px); } } }
@media (min-width: 1280px) {
  .bench[data-count="2"]:not(.bench--wide) .systems { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); column-gap: 24px; }
  .bench[data-count="2"]:not(.bench--wide) .systems .system { display: block; }
  .bench[data-count="2"]:not(.bench--wide) .systems .systems__tabs { display: none; }
  .bench[data-count="2"]:not(.bench--wide) .systems .system__name { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .bench[data-count="2"]:not(.bench--wide) .systems .systems__note { grid-column: 1 / -1; }
  .bench[data-count="2"]:not(.bench--wide) .step__show { display: none; }
}
.edemo-facts { max-width: 760px; margin: 96px auto 0; padding: 0 24px; }
.edemo-facts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.edemo-facts li { position: relative; padding-left: 22px; font-size: 1.0625rem; line-height: 1.7; color: var(--text-secondary); }
.edemo-facts li::before { content: ''; position: absolute; left: 0; top: 0.72em; width: 8px; height: 8px; border-radius: 50%; background: var(--navy); }
.edemo-end { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; max-width: 760px; margin: 64px auto 0; padding: 0 24px; }
.efilm { max-width: 960px; margin: 72px auto 0; padding: 0 24px; }
.efilm video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; background: #060d16; box-shadow: 0 30px 80px rgba(0,0,0,0.25); }

@media (max-width: 768px) {
  .elib-toc { display: block; }
  .elib__body, .elib-cat, .elib-cat__head, .elib-row__link, .elib-row__link > span, .edemo-see, .edemo-see__list > li, .bench, .bench .steps,
  .step, .step__title, .step__actions > li, .step__result, .systems, .systems__note, .edemo-facts, .edemo-facts li { text-align: left !important; }
  .section.elib-showcase { padding: 48px 0 16px; }
  .elib-cat, .edemo-see, .bench { margin-top: 48px; }
}
@media (max-width: 640px) {
  .bench { padding: 0; }
  .bench .bench__h, .bench .steps, .systems .systems__tabs, .systems .system__name, .systems .system__open, .systems .systems__note, .systems .systems__back { margin-left: 16px; margin-right: 16px; }
  .system__frame { border-left: 0; border-right: 0; border-radius: 0; }
  .system__frame iframe { height: clamp(420px, calc(100vh - 180px), 780px); }
  /* after a Show button, "Back to steps" sits above the tabs: the frame gives up its height, so all of it is in the window */
  .systems:has(> .systems__back:not([hidden])) .system__frame iframe { height: clamp(360px, calc(100vh - 240px), 730px); }
  .elib__body, .edemo-see, .edemo-facts { padding: 0 16px; }
  .elib-row__link { padding: 18px 8px 20px; margin: 0 -8px; }
}
@supports (height: 100svh) { @media (max-width: 640px) { .system__frame iframe { height: clamp(420px, calc(100svh - 180px), 780px); }
  .systems:has(> .systems__back:not([hidden])) .system__frame iframe { height: clamp(360px, calc(100svh - 240px), 730px); } } }
