/* ===== Parcourir (browse) ===== */

.ob-browse-layout{
  display:grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items:start;
}

@media (max-width: 980px){
  .ob-browse-layout{ grid-template-columns: 1fr; }
}

/* En-tête de la page Parcourir (titre + compteur) */
.ob-browse-header{
  display:flex;
  flex-direction:column;
  gap: .35rem;
  margin: 0 0 1.15rem 0;
}

/* Titre "Parcourir les cartes" : plus calme, bordeaux */
.ob-browse-header h1{
  margin:0;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: #b00000;  /* bordeaux/rouge profond */
}

/* Sur les fiches (ob-item), titre encore un peu plus discret */
.ob-item .ob-browse-header h1{
  font-size: 1.4rem;
}

/* Ligne "X objets trouvés" */
.ob-browse-meta{
  opacity:.75;
  font-size:.9rem;
}

/* Barre des contrôles de parcours (pagination / tri / recherche avancée) */
.browse-controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top:.3rem;
  font-size:.78rem;
  opacity:.75;
}

/* Lien "Recherche avancée" très discret */
.browse-controls .advanced-search{
  text-decoration:none;
  opacity:.6;
  margin-left:.5rem;
  color:#caa;
}

.browse-controls .advanced-search:hover{
  text-decoration:underline;
}

/* Menus Created / Descending / Sort plus calmes */
.browse-controls select,
.browse-controls button{
  font-size:.78rem;
  padding: .12rem .30rem;
  color:#777;
}

/* Pagination très discrète ("1 of 1", flèches, etc.) */
.pagination{
  font-size:.75rem;
  color:#999;
}

.pagination a,
.pagination span{
  padding: .1rem .2rem;
  border:none;
  background:transparent;
}

/* Sidebar */
.ob-browse-sidebar{
  position:sticky;
  top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(6px);
  max-width: 260px;
  margin-bottom: 2rem;
}

.ob-sideblock + .ob-sideblock{ margin-top: 1.25rem; }
.ob-sideblock h3{ margin: 0 0 .5rem 0; font-size: 1rem; }
.ob-sideblock ul{ list-style:none; margin:0; padding:0; }
.ob-sideblock li{ margin:.35rem 0; }

/* La grille de cartes */
.resource-list.ob-card-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 1rem 0 0 0;
  padding: 0;
}

.resource-list.ob-card-grid > li{
  list-style:none;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  overflow:hidden;
  background:#fff;
  transition: transform .12s ease, box-shadow .12s ease;
  padding-bottom: .25rem;
}

.resource-list.ob-card-grid > li:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,0,0,.10);
}

.resource-list.ob-card-grid .resource-link,
.resource-list.ob-card-grid a{
  text-decoration:none;
}

/* Miniatures dans la grille : plus grandes */
.resource-list.ob-card-grid img{
  display:block;
  width:100% !important;
  height: 340px;
  object-fit: cover;
  max-width: none !important;
}

/* Titre sous l’image */
.ob-card-title{
  padding: .85rem 1rem 1rem 1rem;
  font-size: 1rem;
  line-height: 1.2;
}

/* ===== Item (show) ===== */

/* Mise en page 3 colonnes : miniatures / grande image / actions */
.ob-item-layout{
  display:grid;
  grid-template-columns: 180px 1fr 320px;
  gap: 2rem;
  align-items:start;
}

@media (max-width: 980px){
  .ob-item-layout{ grid-template-columns: 1fr; }
  .ob-item-thumbs{ order: 2; }
  .ob-item-actions{ order: 3; }
}

/* Miniatures à gauche (recto / verso) */
.ob-item-thumbs button{
  width:100%;
  border:0;
  background:transparent;
  padding:0;
  margin: 0 0 .75rem 0;
  cursor:pointer;
}

/* Vignettes : carte entière, proportions conservées (comme Delcampe) */
.ob-item-thumbs img{
  display:block;
  max-width:120px;    /* largeur maximale de la vignette */
  width:100%;
  height:auto;        /* conserve le ratio, pas de déformation */
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.10);
}

/* Grande image au centre */
.ob-item-main{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  overflow:hidden;
  background:#fff;
}

