/* =============================================
   KUN JI TANG 坤濟堂 — Main Stylesheet
   Minimal, elegant, easy to read
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=EB+Garamond:ital,wght@0,400;0,500;1,400&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --bg:         #FAF8F5;       /* warm off-white, slightly grey-beige */
  --bg-card:    #E8E4DE;       /* slightly darker for cards/sections */
  --text:       #2A2420;       /* dark warm brown — readable, not harsh black */
  --text-mid:   #4A3F38;       /* medium tone for secondary text */
  --text-light: #7A6E66;       /* lighter for captions, labels */
  --accent:     #5C3D2E;       /* deep warm brown accent */
  --accent-mid: #8B6655;       /* medium accent */
  --rule:       #C8BFB5;       /* horizontal rule color */
  --link:       #5C3D2E;
  --link-hover: #8B6655;
  --font-serif: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --font-body:  'Libre Baskerville', Georgia, serif;
  --max-width:  780px;
  --nav-height: 64px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
a:hover { color: var(--link-hover); }

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: .5rem 0;
}

/* ── Navigation ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-decoration: none;
}

.nav-logo span {
  font-weight: 300;
  font-style: italic;
  margin-left: 0.4em;
  color: var(--text-mid);
  font-size: 1rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-mid);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--accent);
  transition: all 0.3s;
}

/* ── Page wrapper ── */
.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem 1.5rem;
}

/* ── Page hero image ── */
.page-hero {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto 0rem;
  overflow: hidden;
}

.page-hero img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: center top;
}

.page-hero .caption {
  font-size: 0.5rem;
  color: var(--text-light);
  text-align: right;
  margin-top: 0.4rem;
  padding: 0 1rem;
  font-style: italic;
}

/* ── Typography ── */
h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--accent);
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  margin: 1.5rem 0 1rem;
  letter-spacing: 0.03em;
}

h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.75rem;
  letter-spacing: 0.02em;
}

p {
  margin-bottom: 1.2rem;
  color: var(--text);
}

/* ── Section label ── */
.label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  display: block;
}

/* ── Lists ── */
ul.content-list {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

ul.content-list li {
  padding: 0.35rem 0 0.35rem 1.2rem;
  position: relative;
  color: var(--text);
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}

ul.content-list li:last-child { border-bottom: none; }

ul.content-list li::before {
  content: '●';
  position: absolute;
  left: 0;
  color: var(--text-light);
  font-size: 0.8rem;
}

/* ── Two column grid ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

/* ── Chinese bilingual block ── */
.bilingual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}

.bilingual-en { }
.bilingual-zh {
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.9;
}

/* ── Highlight block ── */
.highlight-block {
  background: var(--bg-card);
  border-left: 3px solid var(--accent-mid);
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 4px 4px 0;
}

.highlight-block p { margin-bottom: 0; font-size: 0.95rem; }

/* ── Contact info block ── */
.contact-info {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 2;
  color: var(--text-mid);
}

.contact-info a { color: var(--accent); }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--rule);
  padding: 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-light);
  letter-spacing: 0.03em;
}

.footer-links {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.footer-links a {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

.footer-icon {
  width: 18px;
  height: 18px;
  fill: var(--text-light);
  transition: fill 0.2s;
  vertical-align: middle;
}

.footer-links a:hover .footer-icon { fill: var(--accent); }

/* ── Publication list ── */
.pub-list {
  list-style: none;
  padding: 0;
}

.pub-list li {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem;
  line-height: 1.6;
}

.pub-list li:last-child { border-bottom: none; }

/* ── Client list ── */
.client-list {
  columns: 2;
  column-gap: 2.5rem;
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

.client-list li {
  font-size: 0.88rem;
  color: var(--text-mid);
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--rule);
  break-inside: avoid;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .client-list { columns: 1; }
}

/* ── Notice box ── */
.notice {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  padding: 1rem 1.2rem;
  border-radius: 4px;
  font-size: 0.88rem;
  color: var(--text-mid);
  margin: 1.5rem 0;
  line-height: 1.6;
}

/* ── Home page specific ── */
.home-intro {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 3rem;
}

.home-intro-photo {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  object-position: center top;
}

.home-name {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 300;
  line-height: 1.2;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.home-chinese {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
}

.home-nav-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 3rem;
}

.home-nav-card {
  background: var(--bg);
  padding: 1.5rem;
  text-decoration: none;
  transition: background 0.2s;
}

.home-nav-card:hover { background: var(--bg-card); }

.home-nav-card .card-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  display: block;
}

.home-nav-card .card-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  display: block;
  margin-bottom: 0.4rem;
}

.home-nav-card .card-desc {
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  nav { padding: 0 1.2rem; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 0.8rem 2rem;
    display: block;
  }

  .nav-toggle { display: flex; }

  .page { padding: 2rem 1.2rem 4rem; }

  .page-hero img { height: 220px; }

  .two-col,
  .bilingual,
  .home-intro { grid-template-columns: 1fr; }

  .home-intro-photo { aspect-ratio: 4/3; }

  .home-nav-cards { grid-template-columns: 1fr; }

  .client-grid { grid-template-columns: 1fr 1fr; }

  footer { flex-direction: column; align-items: flex-start; }
}
