/* ============================================
   BASE STYLES — Typography & common elements
   ============================================ */

/* ── Chinese text optimization ── */
body[lang="zh-TW"],
body[lang="zh"] {
  font-family: var(--f-zh), var(--f-sans);
}

/* ── Headings ── */
.heading-hero {
  font-family: var(--f-sans);
  font-size: var(--fs-hero);
  font-weight: var(--fw-light);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

.heading-display {
  font-family: var(--f-sans);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-light);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

/* ── Personal Name Stylized ── */
.name-adj {
  font-family: 'Playfair Display', var(--f-serif);
  font-style: italic;
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: -0.04em;
  padding-right: 0.05em; /* Compensate for italic cutoff */
}

.heading-xl {
  font-size: var(--fs-xl);
  font-weight: var(--fw-regular);
  line-height: var(--lh-snug);
}

.heading-lg {
  font-size: var(--fs-lg);
  font-weight: var(--fw-regular);
  line-height: var(--lh-snug);
}

/* ── Labels ── */
.label {
  font-family: var(--f-sans);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--c-text-muted);
}

.label-mono {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  letter-spacing: var(--ls-wide);
  color: var(--c-text-muted);
}

/* ── Body text ── */
.text-body {
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
}

.text-lead {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  font-weight: var(--fw-light);
}

.text-small {
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--c-text-muted);
}

/* ── Serif accent ── */
.serif {
  font-family: var(--f-serif);
  font-style: italic;
}

/* ── Divider ── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--c-border);
  border: none;
}

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--page-mx);
}

.container-full {
  width: 100%;
  padding: 0 var(--page-mx);
}

/* ── Section spacing ── */
.section {
  padding-top: var(--sp-9);
  padding-bottom: var(--sp-9);
}

.section-lg {
  padding-top: var(--sp-10);
  padding-bottom: var(--sp-10);
}

/* ── Visually hidden (accessibility) ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Image wrapper ── */
.img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--c-bg-card);
}

.img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-normal) var(--ease);
}

.img-wrap:hover img {
  transform: scale(1.03);
}

/* ── Placeholder for missing images ── */
.img-placeholder {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--c-bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-placeholder::after {
  content: '';
  display: block;
  width: 60%;
  height: 60%;
  border: 1px solid var(--c-border);
  position: relative;
}

.img-placeholder::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 20%;
  right: 20%;
  bottom: 20%;
  background: linear-gradient(
    135deg,
    transparent 48%,
    var(--c-border) 48%,
    var(--c-border) 52%,
    transparent 52%
  );
}
