/* The w4os site: small touches over Quark2 */

/* Quark2 made lighter: the headings in its text face (Inter, a variable font: every weight) rather than its display face (Cal Sans,
   one heavy weight), on a smaller scale, a little less space around them; the first two light (--w4os-heading-weight:
   400 for a normal weight), the others semibold; what Quark2 and Pico make bold, semibold; the text at its regular weight */
:root { --pico-font-family-display: var(--pico-font-family-sans-serif); --pico-font-weight: 400; --w4os-heading-weight: 300; }
h1, h2, h3, h4, h5, .display, .h-display { letter-spacing: -0.01em; margin-bottom: 0.35em; }
h1, h2, .display, .h-display { font-weight: var(--w4os-heading-weight); }
h3, h4, h5, h6 { font-weight: 600; }
h1, h2, h3, h4, h5, h6 { --pico-font-weight: 600; }
b, strong, th, table th, .title-h1h2 h1 + h2 { font-weight: 600; }
h1 { font-size: clamp(1.75rem, 2vw + 1rem, 2.375rem); line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.375rem, 1.25vw + 0.85rem, 1.75rem); }
h3 { font-size: clamp(1.15rem, 0.75vw + 0.8rem, 1.3rem); }
h4 { font-size: 1.0625rem; }
h5 { font-size: 1rem; }
:is(p, ul, ol, dl, blockquote, pre, table, figure, hr, iframe, .card) + :is(h1, h2) { margin-top: 1.35em; }
:is(p, ul, ol, dl, blockquote, pre, table, figure, hr, iframe, .card) + :is(h3, h4, h5, h6) { margin-top: 1.2em; }
/* A page as a page, not as Quark2's card on its canvas: cards kept for what stands out in it (the tables of the blocks on the same
   background as the page around them) */
#body-wrapper > .container > .content-item,
:root[data-theme="dark"] #body-wrapper > .container > .content-item { background: none; box-shadow: none; border-radius: 0; }

/* The colors of the w4os logo: its green first, its orange second. Filled accents keep the logo's green with black text, as the
   logo has it; links are that green on a dark page, a darker shade of it on a light one (the logo's green on white is too pale
   to read); the orange marks what is pointed or focused. */
:root { --w4os-primary: #61c909; --w4os-secondary: #ff7f00; }
:root:root, :root:root[data-theme="light"] {
    --q2-accent: var(--w4os-primary);
    --q2-accent-contrast: #000000;
    --q2-link: #3a7a05;
    --q2-link-hover: #b35600;
    --q2-focus-ring: color-mix(in oklab, var(--w4os-secondary) 60%, transparent);
}
:root:root[data-theme="dark"] {
    --q2-accent: var(--w4os-primary);
    --q2-accent-contrast: #000000;
    --q2-link: var(--w4os-primary);
    --q2-link-hover: var(--w4os-secondary);
    --q2-focus-ring: color-mix(in oklab, var(--w4os-secondary) 60%, transparent);
}
a:hover { color: var(--q2-link-hover); }
/* The Connect block of the w4os plugin: the number of the step to do now readable on the accent it is filled with */
.w4os-start-step.is-next::before { color: var(--q2-accent-contrast); }
.navbar-brand { display: inline-flex; align-items: center; gap: .5rem; }
/* The logo of the top bar never distorted (its ratio from its file: --w4os-logo-ratio): at most 28 px high, the first to give room
   to the menus (its column of the top bar), whole and smaller down to 20 px high, then the site's icon in its place (--w4os-logo-icon) */
body.w4os-logo-fit #header .navbar-section.logo { width: calc(28px * var(--w4os-logo-ratio)); max-width: 100%; min-width: 28px; }
body.w4os-logo-fit #header .navbar-brand { display: flex; width: 100%; height: 28px; gap: 0; }
body.w4os-logo-fit #header .navbar-brand img { flex: none; min-width: 0; max-width: none; width: clamp(0px, (100% - 20px * var(--w4os-logo-ratio)) * 999, 100%); height: auto; }
/* Without a logo of the site, its name as the logo (templates/partials/logo.html.twig), in the theme's title font: whole, cut short
   when the menus need the room, the site's icon in its place below 6rem (the top bar in three columns); never wider than a phone's */
.w4os-brand-name { font-family: var(--pico-font-family-display, inherit); font-size: 1.25rem; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--q2-text-strong, inherit); }
body.w4os-logo-text #header .w4os-brand-name { max-width: calc(100vw - 7rem); }
@media (min-width: 861px) {
    body.w4os-logo-text #header .navbar-section.logo { min-width: 28px; }
    body.w4os-logo-text #header .navbar-brand { display: flex; width: 100%; min-width: 0; gap: 0; }
    body.w4os-logo-text #header .w4os-brand-name { max-width: clamp(0px, (100% - 6rem) * 999, 100%); }
    body.w4os-logo-text #header .navbar-brand::before { content: ""; flex: none; width: clamp(0px, (6rem - 100%) * 999, 28px); height: 28px; background: var(--w4os-logo-icon, none) center / contain no-repeat; }
}
body.w4os-logo-fit #header .navbar-brand::before { content: ""; flex: none; width: clamp(0px, (20px * var(--w4os-logo-ratio) - 100%) * 999, 28px); height: 28px; background: var(--w4os-logo-icon) center / contain no-repeat; }
.w4os-credits { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .25rem .6rem; }
.w4os-credits > span:first-child { opacity: .75; }
.w4os-credits a { display: inline-flex; align-items: center; gap: .35rem; }
.w4os-credit-logo { height: 1.5rem; width: auto; }
.w4os-credit-icon { height: 1.1rem; width: auto; }

