/*
Theme Name: Labyrinthes, la Revue
Template: labyrinthes
Description: Thème enfant de revue.labyrinthes.net. Alegreya pour les titres, Montserrat pour le texte, les crochets et le rouge des couvertures de Labyrinthe[s.
Version: 1.0.0
Requires at least: 7.0
Requires PHP: 8.3
Text Domain: labyrinthes
License: Proprietary
*/

/* The Revue keeps the largest spacing between header, content and footer. */
:root {
  --lab-respiration: var(--wp--preset--spacing--60);
  --lab-respiration-haut: 1.5rem;
}

/* Le crochet de la revue, rouge, qui ouvre numéros, titres et navigation. */

.lab-crochet,
.lab-revue-nav .wp-block-navigation-item__content::before,
:is(.lab-section-titre, .is-style-section)::before,
.lab-revue-titre-crochet::before {
  color: var(--wp--preset--color--rouge);
}

.lab-revue-nav .wp-block-navigation-item__content::before,
:is(.lab-section-titre, .is-style-section)::before,
.lab-revue-titre-crochet::before {
  content: "[";
  content: "[" / "";
}

::selection {
  background: var(--wp--preset--color--rouge);
  color: var(--wp--preset--color--papier);
}

:focus-visible {
  outline-color: var(--wp--preset--color--rouge);
}

/* Alegreya carries titles and important elements, Montserrat the text. The
   parent sets small information in its title font: here it follows the text,
   a serif reading poorly at that size. */
.lab-faits,
:is(.lab-fil, .is-style-fil),
.lab-statut,
.lab-cle,
.lab-note,
.lab-procurer__aide,
.lab-pages {
  font-family: var(--wp--preset--font-family--texte);
}

/* En-tête */

.lab-revue-entete {
  border-bottom: 1px solid var(--lab-trait-fort);
}

.lab-revue-entete__barre {
  gap: 0.5rem 2rem;
  min-height: var(--lab-entete-hauteur);
  padding-block: 0;
  align-items: center;
}

.lab-revue-marque > * {
  margin: 0;
}

