/* ============================
   BREED GUIDE PAGE STYLES
   ============================ */
:root {
  --clr-bg: #0f0e13;
  --clr-bg-raised: #1a1920;
  --clr-bg-card: #1e1d25;
  --clr-surface: #252430;
  --clr-border: #2e2d3a;
  --clr-text: #f0eff4;
  --clr-text-dim: #b0aec0;
  --clr-text-mute: #6e6b80;
  --clr-accent: #ffa032;
  --clr-accent2: #f59e0b;
  --ff-heading: 'Outfit', 'Noto Sans TC', sans-serif;
  --ff-body: 'Noto Sans TC', sans-serif;
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-base: 1rem;
  --fs-lg: 1.125rem; --fs-xl: 1.25rem; --fs-2xl: 1.5rem;
  --fs-3xl: 2rem; --fs-4xl: 2.5rem;
  --sp-xs: 4px; --sp-sm: 8px; --sp-md: 12px; --sp-lg: 16px;
  --sp-xl: 24px; --sp-2xl: 32px; --sp-3xl: 48px; --sp-4xl: 64px;
  --rad-sm: 6px; --rad-md: 10px; --rad-lg: 16px; --rad-xl: 24px;
  --rad-full: 999px;
  --dur-fast: .15s; --dur-med: .3s;
  --ease-out: cubic-bezier(.16,1,.3,1);
}

/* ---------- LIGHT MODE ---------- */
[data-theme="light"] {
  --clr-bg: #f5f3ef; --clr-bg-raised: #ffffff; --clr-bg-card: #ffffff;
  --clr-surface: #eae8e3; --clr-border: #d8d5cf;
  --clr-text: #1a1a1a; --clr-text-dim: #555; --clr-text-mute: #888;
  --clr-accent: #d48806; --clr-accent2: #c06b10;
}

[data-theme="light"] .guide-card { background: #fff; border-color: rgba(0,0,0,.06); box-shadow: 0 1px 6px rgba(0,0,0,.04); }
[data-theme="light"] .guide-hero { background: linear-gradient(180deg, #f0ede6 0%, #f5f3ef 100%); }
[data-theme="light"] .toc-sidebar { background: rgba(255,255,255,.7); }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--clr-bg);
  color: var(--clr-text);
  font-family: var(--ff-body);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

/* Reading Progress */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--clr-accent), #f59e0b);
  z-index: 9999; width: 0%;
  transition: width .1s linear;
}

/* Nav styles are in /css/nav.css */

/* Hero */
.guide-hero {
  position: relative; height: 50vh; min-height: 400px;
  overflow: hidden;
}
.guide-hero-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: brightness(.4);
}
.guide-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--clr-bg));
  display: flex; align-items: flex-end;
  padding: var(--sp-3xl) var(--sp-2xl);
}
.guide-hero-content { max-width: 800px; }
.guide-hero-badge {
  display: inline-block;
  padding: var(--sp-xs) var(--sp-lg);
  background: rgba(255,160,50,.15);
  color: var(--clr-accent);
  border-radius: var(--rad-full);
  font-size: var(--fs-xs); font-weight: 600;
  margin-bottom: var(--sp-md);
  border: 1px solid rgba(255,160,50,.3);
}
.guide-hero-title {
  font-family: var(--ff-heading);
  font-size: var(--fs-4xl); font-weight: 900;
  line-height: 1.2; margin-bottom: var(--sp-sm);
}
.guide-hero-subtitle {
  font-size: var(--fs-lg);
  color: var(--clr-text-dim);
  margin-bottom: var(--sp-xl);
}
.guide-hero-stats {
  display: flex; gap: var(--sp-xl); flex-wrap: wrap;
}
.guide-stat {
  display: flex; flex-direction: column; gap: 2px;
}
.guide-stat-val {
  font-family: var(--ff-heading);
  font-size: var(--fs-xl); font-weight: 700;
}
.guide-stat-label {
  font-size: var(--fs-xs); color: var(--clr-text-mute);
}

/* Layout */
.guide-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--sp-3xl);
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-3xl) var(--sp-2xl);
}

