/* Teal accent, used instead of Bootstrap's blue */
:root {
  --accent: #20c997;
  --accent-hover: #3dd5a7;
  --accent-active: #1aa179;
  --accent-rgb: 32, 201, 151;
}

.btn-primary {
  --bs-btn-color: #000;
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #000;
  --bs-btn-hover-bg: var(--accent-hover);
  --bs-btn-hover-border-color: var(--accent-hover);
  --bs-btn-active-color: #000;
  --bs-btn-active-bg: var(--accent-active);
  --bs-btn-active-border-color: var(--accent-active);
  --bs-btn-focus-shadow-rgb: var(--accent-rgb);
}
.btn-outline-primary {
  --bs-btn-color: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #000;
  --bs-btn-hover-bg: var(--accent);
  --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-color: #000;
  --bs-btn-active-bg: var(--accent-active);
  --bs-btn-active-border-color: var(--accent-active);
  --bs-btn-focus-shadow-rgb: var(--accent-rgb);
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 .25rem rgba(var(--accent-rgb), .25);
}

.app-container { max-width: 960px; }   /* the navbar's and the page's width */
.app-navbar { border-bottom: 2px solid var(--accent); }
.app-navbar .navbar-brand { color: var(--accent); letter-spacing: .02em; }
.app-pages .nav-link { padding: .25rem 0; color: var(--bs-secondary-color); border-bottom: 2px solid transparent; }
.app-pages .nav-link:hover { color: var(--accent); }
.app-pages .nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }
.app-logo { height: 1.75rem; width: auto; }
summary { cursor: pointer; }
summary:hover { color: var(--accent) !important; }

/* The settings tabs, in the accent colour */
.settings-tabs { --bs-nav-link-padding-y: .25rem; --bs-nav-link-padding-x: .75rem; font-size: .875rem; }
.settings-tabs .nav-link { color: var(--bs-secondary-color); }
.settings-tabs .nav-link:hover { color: var(--accent); }
.settings-tabs .nav-link.active { color: #000; background-color: var(--accent); }

/* Sliders in the accent colour, with the words for their two ends underneath */
.form-range::-webkit-slider-thumb { background-color: var(--accent); }
.form-range::-webkit-slider-thumb:active { background-color: var(--accent-active); }
.form-range::-moz-range-thumb { background-color: var(--accent); }
.form-range::-moz-range-thumb:active { background-color: var(--accent-active); }
.form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--bs-body-bg), 0 0 0 .25rem rgba(var(--accent-rgb), .25); }
.form-range:focus::-moz-range-thumb { box-shadow: 0 0 0 1px var(--bs-body-bg), 0 0 0 .25rem rgba(var(--accent-rgb), .25); }
.range-ends { font-size: .75rem; margin-top: -.25rem; }
/* Ticked checkboxes in the accent colour too */
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { border-color: var(--accent); box-shadow: 0 0 0 .25rem rgba(var(--accent-rgb), .25); }

/* A setting's "?" and the explanation it shows (see showTip in index.js) */
.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1rem; height: 1rem; margin-left: .25rem; vertical-align: text-top;
  border: 1px solid var(--bs-secondary-color); border-radius: 50%;
  color: var(--bs-secondary-color); font-size: .65rem; font-weight: 600; line-height: 1; cursor: help;
}
.tip:hover, .tip:focus { color: var(--accent); border-color: var(--accent); outline: none; }
.tip-box {
  position: absolute; z-index: 1080; display: none; max-width: 260px; pointer-events: none;
  padding: .4rem .6rem; border-radius: .375rem; background: #000; color: #fff;
  font-size: .8rem; line-height: 1.35; box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .4);
}

#input { font-family: var(--bs-font-monospace); resize: vertical; }
#preview { min-height: 160px; }
#preview svg { display: block; }
/* A transparent background shows as a checkerboard (preview only: not part of the image) */
#preview svg.transparent { background: repeating-conic-gradient(#d0d0d0 0 25%, #ffffff 0 50%) 0 0 / 16px 16px; }
/* Reading the drawing (see "Reading the drawing" in index.js): the word pointed at stays, the
   rest fades, the letter takes the accent colour; and the label beside the pointer */
