/* ==========================================================================
   taipeieswt.com Static Redesign : Editorial Report ("The printed annual")
   Palette: Richard Wolf Clinical Navy, Cobalt & Paper
   ========================================================================== */

:root {
  --bg: #f7f9fb;
  --surface: #ebf0f5;
  --ink: #0f2030;
  --muted: #465a6e;
  --accent: #0b5cab;
  --accent-ink: #ffffff;
  --field-1: #dce8f5;
  --field-2: #0f2030;
  --field-2-surface: #183046;
  --field-2-ink: #f7f9fb;
  --field-2-muted: #b8c9d9;

  --font-sans: "Hanken Grotesk", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;

  /* 5-step fluid type scale */
  --t-display: clamp(2.25rem, 4.6vw, 4.1rem);
  --t-h1: clamp(1.65rem, 2.7vw, 2.4rem);
  --t-h2: clamp(1.3rem, 1.9vw, 1.65rem);
  --t-lead: clamp(1.08rem, 1.25vw, 1.22rem);
  --t-body: 1.0625rem;
  --t-small: 0.9375rem;

  --pad-x: clamp(1.25rem, 4.5vw, 4.25rem);
  --sec-y: clamp(3.5rem, 7vw, 6.5rem);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  overflow-x: clip;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1.5px;
  transition: color 0.18s ease, background-color 0.18s ease;
}

a:hover {
  color: var(--ink);
}

/* Typography Steps */
.t-display {
  font-size: var(--t-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 1.2rem;
  color: var(--ink);
}

.t-h1 {
  font-size: var(--t-h1);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
  color: var(--ink);
}

.t-h2 {
  font-size: var(--t-h2);
  font-weight: 700;
  line-height: 1.28;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

.t-h3 {
  font-size: var(--t-lead);
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.6rem;
  color: var(--ink);
}

.t-lead {
  font-size: var(--t-lead);
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
  max-width: 58ch;
  margin: 0 0 1.5rem;
}

p, li, dd {
  font-size: var(--t-body);
  line-height: 1.75;
  color: var(--ink);
  max-width: 36rem;
}

p {
  margin: 0 0 1.15rem;
}

/* Layout Containers & 42% Editorial Axis */
.container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.section-band {
  padding-top: var(--sec-y);
  padding-bottom: var(--sec-y);
}

.band-surface {
  background-color: var(--surface);
}

.band-field-1 {
  background-color: var(--field-1);
}

.band-dark {
  background-color: var(--field-2);
  color: var(--field-2-ink);
}

.band-dark .t-h1,
.band-dark .t-h2,
.band-dark .t-h3,
.band-dark p,
.band-dark li,
.band-dark dt,
.band-dark dd {
  color: var(--field-2-ink);
}

.band-dark .muted-note {
  color: var(--field-2-muted);
}

.editorial-split {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(2rem, 4.5vw, 4.5rem);
  align-items: start;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--bg);
  padding: 0.85rem 0;
}

.header-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand-wordmark {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  color: var(--ink);
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--ink);
  white-space: nowrap;
}

.brand-sub {
  font-size: var(--t-small);
  color: var(--muted);
  font-weight: 500;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  flex-wrap: wrap;
}

.primary-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: var(--t-small);
  font-weight: 600;
  padding: 0.25rem 0;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Flat Solid Buttons (No Shadows or Gradients) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.65rem 1.3rem;
  font-size: var(--t-small);
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.btn-Primary {
  background-color: var(--accent);
  color: var(--accent-ink);
}

.btn-Primary:hover {
  background-color: var(--ink);
  color: var(--accent-ink);
}

.btn-Secondary {
  background-color: var(--ink);
  color: var(--accent-ink);
}

.btn-Secondary:hover {
  background-color: var(--accent);
  color: var(--accent-ink);
}

.btn-Ghost {
  background-color: var(--surface);
  color: var(--ink);
}

.btn-Ghost:hover {
  background-color: var(--field-1);
  color: var(--ink);
}

