/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  color: #1a1a1a;
}

header, section, .fabric-search {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 0 1rem;
}

/* Dense square-image grid -------------------------------------------------- */
.fabric-grid {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px;
}

.fabric-grid li a {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.fabric-grid li img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  background: #f0f0f0;
  display: block;
}

.fabric-grid li span,
.fabric-grid li small {
  position: absolute;
  left: 4px;
  right: 4px;
  padding: 1px 4px;
  font-size: .7rem;
  line-height: 1.3;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .15s;
}

.fabric-grid li span { bottom: 20px; }
.fabric-grid li small { bottom: 4px; }
.fabric-grid li a:hover span,
.fabric-grid li a:hover small { opacity: 1; }

/* Crop-to-search ----------------------------------------------------------- */
.cropper { margin: .75rem 0; }

.cropper__stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  touch-action: none;
  cursor: crosshair;
  line-height: 0;
}

.cropper__stage img {
  max-width: 100%;
  max-height: 360px;
  border-radius: 8px;
  user-select: none;
  -webkit-user-drag: none;
}

.cropper__box {
  position: absolute;
  border: 2px dashed #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45);
  pointer-events: none;
  display: none;
}

.cropper__hint { font-size: .85rem; color: #555; margin: .35rem 0; }
.cropper[hidden] { display: none; }
