/* What the views draw (W4OS\Views\Assets), the same on every site and every client: its own look alone, its layout, the colours of
   the text and of the page (Canvas), the accent of the site (--w4os-accent) else the text's. Its frames in a browser:
   views.web.css; smaller in a viewer: views.viewer.css. A theme dresses it over it. */

/* The tables the views and the helpers draw (a list, its records, a block of the grid: its status, what it is): each header
   aligned as its column, at the start, a number at the end; never centred by a theme */
:is(.w4os-list, .w4os-records, .block-table) th { text-align: start; }
:is(.w4os-list, .w4os-records) th.w4os-col-number { text-align: end; }

/* A link as a button (Link: button, primary), the one to click first filled: the views' own look, without weight (:where) so that
   the class a theme gives its buttons wins over it */
:where(.w4os-button) { display: inline-block; padding: .45em 1em; border: 1px solid color-mix(in srgb, currentColor 40%, transparent); border-radius: .4em; line-height: 1.3; text-align: center; }
a:where(.w4os-button) { text-decoration: none; }
:where(.w4os-button-primary) { background: var(--w4os-accent, CanvasText); border-color: var(--w4os-accent, CanvasText); }
a:where(.w4os-button-primary) { color: Canvas; }

/* The login URI of a grid (TeleportLink::address()): its address as code, the text of the link, broken anywhere where it is narrow */
.w4os-uri-field .w4os-login-uri { color: inherit; }
.w4os-start-uri .w4os-login-uri, .w4os-hypergrid-address .w4os-login-uri { overflow-wrap: anywhere; }

/* The steps of a newcomer (StartSteps): numbered, the one to do now with its number filled, the ones done checked, the others faded */
.w4os-start { margin: 1.5rem 0; container-type: inline-size; }
.w4os-start-content, .w4os-start-footer { margin: .75rem 0; }
.w4os-start-content > :first-child, .w4os-start-footer > :first-child { margin-top: 0; }
.w4os-start-content > :last-child, .w4os-start-footer > :last-child { margin-bottom: 0; }
.w4os-start-steps { list-style: none; counter-reset: w4os-step; padding: 0; margin: 0; display: grid; gap: .75rem; }
.w4os-start-step { counter-increment: w4os-step; position: relative; margin: 0; padding: .75rem 1rem .75rem 3.25rem; min-height: 3.2rem; }
.w4os-start-step::before { content: counter(w4os-step); position: absolute; left: 1rem; top: .8rem; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 45%, transparent); font-weight: bold; font-size: .9rem; }
.w4os-start-step p { margin: .5rem 0 0; }
/* The number of the one to do now on the accent, else on the colour of the text of the page (its own colour is Canvas) */
.w4os-start-step.is-next::before { background: var(--w4os-accent, CanvasText); border-color: var(--w4os-accent, CanvasText); color: Canvas; }
.w4os-start-step.is-done::before { content: "\2713"; border-color: var(--w4os-accent, currentColor); color: var(--w4os-accent, currentColor); }
.w4os-start-step:is(.is-done, .is-todo) > *, .w4os-start-step:is(.is-done, .is-todo)::before { opacity: .7; }
/* A step whose menu is open (a teleport link) shown whole, its menu over what follows */
.w4os-start-step:has([aria-expanded="true"]) { opacity: 1; z-index: 1; }
/* Side by side where the block has the room (a page), stacked where it has not (a sidebar, a viewer's panel) */
@container (min-width: 42rem) {
    .w4os-start-steps { grid-template-columns: repeat(3, 1fr); }
    .w4os-start-step { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
    .w4os-start-step::before { top: 50%; transform: translateY(-50%); }
}

/* A callout (HypergridVisit: the visit of the grid from another one) */
.w4os-callout { margin: 1.5rem 0; }
.w4os-callout-title { margin: 0 0 .5rem; }
.w4os-callout p { margin: .5rem 0 0; }
.w4os-callout > :last-child { margin-bottom: 0; }

/* A profile (ProfileHtml). Its pictures in their own proportions, never cut nor stretched */
.profile-photo { display: grid; flex: none; min-width: 4rem; min-height: 4rem; max-width: min(100%, 20rem); max-height: 16rem; border-radius: .4rem; }
.profile-photo img, .profile-item-picture img { width: auto; height: auto; max-width: inherit; max-height: inherit; object-fit: contain; }
/* The banner, over every tab: its picture beside what the engine marks for it (the birth, the role alone) */
.profile-banner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.profile-banner .profile-photo { max-width: min(100%, 12rem); max-height: 9rem; }
.profile-banner .block-title { margin: 0 0 .25rem; }
.profile-banner .profile-banner-details { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; }
.profile-banner .profile-banner-bare { margin: .15rem 0 0; }
/* The details (its groups, its interests...), label left and value right */
.profile-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .25rem 1rem; margin: 0 0 1rem; }
.profile-details dt, .profile-details dd { margin: 0; }
/* Its groups one under the other, eight rows at most then a scroll; the grid of a group of another grid muted */
.profile-group-list { max-height: 12em; overflow-y: auto; margin: 0; padding: 0; list-style: none; line-height: 1.5; }
.profile-group-list li { margin: 0; padding: 0; }
.profile-group-grid { opacity: .65; }
/* Its picks and its classifieds; one under the other on a narrow screen */
/* Its tabs: a line of links across the whole profile, the open one underlined; a block whatever a theme does with a nav and its
   lists (Pico: nav ul a row, its first one pulled to the left) */