/* Hero Section */
.hero-section {
  padding-top: clamp(2rem, 4.5vw, 4rem);
  padding-bottom: clamp(3rem, 6vw, 5.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2.25rem;
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  background-color: var(--surface);
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
}

.hero-fact-item strong {
  display: inline;
  font-size: var(--t-body);
  font-weight: 700;
  color: var(--ink);
}

.hero-figure {
  margin: 0;
  background-color: var(--surface);
  padding: 1rem;
  border-radius: 4px;
}

.hero-figure img {
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.hero-caption {
  margin-top: 0.75rem;
  font-size: var(--t-small);
  color: var(--muted);
}

/* Interactive Anatomical Symptom Finder & 13-Item Directory */
.finder-sticky {
  position: sticky;
  top: 5.5rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 1.5rem;
}

.filter-btn {
  appearance: none;
  border: none;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-small);
  font-weight: 600;
  padding: 0.55rem 1rem;
  min-height: 40px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.filter-btn:hover {
  background-color: var(--field-1);
}

.filter-btn.is-active {
  background-color: var(--accent);
  color: var(--accent-ink);
}

.finder-preview {
  background-color: var(--bg);
  padding: 1.35rem;
  border-radius: 4px;
}

.finder-preview-media {
  background-color: var(--field-1);
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.finder-preview-media img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  margin: 0 auto;
}

. indication-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.25rem 1.75rem;
}

.indication-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.25rem 1.75rem;
}

.indication-item {
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s ease;
}

.indication-item.is-hidden {
  display: none;
}

.indication-media-link {
  display: block;
  background-color: var(--bg);
  padding: 0.85rem;
  border-radius: 4px;
  margin-bottom: 0.9rem;
  text-decoration: none;
}

.indication-media-link img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 2px;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.indication-media-link:hover img {
  transform: scale(1.02);
}

.indication-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.indication-title-row a {
  text-decoration: none;
  color: var(--ink);
}

.indication-title-row a:hover {
  color: var(--accent);
}

.indication-sub {
  font-size: var(--t-small);
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.45rem;
}

.indication-desc {
  font-size: var(--t-small);
  color: var(--muted);
  margin: 0 0 0.65rem;
}

.indication-more {
  font-size: var(--t-small);
  font-weight: 700;
  color: var(--accent);
  margin-top: auto;
}

/* Dark Philosophy & Equipment Band */
.philosophy-quote {
  background-color: var(--field-2-surface);
  padding: 1.5rem 1.75rem;
  border-radius: 4px;
  margin: 1.5rem 0;
}

.philosophy-quote p {
  font-size: var(--t-lead);
  font-weight: 600;
  line-height: 1.65;
  margin: 0 0 0.65rem;
}

.philosophy-quote p:last-child {
  margin-bottom: 0;
}

.clinic-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.clinic-gallery-wide {
  grid-column: 1 / -1;
}

.gallery-card {
  margin: 0;
  background-color: var(--field-2-surface);
  padding: 0.85rem;
  border-radius: 4px;
}

.gallery-card figcaption {
  margin-top: 0.6rem;
  font-size: var(--t-small);
  color: var(--field-2-muted);
}

/* Booking Process & Contact Section */
.step-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 2rem;
  display: grid;
  gap: 1rem;
}

.step-item {
  padding: 0.45rem 0;
}

.step-item strong {
  display: block;
  font-size: var(--t-body);
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.step-item span {
  font-size: var(--t-small);
  color: var(--muted);
}

.booking-figure {
  margin: 0 0 2rem;
  background-color: var(--surface);
  padding: 1rem;
  border-radius: 4px;
}

.booking-figure figcaption {
  margin-top: 0.65rem;
  font-size: var(--t-small);
  color: var(--muted);
}

.faq-panel {
  background-color: var(--field-1);
  padding: 1.6rem 1.85rem;
  border-radius: 4px;
}

/* Breadcrumb (Wrapped in <nav> per design-taste rules) */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--t-small);
  color: var(--muted);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Article Page Layout */
.article-hero {
  background-color: var(--surface);
  padding-top: clamp(2.25rem, 4.5vw, 3.75rem);
  padding-bottom: clamp(2.25rem, 4.5vw, 3.75rem);
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: var(--t-small);
  color: var(--muted);
  margin-top: 1rem;
}

.article-layout {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: clamp(2rem, 4.5vw, 4.5rem);
  align-items: start;
}

.article-sidebar {
  position: sticky;
  top: 5.5rem;
  display: grid;
  gap: 1.5rem;
}

.toc-box,
.sidebar-cta-box {
  background-color: var(--surface);
  padding: 1.35rem 1.5rem;
  border-radius: 4px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: grid;
  gap: 0.5rem;
}

.toc-list a {
  font-size: var(--t-small);
  color: var(--ink);
  text-decoration: none;
  display: block;
  padding: 0.25rem 0;
}

.toc-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.article-figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 0 0 2.25rem;
}

.article-figure {
  margin: 0;
}

.article-figure img {
  width: 100%;
  max-height: 440px;
  object-fit: contain;
  margin: 0 auto;
  background-color: var(--surface);
  padding: 0.85rem;
  border-radius: 4px;
}

.article-figure figcaption {
  margin-top: 0.65rem;
  font-size: var(--t-small);
  color: var(--muted);
  text-align: center;
}

