/*
 * The term switcher as a drop-down menu (resources/views/partials/
 * term-menu.blade.php, 12 Nov 2026): a button naming the term shown and its
 * best saving, and under it the terms as a list. The list is site.css's own
 * `nav.seg` — the same links site.js switches — laid out here as a menu, so
 * these rules sit inside `.term-dd`. Only the site's own tokens.
 */

.term-dd { position: relative; display: inline-block; }
.term-dd summary { box-sizing: border-box; list-style: none; display: inline-flex; align-items: center; gap: 12px; height: 48px; padding: 6px 14px 6px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; color: var(--fg); user-select: none; }
.term-dd summary::-webkit-details-marker { display: none; }
.term-dd summary:hover { border-color: var(--primary); }
.term-dd summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.term-dd-label { font-size: 13px; color: var(--fg-3); }
.term-dd-now { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.term-dd .off { font-family: var(--font-mono); font-size: 10px; border-radius: 999px; padding: 2px 7px; background: var(--tint); color: var(--primary-text); font-weight: 500; }
.term-dd-chev { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--fg-2); transition: transform 0.2s ease; }
.term-dd[open] .term-dd-chev { transform: rotate(180deg); }
.term-dd[open] summary { border-color: var(--primary); }

/* The list: site.css draws `nav.seg` as a row of pills; here it is a menu. */
.term-dd .seg.term-dd-list { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 40; display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; flex-wrap: nowrap; gap: 2px; width: max-content; min-width: 100%; max-width: calc(100vw - 32px); padding: 6px; overflow: visible; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 24px 48px -20px rgb(0 0 0 / 0.35); }
.term-dd .seg.term-dd-list a { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 11px 12px; border-radius: 10px; color: var(--fg); font-size: 14.5px; font-weight: 500; background: none; }
.term-dd .seg.term-dd-list a:hover { background: var(--surface-2); }
.term-dd .seg.term-dd-list a[aria-current="true"],
.term-dd .seg.js.term-dd-list a[aria-current="true"] { background: var(--tint); color: var(--primary-text); font-weight: 600; }
.term-dd .seg.term-dd-list a[aria-current="true"] .off { background: var(--primary); color: var(--primary-fg); }
.term-dd .seg.term-dd-list a[aria-current="true"]::after { content: ""; width: 16px; height: 16px; flex: none; margin-left: -8px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat; }
.term-dd .seg.term-dd-list .tn { flex: 1; }

@media (prefers-reduced-motion: reduce) {
    .term-dd-chev { transition: none; }
}