/* The main menu centered, the tools of the visitor on the right; the logo's side the first to give room */
@media (min-width: 861px) {
    #header .navbar { display: grid; grid-template-columns: minmax(28px, 1fr) auto minmax(max-content, 1fr); }
    #header .navbar-section.desktop-menu { justify-content: center; }
    #header .navbar-section.actions { justify-self: end; margin-left: 0; }
}
/* From 861 to 1199 px, the menus of the visitor (admin, avatar) as their icons alone, their names still read out; the search and the
   languages beside them as they are, all closer together */
@media (min-width: 861px) and (max-width: 1199.98px) {
    #header .navbar .navbar-section.actions, #header .navbar .w4os-visitor-menus { gap: .5rem; }
    #header .navbar-section.actions .w4os-user-current { font-size: 0; gap: 0; padding: .4rem; }
    #header .navbar-section.actions .w4os-user-current i { font-size: 1rem; }
}
.login-status-wrapper { display: none; }
.w4os-toggle-label { margin-left: .5rem; }
/* The search of the grid as an icon among the tools of the top bar (search_link: icon), with its name in the menu of a phone */
.w4os-search-icon { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-width: 36px; height: 36px; border-radius: var(--q2-radius-pill); color: var(--q2-text-strong); text-decoration: none; }
.w4os-search-icon:hover, .w4os-search-icon.active { background: var(--q2-bg-muted); color: var(--q2-text-strong); }
.w4os-search-icon.is-labeled { display: flex; justify-content: flex-start; width: max-content; height: auto; margin-bottom: 1rem; }
.w4os-visitor-menus { display: inline-flex; align-items: center; gap: 1rem; }
.w4os-visitor-menus.w4os-menus-open { display: block; margin-bottom: 1rem; }
.overlay .oli-langswitcher { margin-bottom: 1rem; }
@media (max-width: 860px) { .navbar-section.actions .w4os-visitor-menus { display: none; } }
.navbar-section.actions .oli-langswitcher { margin: 0; }

/* The login form: the placeholders show, the labels stay for screen readers */
#grav-login .form-label-wrapper { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#grav-login .button-wrapper { display: flex; flex-direction: column; gap: .75rem; }
#grav-login .button-wrapper button { width: 100%; }
/* The links of the w4os plugin under the button, inside the panel of the Login plugin */
#grav-login .w4os-login-links { margin: 1rem 0 0; text-align: center; }

/* The width of a page (by its template, widths of w4os.yaml; templates/partials/base.html.twig): full and sidebars as Quark2's layout-fluid, wide as wide
   as the menu bar, standard Quark2's column */
body.w4os-width-wide #body-wrapper > .container > .content-item { max-width: none; }

