/* Library page + lead form popup (the flipbook itself is styled by viewer.css) */

/* ---------- lead popup ---------- */
.ld-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(8, 9, 12, 0.72); display: none; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.ld-overlay.open { display: flex; }
.ld-card { position: relative; width: min(460px, 100%); background: #fff; color: #1f2125; border-radius: 18px; padding: 22px 20px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); font-size: 14px; margin: auto; }
.ld-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: #f1efec; font-size: 14px; }
.ld-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; padding-right: 30px; }
.ld-head .fb-dot { margin-top: 6px; flex-shrink: 0; }
.ld-head h2 { margin: 0; font-size: 19px; }
.ld-head p { margin: 3px 0 0; color: #6b6f78; font-size: 12px; }
.ld-card label { display: block; font-weight: 600; font-size: 13px; margin-top: 10px; }
.ld-card label small { font-weight: 400; color: #8a8d94; }
.ld-card input, .ld-card select, .ld-card textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #dddad4; border-radius: 10px; font: inherit; color: inherit; background: #fff; }
.ld-card input:focus, .ld-card select:focus, .ld-card textarea:focus { outline: 2px solid rgba(215, 38, 46, 0.35); border-color: #d7262e; }
.ld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ld-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; }
.ld-submit { width: 100%; margin-top: 16px; padding: 13px; border: 0; border-radius: 999px; background: #d7262e; color: #fff; font-weight: 700; font-size: 15px; }
.ld-submit:disabled { opacity: 0.6; }
.ld-msg { margin: 8px 0 0; min-height: 1em; font-size: 13px; color: #6b6f78; text-align: center; }
.ld-msg.err { color: #b3261e; }
.ld-done { text-align: center; padding: 12px 4px 6px; }
.ld-tick { width: 56px; height: 56px; margin: 0 auto 8px; border-radius: 50%; background: #25d366; color: #fff; font-size: 30px; line-height: 56px; font-weight: 700; }
.ld-done h2 { margin: 4px 0; }
.ld-done p { color: #555; line-height: 1.5; }
.ld-wa { display: inline-block; margin-top: 8px; padding: 12px 20px; border-radius: 999px; background: #25d366; color: #fff; font-weight: 700; text-decoration: none; }
@media (max-width: 420px) { .ld-row { grid-template-columns: 1fr; } }

/* ---------- library page ---------- */
body.library { overflow: auto; }
.lib { max-width: 1120px; margin: 0 auto; padding: 0 16px 60px; }
.lib-hero { text-align: center; padding: 34px 0 26px; }
.lib-hero h2 { margin: 0 0 8px; font-size: clamp(24px, 4.4vw, 38px); line-height: 1.15; }
.lib-hero h2 span { color: #ff5a62; }
.lib-hero p { margin: 0 auto; max-width: 560px; color: var(--muted); line-height: 1.5; }
.lib-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.lib-stats span { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); border-radius: 999px; padding: 6px 14px; font-size: 13px; }
.lib-tools { display: flex; gap: 10px; margin: 6px 0 22px; }
.lib-tools input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 26px 20px; }
.lib-card { text-decoration: none; color: var(--text); display: block; }
.lib-card[hidden] { display: none; }
.lib-cover { aspect-ratio: 0.7; background: var(--bg-2); border-radius: 4px 9px 9px 4px; overflow: hidden; box-shadow: 0 12px 26px rgba(0, 0, 0, 0.5), inset 5px 0 8px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.lib-card:hover .lib-cover { transform: translateY(-5px) rotate(-1.2deg); }
.lib-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-card h3 { margin: 11px 0 2px; font-size: 14px; line-height: 1.3; }
.lib-card p { margin: 0; font-size: 12px; color: var(--muted); }
.lib-empty { text-align: center; color: var(--muted); padding: 50px 0; }
.lib-cta { margin-top: 56px; border-radius: 22px; padding: 30px 22px; text-align: center; background: linear-gradient(135deg, #d7262e, #8f1218); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35); }
.lib-cta h2 { margin: 0 0 8px; font-size: clamp(20px, 3.4vw, 28px); }
.lib-cta p { margin: 0 0 18px; opacity: 0.9; }
.lib-cta button, .lib-cta a { display: inline-block; margin: 4px; padding: 12px 22px; border-radius: 999px; border: 0; font-weight: 700; font-size: 15px; text-decoration: none; }
.lib-cta button { background: #fff; color: #a91b22; }
.lib-cta a { background: #25d366; color: #fff; }
.lib-foot { text-align: center; margin-top: 34px; color: var(--muted); font-size: 12px; }
.lib-foot a { color: var(--muted); }
