/* builtin/statblock.css */

.statblock {
  --statblock-primary-color: #7a200d;
  --statblock-rule-color: #922610;
  --statblock-bg: #fdf1dc;
  --statblock-heading-font: "Libre Baskerville", "Lora", Georgia, serif;
  --statblock-content-font: "Noto Sans", Calibri, Helvetica, Arial, sans-serif;

  background: var(--statblock-bg);
  color: #000;
  border: 1px solid #ddd;
  box-shadow: 0 0 1.5em #ddd;
  padding: 0.6rem 0.75rem;
  margin: 1rem 0;
  font-family: var(--statblock-content-font);
  font-size: 14px;
  line-height: 1.4;
}
.statblock p { margin: 0.15rem 0; }
.statblock-name {
  font-family: var(--statblock-heading-font);
  font-size: 1.6rem;
  font-variant: small-caps;
  font-weight: 700;
  color: var(--statblock-primary-color);
  margin: 0;
  line-height: 1.1;
}
.statblock-subheading {
  font-style: italic;
  font-size: 0.9rem;
  margin: 0.1rem 0 0;
}
.statblock-rule {
  height: 5px;
  background: var(--statblock-rule-color);
  border: none;
  margin: 0.4rem 0;
  clip-path: polygon(0 0, 100% 0, 100% 30%, 0 100%);
}
.statblock-rule-tapered {
  clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%);
}
.statblock-block { margin: 0.3rem 0; }
.statblock-property {
  color: var(--statblock-primary-color);
}
.statblock-property strong {
  font-weight: bold;
}
.statblock-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.25rem;
  text-align: center;
  color: var(--statblock-primary-color);
  margin: 0.3rem 0;
}
.statblock-stat-name {
  font-weight: bold;
  font-variant: small-caps;
}
.statblock-section { margin-top: 0.6rem; }
.statblock-section-heading {
  font-family: var(--statblock-heading-font);
  font-variant: small-caps;
  font-weight: normal;
  font-size: 1.3rem;
  color: var(--statblock-primary-color);
  border-bottom: 1px solid var(--statblock-primary-color);
  margin: 0.5rem 0 0.3rem;
}
.statblock-trait {
  margin: 0.3rem 0;
  text-indent: -1rem;
  padding-left: 1rem;
}
.statblock-trait strong em {
  font-weight: bold;
  font-style: italic;
}
.statblock-spell-level {
  margin: 0.15rem 0 0.15rem 1rem;
  text-indent: -1rem;
  padding-left: 1rem;
}
.statblock-section-intro {
  font-style: italic;
  margin: 0.3rem 0;
}
.statblock-error {
  background: #fde7e3;
  color: #7a200d;
  border-color: #7a200d;
}
.statblock-image {
  float: right;
  width: 75px;
  height: 75px;
  object-fit: cover;
  margin: 0 0 0.4rem 0.5rem;
  border: 2px solid var(--statblock-rule-color);
  border-radius: 2px;
}
.statblock-source,
.statblock-note {
  font-size: 0.85rem;
  margin-top: 0.4rem;
  color: #555;
}


/* builtin/battlemap.css */

