/* 政府開放資料區塊 — 沿用既有節奏與色票，只補這個區塊需要的樣式 */

.qg-live-section .v3-section-head,
.qg-live-section .v4-section-head,
.qg-live-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* visual-lock（實際上線的版面）用的區塊 */
section.qg-live-section {
  margin: 24px auto 40px;
  max-width: 1180px;
  padding: 26px 28px 30px;
}

.qg-live-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
}

.qg-live-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: transform 200ms cubic-bezier(0.22, 0.68, 0.32, 1), box-shadow 200ms ease;
}

.qg-live-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(31, 41, 55, 0.1);
}

.qg-live-cta > span {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.qg-live-cta strong {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1f2937;
}

.qg-live-cta small {
  font-size: 0.8125rem;
  color: #6b7280;
}

.qg-live-cta > svg:last-child {
  flex: none;
  opacity: 0.4;
  transition: transform 200ms ease;
}

.qg-live-cta:hover > svg:last-child {
  transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
  .qg-live-cta { transition: none; }
  .qg-live-cta:hover { transform: none; }
  .qg-live-cta:hover > svg:last-child { transform: none; }
}

.qg-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.qg-live-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(31, 41, 55, 0.1);
  background: #fff;
  overflow: hidden;
}

.qg-live-card img {
  width: 100%;
  height: 132px;
  object-fit: cover;
}

.qg-live-card > div {
  padding: 12px 14px 14px;
  display: grid;
  gap: 6px;
}

.qg-live-card h3 {
  margin: 0;
  font-size: 0.9688rem;
  font-weight: 700;
  line-height: 1.45;
}

.qg-live-card p {
  margin: 0;
  font-size: 0.8438rem;
  line-height: 1.6;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qg-live-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.qg-live-meta span {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.05);
  font-size: 0.75rem;
  color: #4b5563;
}

.qg-live-badge {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(31, 41, 55, 0.16);
  background: rgba(31, 41, 55, 0.04);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #4b5563;
  white-space: nowrap;
}

.qg-live-lead {
  margin: 4px 0 18px;
  max-width: 62ch;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: #4b5563;
}

.qg-live-notes {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid rgba(31, 41, 55, 0.1);
  background: rgba(255, 255, 255, 0.62);
}

.qg-live-notes h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
}

.qg-live-notes + .qg-live-notes {
  margin-top: 12px;
}

.qg-live-notes ul,
.qg-live-notes ol {
  margin: 0;
  padding-left: 1.1em;
  display: grid;
  gap: 8px;
}

.qg-live-notes li {
  font-size: 0.9063rem;
  line-height: 1.7;
  color: #4b5563;
}

.qg-live-sources {
  margin: 14px 0 0;
  font-size: 0.8125rem;
  line-height: 1.75;
  color: #6b7280;
  word-break: break-word;
}

.qg-live-sources a {
  color: #4b5563;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.qg-live-sources a:hover,
.qg-live-sources a:focus-visible {
  color: #1f2937;
}

@media (max-width: 640px) {
  .qg-live-section .v3-section-head {
    flex-wrap: wrap;
  }

  .qg-live-lead {
    font-size: 0.9063rem;
  }
}

/* 首頁探索區：主題／停留時間／室內外／雨天篩選、精選路線分頁、動態場域地圖。
   這些控制項接的是 destination.places（示範＋政府開放資料）與 guideList 既有資料，
   沒有另外發明資料格式。 */

.ql-filter-panel .ql-chips-wrap {
  /* 讓主題晶片自然換行長高，不要內縮成一個小視窗還要滾動找選項——
     7 個主題在 210px 寬的側欄本來就會超過一個固定高度。 */
  padding-right: 2px;
}

/* content-typography-v55.css 的全站重置把 button 的 font-size 收成
   inherit，蓋掉了 .ql-chips button 原本的 12px；.ql-panel h2 的通用字級
   規則也連帶把這個窄側欄的標題撐到 22px。這裡把兩個字級找回來，只補
   側欄篩選面板這一塊，不動其他共用 .ql-panel／button 樣式。 */
body.ql-visual-lock .ql-desktop-page .ql-filter-panel h2 {
  font-size: 15px;
}

.ql-filter-panel .ql-chips button {
  font-size: 12px;
}

/* 「查看內容」「加入路線」這兩個按鈕文字在窄欄位常常從中間斷成「加入路／線」
   這種難看的斷法。各自包一個 nowrap span，斷行只會發生在兩個詞組之間
   （查看／內容、加入／路線），不會斷在詞組中間。 */
.ql-place-card > div:last-child button span {
  white-space: nowrap;
}

.ql-filter-note,
.ql-empty-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 4px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(31, 41, 55, 0.05);
  color: #6b7280;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.ql-filter-note svg,
.ql-empty-note svg {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
}

.ql-empty-note {
  grid-column: 1 / -1;
  background: #fffdf8;
  border: 1px solid rgba(23, 78, 91, 0.12);
}

.ql-route-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px 12px;
}

.ql-route-guide-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #d9cfbf;
  border-radius: 13px;
  background: #fffdf8;
  overflow: hidden;
}

.ql-route-guide-card > img {
  width: 100%;
  aspect-ratio: 1.7 / 1;
  object-fit: cover;
}

