/* v1.3.8 Universal Cultural Demystification: glossary terms (includes/glossary.php, assets/js/gloss.js)
   v1.4.4: the explanation never sits in the page flow: a top-layer popover tethered to its ⓘ (from 640px) or a centred
   modal over a blurred scrim (phones, and 'modal' terms such as the homepage hero's Brahm Gyan). */
.gloss { display: inline; }
.gloss__en { font-size: .82em; font-weight: 500; letter-spacing: .01em; color: var(--gloss-en, #B45309); white-space: normal; }
html.dark .gloss__en, [data-theme="dark"] .gloss__en { --gloss-en: #F5C26B; }
.gloss__btn { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; min-width: 22px; min-height: 22px;
  margin: 0 0 0 .3em; padding: 0; vertical-align: .08em; border-radius: 50%; border: 1px solid currentColor; background: transparent;
  color: var(--gloss-en, #B45309); font: italic 700 .72em/1 Georgia, 'Times New Roman', serif; cursor: pointer; position: relative; }
.gloss__btn::before { content: ''; position: absolute; inset: -11px; } /* a 44 px touch target without moving the text */
html.dark .gloss__btn, [data-theme="dark"] .gloss__btn { --gloss-en: #F5C26B; }
.gloss__btn:hover, .gloss__btn[aria-expanded="true"] { background: rgba(217, 119, 6, .16); }
.gloss__btn:focus-visible { outline: 2px solid #D97706; outline-offset: 2px; }
/* Closed, the explanation is display: none where it is written (no-JS readers get the visible English subtitle). */
.gloss__tip[hidden] { display: none !important; }
.gloss__tip { display: none; }

/* ---------- the tethered popover (gloss.js places it with position: fixed; popover API = top layer) ---------- */
.gloss__tip.gloss__tip--pop {
  display: block; position: fixed; z-index: 70; inset: auto; right: auto; bottom: auto; margin: 0; box-sizing: border-box;
  width: max-content; max-width: min(22rem, calc(100vw - 24px)); overflow: auto; overscroll-behavior: contain;
  padding: .85rem 2.6rem .9rem 1rem; border-radius: 14px;
  background: rgba(22, 19, 17, .97); color: #F5EFE6; border: 1px solid rgba(217, 119, 6, .45);
  box-shadow: 0 22px 48px -18px rgba(0, 0, 0, .75), 0 0 0 1px rgba(245, 158, 11, .08);
  font: 400 .9rem/1.6 var(--sans, var(--font-body, system-ui, sans-serif)); letter-spacing: 0; text-transform: none; text-align: left; white-space: normal;
}
.gloss__tip--pop:focus { outline: none; }
.gloss__tip--pop:focus-visible { outline: 2px solid #D97706; outline-offset: 2px; }
.gloss__tip strong { display: block; margin-bottom: .25rem; color: #F5C26B; font-weight: 700; }
.gloss__tip b { color: #FCD34D; font-weight: 700; }
.gloss__tip .gloss__note { display: block; margin-top: .55rem; font-size: .85em; color: rgba(245, 239, 230, .78); }
html:not(.dark) .gloss__tip--pop { background: #FCFBF7; color: #2A1614; border-color: rgba(180, 83, 9, .35); box-shadow: 0 18px 40px -20px rgba(42, 22, 20, .35); }
html:not(.dark) .gloss__tip--pop strong { color: #881337; }
html:not(.dark) .gloss__tip--pop b { color: #92400E; }
html:not(.dark) .gloss__tip--pop .gloss__note { color: #5B4636; }
.gloss__close {
  position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: inherit; opacity: .8; cursor: pointer;
}
.gloss__close::before { content: ''; position: absolute; inset: -4px; } /* 44 px target */
.gloss__close:hover { opacity: 1; background: rgba(217, 119, 6, .16); }
.gloss__close:focus-visible { outline: 2px solid #D97706; outline-offset: 0; opacity: 1; }

/* ---------- the centred modal: scrim (z 55) + card (z 60); a <dialog> in the top layer where supported ---------- */
.gloss-modal {
  position: fixed; inset: 0; z-index: 55; box-sizing: border-box; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  border: 0; background: transparent; color: #F5EFE6; overflow: auto; overscroll-behavior: contain;
}
.gloss-modal[open] { display: grid; place-items: center; }
.gloss-modal::backdrop { background: rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.gloss-modal--fallback[open] { background: rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.gloss-modal__card {
  position: relative; z-index: 60; box-sizing: border-box; width: 90%; max-width: 32rem; margin: auto;
  padding: 1.25rem 1.25rem 1.4rem 1.4rem; border-radius: 1rem; background: #161311; border: 1px solid rgba(245, 158, 11, .3);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .9), 0 0 0 1px rgba(245, 158, 11, .06), 0 0 60px -20px rgba(217, 119, 6, .35);
  font: 400 1rem/1.65 var(--sans, system-ui, sans-serif); text-align: left;
}
@media (max-width: 419.98px) { .gloss-modal__card { width: 100%; } }
.gloss-modal__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: .6rem; }
.gloss-modal__title { flex: 1 1 auto; margin: .35rem 0 0; font-family: var(--serif, 'Cormorant Garamond', Georgia, serif); font-size: 1.45rem;
  font-weight: 600; line-height: 1.2; letter-spacing: .01em; color: #FCD34D; text-transform: none; }
.gloss-modal__close {
  position: relative; flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -4px -6px 0 0; padding: 0;
  border: 1px solid rgba(245, 158, 11, .3); border-radius: 50%; background: rgba(255, 255, 255, .04); color: #F5EFE6; cursor: pointer;
}
.gloss-modal__close:hover { background: rgba(217, 119, 6, .18); }
.gloss-modal__close:focus-visible { outline: 2px solid #FCD34D; outline-offset: 2px; }
.gloss-modal .gloss__tip { display: block; position: static; color: #EDE3D6; font-size: 1rem; line-height: 1.7; }
.gloss-modal .gloss__tip > strong:first-child { display: none; }   /* the dialog's heading carries the title */
.gloss-modal .gloss__tip b { color: #FCD34D; }
.gloss-modal .gloss__tip .gloss__note { margin-top: .9rem; padding-top: .8rem; border-top: 1px solid rgba(245, 158, 11, .18); font-size: .88rem; line-height: 1.55; color: #CDBBA6; }
html.gloss-modal-open { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .gloss__tip--pop { animation: gloss-in .16s ease-out; }
  .gloss-modal[open] .gloss-modal__card { animation: gloss-card-in .22s cubic-bezier(.22, 1, .36, 1); }
  .gloss-modal[open]::backdrop { animation: gloss-fade .2s ease-out; }
}
@keyframes gloss-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes gloss-card-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes gloss-fade { from { opacity: 0; } }
@media print { .gloss__btn, .gloss__tip, .gloss-modal { display: none !important; } }
/* v1.3.8: the discreet notice when a hidden module sends a visitor home (includes/views/layout.php) */
.module-notice { max-width: 46rem; margin: 14px auto 0; padding: 12px 18px; border-radius: 14px; text-align: center;
  font-size: .95rem; line-height: 1.5; background: rgba(217, 119, 6, .1); border: 1px solid rgba(217, 119, 6, .35); color: inherit; width: calc(100% - 32px); box-sizing: border-box; }
