/* ============================================================
   VISBROWSER — Responsive Redesign v2
   ============================================================ */

/* --- Design Tokens --- */
:root {
  --border-color: #e0e0e0;
  --bg-muted: #f8f9fa;
  --bg-hover: #f0f0f0;
  --bg-page: linear-gradient(135deg, #f5f7fa 0%, #e4e8ee 100%);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: -4px 0 24px rgba(0,0,0,0.12);
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.75rem;
  --radius-pill: 50rem;
  --transition: 0.2s ease;
  --navbar-height: 0px;
  --detail-gap: 1rem;
  --card-min-width: 260px;
}

/* --- Base Resets --- */
*:focus { outline: 2px solid #343a40; outline-offset: 2px; }
*:focus:not(:focus-visible) { outline: none; }
*:focus-visible { outline: 2px solid #343a40; outline-offset: 2px; }

strong { font-weight: bold; }
.clear, .clearfix-both { clear: both; }
.hidden { display: none; }

body {
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-page);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; }

.hint {
  font-weight: normal;
  color: #6c757d;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

/* ============================================================
   NAVBAR
   ============================================================ */

#nav-wrapper {
  position: fixed;
  z-index: 1000000;
  top: 0;
  left: 0;
  width: 100%;
}

#nav-offset-wrapper { position: relative; }

.navbar {
  padding: 0.6rem 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin-right: 1.5rem;
}

.navbar-brand h1 {
  font-size: inherit;
  margin: 0;
  line-height: inherit;
}

.navbar-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
}

li.nav-item { display: inline-block; }

.nav-link {
  padding: 0.4rem 0.75rem !important;
  font-size: 0.95rem;
  transition: opacity var(--transition);
}

.nav-link:hover { opacity: 0.85; }

.navbar .visbrowser-search {
  width: 100%;
  border-radius: var(--radius-pill);
  padding: 0.4rem 1rem;
  border: 1px solid rgba(255,255,255,0.15);
  background-color: rgba(255,255,255,0.1);
  color: #fff;
  transition: background-color var(--transition), border-color var(--transition);
}

.navbar .visbrowser-search::placeholder { color: rgba(255,255,255,0.5); }
.navbar .visbrowser-search:focus {
  background-color: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}

.navbar form.navbar-search { width: 100%; margin: 0; }

@media (min-width: 768px) {
  .navbar form.navbar-search {
    width: auto;
    flex: 0 1 22rem;
    margin-left: auto;
  }
}

@media (max-width: 767.98px) {
  .navbar-collapse .navbar-nav {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0;
  }
  .navbar-collapse .navbar-nav .nav-link { padding: 0.6rem 0 !important; }
  .navbar-collapse .navbar-search { padding: 0.5rem 0; }
}

/* ============================================================
   FILTER PANEL — Slide-over from left
   ============================================================ */

.filter-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 340px;
  max-width: 90vw;
  background: white;
  z-index: 1000001;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
}

.filter-panel.open { transform: translateX(0); }

.filter-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.filter-panel-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.filter-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-reset-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #dc3545;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
}

.filter-reset-btn:hover {
  background-color: #dc3545;
  color: white;
  border-color: #dc3545;
}

.filter-panel-close {
  background-color: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color var(--transition);
}

.filter-panel-close:hover { background-color: #ddd; }

.filter-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1.25rem;
}

/* Filter panel backdrop */
.filter-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.35);
  z-index: 1000000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.filter-backdrop.open {
  display: block;
  opacity: 1;
}

/* Facet controls inside filter panel */
div.facet-controls {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.facet-category {
  margin-bottom: 1rem;
}

.facet-category-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-color);
}

.facet-category-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.facet-category-items .list-group-item {
  padding: 0;
  border: none;
  margin: 0;
}

.facet-category-items label {
  padding: 0.45rem 0.6rem;
  margin: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  font-size: 0.9rem;
}

.facet-category-items label[data-count="0"] { opacity: 0.45; }
.facet-category-items label:hover { background-color: var(--bg-hover); }

/* --- Custom Checkbox / Button Mode --- */
.custom-check-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  gap: 0.4rem;
}

.custom-check-wrapper.selected {
  background-color: #343a40 !important;
  color: white;
  border-radius: var(--radius-sm);
}

.custom-check-wrapper.selected .badge { background-color: white; color: #333; }

.custom-check-wrapper input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* Badge pills in facets */
.facet-category-items .badge {
  background-color: var(--bg-hover);
  padding: 0.2rem 0.45rem;
  min-width: 1.5rem;
  text-align: center;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
}

/* ============================================================
   FILTER TOOLBAR — Sticky bar with filter button + chips
   ============================================================ */

.filter-toolbar {
  position: sticky;
  top: var(--navbar-height);
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
}

.filter-toggle-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition);
  color: #343a40;
}

