/* Atelier : la composition du Répertoire actuel (repertoire.php), avec la recherche dans le panneau. */

:root {
  --dore: #e0d3a4;
  --dore-fonce: #b9a66a;
  --rouge: #c00000;
  --rouge-libelle: #aa2c1d;
  --ardoise: #59656f;
  --encre: #1d1b16;
  --etroit: "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
}

body {
  margin: 0;
  background: var(--dore);
  color: var(--encre);
  font: 17px/1.45 "EB Garamond", Garamond, Georgia, serif;
}

a {
  color: var(--rouge-libelle);
}

/* En-tête : titre centré, filet noir, ligne d'index */

header {
  display: block;
  padding: 1.5em 0 0;
  border: 0;
  text-align: center;
}

.titre {
  display: block;
  color: var(--rouge);
  font: 600 30pt/1.15 var(--etroit);
  text-decoration: none;
}

.titre span {
  display: block;
  margin-top: 4px;
  color: var(--rouge);
  font-size: 20pt;
}

header nav {
  margin-top: 1.1em;
  padding: .6em 1em;
  border-top: 3px solid #000;
  border-bottom: 1px solid #333;
  font: 600 10pt var(--etroit);
  letter-spacing: .5pt;
}

header nav a {
  margin: 0;
  color: #000;
  text-decoration: none;
}

header nav a::before {
  content: "◼";
  margin: 0 .5em 0 .8em;
  color: var(--rouge-libelle);
}

header nav a:hover {
  color: var(--rouge-libelle);
}

header form {
  margin: .8em 0 0;
}

header input[type=search] {
  width: 230px;
  border: 2px solid #000;
  background: #fff;
  font: 11pt var(--etroit);
}

main {
  max-width: 1024px;
  margin: 0 auto;
  padding: 60px 1em 2em;
}

/* Les deux boîtes : le panneau a au moins la hauteur de la gravure, qui garde sa taille */

#accueil {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  column-gap: 30px;
  align-items: stretch;
}

#panneau {
  display: flex;
  flex-direction: column;
  border: 2px solid #000;
  background: var(--ardoise);
  color: #fff;
  font: 600 11pt/1.3 var(--etroit);
}

#panneau > * + * {
  border-top: 2px solid #000;
}

#recherche {
  padding: 10px 10px 8px;
}

.zone-titre {
  margin: 0 0 8px;
  text-align: center;
}

/* Une ligne par critère : champ, valeur, ×, toutes les cases de la même hauteur */

.critere {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 14px;
  gap: 4px;
  align-items: center;
  margin: 0 0 6px;
}

#panneau input, #panneau select, #panneau button[id] {
  box-sizing: border-box;
  height: 24px;
  min-width: 0;
  margin: 0;
  padding: 0 4px;
  border: 2px solid #000;
  border-radius: 0;
  background-color: #fff;
  color: #000;
  font: 500 10.5pt/20px var(--etroit);
  -webkit-appearance: none;
  appearance: none;
}

#panneau select {
  padding-right: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0h8L4 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}

.critere .champ, .critere .valeur {
  width: 100%;
}

.critere:first-child .valeur {
  grid-column: 2 / -1;
}

.critere .retirer {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 14pt;
  line-height: 1;
  cursor: pointer;
}

.annee {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 3px;
  align-items: center;
}

#panneau .annee input {
  padding: 0 3px;
  text-align: center;
}

#panneau input {
  line-height: 1;
}

#panneau input::-webkit-search-cancel-button {
  display: none;
}

/* Une action secondaire en lien sous les lignes ; le seul bouton, Rechercher, sous le bord gauche des champs */

.outils {
  justify-content: center;
  margin: 0 0 10px;
}

#panneau #ajouter {
  display: inline;
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: 500 10pt var(--etroit);
  cursor: pointer;
}

#panneau #ajouter:hover {
  text-decoration: underline;
}

.lancer {
  margin: 0 0 2px;
  text-align: center;
}

#panneau #lancer {
  display: block;
  margin: 0 auto;
  padding: 0 14px;
  color: var(--rouge);
  font-weight: 600;
  cursor: pointer;
}

.zone {
  padding: 10px;
  text-align: center;
}

.infos p {
  margin: 0 0 2px;
}

.infos a {
  color: #fff;
  text-decoration: none;
}

.logo {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
}

.logo img {
  display: block;
}

#droite {
  align-self: start;
  min-width: 0;
}

.gravure {
  margin: 0;
}

.gravure img {
  display: block;
  width: 100%;
  height: auto;
}

body:not(.avec-resultats) #mesures,
body:not(.avec-resultats) #resultats {
  display: none;
}

/* Pendant une recherche : le panneau reste à gauche, les résultats remplacent la gravure */

