/* Online catalogue: an open book, one rug per page; the outer page turns over the spine. Computer and tablet only. */
.fb-wrap { padding: 14px 0 40px; background: radial-gradient(ellipse at center, #efe4cf 0%, var(--cream) 70%); }
.fb-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 4px 24px; margin-bottom: 10px; }
.fb-head h1 { margin: 2px 0 0; font-size: clamp(24px, 2.6vw, 32px); }
.fb-hint { margin: 0; font-size: 13.5px; color: var(--ink-2); max-width: 460px; }
.fb-stage { --paper-c: #fbf6ec; --r: 18px; display: grid; justify-items: center; gap: 14px; }
.fb-book { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 1180px);
           height: clamp(460px, calc(100vh - 330px), 740px); perspective: 2600px; border-radius: var(--r);
           box-shadow: 0 26px 50px rgba(34, 28, 26, .22), 0 2px 0 rgba(34, 28, 26, .06); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.fb-side { position: relative; overflow: hidden; background: var(--paper-c); }
.fb-start { border-start-start-radius: var(--r); border-end-start-radius: var(--r); }
.fb-end { border-start-end-radius: var(--r); border-end-end-radius: var(--r); }
.fb-spine { position: absolute; top: 0; bottom: 0; left: 50%; width: 60px; margin-left: -30px; pointer-events: none; z-index: 3;
            background: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(60,40,30,.10) 38%, rgba(60,40,30,.24) 50%, rgba(60,40,30,.10) 62%, rgba(0,0,0,0) 100%); }
.fb-book, .fb-side { cursor: grab; }
.fb-book.dragging, .fb-book.dragging * { cursor: grabbing; }

/* the turning page */
.fb-leaf { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 4; transform-style: preserve-3d; will-change: transform; }
.fb-leaf.ease { transition: transform var(--t, 1.25s) cubic-bezier(.33, .02, .2, 1); }
.fb-leaf-face { position: absolute; inset: 0; overflow: hidden; background: var(--paper-c); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fb-leaf-back { transform: rotateY(180deg); }
.fb-leaf.on-left .fb-leaf-front { border-radius: var(--r) 0 0 var(--r); }
.fb-leaf.on-left .fb-leaf-back { border-radius: 0 var(--r) var(--r) 0; }
.fb-leaf.on-right .fb-leaf-front { border-radius: 0 var(--r) var(--r) 0; }
.fb-leaf.on-right .fb-leaf-back { border-radius: var(--r) 0 0 var(--r); }
/* light and shade that follow the turn (driven by --k, 0 flat → 1 upright) */
.fb-leaf-face::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--k, 0); }
.fb-leaf.on-left .fb-leaf-front::after, .fb-leaf.on-right .fb-leaf-back::after { background: linear-gradient(to left, rgba(40,25,15,.32), rgba(40,25,15,.05) 45%, rgba(255,255,255,.08) 80%); }
.fb-leaf.on-right .fb-leaf-front::after, .fb-leaf.on-left .fb-leaf-back::after { background: linear-gradient(to right, rgba(40,25,15,.32), rgba(40,25,15,.05) 45%, rgba(255,255,255,.08) 80%); }
.fb-leaf::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; box-shadow: 0 0 40px rgba(34, 28, 26, calc(var(--k, 0) * .45)); }
.fb-shade { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 3; pointer-events: none; opacity: var(--k, 0); }
.fb-shade.on-left { left: 0; background: linear-gradient(to left, rgba(40,25,15,.28), rgba(40,25,15,0) 55%); }
.fb-shade.on-right { right: 0; background: linear-gradient(to right, rgba(40,25,15,.28), rgba(40,25,15,0) 55%); }