/* TOC */
.guide-toc {
  position: sticky; top: 80px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.toc-title {
  font-family: var(--ff-heading);
  font-size: var(--fs-sm); font-weight: 700;
  color: var(--clr-text-mute);
  margin-bottom: var(--sp-lg);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.toc-list { list-style: none; }
.toc-list li { margin-bottom: var(--sp-xs); }
.toc-list a {
  display: flex; align-items: center; gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  color: var(--clr-text-dim);
  text-decoration: none;
  font-size: var(--fs-sm);
  border-radius: var(--rad-sm);
  border-left: 2px solid transparent;
  transition: all var(--dur-fast);
}
.toc-list a:hover { color: var(--clr-text); background: var(--clr-surface); }
.toc-list a.active {
  color: var(--clr-accent);
  border-left-color: var(--clr-accent);
  background: rgba(255,160,50,.06);
  font-weight: 600;
}

/* Main Content */
.guide-main { min-width: 0; }

.guide-section {
  margin-bottom: var(--sp-4xl);
  scroll-margin-top: 80px;
}
.guide-section-header {
  display: flex; align-items: center; gap: var(--sp-md);
  margin-bottom: var(--sp-2xl);
  padding-bottom: var(--sp-md);
  border-bottom: 2px solid var(--clr-border);
}
.guide-section-icon { font-size: 1.5rem; }
.guide-section-title {
  font-family: var(--ff-heading);
  font-size: var(--fs-2xl); font-weight: 800;
}

/* Content Cards */
.guide-card {
  background: var(--clr-bg-raised);
  border: 1px solid var(--clr-border);
  border-radius: var(--rad-lg);
  padding: var(--sp-xl);
  margin-bottom: var(--sp-lg);
}
.guide-card h4 {
  font-family: var(--ff-heading);
  font-size: var(--fs-lg); font-weight: 700;
  margin-bottom: var(--sp-md);
  display: flex; align-items: center; gap: var(--sp-sm);
}
.guide-card p, .guide-card li {
  font-size: var(--fs-sm);
  color: var(--clr-text-dim);
  line-height: 1.9;
}
.guide-card ul {
  list-style: none; padding: 0;
}
.guide-card ul li {
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--clr-border);
  display: flex; gap: var(--sp-sm);
}
.guide-card ul li:last-child { border-bottom: none; }
.guide-card ul li::before { content: '•'; color: var(--clr-accent); font-weight: 700; }

/* Info Grid */
.guide-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-lg);
}

/* Timeline in guide */
.guide-timeline { position: relative; padding-left: 32px; }
.guide-timeline::before {
  content: ''; position: absolute;
  left: 11px; top: 0; bottom: 0;
  width: 2px; background: var(--clr-border);
}
.guide-tl-item {
  position: relative; margin-bottom: var(--sp-2xl);
}
.guide-tl-dot {
  position: absolute; left: -27px;
  width: 24px; height: 24px;
  background: var(--clr-accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  border: 3px solid var(--clr-bg);
}
.guide-tl-card {
  background: var(--clr-bg-raised);
  border: 1px solid var(--clr-border);
  border-radius: var(--rad-lg);
  padding: var(--sp-xl);
}
.guide-tl-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--sp-md);
}
.guide-tl-stage {
  font-family: var(--ff-heading);
  font-size: var(--fs-lg); font-weight: 700;
}
.guide-tl-age {
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--clr-accent);
  padding: 2px var(--sp-md);
  background: rgba(255,160,50,.1);
  border-radius: var(--rad-full);
}
.guide-tl-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
}
.guide-tl-info h5 {
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--clr-text-mute);
  margin-bottom: var(--sp-xs);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.guide-tl-info p {
  font-size: var(--fs-sm); color: var(--clr-text-dim); line-height: 1.7;
}
.guide-tl-warning {
  margin-top: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  background: rgba(245,158,11,.08);
  border-left: 3px solid var(--clr-accent2);
  border-radius: 0 var(--rad-sm) var(--rad-sm) 0;
  font-size: var(--fs-sm); color: #f59e0b;
}

