/* Topic pages follow the supplied friends and family artwork. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: #666;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: #f7f7f5 url('../images/bg.jpg') center top / 100% auto repeat-y;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a:focus-visible { outline: 3px solid #173c75; outline-offset: 5px; }
.skip-link { position: absolute; left: 15px; top: -100px; z-index: 30; background: #fff; padding: 12px; }
.skip-link:focus { top: 15px; }
.friends { --topic-background: url('../images/friends/bg-topic.jpg'); --theme: #50b9dd; --ink: #53bce3; --accent: #2788ac; }
.family { --topic-background: url('../images/family/bg-topic.jpg'); --theme: #e98ab0; --ink: #ed7eaa; --accent: #bc4175; }
.topic-title { width: 27.66%; margin: 7vw auto 0; }
.topic-title img { width: 100%; }
.category-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2vw;
  width: 93.74%;
  margin: 7.4vw auto 0;
}
.category-nav a { display: block; width: 16.15vw; }
.category-nav img { width: 100%; }
.topic-panel {
  position: relative;
  margin: 7.8vw 3.13vw 3.5vw;
  padding: 6.1vw 6.1vw 3vw;
  border-radius: 3.6vw;
  /* Precomposited texture avoids iOS WebKit repeating-background blend issues. */
  background: var(--theme) var(--topic-background) center top / 100% auto repeat-y;
}
.topic-pointer {
  position: absolute;
  left: 50%;
  top: 0;
  width: 6.3vw;
  height: 5.2vw;
  transform: translate(-50%, calc(-100% + 2px));
  background: var(--theme) var(--topic-background) center top / 93.74vw auto;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.topic-category { position: relative; scroll-margin-top: 24px; padding-bottom: 9vw; }
.category-dine { min-height: 62vw; }
.category-stay { min-height: 54vw; }
.category-explore { min-height: 92vw; }
.category-shop { min-height: 91vw; }
.category-discover { padding-bottom: 0; }
.topic-category h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7vw;
  margin: 0 0 5.6vw;
  color: #fff;
  font-size: 4.9vw;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}
