/* Clients wall (owner, 2026-11-17: "the most beautiful, impressive and respectable", orderly instead of dark and white
   logos mixed at random, in colour; a critic's fixes the same day, and "also the home page").
   One grid of hairlines. Every cell is filled with its colour: white, black, or the brand's own colour. The logo is
   a clean version of the original, in its own colours on a transparent ground, all at the same visual weight.
   Order, in whole rows of eight: the owner's first eight; three rows on black; one row of brand colours; the white
   ones. On the home page the black and colour rows come first, at half the cell size.
   Markup: barami_client_wall_tile() and barami_client_wall_home() in inc/content.php; page-pazel.php, front-page.php.
   Data: assets/data/client-wall.json. To go back, see data/deploys/ (deploy_files.py --undo). */

body .bm-even.bm-inkwall {
    --g: 0px;
    --bm-line: rgba(26, 26, 26, 0.11);
    gap: 0 !important;
}

/* Clients page: 2 columns on a phone (3 for the white ones), 4 on a tablet, 8 on a computer. */
@media (min-width: 640px) {
    body .bm-even.bm-inkwall { --c: 4; }
}
@media (min-width: 1024px) {
    body .bm-even.bm-inkwall { --c: 8; }
}
@media (max-width: 639px) {
    body #clients-gallery-grid.bm-inkwall > .barami-logo-tile--white {
        flex-basis: calc(100% / 3);
        max-width: calc(100% / 3);
    }
}

/* Home page: all clients at half the size: 4, 8, then 16 columns. */
body .bm-clients .bm-even.bm-inkwall { --c: 4; }
@media (min-width: 640px) {
    body .bm-clients .bm-even.bm-inkwall { --c: 8; }
}
@media (min-width: 1280px) {
    body .bm-clients .bm-even.bm-inkwall { --c: 16; }
}

body .bm-inkwall > .barami-logo-tile--ink {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 2;
    padding: 0 !important;
    background: var(--bm-cell, #fff);
    /* hairlines: every cell has its own frame and overlaps its neighbours by one pixel, so two frames meet as one
       line, also in a centred last row */
    border: 1px solid var(--bm-line);
    margin: 0 0 -1px -1px;
    border-radius: 0 !important;
    overflow: hidden;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
}

/* Black and colour cells: the frame takes the cell's colour, so a band reads as one surface. */
body .bm-inkwall > .barami-logo-tile--ink:not([style*="#ffffff"]) {
    border-color: var(--bm-cell);
    z-index: 1;
}

.barami-logo-tile--ink > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.barami-logo-tile--ink .bm-wall__logo,
.barami-logo-tile--ink img {
    display: block;
    width: 86%;
    height: auto;
    max-width: none;
    max-height: none;
    aspect-ratio: 8 / 5;
    object-fit: contain;
    border-radius: 0 !important;
    clip-path: none !important;
    transition: opacity 0.35s ease;
}

@media (hover: hover) and (pointer: fine) {
    .barami-logo-tile--ink:hover img {
        opacity: 0.72;
    }
}

.barami-logo-tile--ink a:focus-visible {
    outline: 1px solid #1a1a1a;
    outline-offset: -6px;
}
.barami-logo-tile--ink:not([style*="#ffffff"]) a:focus-visible {
    outline-color: #fff;
}

/* Less empty cream between the end of the wall and the footer. */
section:has(> #clients-gallery-grid.bm-inkwall) {
    padding-bottom: 96px;
}

@media (prefers-reduced-motion: reduce) {
    .barami-logo-tile--ink img {
        transition: none;
    }
}
