/**
 * Entity Kit — fiche single (gas-entity-single).
 * BEM + tokens --gas-* uniquement. Markup en parité avec l'Astro.
 */

.gas-entity-single-wrap {
    max-width: var(--gas-container-default, 720px);
    margin-inline: auto;
    padding: var(--gas-space-l, 20px) var(--gas-space-m, 10px);
}

.gas-entity-single__header {
    margin-bottom: var(--gas-space-l, 20px);
}

.gas-entity-single__category {
    margin: 0 0 var(--gas-space-xs, 2.5px);
    color: var(--gas-color-primary, #5b3df5);
    font-size: var(--gas-text-s, 8.75px);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.gas-entity-single__title {
    margin: 0;
    font-size: var(--gas-text-xl, 22.5px);
    line-height: 1.1;
    color: var(--gas-color-text, #15151a);
}

.gas-entity-single__media {
    margin: 0 0 var(--gas-space-l, 20px);
}

.gas-entity-single__image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--gas-radius-l, 10px);
    object-fit: cover;
}

.gas-entity-single__body {
    display: grid;
    gap: var(--gas-space-m, 10px);
    margin-bottom: var(--gas-space-l, 20px);
}

.gas-entity-single__field {
    display: grid;
    gap: var(--gas-space-xs, 2.5px);
}

.gas-entity-single__field-label {
    font-size: var(--gas-text-s, 8.75px);
    font-weight: 600;
    color: var(--gas-color-text-muted, #6b6b78);
}

.gas-entity-single__field-value {
    color: var(--gas-color-text, #15151a);
    font-size: var(--gas-text-m, 10px);
}

.gas-entity-single__field-value img {
    max-width: 100%;
    height: auto;
    border-radius: var(--gas-radius-m, 5px);
}

/* Image de couverture du hero (entity_hero). Sans ces deux déclarations elle
 * était rendue à une hauteur de 0 : le HTML et le src étaient corrects, mais
 * l'image n'était jamais chargée (`loading="lazy"` + boîte de hauteur nulle =
 * jamais dans le viewport). Seul `__field-value img` était stylé. */
.gas-entity-single__media {
    margin: 0 0 var(--gas-space-l, 20px);
}

.gas-entity-single__image {
    max-width: 100%;
    height: auto;
    border-radius: var(--gas-radius-m, 5px);
}

/* ── Champ `file` : lien de téléchargement (PDF, docx, zip…) ──
 * Markup identique PHP (GasEntitySingleRenderer) et Astro (EntityDisplayValue). */
.gas-entity-single__file {
    display: inline-flex;
    align-items: baseline;
    gap: var(--gas-space-s, 8px);
    padding: var(--gas-space-s, 8px) var(--gas-space-m, 16px);
    border: 1px solid var(--gas-color-border-default, #ddd);
    border-radius: var(--gas-radius-m, 5px);
    color: var(--gas-primary, #2563eb);
    text-decoration: none;
}

.gas-entity-single__file:hover,
.gas-entity-single__file:focus {
    border-color: var(--gas-primary, #2563eb);
    text-decoration: underline;
}

.gas-entity-single__file-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.gas-entity-single__file-meta {
    color: var(--gas-color-text-muted, #666);
    font-size: var(--gas-text-s, 8.75px);
    white-space: nowrap;
}

.gas-entity-single__relations {
    margin-top: var(--gas-space-l, 20px);
    padding-top: var(--gas-space-m, 10px);
    border-top: 1px solid var(--gas-color-border, #e4e4ec);
}

.gas-entity-single__relations-title {
    margin: 0 0 var(--gas-space-s, 5px);
    font-size: var(--gas-text-l, 15px);
    color: var(--gas-color-text, #15151a);
}

.gas-entity-single__relation-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--gas-space-s, 5px);
}

.gas-entity-single__relation {
    display: inline-flex;
    align-items: baseline;
    gap: var(--gas-space-xs, 2.5px);
    padding: var(--gas-space-xs, 2.5px) var(--gas-space-s, 5px);
    border-radius: var(--gas-radius-m, 5px);
    background: var(--gas-color-surface-alt, #f4f4f8);
}

.gas-entity-single__relation-link {
    color: var(--gas-color-primary, #5b3df5);
    font-weight: 600;
    text-decoration: none;
}

.gas-entity-single__relation-link:hover {
    text-decoration: underline;
}

.gas-entity-single__relation-meta {
    color: var(--gas-color-text-muted, #6b6b78);
    font-size: var(--gas-text-s, 8.75px);
}

/* Repeater / group (sous-champs structurés — lot 2/3 plan v2) */

.gas-entity-single__repeater {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--gas-space-s, 5px);
}

.gas-entity-single__repeater-item {
    padding: var(--gas-space-s, 5px) var(--gas-space-m, 7.5px);
    border-radius: var(--gas-radius-m, 5px);
    background: var(--gas-color-surface-alt, #f4f4f8);
}

.gas-entity-single__group {
    display: grid;
    gap: var(--gas-space-xs, 2.5px);
}

.gas-entity-single__subfield {
    display: flex;
    align-items: baseline;
    gap: var(--gas-space-s, 5px);
}

.gas-entity-single__subfield-label {
    color: var(--gas-color-text-muted, #6b6b78);
    font-size: var(--gas-text-s, 8.75px);
    min-width: 80px;
}

.gas-entity-single__subfield-value img {
    max-width: 120px;
    height: auto;
    border-radius: var(--gas-radius-m, 5px);
}

/* Types de champs lot 4 */

.gas-entity-single__multiline {
    white-space: pre-line;
}

.gas-entity-single__gallery {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gas-space-s, 5px);
}

.gas-entity-single__gallery-image {
    max-width: 100px;
    height: auto;
    border-radius: var(--gas-radius-m, 5px);
}

/* Bandeau de prévisualisation (lot 13) */

.gas-entity-preview-banner {
    position: sticky;
    top: 0;
    z-index: 99;
    padding: var(--gas-space-s, 5px) var(--gas-space-m, 7.5px);
    background: var(--gas-color-warning-soft, #fff7e6);
    border-bottom: 1px solid var(--gas-color-warning, #f5c97a);
    color: var(--gas-color-text, #333);
    font-size: var(--gas-text-s, 8.75px);
    text-align: center;
}

/* ── Landings SEO facettes ─────────────────────────── */

.gas-entity-facet-landing-wrap {
    max-width: var(--gas-container-wide, 1100px);
    margin-inline: auto;
    padding: var(--gas-space-l, 24px) var(--gas-space-m, 16px);
}

.gas-entity-facet-landing__header {
    margin-bottom: var(--gas-space-l, 24px);
}

.gas-entity-facet-landing__eyebrow {
    margin: 0 0 var(--gas-space-xs, 4px);
}

.gas-entity-facet-landing__back {
    color: var(--gas-color-primary, #5b3df5);
    text-decoration: none;
    font-size: var(--gas-text-s, 14px);
}

.gas-entity-facet-landing__back:hover {
    text-decoration: underline;
}

.gas-entity-facet-landing__title {
    margin: 0 0 var(--gas-space-s, 8px);
    font-size: var(--gas-text-xl, 32px);
    line-height: 1.15;
    color: var(--gas-color-text, #15151a);
}

.gas-entity-facet-landing__intro {
    margin: 0;
    color: var(--gas-color-text-muted, #5c5c66);
    font-size: var(--gas-text-m, 16px);
}

.gas-entity-facet-landing__empty {
    margin: var(--gas-space-l, 24px) 0;
    color: var(--gas-color-text-muted, #5c5c66);
}

.gas-entity-facet-landing__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--gas-space-m, 16px);
}

.gas-entity-facet-landing__card {
    display: flex;
    flex-direction: column;
    background: var(--gas-bg-surface, #fff);
    border: 1px solid var(--gas-color-border, #e5e5ea);
    border-radius: var(--gas-radius-l, 12px);
    overflow: hidden;
}

.gas-entity-facet-landing__card-media {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--gas-bg-surface-alt, #f5f5f7);
}

.gas-entity-facet-landing__card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gas-entity-facet-landing__card-body {
    padding: var(--gas-space-m, 16px);
    display: flex;
    flex-direction: column;
    gap: var(--gas-space-xs, 4px);
}

.gas-entity-facet-landing__card-cat {
    margin: 0;
    font-size: var(--gas-text-xs, 12px);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gas-color-primary, #5b3df5);
    font-weight: 600;
}

.gas-entity-facet-landing__card-title {
    margin: 0;
    font-size: var(--gas-text-m, 16px);
    line-height: 1.3;
}

.gas-entity-facet-landing__card-title a {
    color: inherit;
    text-decoration: none;
}

.gas-entity-facet-landing__card-title a:hover {
    color: var(--gas-color-primary, #5b3df5);
}

.gas-entity-facet-landing__card-desc {
    margin: 0;
    font-size: var(--gas-text-s, 14px);
    color: var(--gas-color-text-muted, #5c5c66);
}
