/*
 * Fichier — composants de page : en-têtes, fiches en blocs, tableau de bord.
 * ==========================================================================
 * Fiches « view » : reprise des fiches Hôtellerie (Admin/Users/view,
 * Events/view) — en-tête centré (surtitre or, titre Oswald, actions), puis
 * grille de blocs à bordure bleue, en-tête bleu clair, corps défilant.
 *
 *   <section class="view-page">
 *     <header class="view-header">…</header>
 *     <div class="view-grid">
 *       <section class="view-card [view-card--wide|--full]">
 *         <div class="view-card__header"><h2>…</h2><div class="view-card__actions">…</div></div>
 *         <div class="view-card__body">…</div>
 *       </section>
 *     </div>
 *   </section>
 *
 * Le bloc est produit par templates/element/view/card.php.
 */

/* --------------------------------------------------------------------------
   EN-TÊTE DES ÉCRANS DE LISTE ET DE SAISIE
   Référence : .admin-page-header Hôtellerie.
   -------------------------------------------------------------------------- */

.page-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.4rem;
}

.page-heading h1 {
    margin: 0;
}

.page-heading p {
    max-width: 58rem;
    margin: .5rem 0 0;
    color: var(--hot-muted);
}

.page-heading > div:last-child:not(:first-child) {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

/* Introduction sous un titre de liste (h1 + p de présentation). */
.content-surface > h1 + p {
    max-width: 62rem;
    color: var(--hot-muted);
}

/* Barre de recherche / filtre des listes (formulaire GET). */
.content-surface form[method=get] {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem 1rem;
    margin: 1.2rem 0;
    padding: .9rem 1rem;
    border: 1px solid var(--hot-line);
    border-radius: .6rem;
    background: #f8fafc;
}

.content-surface form[method=get] > .input {
    flex: 1 1 14rem;
    max-width: 650px;
    margin: 0;
}

.content-surface form[method=get] > .input.checkbox {
    flex: 0 1 auto;
}

.content-surface form[method=get] button {
    flex-shrink: 0;
    min-height: 2.75rem;
}

/* --------------------------------------------------------------------------
   FICHE EN BLOCS
   -------------------------------------------------------------------------- */

.view-page {
    width: 100%;
    margin-inline: auto;
}

.view-header {
    max-width: 1100px;
    margin: 0 auto 1.2rem;
    text-align: center;
}

.view-header__kicker {
    display: inline-block;
    margin-bottom: .2rem;
    color: var(--hot-gold-dark);
    font-family: var(--font-title);
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.view-header__title {
    margin: 0;
    color: var(--hot-blue-deep);
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    font-weight: 500;
    line-height: 1.12;
}

.view-header__subtitle {
    margin: .35rem 0 0;
    color: var(--hot-ink);
    font-size: .95rem;
}

.view-header__subtitle .separator {
    margin: 0 .4rem;
    color: var(--hot-gold);
}

.view-header__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .45rem;
    margin-top: .8rem;
}

.view-header__actions form {
    display: inline-flex;
    margin: 0;
}

/* Notes de la fiche (verrouillage, numéro partagé…) sous l'en-tête. */
.view-notice {
    max-width: 1100px;
    margin: 0 auto 1rem;
    text-align: left;
}

/* Grille : 4 blocs par ligne, comme l'ancien col-lg-3 de l'Hôtellerie. */
.view-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    align-items: start;
}

.view-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.view-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.view-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--hot-blue);
    border-radius: .72rem;
    background: #fff;
    box-shadow: var(--hot-shadow-card);
}

.view-card--wide {
    grid-column: span 2;
}

.view-card--full {
    grid-column: 1 / -1;
    min-height: 0;
}

.view-card--auto {
    min-height: 0;
}

.view-card__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .45rem;
    min-height: 43px;
    padding: .38rem .75rem;
    border-bottom: 1px solid var(--hot-blue);
    background: var(--hot-blue-soft);
    color: var(--hot-blue-deep);
}

