/* GENERERAD FIL — redigera inte för hand.
   Byggs av Skript/build_ordlista_web.py. */

/* --- Markerat begrepp i punkttext och tooltip --- */
.glossary-term {
  color: inherit;
  text-decoration: underline dotted currentColor;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  cursor: help;
}

.glossary-term:hover { text-decoration-style: solid; }

.glossary-term:focus-visible {
  outline: 2px solid var(--primary-color, #0066CC);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Popover (dator) --- */
.glossary-popover {
  position: absolute;
  z-index: 10050;              /* över tooltip-lagret */
  max-width: 320px;
  padding: 14px 16px;
  background: #fff;
  color: #1A1A1A;
  /* Checklistans rader är helvita. Skuggan är blågrå (samma familj som
     webbplatsens #4A6779), tydligt mörkare och når längre ut runt HELA rutan
     — det tredje lagret är riktningslöst (0 0 18px) och ramar in även
     ovansidan — så att rutan lyfter från det vita underlaget utan att bli en
     hård svart kontur. */
  border: 1px solid rgba(25, 45, 58, 0.34);
  border-radius: 10px;
  box-shadow:
    0 22px 58px rgba(18, 38, 50, 0.40),
    0 8px 24px rgba(18, 38, 50, 0.30),
    0 0 18px rgba(18, 38, 50, 0.18);
  font-size: 0.92rem;
  line-height: 1.6;
  text-align: left;
  /* Rutan är REN INFORMATION på dator och ska inte fånga pekaren. Utan detta
     håller den sig öppen genom sitt eget hover-läge när pekaren förs över
     den — beteendet som återkallades. */
  pointer-events: none;
}

.glossary-popover[hidden] { display: none !important; }

.glossary-popover-term {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--primary-dark, #004C99);
}

.glossary-popover-def { display: block; margin-bottom: 10px; }

.glossary-popover-link {
  display: inline-block;
  color: var(--primary-color, #0066CC);
  font-weight: 600;
  text-decoration: underline;
}

.glossary-popover-link:focus-visible {
  outline: 2px solid var(--primary-color, #0066CC);
  outline-offset: 2px;
}

/* --- Nederkantsruta (mobil) --- */
.glossary-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10060;
  max-height: 70vh;
  overflow-y: auto;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  color: #1A1A1A;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  border-top: 1px solid rgba(35, 58, 70, 0.28);
  /* Uppåtriktad skugga i samma blågrå ton, motsvarande styrka som popovern. */
  box-shadow:
    0 -16px 40px rgba(25, 45, 58, 0.30),
    0 -5px 14px rgba(25, 45, 58, 0.22);
}

.glossary-sheet[hidden] { display: none !important; }

.glossary-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10055;
  background: rgba(0, 0, 0, 0.42);
}

.glossary-sheet-backdrop[hidden] { display: none !important; }

.glossary-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.glossary-sheet-term {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark, #004C99);
  margin: 0;
}

.glossary-sheet-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color, #E0E0E0);
  border-radius: 8px;
  background: #fff;
  color: var(--text-dark, #1A1A1A);
  cursor: pointer;
}

.glossary-sheet-close:focus-visible {
  outline: 2px solid var(--primary-color, #0066CC);
  outline-offset: 2px;
}

.glossary-sheet-def {
  margin: 0 0 14px;
  line-height: 1.7;
}

.glossary-sheet-link {
  display: inline-block;
  color: var(--primary-color, #0066CC);
  font-weight: 600;
  text-decoration: underline;
}

body.glossary-sheet-open { overflow: hidden; }