.ob-item-main img{
  width:100%;
  height:auto;
  max-height: 700px;
  object-fit: contain;
  background:#f7f7f7;
  display:block;
}

/* Crédit de collection discret sous l’image principale */
.ob-collection-credit-inline{
  margin: .35rem 0 0;
  font-size: .80rem;
  opacity: .7;
  font-style: italic;
}

/* Colonne de droite : actions / infos */
.ob-item-actions{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  background:#fff;
}

/* Bloc Commenter (prioritaire) */
.ob-comment-block{
  margin-bottom: 1rem;
}

.ob-comment-link{
  display:inline-block;
  font-weight:700;
  font-size:1rem;
  text-decoration:none;
}

.ob-comment-link:hover{
  text-decoration:underline;
}

.ob-comment-text{
  margin:.25rem 0 0 0;
  font-size:.85rem;
  opacity:.85;
}

/* Cotation */
.ob-quote{
  margin-top: .5rem;
  font-size: .8rem;
  opacity: .8;
}

.ob-quote-label{
  font-weight: 600;
  margin-right: .25rem;
}

.ob-quote-value{
  font-style: italic;
}

/* Bloc Suivre cet objet (secondaire, plus bas) */
.ob-follow-block{
  margin-top: 1.25rem;
  font-size:.85rem;
}

.ob-follow-title{
  font-weight:600;
  margin-bottom:.1rem;
}

.ob-follow-meta{
  font-size:.78rem;
  opacity:.75;
}

/* Cotation (rareté) dans la colonne de droite */
.ob-quote{
  margin-top: .75rem;
  font-size: .8rem;
  opacity: .8;
}

.ob-quote-label{
  font-weight: 600;
  margin-right: .25rem;
}

.ob-quote-value{
  font-style: italic;
}

/* Zone des commentaires en bas de page */
.ob-item-comments{
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0,0,0,.10);
}

/* On masque le titre par défaut du module Comment, on met le nôtre */
#comments-container h2{
  display:none;
}

/* Titre local pour le bloc de commentaires */
.ob-comments-title{
  margin: 0 0 1rem 0;
  font-size: 1.3rem;
  font-weight: 600;
}
/* ===== Raffinage du bloc commentaires ===== */

.ob-item-comments{
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0,0,0,.10);
  font-size: .9rem;
}

/* Titre "Vos commentaires" rouge mais discret */
.ob-comments-title{
  margin: 0 0 .75rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #b00000;
}

/* Texte "No comment yet..." un peu plus léger */
.ob-item-comments > p{
  font-size: .85rem;
  opacity:.8;
}

/* Le formulaire entier centré sous la carte */
.ob-item-comments form{
  max-width: 960px;          /* largeur max comparable à la carte */
  margin: 1rem auto 0 auto;  /* centré */
}

/* Label "Comment" */
.ob-item-comments label{
  font-size: .9rem;
}

/* Champ de commentaire : prend toute la largeur du formulaire */
.ob-item-comments textarea{
  width: 100%;
  min-height: 7rem;
  font-size: .9rem;
}

/* Bouton : aligné à gauche du formulaire (sous le champ) */
.ob-item-comments input[type="submit"],
.ob-item-comments button[type="submit"]{
  margin-top: .6rem;
  font-size: .9rem;
  padding: .4rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.25);
  background:#ffffff;
  font-weight:600;
  font-family: inherit;
  cursor:pointer;
}

.ob-item-comments input[type="submit"]:hover,
.ob-item-comments button[type="submit"]{
  background:#f5f5f5;
}

/* Sur mobile : le formulaire prend toute la largeur */
@media (max-width:980px){
  .ob-item-comments form{
    max-width:100%;
  }
}

/* ===== Footer "Powered by Omeka S" plus discret ===== */

footer,
footer *{
  font-size: .7rem !important;
  opacity: .4 !important;
}
/* Formulaire de commentaires :
   on casse la mise en page 2 colonnes pour aligner le textarea
   sur le bord gauche de la carte. */

#comments .field-meta,
.commenting .field-meta,
.comments .field-meta{
  float: none;
  width: auto;
  margin: 0 0 .35rem 0;  /* le label juste au-dessus, petite marge en bas */
}

