/* Free stock image library -- stock-images.php */

.stock-page {
  margin-bottom: 60px;
}

/* The site body is black with white text, so everything outside the modal is
   styled for a dark background. The modal keeps Materialize's white panel and
   forces dark text, the same way the site builder modals do. */

.stock-page-intro {
  max-width: 760px;
  margin: 0 auto 10px;
  color: #c8d5e4;
}

.stock-toolbar {
  margin-bottom: 0;
}

.stock-search-field {
  margin-top: 0;
}

.stock-count-col {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.stock-count {
  margin: 0;
  color: #b0bec5;
  font-size: 0.9rem;
}

.stock-clear {
  margin-left: 8px;
  color: #ff8a65;
  font-size: 0.82rem;
}

.stock-perpage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #b0bec5;
  font-size: 0.82rem;
  white-space: nowrap;
}

.stock-perpage select {
  height: 32px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  color: #eceff1;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
}

.stock-perpage select option {
  color: #212121;
  background: #fff;
}

.stock-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.stock-categories .stock-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 0.82rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.stock-categories .stock-cat:hover {
  border-color: #ff7043;
  color: #ffab91;
}

.stock-categories .stock-cat.active {
  background: #ff7043;
  border-color: #ff7043;
  color: #fff;
}

.stock-cat-count {
  font-size: 0.72rem;
  opacity: 0.75;
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.stock-card {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: #212121;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.stock-card:hover {
  box-shadow: 0 6px 18px rgba(255, 112, 67, 0.35);
  transform: translateY(-2px);
}

.stock-card img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.stock-card-overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 26px 10px 8px;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity 0.15s ease;
}

.stock-card:hover .stock-card-overlay,
.stock-card:focus .stock-card-overlay {
  opacity: 1;
}

.stock-card-label {
  font-size: 0.78rem;
  line-height: 1.2;
}

.stock-card-action .material-icons {
  font-size: 20px;
  line-height: 1;
}

.stock-empty {
  padding: 24px 0;
  color: #b0bec5;
  text-align: center;
}

.stock-empty a {
  color: #ff8a65;
}

/* Pagination ------------------------------------------------------------ */

.stock-pagination {
  /* Materialize gives a bare <nav> a coloured 56px bar with its own line
     height. This is a pagination nav, not the site nav, so undo all of it. */
  height: auto;
  line-height: normal;
  background: none;
  box-shadow: none;

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 26px;
}

.stock-page-link {
  min-width: 38px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 0.85rem;
  text-align: center;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

a.stock-page-link:hover {
  border-color: #ff7043;
  color: #ffab91;
}

.stock-page-link.current {
  background: #ff7043;
  border-color: #ff7043;
  color: #fff;
  font-weight: 600;
}

.stock-page-link.disabled {
  border-color: rgba(255, 255, 255, 0.1);
  color: #546e7a;
}

.stock-page-gap {
  padding: 6px 2px;
  color: #607d8b;
}

/* Detail modal ---------------------------------------------------------- */

.stock-modal {
  max-width: 900px;
  width: 92%;
}

/* Materialize gives the modal a white panel, but the body sets white text.
   Everything inside has to be pulled back to a dark ink. */
.stock-modal .modal-content,
.stock-modal .modal-content h5,
.stock-modal .stock-size-table td {
  color: #212121;
}

.stock-modal-row {
  margin-bottom: 0;
}

.stock-modal-preview {
  border: 1px solid #cfd8dc;
  border-radius: 10px;
  overflow: hidden;
  background: #eceff1;
}

.stock-modal-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.stock-detail-prompt {
  margin-top: 0;
  color: #607d8b;
  font-size: 0.88rem;
  line-height: 1.5;
}

.stock-size-table {
  width: 100%;
  margin-bottom: 12px;
}

.stock-size-table th {
  padding: 6px 8px;
  color: #90a4ae;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stock-size-table td {
  padding: 8px;
  border-radius: 0;
  font-size: 0.86rem;
  vertical-align: middle;
}

.stock-size-format {
  color: #90a4ae;
  font-size: 0.7rem;
}

.stock-modal-license {
  margin: 0;
  color: #78909c;
  font-size: 0.78rem;
  line-height: 1.4;
}

/* License block --------------------------------------------------------- */

.stock-license {
  margin-top: 30px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 87, 34, 0.4);
  border-left: 4px solid #ff5722;
  border-radius: 10px;
  background: rgba(255, 87, 34, 0.06);
}

.stock-license h5 {
  margin-top: 0;
  color: #ff7043;
  font-size: 1.1rem;
}

.stock-license p {
  margin: 0 0 10px;
  line-height: 1.6;
  font-size: 0.9rem;
}

.stock-license p:last-child {
  margin-bottom: 0;
}

.stock-license-note {
  color: #b0bec5;
  font-size: 0.82rem !important;
}

.stock-builder-cta {
  margin-top: 24px;
  color: #c8d5e4;
}

@media only screen and (max-width: 600px) {
  .stock-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .stock-card img {
    height: 130px;
  }

  .stock-count-col {
    justify-content: flex-start;
    margin-bottom: 8px;
  }

  .stock-card-overlay {
    opacity: 1;
  }
}
