/*
 * Page autonome « Horaires » (module horaires) — charte HELdB.
 * Feuille isolée : la page ne charge ni le thème ni Bootstrap du coffre-fort.
 * Police : Manrope (Google Fonts, licence SIL OFL 1.1).
 */
:root {
    --hor-bleu: #1414A1;
    --hor-bleu-fonce: #090D6C;
    --hor-bleu-accent: #2C31FB;
    --hor-bleu-pale: #D3DCFF;
    --hor-bleu-tres-pale: #E7EBFF;
    --hor-rouge: #EA0637;
    --hor-rouge-texte: #D20031;
    --hor-rouge-fonce: #960531;
    --hor-rouge-pale: #FFE1E3;
    --hor-noir: #262626;
    --hor-gris-50: #F6F6F6;
    --hor-gris-100: #E7E7E7;
    --hor-gris-200: #D1D1D1;
    --hor-gris-300: #B0B0B0;
    --hor-gris-500: #6D6D6D;
    --hor-gris-600: #5D5D5D;
    --hor-fond-page: #ecebe6;
    --hor-transition: 150ms ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 40px 16px;
    background: var(--hor-fond-page);
    color: var(--hor-noir);
    font: 400 15px/1.4 Manrope, system-ui, sans-serif;
}

[hidden] {
    display: none !important;
}

.hor-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--hor-bleu-accent);
    outline-offset: 2px;
}

/* ---------- Structure ---------- */
.hor-page {
    display: grid;
    grid-template-columns: 420px 1fr;
    max-width: 1440px;
    min-height: 760px;
    margin: 0 auto;
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
}

.hor-acces {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 40px 44px;
    border-right: 1px solid var(--hor-gris-100);
}

.hor-absences {
    padding: 40px 48px;
    background: var(--hor-gris-50);
}

.hor-absences--verrou {
    display: flex;
    flex-direction: column;
}

/* ---------- Colonne gauche : accès ---------- */
.hor-logo {
    display: block;
    align-self: flex-start;
    height: 36px;
}

.hor-surtitre {
    margin: 0;
    color: var(--hor-gris-500);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.hor-titre {
    margin: 8px 0 0;
    font-size: 40px;
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -.03em;
}

.hor-cartes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hor-carte {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
    border: 1.5px solid transparent;
    border-radius: 12px;
    text-decoration: none;
    transition: background-color var(--hor-transition), border-color var(--hor-transition);
}

.hor-carte--primaire {
    background: var(--hor-bleu);
    border-color: var(--hor-bleu);
    color: #fff;
}

.hor-carte--primaire:hover {
    background: var(--hor-bleu-fonce);
    border-color: var(--hor-bleu-fonce);
}

.hor-carte--secondaire {
    border-color: var(--hor-gris-200);
    color: var(--hor-noir);
}

.hor-carte--secondaire:hover {
    border-color: var(--hor-noir);
}

.hor-carte__icone {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
}

.hor-carte--primaire .hor-carte__icone {
    background: var(--hor-bleu-accent);
}

.hor-carte--secondaire .hor-carte__icone {
    background: var(--hor-gris-50);
}

.hor-carte__texte {
    flex: 1;
}

.hor-carte__titre {
    display: block;
    font-size: 17px;
    font-weight: 800;
}

.hor-carte__soustitre {
    display: block;
    margin-top: 2px;
    font-size: 13px;
}

.hor-carte--primaire .hor-carte__soustitre {
    color: var(--hor-bleu-pale);
}

.hor-carte--secondaire .hor-carte__soustitre {
    color: var(--hor-gris-500);
}

.hor-carte__chevron {
    flex: none;
}

.hor-pied {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    color: var(--hor-gris-500);
    font-size: 13px;
}

.hor-pied__archives {
    color: var(--hor-bleu);
    font-weight: 600;
    text-decoration: none;
}

.hor-pied__archives:hover {
    color: var(--hor-bleu-fonce);
}

.hor-pied__nom {
    color: var(--hor-noir);
    font-weight: 700;
}

.hor-pied__deconnexion {
    color: var(--hor-gris-500);
}

.hor-pied__connexion {
    color: var(--hor-noir);
    font-weight: 700;
}

/* ---------- Colonne droite : absences ---------- */
.hor-absences__entete {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
}

.hor-absences__entete--centre {
    align-items: center;
}

.hor-absences__titre {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.hor-absences__date {
    color: var(--hor-gris-500);
    font-size: 13px;
}

.hor-demo {
    margin: 14px 0 0;
    padding: 8px 12px;
    background: var(--hor-bleu-tres-pale);
    border-radius: 6px;
    color: var(--hor-bleu);
    font-size: 13px;
    font-weight: 600;
}

.hor-recherche {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 52px;
    margin-top: 18px;
    padding: 0 16px;
    background: #fff;
    border: 1.5px solid var(--hor-gris-200);
    border-radius: 10px;
    transition: border-color var(--hor-transition);
}

.hor-recherche:focus-within {
    border-color: var(--hor-bleu);
}

.hor-recherche svg {
    flex: none;
}

.hor-recherche__champ {
    flex: 1;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--hor-noir);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    appearance: none;
}

/* Le bouton « Effacer » de la maquette remplace la croix native du navigateur. */
.hor-recherche__champ::-webkit-search-cancel-button {
    display: none;
}

.hor-recherche__effacer {
    flex: none;
    padding: 5px 10px;
    background: var(--hor-gris-100);
    border: 0;
    border-radius: 6px;
    color: var(--hor-noir);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.hor-resultat {
    margin: 12px 0 0;
    color: var(--hor-gris-600);
    font-size: 13px;
}

.hor-resultat b {
    color: var(--hor-noir);
}

.hor-vide {
    margin-top: 14px;
    padding: 22px 20px;
    background: #fff;
    border: 1px dashed var(--hor-gris-200);
    border-radius: 10px;
    text-align: center;
}

.hor-vide__titre {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
}

.hor-vide__texte {
    margin: 4px 0 0;
    color: var(--hor-gris-500);
    font-size: 13px;
}

.hor-groupe {
    margin-top: 22px;
}

.hor-groupe--en-cours {
    margin-top: 20px;
}

.hor-groupe__libelle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--hor-gris-500);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.hor-groupe__point {
    width: 8px;
    height: 8px;
    background: var(--hor-gris-300);
    border-radius: 50%;
}

.hor-groupe--en-cours .hor-groupe__libelle {
    color: var(--hor-rouge-texte);
}

.hor-groupe--en-cours .hor-groupe__point {
    background: var(--hor-rouge);
}

/* Grille de cartes compactes : autant de colonnes que la largeur le permet
   (2 à 3 sur ordinateur, 1 sur téléphone) pour limiter le défilement. */
.hor-groupe__liste {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 8px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.hor-ligne {
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 8px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--hor-gris-100);
    border-radius: 10px;
}

.hor-groupe--en-cours .hor-ligne {
    border-left: 4px solid var(--hor-rouge);
}

.hor-ligne__nom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 0;
    font-size: 14px;
    font-weight: 800;
}

