/* ==========================================================================
   Contrôle Focus dans la sidebar médiathèque
   ========================================================================== */

.image-focus-control {
  border-bottom: 1px solid #dcdcde;
}

.image-focus-control label.setting {
  margin: 0;
  padding: 16px;
}

.image-focus-control label.setting .name {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

/* ==========================================================================
   Preview avec bouton (sidebar médiathèque)
   ========================================================================== */

.image-focus-preview {
  position: relative;
  width: 100%;
  max-width: 150px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  background: #f0f0f1;
}

.image-focus-preview img {
  width: 100%;
  display: block;
  user-select: none;
  pointer-events: none;
}

.image-focus-dot-preview {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #2271b1;
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 5;
}

.image-focus-preview .image-focus-button {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  color: #1e1e1e;
}

.image-focus-preview .image-focus-button:hover {
  background: #fff;
  color: #2271b1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.image-focus-preview .image-focus-button:focus {
  outline: 2px solid #2271b1;
  outline-offset: 1px;
}

.image-focus-preview .image-focus-button svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Modale Focus - Reset complet
   ========================================================================== */

.image-focus-modal,
.image-focus-modal *,
.image-focus-modal *::before,
.image-focus-modal *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

/* ==========================================================================
   Modale Focus - Structure
   ========================================================================== */

.image-focus-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.image-focus-modal .image-focus-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
}

.image-focus-modal .image-focus-modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  width: auto;
  max-width: 850px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==========================================================================
   Modale Focus - Header
   ========================================================================== */

.image-focus-modal .image-focus-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  background: #fff;
  flex-shrink: 0;
}

.image-focus-modal .image-focus-modal-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #1d2327;
  line-height: 1.4;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell,
    "Helvetica Neue", sans-serif;
}

.image-focus-modal .image-focus-modal-close {
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #646970;
  transition: all 0.15s ease;
}

.image-focus-modal .image-focus-modal-close:hover {
  background: #f0f0f1;
  color: #1d2327;
}

.image-focus-modal .image-focus-modal-close .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
  line-height: 20px;
}

/* ==========================================================================
   Modale Focus - Body
   ========================================================================== */

.image-focus-modal .image-focus-modal-body {
  padding: 20px;
  overflow: auto;
  text-align: center;
  background: #f6f7f7;
  flex: 1;
  min-height: 0;
}

.image-focus-modal .image-focus-description {
  margin-top: 12px;
  font-size: 13px;
  color: #646970;
  text-align: center;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell,
    "Helvetica Neue", sans-serif;
}

/* ==========================================================================
   Modale Focus - Image Wrapper
   ========================================================================== */

.image-focus-modal .image-focus-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: calc(80vh - 140px);
  border-radius: 4px;
  overflow: hidden;
  cursor: crosshair;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  background: #1a1a1a;
  line-height: 0;
}

.image-focus-modal .image-focus-wrapper img {
  display: block;
  max-width: 800px;
  max-height: calc(80vh - 140px);
  width: auto;
  height: auto;
  user-select: none;
  pointer-events: none;
}

/* Point de focus */
.image-focus-modal .image-focus-dot {
  position: absolute;
  width: 24px;
  height: 24px;
  background: #2271b1;
  border: 3px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 10;
  transition:
    left 0.15s ease,
    top 0.15s ease;
}

/* Grille de composition (rule of thirds) */
.image-focus-modal .image-focus-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
  pointer-events: none;
}

/* ==========================================================================
   Modale Focus - Actions
   ========================================================================== */

.image-focus-modal .image-focus-actions {
  margin-top: 16px;
  text-align: center;
}

.image-focus-modal .image-focus-remove {
  color: #b32d2e;
  border-color: #b32d2e;
}

.image-focus-modal .image-focus-remove:hover {
  background: #b32d2e;
  color: #fff;
  border-color: #b32d2e;
}