#comments .inputs,
.commenting .inputs,
.comments .inputs{
  float: none;
  width: 100%;
  margin-left: 0;         /* clé : plus de décalage vers la droite */
  box-sizing: border-box;
}

/* --- VIGNETTES ob-card-grid : même cadre pour vertical & horizontal (sans coupe) --- */
.resource-list.ob-card-grid > li.item.resource > a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 220px !important;   /* ajuste 200/220/240 */
  overflow: hidden !important;
  background: #fff !important;
  border-radius: 8px !important;
}

.resource-list.ob-card-grid > li.item.resource > a > img {
  max-height: 100% !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
}

/* === HIDE-HEADER-SEARCH-ON-SOLR-PAGE === */
body.search-page-recherche-solr #search,
body.search-page-recherche-solr #search-form,
body.search-page-recherche-solr .sitewide-search-form,
body.search-page-recherche-solr form[action*="/s/oblitarium/search"]{
  display: none !important;
}

/* === HIDE-HEADER-SEARCH-V2 === */
/* On masque le champ de recherche du header (zone en haut à droite) */
header form#search-form,
header #search,
header .sitewide-search-form,
header form[action*="/search"],
header form[action*="/s/"] input[type="search"],
header form[action*="/s/"] input[type="text"]{
  display:none !important;
}

/* rights caption under item */
.ob-rights-caption{
  font-size: 0.80rem;
  color: #666;
  margin-top: 8px;
}

/* OB-RIGHTS-CAPTION-START */
.ob-rights-caption{
  font-size: 0.80rem;
  color: #666;
  margin-top: 8px;
}
/* OB-RIGHTS-CAPTION-END */

/* Make the "Recherche avancée" link visible in browse toolbar */
.browse-controls a.advanced-search {
  display: inline-block;
  font-size: 0.95rem;
  color: #a00000 !important;
  opacity: 1 !important;
  font-weight: 600;
  margin-left: 14px;
  text-decoration: none;
}
.browse-controls a.advanced-search:hover {
  text-decoration: underline;
}


/* Advanced search link next to the search box */
.ob-item-search .advanced-search-top{
  display:inline-flex;
  align-items:center;
  padding:0 10px;
  border:1px solid rgba(0,0,0,.18);
  border-radius:10px;
  font-size:0.9rem;
  font-weight:600;
  color:#a00000;
  text-decoration:none;
  background:#fff;
}
.ob-item-search .advanced-search-top:hover{
  text-decoration:underline;
}


/* Make advanced search a bit more subtle */
.ob-item-search .advanced-search-top{
  font-size:0.85rem;
  font-weight:500;
  opacity:.9;
}


/* =========================================================
   Recherche avancée (Solr) — mode compact
   Cible: body.ob-search-advanced
   ========================================================= */

body.ob-search-advanced .ob-browse-header h1{
  font-size: 2rem;
  margin: 0 0 .25rem 0;
}

body.ob-search-advanced .ob-browse-meta{
  font-size: 1rem;
  opacity: .8;
}

/* Formulaire Search (Solr) : on compresse un peu */
body.ob-search-advanced #search-form-wrapper,
body.ob-search-advanced .ob-search-advanced-form{
  margin-top: .6rem;
}

/* Layout : sidebar plus étroite + gap plus petit */
body.ob-search-advanced .ob-browse-layout{
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 980px){
  body.ob-search-advanced .ob-browse-layout{
    grid-template-columns: 1fr;
  }
}

/* Sidebar facettes : texte plus petit, moins d’espacement */
body.ob-search-advanced .ob-browse-sidebar{
  padding: 12px;
}

body.ob-search-advanced .search-facets h2,
body.ob-search-advanced .search-facets h3{
  font-size: 1.05rem;
  margin: .6rem 0 .4rem;
}

body.ob-search-advanced .search-facets,
body.ob-search-advanced .search-facets *{
  font-size: 0.98rem;
  line-height: 1.25;
}

body.ob-search-advanced .search-facet-item{
  margin: 4px 0;
}

/* Résultats : grille plus dense */
body.ob-search-advanced ul.resource-list.ob-card-grid{
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
}

@media (max-width: 1180px){
  body.ob-search-advanced ul.resource-list.ob-card-grid{
    grid-template-columns: 1fr;
  }
}