/* Cost Table */
.guide-cost-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--clr-bg-raised);
  border-radius: var(--rad-lg);
  overflow: hidden;
  border: 1px solid var(--clr-border);
}
.guide-cost-table th, .guide-cost-table td {
  padding: var(--sp-md) var(--sp-lg);
  font-size: var(--fs-sm);
  text-align: left;
}
.guide-cost-table th {
  background: var(--clr-surface);
  font-weight: 600; color: var(--clr-text-dim);
}
.guide-cost-table td {
  border-bottom: 1px solid var(--clr-border);
  color: var(--clr-text-dim);
}
.guide-cost-table tr:last-child td { border-bottom: none; }
.guide-cost-table .cost-val {
  font-family: var(--ff-heading);
  font-weight: 700; color: var(--clr-accent);
}
.guide-cost-total {
  background: rgba(255,160,50,.06) !important;
}
.guide-cost-total td {
  font-weight: 700; color: var(--clr-text) !important;
  font-size: var(--fs-base) !important;
}

/* Alert Box */
.guide-alert {
  padding: var(--sp-lg) var(--sp-xl);
  border-radius: var(--rad-md);
  margin-bottom: var(--sp-lg);
  font-size: var(--fs-sm);
  line-height: 1.8;
}
.guide-alert.warn {
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.2);
  color: #f59e0b;
}
.guide-alert.info {
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.2);
  color: #a5b4fc;
}
.guide-alert.danger {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2);
  color: #fca5a5;
}
.guide-alert strong { display: block; margin-bottom: var(--sp-xs); }

/* Checklist */
.guide-checklist {
  list-style: none; padding: 0;
}
.guide-checklist li {
  display: flex; align-items: flex-start; gap: var(--sp-md);
  padding: var(--sp-md) 0;
  font-size: var(--fs-sm);
  color: var(--clr-text-dim);
  border-bottom: 1px solid var(--clr-border);
}
.guide-checklist li:last-child { border-bottom: none; }
.guide-checklist li::before {
  content: '☐'; font-size: var(--fs-base);
  color: var(--clr-accent); flex-shrink: 0;
}

/* Bottom CTA */
.guide-bottom-cta {
  padding: var(--sp-4xl) var(--sp-2xl);
  text-align: center;
}
.guide-cta-inner {
  max-width: 600px; margin: 0 auto;
  padding: var(--sp-3xl);
  background: linear-gradient(135deg, rgba(255,160,50,.06), rgba(139,92,246,.06));
  border-radius: var(--rad-xl);
  border: 1px solid var(--clr-border);
}
.guide-cta-inner h2 {
  font-family: var(--ff-heading);
  font-size: var(--fs-2xl); font-weight: 800;
  margin-bottom: var(--sp-sm);
}
.guide-cta-inner p {
  font-size: var(--fs-sm); color: var(--clr-text-dim);
  margin-bottom: var(--sp-xl);
}
.guide-cta-buttons {
  display: flex; gap: var(--sp-md);
  justify-content: center; flex-wrap: wrap;
}
.guide-cta-btn {
  padding: var(--sp-md) var(--sp-xl);
  border-radius: var(--rad-full);
  font-size: var(--fs-sm); font-weight: 600;
  text-decoration: none;
  transition: all var(--dur-fast);
  border: 2px solid var(--clr-border);
  color: var(--clr-text);
}
.guide-cta-btn:hover {
  border-color: var(--clr-accent);
  color: var(--clr-accent);
}
.guide-cta-btn.primary {
  background: linear-gradient(135deg, var(--clr-accent), #f59e0b);
  color: #0f0e13; border-color: transparent;
}
.guide-cta-btn.primary:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(255,160,50,.3);
}

/* Footer */
.guide-footer {
  padding: var(--sp-2xl);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--clr-text-mute);
  border-top: 1px solid var(--clr-border);
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.guide-section { animation: fadeInUp .5s var(--ease-out) both; }