#preview svg.reading line:not(.guide) { opacity: .18; }
#preview svg.reading line.reading-word { opacity: 1; }
#preview svg.reading line.reading-letter { stroke: var(--accent); opacity: 1; }
.reading-label {
  position: fixed; z-index: 1080; display: none; max-width: min(420px, calc(100vw - 16px)); pointer-events: none;
  padding: .3rem .6rem; border-radius: .375rem; background: #000; color: #fff;
  font-family: var(--bs-font-monospace); font-size: .85rem; white-space: pre-wrap;
  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .4);
}
/* the word in the accent colour, the letter pointed at as a solid block of it */
.reading-label mark { background: none; color: var(--accent); font-weight: 600; }
.reading-label mark b { padding: 0 .12em; border-radius: .2em; background: var(--accent); color: #000; }

/* While a new compact layout is being worked out, the old drawing fades */
#preview.busy svg { opacity: .45; transition: opacity .15s; }
/* The hint suggesting the compact shape, under the preview */
.compact-hint { border-left: 3px solid var(--accent); }
#zoomReset { min-width: 4rem; }   /* room for "400%" without the buttons shifting */
.layout-label { min-width: 6.5rem; opacity: 1 !important; }   /* room for "Layout 8 / 8"; a label, so not greyed out */
#sigilLayoutLabel { min-width: 7.75rem; }   /* room for "Layout 13 / 13", so the buttons don't move while it counts */

/* Large screens: text and settings on the left, the preview on the right. The page gets wider to
   fit both, and the preview stays in view while scrolling (a big drawing scrolls inside it). */
@media (min-width: 1200px) {
  .app-container { max-width: 1320px; }
  .preview-card { position: sticky; top: 1rem; }
  .preview-card .card-body { max-height: calc(100vh - 6rem); }
}

/* "How to read AIDAScript": a tile per letter, drawn in the accent colour */
.alphabet > summary { list-style-position: inside; }
.alphabet[open] > summary { border-bottom: var(--bs-card-border-width) solid var(--bs-card-border-color); }
.alphabet:not([open]) > summary { border-bottom: 0; border-radius: var(--bs-card-inner-border-radius); }
.alphabet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.5rem, 1fr)); gap: .5rem; }
.alphabet-tile {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  padding: .4rem .25rem .3rem; color: var(--accent);
  background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: .5rem;
}
.alphabet-tile svg { width: 2.5rem; height: 2.5rem; }
.alphabet-tile span { color: var(--bs-body-color); font-weight: 600; line-height: 1; }
button.alphabet-tile:hover, button.alphabet-tile:focus-visible { border-color: var(--accent); background: rgba(var(--accent-rgb), .1); }

/* Cards that fold open, like "How to read AIDAScript" */
.fold-card > summary { list-style-position: inside; }
.fold-card[open] > summary { border-bottom: var(--bs-card-border-width) solid var(--bs-card-border-color); }
.fold-card:not([open]) > summary { border-bottom: 0; border-radius: var(--bs-card-inner-border-radius); }

/* Sigils page: the drawing, centred; a transparent background shows as a checkerboard (preview only) */
.sigil-preview { min-height: 200px; display: flex; align-items: center; }
.sigil-preview svg { display: block; margin: auto; flex: none; }   /* (zoomed in, it scrolls: see sigils.js) */
.sigil-preview svg.transparent { background: repeating-conic-gradient(#d0d0d0 0 25%, #ffffff 0 50%) 0 0 / 16px 16px; }
#sigilText { font-family: var(--bs-font-monospace); resize: vertical; }
/* Sigils page: pointing at a line shows its word, with the letters it stands for marked */
.sigil-preview .hits line { pointer-events: stroke; cursor: pointer; }
.sigil-label {
  position: fixed; z-index: 1080; display: none; pointer-events: none;
  padding: .25rem .5rem; border-radius: .375rem; background: #000; color: #fff;
  font-family: var(--bs-font-monospace); font-size: .9rem; box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .4);
}
.sigil-label mark { padding: 0 .05rem; border-radius: .2rem; background: var(--accent); color: #000; }
.sigil-label .note { font-family: var(--bs-body-font-family); font-size: .8rem; color: #ccc; }

/* The picture to save, over the page (see showPicture in save.js) */
.save-picture {
  width: min(32rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 1rem;
  border: 1px solid var(--bs-border-color); border-radius: .5rem;
  background: var(--bs-body-bg); color: var(--bs-body-color);
}
.save-picture::backdrop { background: rgba(0, 0, 0, .6); }
.save-picture img {
  display: block; max-width: 100%; max-height: 60vh; margin: 0 auto;
  -webkit-touch-callout: default; user-select: auto;   /* (so press-and-hold offers to save it) */
  background: repeating-conic-gradient(#ccc 0 25%, #fff 0 50%) 0 0 / 16px 16px;   /* (a transparent one shows as such) */
}
