.pu-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(35px, 7vw, 100px);
    padding: 20px 0 40px;
}

/*
 * Opening a book also zooms it.
 *
 * The wrapper is lifted to position:fixed at its original rect (main.js), then
 * translated and scaled so the *open spread* — the flipped cover on the left
 * plus the page on the right, together about 1.95 card widths — is centred in
 * the viewport at a comfortable size. The numbers are measured at open time
 * rather than baked in here, because they depend on where the card happened to
 * be sitting and how much room the viewport has.
 */
.pu-book-wrapper.is-lifted {
    transform-origin: center center;
    transform: translate(var(--pu-dx, 0px), var(--pu-dy, 0px)) scale(var(--pu-scale, 1));
    transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
    .pu-book-wrapper.is-lifted {
        transition: none;
    }
}

.pu-book-wrapper {
    perspective: 1200px;
    width: var(--pu-w);
    height: var(--pu-h);
    outline: none;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.pu-book {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    cursor: pointer;
    outline: none;
    -webkit-transform-style: preserve-3d;
}

.pu-book *,
.pu-book *::before,
.pu-book *::after {
    outline: none;
}

.pu-book-spine {
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 16px;
    transform: translateX(-8px) rotateY(90deg);
    transform-origin: right center;
    border-radius: 2px 0 0 2px;
    z-index: 1;
}

.pu-book-back {
    position: absolute;
    top: -1px;
    left: -1px;
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    background-color: #fff;
    border: none;
    border-radius: 0;
    /* One unit per pixel of the full 280px card. The page and everything set
       on it are measured in it, so they shrink with the card instead of
       wrapping more: a list that fits the page at 280px fits at every width. */
    --pu-u: calc(var(--pu-w) / 280);
    padding: calc(26 * var(--pu-u)) calc(24 * var(--pu-u)) calc(20 * var(--pu-u));
    box-sizing: border-box;
    box-shadow: none;
    outline: none;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /*
     * A book page with a chunky OS scrollbar down its inside edge breaks the
     * illusion — and Firefox's default is a full-width, always-present bar
     * rather than Chromium's overlay. Thin and low-contrast in both, and
     * scrolling the page does not chain out to the document behind it.
     */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.24) transparent;
    overscroll-behavior: contain;
}

.pu-book-back::-webkit-scrollbar {
    width: 6px;
}

.pu-book-back::-webkit-scrollbar-track {
    background: transparent;
}

.pu-book-back::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.22);
    border-radius: 3px;
}

.pu-book-back::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.38);
}

/*
 * Helvetica, the CI's heading face (BRAND.md). This was Open Sans ExtraBold,
 * and the CI keeps Open Sans for body text. Helvetica is licensed: it cannot be
 * self-hosted for free and must not come from a font CDN (see fonts.css), so it
 * is named rather than served. Apple devices have it built in; elsewhere Arial,
 * drawn to Helvetica's metrics, stands in.
 */
.pu-back-title {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: calc(22 * var(--pu-u));
    font-weight: 700;
    margin: 0 0 calc(6 * var(--pu-u));
    letter-spacing: 0.2px;
    -webkit-font-smoothing: antialiased;
}

.pu-back-hr {
    border: none;
    border-top: 2px solid;
    margin: 0 0 calc(9 * var(--pu-u));
}

.pu-product-list {
    list-style: none;
    padding: 0;
    margin: 0 0 auto;
}

/*
 * An entry is a title and, for the Lehrgänge, a subtitle under it
 * (inc/untertitel.php): "Organisationen gestalten und verantwortlich handeln"
 * over "Lehrgang für Ethik und Systemische Organisationsentwicklung im
 * Gesundheitswesen". Three of those have to share one page, so what took room
 * without carrying text went: the chevron's own column (it now hangs on the end
 * of the title) and the padded, bordered button box, which is a hairline
 * between entries instead.
 *
 * Sized in --pu-u (see .pu-book-back), and small because they are set before
 * the zoom — main.js shows an open book at 1.25x or more wherever the screen
 * has the room. Three Lehrgänge with subtitles fill the page with a few pixels
 * to spare; a fourth entry scrolls.
 */
/* Direct children only: an entry's own text can hold a list, and its items
   are bullets, not entries. */
