/* Only for the pages that loco renders (Tera + htmx); everything else is design/styles.css, shared with the React app. */
.toggle { position: relative; display: inline-flex; align-items: center; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle:has(input:checked) { background: var(--primary-50); border-color: var(--primary-600); color: var(--primary-600); }
.toggle:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--primary-200); }
.load-more { display: flex; justify-content: center; margin: 8px 0 24px; }
.htmx-request.results, .results.htmx-request { opacity: 0.5; }
.filters select { width: 100%; }
.page-head .found { margin: 0; }
@media (max-width: 860px) { .catalog { grid-template-columns: 1fr; } .filters { position: static; } }
.header-actions { display: flex; align-items: center; gap: 12px; } .header-actions .auth-links { display: inline-flex; gap: 8px; }
.lang-switch { display: inline-flex; gap: 4px; } .lang-switch .toggle { height: 32px; padding: 0 10px; border-radius: var(--r-chip); border: 1px solid var(--line-300); background: var(--surface); color: var(--ink-900); font-weight: 600; font-size: 12px; }
.lang-switch .toggle.on { background: var(--primary-50); border-color: var(--primary-600); color: var(--primary-600); }

/* native <dialog> as the picker window (the look of .dialog / .dialog.wide of styles.css) */
/* position: fixed: .dialog is `position: relative` (for its close cross), which a dialog in the top layer turns into `absolute`, the window then sat at the top of the DOCUMENT and a scrolled page jumped back to the top when it opened */
dialog.dialog { position: fixed; border: 0; padding: 24px; color: inherit; }
dialog.dialog:not([open]) { display: none; }
dialog.dialog::backdrop { background: #11182780; }
dialog.dialog.wide { max-width: 96vw; }
.msel-option[hidden] { display: none; }
button.msel-trigger { width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--ink-900); }
button.msel-trigger .msel-value { pointer-events: none; }
.dialog .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex: none; }
.project-page .slot-skills { margin: 6px 0; }

/* list / mosaic of the server-rendered catalogs: the switch sets data-view on #catalog (ui.js), the same looks as the React app */
.catalog[data-view="mosaic"] .projects-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 16px; align-items: stretch; } .catalog[data-view="mosaic"] .projects-results .project { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.catalog[data-view="mosaic"] .projects-results .project > p:not(.byline):not(.slots-summary) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.catalog[data-view="mosaic"] .projects-results .project .slots-summary { margin-top: auto; padding-top: 12px; }
@media (max-width: 1100px) { .catalog[data-view="mosaic"] .projects-results { grid-template-columns: 1fr; } }
.catalog[data-view="list"] .members-grid { display: flex; flex-direction: column; gap: 12px; } .catalog[data-view="list"] .members-grid .member { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 20px; } .catalog[data-view="list"] .members-grid .member .chips { justify-content: flex-end; max-width: 55%; }
.catalog[data-view="mosaic"] .projects-results .load-more, .catalog[data-view="mosaic"] .projects-results .empty { grid-column: 1 / -1; }
.btn.disabled[data-reset] { opacity: .45; }
.view-toggle button.on { background: var(--primary-50); color: var(--primary-600); }

/* the slots of a card: the list folds them down to the summary line, the square (mosaic) cards show only the summary and are one size whatever the project asks for */
.project[data-slots="closed"] > .slot { display: none; }
.slots-toggle[aria-expanded="false"] > svg { transform: rotate(180deg); } .slots-toggle .slots-summary[hidden] { display: none; }
.catalog[data-view="list"] .projects-results .project > p.slots-summary { display: none; }
.catalog[data-view="mosaic"] .projects-results .project > .slot, .catalog[data-view="mosaic"] .projects-results .project > .slots-toggle { display: none; }

/* the sort buttons of the catalogs: the active one shows its direction (descending / ascending) and a click on it turns it round (ui.js) */
.sort-row .sort-ico { display: none; margin-left: 6px; vertical-align: -3px; }
.sort-row[data-dir="desc"] .toggle:has(input:checked) .sort-desc, .sort-row[data-dir="asc"] .toggle:has(input:checked) .sort-asc { display: inline-block; }

/* the end of a long list (/projects, /members) loads the next portion by itself: when it comes near the window the row shows a spinner and "Loading more…" for a moment, then the
   portion is asked for (ui.js). Without JS the row is the plain "Load more" button. New cards fade in. */
.load-more .autoload-status { display: none; align-items: center; justify-content: center; gap: 12px; color: var(--ink-500); font-size: 14px; }
.load-more[data-auto] { min-height: 72px; align-items: center; }
.load-more[data-auto] > button { display: none; }
.load-more[data-auto]:not(.on) { visibility: hidden; }
.load-more.on .autoload-status { display: inline-flex; }
.results .member { animation: result-in 0.18s ease both; }
@media (prefers-reduced-motion: reduce) { .results .project, .results .member { animation: none; } }
/* an inactive sort button keeps its icon (its natural direction) grey at 25 percent, so a button never changes size when it is chosen */
.sort-row .toggle:has(input:not(:checked)[data-default-dir="desc"]) .sort-desc, .sort-row .toggle:has(input:not(:checked)[data-default-dir="asc"]) .sort-asc { display: inline-block; opacity: 0.25; color: var(--ink-500); }

/* a short page (a project, an empty list) keeps the footer at the bottom of the window: the page is a column that is at least as high as the window and its main area takes the rest, so there is no gap under the footer */
body { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1 0 auto; }
.site-header, .site-footer { flex: none; }

/* while a changed filter loads, the old results stay but dim (the prototype's stale state); the new ones replace them */
.results.htmx-request { opacity: 0.5; pointer-events: none; }
