/*
Theme Name: Labyrinthes, Misfits
Template: labyrinthes
Description: Thème enfant de misfits.labyrinthes.net. Fond de nuit, la couverture comme page, titres en bas de casse. Le titrage en Alegreya attend la police des couvertures.
Version: 1.0.0
Requires at least: 7.0
Requires PHP: 8.3
Text Domain: labyrinthes
License: Proprietary
*/

/* Misfits keeps the largest spacing between header, content and footer. */
:root {
  color-scheme: dark;
  /* The parent's two rule levels on the night: bone at 30 and 15 %. */
  --lab-trait-fort: rgb(244 241 234 / 0.3);
  --lab-trait-doux: rgb(244 241 234 / 0.15);
  --lab-respiration: var(--wp--preset--spacing--60);
  --lab-respiration-haut: 1.5rem;
}

/* En-tête collant, sans filet. Le collant porte sur la partie de modèle qui l'enveloppe. */

.wp-site-blocks > .wp-block-template-part:has(> .lab-misfits-entete) {
  position: sticky;
  top: 0;
  z-index: 20;
}

.admin-bar .wp-site-blocks > .wp-block-template-part:has(> .lab-misfits-entete) {
  top: var(--wp-admin--admin-bar--height, 0);
}

/* Les affiches et le pied commencent sous l'en-tête, sans l'espace entre blocs. */
.wp-site-blocks > * + * {
  margin-block-start: 0;
}

.lab-misfits-entete {
  gap: 1rem;
  min-height: var(--lab-entete-hauteur);
  padding: 0 var(--wp--custom--gouttiere);
  background: rgb(11 11 11 / 0.92);
  border-bottom: 0;
}

.lab-misfits-marque {
  margin: 0;
  font-family: var(--wp--preset--font-family--texte);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.lab-misfits-marque a {
  text-decoration: none;
}

.lab-misfits-entete .wp-block-navigation-item__content {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
}

/* Sections de l'accueil : à paraître, nouveautés, catalogue */

.lab-misfits-accueil .lab-accrochage {
  padding-block-start: 0;
}

.lab-misfits-accueil :is(.lab-section-titre, .is-style-section) {
  padding: 1.25rem var(--wp--custom--gouttiere) 1rem;
  border-top: 1px solid var(--lab-trait-fort);
  font-size: 0.875rem;
}

.lab-accrochage--affiche .lab-accrochage__liste,
.lab-accrochage--liste .lab-accrochage__liste {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* L'affiche : un livre, un écran */

.lab-affiche {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr auto;
  min-height: calc(100svh - var(--lab-entete-hauteur));
  padding: clamp(1.5rem, 3vw, 2.5rem) var(--wp--custom--gouttiere) 0;
  overflow: hidden;
  isolation: isolate;
}

.lab-affiche__fond {
  position: absolute;
  inset: -10%;
  z-index: -2;
  width: 120%;
  max-width: none;
  height: 120%;
  object-fit: cover;
  filter: blur(48px) saturate(1.2);
}

.lab-affiche::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* Dark enough for 4.5:1 with bone text even over a white cover: 0.6 at least. */
  background: linear-gradient(180deg, rgb(11 11 11 / 0.6), rgb(11 11 11 / 0.8));
}

.lab-affiche__auteurs {
  grid-column: 1 / span 5;
  grid-row: 1;
  margin: 0;
  font-family: var(--wp--preset--font-family--texte);
  font-size: clamp(2rem, 4.5vw, 4rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: lowercase;
}

.lab-affiche__auteur {
  display: block;
}

.lab-affiche__auteur + .lab-affiche__auteur {
  margin-block-start: 0.35em;
}

.lab-affiche__auteurs a {
  text-decoration: none;
}

.lab-affiche__couverture {
  grid-column: 7 / span 5;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
}

.lab-affiche__couverture img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 56svh;
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.8);
}

.lab-affiche__couverture .lab-sans-couverture {
  width: min(22rem, 40vw);
}

.lab-affiche__meta {
  grid-column: 1 / span 5;
  grid-row: 2;
  align-self: end;
  padding-bottom: 1.5rem;
}

.lab-affiche__meta .lab-statut {
  margin-bottom: 0.5rem;
}

.lab-affiche__extrait {
  max-width: 26rem;
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  text-wrap: pretty;
}

