/* Nearme page styles — MUST match web/naerme.html look */
:root {
  --primary-color: #007AFF;
  --dark-overlay: rgba(0, 0, 0, 0.7);
  --border-gray: #e0e0e0;
  --pill-bg: #f0f2f5;
}
main{
  min-height: 98vh;
}

/* --- 2. Header/Search area --- */
.header-section {
  background: linear-gradient(var(--dark-overlay), var(--dark-overlay)),
    var(--nearme-hero-bg, url("../images/nearme_bg.webp")) center/cover;
  padding: 60px 20px 10px;
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-section h1 {
  font-size: 42px;
  margin-bottom: 5px;
  letter-spacing: -1px;
  margin-top: 10px;
}

.header-section .desc {
  font-size: 16px;
  opacity: 0.8;
  margin: 5px 0;
}

.category-table {
  border-collapse: separate;
  border-spacing: 10px 0;
  margin-bottom: 25px;
  background: transparent;
  border-radius: 14px;
  padding: 4px;
}

.category-table td {
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.18s, border-color 0.18s, transform 0.12s, color 0.18s;
  white-space: nowrap;
  user-select: none;
  backdrop-filter: blur(10px);
}

.category-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}

.category-link:focus-visible {
  outline: 2px solid rgba(147, 197, 253, 0.7);
  outline-offset: 3px;
  border-radius: 999px;
}

.category-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.category-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.92);
}

.category-ic svg {
  width: 18px;
  height: 18px;
  display: block;
}

.category-table .category-ic img {
  width: 16px;
  height: 16px;
  display: block;
  object-fit: contain;
}

.category-table td:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.category-table td.active {
  background: rgba(0, 122, 255, 0.20);
  border-color: rgba(147, 197, 253, 0.55);
  font-weight: 700;
}

.category-txt {
  letter-spacing: 0.2px;
}

/* Location row */
.location-wrapper {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  flex-wrap: wrap;
}

.nearme-loc-field {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.nearme-loc-input-row {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0;
}

.location-wrapper .search-panel-clear {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.location-wrapper .search-panel-clear:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* input-clear.js toggles [hidden]; keep flex slot so input width does not jump on focus */
.location-wrapper .nearme-loc-input-row .search-panel-clear {
  flex: 0 0 auto;
}

.location-wrapper .nearme-loc-input-row .search-panel-clear[hidden] {
  display: flex !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.location-wrapper .nearme-loc-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.location-input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 11px;
  flex: 1;
  min-width: 0;
  width: auto;
}

.nm-suggest--loc {
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
}

.location-input::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

/* Suggest dropdown (for qwerpdf suggest API) */
.nm-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  width: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  z-index: 50;
  text-align: left;
}

.nm-suggest__item {
  padding: 10px 12px;
  font-size: 13px;
  color: #111;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nm-suggest__item:last-child {
  border-bottom: 0;
}

.nm-suggest__item:hover,
.nm-suggest__item.is-active {
  background: #eef6ff;
  color: var(--primary-color);
}

.loc-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 11px;
  transition: 0.2s;
}

.loc-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Search */
.search-container {
  width: 100%;
  max-width: 750px;
  display: flex;
  background: #fff;
  border-radius: 50px;
  padding: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
}

.nearme-search-input-row {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 0;
}

.search-container .nearme-search-input-row .search-panel-clear {
  flex: 0 0 auto;
  margin-right: 6px;
}

/* input-clear.js: reserve slot so width does not jump when × appears */
.search-container .nearme-search-input-row .search-panel-clear[hidden] {
  display: flex !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.search-container input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 20px;
  font-size: 16px;
  border-radius: 15px;
  min-width: 0;
}

.nearme-seo-block {
  max-width: 1100px;
  margin: 0 auto;
}

.search-btn {
  width: 46px;
  height: 46px;
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
}

/* --- 3. Content area --- */
.content-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Main categories — horizontal pills (fig.2: inactive grey fill; active pale blue + blue ring + bold blue text) */
.category-stack {
  margin: 0 auto 20px;
  max-width: 1100px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.category-stack__row {
  display: inline-flex;
  flex: 0 0 auto;
  text-decoration: none;
  color: inherit;
}

.category-stack__row .category-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  padding: 10px 18px;
  min-height: 40px;
  background: var(--pill-bg);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 400;
  color: #3c4043;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  border: 1px solid transparent;
  user-select: none;
}

.category-stack .category-ic {
  color: currentColor;
  flex-shrink: 0;
  opacity: 0.85;
}

.category-stack .category-ic svg {
  width: 16px;
  height: 16px;
  display: block;
}

.category-stack .category-ic img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

.category-stack__row:hover .category-btn {
  box-shadow: 0 1px 4px rgba(60, 64, 67, 0.12);
}

.category-stack__row.active .category-btn {
  background: #eef6ff;
  color: var(--primary-color);
  font-weight: 700;
  border-color: rgba(0, 122, 255, 0.45);
  box-shadow: none;
}

.category-stack__row.active .category-ic {
  color: var(--primary-color);
  opacity: 1;
}

.category-stack__row.category-link:focus-visible {
  outline: 2px solid rgba(0, 122, 255, 0.45);
  outline-offset: 3px;
  border-radius: 999px;
}

.category-stack__row.category-link:focus-visible .category-btn {
  background: #eef6ff;
  border-color: rgba(0, 122, 255, 0.45);
}

/* Status */
.nearme-status {
  text-align: center;
  color: #666;
  font-size: 13px;
  margin: 0 0 18px;
  min-height: 1.2em;
}

/* Nearme results — one card per row */
.data-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.item-card {
  background: #fff;
  border: 1px solid var(--border-gray);
  border-radius: 12px;
  padding: 20px;
  transition: 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

a.item-card.item-card--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.item-card.item-card--link:hover h4 {
  color: var(--primary-color);
}

.item-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-color: var(--primary-color);
}

.item-card h4 {
  font-size: 17px;
  margin-bottom: 8px;
  color: #111;
}

.item-card .item-desc {
  font-size: 13px;
  color: #666;
  margin-bottom: 15px;
  line-height: 1.4;
}

.item-meta {
  border-top: 1px solid #f0f0f0;
  margin-top: auto;
  padding-top: 12px;
}

.meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.meta-line svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

/* No "load more" button — default expands all results */

@media (max-width: 500px) {
  .location-input {
    width: 120px;
  }
}