/* Cartes : moins hautes */
body.ob-search-advanced ul.resource-list.ob-card-grid li{
  border-radius: 14px;
}

body.ob-search-advanced ul.resource-list.ob-card-grid img{
  height: 200px;
  object-fit: cover;
}

/* Titres des cartes : plus petits */
body.ob-search-advanced .ob-card-title,
body.ob-search-advanced ul.resource-list.ob-card-grid li .resource-title,
body.ob-search-advanced ul.resource-list.ob-card-grid li h3{
  font-size: 1.25rem;
  line-height: 1.15;
  margin: 10px 14px 14px;
}

/* Pagination/toolbar : compacte */
body.ob-search-advanced .browse-controls,
body.ob-search-advanced .search-results-header,
body.ob-search-advanced .search-results-footer{
  margin: 10px 0;
}


/* =========================================================
   Recherche avancée (Solr) — compact + 3 colonnes + facettes propres
   Cible: body.ob-search-advanced
   ========================================================= */

body.ob-search-advanced .ob-browse-header{
  padding: 14px 18px;
}
body.ob-search-advanced .ob-browse-header h1{
  font-size: 1.8rem;
  margin: 0 0 .25rem 0;
}
body.ob-search-advanced .ob-browse-meta{
  font-size: .95rem;
  opacity: .75;
}

/* Layout : sidebar plus fine + plus de place au centre */
body.ob-search-advanced .ob-browse-layout{
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 980px){
  body.ob-search-advanced .ob-browse-layout{ grid-template-columns: 1fr; }
}

/* Sidebar facettes : titres NON gras + plus petits */
body.ob-search-advanced .search-facets{
  padding: 12px;
}
body.ob-search-advanced .search-facet > h3{
  font-size: .9rem !important;
  font-weight: 500 !important;
  margin: 10px 0 6px !important;
  opacity: .85;
}

/* Valeurs facettes (Ethnique, Artisanat...) encore plus petites */
body.ob-search-advanced .search-facet-items,
body.ob-search-advanced .search-facet-item,
body.ob-search-advanced .search-facet-item a{
  font-size: .85rem !important;
  line-height: 1.2 !important;
}
body.ob-search-advanced .search-facet-item{ margin: 4px 0 !important; }

/* Compacter le bouton refresh facettes */
body.ob-search-advanced #submit-facets{
  transform: scale(.9);
}

/* --- Formulaire (énorme actuellement) : le compacter fortement --- */
body.ob-search-advanced #search-form-wrapper{
  margin: 6px 0 10px;
}
body.ob-search-advanced #search-form-wrapper,
body.ob-search-advanced #search-form-wrapper *{
  font-size: .9rem;
}
body.ob-search-advanced #search-form-wrapper h2,
body.ob-search-advanced #search-form-wrapper h3{
  font-size: .95rem;
  font-weight: 600;
}

/* Réduire paddings inputs/select */
body.ob-search-advanced #search-form-wrapper input,
body.ob-search-advanced #search-form-wrapper select,
body.ob-search-advanced #search-form-wrapper button{
  padding: 6px 8px !important;
  border-radius: 10px !important;
}

/* Masquer la 2ème ligne de filtre par défaut (tu gardes Add filter) */
body.ob-search-advanced #search-form-wrapper .queries > :nth-child(n+2){
  display:none !important;
}
/* Au cas où la structure diffère selon version */
body.ob-search-advanced #search-form-wrapper .search-queries > :nth-child(n+2){
  display:none !important;
}

/* --- Grille résultats : 3 pavés sur grand écran --- */
body.ob-search-advanced ul.resource-list.ob-card-grid{
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}
@media (max-width: 1180px){
  body.ob-search-advanced ul.resource-list.ob-card-grid{
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}
@media (max-width: 780px){
  body.ob-search-advanced ul.resource-list.ob-card-grid{
    grid-template-columns: 1fr;
  }
}

/* Cartes plus compactes */
body.ob-search-advanced ul.resource-list.ob-card-grid img{
  height: 160px;
  object-fit: cover;
}
body.ob-search-advanced .ob-card-title{
  font-size: 1.05rem;
  margin: 10px 12px 12px;
}

/* Masquer le gros bouton Search isolé si ça casse la mise en page */
body.ob-search-advanced #search-form-wrapper input[type="submit"],
body.ob-search-advanced #search-form-wrapper button[type="submit"]{
  transform: scale(.95);
}


