/* Tiny Scribblz Bookshelf
   Everything is prefixed .tsb so the Childy theme and other pages are not affected.
   Colours you can change in WooCommerce -> Bookshelf: --tsb-wall, --tsb-price, --tsb-btn. */

.tsb {
	--tsb-wall: #f7ecdb;
	--tsb-price: #f05491;
	--tsb-btn: #1b2b5a;
	--tsb-ink: #1b2b5a;
	--tsb-gold: #f5be32;
	--tsb-oak1: #d9a96f;
	--tsb-oak2: #c18d55;
	--tsb-oak3: #9a663a;
	--tsb-oak4: #7a4f2c;
	--tsb-h: 170px; /* height of books on the shelf */
	color: var(--tsb-ink);
	max-width: 1240px;
	margin: 0 auto;
}
.tsb *, .tsb-ov *, .tsb-ov, .tsb-toast { box-sizing: border-box; }

/* reset theme button styles inside the bookshelf only */
.tsb button, .tsb-ov button { margin: 0; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; min-height: 0 !important; width: auto !important; height: auto !important; text-transform: none !important; letter-spacing: normal !important; font: inherit; color: inherit !important; line-height: inherit !important; cursor: pointer; border-radius: 0 !important; }
.tsb button:focus-visible, .tsb-ov button:focus-visible { outline: 3px solid #3d9be9; outline-offset: 3px; }

/* heading + filters */
.tsb-intro { padding: 0 4px 6px; }
.tsb .tsb-h { margin: 0 0 4px; font-size: clamp(28px, 4.5vw, 42px); line-height: 1.1; color: var(--tsb-ink); }
.tsb .tsb-sub { margin: 0; opacity: .75; }
.tsb-chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px; scrollbar-width: none; }
.tsb-chips:empty { display: none; }
.tsb .tsb-chip { flex: none; min-height: 44px !important; padding: 0 18px !important; border-radius: 22px !important; border: 2px solid #ead8bd !important; background: #fff !important; font-weight: 600 !important; font-size: 15px !important; color: var(--tsb-ink) !important; }
.tsb .tsb-chip[aria-pressed="true"] { background: var(--tsb-price) !important; border-color: var(--tsb-price) !important; color: #fff !important; }

/* filter bar */
.tsb-filters { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.tsb-filters .tsb-chips { padding: 0; }
.tsb-subs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tsb-subs[hidden] { display: none; }
.tsb .tsb-chip.tsb-sub { min-height: 38px !important; font-size: 14px !important; padding: 0 14px !important; background: #fff8ea !important; }
.tsb .tsb-chip.tsb-sub[aria-pressed="true"] { background: var(--tsb-btn) !important; border-color: var(--tsb-btn) !important; color: #fff !important; }
.tsb .tsb-chip.tsb-sub span { opacity: .6; font-weight: 500; margin-left: 2px; }
.tsb-ctl { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 10px; }
.tsb-f { display: block; margin: 0; }
.tsb .tsb-f input, .tsb .tsb-f select {
	width: 100% !important; min-height: 46px !important; height: 46px !important; padding: 0 14px !important; margin: 0 !important;
	border: 2px solid #ead8bd !important; border-radius: 23px !important; background-color: #fff !important; color: #1b2b5a !important;
	font-size: 16px !important; line-height: 1.2 !important; box-shadow: none !important;
}
.tsb .tsb-f select { padding-right: 34px !important; }
.tsb .tsb-f input:focus, .tsb .tsb-f select:focus { border-color: #3d9be9 !important; outline: none; }
.tsb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tsb-count { font-size: 14px; opacity: .8; display: flex; gap: 12px; align-items: center; min-height: 24px; }
.tsb .tsb-clear { color: var(--tsb-price) !important; font-weight: 600 !important; text-decoration: underline; }
.tsb-none { background: var(--tsb-wall); border-radius: 6px; padding: 40px 16px; text-align: center; }
.tsb-more-wrap { text-align: center; margin: 18px 0 6px; }
.tsb-more-wrap:empty { display: none; }
.tsb-pages { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.tsb .tsb-pg {
	min-width: 44px !important; height: 44px !important; padding: 0 10px !important; border-radius: 22px !important;
	background: #fff !important; color: #1b2b5a !important; border: 2px solid #ead8bd !important; font-weight: 600 !important; font-size: 16px !important;
}
.tsb .tsb-pg.on { background: var(--tsb-btn) !important; border-color: var(--tsb-btn) !important; color: #fff !important; }
.tsb .tsb-pg:disabled { opacity: .35; cursor: default; }
.tsb-gap { padding: 0 4px; opacity: .6; }
.tsb .tsb-more { min-height: 48px !important; padding: 0 26px !important; border-radius: 24px !important; background: var(--tsb-btn) !important; color: #fff !important; font-weight: 600 !important; }

/* bookcase: crown on top, side posts, a back panel in each compartment, planks with a label rail */
.tsb-cab {
	position: relative; margin: 34px 6px 30px; padding: 0 18px;
	background:
		repeating-linear-gradient(90deg, rgba(60, 30, 10, .07) 0 2px, transparent 2px 11px, rgba(255, 255, 255, .05) 11px 12px, transparent 12px 23px),
		linear-gradient(90deg, #6e4423, #8c5a30 6%, #a26b3b 50%, #8c5a30 94%, #6e4423);
	border-radius: 4px;
	box-shadow: 0 26px 40px -22px rgba(60, 30, 5, .65), inset 0 0 0 1px rgba(0, 0, 0, .25);
}
.tsb-cab::before, .tsb-cab::after { content: ''; position: absolute; left: -10px; right: -10px; border-radius: 6px; }
.tsb-cab::before { /* crown */
	top: -26px; height: 28px;
	background: linear-gradient(#b67c46, #8c5a30 55%, #6e4423);
	box-shadow: 0 6px 0 -2px #5b371b, 0 10px 14px -6px rgba(0, 0, 0, .45), inset 0 2px 0 rgba(255, 255, 255, .25);
}
.tsb-cab::after { /* base */
	bottom: -22px; height: 24px;
	background: linear-gradient(#7a4c27, #5b371b);
	box-shadow: 0 10px 16px -8px rgba(0, 0, 0, .5), inset 0 2px 0 rgba(255, 255, 255, .15);
}
.tsb-shelf {
	position: relative; overflow: hidden; margin: 0;
	background:
		repeating-linear-gradient(90deg, rgba(0, 0, 0, .035) 0 1px, transparent 1px 38px),
		linear-gradient(color-mix(in srgb, var(--tsb-wall) 70%, #3a2210), var(--tsb-wall) 38%, color-mix(in srgb, var(--tsb-wall) 88%, #3a2210));
	box-shadow: inset 0 22px 18px -12px rgba(30, 15, 0, .55), inset 16px 0 16px -12px rgba(30, 15, 0, .45), inset -16px 0 16px -12px rgba(30, 15, 0, .45);
}
.tsb-shelf:first-child { margin-top: 18px; }
.tsb-shelf:last-child { margin-bottom: 18px; }
.tsb-shelf[hidden] { display: none; }
.tsb-plaque { display: none; }
.tsb-row {
	display: flex; align-items: flex-end; flex-wrap: nowrap; overflow: hidden;
	padding: 30px 22px 0; position: relative;
	background:
		/* label rail on the plank front */
		linear-gradient(rgba(255, 255, 255, .18), rgba(255, 255, 255, .18)) 0 calc(100% - 54px) / 100% 2px no-repeat,
		linear-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, .25)) 0 calc(100% - 6px) / 100% 2px no-repeat,
		/* plank front with grain */
		repeating-linear-gradient(0deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 7px) bottom / 100% 66px no-repeat,
		linear-gradient(#a8703f, #8a5a30 30%, #744a26) bottom / 100% 66px no-repeat,
		/* plank top surface, seen from above */
		linear-gradient(#e0b47e, #c89660) 0 calc(100% - 66px) / 100% 16px no-repeat,
		/* shadow the books and plank cast on the back panel */
		linear-gradient(transparent, rgba(30, 15, 0, .18)) 0 calc(100% - 82px) / 100% 26px no-repeat;
}
.tsb-row::before { /* bright front edge of the plank */
	content: ''; position: absolute; left: 0; right: 0; bottom: 66px; height: 2px; background: rgba(255, 235, 200, .55);
}
.tsb .tsb-bk::after { /* soft contact shadow where the book stands */
	content: ''; position: absolute; left: 0; right: -10%; bottom: -5px; height: 10px; z-index: -1;
	background: radial-gradient(closest-side, rgba(40, 20, 0, .45), transparent);
}
.tsb-item { flex: none; display: flex; flex-direction: column; align-items: center; }
.tsb .tsb-bk { display: block; position: relative; transform-origin: 50% 100%; transition: transform .25s; }
.tsb .tsb-bk:hover { transform: translateY(-6px) rotate(-1deg); }
.tsb-cov {
	display: block; height: var(--tsb-h); border-radius: 3px 6px 6px 3px; overflow: hidden; background: #eee;
	box-shadow: inset -3px 0 0 rgba(0, 0, 0, .18), inset 4px 0 6px -3px rgba(255, 255, 255, .35), 6px -2px 14px rgba(30, 15, 0, .35), 2px 2px 3px rgba(0, 0, 0, .25);
}
.tsb-img, .tsb-cloth { display: block; width: 100%; height: 100%; background-repeat: no-repeat; background-color: #eee; }
.tsb-cloth {
	display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center; padding: 14% 10% 9%;
	color: #f7e7c6; background-image: linear-gradient(90deg, rgba(0, 0, 0, .25), transparent 9%, rgba(255, 255, 255, .06) 50%, rgba(0, 0, 0, .12));
	box-shadow: inset 0 0 0 4px rgba(247, 231, 198, .18), inset 0 0 0 7px rgba(0, 0, 0, .12);
}
.tsb-cloth b { font-size: 13px; line-height: 1.25; font-weight: 700; letter-spacing: .2px; }
.tsb-cloth small { font-size: 9px; opacity: .75; letter-spacing: .5px; }
.tsb .tsb-bk.is-sold { cursor: default; }
.tsb .tsb-bk.is-sold:hover { transform: none; }
.tsb-bk.is-sold .tsb-cov > * { filter: grayscale(.75) brightness(.92); }
.tsb-rib {
	position: absolute; top: 12px; right: -8px; background: #d93636; color: #fff; font-size: 12px; font-weight: 700;
	padding: 3px 10px; border-radius: 3px; box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
}
.tsb .tsb-slab {
	margin: 18px 0 10px !important; width: 100% !important; max-width: 170px; min-height: 42px !important; padding: 3px 8px !important;
	display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
	border: 1px solid #c9a46c !important; border-radius: 3px !important; color: #1b2b5a !important;
	background: linear-gradient(#fffdf6, #f6ead2) !important;
	box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(255, 255, 255, .25), 0 2px 3px rgba(0, 0, 0, .35) !important;
}
.tsb-slab b {
	font-size: 12px; line-height: 1.25; font-weight: 600;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tsb-slab span { font-size: 14px; line-height: 1.3; font-weight: 700; color: var(--tsb-price); white-space: nowrap; }
.tsb-slab.is-sold span { color: #999; text-decoration: line-through; }

/* open book (lives on <body>) */
.tsb-ov {
	position: fixed; inset: 0; z-index: 999990; display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: 14px; padding: 16px; background: rgba(25, 18, 22, .75); opacity: 0; pointer-events: none; transition: opacity .3s;
	color: #1b2b5a;
}
.tsb-ov.on { opacity: 1; pointer-events: auto; }
.tsb-ov .tsb-x { position: absolute; top: 12px; right: 12px; width: 48px !important; height: 48px !important; border-radius: 24px !important; background: #fff !important; color: #1b2b5a !important; font-size: 28px !important; line-height: 48px !important; text-align: center; }
.tsb-stage { display: flex; align-items: center; gap: 8px; position: relative; }
.tsb-ov .tsb-nav { width: 44px !important; height: 44px !important; border-radius: 22px !important; background: rgba(255, 255, 255, .92) !important; color: #1b2b5a !important; font-size: 26px !important; line-height: 44px !important; text-align: center; flex: none; }
.tsb-ov .tsb-nav:disabled { opacity: .3; cursor: default; }
.tsb-book {
	position: relative; width: calc(var(--pw) * 2); height: var(--ph); perspective: 2200px; touch-action: pan-y;
	transition: transform .6s cubic-bezier(.3, .7, .2, 1); opacity: 0;
}
.tsb-book.ready { opacity: 1; }
.tsb-leaf {
	position: absolute; left: 50%; top: 0; width: 50%; height: 100%; transform-origin: 0 50%; transform-style: preserve-3d;
	transition: transform .7s cubic-bezier(.4, .1, .2, 1);
}
.tsb-leaf.t { transform: rotateY(-180deg); }
.tsb-face { position: absolute; inset: 0; overflow: hidden; background: #fffdf8; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: visibility 0s linear .35s; }
/* hide the side of each page that faces away (some browsers ignore backface-visibility and show it mirrored) */
.tsb-leaf.t > .fr, .tsb-leaf:not(.t) > .bk { visibility: hidden; }
.tsb-pgcover, .tsb-pgimg, .tsb-blank { width: 100%; height: 100%; }
.tsb-pgimg { background-repeat: no-repeat; background-color: #fffdf8; }
.tsb-blank { background: linear-gradient(90deg, #f6efe2, #fffdf8 20%); }
.tsb-face.fr .tsb-pgimg { box-shadow: inset 14px 0 18px -12px rgba(0, 0, 0, .35); }
.tsb-face.bk .tsb-pgimg { box-shadow: inset -14px 0 18px -12px rgba(0, 0, 0, .35); }
.tsb-face.fr { border-radius: 0 6px 6px 0; box-shadow: inset 10px 0 14px -10px rgba(0, 0, 0, .25); }
.tsb-face.bk { transform: rotateY(180deg); border-radius: 6px 0 0 6px; box-shadow: inset -10px 0 14px -10px rgba(0, 0, 0, .25); }
.tsb-back {
	height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
	gap: 10px; padding: 10%; background: linear-gradient(160deg, #fdf1dc, #f7dfe9); color: #1b2b5a;
}
.tsb-back b { font-size: clamp(14px, calc(var(--pw) / 14), 20px); line-height: 1.25; }
.tsb-back p { margin: 0; font-size: clamp(11px, calc(var(--pw) / 22), 14px); line-height: 1.45; opacity: .85; }
.tsb-back small { font-size: 11px; letter-spacing: .5px; opacity: .7; }

.tsb-info {
	width: min(600px, 100%); max-height: 44vh; overflow-y: auto; overscroll-behavior: contain;
	background: #fff; border-radius: 18px; padding: 14px 16px; color: #1b2b5a;
	display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
	opacity: 0; transform: translateY(16px); transition: .35s .15s;
}
.tsb-ov.on .tsb-info.show { opacity: 1; transform: none; }
.tsb-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tsb-info h3 { margin: 0; font-size: 20px; line-height: 1.2; color: #1b2b5a; }
.tsb-info .tsb-by { font-size: 14px; color: #6b6676; margin-top: 2px; }
.tsb-info .tsb-price { text-align: right; font-size: 26px; font-weight: 700; line-height: 1; color: var(--tsb-price); white-space: nowrap; }
.tsb-info .tsb-price del { display: block; font-size: 14px; color: #999; font-weight: 500; margin-top: 4px; }
.tsb-info .tsb-hint { grid-column: 1 / -1; text-align: center; font-size: 12px; color: #6b6676; }
.tsb-more-info { grid-column: 1 / -1; border-top: 1px solid #f0e4d0; margin-top: 6px; padding-top: 10px; }
.tsb-dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.tsb-dl div { min-width: 0; }
.tsb-dl dt { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: #8a8494; margin: 0; }
.tsb-dl dd { margin: 1px 0 0; font-size: 14px; font-weight: 600; color: #1b2b5a; overflow-wrap: anywhere; }
.tsb-desc { margin: 10px 0 0; font-size: 14px; line-height: 1.55; color: #3d3a48; }
.tsb-desc.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tsb-ov .tsb-readmore { margin-top: 4px !important; color: var(--tsb-price) !important; font-weight: 600 !important; font-size: 14px !important; text-decoration: underline; }
.tsb-btns { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.tsb-btns.one { grid-template-columns: 1fr; }
.tsb-ov .tsb-btn { min-height: 48px !important; border-radius: 24px !important; border: 2px solid var(--tsb-btn) !important; font-weight: 600 !important; font-size: 16px !important; color: var(--tsb-btn) !important; background: transparent !important; text-align: center; display: flex; align-items: center; justify-content: center; text-decoration: none; padding: 0 14px !important; }
.tsb-ov .tsb-btn.pri { background: var(--tsb-price) !important; border-color: var(--tsb-price) !important; color: #fff !important; }
.tsb-ov .tsb-btn.wa { background: #25d366 !important; border-color: #25d366 !important; color: #fff !important; }
.tsb-ov .tsb-btn[aria-busy="true"] { opacity: .6; pointer-events: none; }

.tsb-fly {
	position: fixed; z-index: 999995; pointer-events: none; display: none; overflow: hidden; border-radius: 3px 6px 6px 3px;
	box-shadow: 6px 12px 30px rgba(0, 0, 0, .4);
	transition: left .5s cubic-bezier(.3, .7, .2, 1), top .5s cubic-bezier(.3, .7, .2, 1), width .5s cubic-bezier(.3, .7, .2, 1), height .5s cubic-bezier(.3, .7, .2, 1);
}
.tsb-fly > * { display: block; width: 100%; height: 100%; }

.tsb-toast {
	position: fixed; left: 50%; bottom: 24px; z-index: 999999; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
	background: #1b2b5a; color: #fff; padding: 10px 18px; border-radius: 22px; font-weight: 600; font-size: 14px; transition: .3s;
}
.tsb-toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.tsb-toast a { color: #f5be32; margin-left: 8px; text-decoration: underline; }

@media (max-width: 600px) {
	.tsb-ctl { grid-template-columns: 1fr 1fr; gap: 8px; }
	.tsb-ctl .tsb-f:nth-child(2) { grid-column: 1 / -1; }
	.tsb .tsb-f input, .tsb .tsb-f select { height: 42px !important; min-height: 42px !important; padding: 0 10px !important; padding-right: 22px !important; font-size: 14px !important; }
	.tsb .tsb-f input { font-size: 16px !important; }
	.tsb-filters { gap: 8px; }
	.tsb-f-q { grid-column: 1 / -1; }
	.tsb-ov { gap: 10px; padding: 10px; }
	.tsb-info { max-height: 46vh; }
	.tsb-dl { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.tsb-cab { padding: 0 10px; margin-left: 8px; margin-right: 8px; }
	.tsb-ov .tsb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 150; width: 40px !important; height: 40px !important; line-height: 40px !important; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
	.tsb-ov .tsb-prev { left: -8px; }
	.tsb-ov .tsb-next { right: -8px; }
	.tsb-ov .tsb-nav:disabled { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.tsb *, .tsb-ov, .tsb-ov *, .tsb-fly, .tsb-toast { transition: none !important; }
}
