/* Road Community - Téléchargements V2
   Scope volontairement limité à la page Téléchargements et son administration. */

.downloads-page-header {
    margin-bottom: 18px;
}

.download-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.download-list,
.admin-download-list {
    display: grid;
    gap: 16px;
}

.download-card {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    gap: 20px;
    align-items: start;
    padding: 22px;
}

.download-card-mark {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: var(--surface-2);
    color: var(--link);
    font-size: .9rem;
    font-weight: 950;
    letter-spacing: .06em;
}

.download-card-content {
    min-width: 0;
}

.download-card-kicker {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    margin-bottom: 6px;
}

.download-card-kicker span {
    color: var(--eyebrow);
    font-size: .9rem;
    font-weight: 850;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.download-card-kicker b {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--on-primary);
    font-size: .9rem;
    font-weight: 900;
    letter-spacing: .05em;
}

.download-card-kicker b.is-muted {
    background: var(--surface-3);
    color: var(--muted);
}

.download-card h2,
.admin-download-row h3 {
    margin: 0;
}

.download-card p {
    margin: 8px 0 0;
    color: var(--text);
}

.download-description {
    margin-top: 12px;
    color: var(--soft-text);
    line-height: 1.65;
}

.download-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 14px;
    color: var(--muted);
}

.download-meta strong {
    color: var(--text);
}

.download-integrity {
    margin-top: 12px;
}

.download-integrity summary {
    color: var(--link);
    cursor: pointer;
    font-size: .9rem;
    font-weight: 800;
}

.download-integrity code {
    display: block;
    margin-top: 8px;
    padding: 9px 11px;
    overflow-wrap: anywhere;
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: .9rem;
}

.download-card-action {
    display: grid;
    gap: 8px;
    justify-items: end;
    min-width: 170px;
}

.download-card-action small {
    max-width: 220px;
    color: var(--muted);
    text-align: right;
    overflow-wrap: anywhere;
}

.admin-download-create {
    margin-bottom: 28px;
}

.admin-download-list-section {
    margin-top: 26px;
}

.admin-download-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
}

.admin-download-row-main {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.admin-download-row-main p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: .9rem;
}

.admin-download-row-main small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

.download-current-file {
    display: grid;
    gap: 5px;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
}

.download-current-file span {
    color: var(--muted);
    font-size: .9rem;
    overflow-wrap: anywhere;
}

.download-source-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.download-source-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    cursor: pointer;
}

.download-source-option:hover,
.download-source-option.is-selected {
    border-color: var(--primary);
}

.download-source-option input {
    margin: 3px 0 0;
    flex: 0 0 auto;
}

.download-source-option span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.download-source-option strong {
    color: var(--text);
}

.download-source-option small {
    color: var(--muted);
    line-height: 1.45;
}

.download-source-panel[hidden] {
    display: none !important;
}

.download-file-picker {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    min-height: 44px;
}

.download-file-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.download-file-button {
    margin: 0;
    cursor: pointer;
}

.download-file-name {
    min-width: 0;
    color: var(--muted);
    font-size: .9rem;
    overflow-wrap: anywhere;
}

.download-file-name.has-file {
    color: var(--text);
    font-weight: 700;
}

.downloads-admin-form .field-help {
    margin-top: 7px;
    line-height: 1.45;
}

@media (max-width: 860px) {
    .download-card {
        grid-template-columns: 60px minmax(0, 1fr);
        gap: 14px;
        padding: 18px;
    }

    .download-card-mark {
        width: 56px;
        height: 56px;
        border-radius: 14px;
    }

    .download-card-action {
        grid-column: 1 / -1;
        grid-template-columns: minmax(0, 1fr);
        justify-items: stretch;
        min-width: 0;
    }

    .download-card-action small {
        max-width: none;
        text-align: left;
    }

    .admin-download-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-download-row > .button-row {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .download-source-choice {
        grid-template-columns: 1fr;
    }

    .download-filters .button {
        flex: 1 1 calc(50% - 8px);
    }

    .download-card {
        grid-template-columns: 1fr;
    }

    .download-card-mark {
        width: 52px;
        height: 52px;
    }

    .admin-download-row-main {
        grid-template-columns: 52px minmax(0, 1fr);
    }
}


/* Road Community 2026-08-22 — finition gestion / lisibilité */
.download-file-button,
.download-file-button:visited {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--on-primary) !important;
    font-weight: 800;
}
.download-file-button:hover,
.download-file-button:focus-visible {
    background: var(--primary-strong) !important;
    border-color: var(--primary-strong) !important;
    color: var(--on-primary) !important;
}
.download-card-admin-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}
.download-card-admin-actions form { margin: 0; }
.download-admin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 16px;
    margin-top: 8px;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.45;
}
.download-admin-meta strong { color: var(--text); }
.admin-download-row-main .download-admin-source {
    margin-top: 7px;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
@media (max-width: 860px) {
    .download-card-admin-actions { justify-content: flex-start; }
}
