/**
 * ACF Image Focus Styles
 *
 * Styles pour le bouton et la modale de sélection du point de focus
 * sur les champs image ACF natifs.
 */

/* ==========================================================================
   Bouton Focus
   ========================================================================== */

.acf-image-uploader.has-focus-button .show-if-value.image-wrap {
  position: relative;
}

.acf-image-focus-button {
  position: absolute;
  top: 8px;
  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;
}

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

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

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

/* ==========================================================================
   Modale Focus
   ========================================================================== */

.acf-image-focus-modal {
  position: fixed;
  inset: 0;
  z-index: 100100;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.acf-image-focus-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.acf-image-focus-modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.acf-image-focus-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1d2327;
}

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

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

.acf-image-focus-modal-close:focus {
  outline: 2px solid #2271b1;
  outline-offset: -2px;
}

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

.acf-image-focus-modal-body {
  padding: 20px;
  overflow: auto;
}

.acf-image-focus-description {
  margin: 12px 0 0;
  font-size: 13px;
  color: #646970;
  text-align: center;
}

/* ==========================================================================
   Focus Wrapper
   ========================================================================== */

.acf-image-focus-wrapper {
  position: relative;
  max-width: 800px;
  max-height: 60vh;
  margin: 0 auto;
  border-radius: 4px;
  overflow: hidden;
  cursor: crosshair;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: #f0f0f1;
}

.acf-image-focus-wrapper img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
  user-select: none;
  pointer-events: none;
}

.acf-image-focus-dot {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #2271b1;
  border: 3px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 10;
  transition:
    left 0.1s ease,
    top 0.1s ease;
}

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