/* bookhome.ge base styles on top of tokens.css (a copy of docs/design/tokens.css): fonts, the base elements, and the
   design system's shared components (bh- classes). Each feature keeps its own styles in css/<feature>.css, which it
   registers as a Stylesheet. No inline styles anywhere: the CSP allows stylesheets from our origin only. */

@font-face {
  font-family: "Noto Sans";
  src: url("../fonts/noto-sans-latin-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-024F, U+0300-036F, U+0400-052F, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-218F, U+2212;
}

@font-face {
  font-family: "Noto Sans Georgian";
  src: url("../fonts/noto-sans-georgian.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+10A0-10FF, U+1C90-1CBF, U+2D00-2D2F;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink-1);
  font-family: var(--font-sans); font-size: var(--text-body); line-height: var(--leading-body);
  font-weight: var(--weight-regular); font-synthesis: none; letter-spacing: 0;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--primary-hover); text-decoration-thickness: 2px; }
button, input, select { font: inherit; color: inherit; letter-spacing: 0; }
:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--focus-ring); }
[hidden] { display: none !important; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }

/* Type */
.bh-t-display { font-size: var(--text-display); line-height: var(--leading-display); font-weight: var(--weight-bold); }
.bh-t-h1 { font-size: var(--text-h1); line-height: var(--leading-h1); font-weight: var(--weight-bold); }
.bh-t-h2 { font-size: var(--text-h2); line-height: var(--leading-h2); font-weight: var(--weight-bold); }
.bh-muted { color: var(--ink-2); }
.bh-small { font-size: var(--text-small); line-height: var(--leading-small); }
.bh-meta { color: var(--ink-3); font-size: var(--text-small); line-height: var(--leading-small); }
.bh-label { font-size: var(--text-small); line-height: var(--leading-small); font-weight: var(--weight-bold); }
.bh-hint { color: var(--ink-3); font-size: var(--text-small); line-height: var(--leading-small); }
.bh-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Icons: Lucide at a 1.5 px stroke at every size */
.bh-icon { flex: none; width: 20px; height: 20px; stroke-width: 1.5; vertical-align: -0.25em; }
.bh-icon * { vector-effect: non-scaling-stroke; }
.bh-icon--16 { width: 16px; height: 16px; }
.bh-icon--24 { width: 24px; height: 24px; }
.bh-spin { animation: bh-spin 1s linear infinite; }
@keyframes bh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bh-spin { animation: none; } }

/* Buttons and links */
.bh-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--target-min); min-width: var(--target-min); max-width: 100%; margin: 0; padding: var(--space-2) var(--space-4);
  border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; color: var(--ink-1);
  font-size: var(--text-body); line-height: var(--leading-body); font-weight: var(--weight-bold);
  text-align: center; text-decoration: none; overflow-wrap: anywhere; cursor: pointer; touch-action: manipulation;
  transition: background-color var(--dur-press) var(--ease), color var(--dur-press) var(--ease);
}
.bh-btn:hover { text-decoration: none; }
.bh-btn--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.bh-btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.bh-btn--secondary { background: var(--card); border-color: var(--primary); color: var(--primary); }
.bh-btn--secondary:hover { background: var(--primary-soft); color: var(--primary-hover); }
.bh-btn--tertiary { padding-inline: var(--space-3); color: var(--primary); }
.bh-btn--tertiary:hover { background: var(--primary-soft); color: var(--primary-hover); }
.bh-btn--block { display: flex; width: 100%; }
.bh-btn--small { min-height: var(--target-min); padding: var(--space-1) var(--space-2); font-size: var(--text-small); line-height: var(--leading-small); }
.bh-btn[aria-disabled="true"] { background: var(--disabled-bg); border-color: var(--disabled-bg); color: var(--disabled-ink); cursor: not-allowed; }
.bh-btn--tertiary[aria-disabled="true"] { background: transparent; border-color: transparent; }
.bh-btn[aria-busy="true"] { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); cursor: progress; }
.bh-arrow-link {
  display: inline-flex; align-items: center; gap: var(--space-2); justify-self: start; min-height: var(--target-min);
  font-weight: var(--weight-bold); text-decoration: none;
}

/* Wordmark */
.bh-wordmark { font-size: var(--text-h2); line-height: var(--leading-h2); font-weight: var(--weight-bold); color: var(--ink-1); text-decoration: none; white-space: nowrap; }
a.bh-wordmark { display: inline-flex; align-items: center; min-height: var(--target-min); }
a.bh-wordmark, a.bh-wordmark:hover { color: var(--ink-1); text-decoration: none; }

/* Menus: <details> with a <summary> button, so they work without JavaScript */
.bh-menu {
  display: grid; gap: 2px; min-width: 220px; margin: 0; padding: var(--space-2);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-overlay);
}
.bh-menu-pop { position: absolute; right: 0; top: calc(100% + var(--space-1)); z-index: 10; }
.bh-menu-item {
  appearance: none; display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: var(--target-min); margin: 0;
  padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-control); background: transparent;
  color: var(--ink-1); text-align: left; text-decoration: none; cursor: pointer;
}
.bh-menu-item:hover { background: var(--sunken); color: var(--ink-1); }
.bh-menu-item[aria-current="true"] { font-weight: var(--weight-bold); }
.bh-menu-item-tick { margin-left: auto; color: var(--primary); }

/* Page column, icon tile, copy field, chip, banner, card and form field */
.bh-page { display: grid; gap: var(--space-4); align-content: start; width: 100%; max-width: 560px; margin: 0 auto; padding: var(--space-8) var(--page-pad) var(--space-10); }
.bh-sys-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--radius-card); background: var(--primary-soft); color: var(--primary); }
.bh-sys-icon--danger { background: var(--danger-bg); color: var(--danger-ink); }
.bh-sys-icon--info { background: var(--info-bg); color: var(--info-ink); }
.bh-copyf {
  padding: var(--space-3); border: 1px solid var(--border-input); border-radius: var(--radius-control); background: var(--card);
  font-family: var(--font-mono); font-size: var(--text-mono); line-height: var(--leading-mono); overflow-wrap: anywhere;
}
.bh-chip {
  display: inline-flex; align-items: center; gap: var(--space-1); min-height: 24px; padding: 2px 8px; vertical-align: middle;
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--neutral-bg); color: var(--neutral-ink);
}
.bh-banner { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-card); background: var(--info-bg); }
.bh-banner--error { background: var(--danger-bg); }
.bh-banner--error > .bh-icon { margin-top: 2px; color: var(--danger-ink); }
.bh-banner-body { display: grid; gap: var(--space-1); min-width: 0; }
.bh-banner-title { font-weight: var(--weight-bold); }
.bh-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: var(--space-4); }
.bh-field { display: grid; gap: var(--space-2); }
.bh-select {
  width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid var(--border-input); border-radius: var(--radius-control);
  background: var(--card); color: var(--ink-1); font-size: var(--text-body); line-height: var(--leading-body);
}