.filter-toggle-btn:hover {
  background-color: var(--bg-hover);
  border-color: #ccc;
}

.filter-toggle-btn .fa-filter { font-size: 0.75rem; }

.filter-count-badge {
  display: none;
  background-color: #343a40;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  min-width: 1.2rem;
  text-align: center;
}

.filter-count-badge.visible { display: inline-block; }

/* Active filter chips */
.active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  overflow: hidden;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  background-color: #343a40;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition);
}

.filter-chip:hover { background-color: #555; }

.filter-chip i { font-size: 0.8rem; }

.filter-chip .chip-remove {
  margin-left: 0.2rem;
  font-size: 0.65rem;
  opacity: 0.7;
}

.filter-chip .chip-remove:hover { opacity: 1; }

/* ============================================================
   CARDS
   ============================================================ */

#tool-display {
  padding: 1rem 15px;
}

.card {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  background: white;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.card:focus {
  box-shadow: inset 0 0 0 3px #343a40, var(--shadow-md);
}

/* Card grid */
div.card-grid-wrapper {
  margin-top: 0.5rem;
  width: 100%;
  padding: 4px;
}

div.card-grid-wrapper.shuffle div.card {
  margin-bottom: 10px;
  min-width: var(--card-min-width);
}

/* Responsive card widths for Shuffle.js */
@media (max-width: 575.98px) {
  div.card-grid-wrapper.shuffle div.card {
    width: 100% !important;
  }
}
@media (min-width: 576px) and (max-width: 767.98px) {
  div.card-grid-wrapper.shuffle div.card {
    width: calc(50% - 8px) !important;
  }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
  div.card-grid-wrapper.shuffle div.card {
    width: calc(33.333% - 8px) !important;
  }
}
@media (min-width: 1200px) {
  div.card-grid-wrapper.shuffle div.card {
    width: calc(25% - 8px) !important;
  }
}

/* When detail panel is open — card width calculated dynamically by JS */
.show-tool-details div.card-grid-wrapper.shuffle div.card {
  width: var(--detail-card-width, 100%) !important;
}

/* Card images */
div.card img {
  width: 100%;
  display: block;
  object-fit: cover;
  height: 150px;
}

@media (min-width: 576px) { div.card img { height: 170px; } }
@media (min-width: 992px) { div.card img { height: 200px; } }

.card-body { padding: 1rem 1.15rem; }

.card-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

div.card .availabilities { vertical-align: middle; padding: 0.5rem 1rem; }
div.card .availabilities i {
  display: inline-block;
  text-align: center;
  opacity: 0.65;
  height: 1.3rem;
  width: 1.3rem;
  line-height: 1.3rem;
  border-radius: 50%;
  font-size: 1rem;
  margin-right: 0.5rem;
  margin-bottom: 0.1rem;
  transition: opacity var(--transition);
}

div.card .availabilities i.fa-creative-commons-nc { font-size: 1.4rem; top: 1px; position: relative; }
div.card .availabilities i.selected { background-color: #343a40; color: white; opacity: 1; }

.card-body p.short-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
  font-size: 0.9rem;
  color: #555;
  line-height: 1.5;
}

.card-body p.short-description a.card-link {
  font-size: 0.8rem;
  color: #888;
  word-break: break-all;
}

/* ============================================================
   TOOL DETAIL PANEL — Slide-Over (right)
   ============================================================ */

div.tool-detail-wrapper {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  background: white;
  z-index: 500000;
  padding: 0;
  margin: 0;
  border: none;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  will-change: transform;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.show-tool-details div.tool-detail-wrapper {
  transform: translateX(0);
}

/* Panel width by breakpoint */
@media (max-width: 767.98px) {
  div.tool-detail-wrapper { width: 100%; border-radius: 0; }
}
@media (min-width: 768px) and (max-width: 1023.98px) {
  div.tool-detail-wrapper { width: 60vw; }
}
@media (min-width: 1024px) and (max-width: 1399.98px) {
  div.tool-detail-wrapper { width: 48vw; }
}
@media (min-width: 1400px) {
  div.tool-detail-wrapper { width: 40vw; }
}

/* Card grid width when panel open — with gap */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .show-tool-details div.card-grid-wrapper {
    width: calc(40vw - var(--detail-gap) - 15px);
  }
}
@media (min-width: 1024px) and (max-width: 1399.98px) {
  .show-tool-details div.card-grid-wrapper {
    width: calc(52vw - var(--detail-gap) - 15px);
  }
}
@media (min-width: 1400px) {
  .show-tool-details div.card-grid-wrapper {
    width: calc(60vw - var(--detail-gap) - 15px);
  }
}

/* Detail backdrop on mobile */
.detail-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 499999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.show-tool-details .detail-backdrop {
  display: block;
  opacity: 1;
}

@media (min-width: 768px) {
  .detail-backdrop { display: none !important; }
}

/* Placeholder */
div.tool-detail-wrapper .tool-detail-placeholder {
  border: 1px solid var(--border-color);
  background-color: var(--bg-muted);
  color: #555;
  width: calc(100% - 2rem);
  padding: 1.25rem;
  margin: 1rem;
  border-radius: var(--radius-md);
  text-align: center;
}

div.tool-detail-wrapper .tool-detail-placeholder.error {
  border-color: #d9534f;
  color: #8e1212;
  background-color: #fef2f2;
}

/* Detail content */
div.tool-details { background-color: white; width: 100%; display: none; }
div.tool-details.active { display: flex; flex-direction: column; height: 100%; }

/* Detail Header (Sticky) */
div.tool-details-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 2;
  background: white;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

div.tool-details-header h2 {
  font-size: 1.35rem;
  margin: 0;
  font-weight: 700;
}

div.tool-details .tool-detail-close {
  background-color: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color var(--transition);
  flex-shrink: 0;
}

div.tool-details .tool-detail-close:hover { background-color: #ddd; }

/* Detail Body */
div.tool-details-body {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1.25rem;
}

/* Pictures gallery */
div.tool-details .pictures {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  gap: 0.5rem;
  padding: 0 0 0.75rem 0;
  margin-bottom: 0.5rem;
}

div.tool-details .pictures::-webkit-scrollbar { height: 4px; }
div.tool-details .pictures::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

div.tool-details .pictures a {
  scroll-snap-align: start;
  flex-shrink: 0;
  height: 18vh;
  min-height: 120px;
  width: auto;
  min-width: 30%;
  display: block;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
}

div.tool-details .pictures img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: filter var(--transition);
}

div.tool-details .pictures a:hover img { filter: brightness(85%); }

div.tool-details .pictures i {
  position: absolute;
  font-size: 1.5rem;
  left: calc(50% - 0.75rem);
  top: calc(50% - 0.75rem);
  color: white;
  display: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

div.tool-details .pictures a:hover i { display: block; }

div.tool-details hr {
  width: 100%;
  margin: 1rem 0;
  border-top: 1px solid var(--border-color);
}

/* Hard facets as pills */
div.tool-details ul.hard-facets { padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
div.tool-details ul.hard-facets li {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  list-style: none;
  font-weight: 600;
  font-size: 0.85rem;
  background-color: var(--bg-muted);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  margin: 0;
}
div.tool-details ul.hard-facets ul { padding-left: 1.3rem; }
div.tool-details ul.hard-facets ul li {
  display: inline-block; font-weight: normal; margin-bottom: 0.1rem; margin-right: 0.5rem;
  background: none; border: none; padding: 0;
}

div.tool-details-body span.date {
  font-size: 0.8rem;
  opacity: 0.5;
  float: right;
}

div.tool-details-body span.rating-name {
  display: inline-block;
  font-weight: 700;
  min-width: 5rem;
}

div.tool-details-body .review-heading {
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

div.tool-details-body .rating-title {
  border-bottom: 1px solid var(--border-color);
  width: 100%;
  margin-bottom: 0.4rem;
  padding-bottom: 0.3rem;
}

div.tool-details-body .overall-ratings p.rating-title {
  display: inline-block;
  width: 48%;
  border: none;
  min-width: 11rem;
}

div.tool-details-body button.similar-tool-filter,
div.tool-details-body .btn.add-review {
  width: 100%;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  background-color: var(--bg-muted);
  color: #343a40;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  font-weight: 600;
  transition: background-color var(--transition), color var(--transition);
}

div.tool-details-body button.similar-tool-filter:hover,
div.tool-details-body .btn.add-review:hover {
  color: white;
  background-color: #343a40;
  border-color: #343a40;
}

/* Tabs in detail view */
div.tool-details .nav-tabs {
  border-bottom: 2px solid var(--border-color);
}

div.tool-details .nav-tabs .nav-link {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-weight: 600;
  font-size: 0.9rem;
}

div.tool-details .tab-content { padding-top: 0.5rem; }

/* ============================================================
   HEADER MESSAGE
   ============================================================ */

div.header-message {
  width: 100%;
  border: 1px solid var(--border-color);
  background-color: var(--bg-muted);
  padding: 1rem;
  margin-top: 3rem;
  margin-bottom: 2rem;
  text-align: center;
  border-radius: var(--radius-md);
}

div.header-message.green {
  background-color: #f1fbf2cc;
  border-color: #b7e4c7;
}

div.header-message p { margin: 0; font-size: 1rem; }
div.header-message p i { margin-right: 0.5rem; }

/* ============================================================
   FORMS
   ============================================================ */

.create h1 {
  text-align: center;
  padding: 1.5rem 0;
  font-size: 1.75rem;
}

.create form input,
.create form textarea {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid #c0c0c0;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.create form input:focus,
.create form textarea:focus {
  border-color: #343a40;
  box-shadow: 0 0 0 3px rgba(52,58,64,0.12);
}

.create form label {
  display: block;
  width: 100%;
  color: #000;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.create form button { clear: both; display: block; }

fieldset {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

legend {
  background-color: #343a40;
  color: #fff;
  padding: 0.3rem 0.75rem;
  display: inline-block;
  width: auto;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
}

.tag-button i { margin-left: 0.3rem; align-self: baseline; }

.tag-button {
  background-color: var(--bg-hover);
  border-radius: var(--radius-sm);
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border-color);
  transition: background-color var(--transition);
}

.tag-button:hover { background-color: #ddd; }

form { margin-bottom: 1rem; }
form input[type="submit"] {
  font-size: 1.2rem;
  font-weight: 700;
  width: 100%;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  background-color: #343a40;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color var(--transition);
}

form input[type="submit"]:hover { background-color: #23272b; }

form img.captcha { width: 10rem; margin-bottom: 1rem; border-radius: var(--radius-sm); }
form fieldset ul { list-style: none; }
form fieldset ul li { display: inline-block; }

form fieldset textarea { height: 5rem; margin-top: 0.3rem; margin-bottom: 1rem; }
form fieldset input[type="url"],
form fieldset input[type="text"],
form fieldset input[type="email"] { margin-bottom: 1rem; }

form fieldset textarea,
form fieldset input[type="url"],
form fieldset input[type="text"],
form fieldset input[type="email"] { width: 100%; }

@media (min-width: 768px) {
  form fieldset textarea,
  form fieldset input[type="url"],
  form fieldset input[type="text"],
  form fieldset input[type="email"] { width: 90%; }
}

form fieldset ul { margin: 0; padding: 0; margin-bottom: 0.6rem; }
form fieldset ul li label { font-size: 1.4rem; }
form fieldset ul li label:hover { cursor: pointer; opacity: 0.5; }

form fieldset.facets ul li { margin-right: 1.5rem; }
form fieldset.facets label {
  display: inline-block;
  font-size: 1rem;
  margin-bottom: 0.7rem;
  cursor: pointer;
}

@media (max-width: 575.98px) { form fieldset.facets label { width: 100%; } }
@media (min-width: 576px) and (max-width: 767.98px) { form fieldset.facets label { width: 48%; min-width: 0; } }
@media (min-width: 768px) { form fieldset.facets label { width: 32%; min-width: 10rem; } }

form fieldset.facets h5 { margin-top: 1rem; margin-bottom: 0.7rem; }
form fieldset.facets label input { width: 1rem; vertical-align: middle; }
ul.errorlist { display: block; padding-left: 1rem; }
ul.errorlist li { list-style: disc; display: list-item; }

/* ============================================================
   STAR RATING — Clickable interactive stars
   ============================================================ */

/* Django 5.x RadioSelect renders as div > div > label, not ul > li > label */
fieldset.rating > div {
  display: flex;
  flex-direction: row;
  gap: 0.15rem;
  padding: 0.25rem 0;
  margin-bottom: 0.75rem;
}

fieldset.rating > div > div {
  display: inline-block;
}

fieldset.rating > div > div label {
  display: inline-block;
  margin: 0;
  padding: 0.15rem;
  font-size: 1.6rem;
  cursor: pointer;
  opacity: 1;
  transition: transform 0.1s ease;
}

fieldset.rating > div > div label:hover {
  transform: scale(1.2);
  opacity: 1 !important;
}

fieldset.rating > div > div input[type="radio"] {
  display: none;
}

fieldset.rating > div > div label .fas.fa-star {
  color: #d0d0d0;
  transition: color 0.15s ease;
}

/* ============================================================
   EDIT CONTENT
   ============================================================ */

a.edit-content { opacity: 0.6; position: absolute; right: 0; top: 0; }
a.edit-content:hover { opacity: 1; }

/* ============================================================
   UTILITY
   ============================================================ */

body.detail-open { overflow: hidden; }

@media (min-width: 768px) {
  body.detail-open { overflow: auto; }
}

body.filter-open { overflow: hidden; }

/* ============================================================
   UPVOTE BUTTON
   ============================================================ */

.upvote-button {
  background-color: var(--bg-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition);
}

.upvote-button:hover { background-color: var(--bg-hover); }