/* Over a cover, grey text cannot be guaranteed 4.5:1: the poster's small text stays bone. */
.lab-affiche .lab-accroche,
.lab-affiche__extrait {
  color: var(--wp--preset--color--encre);
}

/* Above the giant title: the box of its link rises past its tight line
   height and would cover the buttons, taking their hover and their click. */
.lab-affiche .lab-actions {
  position: relative;
  z-index: 2;
  margin-block-start: 0;
}

.lab-affiche__titre {
  grid-column: 1 / -1;
  grid-row: 3;
  position: relative;
  z-index: 1;
  margin: 0 calc(var(--wp--custom--gouttiere) * -0.4) -0.14em;
  font-family: var(--wp--preset--font-family--texte);
  font-size: clamp(4.5rem, 15vw, 15rem);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.045em;
  text-transform: lowercase;
  text-wrap: balance;
}

.lab-affiche__titre a {
  text-decoration: none;
}

/* Boutons de Misfits : plus petits, en os sur la nuit */

.lab-bouton {
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Catalogue compact */

.lab-accrochage--liste .lab-accrochage__liste {
  max-width: var(--wp--style--global--wide-size);
  margin-inline: auto;
  padding: 0 var(--wp--custom--gouttiere) clamp(3rem, 7vw, 6rem);
}

.lab-ligne {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1.5rem;
  align-items: center;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--lab-trait-doux);
}

.lab-ligne__couverture img,
.lab-ligne__couverture .lab-sans-couverture {
  display: block;
  width: 6rem;
  height: auto;
  box-shadow: 0 16px 30px -16px rgb(0 0 0 / 0.9);
}

.lab-ligne__titre,
.lab-misfits-titres .lab-piece__titre {
  margin: 0;
  font-family: var(--wp--preset--font-family--texte);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.lab-ligne__titre a {
  text-decoration: none;
}

/* Giant titles: a thicker line than the shared hover rule. */
:root .lab-ligne__titre a:hover,
:root .lab-misfits-titres .lab-piece__titre a:hover {
  text-decoration-thickness: 3px;
}

.lab-ligne__auteurs {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--wp--preset--color--gris);
}

.lab-ligne__auteurs a,
.lab-misfits-titres .lab-auteurs a {
  color: var(--wp--preset--color--encre);
  text-decoration: none;
}

/* Fiche ouvrage, sous l'affiche */

.lab-misfits-feuille {
  box-sizing: content-box;
  max-width: var(--wp--style--global--wide-size);
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 6rem) var(--wp--custom--gouttiere);
  gap: 3rem var(--wp--custom--gouttiere);
  justify-content: space-between;
}

.lab-misfits-feuille .lab-prose,
.lab-misfits-titres .lab-prose {
  margin-block-start: 0;
  font-family: var(--wp--preset--font-family--texte);
  font-size: 1.1875rem;
  line-height: 1.7;
}

.lab-misfits-feuille .lab-prose > p:first-child::first-line {
  font-weight: 700;
}

.lab-misfits-feuille__cote .lab-faits {
  margin-block-start: 1rem;
  border: 0;
  padding-block: 0 2rem;
}

.lab-misfits-fiche .lab-meme-collection {
  box-sizing: content-box;
  max-width: var(--wp--style--global--wide-size);
  margin-inline: auto;
  padding: 0 var(--wp--custom--gouttiere) clamp(3rem, 7vw, 6rem);
}

.lab-misfits-fiche .lab-etagere__titre {
  font-family: var(--wp--preset--font-family--texte);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  text-transform: lowercase;
}

.lab-misfits-fiche .lab-etagere img,
.lab-misfits-titres .lab-piece__couverture img {
  box-shadow: 0 24px 48px -20px rgb(0 0 0 / 0.9);
}

.lab-misfits-fiche .lab-etagere__auteurs {
  font-family: var(--wp--preset--font-family--titrage);
  font-size: 0.9375rem;
  font-style: normal;
}

/* Page « les titres » */

.lab-misfits-titres .lab-page__titre {
  font-size: clamp(3.5rem, 12vw, 9rem);
  line-height: 0.9;
}

.lab-misfits-chapeau {
  margin-block: 1rem 2rem;
  font-family: var(--wp--preset--font-family--titrage);
  font-size: 1rem;
  color: var(--wp--preset--color--gris);
}

