/* links.css — encyclopedia links in text (links.js): subtle dotted gold underline + the tap card (bottom sheet on phones). */
.lk { cursor: pointer; text-decoration: underline dotted; text-decoration-color: rgba(166, 120, 30, .7); text-decoration-thickness: 1.5px; text-underline-offset: 3px; border-radius: 2px; -webkit-tap-highlight-color: rgba(201, 162, 39, .18); }
.lk:hover { text-decoration-color: #a6781e; text-decoration-style: solid; }
.lk:focus-visible { outline: 2px solid #c9a227; outline-offset: 1px; }
html:not(.light) .lk { text-decoration-color: rgba(217, 179, 106, .6); }
html:not(.light) .lk:hover { text-decoration-color: #e2c27e; }
body.dp-nolinks .lk { text-decoration: none; cursor: auto; }
.lk-back { position: fixed; inset: 0; z-index: 890; background: rgba(30, 22, 12, .38); }
.lk-card { position: fixed; z-index: 900; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 32px)); max-height: min(80vh, 680px); overflow: auto; overscroll-behavior: contain;
  box-sizing: border-box; background: var(--card, #fffaf0); color: var(--ink, #2b2116); border: 1px solid var(--line, #c9b896); border-radius: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); padding: 14px 18px 18px; font-family: var(--sans, system-ui, sans-serif); }
.lk-card[hidden], .lk-back[hidden] { display: none; }
.lk-card:focus { outline: none; }
.lk-x { position: sticky; top: 0; float: right; margin: -4px -8px 0 8px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.1rem; cursor: pointer; z-index: 1; }
.lk-x:focus-visible, .lk-pick:focus-visible { outline: 2px solid #c9a227; }
.lk-grip { display: none; }
.lk-fig { margin: 0 0 .6rem; }
.lk-img { display: block; width: 100%; max-height: 190px; object-fit: cover; border-radius: 10px; background: rgba(0, 0, 0, .06); }
.lk-cr { margin: .25rem 0 0; font-size: .72rem; line-height: 1.3; opacity: .7; }
.lk-k { margin: 0; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent, #8a5a14); }
.lk-t { margin: .1rem 0 .4rem; font: 700 1.3rem/1.25 var(--serif, Georgia, serif); }
.lk-s { margin: 0 0 .5rem; line-height: 1.5; }
.lk-f { margin: 0 0 .7rem; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; }
.lk-f li { font-size: .8rem; padding: .15rem .55rem; border-radius: 999px; border: 1px solid var(--line, #c9b896); }
.lk-btns { display: flex; flex-wrap: wrap; gap: .45rem; }
.lk-btns .rd-btn { min-height: 44px; }
.lk-vs { margin-top: .7rem; }
.lk-refs { line-height: 1.9; }
.lk-ch { list-style: none; margin: 0 0 .7rem; padding: 0; display: grid; gap: .4rem; }
.lk-pick { width: 100%; text-align: left; min-height: 48px; padding: .5rem .75rem; border-radius: 10px; border: 1px solid var(--line, #c9b896); background: transparent; color: inherit; cursor: pointer; display: flex; flex-direction: column; font: inherit; }
.lk-pick small { opacity: .75; }
@media (max-width: 640px) {
  .lk-card { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100%; max-width: 100%; max-height: calc(100dvh - 48px); max-height: calc(100vh - 48px); border-radius: 18px 18px 0 0; border-bottom: 0;
    padding: 6px 16px calc(16px + env(safe-area-inset-bottom, 0px)); transition: transform .15s; }
  @supports (height: 100dvh) { .lk-card { max-height: calc(100dvh - 48px); } }
  .lk-grip { display: block; width: 42px; height: 5px; border-radius: 3px; background: var(--line, #c9b896); margin: 4px auto 6px; }
  .lk-img { max-height: 150px; }
}
@media (prefers-reduced-motion: reduce) { .lk-card { transition: none; } }
html:not(.light) .lk-card { background: #221d12; color: #ead9b8; border-color: #504229; }
html:not(.light) .lk-back { background: rgba(0, 0, 0, .55); }
html:not(.light) .lk-k { color: #d1aa60; }
