/* Sign lists, panels and the sign board drawing. */

/* Sign lists: a place's or a lone sign's row starts with the sign (see .item-row), and panels show signs as tiles with their location below. */
.item-row-sign {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(90 * 1.25px);
    min-height: calc(45 * 1.25px);
}

.item-row-sign .mc-sign {
    --px: 1.25px;
}

.sign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 18px 12px;
}

.sign-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    text-align: center;
}

.sign-tile-caption {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    max-width: 100%;
}

.sign-tile-coords {
    color: var(--mud-palette-text-secondary);
}

/* A panel: signs in rows and columns as on the wall, a little apart so each board stands out.
   Wide panels scroll on small screens. */
.sign-panel-scroll {
    max-width: 100%;
    overflow-x: auto;
    padding: 4px;
}

.sign-panel {
    display: inline-grid;
    gap: 8px;
}

.sign-panel > div {
    display: flex;
}

.sign-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

.sign-detail-text {
    flex: 1 1 260px;
    min-width: 0;
}

.sign-location {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/*
 * A sign as 1.8 draws it: the board is 90 x 45 font pixels, with four 10 px lines centred on it
 * and each line cut at the board's width. Sizes are font pixels times --px. Without the game's
 * entity/sign.png, the board is drawn as oak planks.
 */
.mc-sign {
    --px: 1.5px;
    position: relative;
    display: inline-flex;
    flex: none;
    box-sizing: border-box;
    width: calc(90 * var(--px));
    height: calc(45 * var(--px));
    padding-top: calc(2.5 * var(--px));
    background-color: #a8874f;
    background-image: repeating-linear-gradient(180deg,
        #b4945f 0, #b4945f calc(3.75 * var(--px)), #a4844f calc(3.75 * var(--px)), #a4844f calc(11.25 * var(--px)),
        #9a7a46 calc(11.25 * var(--px)), #9a7a46 calc(15 * var(--px)));
    box-shadow: inset 0 0 0 var(--px) #6b5332, 0 2px 6px rgba(0, 0, 0, .25);
    color: #000;
    font-family: "Minecraft Texture", "Pixelify Sans", monospace;
    font-size: calc(8 * var(--px));
    line-height: calc(10 * var(--px));
    letter-spacing: calc(1.15 * var(--px));
    text-decoration: none;
    -webkit-font-smoothing: none;
}

.mc-sign.large {
    --px: 3px;
}

@media (max-width: 359.98px) {
    .mc-sign.large {
        --px: 2.5px;
    }
}

html.mc-sign-texture .mc-sign {
    background: url("../textures/sign.png") calc(-7.5 * var(--px)) calc(-7.5 * var(--px)) / calc(240 * var(--px)) calc(120 * var(--px)) no-repeat;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    image-rendering: pixelated;
}

html.mc-font .mc-sign {
    letter-spacing: 0;
}

.mc-sign-text {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.mc-sign-line {
    display: block;
    height: calc(10 * var(--px));
    overflow: hidden;
    white-space: pre;
    text-align: center;
}

.mc-sign.link:hover,
.mc-sign.link:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.mc-sign.current {
    z-index: 1;
    outline: 3px solid var(--mud-palette-warning);
    outline-offset: 2px;
}
