/* ---------------------------------------------------------------
   Photo manager cards (shared by buildlog.php editor and add-build.php)
   Self-contained: does not rely on buildlog.css.
   --------------------------------------------------------------- */
:root { --bl-focus: #ffbf47; }

.bim-cap {
    width: 100%;
    font-size: 14px;
    font-family: inherit;
    color: #1a1a18;
    background: #fff;
    border: 1px solid #d1cfc9;
    border-radius: 7px;
    padding: 9px 12px;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
.bim-cap:focus { outline: none; border-color: #1a1a18; box-shadow: 0 0 0 3px rgba(26,26,24,.1); }

.bim-ba-status {
    margin: 0 0 6px;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
    background: #f5f5f4;
    border: 1px solid #e2e0db;
    color: #1a1a18;
}

.bim-msg {
    min-height: 1.2em;
    margin: 0 0 8px;
    color: #a02a1e;
    font-weight: 600;
}

.bim-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.bim-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #d1cfc9;
    border-radius: 12px;
    overflow: hidden;
    transition: opacity .15s ease, border-color .15s ease;
}

.bim-card.is-dragging {
    opacity: .35;
}

.bim-card.is-removed {
    border: 2px dashed #c0392b;
}

.bim-card.is-removed .bim-card__media img {
    opacity: .3;
    filter: grayscale(1);
}

.bim-card.is-removed .bim-cap,
.bim-card.is-removed .bim-act:not(.bim-act--remove) {
    opacity: .45;
    pointer-events: none;
}

.bim-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #1a1a18;
}

.bim-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bim-pos {
    position: absolute;
    top: 8px;
    left: 8px;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(0, 0, 0, .75);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.bim-badges {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.bim-badge {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
}

.bim-badge[hidden] { display: none; }
.bim-badge--cover  { background: #ffbf47; color: #1a1a18; }
.bim-badge--before { background: #dbeafe; color: #1e40af; }
.bim-badge--after  { background: #dcfce7; color: #15803d; }

.bim-removed-note {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 10px;
    background: #c0392b;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.bim-removed-note[hidden] { display: none; }

.bim-handle {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 14px;
    line-height: 1.2;
    cursor: grab;
}

@media (hover: none) {
    .bim-handle { display: none; }
}

.bim-card__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px 12px;
}

.bim-cap-label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #1a1a18;
}

.bim-count {
    display: block;
    margin-top: 3px;
    text-align: right;
    font-size: 11px;
    color: #6b6b69;
}

.bim-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bim-act {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid #c4c2bc;
    border-radius: 7px;
    background: #fff;
    color: #1a1a18;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}

.bim-act:hover:not(:disabled) {
    background: #f1f1ef;
}

.bim-act:focus-visible {
    outline: 3px solid #1a1a18;
    outline-offset: 2px;
}

.bim-act:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.bim-act[hidden] { display: none; }

.bim-act--before[aria-pressed="true"] {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

.bim-act--after[aria-pressed="true"] {
    background: #dcfce7;
    border-color: #22c55e;
    color: #15803d;
}

.bim-act--remove {
    margin-left: auto;
    color: #a02a1e;
    border-color: #e3b5af;
}

.bim-card.is-removed .bim-act--remove {
    background: #a02a1e;
    border-color: #a02a1e;
    color: #fff;
}

