.photos-admin {
  max-width: 1100px;
}

.photos-title-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .8rem;
  margin-bottom: .6rem;
}

.photos-title-row p,
.photos-list-heading p {
  margin-bottom: 0;
}

.photos-export {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.photos-import {
  background: #fff;
  border: 1px solid var(--ecru-fonce);
  border-radius: 16px;
  box-shadow: 0 8px 26px rgba(90, 40, 30, .06);
  padding: 1rem;
  margin: 1.2rem 0 2rem;
}

.photos-import h3 {
  margin-bottom: .35rem;
}

.photos-import > p {
  color: #5e6975;
  font-size: .94rem;
}

.photos-import-actions {
  display: grid;
  gap: 1rem;
}

.photo-upload-form,
.photo-caption-form,
.photo-order-actions form,
.photo-main-actions form {
  margin: 0;
}

.photo-upload-form {
  display: grid;
  gap: .65rem;
}

.photo-picker {
  position: relative;
  min-height: 154px;
  margin: 0;
  padding: 1rem;
  border: 2px dashed #b8c9d3;
  border-radius: 14px;
  background: #f4f8fa;
  color: var(--encre);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}

.photo-picker:hover,
.photo-picker:focus-within {
  border-color: var(--mer);
  background: #eaf3f7;
}

.photo-picker:active {
  transform: scale(.99);
}

.photo-picker-camera {
  border-color: #d7b5ae;
  background: #fbf2ef;
}

.photo-picker-camera:hover,
.photo-picker-camera:focus-within {
  border-color: var(--rouge);
  background: #f8e8e4;
}

.photo-picker-icon {
  font-size: 2rem;
  line-height: 1;
  color: var(--mer);
}

.photo-picker-camera .photo-picker-icon {
  color: var(--rouge);
}

.photo-picker small {
  color: #687582;
}

.photo-picker input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.photo-upload-submit {
  min-height: 48px;
  margin: 0;
}

.photo-upload-submit:disabled {
  opacity: .48;
}

.photo-upload-status {
  margin-top: 1rem;
  padding: .9rem;
  border-radius: 12px;
  background: var(--ecru);
  border: 1px solid var(--ecru-fonce);
}

.photo-upload-status.is-error {
  background: #f9e7e5;
  border-color: #e5bcb8;
  color: var(--rouge-fonce);
}

.photo-upload-status progress {
  display: block;
  width: 100%;
  height: .75rem;
  margin: .65rem 0;
  accent-color: var(--vert);
}

.photo-upload-files {
  margin: .5rem 0 0;
  padding-left: 1.2rem;
  color: #58636e;
  font-size: .88rem;
  overflow-wrap: anywhere;
}

.photo-upload-retry {
  min-height: 46px;
  margin: .8rem 0 0;
}

.photos-list-heading {
  margin-bottom: 1rem;
}

.photos-list-heading h3 {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .25rem;
}

.photo-count {
  min-width: 1.8rem;
  height: 1.8rem;
  padding: 0 .45rem;
  border-radius: 999px;
  background: var(--mer-claire);
  color: var(--mer-fonce);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 600 .82rem 'Jost', sans-serif;
}

.photos-empty {
  text-align: center;
  border: 2px dashed var(--ecru-fonce);
  background: #fff;
  box-shadow: none;
}

.photos-empty > span {
  display: block;
  color: var(--rouge);
  font-size: 2.4rem;
}

.photos-empty h3 {
  margin: .35rem 0;
}

.photos-grid {
  display: grid;
  gap: 1rem;
}

.photo-admin-card {
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--ecru-fonce);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(90, 40, 30, .07);
}

.photo-admin-card.is-cover {
  border: 2px solid var(--vert);
}

.photo-admin-card figure {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 0;
  background: var(--ecru);
  overflow: hidden;
}

.photo-admin-card figure img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.photo-position,
.photo-cover-badge {
  position: absolute;
  top: .65rem;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  font-size: .78rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
}

.photo-position {
  left: .65rem;
  min-width: 30px;
  background: rgba(24, 32, 38, .82);
}

.photo-cover-badge {
  right: .65rem;
  padding: 0 .75rem;
  background: var(--vert);
}

.photo-card-body {
  padding: .9rem;
}

.photo-caption-form label {
  margin-bottom: .3rem;
  font-weight: 600;
}

.photo-caption-form label small {
  font-weight: 400;
  color: #6d7782;
}

.photo-caption-row {
  display: grid;
  gap: .5rem;
}

.photo-caption-row input,
.photo-caption-row button {
  min-height: 48px;
  margin: 0;
}

.photo-order-actions,
.photo-main-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-top: .75rem;
}

.photo-order-actions button,
.photo-main-actions button,
.photo-main-actions a[role="button"] {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: .55rem .65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .88rem;
}

.photo-main-actions form:first-child:nth-last-child(3),
.photo-main-actions form:first-child:nth-last-child(3) + a,
.photo-main-actions form:first-child:nth-last-child(3) + a + form {
  grid-column: 1 / -1;
}

.photo-delete {
  color: var(--rouge) !important;
  border-color: #d9aaa5 !important;
}

.photo-delete:hover,
.photo-delete:focus {
  color: #fff !important;
  background: var(--rouge) !important;
  border-color: var(--rouge) !important;
}

.photo-original-name {
  display: block;
  margin-top: .75rem;
  color: #7a848e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 620px) {
  .photos-title-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .photos-export {
    width: auto;
  }

  .photos-import {
    padding: 1.25rem;
  }

  .photos-import-actions,
  .photos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-caption-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .photo-caption-row button {
    width: auto;
  }

  .photo-main-actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .photo-main-actions form:first-child:nth-last-child(3),
  .photo-main-actions form:first-child:nth-last-child(3) + a,
  .photo-main-actions form:first-child:nth-last-child(3) + a + form {
    grid-column: auto;
  }
}

@media (min-width: 980px) {
  .photos-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