.ql-route-guide-card > div {
  padding: 12px 14px 14px;
  display: grid;
  gap: 6px;
}

.ql-route-guide-card h3 {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--ql-navy);
}

.ql-route-guide-card p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #57544c;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ql-route-guide-card .ql-meta {
  display: flex;
  gap: 12px;
  color: #656158;
  font-size: 0.75rem;
}

.ql-route-guide-card .ql-primary {
  margin-top: 4px;
  min-height: 38px;
}

.ql-map-source {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin: 0 0 10px;
  color: #6b7280;
  font-size: 0.75rem;
  line-height: 1.55;
}

.ql-map-source svg {
  flex: none;
  width: 13px;
  height: 13px;
  margin-top: 1px;
}

.ql-map-scatter {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 11px;
  background:
    linear-gradient(rgba(23, 78, 91, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 78, 91, 0.06) 1px, transparent 1px),
    #f7f3ea;
  background-size: 20% 20%;
  border: 1px solid #d3c7b2;
}

.ql-map-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--ql-action, #174e5b);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 8px rgba(23, 78, 91, 0.35);
  cursor: pointer;
}

.ql-map-dot:hover,
.ql-map-dot:focus-visible {
  background: var(--ql-action-hover, #103e4a);
}

.ql-map-panel-list .ql-map-list {
  display: grid;
  gap: 8px;
}

.ql-map-list-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid #d9cfbf;
  border-radius: 10px;
  background: #fffdf8;
  text-align: left;
  color: var(--ql-navy);
}

.ql-map-list-item img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.ql-map-list-item span {
  display: grid;
  font-size: 0.875rem;
}

.ql-map-list-item small {
  color: #77716a;
  font-size: 0.75rem;
}

@media (max-width: 900px) {
  .ql-route-guide-grid {
    grid-template-columns: 1fr;
  }
}

.qg-live-image-disclosure {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 1;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(31, 53, 66, .84);
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: .04em;
}

/* The discovery shell keeps fixed side columns.  On a normal laptop that left
   four live-data cards about 130px wide, which made real shop names and card
   actions collapse into vertical text. */
@media (min-width: 1251px) and (max-width: 1440px) {
  body.ql-visual-lock .ql-desktop-hero {
    grid-template-columns: 110px minmax(0, 1fr) 250px;
    gap: 20px;
    padding-inline: 42px;
  }

  body.ql-visual-lock .ql-hero-mascot { width: 96px; }

  body.ql-visual-lock .ql-scope-select {
    min-width: 0;
    padding-inline: 14px;
  }

  body.ql-visual-lock .ql-discovery-layout {
    grid-template-columns: 190px minmax(0, 1fr) 320px;
  }

  body.ql-visual-lock .ql-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Below this range the map remains useful as a full-width second row instead
   of competing with the result grid for horizontal space. */
@media (min-width: 901px) and (max-width: 1250px) {
  body.ql-visual-lock .ql-desktop-hero {
    grid-template-columns: 94px minmax(0, 1fr) 220px;
    gap: 16px;
    padding-inline: 28px;
  }

  body.ql-visual-lock .ql-hero-mascot { width: 84px; }

  body.ql-visual-lock .ql-scope-select {
    min-width: 0;
    padding-inline: 12px;
  }

  body.ql-visual-lock .ql-discovery-layout {
    grid-template-columns: 190px minmax(0, 1fr);
    grid-template-areas:
      "sidebar results"
      "map map";
  }

  body.ql-visual-lock .ql-discovery-sidebar { grid-area: sidebar; }
  body.ql-visual-lock .ql-discovery-main { grid-area: results; }
  body.ql-visual-lock .ql-map-panel { grid-area: map; }
  body.ql-visual-lock .ql-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* A category fallback may preserve the layout, but it is never a merchant
   photo. Keep that disclosure visible at every desktop width. */
body.ql-visual-lock .ql-place-card { position: relative; }
body.ql-visual-lock .ql-place-card .ql-image-disclosure {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 1;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(31, 53, 66, .84);
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: .04em;
}

/* Keep title, source metadata, and actions in a stable rhythm.  The favourite
   control already has an accessible aria-label, so it can be an icon-sized
   tap target rather than stealing width from the two labelled actions. */
@media (min-width: 901px) and (max-width: 1440px) {

  body.ql-visual-lock .ql-place-card h3 {
    min-height: 2.64em;
    white-space: normal;
    overflow: hidden;
  }

  body.ql-visual-lock .ql-place-card .ql-meta {
    min-height: 2.8em;
    align-content: start;
    flex-wrap: wrap;
    gap: 4px 9px;
  }

  body.ql-visual-lock .ql-place-card > div:last-child {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px;
  }

  body.ql-visual-lock .ql-place-card > div:last-child button {
    min-width: 0;
    height: 38px;
    padding-inline: 4px;
    white-space: nowrap;
  }

  body.ql-visual-lock .ql-place-card > div:last-child button:last-child {
    padding: 0;
    font-size: 0;
  }

  body.ql-visual-lock .ql-place-card > div:last-child button:last-child::after {
    content: "♡";
    font-size: 18px;
    line-height: 1;
  }
}