.view-card__header h2 {
    margin: 0;
    color: var(--hot-blue-deep);
    font-size: 1.03rem;
    font-weight: 500;
    line-height: 1.12;
}

.view-count {
    display: inline-block;
    margin-left: .28rem;
    padding: .05rem .38rem;
    border: 1px solid rgba(var(--hot-blue-rgb), .35);
    border-radius: 999px;
    background: #fff;
    color: var(--hot-blue-deep);
    font-family: var(--font-text);
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.2;
    vertical-align: .12em;
}

.view-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .3rem;
}

.view-card__actions form {
    display: inline-flex;
    margin: 0;
}

/* Boutons compacts des en-têtes de bloc (équivalent .admin-card-btn). */
.view-card__actions .button,
.view-card__actions button,
.view-card__actions a {
    min-height: 1.72rem;
    padding: .18rem .5rem;
    border: 1px solid var(--hot-blue);
    border-radius: .34rem;
    background: #fff;
    color: var(--hot-blue-deep);
    font-size: .76rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.view-card__actions .button:hover,
.view-card__actions button:hover,
.view-card__actions a:hover {
    background: #f7faff;
    color: var(--hot-blue-deep);
}

.view-card__body {
    flex: 1 1 auto;
    max-height: 430px;
    padding: .5rem .7rem;
    overflow: auto;
    font-size: .88rem;
    line-height: 1.35;
    scrollbar-width: thin;
}

.view-card--full .view-card__body,
.view-card--auto .view-card__body {
    max-height: none;
}

.view-card__body > :last-child {
    margin-bottom: 0;
}

.view-card__body p {
    margin-bottom: .6rem;
}

.view-card__body form {
    margin: 0 0 .7rem;
}

.view-card__body .input {
    margin-bottom: .7rem;
}

.view-empty {
    margin: 0;
    color: var(--hot-muted);
    font-style: italic;
}

/* Rubriques compactes : « Intitulé : valeur », une paire par ligne.
 * Les éléments dt/dd et leurs valeurs restent intacts ; les textes multilignes
 * conservent leurs retours, les liens et les gardes ACL ne sont pas modifiés. */
.view-card__body dl,
.view-data {
    display: block;
    margin: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.view-card__body dt,
.view-data dt {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--hot-blue-deep);
    font-size: inherit;
    font-weight: 700;
}

.view-card__body dt::after,
.view-data dt::after {
    content: " : ";
    white-space: pre;
}

/* La rupture suit la valeur, jamais l’intitulé ; pas de colonne vide réservée. */
.view-card__body dd::after,
.view-data dd::after {
    content: "";
    display: block;
    margin-bottom: .25rem;
}

.view-card__body dd,
.view-data dd {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--hot-ink);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.view-card__body dd:last-child,
.view-data dd:last-child {
    margin-bottom: 0;
}

/* Valeur absente : tiret discret plutôt qu'une ligne vide. */
.view-card__body dd:empty::before,
.view-data dd:empty::before {
    content: "—";
    color: #b3bdc9;
}

/* Éléments répétés dans un bloc (adresses, versements…). */
.view-card__body article {
    margin: 0 0 .6rem;
    padding: .55rem .65rem;
    border: 1px solid var(--hot-line);
    border-left: 3px solid var(--hot-gold);
    border-radius: .45rem;
    background: #fafbfd;
}

.view-card__body article:last-child {
    margin-bottom: 0;
}

.view-card__body article h3 {
    margin: 0 0 .4rem;
    color: var(--hot-blue-deep);
    font-size: .92rem;
}

/* Même présentation pour les adresses et versements imbriqués. */
.view-card__body article dl {
    display: block;
}

.view-card__body article dd {
    margin: 0;
}

.view-card__body article p {
    margin: .45rem 0 0;
    font-size: .82rem;
}

.view-flag {
    display: inline-block;
    margin: 0 .25rem .3rem 0;
    padding: .05rem .5rem;
    border: 1px solid #f0d7a1;
    border-radius: 999px;
    background: var(--hot-gold-soft);
    color: #74540d;
    font-size: .74rem;
    font-weight: 700;
}

/* Liste simple de liens dans un bloc (courriels, groupes…). */
.view-list {
    display: grid;
    gap: .4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.view-list li {
    padding-bottom: .4rem;
    border-bottom: 1px solid rgba(57, 85, 122, .14);
}

.view-list li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.view-list a {
    font-weight: 600;
    text-decoration: none;
}

.view-list a:hover {
    text-decoration: underline;
}

.view-list small {
    display: block;
    color: var(--hot-muted);
    font-size: .78rem;
}

/* Tableau compact dans un bloc (équivalent .admin-view-table). */
.view-card__body .table-scroll {
    margin: 0;
    border-radius: .45rem;
    box-shadow: none;
}

.view-card__body table {
    margin: 0;
    font-size: .82rem;
}

.view-card__body thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 0;
    background: var(--hot-blue-deep);
    color: #fff;
    font-family: var(--font-title);
    font-size: .82rem;
    font-weight: 500;
}

.view-card__body th,
.view-card__body td {
    padding: .34rem .45rem;
}

.view-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: .7rem;
    font-size: .84rem;
}

