/* Conception algorithmique : ce qui s'ajoute à la mise en page du guide (gd-*) */

.ag-hero .ag-sous-titre {
    margin: -2px 0 10px;
    font-family: 'Unbounded', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--accent);
}

/* encadré « le piège » */
.ag-piege {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 16px 0 0;
    padding: 14px 16px;
    border-left: 3px solid var(--err);
    border-radius: 0 12px 12px 0;
    background: color-mix(in srgb, var(--err) 7%, transparent);
}

.ag-piege > .mdi {
    font-size: 21px;
    color: var(--err);
    flex-shrink: 0;
}

.ag-piege strong {
    display: block;
    margin-bottom: 2px;
    color: var(--text);
}

.ag-piege p {
    margin: 0 !important;
    font-size: 14px;
}

/* exercice : énoncé visible, solution dépliable */
.ag-exo {
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px dashed var(--border2);
    border-radius: 14px;
    background: var(--surface2);
}

.ag-exo-titre {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gd, var(--accent));
}

.ag-exo > p:last-of-type,
.ag-exo > ul {
    margin-bottom: 12px;
}

.ag-exo details {
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.ag-exo summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 0;
    color: var(--gd, var(--accent));
    font-size: 14px;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.ag-exo summary::-webkit-details-marker {
    display: none;
}

.ag-exo summary::before {
    content: '\F142';
    font-family: 'Material Design Icons';
    font-size: 18px;
    transition: transform .15s;
}

.ag-exo details[open] summary::before {
    transform: rotate(90deg);
}

.ag-exo details > *:not(summary) {
    margin-top: 8px;
    font-size: 14px;
}

.ag-exo details p:last-child {
    margin-bottom: 0;
}

.ag-trace {
    width: auto;
    min-width: min(100%, 420px);
    margin: 4px 0 14px;
    border-collapse: collapse;
    font-size: 12.5px;
}

.ag-trace th,
.ag-trace td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.ag-trace th {
    background: var(--surface2);
    font-size: 12px;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.ag-trace td code {
    background: none;
    padding: 0;
}

.ag-trace tr:last-child td {
    border-bottom: 0;
}

.ag-trace-err td {
    background: color-mix(in srgb, var(--err) 8%, transparent);
    color: var(--err);
    font-weight: 600;
}

/* les blocs de code, dans le rythme des sections du guide */
.gd-section .code-wrap,
.gd-section > .code-block {
    margin: 4px 0 14px;
}

@media (max-width: 760px) {
    .ag-hero .ag-sous-titre {
        font-size: 15px;
    }

    .ag-piege,
    .ag-exo {
        padding: 12px 14px;
    }
}
