/* The navigation and footer follow the same gutters as the homepage. */
html[lang][data-material][data-edition] body.studio-shell > header {
  padding: 0;
  border: 0;
}

body.studio-shell .skip:not(:focus) {
  clip-path: inset(50%);
}

html[lang][data-material][data-edition] body.studio-shell .masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "mark languages materials";
  align-items: center;
  gap: 8px clamp(16px, 2.8vw, 44px);
  width: 100%;
  max-width: none;
  padding: 9px var(--studio-gutter);
  border-bottom: 1px solid color-mix(in srgb, currentColor 21%, transparent);
}

html[lang][data-material][data-edition] body.studio-shell .masthead .wordmark {
  grid-area: mark;
  width: fit-content;
  max-width: 100%;
}

html[lang][data-material][data-edition] body.studio-shell .masthead .wordmark img[data-mode-asset=mark] {
  width: clamp(158px, 24vw, 290px);
  height: auto;
  max-width: 100%;
  padding: 0;
  border: 0;
}

html[lang][data-material][data-edition] body.studio-shell .masthead .languages {
  grid-area: languages;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
}

html[lang][data-material][data-edition] body.studio-shell .masthead .material-selector {
  grid-area: materials;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  width: auto;
  margin: 0;
}

html[lang][data-material][data-edition] body.studio-shell .masthead :is(.wordmark, button, .lang-link) {
  min-inline-size: 44px;
  min-block-size: 44px;
}

html[lang][data-material][data-edition] body.studio-shell .masthead :is(.lang-link, .material-selector button, #menu-toggle) {
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: clamp(12px, 1.1vw, 15px);
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}

html[lang][data-material][data-edition] body.studio-shell .masthead :is(.lang-link[aria-current=page], .material-selector button[aria-pressed=true], #menu-toggle[aria-expanded=true]) {
  box-shadow: inset 0 0 0 1px currentColor; border-radius: 3px;
  font-weight: 650;
}

html[lang][data-material][data-edition] body.studio-shell .masthead #menu-toggle {
  grid-area: menu;
  justify-self: end;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
}

html[lang][data-material][data-edition] body.studio-shell .masthead :is(.wordmark, button, .lang-link):focus-visible,
html[lang][data-material][data-edition] body.studio-shell #site-nav a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

html[lang][data-material][data-edition] body.studio-shell #site-nav {
  padding-inline: var(--studio-gutter);
}

html[lang][data-material][data-edition] body.studio-shell #site-nav a {
  min-block-size: 44px;
  text-decoration: none;
}

html[lang][data-material][data-edition] body.studio-shell #site-nav a .nav-label {
  text-decoration: none !important;
  white-space: normal;
}

html[lang][data-material][data-edition] body.studio-shell #site-nav a[aria-current=page] {
  box-shadow: none !important; background-color: color-mix(in srgb, currentColor 13%, transparent) !important; border-radius: 3px;
}

@media (min-width: 901px) {
  html[lang][data-material][data-edition] body.studio-shell #site-nav {
    padding-block: 2px;
    align-items: stretch;
  }

  html[lang][data-material][data-edition] body.studio-shell #site-nav a {
    gap: 0;
    min-block-size: 74px;
  }

  html[lang][data-material][data-edition] body.studio-shell #site-nav a .nav-motif {
    width: 74px;
    height: 47px;
  }
}

@media (max-width: 900px) {
  html[lang][data-material][data-edition] body.studio-shell .masthead {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "mark languages" "materials menu";
    row-gap: 2px;
    padding-block: 5px;
  }

  html[lang][data-material][data-edition] body.studio-shell .masthead .wordmark img[data-mode-asset=mark] {
    width: min(100%, 218px) !important;
  }

  html[lang][data-material][data-edition] body.studio-shell .masthead .material-selector {
    justify-self: start;
  }

  html[lang][data-material][data-edition] body.studio-shell .masthead #menu-toggle {
    display: inline-flex;
  }

  html[lang][data-material][data-edition] body.studio-shell #site-nav a {
    min-block-size: 60px;
    align-items: center;
  }

  html[lang][data-material][data-edition] body.studio-shell #site-nav a .nav-label {
    align-self: center;
  }

  html[lang][data-material][data-edition] body.studio-shell #site-nav a[aria-current=page] {
    box-shadow: inset 0 0 0 1px currentColor !important;
  }
}

/* Each directory column opens with an object at a different scale from its neighbours. */
.studio-index .directory-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 24px clamp(22px, 4vw, 64px);
}

.studio-index .directory-group {
  min-width: 0;
}

.studio-index .directory-heading {
  margin: 0;
  padding-block: 10px;
  border-block-start: 1px solid var(--fine-rule);
  font: 600 14px/1.4 var(--ui);
}

.studio-index .directory-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.studio-index .directory-links > li + li {
  border-block-start: 1px solid var(--fine-rule);
}

html[lang][data-material][data-edition] body[data-page=index] #main .studio-index .directory-entry {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(7px, 1vw, 14px);
  min-block-size: 72px;
  padding: 8px 5px;
  text-decoration: none;
}

