/**
 * DF Glossary — Glossaire SEO
 *
 * @author    DataFirefly
 * @copyright DataFirefly
 * @license   Commercial
 */

/* ---------------------------------------------------------------------------
 * Terme injecté dans les contenus (lien + infobulle CSS pure)
 * ------------------------------------------------------------------------- */
a.dfg-term {
    position: relative;
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: currentColor;
    text-underline-offset: 2px;
    cursor: help;
}

a.dfg-term:hover,
a.dfg-term:focus {
    text-decoration-style: solid;
}

/* Bulle */
a.dfg-term[data-dfg-tip]::after {
    content: attr(data-dfg-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    width: max-content;
    max-width: min(320px, 80vw);
    padding: 10px 12px;
    background: #1f2430;
    color: #fff;
    font-size: 13px;
    font-weight: 400;
    font-style: normal;
    line-height: 1.45;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 1050;
}

/* Flèche */
a.dfg-term[data-dfg-tip]::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%) translateY(4px);
    border: 6px solid transparent;
    border-top-color: #1f2430;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 1051;
}

a.dfg-term[data-dfg-tip]:hover::after,
a.dfg-term[data-dfg-tip]:focus::after,
a.dfg-term[data-dfg-tip].dfg-open::after,
a.dfg-term[data-dfg-tip]:hover::before,
a.dfg-term[data-dfg-tip]:focus::before,
a.dfg-term[data-dfg-tip].dfg-open::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Variante sans lien (mode "tooltip") : span */
span.dfg-term {
    position: relative;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    cursor: help;
}

/* ---------------------------------------------------------------------------
 * Page liste du glossaire
 * ------------------------------------------------------------------------- */
.dfg-glossary .dfg-header,
.dfg-term-page .dfg-header {
    margin-bottom: 1.5rem;
}

.dfg-alpha {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;
}

.dfg-alpha li a,
.dfg-alpha li span {
    display: inline-block;
    min-width: 32px;
    padding: 4px 8px;
    text-align: center;
    border: 1px solid #e2e4ea;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
}

.dfg-alpha li span {
    opacity: 0.35;
}

.dfg-alpha li a:hover {
    background: #1f2430;
    border-color: #1f2430;
    color: #fff;
}

.dfg-letter {
    margin-bottom: 2rem;
}

.dfg-letter-title {
    font-size: 1.4rem;
    font-weight: 700;
    border-bottom: 2px solid #1f2430;
    padding-bottom: 4px;
    margin-bottom: 1rem;
}

.dfg-terms {
    margin: 0;
    padding: 0;
    list-style: none;
}

.dfg-terms-item {
    padding: 10px 0;
    border-bottom: 1px solid #eef0f4;
}

.dfg-terms-item:last-child {
    border-bottom: 0;
}

.dfg-terms-link {
    font-weight: 600;
}

.dfg-terms-excerpt {
    display: block;
    margin-top: 2px;
    opacity: 0.75;
    font-size: 0.92em;
}

/* ---------------------------------------------------------------------------
 * Page fiche terme
 * ------------------------------------------------------------------------- */
.dfg-term-page .dfg-short {
    font-size: 1.05em;
    font-weight: 500;
    padding: 12px 16px;
    background: #f5f6fa;
    border-left: 4px solid #1f2430;
    border-radius: 0 6px 6px 0;
    margin-bottom: 1.5rem;
}

.dfg-term-page .dfg-long {
    margin-bottom: 2rem;
    line-height: 1.65;
}

.dfg-products {
    margin-bottom: 2rem;
}

.dfg-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 1rem;
}

.dfg-product {
    display: block;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    text-decoration: none;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.dfg-product:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    text-decoration: none;
}

.dfg-product img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 8px;
}

.dfg-product-name {
    display: block;
    font-weight: 600;
    font-size: 0.95em;
}

.dfg-siblings-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.dfg-siblings-list li a {
    display: inline-block;
    padding: 6px 12px;
    background: #f5f6fa;
    border-radius: 999px;
    font-size: 0.9em;
    text-decoration: none;
}

.dfg-siblings-list li a:hover {
    background: #1f2430;
    color: #fff;
}

.dfg-back {
    margin-top: 2rem;
}

@media (max-width: 575px) {
    .dfg-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