/* --------------------------------------------------------------------------
   TABLEAU DE BORD
   Référence : .admin-module-link / .admin-dashboard-card Hôtellerie.
   -------------------------------------------------------------------------- */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.module-card {
    display: flex;
    min-height: 10rem;
    flex-direction: column;
    gap: .45rem;
    padding: 1.15rem 1.2rem;
    border: 1px solid var(--hot-line);
    border-top: 3px solid var(--hot-gold);
    border-radius: .75rem;
    background: #fff;
    box-shadow: var(--hot-shadow-card);
    color: var(--hot-blue-dark);
    text-decoration: none;
    transition:
        border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.module-card:hover,
.module-card:focus {
    border-color: rgba(var(--hot-blue-rgb), .45);
    border-top-color: var(--hot-gold);
    box-shadow: 0 10px 24px rgba(49, 70, 95, .12);
    color: var(--hot-blue-dark);
    transform: translateY(-1px);
}

.module-icon {
    color: var(--hot-gold-dark);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
}

.module-card h2 {
    margin: 0;
    color: var(--hot-blue-dark);
    font-size: 1.25rem;
    font-weight: 400;
}

.module-card p {
    flex: 1;
    margin: 0;
    color: var(--hot-muted);
    font-size: .86rem;
}

.module-card .card-link {
    color: var(--hot-blue);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   RESPONSIVE / IMPRESSION
   -------------------------------------------------------------------------- */

@media (min-width: 1600px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1199.98px) {
    .view-grid,
    .view-grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .view-grid,
    .view-grid--3,
    .view-grid--2 {
        grid-template-columns: 1fr;
    }

    .view-card--wide {
        grid-column: auto;
    }

    .view-card {
        min-height: 0;
    }

    .view-card__body {
        max-height: none;
    }

    .view-card__header {
        grid-template-columns: 1fr;
        gap: .25rem;
        padding-bottom: .45rem;
    }

    .view-card__actions {
        justify-content: flex-start;
    }

    .page-heading {
        flex-direction: column;
    }

    .content-surface form[method=get] > .input {
        flex-basis: 100%;
        max-width: none;
    }
}

@media (max-width: 575.98px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .module-card {
        min-height: 0;
    }

    .view-header__actions .button,
    .view-header__actions button,
    .view-header__actions form {
        width: 100%;
    }
}

@media print {
    .view-grid {
        display: block;
    }

    .view-card {
        margin-bottom: 8px;
        border-color: #999;
        box-shadow: none;
        break-inside: avoid;
    }

    .view-card__body {
        max-height: none;
        overflow: visible;
    }

    .view-header__actions,
    .view-card__actions {
        display: none !important;
    }
}
