/* TrendLife Flipbook — uses the TrendLife theme tokens, with fallbacks for any theme. */

.tlfb, .tlfb-zoom {
	--tlfb-ink: var(--ink, #1c1a17);
	--tlfb-paper: var(--paper, #f7f2ea);
	--tlfb-stone: var(--stone, #d8cdbc);
	--tlfb-blue: var(--blue, #50ade5);
	--tlfb-sans: var(--f-sans, Jost, "Helvetica Neue", Arial, sans-serif);
	--tlfb-display: var(--f-display, "Cormorant Garamond", Garamond, serif);
	--tlfb-line: rgba(247, 242, 234, .2);
}
.tlfb {
	position: relative;
	color: var(--tlfb-paper);
	background: radial-gradient(ellipse 70% 60% at 50% 42%, #2e2a25 0%, var(--tlfb-ink) 72%);
	padding-top: clamp(20px, 3.5vw, 40px);
}

/* Without JavaScript: a simple scroll of pages. */
.tlfb-fallback { list-style: none; margin: 0 auto; padding: 0 16px 32px; max-width: 640px; display: grid; gap: 16px; }
.tlfb-fallback img { display: block; width: 100%; height: auto; background: #fff; }
.tlfb--ready .tlfb-fallback { display: none; }

.tlfb-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

/* Book */
.tlfb-viewport { position: relative; display: flex; align-items: center; justify-content: center; gap: 20px; padding: 0 8px; }
.tlfb-stage { position: relative; flex: none; perspective: 2600px; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.tlfb-stage:focus { outline: none; }
.tlfb-stage:focus-visible { outline: 2px solid var(--tlfb-blue); outline-offset: 8px; }
.tlfb-book { position: absolute; inset: 0; display: flex; transform-style: preserve-3d; transition: transform .62s cubic-bezier(.2, .7, .2, 1); }
.tlfb--spread .tlfb-book.is-front { transform: translateX(-25%); }
.tlfb--spread .tlfb-book.is-back { transform: translateX(25%); }
.tlfb-slot { position: relative; flex: 1 1 50%; min-width: 0; height: 100%; overflow: hidden; background: #fff; box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .3); }
.tlfb--single .tlfb-slot--left { display: none; }
.tlfb--single .tlfb-slot--right { flex-basis: 100%; }
.tlfb-slot.is-empty { background: transparent; box-shadow: none; }
.tlfb-slot img, .tlfb-leaf img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
/* The fold in the middle of a spread. */
.tlfb--spread .tlfb-slot::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.tlfb--spread .tlfb-slot--left::after { background: linear-gradient(to left, rgba(0, 0, 0, .22), rgba(0, 0, 0, .06) 3%, transparent 9%); }
.tlfb--spread .tlfb-slot--right::after { background: linear-gradient(to right, rgba(0, 0, 0, .22), rgba(0, 0, 0, .06) 3%, transparent 9%); }
.tlfb--spread .tlfb-slot.is-empty::after { display: none; }

/* The turning leaf. */
.tlfb-leaf { position: absolute; top: 0; width: 50%; height: 100%; z-index: 3; transform-style: preserve-3d; transition: transform .62s cubic-bezier(.45, .05, .3, 1); }
.tlfb-leaf--fwd { left: 50%; transform-origin: left center; }
.tlfb-leaf--fwd.is-turning { transform: rotateY(-180deg); }
.tlfb-leaf--back { left: 0; transform-origin: right center; }
.tlfb-leaf--back.is-turning { transform: rotateY(180deg); }
.tlfb-leaf__face { position: absolute; inset: 0; overflow: hidden; background: #fff; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.tlfb-leaf__face--back { transform: rotateY(180deg); }
.tlfb-leaf__face::after { content: ""; position: absolute; inset: 0; pointer-events: none; transition: opacity .62s ease; }
.tlfb-leaf--fwd .tlfb-leaf__face--front::after { background: linear-gradient(to left, rgba(0, 0, 0, .35), transparent 70%); opacity: 0; }
.tlfb-leaf--fwd .tlfb-leaf__face--back::after { background: linear-gradient(to left, rgba(0, 0, 0, .35), transparent 70%); opacity: 1; }
.tlfb-leaf--back .tlfb-leaf__face--front::after { background: linear-gradient(to right, rgba(0, 0, 0, .35), transparent 70%); opacity: 0; }
.tlfb-leaf--back .tlfb-leaf__face--back::after { background: linear-gradient(to right, rgba(0, 0, 0, .35), transparent 70%); opacity: 1; }
.tlfb-leaf.is-turning .tlfb-leaf__face--front::after { opacity: 1; }
.tlfb-leaf.is-turning .tlfb-leaf__face--back::after { opacity: 0; }
.tlfb-slot .is-incoming { z-index: 2; }

/* Buttons */
.tlfb-btn { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; min-width: 40px; padding: 0 12px; margin: 0; border: 1px solid var(--tlfb-line); border-radius: 0; background: transparent; color: inherit; font: 500 .75rem/1 var(--tlfb-sans); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; transition: background-color .2s, border-color .2s, opacity .2s; }
.tlfb-btn:hover { background: rgba(247, 242, 234, .1); border-color: rgba(247, 242, 234, .45); }
.tlfb-btn:focus-visible { outline: 2px solid var(--tlfb-blue); outline-offset: 2px; }
.tlfb-btn:disabled { opacity: .25; cursor: default; background: transparent; }
.tlfb-btn[aria-expanded="true"] { background: var(--tlfb-paper); color: var(--tlfb-ink); }

.tlfb-edge { width: 52px; height: 52px; padding: 0; border-radius: 50%; flex: none; }
@media (max-width: 899px) {
	.tlfb-edge { position: absolute; top: 50%; z-index: 4; width: 42px; height: 42px; min-width: 0; transform: translateY(-50%); background: rgba(28, 26, 23, .6); border-color: rgba(247, 242, 234, .25); }
	.tlfb-edge--prev { left: 6px; }
	.tlfb-edge--next { right: 6px; }
	.tlfb-edge:disabled { opacity: 0; pointer-events: none; }
}

/* Toolbar */
.tlfb-bar { box-sizing: border-box; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1200px; margin: clamp(14px, 2.5vw, 24px) auto 0; padding: 0 clamp(12px, 3vw, 32px) clamp(16px, 2.5vw, 24px); font-family: var(--tlfb-sans); }
.tlfb-bar__group { display: flex; gap: 8px; flex: none; }
.tlfb-bar__nav { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 16px; min-width: 0; max-width: 560px; }
.tlfb-range { flex: 1 1 auto; min-width: 60px; margin: 0; accent-color: var(--tlfb-blue); cursor: pointer; }
.tlfb-count { flex: none; font-size: .8125rem; letter-spacing: .06em; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--tlfb-stone); }
@media (max-width: 640px) {
	.tlfb-range { display: none; }
	.tlfb-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.tlfb-btn { padding: 0; width: 40px; }
	.tlfb-bar { gap: 6px; }
	.tlfb-bar__group { gap: 6px; }
}

/* Page grid and contents */
.tlfb-panel { position: absolute; inset: 0; z-index: 10; overflow: auto; overscroll-behavior: contain; background: rgba(22, 21, 19, .97); padding: 0 clamp(16px, 3vw, 40px) 40px; }
.tlfb-panel__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 16px 0; margin-bottom: 8px; background: rgba(22, 21, 19, .97); border-bottom: 1px solid var(--tlfb-line); }
.tlfb-panel__title { margin: 0; font: 500 .75rem/1 var(--tlfb-sans); letter-spacing: .16em; text-transform: uppercase; }
.tlfb-grid { list-style: none; margin: 0; padding: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 20px 14px; }
@media (min-width: 900px) { .tlfb-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); } }
.tlfb-grid button { display: block; width: 100%; padding: 0; border: 0; background: none; color: var(--tlfb-stone); font: .75rem/1 var(--tlfb-sans); letter-spacing: .06em; cursor: pointer; text-align: center; }
.tlfb-grid img { display: block; width: 100%; height: auto; margin-bottom: 8px; background: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); transition: transform .2s; }
.tlfb-grid button:hover img { transform: translateY(-3px); }
.tlfb-grid button:focus-visible { outline: 2px solid var(--tlfb-blue); outline-offset: 4px; }
.tlfb-grid [aria-current] img { box-shadow: 0 0 0 3px var(--tlfb-blue); }
.tlfb-grid [aria-current] { color: var(--tlfb-paper); }
.tlfb-toc { list-style: none; margin: 0 auto; padding: 0; max-width: 720px; }
.tlfb-toc li { border-bottom: 1px solid var(--tlfb-line); }
.tlfb-toc button { display: flex; align-items: baseline; gap: 20px; width: 100%; padding: 16px 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.tlfb-toc button:hover .tlfb-toc__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.tlfb-toc button:focus-visible { outline: 2px solid var(--tlfb-blue); outline-offset: 2px; }
.tlfb-toc__page { flex: none; width: 2.5em; font: 500 .8125rem/1 var(--tlfb-sans); color: var(--tlfb-blue); letter-spacing: .06em; }
.tlfb-toc__title { font: 500 clamp(1.25rem, 2.5vw, 1.625rem)/1.2 var(--tlfb-display); }

/* Zoom */
.tlfb-zoom { position: fixed; inset: 0; z-index: 100001; display: flex; flex-direction: column; background: #141311; color: #f7f2ea; }
.tlfb-zoom[hidden] { display: none; }
.tlfb-zoom__bar { display: flex; align-items: center; gap: 8px; padding: 8px clamp(8px, 2vw, 20px); border-bottom: 1px solid rgba(247, 242, 234, .12); }
.tlfb-zoom__label { flex: 1; margin: 0; text-align: center; font: .8125rem var(--tlfb-sans); letter-spacing: .06em; font-variant-numeric: tabular-nums; color: #d8cdbc; }
.tlfb-zoom .tlfb-btn { color: #f7f2ea; }
.tlfb-zoom__scroll { flex: 1; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.tlfb-zoom__scroll:focus { outline: none; }
.tlfb-zoom__pages { display: flex; justify-content: center; width: 100%; max-width: 980px; margin: 0 auto; padding: clamp(0px, 2vw, 24px); }
.tlfb-zoom__pages.is-two { max-width: 1600px; }
.tlfb-zoom__pages img { display: block; width: 100%; min-width: 0; height: auto; background: #fff; }
.tlfb-zoom__pages.is-two img { width: 50%; }
.tlfb-zoom__pages.is-big { width: 200%; max-width: none; }
@media (max-width: 640px) {
	.tlfb-zoom__pages { padding: 0; }
	.tlfb-zoom__pages.is-two { flex-direction: column; }
	.tlfb-zoom__pages.is-two img { width: 100%; }
}

/* Full screen */
.tlfb:fullscreen { display: flex; flex-direction: column; justify-content: center; padding-top: 12px; overflow: hidden; }
.tlfb--max { position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column; justify-content: center; padding-top: 12px; overflow: hidden; }
html.tlfb-locked, html.tlfb-locked body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
	.tlfb-book, .tlfb-leaf, .tlfb-leaf__face::after, .tlfb-grid img { transition: none !important; }
}

/* ---------- Issue page ---------- */
.tlfb-issue__head { text-align: center; padding-block: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 3vw, 2.25rem); }
.tlfb-issue__head .tl-kicker a { color: inherit; text-decoration: none; }
.tlfb-issue__title { font-family: var(--f-display, "Cormorant Garamond", serif); font-weight: 500; font-size: clamp(2.75rem, 7vw, 5rem); line-height: 1; letter-spacing: -.01em; margin: 0 0 1rem; }
.tlfb-issue__standfirst { max-width: 36em; margin: 0 auto 1rem; font-style: italic; font-size: clamp(1.0625rem, 1.8vw, 1.25rem); color: var(--taupe, #6b6258); }
.tlfb-issue__meta { margin: 0; font: 500 .75rem/1.4 var(--f-sans, Jost, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--taupe, #6b6258); }
.tlfb-issue__body { padding-block: clamp(2.5rem, 5vw, 4rem); }
.tlfb-issue__toc { margin-bottom: 2.5rem; }
.tlfb-issue__toc .tl-label { margin: 0 0 .75rem; }
.tlfb-contents { list-style: none; margin: 0; padding: 0; }
.tlfb-contents li { border-bottom: 1px solid var(--stone, #d8cdbc); }
.tlfb-contents a { display: flex; align-items: baseline; gap: 1.25rem; padding: .9rem 0; color: var(--ink, #1c1a17); text-decoration: none; }
.tlfb-contents a:hover .tlfb-contents__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.tlfb-contents__page { flex: none; width: 3em; font: 500 .8125rem/1 var(--f-sans, Jost, sans-serif); letter-spacing: .06em; color: var(--deep, #1d6a99); }
.tlfb-contents__title { font: 500 1.375rem/1.2 var(--f-display, "Cormorant Garamond", serif); }
.tlfb-issue__about { margin-bottom: 2.5rem; }
.tlfb-text { border-top: 1px solid var(--stone, #d8cdbc); border-bottom: 1px solid var(--stone, #d8cdbc); }
.tlfb-text summary { padding: 1rem 0; cursor: pointer; font: 500 .8125rem/1.3 var(--f-sans, Jost, sans-serif); letter-spacing: .12em; text-transform: uppercase; }
.tlfb-text summary:focus-visible { outline: 2px solid var(--deep, #1d6a99); outline-offset: 2px; }
.tlfb-text__note { font-size: .875rem; color: var(--taupe, #6b6258); }
.tlfb-text__page h3 { font: 500 .75rem/1 var(--f-sans, Jost, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--taupe, #6b6258); margin: 2rem 0 .75rem; }
.tlfb-text__page p { font-size: 1rem; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.tlfb-empty { padding: 3rem 1rem; text-align: center; }

/* ---------- Shelf of covers ---------- */
.tlfb-shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 1.25rem; }
@media (min-width: 760px) { .tlfb-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem 2rem; } }
@media (min-width: 1100px) { .tlfb-shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tlfb-shelf__item a { display: block; color: var(--ink, #1c1a17); text-decoration: none; }
.tlfb-shelf__frame { display: block; aspect-ratio: 148 / 210; margin-bottom: 1rem; background: var(--linen, #eee6d8); box-shadow: 0 18px 32px -18px rgba(28, 26, 23, .55), 0 1px 3px rgba(28, 26, 23, .15); transition: transform .35s var(--ease, ease), box-shadow .35s var(--ease, ease); }
.tlfb-shelf__cover { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (hover: hover) {
	.tlfb-shelf__item a:hover .tlfb-shelf__frame { transform: translateY(-6px); box-shadow: 0 26px 40px -18px rgba(28, 26, 23, .6), 0 1px 3px rgba(28, 26, 23, .15); }
	.tlfb-shelf__item a:hover .tlfb-shelf__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
}
.tlfb-shelf__title { margin: 0 0 .35rem; font: 500 clamp(1.25rem, 2vw, 1.625rem)/1.15 var(--f-display, "Cormorant Garamond", serif); }
.tlfb-shelf__meta { font: 500 .6875rem/1 var(--f-sans, Jost, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--taupe, #6b6258); }
.tlfb-more .tlfb-shelf { margin-top: 1.5rem; }

@media print {
	.tlfb-bar, .tlfb-edge { display: none !important; }
}