.lab-revue-marque__nom {
  font-family: var(--wp--preset--font-family--marque);
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.lab-revue-marque__nom a {
  text-decoration: none;
}

.lab-revue-marque__slogan {
  margin-block-start: 0.375rem !important;
  font-size: 0.9375rem;
  color: var(--wp--preset--color--gris);
}

.lab-revue-nav .wp-block-navigation__container {
  gap: 0 1.75rem;
}

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

.lab-revue-nav .wp-block-navigation-item__content[aria-current] {
  text-decoration: underline;
}

/* Titres de section : crochet, Alegreya gras, sans capitales */

:is(.lab-section-titre, .is-style-section) {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

/* Étiquette d'un numéro */

.lab-numero {
  margin: 0;
  font-family: var(--wp--preset--font-family--marque);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

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

/* Accueil : un numéro par rangée, couverture alternée */

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

.lab-numeros__liste {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lab-numero-rangee {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
  gap: 2rem var(--wp--custom--gouttiere);
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.lab-numero-rangee + .lab-numero-rangee {
  border-top: 1px solid var(--lab-trait-doux);
}

.lab-numero-rangee__couverture {
  grid-column: 1 / span 5;
  max-width: 62svh;
}

.lab-numero-rangee__texte {
  grid-column: 7 / span 6;
}

.lab-numero-rangee:nth-child(even) .lab-numero-rangee__couverture {
  grid-column: 8 / span 5;
  grid-row: 1;
  justify-self: end;
}

.lab-numero-rangee:nth-child(even) .lab-numero-rangee__texte {
  grid-column: 1 / span 6;
  grid-row: 1;
}

.lab-numero-rangee__couverture a {
  display: block;
}

.lab-numero-rangee__couverture img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: var(--wp--custom--ombre-couverture);
}

.lab-numero-rangee__theme {
  margin: 0.75rem 0 0;
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  line-height: 1.1;
  text-wrap: balance;
}

.lab-numero-rangee__theme a {
  text-decoration: none;
}

/* The cover, a duplicate link of the title hidden from assistive technology, underlines the title on hover. */
.lab-numero-rangee:has(.lab-numero-rangee__couverture a:hover) .lab-numero-rangee__theme a {
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
}

.lab-numero-rangee__quand,
.lab-revue-quand {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  color: var(--wp--preset--color--gris);
}

/* Contributeurs entre crochets */

.lab-crochets,
.lab-auteurs.lab-crochets {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.125rem;
  margin: 1.5rem 0 0;
  font-family: var(--wp--preset--font-family--texte);
  font-size: 0.9375rem;
  font-style: normal;
  line-height: 1.9;
}

.lab-crochets a {
  white-space: nowrap;
  text-decoration: none;
}

.lab-crochets__reste {
  margin-inline-start: 0.5rem;
  color: var(--wp--preset--color--gris);
}

/* Page d'un numéro */

.lab-revue-fiche .lab-fiche__titre {
  margin-block-start: 0.75rem;
  font-size: clamp(2.25rem, 4.6vw, 3.5rem);
}

.lab-revue-fiche .lab-revue-quand:empty {
  display: none;
}

.lab-supplements,
.lab-revue-contributeurs {
  margin-block-start: 3rem;
}

.lab-supplement + .lab-supplement {
  margin-block-start: 2rem;
}

.lab-supplement__titre {
  margin: 1rem 0 0;
  font-size: 1.5rem;
}

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

.lab-supplement .lab-crochets {
  margin-block-start: 0.5rem;
}

.lab-revue-contributeurs .lab-crochets {
  margin-block-start: 1rem;
}

.lab-numeros--vignettes {
  margin-block-start: var(--wp--preset--spacing--60);
}

/* The « Suivre » accounts take the weight of the Revue's navigation links. */
.lab-pied .lab-suivre.wp-block-social-links {
  font-weight: 400;
}

.lab-revue-supplement :is(.lab-fil, .is-style-fil) {
  margin: 0;
}

.lab-revue-supplement .lab-numero {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}

.lab-revue-supplement .lab-numero span {
  font-family: var(--wp--preset--font-family--texte);
  font-weight: 400;
}

/* Tableau des contributeurs */

.lab-contributeurs__defilement {
  position: relative;
  overflow-x: auto;
  margin-block-start: 2rem;
}

.lab-contributeurs table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.lab-contributeurs thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.75rem 0.5rem;
  background: var(--wp--preset--color--papier);
  border-bottom: 1px solid var(--lab-trait-fort);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.lab-contributeurs thead th:first-child {
  padding-inline-start: 0;
  text-align: left;
}

.lab-contributeurs tbody th,
.lab-contributeurs td {
  border-bottom: 1px solid var(--lab-trait-doux);
}

.lab-contributeurs tbody th {
  padding: 0;
  font-weight: 400;
  text-align: left;
}

.lab-contributeurs tbody th a {
  display: inline-block;
  padding-block: 0.625rem;
  text-decoration: none;
}

.lab-contributeurs td {
  width: 7rem;
  text-align: center;
}

/* Column heads lead to their issue: a 44px target, underlined on hover only. */
.lab-contributeurs thead th a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  text-decoration: none;
}

/* The mark of an issue the contributor wrote for: a dot in the red of the
   brackets. */
.lab-contributeurs__point {
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--wp--preset--color--rouge);
  vertical-align: middle;
}

/* Pied de page */

.lab-revue-pied {
  margin-block-start: clamp(4rem, 10vw, 8rem);
  font-family: var(--wp--preset--font-family--texte);
  font-size: 0.875rem;
}

.lab-revue-pied .lab-pied__maison a,
.lab-revue-pied .lab-pied__bas a {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
}

.lab-revue-pied .lab-revue-marque__nom {
  font-size: 2rem;
}

@media (max-width: 52rem) {
  /* The wordmark and its tagline fit the 4.5rem header bar. */
  .lab-revue-entete .lab-revue-marque__nom {
    font-size: 1.5rem;
    margin-inline-end: auto;
  }

  /* 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-revue-entete .lab-revue-entete__barre {
    flex-wrap: wrap;
    row-gap: 0;
    align-content: center;
    padding-block: 0.5rem;
  }

  .lab-revue-entete .lab-revue-marque {
    display: contents;
  }

  .lab-revue-entete .lab-revue-nav {
    order: 1;
  }

  .lab-revue-entete .lab-revue-marque__slogan {
    order: 2;
    flex-basis: 100%;
    margin-block-start: -0.25rem !important;
    white-space: nowrap;
  }

  .lab-numero-rangee {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .lab-numero-rangee__couverture,
  .lab-numero-rangee__texte,
  .lab-numero-rangee:nth-child(even) .lab-numero-rangee__couverture,
  .lab-numero-rangee:nth-child(even) .lab-numero-rangee__texte {
    grid-column: 1;
    grid-row: auto;
  }

  /* One column: every cover is centred, as on the main site. */
  .lab-numero-rangee__couverture,
  .lab-numero-rangee:nth-child(even) .lab-numero-rangee__couverture {
    justify-self: center;
    width: min(70%, 18rem);
  }

  .lab-contributeurs table {
    font-size: 0.9375rem;
  }

  .lab-contributeurs td {
    width: 3.5rem;
  }
}

/* Titres de page et chapeaux, à la mesure de la revue */

.lab-page__titre {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
}

.lab-contributeurs :is(.lab-chapeau, .is-style-chapeau) {
  font-size: 0.9375rem;
  font-style: normal;
  color: var(--wp--preset--color--gris);
}
