:root { --imm-border: #dbdbdb; }

body { background: #fafafa; }
.navbar-menu.is-active { box-shadow: none; background: inherit; }
.breadcrumb { margin-bottom: 1rem !important; }
.breadcrumb.is-medium { font-size: 1rem; }

/* Tables de métadonnées : clé étroite, valeur qui respire. */
.meta-table th { width: 40%; color: #7a7a7a; font-weight: 500; white-space: nowrap; }
.meta-table td { overflow-wrap: anywhere; }

/* Corps d’article */
.immxml-body { max-width: 46rem; }
.immxml-body p { margin-bottom: .8rem; text-align: justify; }
.immxml-header { font-size: 1.1rem; font-weight: 600; color: #363636; border-left: 3px solid #485fc7; padding-left: .75rem; }
.immxml-tag { background: #eef1fc; border-bottom: 1px dotted #485fc7; border-radius: 2px; padding: 0 2px; }
.immxml-tag[data-type="person"] { background: #fdeef4; border-bottom-color: #f14668; }
.immxml-tag[data-type="geo"] { background: #eefaf3; border-bottom-color: #48c78e; }
.immxml-anchor { display: inline-block; font-size: .8rem; background: #f5f5f5; border: 1px dashed var(--imm-border); border-radius: 3px; padding: 0 .4rem; }
.immxml-footnote { font-size: .85rem; color: #7a7a7a; border-top: 1px solid var(--imm-border); padding-top: .5rem; margin-top: 1rem; }
.immxml-unknown { border-bottom: 1px dotted #ffe08a; }
.card:target, .card:has(:target) { outline: 2px solid #485fc7; }

.entity-image { max-height: 70vh; width: auto; border: 1px solid var(--imm-border); background: #fff; }
.image-full { max-height: 80vh; width: auto; }

/* Galerie */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.gallery-item { display: flex; flex-direction: column; gap: .35rem; background: #fff; border: 1px solid var(--imm-border); border-radius: 6px; padding: .5rem; color: inherit; }
.gallery-item:hover { border-color: #485fc7; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.gallery-item img { width: 100%; height: 150px; object-fit: contain; background: #f5f5f5; }
.gallery-caption { font-size: .7rem; word-break: break-all; color: #7a7a7a; }

/* Source XML */
.xml-source { max-height: 75vh; overflow: auto; font-size: .78rem; line-height: 1.45; background: #ffffff; padding: 1rem; }
.x-tag { color: #2b6cb0; font-weight: 600; }
.x-attr { color: #b7791f; }
.x-value { color: #2f855a; }
.x-punct { color: #a0aec0; }
.x-comment { color: #a0aec0; font-style: italic; }

.details-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.details-list .tag { max-width: 100%; height: auto; white-space: normal; }
.immxml-header p:last-child { margin-bottom: 0; }
.immxml-header p { margin-bottom: .5rem; }
.immxml-legend p { margin-bottom: .25rem; }

/* Colonne latérale (métadonnées) : étroite et fixe, la place va au contenu. */
.side-column { flex: 0 0 19rem; width: 19rem; max-width: 19rem; }
.side-column .table { table-layout: fixed; width: 100%; }
.side-column .table td, .side-column .table th { overflow-wrap: anywhere; }
.side-column .box { padding: 1rem; }
.side-column .meta-table th { width: 45%; white-space: normal; word-break: break-word; }
.side-column .title { font-size: .95rem; }

/* Miniature d’entité dans le sommaire. */
.entity-thumb { display: block; width: 32px; height: 32px; object-fit: contain; background: #f5f5f5; border: 1px solid var(--imm-border); border-radius: 3px; }
.entity-thumb.is-empty { background: #fafafa; border-style: dashed; }

/* Mode « pages » : grille d’entités avec un visuel plus grand. */
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.entity-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--imm-border); border-radius: 6px; overflow: hidden; color: inherit; }
.entity-card:hover { border-color: #485fc7; box-shadow: 0 2px 10px rgba(0,0,0,.09); }
.entity-card-image { display: block; width: 100%; height: 220px; object-fit: contain; background: #f5f5f5; }
.entity-card-image.is-empty { background: repeating-linear-gradient(45deg, #fafafa, #fafafa 8px, #f2f2f2 8px, #f2f2f2 16px); }
.entity-card-body { display: flex; flex-direction: column; gap: .3rem; padding: .6rem .7rem .7rem; }
.entity-card-section { font-size: .65rem; text-transform: uppercase; letter-spacing: .04em; color: #7a7a7a; }
.entity-card-title { font-weight: 600; line-height: 1.25; font-size: .9rem; }
.entity-card-meta { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .15rem; }
.entity-card-meta .tag { font-size: .65rem; height: 1.4em; }

/* Ancres d’images dans le corps du texte : vignette cliquable vers l’item complet. */
.immxml-anchor-image { display: inline-block; vertical-align: middle; margin: .25rem .4rem .25rem 0; line-height: 0; }
.immxml-anchor-image img { width: 120px; height: 120px; object-fit: contain; background: #f5f5f5; border: 1px solid var(--imm-border); border-radius: 4px; }
.immxml-anchor-image:hover img { border-color: #485fc7; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.immxml-body p:has(> .immxml-anchor-image) { margin-bottom: .4rem; }

/* Résultats de recherche dans la liste des archives. */
.search-hits td { background: #fbfbfd; border-top: 0; padding-top: .25rem !important; }
.search-hit { display: block; padding: .35rem .6rem; margin-bottom: .3rem; border-left: 3px solid #dbdbdb; background: #fff; color: inherit; border-radius: 0 3px 3px 0; }
.search-hit:hover { border-left-color: #485fc7; background: #f7f8ff; }
.search-hit-label { display: block; font-size: .8rem; font-weight: 600; }
.search-hit-snippet { display: block; font-size: .75rem; color: #7a7a7a; line-height: 1.45; }
.search-hit mark { background: #ffe9a8; color: inherit; padding: 0 .1em; border-radius: 2px; }

/* Versions d’une même livraison (même nom de ZIP, contenu différent). */
.version-list { display: flex; flex-direction: column; gap: .2rem; }
.version-item { display: flex; align-items: center; gap: .4rem; font-size: .72rem; padding: .25rem .4rem; border-radius: 3px; color: inherit; border: 1px solid transparent; }
.version-item:hover { background: #fffaf0; border-color: #ffe08a; }
.version-item.is-current { background: #fffaf0; border-color: #ffdd57; font-weight: 600; }
.version-item .tag { font-size: .65rem; height: 1.4em; }
