/* ==========================================================================
   Barre du haut
   ========================================================================== */
.top-bar, .top-bar ul {
  background-color: white;
}

.block-blockGroup.grid-span-2 {
  grid-column: span 1 !important;
}

.block-itemWithMetadata {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.block-itemWithMetadata .item-with-metadata,
.block-itemWithMetadata .resource.show,
.block-itemWithMetadata dl {
  width: 100% !important;
  max-width: 100% !important;
}

/* ==========================================================================
   Réorganisation de l'en-tête (Logo + Recherche en haut, Menu en dessous)
   ========================================================================== */
#content {
  border: 1px solid #eee;
}

body:not(.browse) #content {
  max-width: 73rem;
}

header {
  max-width: calc(76rem - 2rem);
  margin: auto;
}

header .top-bar {
  display: flex !important;
  flex-direction: column !important;
  width: 100%;
}

header .top-bar-left {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  padding: 10px 15px;
  border-bottom: 1px solid #e6e6e6;
}

header .site-title img {
  max-height: 75px;
  width: auto;
}

header .top-bar-right {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
}

header .search {
  order: -1; /* Remonte le bloc de recherche avant le menu */
  align-self: flex-end; /* Aligne la recherche à droite */
  margin-top: -60px; /* Remonte la recherche au niveau du logo */
  margin-bottom: 15px;
  padding-right: 15px;
}

/* Style du champ de recherche pour ressembler à l'ancien */
header .search .search-form {
  display: flex;
  gap: 5px;
}

header .search input[type="text"] {
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 6px 10px;
}

header .search .button {
  background-color: #0056b3;
  color: #ffffff;
  border-radius: 3px;
  padding: 6px 15px;
}

header .dropdown.menu {
  width: 100% !important;
  background-color: #f8f9fa;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #ccc;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
}

header .dropdown.menu > li > a {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: bold;
  color: #333;
  padding: 12px 20px;
}

header .dropdown.menu > li > a:hover {
  background-color: #e2e6ea;
}

.banner {
  margin-top: -8px !important;
  margin-bottom: 0px !important;
}

/* ==========================================================================
   Typographie inspirée de l'ancien site
   ========================================================================== */
body {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

p, dd, li {
  font-size: 14px;
  line-height: 1.4;
}

a {
  color: #336699;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Gill Sans MT', 'Gill Sans', sans-serif;
  font-weight: normal;
  color: #015581;
}

/* Titre du site, à côté du logo */
header .site-title,
header .site-title a {
  font-family: 'Gill Sans MT', 'Gill Sans', sans-serif;
  font-size: 36px;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: #336699;
}

/* Titres de section (Contenu mis en avant, Contenus ajoutés récemment…) */
h2,
h3,
.preview-header h3 {
  font-size: 24px;
  line-height: 36px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Titre de la collection à la une : casse normale */
.collection-content h3 {
  text-transform: none;
  letter-spacing: normal;
}

/* Titres des contenus dans les listes */
.resource-name, h4 {
  font-size: 17px !important;
}

/* ==========================================================================
   Pages collection / contenu
   ========================================================================== */
.item-set h2 {
  font-size: 30px;
  line-height: 36px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.item-set h3 {
  display: none;
}

.resource h2 {
  line-height: 1;
  font-size: 1.9375rem;
  text-transform: none;
  letter-spacing: normal;
}

.resource img {
  max-width: 350px;
}

.item-set dt, .item-set .resource-name {
  font-size: 16px !important;
  font-weight: normal !important;
  font-family: 'Gill Sans MT', 'Gill Sans', sans-serif !important;
  color: #015581 !important;
}

.item-set dd {
  font: 12px Helvetica, Arial, sans-serif;
  line-height: 18px;
  color: #333;
}

.item-set .description, .resource-grid .description {
  display: none;
}

/* ==========================================================================
   Carte
   ========================================================================== */
#mapping-map ~ #advanced-search {
  display: none;
}

/* ==========================================================================
   Correctifs demandés par le client – à AJOUTER à la fin du CSS du site
   (Admin > Sites > omeka-test > CSS editor). Thème : Foundation 1.5.3
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Bandeau d'en-tête : logo + « Bibliothèque numérique » moins gros
   L'image du logo fait 1412 × 129 px ; à 75 px de haut elle occupait ~820 px.
   -------------------------------------------------------------------------- */
header .top-bar-left {
  padding: 8px 15px;
}

header .site-title img {
  max-height: 46px;          /* au lieu de 75px → environ 500 px de large */
  width: auto;
  max-width: 100%;
}

/* La recherche était remontée de 60px pour s'aligner sur l'ancien logo */
@media screen and (min-width: 64em) {
  header .search {
    margin-top: -52px;
    margin-bottom: 8px;
  }
}

/* Mobile : logo encore plus discret */
@media screen and (max-width: 39.99875em) {
  header .site-title img {
    max-height: 32px;
  }
}


/* --------------------------------------------------------------------------
   2. Page d'accueil : suppression des grandes zones grises
   Le gris (#EEEEEE) est saisi en style inline sur les blocs de la page
   d'accueil, d'où le !important. (Idéalement, retirer aussi la couleur de fond
   dans l'éditeur de page : bloc « Contenu mis en avant » et bloc HTML.)
   -------------------------------------------------------------------------- */
.welcome .block.has-background {
  background-color: transparent !important;
  padding: 0 !important;
}

.welcome .featured {
  background-color: #fff !important;
}


/* --------------------------------------------------------------------------
   3. Résultats de la recherche globale : mêmes grandes vignettes que /item
   Le thème affiche index/search en 2 colonnes CSS avec des vignettes de
   3,2rem de haut. On passe en grille de vignettes comme la liste des contenus.
   -------------------------------------------------------------------------- */
.index.search .results ul {
  columns: auto;
  -webkit-columns: auto;
  -moz-columns: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem 1.5rem;
  margin: 1rem 0 0;
}

@media screen and (max-width: 63.99875em) {
  .index.search .results ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 39.99875em) {
  .index.search .results ul {
    grid-template-columns: 1fr;
  }
}

.index.search .results > ul > li {
  width: auto;
  display: block;
  padding: 0;
  border-bottom: 0;
  break-inside: avoid;
}

.index.search .results .resource-link {
  display: block;
}

.index.search .results .resource-link img {
  display: inline-block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 200px;
  margin: 0 0 1rem 0;
  border: 4px solid #fefefe;
  box-shadow: 0 0 0 1px rgba(10, 10, 10, .2);
}

.index.search .results .resource-name {
  display: block;
  font-family: 'Gill Sans MT', 'Gill Sans', sans-serif;
  color: #015581;
  line-height: 1.3;
}

.index.search .results ul + a {
  margin-top: 1.5rem;
}


/* --------------------------------------------------------------------------
   4. Bannière photo tronquée (ex. pages collection)
   Le thème force une hauteur de 200px en background-size: cover ; l'image
   (1024 × 138 px) est donc agrandie et rognée. On affiche l'image entière.
   -------------------------------------------------------------------------- */
.banner,
body.dropdown-menu .banner.contained {
  height: auto !important;
  background-image: none !important;
  overflow: hidden;
}

.banner img {
  visibility: visible !important;
  display: block;
  width: 100%;
  height: auto;
}

.banner img {
  max-width: 100% !important;
}