/* ════════════════════════════════════════════
   BROWSE PAGE — browse.css
   Depends on styles.css design tokens
════════════════════════════════════════════ */

/* ── Browse Header ───────────────────────────────────────────────── */
.browse-header {
  background: #0d1b2a;
  padding: 44px 24px 36px;
}
.browse-header-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.browse-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
}
.browse-subtitle {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.55);
  margin: 0;
}

/* ── Browse Body ─────────────────────────────────────────────────── */
.browse-body {
  background: #f4f7fb;
  min-height: 60vh;
  padding: 36px 24px 80px;
}
.browse-layout {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* ── Filter Panel ────────────────────────────────────────────────── */
.filter-panel {
  width: 248px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  padding: 24px 20px;
  position: sticky;
  top: 88px;   /* clears the site-nav */
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.filter-panel-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0d1b2a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.filter-clear-all {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.78rem;
  color: #00b4d8;
  text-decoration: none;
}
.filter-clear-all:hover { text-decoration: underline; }

/* ── Filter Groups ───────────────────────────────────────────────── */
.filter-group {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid #eef2f6;
}
.filter-group:last-of-type { border-bottom: none; margin-bottom: 0; }

.filter-group-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #8fa3b1;
  margin: 0 0 10px;
}

.filter-radio {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.88rem;
  color: #4a6274;
  transition: background 0.15s;
  margin-bottom: 2px;
}
.filter-radio:hover { background: #f0f9fc; }
.filter-radio.checked {
  background: rgba(0,180,216,0.10);
  color: #0d1b2a;
  font-weight: 600;
}
.filter-radio input[type="radio"] {
  accent-color: var(--cat-color, #00b4d8);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.85rem;
  color: #3a4a5a;
  transition: background 0.15s;
  margin-bottom: 2px;
}
.filter-checkbox:hover { background: #f0f9fc; }
.filter-checkbox.checked {
  background: rgba(0,180,216,0.10);
  color: #0d1b2a;
  font-weight: 600;
}
.filter-checkbox input[type="checkbox"] {
  accent-color: #00b4d8;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  cursor: pointer;
}

.filter-apply-btn {
  width: 100%;
  padding: 11px;
  background: #00b4d8;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 20px;
  transition: background 0.2s;
}
.filter-apply-btn:hover { background: #0096b8; }

/* ── Browse Main ─────────────────────────────────────────────────── */
.browse-main { flex: 1; min-width: 0; }

/* ── Active Chips ────────────────────────────────────────────────── */
.active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #00b4d8;
  color: #fff;
  border-radius: 20px;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.active-chip:hover { background: #0096b8; }
.active-chip--clear {
  background: #4a6274;
}
.active-chip--clear:hover { background: #0d1b2a; }
.chip-x {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.85;
}

/* ── Sort Bar ────────────────────────────────────────────────────── */
.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.sort-bar-count {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.92rem;
  color: #6b7f8e;
  margin: 0;
}
.sort-options {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sort-label {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.82rem;
  color: #8fa3b1;
  margin-right: 2px;
}
.sort-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid #d0dce5;
  background: #fff;
  color: #4a6274;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}
.sort-btn:hover {
  border-color: #00b4d8;
  color: #00b4d8;
}
.sort-btn.active {
  background: #00b4d8;
  border-color: #00b4d8;
  color: #fff;
}

/* ── Browse Grid ─────────────────────────────────────────────────── */
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
}

/* ── Browse Card ─────────────────────────────────────────────────── */
.browse-card {
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(13,27,42,0.07);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}
.browse-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 28px rgba(13,27,42,0.13);
}

.browse-card-img {
  position: relative;
  height: 200px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f4f7fb;
}
.browse-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.45s ease;
}
.browse-card:hover .browse-card-img img { transform: scale(1.06); }
.browse-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.browse-card-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 12px;
  border-radius: 100px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.67rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.browse-card-body {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.browse-card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #0d1b2a;
  margin: 0;
  line-height: 1.3;
}

.browse-card-desc {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.82rem;
  color: #6b7f8e;
  line-height: 1.5;
  margin: 0 0 12px;
  flex: 1;
}

.browse-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.browse-stat {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: #4a6274;
}
.browse-stat--done {
  color: #2d6a4f;
  background: #d8f3dc;
  padding: 2px 8px;
  border-radius: 100px;
}

/* ── Pagination ──────────────────────────────────────────────────── */
.browse-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.page-btn {
  padding: 9px 20px;
  background: #fff;
  border: 1.5px solid #d0dce5;
  border-radius: 10px;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #0d1b2a;
  text-decoration: none;
  transition: all 0.15s;
}
.page-btn:hover {
  border-color: #00b4d8;
  color: #00b4d8;
}
.page-numbers { display: flex; align-items: center; gap: 4px; }
.page-num {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #4a6274;
  text-decoration: none;
  transition: all 0.15s;
}
.page-num:hover { background: #f0f9fc; color: #00b4d8; }
.page-num.active {
  background: #00b4d8;
  color: #fff;
}
.page-ellipsis {
  color: #8fa3b1;
  padding: 0 4px;
  font-size: 0.88rem;
}

/* ── Empty State ─────────────────────────────────────────────────── */
.browse-empty {
  text-align: center;
  padding: 60px 24px;
}
.browse-empty-icon { font-size: 3.5rem; margin-bottom: 16px; }
.browse-empty h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.3rem;
  color: #0d1b2a;
  margin: 0 0 10px;
}
.browse-empty p {
  color: #6b7f8e;
  margin: 0 0 24px;
  font-family: 'Open Sans', sans-serif;
}
.browse-empty-btn {
  display: inline-block;
  padding: 12px 28px;
  background: #00b4d8;
  color: #fff;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s;
}
.browse-empty-btn:hover { background: #0096b8; }

/* ── Footer (browse page) ────────────────────────────────────────── */
.browse-page .site-footer {
  background: #0d1b2a;
  color: rgba(255,255,255,0.55);
  padding: 28px 24px;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.85rem;
}
.browse-page .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.browse-page .footer-links { display: flex; gap: 20px; }
.browse-page .footer-links a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
}
.browse-page .footer-links a:hover { color: #fff; }

/* ── Mobile Filter Button ────────────────────────────────────────── */
.mobile-filter-btn {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: #0d1b2a;
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 13px 24px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transition: background 0.2s;
}
.mobile-filter-btn:hover { background: #00b4d8; }
.mobile-filter-count {
  background: #00b4d8;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Filter Overlay (mobile) ─────────────────────────────────────── */
.filter-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,27,42,0.5);
  z-index: 399;
}
.filter-overlay.open { display: block; }

/* ── Tablet ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .browse-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 899px) {
  .browse-layout { display: block; }

  .browse-body { padding: 24px 16px 100px; }

  /* Filter panel becomes a bottom drawer */
  .filter-panel {
    display: block;
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    border-radius: 22px 22px 0 0;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 400;
    transition: bottom 0.3s ease;
    padding: 24px 20px 32px;
  }
  .filter-panel.open { bottom: 0; }

  .mobile-filter-btn {
    display: flex;
  }

  .filter-apply-btn { margin-top: 16px; }

  .browse-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .sort-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .browse-header { padding: 32px 16px 24px; }
}

@media (max-width: 480px) {
  .browse-grid { grid-template-columns: 1fr; }
}

/* ── Hazard filter note ───────────────────────────────────────────── */
.browse-hazard-note {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.85rem;
  color: #5a6a7a;
  background: #fff8ec;
  border-left: 3px solid #f77f00;
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin: 0 0 16px;
  line-height: 1.5;
}
.browse-hazard-note a {
  color: #00b4d8;
  text-decoration: underline;
}

.finder-hazard-note {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.82rem;
  color: #5a6a7a;
  background: #fff8ec;
  border-left: 3px solid #f77f00;
  border-radius: 0 8px 8px 0;
  padding: 9px 13px;
  margin: 12px 0 0;
  line-height: 1.5;
}