/* =========================================================
   Recherche avancée — formulaire ultra compact
   ========================================================= */

body.ob-search-advanced #search-form-wrapper { margin: 6px 0 10px !important; }
body.ob-search-advanced #search-form-wrapper * { font-size: .88rem; }

/* Cache les gros titres "Search everywhere" et "Filters" */
body.ob-search-advanced #search-form-wrapper h2,
body.ob-search-advanced #search-form-wrapper h3,
body.ob-search-advanced #search-form-wrapper .field-meta,
body.ob-search-advanced #search-form-wrapper .field-description {
  display:none !important;
}

/* Réduit les espacements verticaux */
body.ob-search-advanced #search-form-wrapper .field,
body.ob-search-advanced #search-form-wrapper .fieldset,
body.ob-search-advanced #search-form-wrapper .inputs {
  margin: 4px 0 !important;
  padding: 0 !important;
}

/* Inputs/selects plus compacts */
body.ob-search-advanced #search-form-wrapper input,
body.ob-search-advanced #search-form-wrapper select,
body.ob-search-advanced #search-form-wrapper button {
  padding: 6px 8px !important;
  border-radius: 10px !important;
}

/* N’afficher qu’UNE ligne de filtre au départ (le reste via Add filter) */
body.ob-search-advanced #search-form-wrapper .queries > :nth-child(n+2),
body.ob-search-advanced #search-form-wrapper .search-queries > :nth-child(n+2){
  display:none !important;
}


/* Recherche avancée : formulaire ultra compact */
body.ob-search-advanced #search-form-wrapper,
body.ob-search-advanced .ob-search-advanced-form{
  margin: 6px 0 10px !important;
}
body.ob-search-advanced #search-form-wrapper *{
  font-size: .85rem !important;
  line-height: 1.15 !important;
}

/* cacher les gros libellés et gros espaces */
body.ob-search-advanced #search-form-wrapper h2,
body.ob-search-advanced #search-form-wrapper h3,
body.ob-search-advanced #search-form-wrapper .field-meta,
body.ob-search-advanced #search-form-wrapper .field-description{
  display:none !important;
}

/* marges ultra réduites */
body.ob-search-advanced #search-form-wrapper .field,
body.ob-search-advanced #search-form-wrapper .fieldset,
body.ob-search-advanced #search-form-wrapper .inputs{
  margin: 2px 0 !important;
  padding: 0 !important;
}

/* une seule ligne de filtre au départ */
body.ob-search-advanced #search-form-wrapper .queries > :nth-child(n+2),
body.ob-search-advanced #search-form-wrapper .search-queries > :nth-child(n+2){
  display:none !important;
}


/* Rights / provenance under main image */
.ob-collection-credit-inline{
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 6px;
  line-height: 1.2;
}


/* === OB-GUEST-COMPACT === */
body.ob-guest #content{
  max-width: 980px;
  margin: 0 auto;
  padding-top: 10px;
}
body.ob-guest #content h1,
body.ob-guest #content h2{
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 0 0 12px 0;
  font-weight: 600;
}
body.ob-guest #content .messages,
body.ob-guest #content ul.messages{
  font-size: 0.95rem;
  margin: 10px 0 14px;
}
body.ob-guest #content form{
  max-width: 560px;
  margin: 0 auto;
}
body.ob-guest #content .field{
  margin: 10px 0;
}
body.ob-guest #content label{
  font-size: 0.95rem;
}
body.ob-guest #content input[type="text"],
body.ob-guest #content input[type="email"],
body.ob-guest #content input[type="password"]{
  height: 38px;
  font-size: 1rem;
  line-height: 38px;
}
body.ob-guest #content button,
body.ob-guest #content input[type="submit"]{
  padding: 8px 12px;
  font-size: 1rem;
}
body.ob-guest #content .ob-guest-links{
  margin-top: 12px;
  text-align: left;
  font-size: 0.95rem;
}
body.ob-guest #content .ob-guest-link{
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 10px;
}
/* === /OB-GUEST-COMPACT === */

