/*
 * Styles d'administration FTMPUB Media Slider – v1.1
 */

/* ── Section titles ── */
.ems-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
    margin: 18px 0 6px;
    padding: 0;
    border: none;
}

/* ── Image preview zone ── */
.ems-image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px;
    min-height: 60px;
    background: #f6f7f7;
    border: 2px dashed #c3c4c7;
    border-radius: 6px;
    margin-bottom: 8px;
    align-items: center;
    transition: border-color .2s;
}

.ems-image-preview:hover {
    border-color: #2271b1;
}

.ems-placeholder {
    color: #8c8f94;
    font-style: italic;
    font-size: 13px;
    width: 100%;
    text-align: center;
    padding: 12px 0;
    pointer-events: none;
}

.ems-img-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    cursor: grab;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
    transition: transform .15s, box-shadow .15s;
}

.ems-img-wrap:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,.15);
}

.ems-img-wrap:active {
    cursor: grabbing;
}

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

.ems-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(214, 54, 56, .9);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 18px;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s;
    border: none;
    padding: 0;
}

.ems-img-wrap:hover .ems-remove {
    opacity: 1;
}

/* Sortable placeholder */
.ems-sort-placeholder {
    width: 80px;
    height: 80px;
    border: 2px dashed #2271b1;
    border-radius: 6px;
    background: rgba(34,113,177,.06);
}

/* Image count badge */
.ems-image-count {
    display: inline-block;
    font-size: 12px;
    color: #646970;
    margin-left: 10px;
    vertical-align: middle;
}

/* ── Buttons ── */
.ems-select-images.button {
    margin-top: 4px;
}

/* ── Shortcode copy ── */
.ems-shortcode-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 6px 10px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    margin-top: 6px;
}

.ems-shortcode-box code {
    background: none;
    padding: 0;
    color: #1d2327;
    font-size: 13px;
    user-select: all;
}

.ems-copy-shortcode {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #2271b1;
    color: #fff !important;
    border: none;
    border-radius: 3px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background .2s;
    text-decoration: none;
    line-height: 1.6;
}

.ems-copy-shortcode:hover {
    background: #135e96;
    color: #fff !important;
}

.ems-copy-shortcode.ems-copied {
    background: #00a32a;
}

/* ── Advanced options (edit form) ── */
.ems-advanced-toggle {
    cursor: pointer;
    color: #2271b1;
    font-weight: 500;
    font-size: 13px;
    padding: 8px 0;
    user-select: none;
}

.ems-advanced-toggle:hover {
    color: #135e96;
}

/* ── Advanced options (add form – <details>) ── */
details.ems-advanced-options {
    margin-top: 12px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 0;
}

details.ems-advanced-options > summary {
    cursor: pointer;
    padding: 10px 14px;
    font-weight: 500;
    color: #2271b1;
    background: #f6f7f7;
    border-radius: 4px;
    list-style: none;
    user-select: none;
}

details.ems-advanced-options > summary::-webkit-details-marker {
    display: none;
}

details.ems-advanced-options > summary::before {
    content: "▸ ";
}

details.ems-advanced-options[open] > summary {
    border-bottom: 1px solid #dcdcde;
    border-radius: 4px 4px 0 0;
}

details.ems-advanced-options[open] > summary::before {
    content: "▾ ";
}

details.ems-advanced-options > .form-field {
    padding: 6px 14px;
}

/* ── Preview container ── */
.ems-preview-container {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 6px;
}

/* ── Input fields in edit form ── */
.form-field input[type="number"],
.form-field input[type="text"],
.form-field select {
    max-width: 400px;
}

/* ── Table layout tweaks for edit screen ── */
.taxonomy-ftmpub_media_slider_group .form-table th {
    width: 220px;
}