.avec-resultats #accueil {
  align-items: start;
}

.avec-resultats #panneau {
  position: sticky;
  top: 1em;
}

/* Dans les notices, seuls les exemplaires numérisés et les pages de titre sont des liens, sans soulignement */

.copies a {
  text-decoration: none;
}

.copies a:hover {
  color: var(--rouge);
}

/* Résultats : une notice abrégée par édition, regroupées par année ; la transcription se déplie */

#mesures {
  margin: 0 0 .2em;
  color: #8a7c52;
  font: 9pt var(--etroit);
  text-align: right;
}

.compte {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  padding-bottom: .35em;
  border-bottom: 2px solid #000;
  font: 600 11pt var(--etroit);
  text-align: left;
}

.compte label {
  display: flex;
  gap: 6px;
  align-items: center;
  font-weight: 500;
  font-size: 10pt;
}

#tri {
  box-sizing: border-box;
  height: 24px;
  padding: 0 18px 0 4px;
  border: 2px solid #000;
  border-radius: 0;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0h8L4 5z'/%3E%3C/svg%3E") no-repeat right 5px center;
  color: #000;
  font: 500 10.5pt var(--etroit);
  -webkit-appearance: none;
  appearance: none;
}

.annee-notice {
  margin: 1.3em 0 .3em;
  padding: 0;
  border: 0;
  color: #000;
  font: 600 11pt var(--etroit);
  font-style: normal;
  letter-spacing: 1pt;
  text-align: center;
}

/* Les feuilles de lierre de la page d'accueil d'Othonè : caractères ☙ et ❧, dessinés par Menlo */

.annee-notice::before, .annee-notice::after {
  margin: 0 .5em;
  color: var(--rouge-libelle);
  font: 400 1.15em/1 Menlo, "Segoe UI Symbol", "DejaVu Sans", sans-serif;
}

.annee-notice::before {
  content: "☙";
}

.annee-notice::after {
  content: "❧";
}

#resultats details {
  margin: 0;
  padding: .4em 0;
  border: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 3.4em;
}

summary.notice {
  display: grid;
  grid-template-columns: 2.6em minmax(0, 1fr);
  column-gap: .7em;
  cursor: pointer;
}

#resultats summary.notice::after {
  content: none;
}

summary.notice .num {
  grid-row: 1 / span 2;
  min-width: 0;
  margin: 0;
  padding-top: .2em;
  text-decoration: none;
}

.num {
  color: var(--rouge-libelle);
  font: 600 10pt var(--etroit);
}

.titre-notice {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}

.titre-notice.originale {
  font-weight: 600;
}

.meta {
  margin-top: .1em;
  color: #5f5536;
  font: 500 10pt/1.35 var(--etroit);
}

.meta::after {
  content: " ▾";
  color: var(--dore-fonce);
}

details[open] > summary .meta::after {
  content: " ▴";
}

.cercle {
  color: var(--rouge-libelle);
}

summary.notice:hover .titre-notice {
  color: var(--rouge-libelle);
}

#resultats details[open] {
  padding-bottom: .8em;
}

#resultats details[open] > :not(summary) {
  margin-left: 3.3em;
}

/* Déplié : la transcription complète remplace le titre court et sa ligne ; repliée, la notice revient */

.complet {
  display: none;
  grid-column: 2;
  line-height: 1.45;
}

#resultats details[open].complete .titre-notice,
#resultats details[open].complete .meta {
  display: none;
}

#resultats details[open].complete .complet {
  display: block;
}

#resultats details[open] > dl,
#resultats details[open] > h3,
#resultats details[open] > .copies {
  font-size: .92em;
}

#resultats details[open] > dl {
  margin-top: .5em;
}

article {
  border-color: var(--dore-fonce);
}

dl, h3, .copies {
  margin-left: 2.8em;
}

dl {
  align-items: baseline;
}

dt {
  color: var(--rouge-libelle);
  font: 600 10pt/1.6 var(--etroit);
}

h3 {
  font: italic 10pt var(--etroit);
}

.index li:target {
  background: #f1e6bd;
}

footer {
  max-width: 1024px;
  margin: 0 auto;
  border-top: 1px solid #333;
  color: var(--encre);
  font: 10pt var(--etroit);
}

body:has(#accueil) footer {
  display: none;
}

/* Téléphone : les boîtes l'une sous l'autre */

@media (max-width: 760px) {
  .titre {
    font-size: 21pt;
  }

  .titre span {
    font-size: 15pt;
  }

  main {
    padding-top: 1.5em;
  }

  #accueil {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 1.2em;
  }

  .avec-resultats #panneau {
    position: static;
  }

  .gravure img {
    height: auto;
  }
}