/* A full-width page (layout-fluid, the home page) as Quark2 1.1.22 has it, for the versions of Quark2 without it (1.1.12, Grav 1.7's) */
body.layout-fluid .container,
body.layout-fluid #body-wrapper > .container > .content-item { max-width: none; }

/* The top bar and the footer as wide on a full-width page (layout-fluid, the home page) as on the others: Quark2's container
   width, whatever the width of the content below */
body.layout-fluid #header > .container, body.layout-fluid #footer > .container { max-width: 1200px; }

/* A card with no header (the blocks of the dashboard) spaced at its top as one with a header */
.card > .card-body:first-child { padding-top: 1.25rem; }

/* The sections of a page apart by their margins, never by a line: none of Quark2's short line above each h2 */
h2::before { display: none; }
.content-item h2:not(:first-child) { margin-top: 2.75rem; }

/* The components of a page, for its text (as w4os.org has them): sections of the home page apart (generous margins above each h2
   of its main column, and above each block in it); .home-intro, a text with its picture beside it where there is room; .tool-cards and .install-cards, a list made
   cards (<div class="tool-cards" markdown="1"> around a Markdown list, an icon of the theme first in each item) */
.w4os-home-main > h2, .w4os-home-main > .block { margin-top: 3.5rem; }
.content-item { container-type: inline-size; }
.home-intro { display: grid; gap: 1.75rem; align-items: center; margin-bottom: 2rem; }
.home-intro img { width: 100%; height: auto; display: block; border-radius: .6rem; }
.home-intro p:has(img) { margin: 0; }
@container (min-width: 40rem) { .home-intro { grid-template-columns: 3fr 2fr; } }
.tool-cards ul, .install-cards ul { display: grid; gap: 1.25rem; margin: 1.75rem 0; padding: 0; list-style: none; }
.tool-cards ul { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.install-cards ul { grid-template-columns: 1fr; }
@container (min-width: 28rem) { .install-cards ul { grid-template-columns: repeat(2, 1fr); } }
@container (min-width: 60rem) { .install-cards ul { grid-template-columns: repeat(4, 1fr); } }
.tool-cards li, .install-cards li { list-style: none; margin: 0; padding: 1.1rem 1.2rem 1.25rem; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); border-radius: .7rem; transition: border-color .2s, transform .2s; }
.tool-cards li::before, .tool-cards li::marker, .install-cards li::before, .install-cards li::marker { content: none; }
.tool-cards li:hover, .install-cards li:hover { border-color: var(--q2-accent); transform: translateY(-2px); }
.tool-cards li > i, .install-cards li > i { display: block; margin-bottom: .6rem; font-size: 1.5rem; color: var(--q2-accent); }
/* The cards on the solid surface of the theme, light or dark as the page, over a picture behind the page too, never see-through; the
   steps of an install in a solid tint of the accent */
.tool-cards li, .install-cards li { background-color: var(--q2-bg-elev); }
/* The boxes of the w4os plugin (what the grid is, the steps of the Connect block, the box of the search) on the same surface; its accent
   (the step to do now, the row of a list chosen) the primary colour of the theme */
:root { --w4os-surface: var(--q2-bg-elev); --w4os-accent: var(--q2-accent); }
.install-cards li { border-top: 3px solid var(--q2-accent); background-color: color-mix(in srgb, var(--q2-accent) 10%, var(--q2-bg-elev)); }
.install-cards li a:last-child { display: inline-block; margin-top: .5rem; font-weight: 600; }

/* A backdrop behind the pages (the w4os plugin's, body.w4os-backdrop): Quark2's canvas and footer see-through, the picture behind the
   page as it is; no card around the content, the boxes of the page alone stand out */
body.w4os-backdrop #body-wrapper { background: transparent; }

/* A page edge to edge (bleed, the map: templates/partials/base.html.twig), from under the top bar: no space of Quark2's section, of its
   content or of the blocks in it */
body.w4os-width-bleed #body-wrapper { margin: 0; padding: 0; }
body.w4os-width-bleed #body-wrapper .content-item, body.w4os-width-bleed #body-wrapper .w4os-page, body.w4os-width-bleed #body-wrapper .block { margin: 0; padding: 0; max-width: none; }
/* The footer on the surface of the theme, light and dark, over a backdrop too */
#footer { background: var(--q2-bg-elev); }