.hor-ligne__plage {
    margin: 3px 0 0;
    color: var(--hor-gris-600);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.hor-ligne__message {
    margin: 6px 0 0;
    padding: 8px 12px;
    background: var(--hor-gris-100);
    border-radius: 6px;
    color: var(--hor-noir);
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.hor-ligne__message > :first-child { margin-top: 0; }
.hor-ligne__message > :last-child { margin-bottom: 0; }
.hor-ligne__message p,
.hor-ligne__message ul,
.hor-ligne__message ol { margin: 0 0 6px; }
.hor-ligne__message ul,
.hor-ligne__message ol { padding-left: 20px; }
.hor-ligne__message a { color: var(--hor-bleu); text-decoration: underline; }

.hor-badge {
    padding: 2px 6px;
    background: var(--hor-bleu-tres-pale);
    border-radius: 4px;
    color: var(--hor-bleu);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hor-arrivee {
    display: inline-flex;
    justify-self: start;
    align-items: center;
    gap: 7px;
    padding: 4px 8px;
    background: var(--hor-gris-100);
    border-radius: 6px;
    color: var(--hor-noir);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

/* Conforme au prototype #2a : l'horloge n'apparaît que sur les absences en cours. */
.hor-arrivee svg {
    display: none;
}

.hor-groupe--en-cours .hor-arrivee {
    background: var(--hor-rouge-pale);
    color: var(--hor-rouge-fonce);
}

.hor-groupe--en-cours .hor-arrivee svg {
    display: block;
}

/* ---------- État non connecté ---------- */
.hor-bouton-contour {
    padding: 10px 18px;
    background: #fff;
    border: 1.5px solid var(--hor-noir);
    border-radius: 8px;
    color: var(--hor-noir);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color var(--hor-transition), color var(--hor-transition);
}

.hor-bouton-contour:hover {
    background: var(--hor-noir);
    color: #fff;
}

.hor-verrou {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.hor-verrou__bloc {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    max-width: 420px;
    text-align: center;
}

.hor-verrou__icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #fff;
    border: 1px solid var(--hor-gris-100);
    border-radius: 16px;
}

.hor-verrou__titre {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.hor-verrou__texte {
    margin: 10px 0 0;
    color: var(--hor-gris-600);
    font-size: 15px;
    line-height: 1.5;
    text-wrap: pretty;
}

.hor-bouton-plein {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--hor-noir);
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color var(--hor-transition);
}

.hor-bouton-plein:hover {
    background: #000;
}

.hor-verrou__mention {
    color: var(--hor-gris-500);
    font-size: 13px;
}

/* ---------- Responsive : une colonne sous 900px ---------- */
@media (max-width: 900px) {
    body {
        padding: 0;
    }

    .hor-page {
        grid-template-columns: 1fr;
        min-height: 100vh;
        border-radius: 0;
    }

    .hor-acces {
        padding: 24px;
        border-right: 0;
        border-bottom: 1px solid var(--hor-gris-100);
    }

    .hor-absences {
        padding: 24px;
    }

    .hor-titre {
        font-size: 32px;
    }

    .hor-pied {
        margin-top: 0;
    }

    /* Zones cliquables d'au moins 44px de haut. */
    .hor-bouton-contour,
    .hor-recherche__effacer,
    .hor-pied a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
