/*!
 * fileholder-local.css
 * Styles for fileholder-local.js. Replaces the markup+styles that the dead
 * appdevs.cloud CDN module used to inject.
 * Accent colour #5a5278 matches the existing admin theme.
 */

.fh-wrap { width: 100%; }

/* the real <input type="file"> stays in the form, just invisible */
.fh-original {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}

.fh-zone {
  position: relative;
  min-height: 190px;
  padding: 0;
  border: 2px dashed #d5d8e4;
  border-radius: 10px;
  background: #fbfbfe;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .18s, background .18s, box-shadow .18s;
  outline: none;
}
.fh-zone:hover,
.fh-zone:focus-visible {
  border-color: #5a5278;
  background: #f7f6fd;
}
.fh-zone.fh-dragging {
  border-color: #5a5278;
  background: #f1effb;
  box-shadow: 0 0 0 4px rgba(90, 82, 120, .12);
}
.fh-zone.has-file { border-style: solid; }

/* ---------- empty state ---------- */
.fh-empty {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 22px 16px;
  text-align: center;
  font-family: "Karla", sans-serif;
}
.fh-icon-wrap {
  width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #eeecf7;
  color: #5a5278;
  margin-bottom: 3px;
}
.fh-title { font-size: 15px; font-weight: 700; color: #383d4c; }
.fh-browse { color: #5a5278; text-decoration: underline; }
.fh-hint { font-size: 12.5px; color: #8b90a3; }

/* ---------- filled state ---------- */
.fh-view { display: flex; flex-direction: column; height: 100%; }

.fh-media {
  position: relative;
  flex: 1 1 auto;
  min-height: 190px;
  background: #f1f2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.fh-img {
  max-width: 100%;
  max-height: 330px;
  object-fit: contain;
  display: block;
}
.fh-generic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #a9aec0;
}
.fh-ext {
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  color: #5a5278; background: #eeecf7;
  padding: 3px 10px; border-radius: 20px;
}
.fh-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: #16a34a;
  color: #fff;
  font-size: 11px; font-weight: 700;
  letter-spacing: .3px;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.fh-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #eceef4;
}
.fh-meta {
  display: flex; flex-direction: column;
  min-width: 0; flex: 1 1 auto;
  font-family: "Karla", sans-serif;
}
.fh-name {
  font-size: 13.5px; font-weight: 700; color: #383d4c;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.fh-size { font-size: 12px; color: #8b90a3; }

.fh-acts { display: flex; gap: 6px; flex: 0 0 auto; }
.fh-btn {
  border: 1px solid #dcdee8;
  background: #fff;
  color: #4a4f63;
  font-family: "Karla", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.fh-btn:hover { background: #f3f2fa; border-color: #b9b3d4; color: #5a5278; }
.fh-clear-btn:hover { background: #fdeceb; border-color: #f3b6b2; color: #d64545; }

/* legacy hooks that per-page CSS still targets */
.fileholder-files-view-wrp .fh-view { height: 100%; }
.fileholder-perview-single .fh-img,
.accept-single-file .fh-img { max-height: 330px; }

/* taller variant used by blog / banner image pickers */
.fh-zone.fh-tall,
.fh-zone.fh-tall .fh-empty { min-height: 330px; }
.fh-zone.fh-tall .fh-media { min-height: 330px; }

@media only screen and (max-width: 575px) {
  .fh-bar { flex-direction: column; align-items: stretch; }
  .fh-acts { justify-content: space-between; }
  .fh-btn { flex: 1 1 auto; text-align: center; }
  .fh-zone, .fh-empty, .fh-media { min-height: 160px; }
  .fh-img { max-height: 210px; }
}