/* ultra_library · materiais ------------------------------------------------
   De que o volume é feito: as texturas (grão gerado por SVG, sem imagens
   externas) e a tipografia que cada estante empresta ao título.
   Usado pela lombada e pela capa; não desenha geometria nenhuma. */

/* texturas ---------------------------------------------------------------- */
/* Cada face tem `--sheen` (a luz: cilíndrica na lombada, plana na capa) e a
   textura empilha por baixo dela: mesclado grosso + grão fino, mesclados com
   soft-light/overlay sobre a cor do volume (--c). */
:root {
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='.33 .33 .33 0 -0.12 .33 .33 .33 0 -0.12 .33 .33 .33 0 -0.12 0 0 0 0 1'/></filter><rect width='100%25' height='100%25' filter='url(%23g)'  opacity='0.6'/></svg>");
  --mottle: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='.028' numOctaves='5' seed='7' stitchTiles='stitch'/><feColorMatrix values='.33 .33 .33 0 -0.15 .33 .33 .33 0 -0.15 .33 .33 .33 0 -0.15 0 0 0 0 1'/></filter><rect width='100%25' height='100%25' filter='url(%23m)' opacity='.2'/></svg>");
  --pebble: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='p'><feTurbulence type='turbulence' baseFrequency='.16' numOctaves='3' seed='3' stitchTiles='stitch'/><feColorMatrix values='.33 .33 .33 0 -0.14 .33 .33 .33 0 -0.14 .33 .33 .33 0 -0.14 0 0 0 0 1'/></filter><rect width='100%25' height='100%25' filter='url(%23p)' opacity='.6'/></svg>");
  --weave: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='h'><feTurbulence type='fractalNoise' baseFrequency='.02 .9' numOctaves='2' seed='2' stitchTiles='stitch'/><feColorMatrix values='.33 .33 .33 0 -0.12 .33 .33 .33 0 -0.12 .33 .33 .33 0 -0.12 0 0 0 0 1'/></filter><filter id='v'><feTurbulence type='fractalNoise' baseFrequency='.9 .02' numOctaves='2' seed='5' stitchTiles='stitch'/><feColorMatrix values='.33 .33 .33 0 -0.12 .33 .33 .33 0 -0.12 .33 .33 .33 0 -0.12 0 0 0 0 1'/></filter><rect width='100%25' height='100%25' filter='url(%23h)'/><rect width='100%25' height='100%25' filter='url(%23v)' opacity='.5'/></svg>");
  --paper: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='q'><feTurbulence type='fractalNoise' baseFrequency='.6' numOctaves='3' seed='11' stitchTiles='stitch'/><feColorMatrix values='.33 .33 .33 0 -0.04 .33 .33 .33 0 -0.04 .33 .33 .33 0 -0.04 0 0 0 0 1'/></filter><rect width='100%25' height='100%25' filter='url(%23q)' opacity='.55'/></svg>");
}

.spine, .cover, .card-cover, .back {
  background-color: var(--c);
  background-image: var(--sheen);
  /* 2ª cor: painéis/faixas em --c2 são VÉUS (pseudo-elementos com mix-blend-mode
     em spine.css/cover.css) sobre este material único — `color` re-tinge o couro,
     `multiply` é tinta sobre papel. O grão e o --sheen são os mesmos pixels da
     face inteira, só mudam de matiz; nunca re-renderizar sheen/textura dentro do
     painel (a luz "recomeça" e o painel vira outro material). O isolate contém o
     blend na face e dá piso ao z-index:-1 dos véus. */
  isolation: isolate;
}

/* couro liso (bezerro): mesclado suave + grão finíssimo */
[data-texture="leather"] {
  background-image: var(--sheen), var(--mottle), var(--grain);
  background-size: auto, auto, 320px 320px, 90px 90px;
  background-blend-mode: normal, soft-light, soft-light, overlay;
}
/* marroquim: grão pipocado, mais vivo */
[data-texture="morocco"] {
  background-image: var(--sheen), var(--pebble), var(--grain);
  background-size: auto, auto, 110px 110px, 90px 90px;
  background-blend-mode: normal, normal, soft-light, overlay;
}
/* tecido: trama visível nos dois sentidos */
[data-texture="cloth"] {
  background-image: var(--sheen), var(--weave), var(--mottle);
  background-size: auto, auto, 160px 160px, 320px 320px;
  background-blend-mode: normal, hard-light, overlay, soft-light;
}
/* linho: trama mais aberta e clara */
[data-texture="linen"] {
  background-image: var(--sheen), var(--weave), var(--grain);
  background-size: auto, auto, 200px 200px, 120px 120px;
  background-blend-mode: normal, normal, overlay, soft-light;
}
/* buckram: tela engomada, granulada e fosca */
[data-texture="buckram"] {
  background-image: var(--sheen), var(--pebble), var(--weave);
  background-size: auto, auto, 130px 130px, 160px 160px;
  background-blend-mode: normal, normal, overlay, overlay;
}
/* papel de brochura: só o grão fino do papel, sem mesclado de couro */
[data-texture="paper"] {
  background-image: var(--sheen), var(--paper);
  background-size: auto, auto, 240px 240px;
  background-blend-mode: normal, normal, soft-light;
}
/* fosco: superfície quase lisa, um grão finíssimo */
[data-texture="matte"] {
  background-image: var(--sheen), var(--grain);
  background-size: auto, auto, 140px 140px;
  background-blend-mode: normal, normal, soft-light;
}
/* laminado: sem grão, com uma faixa diagonal de brilho de plastificação */
[data-texture="gloss"] {
  background-image:
    linear-gradient(115deg, transparent 30%, rgba(255,255,255,.16) 42%, rgba(255,255,255,.05) 52%, transparent 62%),
    var(--sheen);
  background-blend-mode: screen, normal, normal;
}

/* tipografia por estante --------------------------------------------------- */
[data-shelf="religiao"]   { --title-font: var(--font-religiao);   --title-track: .02em; }
[data-shelf="historia"]   { --title-font: var(--font-historia);   --title-track: .05em; --title-case: uppercase; }
[data-shelf="estrategia"] { --title-font: var(--font-estrategia); --title-track: .02em; }
[data-shelf="literatura"] { --title-font: var(--font-literatura); --title-track: .01em; }
[data-shelf="filosofia"]  { --title-font: var(--font-filosofia);  --title-track: .02em; }
[data-shelf="ciencia"]    { --title-font: var(--font-ciencia);    --title-track: .02em; }
[data-shelf="economia"]   { --title-font: var(--font-economia);   --title-track: .02em; }
[data-shelf="teatro"]     { --title-font: var(--font-teatro);     --title-track: .04em; }
[data-shelf="outros"]     { --title-font: var(--font-outros);     --title-track: .01em; }
.spine-title, .cover-title, .card h3 {
  font-family: var(--title-font, var(--display));
  letter-spacing: var(--title-track, .01em);
  text-transform: var(--title-case, none);
}