/* Responsive */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-burger { display: block; }
  .nav-links.mobile-open {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--clr-bg-raised); border-bottom: 1px solid var(--clr-border);
    padding: var(--sp-md); gap: var(--sp-sm);
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
  }
  .nav-links.mobile-open .nav-dropdown {
    position: static; transform: none;
    opacity: 1; visibility: visible;
    box-shadow: none; border: none;
    min-width: auto; padding: 0 var(--sp-md);
  }
  .guide-layout {
    grid-template-columns: 1fr;
    padding: var(--sp-xl) var(--sp-lg);
  }
  .guide-toc {
    position: relative; top: 0;
    display: flex; flex-direction: row;
    overflow-x: auto;
    gap: var(--sp-xs);
    padding-bottom: var(--sp-md);
    border-bottom: 1px solid var(--clr-border);
    margin-bottom: var(--sp-xl);
    max-height: none;
  }
  .toc-title { display: none; }
  .toc-list {
    display: flex; gap: var(--sp-xs);
    flex-wrap: nowrap;
  }
  .toc-list li { flex-shrink: 0; }
  .toc-list a {
    border-left: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    padding: var(--sp-sm) var(--sp-md);
  }
  .toc-list a.active {
    border-left: none;
    border-bottom-color: var(--clr-accent);
  }
  .guide-hero { height: 40vh; min-height: 300px; }
  .guide-hero-title { font-size: var(--fs-2xl); }
  .guide-tl-grid { grid-template-columns: 1fr; }
  .guide-info-grid { grid-template-columns: 1fr; }
  .guide-rec-grid { grid-template-columns: 1fr; }
}

/* ─── Contextual Product Recommendation ─── */
.guide-rec {
  margin: var(--sp-xl) 0;
  border: 1px solid rgba(245, 180, 60, 0.25);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 180, 60, 0.06) 0%, rgba(245, 180, 60, 0.02) 100%);
  padding: var(--sp-xl);
  position: relative;
}
.guide-rec::before {
  content: '';
  position: absolute;
  top: 0; left: 24px;
  width: 3px; height: 28px;
  background: linear-gradient(180deg, #f5b43c, transparent);
  border-radius: 0 0 3px 3px;
}
.guide-rec-context {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #f5b43c;
  margin-bottom: var(--sp-lg);
  line-height: 1.6;
}
.guide-rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-lg);
}
.guide-rec-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  transition: border-color 0.2s;
}
.guide-rec-card:hover {
  border-color: rgba(245, 180, 60, 0.3);
}
.guide-rec-name {
  font-weight: 700;
  font-size: var(--fs-base);
  color: var(--clr-text);
}
.guide-rec-why {
  font-size: var(--fs-sm);
  color: var(--clr-text-dim);
  line-height: 1.7;
  margin: 0;
}
.guide-rec-scenarios {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.guide-rec-scenario {
  font-size: 0.75rem;
  color: rgba(245, 180, 60, 0.9);
  background: rgba(245, 180, 60, 0.1);
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.guide-rec-price {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--clr-text);
  margin-top: auto;
  padding-top: var(--sp-sm);
}
.guide-rec-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--sp-sm);
}
.guide-rec-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(245, 180, 60, 0.12);
  color: #f5b43c;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}
.guide-rec-link:hover {
  background: rgba(245, 180, 60, 0.22);
  transform: translateY(-1px);
}
.guide-rec-link.hint {
  background: rgba(255, 255, 255, 0.04);
  color: var(--clr-text-dim);
  cursor: default;
  font-weight: 400;
  font-size: 0.72rem;
}
.guide-rec-link.hint:hover {
  transform: none;
}

/* Affiliate tip blocks (medical/health recommendations) */
.affiliate-tip {
  margin: var(--sp-lg) 0;
  padding: var(--sp-lg);
  border-radius: var(--rad-md, 14px);
  background: linear-gradient(135deg, rgba(245,180,60,.06), rgba(255,120,80,.04));
  border: 1px solid rgba(245,180,60,.15);
  font-size: var(--fs-sm, .88rem);
  color: var(--clr-text-dim, #b0aec0);
  line-height: 1.8;
}
.affiliate-tip strong {
  color: var(--clr-text, #e8e6f0);
}
.affiliate-tip-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--sp-md, 12px);
}
.aff-momo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 50px;
  background: linear-gradient(135deg, #ff6b6b, #ffa032);
  color: #fff !important;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255,106,50,.2);
}
.aff-momo:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(255,106,50,.3);
}