.article-prose .article-h2 {
  font-size: var(--t-h2);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin: 2.4rem 0 0.9rem;
  scroll-margin-top: 5.5rem;
}

.article-prose .article-h2:first-child {
  margin-top: 0;
}

.article-prose ul,
.article-prose ol {
  padding-left: 1.4rem;
  margin: 0 0 1.35rem;
}

.article-prose li {
  margin-bottom: 0.55rem;
}

.article-cta-banner {
  background-color: var(--field-1);
  padding: 1.85rem 2rem;
  border-radius: 4px;
  margin-top: 3rem;
}

/* Related Articles & Archive Directory */
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem 1.5rem;
}

.related-item {
  display: grid;
  grid-template-columns: 156px 1fr;
  gap: 1.25rem;
  align-items: center;
}

.related-item img {
  width: 156px;
  height: 144px;
  object-fit: cover;
  background-color: var(--bg);
  padding: 0.45rem;
  border-radius: 4px;
}

.related-item h3 {
  font-size: var(--t-lead);
  margin: 0 0 0.25rem;
}

.related-item h3 a {
  text-decoration: none;
  color: var(--ink);
}

.related-item h3 a:hover {
  color: var(--accent);
}

.related-item p {
  font-size: var(--t-small);
  color: var(--muted);
  margin: 0;
}

.pagination-nav {
  margin-top: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Footer */
.site-footer {
  background-color: var(--surface);
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(2.5rem, 4vw, 3.5rem);
}

.footer-tagline {
  font-size: var(--t-body);
  color: var(--muted);
  margin-bottom: 1.35rem;
}

.footer-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.footer-fb-group {
  display: grid;
  gap: 0.85rem;
}

.fb-badge-link {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  background-color: var(--bg);
  padding: 0.55rem 0.9rem;
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
  font-size: var(--t-small);
  font-weight: 600;
}

.fb-badge-link img {
  width: 136px;
  height: auto;
  border-radius: 2px;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.footer-article-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-article-list a {
  font-size: var(--t-small);
  color: var(--ink);
  text-decoration: none;
}

.footer-article-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.clinic-meta-list {
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.clinic-meta-list dt {
  font-size: var(--t-small);
  font-weight: 700;
  color: var(--ink);
  margin-top: 0.6rem;
}

.clinic-meta-list dt:first-child {
  margin-top: 0;
}

.clinic-meta-list dd {
  margin: 0;
  font-size: var(--t-small);
  color: var(--muted);
}

.footer-disclaimer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  background-color: var(--bg);
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
}

.footer-disclaimer p {
  font-size: var(--t-small);
  color: var(--muted);
  max-width: 35rem;
  margin: 0 0 0.5rem;
}

.footer-disclaimer .footer-copy {
  margin-bottom: 0;
  font-weight: 600;
  color: var(--ink);
}

/* Choreographed Motion (Load + Scroll Reveal) */
@media (prefers-reduced-motion: no-preference) {
  @keyframes riseIn {
    from {
      opacity: 0;
      transform: translateY(22px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes shutterOpen {
    from {
      clip-path: inset(0 0 100% 0);
      transform: scale(1.03);
    }
    to {
      clip-path: inset(0 0 0 0);
      transform: scale(1);
    }
  }

  [data-rise] {
    animation: riseIn 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  [data-rise="1"] { animation-delay: 0.04s; }
  [data-rise="2"] { animation-delay: 0.14s; }
  [data-rise="3"] { animation-delay: 0.24s; }
  [data-rise="4"] { animation-delay: 0.34s; }

  .shutter {
    animation: shutterOpen 0.88s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
  }

  .reveal.is-in {
    animation: riseIn 0.68s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Responsive Breakpoints (Tablet 768px & Mobile 390px) */
@media (max-width: 1080px) {
  .primary-nav,
  .brand-sub,
  .header-actions .btn-Ghost {
    display: none;
  }

  .header-inner {
    flex-wrap: nowrap;
  }
}

@media (max-width: 1024px) {
  .hero-grid,
  .editorial-split,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .finder-sticky,
  .article-sidebar {
    position: static;
  }

  .related-grid,
  .footer-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .brand-title {
    font-size: 1.08rem;
  }

  .header-actions .btn {
    min-height: 40px;
    padding: 0.45rem 0.9rem;
    font-size: 0.875rem;
  }

  .hero-facts,
  .indication-grid,
  .clinic-gallery {
    grid-template-columns: 1fr;
  }

  .related-item {
    grid-template-columns: 84px 1fr;
  }

  .related-item img {
    width: 84px;
    height: 84px;
  }
}
