/*
 * CM Biblioteca — entrada nova da biblioteca + vitrine da página inicial.
 * Composição aprovada: computador = estante de museu (com alternância para
 * a linha do tempo); tablet = grade 3 colunas; celular = grade 2 colunas.
 * Paleta "Página e Pedra".
 */
.cmb-estante, .cmb-vitrine {
	--est-azul: #024F97;
	--est-profundo: #0F264A;
	--est-ouro: #BF892A;
	--est-marfim: #F6F1E8;
	--est-tinta: #24211D;
}

/* ---------------- abertura ---------------- */
.est-ab { text-align: center; margin: 0 0 22px; }
.est-ab-linha {
	max-width: 34rem; margin: 0 auto 12px;
	font-size: 1.05rem; line-height: 1.55; color: #55503f;
}
.est-ab-filete { color: var(--est-ouro); font-size: 15px; letter-spacing: .4em; margin-bottom: 12px; }
.est-ab-stats {
	display: flex; justify-content: center; gap: 22px; flex-wrap: wrap;
	font-size: .9rem; color: #6b6557; font-style: italic;
}
.est-ab-stats b { color: var(--est-azul); font-style: normal; font-weight: 600; }

/* ---------------- ferramentas ---------------- */
.est-ferr {
	display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center;
	margin: 0 0 28px;
}
.est-ferr[hidden] { display: none; }
.est-busca {
	font-family: inherit; font-size: .95rem;
	border: 1px solid rgba(36,33,29,.3); border-radius: 20px;
	padding: 7px 16px; background: #fdfbf6; color: var(--est-tinta);
	width: min(270px, 100%);
}
.est-busca::placeholder { color: #a49a88; font-style: italic; }
.est-ordem { display: flex; border: 1px solid rgba(36,33,29,.25); border-radius: 20px; overflow: hidden; }
.est-ordem button {
	font-family: inherit; font-size: .85rem; cursor: pointer;
	background: none; border: none; color: var(--est-tinta);
	padding: 7px 14px; border-left: 1px solid rgba(36,33,29,.15);
}
.est-ordem button:first-child { border-left: none; }
.est-ordem button.ativo { background: var(--est-azul); color: #fff; }
.est-conta { font-size: .85rem; font-style: italic; color: #8d8577; }

/* ---------------- botões ---------------- */
.est-b {
	font-family: inherit; cursor: pointer; text-align: center;
	border-radius: 3px; border: none; text-decoration: none;
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	line-height: 1.2;
}
.est-b svg { flex-shrink: 0; }
.est-b-ler { background: var(--est-azul); color: #fff !important; font-weight: 600; }
.est-b-ler:hover { background: #0361b8; color: #fff; }
.est-b-baixar { background: none; color: var(--est-azul) !important; box-shadow: inset 0 0 0 1px rgba(2,79,151,.55); }
.est-b-baixar:hover { background: rgba(2,79,151,.07); }
.est-b-baixar.primario { background: var(--est-azul); color: #fff !important; box-shadow: none; font-weight: 600; }
.est-b-baixar.primario:hover { background: #0361b8; }
.est-selo {
	position: absolute; top: 9px; left: -6px; z-index: 2;
	background: var(--est-ouro); color: #241f14;
	font-size: 10px; letter-spacing: .13em; text-transform: uppercase; font-weight: 600;
	padding: 3px 9px 3px 8px; border-radius: 0 2px 2px 0;
	box-shadow: 0 2px 6px rgba(36,33,29,.35);
	font-family: inherit; line-height: 1.4;
}
.est-selo::after {
	content: ''; position: absolute; left: 0; bottom: -5px;
	border: 3px solid transparent; border-top-color: #8a6118; border-right-color: #8a6118;
}
.est-meta { font-size: .82rem; font-style: italic; color: #8d8577; line-height: 1.4; }
.est-sem-capa { font-size: 3rem; opacity: .3; }
.est-vazio { grid-column: 1 / -1; text-align: center; font-style: italic; color: #8d8577; padding: 26px 0; }
.est-vazio[hidden] { display: none; }

/* ---------------- A · grade refinada (celular/tablet) ---------------- */
.est-grade-a { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
.est-card {
	background: #fdfbf6; border: 1px solid rgba(191,137,42,.28);
	border-radius: 6px; overflow: hidden;
	display: grid; grid-template-rows: auto 1fr auto;
}
.est-card-capa {
	position: relative; height: 185px; display: flex; align-items: center; justify-content: center;
	background: linear-gradient(180deg, #efe9dd, #e7dfd0);
	padding: 13px; text-decoration: none;
}
.est-card-capa img {
	max-height: 100% !important; max-width: 100%; width: auto; height: auto;
	box-shadow: 0 6px 16px rgba(36,33,29,.35); border-radius: 2px;
}
.est-card-info { display: block; padding: 11px 12px 4px; text-decoration: none; }
.est-card-info h3 {
	font-size: .95rem; font-weight: 600; line-height: 1.28; margin: 0;
	color: var(--est-tinta);
}
.est-card-info:hover h3 { color: var(--est-azul); }
.est-card-acoes { padding: 7px 10px 12px; display: grid; gap: 6px; }
.est-card-acoes .est-b { font-size: .85rem; padding: 7px 8px; width: 100%; }

/* ---------------- B · estante de museu (computador) ---------------- */
.est-grade-b {
	display: none;
	grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
	gap: 36px 24px;
}
.est-peca { text-align: center; }
.est-peca-capa {
	position: relative; height: 240px;
	display: flex; align-items: flex-end; justify-content: center;
	margin-bottom: 14px; text-decoration: none;
}
.est-peca-capa img {
	max-height: 100% !important; max-width: 100%; width: auto; height: auto;
	border-radius: 2px;
	box-shadow: 0 12px 28px -8px rgba(36,33,29,.5);
	transition: transform .22s ease, box-shadow .22s ease;
}
.est-peca-capa:hover img { transform: translateY(-6px); box-shadow: 0 20px 36px -10px rgba(36,33,29,.55); }
.est-peca h3 { font-size: .98rem; font-weight: 600; line-height: 1.3; margin: 0; }
.est-peca h3 a { color: var(--est-tinta); text-decoration: none; }
.est-peca h3 a:hover { color: var(--est-azul); }
.est-peca .est-meta { margin: 2px 0 9px; }
.est-peca-acoes { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.est-peca-acoes .est-b-ler.pilula { font-size: .85rem; padding: 6px 18px; border-radius: 20px; }
.est-link-baixar {
	font-family: inherit; font-size: .85rem; color: var(--est-azul);
	text-decoration: underline; text-underline-offset: 3px;
	display: inline-flex; align-items: center; gap: 5px;
}
.est-link-baixar:hover { color: #0361b8; }

/* ---------------- E · linha do tempo (alternância, computador) -------- */
.est-lt { position: relative; padding-left: 30px; }
.est-lt[hidden] { display: none; }
.est-lt::before {
	content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px;
	width: 2px;
	background: linear-gradient(180deg, rgba(191,137,42,.15), rgba(191,137,42,.6), rgba(191,137,42,.15));
}
.est-lt-epoca { position: relative; margin-bottom: 34px; }
.est-lt-epoca::before {
	content: ''; position: absolute; left: -27px; top: 9px;
	width: 12px; height: 12px; border-radius: 50%;
	background: var(--est-ouro); box-shadow: 0 0 0 4px rgba(191,137,42,.22);
}
.est-lt-ano { font-size: 1.5rem; font-weight: 600; color: var(--est-profundo); }
.est-lt-ano small { font-size: .85rem; font-weight: 400; font-style: italic; color: #8d8577; margin-left: 8px; }
.est-lt-fila { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; }
.est-lt-livro {
	display: flex; gap: 14px; align-items: flex-start;
	background: #fdfbf6; border: 1px solid rgba(191,137,42,.28); border-radius: 6px;
	padding: 14px; width: min(340px, 100%);
}
.est-lt-livro .capa { position: relative; width: 74px; flex-shrink: 0; display: block; }
.est-lt-livro .capa img { width: 100% !important; height: auto; border-radius: 2px; box-shadow: 0 5px 14px rgba(36,33,29,.35); }
.est-lt-livro h3 { font-size: .98rem; font-weight: 600; line-height: 1.28; margin: 0; }
.est-lt-livro h3 a { color: var(--est-tinta); text-decoration: none; }
.est-lt-livro h3 a:hover { color: var(--est-azul); }
.est-lt-livro .est-meta { margin: 2px 0 8px; }
.est-lt-acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.est-lt-acoes .est-b { font-size: .8rem; padding: 6px 12px; }
.est-lt .est-selo { top: 5px; }

/* ---------------- botão flutuante (só computador) ---------------- */
.est-alterna {
	position: fixed; left: 18px; bottom: 18px; z-index: 60;
	font-family: inherit; font-size: .88rem; cursor: pointer;
	display: none; align-items: center; gap: 8px;
	background: var(--est-profundo); color: var(--est-marfim);
	border: 1px solid rgba(191,137,42,.5);
	padding: 10px 18px; border-radius: 24px;
	box-shadow: 0 8px 24px rgba(15,38,74,.45);
}
.est-alterna:hover { background: #16325e; }
.est-alterna svg { color: #d9a94e; }

/* ---------------- responsivo ---------------- */
@media (min-width: 768px) {
	.est-grade-a { grid-template-columns: repeat(3, 1fr); gap: 24px 18px; }
	.est-card-capa { height: 205px; }
}
@media (min-width: 1024px) {
	.est-grade-a { display: none; }
	.est-grade-b { display: grid; }
	.est-alterna { display: inline-flex; }
	.est-alterna[hidden] { display: none; }
	/* alternância pela linha do tempo (classe posta pelo JS) */
	.cmb-estante.modo-lt .est-grade-b { display: none; }
	.cmb-estante.modo-lt .est-lt[hidden] { display: block; }
	.cmb-estante.modo-lt .est-ferr { display: none; }
}

/* ---------------- vitrine da página inicial ---------------- */
.cmb-vitrine { margin: 2.6rem auto; max-width: 66rem; }
.vit-rotulo {
	text-align: center; font-size: .8rem; letter-spacing: .28em; text-transform: uppercase;
	color: var(--est-ouro); font-weight: 600; margin-bottom: 6px;
}
.vit-titulo {
	text-align: center; font-size: 1.7rem; font-weight: 600;
	color: var(--est-profundo); margin: 0 0 22px;
}
.vit-palco {
	display: flex; gap: 30px; align-items: center;
	background: var(--est-profundo); border-radius: 8px;
	padding: 30px 52px; color: var(--est-marfim);
	position: relative; overflow: hidden;
}
.vit-palco::before {
	content: '\2766'; position: absolute; right: -30px; bottom: -46px;
	font-size: 200px; color: rgba(191,137,42,.09); pointer-events: none;
}
.vit-capa { flex-shrink: 0; width: 170px; }
.vit-capa img { width: 100% !important; height: auto; border-radius: 3px; box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.vit-info { min-width: 0; }
.vit-info .rot { font-size: .72rem; letter-spacing: .26em; text-transform: uppercase; color: #d9a94e; margin-bottom: 8px; }
.vit-info h3 { font-size: 1.65rem; font-weight: 600; color: #fdfaf4; line-height: 1.2; margin: 0 0 5px; }
.vit-info .ficha { font-size: .9rem; font-style: italic; color: #b9c4d6; margin-bottom: 9px; }
.vit-info .desc { font-size: .95rem; line-height: 1.5; color: #d5cbb8; max-width: 28rem; margin-bottom: 16px; }
.vit-acoes { display: flex; gap: 10px; flex-wrap: wrap; }
.vit-acoes .est-b { font-size: .9rem; padding: 9px 20px; }
.vit-acoes .est-b-ler { background: var(--est-ouro); color: #241f14 !important; }
.vit-acoes .est-b-ler:hover { background: #d9a94e; }
.vit-acoes .est-b-baixar { color: var(--est-marfim) !important; box-shadow: inset 0 0 0 1px rgba(246,241,232,.45); }
.vit-acoes .est-b-baixar:hover { background: rgba(246,241,232,.08); }
.vit-acoes .est-b-baixar.primario { background: var(--est-ouro); color: #241f14 !important; box-shadow: none; }
.vit-nav {
	position: absolute; top: 50%; transform: translateY(-50%);
	font-family: inherit; cursor: pointer; background: rgba(246,241,232,.1);
	border: none; color: var(--est-marfim); font-size: 24px; line-height: 1;
	width: 38px; height: 50px; border-radius: 4px; z-index: 2;
}
.vit-nav:hover { background: rgba(246,241,232,.2); }
.vit-ant { left: 8px; } .vit-prox { right: 8px; }
.vit-trilho { display: flex; gap: 13px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.vit-mini {
	border: none; background: none; padding: 0; cursor: pointer;
	width: 56px; opacity: .55; transition: opacity .2s ease, transform .2s ease;
	position: relative;
}
.vit-mini img { width: 100% !important; height: auto; border-radius: 2px; box-shadow: 0 4px 12px rgba(36,33,29,.4); }
.vit-mini:hover { opacity: .85; }
.vit-mini.ativo { opacity: 1; transform: translateY(-4px); }
.vit-mini.ativo::after {
	content: ''; position: absolute; left: 20%; right: 20%; bottom: -9px;
	height: 3px; background: var(--est-ouro); border-radius: 2px;
}
.vit-mini .pontinho {
	position: absolute; top: 3px; right: 3px; width: 9px; height: 9px;
	background: var(--est-ouro); border-radius: 50%; border: 1.5px solid #fdfbf6;
}
.vit-cta { text-align: center; margin-top: 22px; }
.vit-cta a {
	font-size: .98rem; color: var(--est-azul); text-decoration: none;
	border-bottom: 1px solid rgba(2,79,151,.4); padding-bottom: 2px;
}
.vit-cta a:hover { border-color: var(--est-azul); }
@media (max-width: 700px) {
	.vit-palco { flex-direction: column; text-align: center; padding: 24px 18px 26px; }
	.vit-acoes { justify-content: center; }
	.vit-info .desc { display: none; }
	.vit-nav { display: none; }
}