.studio-index .directory-entry:has([data-motif=nav-search]) {
  --motif-width: 96px;
  --motif-wide: 126px;
}
.studio-index .directory-entry:has([data-motif=nav-consultation]) {
  --motif-width: 86px;
  --motif-wide: 112px;
}
.studio-index .directory-entry:has([data-motif=nav-authors]) {
  --motif-width: 102px;
  --motif-wide: 134px;
}
.studio-index .directory-entry:has([data-motif=nav-glasses]) { --motif-width: 82px; }
.studio-index .directory-entry:has([data-motif=nav-notes]) { --motif-width: 76px; }
.studio-index .directory-entry:has([data-motif=nav-home]) { --motif-width: 64px; }
.studio-index .directory-entry:has([data-motif=nav-works]) { --motif-width: 62px; }

html[lang][data-material][data-edition] body[data-page=index] #main .studio-index .directory-entry .archive-motif {
  width: var(--motif-width, 70px);
  max-width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  overflow: visible;
}

html[lang][data-material][data-edition] body[data-page=index] .studio-index .directory-entry .archive-title {
  font: 550 clamp(16px, 1.33vw, 20px)/1.45 var(--ui) !important;
  text-decoration: none !important;
}

.studio-index .directory-entry .directory-arrow {
  line-height: 1.4;
}

.studio-index .directory-entry:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

@media (min-width: 761px) {
  html[lang][data-material][data-edition] body[data-page=index] #main .studio-index .directory-links > li:first-child .directory-entry {
    --motif-width: var(--motif-wide);
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 84px minmax(30px, auto);
    min-block-size: 128px;
    align-items: end;
  }

  .studio-index .directory-links > li:first-child .archive-motif {
    grid-column: 1 / -1 !important;
    align-self: center;
  }
}

@media (max-width: 760px) {
  .studio-index .directory-groups {
    grid-template-columns: minmax(0, 1fr);
  }

  html[lang][data-material][data-edition] body[data-page=index] #main .studio-index .directory-entry {
    grid-template-columns: 102px minmax(0, 1fr) auto;
    min-block-size: 58px;
  }

  html[lang][data-material][data-edition] body[data-page=index] #main .studio-index .directory-links > li:first-child .directory-entry {
    min-block-size: 72px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .studio-index .directory-entry :is(.archive-motif, .directory-arrow),
  body.studio-shell #site-nav .nav-motif {
    transition: transform 160ms ease-out;
  }

  .studio-index .directory-entry:focus-visible .archive-motif,
  body.studio-shell #site-nav a:focus-visible .nav-motif {
    transform: translateY(-3px);
  }

  .studio-index .directory-entry:focus-visible .directory-arrow {
    transform: translate(2px, -2px);
  }

  @media (hover: hover) {
    .studio-index .directory-entry:hover .archive-motif,
    body.studio-shell #site-nav a:hover .nav-motif {
      transform: translateY(-3px);
    }

    .studio-index .directory-entry:hover .directory-arrow {
      transform: translate(2px, -2px);
    }
  }
}

html[lang][data-material][data-edition] body.studio-shell > .home-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px clamp(14px, 2vw, 32px);
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(15px, 2.5vw, 34px) var(--studio-gutter);
  color: var(--art-header-ink) !important;
  background: var(--art-masthead-ground) var(--art-masthead-grain) repeat center / 150px 61px !important;
  background-blend-mode: var(--art-grain-blend);
  font: 500 14px/1.5 var(--ui);
}

.home-footer .footer-identity {
  display: grid;
  gap: 3px;
}

.home-footer .footer-identity small {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .12em;
}

.home-footer > nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 clamp(12px, 1.6vw, 24px);
  margin: 0;
}

.home-footer > nav a {
  display: inline-flex;
  align-items: center;
  column-gap: 4px;
  min-inline-size: 44px;
  min-block-size: 44px;
}

.home-footer .palette-panel {
  color: inherit;
  background: transparent;
  border: 0;
}

.home-footer .palette-panel[open] {
  grid-column: 1 / -1;
  border-block-start: 1px solid color-mix(in srgb, currentColor 32%, transparent);
}

.home-footer .palette-panel > summary {
  width: fit-content;
  min-block-size: 44px;
  margin: 0;
  padding: 11px 4px;
}

html[lang][data-material][data-edition] body.studio-shell .home-footer .edition-toolbar {
  justify-content: flex-start;
  margin: 0;
  padding: 4px 0;
  border: 0;
  color: inherit;
  background: transparent;
}

html[lang][data-material][data-edition] body.studio-shell .home-footer .edition-toolbar :is(label, a, select) {
  min-block-size: 44px;
}

html[lang][data-material][data-edition] body.studio-shell .home-footer .edition-toolbar .edition-compact select {
  color: var(--ed-ink) !important;
  background: var(--ed-paper) !important;
}

.home-footer :is(a, summary, select):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

@media (max-width: 1040px) {
  html[lang][data-material][data-edition] body.studio-shell > .home-footer {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .home-footer .palette-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 690px) {
  html[lang][data-material][data-edition] body.studio-shell > .home-footer {
    grid-template-columns: minmax(0, 1fr);
  }
}
