/**
 * File Path: assets/css/admin/formatting/formatting-layout-thumbnails.css
 * Formatting tab layout + layout thumbnail grid + SVG canvas (Phase 4c, PLG-053)
 * Component of mbs-admin-settings-formatting.css — extracted Session 100.
 * Enqueued by MBS_Tab_Formatting with dep: mbs-admin-settings-formatting.
 */

/* ========================================================= */
/* FORMATTING TAB LAYOUT (Phase 4c)                          */
/* ========================================================= */

/* Tab wrapper — generous max-width, small top padding. */
.mbs-tab-formatting {
    max-width: 1400px;
    padding-top: 12px;
}

.mbs-tab-formatting > h2 {
    margin-bottom: 8px;
}

/* Hairline divider between field groups inside a single card. */
.mbs-card-divider {
    border: 0;
    border-top: 1px solid #f0f0f1;
    margin: 18px 0;
}

/* Layout-picker cell needs extra vertical padding because the thumbnail
   grid adds significant height below the dropdown. */
.mbs-formatting-layout-cell {
    margin-bottom: 4px;
}

/* ------------------------------------------------ */
/* LAYOUT THUMBNAIL GRID                          */
/* ------------------------------------------------ */

.mbs-layout-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 12px;
    margin: 12px 0 8px 0;
    max-width: 820px;
}

/* Individual thumbnail button — reset native button styling, add card look. */
.mbs-layout-thumbnail {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    background: #fff;
    border: 2px solid #dcdcde;
    border-radius: 6px;
    padding: 10px 10px 8px;
    cursor: pointer;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
    font: inherit;
    color: inherit;
    text-align: center;
    min-height: 110px;
}

.mbs-layout-thumbnail:hover:not(.is-disabled):not(:disabled) {
    border-color: var(--mbs-status-info);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.mbs-layout-thumbnail:focus {
    outline: none;
    border-color: var(--mbs-status-info);
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.25);
}

.mbs-layout-thumbnail.is-selected {
    border-color: var(--mbs-status-info);
    background: #f0f6fc;
    box-shadow: 0 0 0 1px var(--mbs-status-info);
}

.mbs-layout-thumbnail.is-disabled,
.mbs-layout-thumbnail:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.mbs-layout-thumbnail-label {
    font-size: 12px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.mbs-layout-thumbnail-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--mbs-lavender-pale);
    color: #5a3a72;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 2px 6px;
    border-radius: 8px;
    text-transform: uppercase;
    line-height: 1.4;
}

/* ----- Illustrated SVG canvas (PLG-053) ----- */
.mbs-layout-thumbnail-canvas {
    position: relative;
    display: block;
    height: 72px;
    width: 100%;
    background: #f6f7f7;
    border-radius: 3px;
    overflow: hidden;
}

.mbs-layout-thumbnail-canvas img {
    display: block;
    width: 100%;
    height: 72px;
    object-fit: fill;
    border-radius: 3px;
}

/* Selected state: blue tint overlay on the canvas. */
.mbs-layout-thumbnail.is-selected .mbs-layout-thumbnail-canvas::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(34, 113, 177, 0.12);
    border-radius: 3px;
    pointer-events: none;
}