.lab-misfits-chapeau a {
  color: var(--wp--preset--color--encre);
}

.lab-misfits-suite summary {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-family: var(--wp--preset--font-family--titrage);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
  list-style: none;
}

.lab-misfits-suite summary:hover {
  text-decoration-thickness: 2px;
}

.lab-misfits-suite summary::-webkit-details-marker {
  display: none;
}

.lab-misfits-suite[open] summary {
  display: none;
}

.lab-misfits-titres .lab-piece__couverture {
  grid-column: 2 / span 3;
}

.lab-misfits-titres .lab-piece:nth-child(even) .lab-piece__couverture {
  grid-column: 9 / span 3;
}

.lab-misfits-titres .lab-piece__texte {
  grid-column: 6 / span 7;
}

.lab-misfits-titres .lab-piece:nth-child(even) .lab-piece__texte {
  grid-column: 2 / span 7;
}

.lab-misfits-titres .lab-auteurs {
  margin-block-start: 0.5rem;
  font-family: var(--wp--preset--font-family--titrage);
  font-size: 0.875rem;
  font-style: normal;
  color: var(--wp--preset--color--gris);
}

/* Pied de page */

/* Footer: same three columns as the main site; its rules come from the two levels above. */
.lab-misfits-pied .lab-misfits-marque {
  font-size: 2rem;
}

/* Header: the collection's line under the wordmark. */
.lab-misfits-identite > * {
  margin: 0;
}

.lab-misfits-slogan {
  margin-block-start: 0.25rem !important;
  font-family: var(--wp--preset--font-family--titrage);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  color: var(--wp--preset--color--gris);
}

.lab-misfits-pied a {
  color: var(--wp--preset--color--encre);
}



@media (max-width: 52rem) {
  .lab-misfits-marque {
    font-size: 1.625rem;
  }

  /* The tagline runs under the wordmark and the menu button, on the full
     width: beside the button it wrapped onto two lines. The bar grows a
     little past the shared height, so the button keeps air above it. */
  .lab-misfits-entete {
    flex-wrap: wrap;
    row-gap: 0;
    align-content: center;
    padding-block: 0.5rem;
  }

  .lab-misfits-entete .lab-misfits-identite {
    display: contents;
  }

  .lab-misfits-entete .lab-misfits-marque {
    margin-inline-end: auto;
  }

  .lab-misfits-entete > .wp-block-navigation {
    order: 1;
  }

  /* Too long for one line on a phone, the tagline breaks where the sentence
     does: the collection, then its director. */
  .lab-misfits-entete .lab-misfits-slogan {
    order: 2;
    flex-basis: 100%;
    margin-block-start: 0 !important;
  }

  .lab-misfits-slogan__suite {
    display: block;
  }

  .lab-affiche {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 1.5rem;
  }

  .lab-affiche__auteurs,
  .lab-affiche__couverture,
  .lab-affiche__meta,
  .lab-affiche__titre {
    grid-column: 1;
  }

  .lab-affiche__auteurs {
    grid-row: 1;
  }

  .lab-affiche__couverture {
    grid-row: 2;
    justify-self: center;
  }

  .lab-affiche__couverture img {
    max-height: 50svh;
  }

  .lab-affiche__couverture .lab-sans-couverture {
    width: min(14rem, 60vw);
  }

  .lab-affiche__titre {
    grid-row: 3;
    margin-top: -0.55em;
    font-size: clamp(3.5rem, 20vw, 7rem);
  }

  .lab-affiche__meta {
    grid-row: 4;
    padding-bottom: 3rem;
  }

  .lab-misfits-feuille__cote {
    order: -1;
  }

  .lab-misfits-titres .lab-piece,
  .lab-misfits-titres .lab-piece:nth-child(even) {
    grid-template-columns: 7rem 1fr;
    gap: 1.25rem;
  }

  .lab-misfits-titres .lab-piece .lab-piece__couverture,
  .lab-misfits-titres .lab-piece .lab-piece__texte,
  .lab-misfits-titres .lab-piece:nth-child(even) .lab-piece__couverture,
  .lab-misfits-titres .lab-piece:nth-child(even) .lab-piece__texte {
    grid-column: auto;
    grid-row: auto;
    width: auto;
    justify-self: stretch;
  }

  .lab-misfits-titres .lab-piece__titre {
    font-size: clamp(2rem, 10vw, 3rem);
  }
}
