/* PianoAlegreTa — "El cuento": a small picture book under the login form (public page only).
   All three languages live in the HTML (for search engines); [data-lang] on .tb shows one. */
.tb { --paper:#fffaf2; --paper2:#f7ecdc; --ink:#3b2c22; --ink2:#6a5646; --accent:#b4532a; --wood:#5a3a22;
  max-width: 1040px; margin: 34px auto 48px; padding: 0 16px; color: var(--ink);
  font: 500 16px/1.6 Nunito, system-ui, sans-serif; scroll-margin-top: 16px; }
.tb [data-l] { display: none; }
.tb[data-lang="es"] [data-l="es"], .tb[data-lang="ru"] [data-l="ru"], .tb[data-lang="eu"] [data-l="eu"] { display: revert; }

.tb-book { position: relative; perspective: 2200px; border-radius: 14px;
  padding: 14px; background: linear-gradient(135deg, #6b4428, #4a2e1a); box-shadow: 0 18px 40px rgba(60,35,15,.28); }
.tb-book::before { /* spine */ content: ""; position: absolute; top: 14px; bottom: 14px; left: 50%; width: 26px;
  transform: translateX(-50%); background: linear-gradient(90deg, rgba(0,0,0,.0), rgba(0,0,0,.18) 45%, rgba(0,0,0,.18) 55%, rgba(0,0,0,0));
  z-index: 3; pointer-events: none; }
.tb-spread { display: none; grid-template-columns: 1fr 1fr; min-height: 430px; }
.tb-spread.is-active { display: grid; }
.tb-page { position: relative; background: var(--paper); overflow: hidden; }
.tb-page.tb-pic { border-radius: 8px 0 0 8px; background: var(--paper2);
  box-shadow: inset -18px 0 24px -18px rgba(70,40,15,.35); display: flex; align-items: center; justify-content: center; }
.tb-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tb-page.tb-text { border-radius: 0 8px 8px 0; padding: 34px 38px 30px 44px;
  background: radial-gradient(120% 90% at 0% 50%, rgba(120,80,40,.10), transparent 40%), var(--paper);
  display: flex; flex-direction: column; justify-content: center; }
.tb-text h2, .tb-text h3 { font: 800 28px/1.15 'Baloo 2', Nunito, system-ui, sans-serif; margin: 0 0 12px; color: var(--ink); }
.tb-text h2 { font-size: 30px; }
.tb-text p { margin: 0 0 10px; color: var(--ink2); }
.tb-text b { color: var(--ink); }
.tb-eyebrow { font: 800 13px/1 Nunito, sans-serif !important; letter-spacing: .14em; text-transform: uppercase; color: var(--accent) !important; margin-bottom: 12px !important; }
.tb-chapter { font: 800 15px/1 'Baloo 2', serif !important; color: var(--accent) !important; letter-spacing: .2em; margin-bottom: 8px !important; }
.tb-chapter::after { content: " ✦"; }
.tb-hint { margin-top: 14px !important; font-weight: 800; color: var(--accent) !important; }
.tb-cover h2 { font-size: 34px; }
.tb-end { margin-top: 12px !important; font-style: italic; text-align: right; }
.tb-cta { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 8px !important; }
.tb-btn { display: inline-block; padding: 10px 18px; border-radius: 999px; background: #2f9e5b; color: #fff !important;
  font-weight: 800; text-decoration: none; box-shadow: 0 4px 12px rgba(47,158,91,.3); }
.tb-btn:hover { filter: brightness(1.07); }
.tb-link { color: var(--accent); font-weight: 800; }

/* the page turning over */
.tb-flip { position: absolute; top: 14px; bottom: 14px; width: calc(50% - 14px); z-index: 4; transform-style: preserve-3d;
  transition: transform .75s cubic-bezier(.45,.05,.3,1); pointer-events: none; }
.tb-flip.fwd { left: 50%; transform-origin: left center; }
.tb-flip.back { left: 14px; transform-origin: right center; }
.tb-flip > .tb-face { position: absolute; inset: 0; backface-visibility: hidden; overflow: hidden; border-radius: 8px; }
.tb-flip > .tb-face.rear { transform: rotateY(180deg); }
.tb-flip > .tb-face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.16), transparent 30%); opacity: 0;
  transition: opacity .75s; }
.tb-flip.turning > .tb-face::after { opacity: 1; }
.tb-flip.fwd.turning { transform: rotateY(-180deg); }
.tb-flip.back.turning { transform: rotateY(180deg); }

.tb-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 16px; }
.tb-arrow { width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; font: 800 26px/1 Nunito, sans-serif;
  color: #fff; background: linear-gradient(180deg, #7a4d2b, #5a3a22); box-shadow: 0 6px 14px rgba(60,35,15,.25); }
.tb-arrow:disabled { opacity: .35; cursor: default; }
.tb-arrow:not(:disabled):hover { filter: brightness(1.12); }
.tb-dots { display: flex; gap: 8px; }
.tb-dots button { width: 11px; height: 11px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: #d9c5ae; }
.tb-dots button.on { background: var(--accent); transform: scale(1.25); }

/* invitation on the login form */
.media-btn.tale-btn .media-icon { background: linear-gradient(180deg, #ffe7a8, #f0b85a); }

body.app-in .tb { display: none; }

@media (max-width: 760px) {
  .tb { margin: 22px auto 34px; }
  .tb-book { padding: 10px; }
  .tb-book::before { display: none; }
  .tb-spread { grid-template-columns: 1fr; min-height: 0; }
  .tb-page.tb-pic { border-radius: 8px 8px 0 0; aspect-ratio: 4 / 3; box-shadow: inset 0 -18px 24px -18px rgba(70,40,15,.3); }
  .tb-page.tb-text { border-radius: 0 0 8px 8px; padding: 22px 20px 20px; }
  .tb-text h2, .tb-cover h2 { font-size: 25px; }
  .tb-text h3 { font-size: 23px; }
  .tb-spread.is-active { animation: tb-in .45s ease; }
}
@keyframes tb-in { from { opacity: 0; transform: translateX(var(--tb-dx, 24px)); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tb-flip { transition: none; } .tb-spread.is-active { animation: none; } }
