/* /breeds/ 品種百科（2026-12-02）。只有品種百科的頁面載入，放在 /styles.css 後面。
 * 手機優先；桌機沿用 styles.css 的 on-doc 兩欄（左邊標題停住，右邊內容）。
 * :hover 只放在最下面的 (hover: hover) 區塊（tests/hover.test.mjs）。 */
[hidden] { display: none !important; }

/* 麵包屑 */
.br-crumbs ol { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; font-size: .875rem; color: var(--muted); }
.br-crumbs li { display: inline-flex; align-items: center; }
.br-crumbs li + li::before { content: "›"; margin: 0 6px; color: var(--muted); }
.br-crumbs a { display: inline-block; padding: 12px 0; color: var(--primary); font-weight: 600; text-decoration: none; }
.br-crumbs [aria-current] { padding: 12px 0; }

.br-h1-en { display: block; margin-top: 2px; font-size: .95rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.br-nozh { margin: -6px 0 10px; }
.br-jump { margin: 0 0 12px; }
.br-jump a { display: inline-flex; align-items: center; min-height: 44px; color: var(--sos); font-weight: 700; text-underline-offset: 3px; }

/* 品種照片（2026-12-03）：不裁切、不放大；直的、比較小的照片置中，兩邊是淺色底。署名一定要看得到（CC 授權）。 */
.br-photo { margin: 0 0 16px; }
.br-photo-frame { display: flex; justify-content: center; background: var(--surface-2); border-radius: 16px; overflow: hidden; }
.br-photo img { display: block; width: auto; max-width: 100%; height: auto; max-height: min(75vw, 460px); }
.br-photo figcaption { margin-top: 6px; font-size: .75rem; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.br-photo figcaption a { color: inherit; text-underline-offset: 2px; }

.br-tool { margin: 14px 0 4px; }
.br-tool a { font-weight: 700; color: var(--primary); text-underline-offset: 3px; white-space: nowrap; }

/* 基本資料 */
.br-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0; font-size: .95rem; }
.br-dl dt { color: var(--muted); }
.br-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.br-dl a { display: inline-block; padding: 10px 0; margin: -10px 0; }
.fact-src { color: var(--muted); font-size: .8125rem; }
.br-note { margin: 10px 0 0; }

/* 急症 */
.card.br-urgent { background: var(--sos-soft); border-color: #efc6bd; box-shadow: none; }
.br-urgent h2 { color: #6e1d14; }
.br-em { padding: 12px 0; border-top: 1px solid #efc6bd; }
.br-em:first-of-type { border-top: 0; padding-top: 4px; }
.br-em h3 { font-size: 1.02rem; color: #6e1d14; margin-bottom: 4px; }
.br-em p { margin: 0 0 6px; }
.br-em-lead { font-weight: 700; }
.br-ref { margin: 4px 0 0; }
.br-ref a { display: inline-block; min-width: 32px; padding: 12px 4px; margin: -12px 0; text-align: center; }
.br-calm { margin: 12px 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); color: var(--ink); }
.br-er-btns { display: grid; gap: 8px; }
.br-general { margin-top: 14px; padding-top: 12px; border-top: 1px solid #efc6bd; }
.br-general h3 { font-size: 1rem; }
body.on-doc .card.br-urgent a:not(.btn) { color: #8a2a1e; }

/* 文字段落 */
.br-text h3 { margin-top: 12px; }
.br-text p:last-child { margin-bottom: 0; }
.br-faq-item + .br-faq-item { margin-top: 14px; }
.br-faq-item h3 { font-size: 1rem; margin-bottom: 4px; }

/* 相關品種、來源 */
.br-rel { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.br-rel a { display: flex; flex-direction: column; justify-content: center; min-height: 48px; padding: 6px 0; font-weight: 700; text-underline-offset: 3px; }
.br-rel .small { font-weight: 400; }
.br-src { margin: 0; padding-left: 1.6em; font-size: .875rem; line-height: 1.5; }
.br-src li { margin: 0 0 8px; overflow-wrap: anywhere; }
.br-src li:target { background: var(--warn-bg); border-radius: 6px; }
.br-src a { display: inline; padding: 6px 0; }

/* 索引：常見品種捷徑 */
.br-quick ul { list-style: none; margin: 4px 0 12px; padding: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.br-quick ul::-webkit-scrollbar { display: none; }
.br-quick a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; white-space: nowrap; font-size: .9rem; font-weight: 600; }

/* 搜尋 */
.br-search { position: relative; }
.br-q-label { display: block; font-weight: 700; margin-bottom: 6px; }
.br-search input[type="search"] {
  width: 100%; min-height: 50px; padding: 10px 14px;
  border: 1px solid #d8cdbf; border-radius: 12px; background: #fff; color: var(--ink);
  font: inherit; font-size: 1.05rem; -webkit-appearance: none; appearance: none;
}
.br-fs { border: 0; margin: 12px 0 0; padding: 0; min-width: 0; }
.br-fs legend { font-weight: 700; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.br-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: #efe7dc; border-radius: 14px; }
.br-seg label { position: relative; display: block; }
.br-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.br-seg span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 10px; font-weight: 700; color: var(--muted); cursor: pointer; }
.br-seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.br-seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.br-more { margin-top: 10px; }
.br-more > summary { min-height: 44px; display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--teal); font-weight: 700; }
.br-nsel:not(:empty) { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--teal); color: #fff; font-size: .8rem; }
.br-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.br-chip { position: relative; display: inline-flex; }
.br-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.br-chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 12px; border: 1px solid #d8cdbf; border-radius: 999px; background: #fff; font-size: .9rem; cursor: pointer; }
.br-chip input:checked + span { border-color: var(--teal); background: var(--teal-soft); color: #5c2a56; font-weight: 700; }
.br-chip input:checked + span::before { content: "✓"; margin-right: 4px; }
.br-chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.br-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.br-status p { margin: 0; font-weight: 700; }

/* 結果列表 */
.br-sec-h { font-size: 1.05rem; margin: 18px 0 8px; }
.br-anchor { display: block; position: relative; top: -80px; }
.br-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.br-item {
  display: flex; gap: 12px; align-items: flex-start; min-height: 64px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); text-decoration: none;
}
.br-ico { width: 34px; height: 34px; flex: none; margin-top: 2px; padding: 5px; border-radius: 10px; background: var(--primary-soft); color: var(--primary);
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
li[data-sp="cat"] .br-ico { background: var(--lav-soft); color: var(--lav-ink); }
.br-thumb { width: 60px; height: 60px; flex: none; border-radius: 12px; object-fit: cover; background: var(--surface-2); } /* 縮圖已經照貓狗的頭裁好正方形（share/breed-photos/scripts/headcrop.swift），這裡不再裁 */
.br-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.br-name { font-weight: 700; font-size: 1.02rem; line-height: 1.35; }
.br-pill { font-size: .75rem; padding: 1px 8px; margin-left: 4px; vertical-align: 2px; white-space: nowrap; }
.br-en { color: var(--muted); font-size: .875rem; }
.br-meta { color: var(--muted); font-size: .875rem; }
.br-risks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.br-risk { font-size: .8125rem; padding: 1px 8px; border-radius: 999px; background: var(--sos-soft); color: #7a2117; }
.br-empty { text-align: center; }

.br-item:active, .br-quick a:active, .br-chip span:active, .br-seg span:active, .br-crumbs a:active, .br-rel a:active { filter: brightness(.94); }
.br-item, .br-quick a, .br-chip span, .br-seg span, .br-crumbs a, .br-rel a, .br-jump a { -webkit-tap-highlight-color: transparent; }

@media (min-width: 640px) {
  .br-list { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  body.on-breeds .br-quick { display: none; } /* 桌機右邊就是常見品種清單，左邊不用再列一次 */
  body.on-breeds .br-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  body.on-breeds #main > .br-list-sec, body.on-breeds #main > .br-empty { grid-column: 2; }
  body.on-breeds .br-er-btns { grid-template-columns: 1fr 1fr; }
  body.on-breeds .br-dl { font-size: 1rem; }
  body.on-breeds .br-photo img { max-height: min(62vh, 520px); }
  body.on-breeds .page-head .br-h1-en { font-size: clamp(1rem, 1.1vw, 1.35rem); margin-top: 6px; }
}

@media (hover: hover) {
  .br-item:hover { border-color: #cdb9c9; background: var(--surface-2); }
  .br-quick a:hover, .br-chip span:hover { background: var(--surface-2); }
  .br-crumbs a:hover, .br-rel a:hover, .br-jump a:hover { text-decoration: underline; }
}
@media (prefers-reduced-motion: reduce) {
  .br-quick ul { scroll-behavior: auto; }
}
.br-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* 跳到某一段時，不要被頂端固定列擋住 */
body.on-breeds section[id], body.on-breeds .br-src li, body.on-breeds .br-anchor { scroll-margin-top: 88px; }
