/* GLYPH MAP (style page, "Glyph map" tab)
   Layers over main.css and style-page.css.
   Same skeleton as the type tester and file specs: a green 10% panel that hangs
   from the 20px bar under the tabs, and a white card beside it. The panel filters
   the map and inspects one glyph; the card is the map, drawn from the SVG font. */


.glyphControls {
    grid-column: span 3;
    align-self: start;
    position: sticky;
    top: 0;
    z-index: 50;
    margin-top: -20px;
    background-color: rgba(21, 71, 52, 0.1);
    padding: 20px;
    border-radius: 0 0 10px 10px;
}

.glyphGroup {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.glyphGroup .specsLabel {
    margin-bottom: 0;
}

.glyphGroup + .glyphGroup {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(21, 71, 52, 0.35);
}

/* the details follow the preview directly: their own first hairline is the divider */
.glyphGroup + .glyphDetails {
    margin-top: 12px;
    padding-top: 0;
    border-top: 0;
}

.glyphCount {
    font-size: 0.875em;
}

/* the inspected glyph on a white square, with its metric lines */
.glyphPreview {
    background-color: #FFF;
    aspect-ratio: 1;
    line-height: 0;
}

.glyphPreview svg, .glyph svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.glyphPreview .metric {
    stroke: rgba(21, 71, 52, 0.2);
    stroke-width: 1px;
    vector-effect: non-scaling-stroke;
    fill: none;
}

/* the baseline is the one stronger line */
.glyphPreview .metric-base {
    stroke: rgba(21, 71, 52, 0.55);
}

/* the map: square cells in a hairline grid */
.glyphMap {
    grid-column: span 7;
    background-color: #FFF;
    padding: 20px;
    min-width: 0;
}

.glyphGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    border-top: 1px solid rgba(21, 71, 52, 0.35);
    border-left: 1px solid rgba(21, 71, 52, 0.35);
}

.glyph {
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-right: 1px solid rgba(21, 71, 52, 0.35);
    border-bottom: 1px solid rgba(21, 71, 52, 0.35);
    border-radius: 0;
    background-color: transparent;
    color: #000;
    cursor: pointer;
    transition: 200ms;
}

.glyph:hover {
    background-color: rgba(21, 71, 52, 0.1);
}

.glyph:focus-visible {
    outline: 2px solid #154734;
    outline-offset: -2px;
}

/* the inspected glyph is a black block, as the active tab is */
.glyph.glyph-active {
    background-color: #111;
    color: #FFF;
}

.glyph[hidden] {
    display: none;
}

.glyphEmpty {
    padding: 20px 0;
}

@media only screen and (max-width: 1410px) {
    .glyphMap {
        grid-column: span 5;
    }
}

/* 6 columns: the panel lies across the top, one group per column, and stays sticky */
@media only screen and (max-width: 1150px) {
    .glyphControls {
        grid-column: span 6;
        display: grid;
        grid-template-columns: 1fr 140px 1fr;
        column-gap: 40px;
    }
    .glyphGroup + .glyphGroup, .glyphGroup + .glyphDetails {
        position: relative;
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }
    .glyphGroup + .glyphGroup::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: -20px;
        border-left: 1px solid rgba(21, 71, 52, 0.35);
    }
    .glyphDetails {
        justify-content: flex-end;
    }
    .glyphMap {
        grid-column: span 6;
    }
}

@media only screen and (max-width: 880px) {
    .glyphControls {
        grid-column: span 5;
        column-gap: 20px;
        grid-template-columns: 1fr 120px 1fr;
    }
    .glyphGroup + .glyphGroup::before {
        left: -10px;
    }
    .glyphMap {
        grid-column: span 5;
    }
}

/* 4 columns: filter and details stack beside a smaller preview; the panel scrolls with the page */
@media only screen and (max-width: 760px) {
    .glyphControls {
        grid-column: span 4;
        position: static;
        grid-template-columns: 1fr 120px;
        row-gap: 20px;
    }
    .glyphDetails {
        grid-column: span 2;
    }
    .glyphGroup + .glyphDetails::before {
        content: none;
    }
    .glyphMap {
        grid-column: span 4;
    }
    .glyphGrid {
        grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    }
}
