/* Photofact layout — complements Pico.css */

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.brand-link:hover strong {
  text-decoration: underline;
}

.brand-icon {
  flex-shrink: 0;
  display: block;
}

.rounded-circle {
  border-radius: 50%;
}

.brand-with-store {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-store-name {
  font-weight: 400;
  color: var(--pico-muted-color);
  white-space: nowrap;
}

.sidebar-store-switch {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pico-muted-border-color);
}

.sidebar-store-switch h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.sidebar-store-form {
  margin: 0;
}

.sidebar-store-form label {
  margin-bottom: 0.25rem;
}

.sidebar-store-form select {
  width: 100%;
  margin: 0;
}

.gallery-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .gallery-layout {
    grid-template-columns: minmax(220px, 280px) 1fr;
    align-items: start;
  }
}

.gallery-sidebar {
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  padding: 1rem;
}

.top-errors-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.top-errors-list li {
  padding: 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.top-errors-link {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  color: inherit;
  text-decoration: none;
}

.top-errors-link:hover .top-errors-label {
  text-decoration: underline;
}

.top-errors-item.is-active .top-errors-link {
  font-weight: 600;
  color: var(--pico-primary);
}

.top-errors-count {
  font-variant-numeric: tabular-nums;
  color: var(--pico-muted-color);
}

.filter-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 1rem;
  align-items: end;
}

.filter-order-group {
  display: flex;
  flex-direction: column;
}

.sidebar-order-filter {
  margin: 0 0 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.sidebar-order-filter .filter-order-group {
  margin: 0;
}

.filter-order-group > label {
  margin-bottom: 0;
}

.filter-order-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 5px 0 0;
  padding: 0.5rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-background-color);
}

.filter-order-controls input {
  width: 100%;
  margin: 0;
}

.filter-order-controls button,
.filter-order-controls a[role="button"] {
  width: 100%;
  margin: 0;
  padding: var(--pico-form-element-spacing-vertical)
    var(--pico-form-element-spacing-horizontal);
  line-height: var(--pico-line-height);
  box-sizing: border-box;
  white-space: nowrap;
}

.gallery-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.gallery-stats {
  margin: 0;
}

.gallery-stats-hint {
  margin: 0 0 0 auto;
  font-size: 0.9rem;
  text-align: right;
}

@media (max-width: 768px) {
  .gallery-stats-hint {
    margin-left: 0;
    text-align: left;
    flex-basis: 100%;
  }
}

.gallery-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 577px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(var(--gallery-columns, 3), minmax(0, 1fr));
  }
}

.gallery-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  overflow: hidden;
}

.gallery-slider {
  position: relative;
  flex: 1 1 auto;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pico-card-background-color);
  cursor: pointer;
}

.gallery-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.gallery-photo.active {
  opacity: 1;
}

.gallery-photo.no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pico-muted-color);
}

.gallery-badge {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
}

.gallery-card footer {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-shrink: 0;
  margin-top: auto;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
}

.gallery-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}

.gallery-card-picker {
  display: block;
}

.gallery-card-label {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}

.gallery-card-label .label-badge {
  flex-shrink: 0;
  line-height: 1.25;
  margin-top: 0.05rem;
}

.gallery-comment {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.25;
  color: var(--pico-muted-color);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.gallery-sentinel {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 1.5rem 0 0.5rem;
  min-height: 2rem;
}

.gallery-loading {
  color: var(--pico-muted-color);
  font-size: 0.9rem;
}

.gallery-empty {
  grid-column: 1 / -1;
}

.muted {
  color: var(--pico-muted-color);
}

.rating-notes {
  margin-top: 1.5rem;
}

.rating-count-link {
  color: inherit;
  font-variant-numeric: tabular-nums;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.rating-count-link:hover {
  color: var(--pico-primary);
}

.rating-notes p:last-child {
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pico-muted-border-color);
}

.page-footer-support {
  margin: 0;
}

.shop-brand-support {
  margin-left: auto;
  text-align: right;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

.shop-brand {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.shop-brand-label {
  white-space: nowrap;
}

.shop-brand a {
  display: inline-flex;
  line-height: 0;
}

.shop-brand img {
  height: 28px;
  width: auto;
  display: block;
}
