:root {
    --pt-hauteur-ligne: 1.71cm;
}

/* --- Layout général : 3 colonnes centrées --- */
#pt-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: nowrap;
    max-width: 1100px;
    margin: 0 auto;
}

/* Colonne 1 : paramètres */
#pt-left {
    flex: 0 0 230px;
}

/* Colonne 2 : fiche (400 px) */
#pt-center {
    flex: 0 0 auto;
}

/* Colonne 3 : pictos */
#pt-right {
    flex: 0 0 260px;
}

/* --- Bouton imprimer --- */
#pt-print {
    display: inline-block;
    margin-bottom: 16px;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    background: #1B9C85;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}
#pt-export-jpg {
    display: inline-block;
    margin-bottom: 16px;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    background: #1B9C85;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

/* --- Zone paramètres, plus compacte --- */
#pt-params {
    margin-top: 8px;
    padding: 8px 10px;
}

#pt-params h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    text-align: left;
    color: #1B9C85;
}

.pt-field {
    margin-bottom: 6px;
    font-size: 14px;
}

.pt-field label {
    display: block;
    margin-bottom: 2px;
}

.pt-field select,
.pt-field input[type="color"] {
    width: 100%;
    box-sizing: border-box;
}

/* champs texte/couleur sur la même ligne */
.pt-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pt-inline label {
    margin-bottom: 0;
    margin-right: 6px;
    flex: 1 1 auto;
}

.pt-inline input[type="color"] {
    width: 44px;
    flex: 0 0 auto;
    padding: 0;
}

/* checkbox "paramètres par défaut" */
.pt-defaults label {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- Banque de pictos : 2 colonnes, scrollable --- */
#pt-right h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 18px;
    color: #1B9C85;
}

#pt-picto-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    height: 450px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
}
/* Dans la médiathèque de pictos, on ignore les <br> que Gutenberg ajoute */
#pt-picto-list br {
    display: none;
}

#pt-picto-list img {
    width: 100%;
    height: auto;
    object-fit: contain;
    cursor: pointer;
}

/* --- Fiche rituels --- */
/* Fiche rituels : format physique */
#ptitemps-table-rituel {
    width: 6.9cm;
    height: 17.1cm;
    margin: 0 auto;
    font-family: "Quicksand", sans-serif;
    background-color: #FFFFFF;
}

/* La table occupe toute la fiche */
#ptitemps-table-rituel .pt-rituel-table {
    width: 100%;
    height: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    border-spacing: 0;
}

/* 10 lignes de hauteur identique : ~1,71 cm chacune */
/* Lignes */
#ptitemps-table-rituel .pt-rituel-table tr {
    height: var(--pt-hauteur-ligne);
}

#ptitemps-table-rituel td {
    border: 1px solid rgba(0,0,0,0.5);
    padding: 0;
    text-align: center;
    vertical-align: middle;
    /* pas de display:flex ici */
}

/* Colonne texte : même hauteur + line-height = centrage vertical “forcé” */
#ptitemps-table-rituel .pt-texte-cell {
    width: 5.2cm;
    height: var(--pt-hauteur-ligne);
    line-height: var(--pt-hauteur-ligne);
    font-weight: 700;
    font-size: 22px;
    color: #1B9C85;
    text-align: center;
}

#ptitemps-table-rituel .pt-picto-cell {
    width: 30%;
}

/* pictos 1,5 cm dans la 2e colonne */
#ptitemps-table-rituel .pt-picto-cell img {
    width: 1.5cm;
    height: 1.5cm;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
/* Cellule prête à recevoir un picto en glisser-déposer */
#ptitemps-table-rituel .pt-picto-cell.pt-drag-over {
    background-color: rgba(27, 156, 133, 0.08);
    outline: 2px dashed #1B9C85;
    outline-offset: -2px;
}


/* Cellule pictogramme sélectionnée */
.pt-selected-cell {
    outline: 2px solid #1B9C85;
    outline-offset: -2px;
}

/* --- Impression : on ne garde que la fiche --- */
/* 1) Taille de page demandée au navigateur/printeur */
@page {
    size: 6.9cm 17.2cm;
    margin: 0;
}

@media print {

    /* On enlève marges par défaut */
    html, body {
        margin: 0;
        padding: 0;
    }

    /* Cibler uniquement la page du planning – adapte le numéro si nécessaire */
    body.page-id-1091 .site-header,
    body.page-id-1091 .site-footer,
    body.page-id-1091 #masthead,
    body.page-id-1091 #colophon,
    body.page-id-1091 .ast-mobile-header-wrap,
    body.page-id-1091 .entry-header,
    body.page-id-1091 .entry-title,
    body.page-id-1091 .ast-breadcrumbs-wrapper {
        display: none !important;
    }

    /* Ne garder que le layout du planning */
    body.page-id-1091 #pt-left,
    body.page-id-1091 #pt-right,
    body.page-id-1091 #pt-print {
        display: none !important;
    }

    body.page-id-1091 #pt-layout {
        margin: 0;
        justify-content: center;
    }

    body.page-id-1091 #ptitemps-table-rituel {
        margin: 0 auto;
    }
}