@media (max-width: 480px) {
  .guide-hero-stats { flex-direction: column; gap: var(--sp-md); }

}

/* ─── Breed CTA Section (internal linking) ─── */
.breed-cta-section {
  background: linear-gradient(135deg, rgba(255,160,50,.04), rgba(139,92,246,.04));
  border: 1px solid rgba(255,160,50,.12);
  border-radius: var(--rad-xl);
  padding: var(--sp-3xl);
}
.breed-cta-intro {
  font-size: var(--fs-sm); color: var(--clr-text-dim);
  margin-bottom: var(--sp-xl);
}
.breed-cta-tools {
  display: flex; flex-direction: column; gap: var(--sp-md);
  margin-bottom: var(--sp-2xl);
}
.breed-cta-tool {
  display: flex; align-items: center; gap: var(--sp-lg);
  padding: var(--sp-lg) var(--sp-xl);
  background: var(--clr-bg-raised);
  border: 1px solid var(--clr-border);
  border-radius: var(--rad-lg);
  text-decoration: none; color: var(--clr-text);
  transition: all .25s var(--ease-out);
  position: relative; overflow: hidden;
}
.breed-cta-tool::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,160,50,.05), rgba(139,92,246,.05));
  opacity: 0; transition: opacity .25s;
}
.breed-cta-tool:hover {
  border-color: var(--clr-accent);
  transform: translateX(6px);
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.breed-cta-tool:hover::before { opacity: 1; }
.breed-cta-tool-icon { font-size: 1.6rem; flex-shrink: 0; z-index: 1; }
.breed-cta-tool-body { flex: 1; z-index: 1; display: flex; flex-direction: column; gap: 2px; }
.breed-cta-tool-name { font-weight: 700; font-size: var(--fs-base); }
.breed-cta-tool-desc { font-size: var(--fs-sm); color: var(--clr-text-dim); }
.breed-cta-tool-arrow {
  font-size: 1.2rem; color: var(--clr-accent);
  opacity: 0; transform: translateX(-8px);
  transition: all .25s; z-index: 1;
}
.breed-cta-tool:hover .breed-cta-tool-arrow { opacity: 1; transform: translateX(0); }

.breed-cta-articles-title {
  font-size: var(--fs-sm); font-weight: 700;
  color: var(--clr-text-mute); margin-bottom: var(--sp-md);
  text-transform: uppercase; letter-spacing: .5px;
}
.breed-cta-articles {
  display: flex; flex-wrap: wrap; gap: var(--sp-sm);
}
.breed-cta-article {
  display: inline-flex; align-items: center; gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-lg);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--rad-full);
  text-decoration: none; color: var(--clr-text-dim);
  font-size: var(--fs-sm); font-weight: 500;
  transition: all .2s;
}
.breed-cta-article:hover {
  border-color: var(--clr-accent);
  color: var(--clr-accent);
  background: rgba(255,160,50,.06);
}

@media (max-width: 900px) {
  .breed-cta-section { padding: var(--sp-xl); }
  .breed-cta-articles { flex-direction: column; }
  .breed-cta-article { width: 100%; justify-content: center; }
  .back-to-top { bottom: 16px; right: 16px; width: 40px; height: 40px; font-size: 1rem; }
}

/* ── Back to Top ── */
.back-to-top {
  position: fixed; bottom: 30px; right: 24px;
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-accent), #e8923a);
  color: #0f0e13; border: none;
  font-size: 1.2rem; font-weight: 700; cursor: pointer;
  z-index: 900;
  opacity: 0; pointer-events: none; transform: translateY(20px);
  transition: all var(--dur-med) var(--ease-out);
  box-shadow: 0 4px 16px rgba(244,166,35,.3);
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(244,166,35,.5); }