.pu-product-list > li + li {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.pu-product-list a {
    display: block;
    padding: calc(8 * var(--pu-u)) 6px;
    margin: 0 -6px;
    border-radius: 4px;
    text-decoration: none;
    overflow-wrap: break-word;
    transition: background-color 0.2s ease;
    -webkit-font-smoothing: antialiased;
}

.pu-product-list a:hover {
    text-decoration: none;
    background-color: rgba(0, 0, 0, 0.04);
}

.pu-product-title {
    display: block;
    font-family: 'Open Sans', sans-serif;
    font-size: calc(14 * var(--pu-u));
    font-weight: 700;
    line-height: 1.3;
}

.pu-product-list a:hover .pu-product-title {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* #555 on white is 7.5:1. */
.pu-product-subtitle {
    display: block;
    margin-top: calc(2 * var(--pu-u));
    font-family: 'Open Sans', sans-serif;
    font-size: calc(12 * var(--pu-u));
    font-weight: 400;
    line-height: 1.35;
    color: #555;
}

.pu-product-arrow {
    font-size: 0.7em;
    vertical-align: 0.08em;
}

/*
 * An entry set as running text ("Text im Buch") rather than title and subtitle —
 * the one entry in Vorträge, which describes the talks instead of naming one.
 * The whole block is the link.
 *
 * The accent's dark ink measures 4.3:1 on white, enough for the bold titles
 * above but under AA for regular text at this size, so the text takes it a step
 * darker (about 6:1 for the teal). The bullets keep the identity colour: they
 * are decoration, not text.
 */
.pu-product-text {
    font-family: 'Open Sans', sans-serif;
    font-size: calc(13 * var(--pu-u));
    line-height: 1.45;
    color: inherit;
    color: color-mix(in srgb, currentColor 82%, #000);
}

.pu-product-text p,
.pu-product-text ul {
    margin: 0 0 calc(7 * var(--pu-u));
}

.pu-product-text > :last-child {
    margin-bottom: 0;
}

/* Explicitly disc: nested inside the entry list's own <li>, the browser would
   otherwise draw hollow second-level circles. */
.pu-product-text ul {
    padding-left: 1.15em;
    list-style: disc;
}

.pu-product-text li {
    margin: calc(2 * var(--pu-u)) 0;
}

.pu-product-text li::marker {
    color: var(--pu-accent, currentColor);
}

.pu-no-products {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 30px 0;
}

/*
 * A quiet text link, not a button.
 *
 * This was a full-width bordered block at weight 800 — heavier than the
 * offerings listed above it, so the way out of the book outshouted its
 * contents. It is now a small centred link that sits under the list without
 * competing with it, and produktuebersicht.php renders it only once a category
 * holds more than three pages.
 *
 * Keeps --tap of height even though it reads small: the padding is invisible,
 * the undersized touch target would not have been.
 */
.pu-category-link {
    display: inline-flex;
    align-self: center;
    align-items: center;
    gap: 7px;
    min-height: var(--tap);
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    -webkit-font-smoothing: antialiased;
    text-decoration: none;
    padding: 8px 6px;
    margin-top: 6px;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.pu-category-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
    opacity: 1;
}

.pu-category-link i {
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

.pu-category-link:hover i {
    transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
    .pu-category-link,
    .pu-category-link i {
        transition: none;
    }
    .pu-category-link:hover i {
        transform: none;
    }
}

/*
 * The cover is a two-sided panel, not a picture seen from behind.
 *
 * It used to be a single element with `backface-visibility: visible` and
 * `overflow: hidden`. Opening the book therefore showed the cover photograph
 * flipped through 3D space — a mirrored title over a mirrored image — which is
 * what the inside-left page of every book looked like. `overflow: hidden` also
 * flattens the 3D context in WebKit, so a real second face could not have been
 * placed inside it anyway; the clipping now lives on the faces themselves.
 */
.pu-book-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: left center;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
    z-index: 5;
    will-change: transform;
    -webkit-will-change: transform;
}

.pu-cover-face {
    position: absolute;
    inset: 0;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/*
 * A white cover with the category's illustration, not a photograph.
 *
 * The covers were stock photos under a dark overlay with white type on top.
 * The illustrations are drawn on white, so the face is white paper instead:
 * title and rule at the head, the artwork filling what is left, the hint at
 * the foot. The title takes the accent's dark ink, which passes contrast on
 * white where the identity colours do not (BRAND.md).
 */
.pu-cover-face--front {
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    padding: clamp(20px, 2vw, 28px) clamp(16px, 1.6vw, 22px) clamp(14px, 1.4vw, 18px);
    background-color: #fff;
    text-align: center;
    box-shadow:
        6px 6px 18px rgba(0, 0, 0, 0.35),
        1px 0 3px rgba(0, 0, 0, 0.15);
    /* See the is-open rule below — the delay is what makes the hand-off
       happen while this face is edge-on. */
    transition: opacity 0s linear 0.4s;
}

/* Turned to face the other way, so that when the cover swings open this is
   what is presented — the right way round. */
.pu-cover-face--inside {
    transform: rotateY(180deg);
    background-color: var(--brand-yellow);
}

.pu-cover-illustration {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/*
 * The inside page is deliberately dimmed, like the shadowed inner board of a
 * real cover. It reads as depth against the bright white page opposite.
 *
 * This started life as a Firefox bug: Firefox composites the hidden backface
 * through in this nested preserve-3d context, so the *front* face's dark photo
 * overlay was bleeding onto the illustration — along with a mirror-image of the
 * cover title and rule. Chromium honoured backface-visibility and showed flat
 * bright yellow, so the two browsers disagreed completely. The bleed-through is
 * now stopped (below) and the shading it produced is reproduced on purpose, so
 * every browser shows the same thing.
 */
.pu-cover-face--inside::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        rgba(0, 0, 0, 0.40) 0%,
        rgba(0, 0, 0, 0.22) 55%,
        rgba(0, 0, 0, 0.34) 100%
    );
    pointer-events: none;
}

/* Gutter shade along the fold. The face is rotated 180deg, so its local left
   edge is the one at the spine. */
.pu-cover-face--inside::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 34px;
    z-index: 1;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.30), rgba(0, 0, 0, 0));
    pointer-events: none;
}