.w4os-profile-tabs { display: block; }
nav.w4os-profile-tabs > ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25em 1.25em; padding: 0; margin: 1.5em 0 1em; border-bottom: 1px solid color-mix(in srgb, currentColor 20%, transparent); }
.w4os-profile-tabs li { margin: 0; }
.w4os-profile-tabs a { display: block; padding: .4em 0; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.w4os-profile-tabs a[aria-current="page"] { border-bottom-color: currentColor; font-weight: 600; }
/* One under the other, the whole width; beside their list where there is one (the helpers' block) */
.profile-items { display: grid; gap: 1rem; align-items: start; }
.profile-items:has(> .profile-items-list) { grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr); }
.profile-items-list, .profile-items-list li { list-style: none; margin: 0; padding: 0; }
.profile-items-list a[aria-current="true"] { font-weight: 600; }
/* Each its picture beside its text, its text the whole width without one */
.profile-item { display: grid; grid-template-columns: minmax(8rem, 16rem) minmax(0, 1fr); gap: 1rem; margin-bottom: 1rem; }
.profile-item > .profile-item-text:first-child { grid-column: 1 / -1; }
.profile-item-picture { display: block; width: auto; height: auto; max-width: 100%; max-height: 16rem; object-fit: contain; border-radius: .4rem; }
.profile-item h3 { margin-top: 0; }
.profile-item-label { font-weight: 600; }
@media (max-width: 40rem) { .profile-items, .profile-item { grid-template-columns: 1fr; } }
/* Its stream as a timeline: the date in a margin on the left, small and muted, the message on the right, its actions (a site's) at
   its end; spacing alone between the posts. Where its block is narrow (a viewer's panel, a phone), the date above its message */
.profile-post { display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; gap: .1rem 1rem; align-items: baseline; margin: 0 0 1.25rem; }
.profile-post-date { font-size: .8em; line-height: 1.3; opacity: .6; text-align: right; }
.profile-post-text { margin: 0; overflow-wrap: anywhere; }
@container (max-width: 34rem) {
    .profile-post { grid-template-columns: minmax(0, 1fr) auto; }
    .profile-post-date { grid-column: 1 / -1; text-align: left; }
}

/* The report of the diagnostics (HealthReport): the lines of a cell, a mark beside a name, what says more, the lines of a file */
.w4os-health-secondary { font-size: .8125rem; opacity: .75; overflow-wrap: anywhere; }
.w4os-health-tag { display: inline-block; padding: 0 .375rem; border-radius: .25rem; background: color-mix(in srgb, currentColor 10%, transparent); font-size: .75rem; }
.w4os-health-code { margin: 0; font-size: .8125rem; white-space: pre-wrap; }
/* A usage (IndicatorView): a meter, what it uses under it */
.w4os-usage { display: block; min-width: 6rem; }
.w4os-usage meter { display: block; width: 100%; height: .5rem; }
.w4os-usage-text { display: block; font-size: .75rem; opacity: .75; }

/* An item of a line after another one (w4os-dot): the dot before it is the style's, so the markup reads without it and a screen
   reader does not say it */
.w4os-dot::before { content: "· "; content: "· " / ""; }
