/**
 * Styles Public - Horaires d'ouverture (v1.0.0)
 * 
 * DESIGN SYSTEM :
 * - Polices système pour la performance (zéro requête HTTP).
 * - Contrastes WCAG AA/AAA.
 * - Responsive natif.
 * 
 * NOTE : Les shortcodes incluent également des styles inline pour une robustesse 
 * maximale contre les conflits de thèmes (Piège #20 Charte V11.4).
 * Ce fichier sert de complément pour la mise en page globale.
 * 
 * @package Horaires_Ouverture
 * @version 1.0.0
 */

/* ==========================================================================
   1. VARIABLES & BASE
   ========================================================================== */
:root {
    --ho-color-open: #006622;       /* Vert accessible */
    --ho-color-closed: #d63638;     /* Rouge accessible */
    --ho-bg-open: #e7f5ea;          /* Fond vert très clair */
    --ho-bg-closed: #ffebeb;        /* Fond rouge très clair */
    --ho-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --ho-border-radius: 4px;
    --ho-spacing: 1rem;
}

/* ==========================================================================
   2. SHORTCODE : STATUT DU JOUR (.abb-ho-status)
   ========================================================================== */
.abb-ho-status {
    font-family: var(--ho-font-stack);
    border-radius: var(--ho-border-radius);
    font-weight: 600;
    line-height: 1.5;
    padding: var(--ho-spacing);
    margin: 1rem 0;
    border-left: 5px solid transparent; /* Couleur définie en inline par PHP */
    transition: background-color 0.3s ease;
}

.abb-ho-status.open {
    /* Les couleurs de fond/texte sont gérées en inline par le PHP pour priorité maximale */
}

.abb-ho-status.closed {
    /* Idem */
}

.abb-ho-status small {
    font-weight: normal;
    opacity: 0.9;
    font-size: 0.9em;
}

/* ==========================================================================
   3. SHORTCODE : SEMAINE (.abb-ho-week)
   ========================================================================== */
.abb-ho-week {
    font-family: var(--ho-font-stack);
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: var(--ho-border-radius);
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.abb-ho-week ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.abb-ho-week li {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.abb-ho-week li:last-child {
    border-bottom: none;
}

.abb-ho-week li:hover {
    background-color: #f9f9f9;
}

.abb-ho-week-day {
    display: flex;
    flex-direction: column;
}

.abb-ho-week-name {
    font-weight: 700;
    text-transform: capitalize;
    color: #1d2327;
}

.abb-ho-week-date {
    font-size: 0.85em;
    color: #646970;
    margin-top: 2px;
}

.abb-ho-week-status {
    font-size: 0.9em;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: 600;
}

.abb-ho-week-status.closed {
    color: var(--ho-color-closed);
    background-color: var(--ho-bg-closed);
}

.abb-ho-week-status.open {
    color: var(--ho-color-open);
    /* Fond transparent ou très léger pour les ouvertures */
}

/* ==========================================================================
   4. SHORTCODE : TABLEAU COMPLET (.abb-ho-full-table)
   ========================================================================== */
.abb-ho-full-table {
    font-family: var(--ho-font-stack);
    color: #3c434a;
    line-height: 1.6;
    margin: 2rem 0;
}

.abb-ho-full-table h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: #1d2327;
    font-weight: 700;
    border-bottom: 2px solid #f0f0f1;
    padding-bottom: 10px;
}

.abb-ho-full-table table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: var(--ho-border-radius);
    overflow: hidden; /* Pour les bords arrondis */
}

.abb-ho-full-table thead {
    background: #f6f7f7;
}

.abb-ho-full-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #1d2327;
    border-bottom: 2px solid #dcdcde;
}

.abb-ho-full-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f1;
}

.abb-ho-full-table tr:last-child td {
    border-bottom: none;
}

.abb-ho-full-table tr:hover {
    background-color: #f9f9f9;
}

.abb-ho-full-table .status-closed {
    color: var(--ho-color-closed);
    font-weight: 600;
}

.abb-ho-full-table .status-open {
    color: var(--ho-color-open);
    font-weight: 500;
}

/* ==========================================================================
   5. RESPONSIVE MOBILE
   ========================================================================== */
@media screen and (max-width: 600px) {
    .abb-ho-week li {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .abb-ho-week-status {
        align-self: flex-start;
        margin-top: 4px;
    }

    .abb-ho-full-table table,
    .abb-ho-full-table thead,
    .abb-ho-full-table tbody,
    .abb-ho-full-table th,
    .abb-ho-full-table td,
    .abb-ho-full-table tr {
        display: block;
    }

    .abb-ho-full-table thead {
        display: none; /* On cache l'en-tête sur mobile */
    }

    .abb-ho-full-table tr {
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: var(--ho-border-radius);
        padding: 10px;
    }

    .abb-ho-full-table td {
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f1;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
    }

    .abb-ho-full-table td:last-child {
        border-bottom: none;
    }

    /* Astuce : Ajouter un label via data-label en CSS si nécessaire, 
       ou laisser le thème gérer l'affichage mobile des tableaux */
}