/*
 * Tome: the type mark and title in a band across the top, the figures ruled
 * beneath it as a two-column ledger, the text below, the source in a footer
 * rule. On a wide card the ledger stands as a column beside the text.
 */

.tome-leaf {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.tome-figures {
    flex: none;
}

.tome-card .print-card-stats {
    flex: none;
    grid-template-columns: fit-content(40%) 1fr;
    gap: 0.5mm 2mm;
    margin: 1.6mm 0 0;
    padding-bottom: 1.6mm;
    border-bottom: 0.25mm dashed color-mix(in srgb, var(--card-accent-second) 55%, transparent);
}

.tome-card .print-card-stats .stat-label {
    font-family: var(--card-label-font);
    font-size: 0.78em;
    overflow-wrap: break-word;
    hyphens: auto;
    letter-spacing: var(--card-label-spacing);
    text-transform: var(--card-label-transform);
    color: var(--card-accent-second);
}

.tome-card .print-card-stats .stat-value {
    font-size: 0.95em;
    color: var(--card-ink);
}

.tome-card .print-card-footer {
    flex: none;
    min-height: calc(1.34em + 1.35mm);
    margin-top: 1.6mm;
    padding-top: 1.1mm;
    border-top: 0.25mm solid var(--card-rule);
    font-family: var(--card-subtitle-font);
    font-size: 0.78em;
    font-style: italic;
    color: var(--card-ink-faint);
}

/* A wide card tall enough for it keeps the ledger as a column beside the
   text; a low wide card runs the ledger in four columns above the text. */
@container card (orientation: landscape) and (max-height: 70mm) {
    .tome-card .print-card-stats {
        grid-template-columns: fit-content(22%) 1fr fit-content(22%) 1fr;
        column-gap: 2.6mm;
    }
}

@container card (orientation: landscape) and (min-height: 70mm) {
    .tome-leaf {
        flex-direction: row;
        gap: 3mm;
    }

    .tome-figures {
        flex: 0 0 34%;
        min-width: 0;
        margin-top: 1.6mm;
        padding-right: 3mm;
        border-right: 0.25mm dashed var(--card-rule);
    }

    .tome-card .print-card-stats {
        grid-template-columns: 1fr;
        row-gap: 0.9mm;
        margin: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .tome-card .print-card-stats .stat-value {
        margin-bottom: 0.4mm;
    }

    .tome-card .print-card-body {
        margin-top: 1.6mm;
    }
}