.vaults-battlemap { margin: 1rem 0; }
.vaults-bm-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.vaults-bm-levels, .vaults-bm-tools { display: flex; flex-wrap: wrap; gap: .25rem; }
.vaults-battlemap button { font: inherit; font-size: .85rem; line-height: 1.2; padding: .3rem .7rem; border: 1px solid var(--rule, #ccc); border-radius: 4px; background: var(--bg, #fff); color: var(--fg, #222); cursor: pointer; }
.vaults-battlemap button:hover { border-color: var(--accent, #888); }
.vaults-bm-level[aria-selected="true"], .vaults-bm-grid[aria-pressed="true"] { background: var(--accent, #333); color: var(--accent-fg, #fff); border-color: var(--accent, #333); }
.vaults-bm-stage { position: relative; line-height: 0; border: 1px solid var(--rule, #ccc); border-radius: 4px; overflow: hidden; background: #15151a; }
.vaults-bm-pane { display: none; position: relative; }
.vaults-bm-pane.is-active { display: block; }
.vaults-bm-pane img { display: block; width: 100%; height: auto; -webkit-user-drag: none; user-select: none; }
.vaults-bm-pane img:not(:first-child) { position: absolute; inset: 0; }
.vaults-bm-grid-overlay { position: absolute; inset: 0; display: none; pointer-events: none; background-image: linear-gradient(to right, rgba(0,0,0,.5) 0 1px, transparent 1px), linear-gradient(to bottom, rgba(0,0,0,.5) 0 1px, transparent 1px); }
.vaults-battlemap.show-grid .vaults-bm-grid-overlay { display: block; }
.vaults-bm-error { padding: .5rem .75rem; border: 1px solid #b94a3a; border-radius: 4px; color: #b94a3a; font-size: .85rem; }


/* builtin/gallery.css */

.vaults-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; margin: 1.25rem 0; }
.vaults-gallery-item { display: block; text-decoration: none; color: inherit; cursor: zoom-in; }
.vaults-gallery-item img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; }
.vaults-gallery-caption { display: block; margin-top: .25rem; font-size: .8rem; text-align: center; opacity: .8; }
.vaults-gallery-error { padding: .5rem .75rem; border: 1px solid #b94a3a; border-radius: 4px; color: #b94a3a; font-size: .85rem; }
.vaults-lightbox { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 2rem; background: rgba(0,0,0,.85); cursor: zoom-out; }
.vaults-lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 4px 30px rgba(0,0,0,.5); }


/* ./kubishi-glossary.css (/home/jared/projects/language/ovp-vault/.vaults/handlers/kubishi-glossary.css) */
/* Styles for the ```kubishi-glossary``` table (handler + runtime). */

.kubishi-glossary-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0;
  flex-wrap: wrap;
}

.kubishi-glossary-filter {
  flex: 1 1 14rem;
  max-width: 22rem;
  padding: 0.4rem 0.6rem;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 0.4rem;
  opacity: 0.9;
}

.kubishi-glossary-count {
  font-size: 0.85rem;
  opacity: 0.6;
  white-space: nowrap;
}

.kubishi-glossary-scroll {
  overflow-x: auto;
}

table.kubishi-glossary {
  width: 100%;
  border-collapse: collapse;
}

table.kubishi-glossary th,
table.kubishi-glossary td {
  text-align: left;
  vertical-align: top;
  padding: 0.35rem 0.6rem;
}

table.kubishi-glossary thead th {
  border-bottom: 2px solid currentColor;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

table.kubishi-glossary th.sortable {
  cursor: pointer;
  user-select: none;
}

/* Sort direction indicator */
table.kubishi-glossary th.sortable::after {
  content: "";
  display: inline-block;
  width: 0.7em;
  opacity: 0.4;
  font-size: 0.8em;
}
table.kubishi-glossary th.sortable:hover::after {
  content: "↕";
}
table.kubishi-glossary th[data-dir="asc"]::after {
  content: "▲";
  opacity: 0.9;
}
table.kubishi-glossary th[data-dir="desc"]::after {
  content: "▼";
  opacity: 0.9;
}

/* The last column (Pages count) is numeric — right-align it. */
table.kubishi-glossary td:last-child,
table.kubishi-glossary th:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  cursor: help;
}

table.kubishi-glossary tbody tr:nth-child(even) {
  background: rgba(127, 127, 127, 0.07);
}

.kubishi-glossary-empty {
  opacity: 0.7;
  font-style: italic;
}


/* ./kubishi.css (/home/jared/projects/language/ovp-vault/.vaults/handlers/kubishi.css) */
/* Kubishi dictionary word links + hover popover.
   Shipped by .vaults/handlers/kubishi.mjs via assets.styles. */

/* The <a> wrapper carries the href (real navigation); the inner <span> is
   the styled, hoverable target (the sanitizer keeps data-* on span, not a). */
.kubishi-link {
  text-decoration: none;
}

.kubishi-word {
  /* A dotted underline marks the word as "look-up-able" without competing
     with ordinary [[wikilinks]]. Inherits the link's accent for color. */
  border-bottom: 1px dotted currentColor;
  cursor: help;
  white-space: nowrap;
}

.kubishi-link:hover .kubishi-word,
.kubishi-link:focus-visible .kubishi-word {
  border-bottom-style: solid;
}

.kubishi-word--invalid {
  color: #b5651d;
  border-bottom: none;
}

/* The popover element is a single node reused for every link, appended to
   <body> by the runtime. */
.kubishi-popover {
  position: absolute;
  z-index: 9999;
  max-width: 22rem;
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.4;
  background: var(--kubishi-pop-bg, #2b2622);
  color: var(--kubishi-pop-fg, #f4ecd8);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.kubishi-popover[data-open="true"] {
  opacity: 1;
  transform: translateY(0);
}

/* Pinned (click-opened) popover: interactive, so its link/close are clickable,
   and given a little extra room for the close button. */
.kubishi-popover--pinned {
  pointer-events: auto;
  padding-right: 1.6rem;
}

.kubishi-popover__close {
  position: absolute;
  top: 0.2rem;
  right: 0.35rem;
  padding: 0 0.15rem;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
}

.kubishi-popover__close:hover {
  opacity: 1;
}

.kubishi-popover__link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--kubishi-pop-link, #6fd0b8);
  text-decoration: none;
}

.kubishi-popover__link:hover {
  text-decoration: underline;
}

.kubishi-popover__head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.kubishi-popover__word {
  font-weight: 700;
  font-size: 1rem;
}

.kubishi-popover__pos {
  font-style: italic;
  opacity: 0.7;
  font-size: 0.8rem;
}

.kubishi-popover__gloss {
  font-weight: 600;
}

.kubishi-popover__def {
  margin-top: 0.2rem;
  opacity: 0.9;
}

.kubishi-popover__hint {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  opacity: 0.6;
}