.topic-category h2 img { width: 14vw; height: auto; }
.category-shop h2 img, .category-discover h2 img { width: 17.5vw; }
.friends .topic-category h2 img { width: 44.17vw; }
.friends .category-shop h2 img, .friends .category-discover h2 img { width: 47.9vw; }
.card-note { margin: .5vw 0 0 4.8%; color: #fff; font-size: 1.05vw; }
.category-label {
  position: absolute;
  top: 24%;
  left: -6vw;
  color: var(--accent);
  font-size: 6vw;
  font-weight: 900;
  line-height: 1;
  writing-mode: vertical-rl;
  opacity: .8;
}
.category-stay .category-label, .category-shop .category-label { left: auto; right: -6vw; }
.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 3.24vw;
  row-gap: 5vw;
  align-items: start;
}
.topic-card { position: relative; min-width: 0; }
.topic-card h3 {
  position: relative;
  z-index: 2;
  display: table;
  max-width: 100%;
  margin: 0 0 .3vw;
  padding: .5vw .65vw;
  border-radius: 1.3vw;
  background: #fff;
  color: var(--ink);
  font-size: 1.78vw;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.topic-card h3 small { font-size: .85em; }
.topic-card h3 .title-name-en {
  font-size: .6em;
  white-space: nowrap;
  overflow-wrap: normal;
}
.topic-subtitle { margin: 0 0 .5vw .65vw; color: #fff; font-size: 1.39vw; line-height: 1.5; letter-spacing: .035vw; }
.topic-photo { position: relative; z-index: 1; width: 89%; aspect-ratio: 900 / 505; object-fit: cover; border-radius: 1.3vw; }
.topic-copy {
  position: relative;
  margin: -2.05vw 0 0 4.8%;
  padding: 2.5vw .85vw .65vw;
  border-radius: 1.3vw;
  background: #fff;
  font-size: 1.22vw;
  line-height: 1.75;
  letter-spacing: .025vw;
}
.topic-copy p { margin: 0; font-weight: 500; }
.latin-apostrophe { font-family: Arial, sans-serif; letter-spacing: 0; }
.recommendation { margin: .8vw 0 0 4.8%; color: #fff; font-size: 1.05vw; font-weight: bold; line-height: 1.6; }
.topic-list { display: grid; gap: 1.2vw; }
.topic-text-card h3 { padding: 0; background: transparent; color: #fff; border-radius: 0; }
.topic-text-card h3::before { content: "•"; position: absolute; right: calc(100% + 2px); color: var(--accent); font-size: 1.5em; line-height: .87; }
.topic-text-card .topic-copy { margin: .4vw 0 0; padding: .65vw .85vw; }
.topic-text-card h4 { margin: 0; color: var(--accent); font-size: 1.39vw; line-height: 1.5; }
.topic-list .recommendation { margin-left: .65vw; }
.topic-signature { width: 100%; align-self: center; margin-top: 5vw; }
.topic-nav { display: flex; justify-content: center; gap: 24px; padding: 8px 16px 36px; font-size: 14px; }
.topic-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 28px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.topic-nav a:hover { background: var(--accent); color: #fff; }
.book-now { position: fixed; right: 20px; bottom: 24px; width: 64px; z-index: 10; border-radius: 50%; }
@media (max-width: 767px) {
  .topic-title { width: 54.35%; margin: 12.08vw auto 0; }
  .category-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 85.7%;
    margin: 11.84vw auto 0;
    gap: 3.54vw 3.86vw;
  }
  .category-nav a { display: flex; align-items: center; min-height: 44px; width: 100%; }
  .topic-panel { margin: 4.43vw 12px 24px; padding: 32px 20px 28px; border-radius: 20px; }
  .topic-pointer {
    left: auto;
    right: 9.5%;
    width: 27vw;
    height: 15.33vw;
    transform: translateY(calc(-100% + 2px));
    background: url('../images/friends/m-topic-pointer.png') center / 100% 100% no-repeat;
    background-blend-mode: normal;
    clip-path: none;
  }
  .family .topic-pointer { background-image: url('../images/family/m-topic-pointer.png'); }
  .topic-category { min-height: 0; padding-bottom: 48px; scroll-margin-top: 20px; }
  .topic-category:last-child { padding-bottom: 0; }
  .topic-category h2 { font-size: clamp(26px, 7.8vw, 36px); gap: 6px; margin-bottom: 28px; }
  .topic-category h2 img { width: 72px; max-width: 28%; }
  .category-shop h2 img, .category-discover h2 img { width: 86px; }
  .friends .topic-category h2 img { width: 100%; max-width: 340px; }
  .card-note { margin: 8px 0 0 12px; font-size: 12px; }
  .category-label { left: -18px; top: 64px; font-size: 25px; opacity: .5; }
  .category-stay .category-label, .category-shop .category-label { right: -18px; }
  .topic-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .topic-card h3 { font-size: 17px; padding: 6px 8px; margin-bottom: 6px; border-radius: 8px; }
  .topic-card h3.title-single-line {
    display: block;
    width: fit-content;
    max-width: 100%;
    white-space: nowrap;
    overflow-wrap: normal;
  }
  .topic-card h3.bilingual-title {
    display: flex;
    align-items: baseline;
    gap: 4px;
    width: fit-content;
    font-size: clamp(11px, 3.3vw, 17px);
    white-space: nowrap;
  }
  .topic-card h3.bilingual-title .title-name-en {
    display: inline;
    flex-shrink: 0;
    font-size: 14px;
  }
  .topic-subtitle { margin: 0 0 8px 4px; font-size: 14px; letter-spacing: 0; }
  .topic-photo { width: 96%; border-radius: 10px; }
  .topic-copy { margin: -12px 0 0 12px; padding: 24px 12px 12px; border-radius: 10px; font-size: 14px; line-height: 1.8; letter-spacing: 0; }
  .recommendation { margin: 10px 0 0 12px; font-size: 12px; }
  .topic-list { gap: 22px; padding-left: 8px; }
  .topic-text-card h3 { padding: 0; }
  .topic-text-card .topic-copy { margin: 0; padding: 12px; }
  .topic-text-card h4 { font-size: 15px; }
  .topic-list .recommendation { margin-left: 0; }
  .topic-signature { width: 80%; max-width: 300px; justify-self: end; margin-top: 4px; }
  .topic-nav { flex-wrap: wrap; gap: 8px; padding-bottom: 92px; }
  .book-now { width: 60px; right: max(12px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
