/* Dizionario della Lingua Saurana - stile personalizzato sopra Bootstrap 5 */

:root {
  --zah-primary: #2f5d50;        /* verde bosco */
  --zah-primary-dark: #234638;
  --zah-primary-rgb: 47, 93, 80;
  --zah-accent: #a65f2b;         /* legno/rame, per l'italiano */
  --zah-hero-bg: #eef3f0;
  --zah-fonetic: #5a6470;
}

[data-bs-theme="dark"] {
  --zah-hero-bg: #1c2724;
  --zah-accent: #e0a070;
  --zah-fonetic: #a8b2bd;
}

/* --- Colori di marca --- */
.bg-zah { background-color: var(--zah-primary) !important; }
.text-zah { color: var(--zah-primary) !important; }

.btn-zah {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--zah-primary);
  --bs-btn-border-color: var(--zah-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--zah-primary-dark);
  --bs-btn-hover-border-color: var(--zah-primary-dark);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--zah-primary-dark);
  --bs-btn-active-border-color: var(--zah-primary-dark);
  --bs-btn-focus-shadow-rgb: var(--zah-primary-rgb);
}

.btn-outline-zah {
  --bs-btn-color: var(--zah-primary);
  --bs-btn-border-color: rgba(var(--zah-primary-rgb), .35);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--zah-primary);
  --bs-btn-hover-border-color: var(--zah-primary);
  --bs-btn-focus-shadow-rgb: var(--zah-primary-rgb);
}

a { color: var(--zah-primary); }
a:hover { color: var(--zah-primary-dark); }

.form-control:focus,
.form-select:focus {
  border-color: rgba(var(--zah-primary-rgb), .6);
  box-shadow: 0 0 0 .25rem rgba(var(--zah-primary-rgb), .2);
}

.page-link { color: var(--zah-primary); }
.active > .page-link, .page-link.active {
  background-color: var(--zah-primary);
  border-color: var(--zah-primary);
}

/* --- Testata e ricerca --- */
.hero { background: var(--zah-hero-bg); }
.search-strip {
  background: var(--zah-hero-bg);
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.search-form-lg .form-control,
.search-form-lg .form-select,
.search-form-lg .btn { padding-top: .65rem; padding-bottom: .65rem; font-size: 1.1rem; }

@media (min-width: 576px) {
  .search-form .form-select { min-width: 9.5rem; }
}

/* Autocompletamento */
.autocomplete-menu {
  top: 100%;
  left: 0;
  right: 0;
  max-height: 18rem;
  overflow-y: auto;
  z-index: 1050;
}
.autocomplete-menu .dropdown-item.active,
.autocomplete-menu .dropdown-item:active {
  background-color: var(--zah-primary);
}

/* --- Schede --- */
.card-link-hover { transition: transform .15s ease, box-shadow .15s ease; }
.card-link-hover:hover { transform: translateY(-2px); box-shadow: var(--bs-box-shadow) !important; }

/* --- Lemma e definizione --- */
.headword-title .lemma_str { font-weight: 700; color: var(--zah-primary); }
[data-bs-theme="dark"] .headword-title .lemma_str { color: #8fc5b3; }
.headword-title .lemma_codfon,
.fonetic {
  color: var(--zah-fonetic);
  font-family: "Charis SIL", "Doulos SIL", "Gentium Plus", "Segoe UI", "DejaVu Sans", sans-serif;
}
.headword-title .lemma_codfon { font-size: .75em; font-weight: 400; }

.definition { font-size: 1.05rem; line-height: 1.7; }
.definition p:last-child { margin-bottom: 0; }
.definition .italiano,
.legend-it { color: var(--zah-accent); font-style: italic; }
.definition a.riflemma {
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  white-space: nowrap;
}
.definition a.riflemma:hover { border-bottom-style: solid; }

/* --- Lemmario --- */
.letter-btn { min-width: 2.4rem; font-weight: 600; }

.wordlist { columns: 1; column-gap: 2rem; }
@media (min-width: 576px) { .wordlist { columns: 2; } }
@media (min-width: 992px) { .wordlist { columns: 3; } }
.wordlist li {
  break-inside: avoid;
  padding: .35rem .25rem;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.found-word { font-weight: 500; text-decoration: none; }
.found-word:hover { text-decoration: underline; }

.suggestion-list .list-inline-item a {
  display: inline-block;
  padding: .25rem .75rem;
  margin-bottom: .4rem;
  border: 1px solid rgba(var(--zah-primary-rgb), .35);
  border-radius: 50rem;
  text-decoration: none;
}
.suggestion-list .list-inline-item a:hover { background: var(--zah-primary); color: #fff; }

/* Pulsante "cancella" nella casella di ricerca: sembra parte del campo di testo */
.search-form .btn-clear {
  --bs-btn-color: var(--bs-secondary-color);
  --bs-btn-bg: var(--bs-body-bg);
  --bs-btn-border-color: var(--bs-border-color);
  --bs-btn-hover-color: var(--bs-body-color);
  --bs-btn-hover-bg: var(--bs-tertiary-bg);
  --bs-btn-hover-border-color: var(--bs-border-color);
  --bs-btn-active-bg: var(--bs-secondary-bg);
  --bs-btn-active-border-color: var(--bs-border-color);
  border-left: 0;
}
.search-form .input-group > .form-control:has(+ .btn-clear:not(.d-none)) { border-right: 0; }

/* Pulsante lingua dell'INTERFACCIA (barra di navigazione): bianco su verde,
   volutamente diverso dal selettore "Cerca in" della lingua di ricerca */
.btn-ui-lang {
  --bs-btn-color: #fff;
  --bs-btn-border-color: rgba(255, 255, 255, .55);
  --bs-btn-hover-color: var(--zah-primary);
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-border-color: #fff;
  --bs-btn-active-color: var(--zah-primary);
  --bs-btn-active-bg: #fff;
  --bs-btn-active-border-color: #fff;
  --bs-btn-focus-shadow-rgb: 255, 255, 255;
  border-radius: 50rem;
  padding-left: .8rem;
  padding-right: .8rem;
}
.ui-lang .dropdown-item.active { background-color: var(--zah-primary); }
/* icona del pulsante riprodotta nel testo della finestra di benvenuto */
.btn-ui-lang-sample { background: var(--zah-primary); color: #fff; border-radius: 50rem; }
.search-form .input-group-text { background: var(--bs-body-bg); color: var(--bs-secondary-color); }

/* Pulsanti dei caratteri speciali sotto la casella di ricerca */
.special-chars { display: flex; flex-wrap: wrap; gap: .35rem; }
.special-chars .btn-char {
  --bs-btn-color: var(--zah-primary);
  --bs-btn-bg: var(--bs-body-bg);
  --bs-btn-border-color: var(--bs-border-color);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--zah-primary);
  --bs-btn-hover-border-color: var(--zah-primary);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--zah-primary-dark);
  --bs-btn-focus-shadow-rgb: var(--zah-primary-rgb);
  min-width: 2.25rem;
  font-size: 1.05rem;
  line-height: 1.2;
  font-weight: 500;
}

/* Etichetta "beta" accanto al nome del sito: piccola e discreta */
.beta-badge {
  align-self: center;
  margin-left: -.5rem;
  padding: .05rem .4rem;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.4;
  color: rgba(255, 255, 255, .8);
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 50rem;
  cursor: help;
}
.beta-badge:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