/* one page */
.fb-paper { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 18px 20px 12px; background: var(--paper-c); }
.fb-rug .fb-pic { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--paper-c); }
.fb-rug .fb-pic img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; -webkit-user-drag: none; }
/* standing rugs are laid on their side, so they fill the wide page */
.fb-rug .fb-pic img.rot { position: absolute; top: 50%; left: 50%; max-width: none; max-height: none; transform: translate(-50%, -50%) rotate(90deg); }
.fb-text { flex: 0 0 auto; padding-top: 8px; min-height: 0; overflow: hidden; border-top: 1px solid #eadfca; margin-top: 8px; }
.fb-origin { font-size: 10.5px; color: var(--gold-text); letter-spacing: .03em; }
.fb-rug h3 { margin: 0 0 3px; font-size: 14px; line-height: 1.5; color: var(--ink); }
.fb-specs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; margin: 0 0 3px; font-size: 11px; line-height: 1.7; }
.fb-specs div { display: flex; gap: 5px; min-width: 0; border-bottom: 1px dotted var(--line); padding: 1px 0; }
.fb-specs dt { color: var(--ink-2); white-space: nowrap; }
.fb-specs dd { margin: 0; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.fb-story { margin: 3px 0 0; font-size: 10.5px; line-height: 1.7; color: var(--ink-2);
            display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.fb-foot { display: flex; align-items: center; gap: 12px; margin-top: 4px; font-size: 11px; }
.fb-code { color: var(--ink-2); }
.fb-price { color: var(--wine); font-weight: 500; }
.fb-more { margin-inline-start: auto; color: var(--wine); text-decoration: underline; }

/* covers: the logo stands free on the wine cloth, drawn in cream */
.fb-cover { align-items: center; justify-content: center; text-align: center; gap: 6px; background: var(--wine); color: #f2e9d9; }
.fb-cover h2 { margin: 14px 0 0; font-size: 26px; color: #f2e9d9; }
.fb-cover p { margin: 0; color: #e6c98f; }
.fb-cover .fb-logo { width: min(320px, 72%); height: auto; filter: brightness(0) invert(92%) sepia(18%) saturate(380%) hue-rotate(345deg) drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); }
.fb-cover-note { font-size: 13px; letter-spacing: .06em; }
.fb-back .btn { background: #e6c98f; border-color: #e6c98f; color: #1b1614; margin-top: 10px; }
.fb-blank { background: var(--paper-c); }

.fb-controls { display: flex; align-items: center; gap: 18px; }
.fb-btn { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--gold); background: var(--paper); color: var(--wine);
          font-size: 26px; line-height: 1; cursor: pointer; }
.fb-btn:hover:not(:disabled) { background: var(--wine); color: var(--paper); border-color: var(--wine); }
.fb-btn:disabled { opacity: .35; cursor: default; }
.fb-full { margin-inline-start: 10px; }
.fb-full .fb-close { display: none; }
.fb-count { min-width: 120px; text-align: center; font-size: 14px; color: var(--ink-2); }
.fb-range { width: min(560px, 90%); accent-color: var(--wine); }
.fb-empty { padding: 40px 0; }

/* stock figures under the book */
.fb-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; max-width: 1180px; margin: 22px auto 0; background: var(--line);
            border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.fb-stats div { display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; padding: 14px 8px; background: var(--paper); text-align: center; }
.fb-stats dt { font-size: 12.5px; color: var(--ink-2); }
.fb-stats dd { margin: 0; font-size: clamp(22px, 2.2vw, 30px); font-weight: 300; color: var(--wine); line-height: 1.2; }

/* full screen: the book fills the screen on a dark ground */
.fb-stage:fullscreen { align-content: center; width: 100vw; height: 100vh; padding: 18px 24px; background: #1b1411; }
.fb-stage:fullscreen .fb-book { width: min(100%, calc((100vh - 130px) * 2.3)); height: calc(100vh - 130px); }
.fb-stage:fullscreen .fb-count { color: #dcd3c2; }
.fb-stage:fullscreen .fb-full .fb-open { display: none; }
.fb-stage:fullscreen .fb-full .fb-close { display: inline; }
.fb-stage:-webkit-full-screen { width: 100vw; height: 100vh; padding: 18px 24px; background: #1b1411; }

/* Phones: the book is switched off; a note points to the treasury. */
.fb-phone { display: none; }
@media (max-width: 1000px) { .fb-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) {
  .fb-stage, .fb-hint, .fb-page { display: none !important; }
  .fb-phone { display: block; padding: 24px 0 8px; font-size: 15px; line-height: 2; }
  .fb-phone .btn { margin-top: 10px; }
  .fb-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .fb-leaf.ease { transition-duration: .01s; } }

/* the index page, right after the cover: a tap opens that part of the book */
.fb-index { justify-content: center; padding: 26px 34px 20px; overflow: hidden; }
.fb-index h2 { margin: 0 0 12px; font-size: 22px; color: var(--wine); text-align: center; letter-spacing: .04em; }
.fb-index ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fb-index .fb-part > a, .fb-index .fb-part > span { font-size: 16px; padding: 6px 6px 2px; }
.fb-index .fb-part > a b, .fb-index .fb-part > span b { font-weight: 600; color: var(--wine); }
.fb-index .fb-sizes { display: flex; flex-wrap: wrap; gap: 2px 4px; padding: 0 6px 6px; border-bottom: 1px solid #eadfca; }
.fb-index .fb-sizes a { display: inline-flex; gap: 4px; padding: 2px 8px; font-size: 12.5px; color: var(--ink-2); background: #f7f0e3; border-radius: 12px; }
.fb-index .fb-sizes a:hover { background: #efe2c9; color: var(--wine); }
.fb-index .fb-sizes small { font-size: 11px; }
.fb-index a, .fb-index span { display: flex; align-items: baseline; gap: 8px; padding: 7px 6px; color: var(--ink); text-decoration: none; border-radius: 6px; font-size: 14px; }
.fb-index a:hover { background: #f1e7d4; color: var(--wine); }
.fb-index b { font-weight: 400; white-space: nowrap; }
.fb-index i { flex: 1; border-bottom: 1px dotted #cdbb98; transform: translateY(-4px); }
.fb-index small { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.fb-index .empty span { color: #b3a68f; }
.fb-section { color: var(--wine); font-weight: 500; }