.pu-cover-title {
    font-family: 'DIN Alternate Bold', 'Open Sans', sans-serif;
    font-size: 30px;
    margin: 0 0 12px;
    letter-spacing: 1px;
}

.pu-cover-bar {
    flex: none;
    width: 50px;
    height: 3px;
    border-radius: 2px;
}

/* min-height: 0 lets the flex item shrink below the image's natural height,
   so contain fits it to the space between the rule and the hint. */
.pu-cover-art {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    margin: 12px 0;
    object-fit: contain;
    display: block;
}

.pu-cover-hint {
    font-family: 'Open Sans', sans-serif;
    font-size: 12px;
    color: #666;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

.pu-page-edges {
    position: absolute;
    right: -3px;
    top: 10px;
    bottom: 10px;
    width: 12px;
    background: repeating-linear-gradient(
        to bottom,
        #f0f0f0 0px,
        #e8e8e8 1px,
        #f5f5f5 2px
    );
    border-radius: 0 2px 2px 0;
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.15);
    transform: translateZ(-1px);
    z-index: -1;
}

/* Open state */
.pu-book.is-open .pu-book-back {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.pu-book.is-open .pu-book-cover {
    transform: rotateY(-160deg);
}

/* The shadow belongs to the face that is actually being lit, now that the
   cover itself is a transparent 3D container. */
/*
 * Take the front face out entirely once the book is open.
 *
 * backface-visibility alone is not enough: Firefox composites this face
 * through anyway, putting a mirrored "Workshops" and the cover's accent rule
 * on top of the inside illustration. Opacity is honoured everywhere. The 0.4s
 * delay on the base rule fires the switch at the midpoint of the 0.8s flip,
 * when the face is edge-on and the change cannot be seen — in either
 * direction, so closing brings it back just as invisibly.
 */
.pu-book.is-open .pu-cover-face--front {
    opacity: 0;
    box-shadow: none;
}

.pu-book.is-open .pu-cover-face--inside {
    box-shadow:
        -4px 6px 18px rgba(0, 0, 0, 0.25),
        -1px 0 3px rgba(0, 0, 0, 0.1);
}

.pu-book.is-open .pu-cover-hint {
    opacity: 0;
}


.pu-book.is-open .pu-book-spine,
.pu-book.is-open .pu-page-edges {
    display: none;
}

/* Desktop hover peek */
@media (hover: hover) and (min-width: 769px) {
    .pu-book:not(.is-open):hover .pu-book-cover {
        transform: rotateY(-25deg);
    }

    .pu-book:not(.is-open):hover .pu-cover-face--front {
        box-shadow:
            8px 6px 20px rgba(0, 0, 0, 0.3),
            2px 0 5px rgba(0, 0, 0, 0.12);
    }

    .pu-book:not(.is-open):hover .pu-cover-hint {
        opacity: 1;
        color: #333;
    }
}

/* Card geometry is fluid (--pu-w / --pu-h in tokens.css); the four breakpoint
   blocks that used to restate width/height at 950/768/500/350px are gone. Only
   the type scale and the single-column threshold remain as media queries. */
.pu-cover-title {
    font-size: clamp(20px, 1vw + 16px, 30px);
}

/* One card per row once three no longer fit comfortably side by side. */
@media (max-width: 768px) {
    .pu-grid {
        flex-direction: column;
        align-items: center;
    }

    .pu-book-wrapper {
        perspective: 1000px;
    }
}

.pu-book:focus-visible {
    outline: none;
}

.pu-book:focus-visible .pu-cover-face--front {
    box-shadow:
        6px 6px 18px rgba(0, 0, 0, 0.35),
        1px 0 3px rgba(0, 0, 0, 0.15),
        0 0 0 3px var(--brand-teal);
}

.pu-book.is-open:focus-visible .pu-book-back {
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.25),
        0 0 0 3px var(--brand-teal);
}

.pu-product-list a:focus-visible {
    outline: 2px solid var(--brand-teal);
    outline-offset: 2px;
    border-radius: 6px;
}

.pu-category-link:focus-visible {
    outline: 2px solid var(--brand-teal);
    outline-offset: 2px;
}

