/* Theme Name: POPHIES
   Description: Framework stylesheet — the pages of this WordPress site are served by the theme (inc/routes.php, 网站规划.md §6).
   Shared design tokens are in assets/css/tokens.css; page-specific styles belong in assets/css/page-*.css.
   Version: 0.2.0
   Text Domain: pophies */

/* ---------- 1. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--ivory);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

body.admin-bar .site-header { top: 32px; }

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

a {
  color: inherit;
  text-decoration-color: var(--brass);
  text-underline-offset: 0.2em;
}

a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.6em;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
}

h1 { font-size: var(--fs-display); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 1em; }

ul { margin: 0; padding: 0; list-style: none; }

/* ---------- 2. Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: var(--section) 0; }
.section--soft { background: var(--surface-soft); }
.section--white { background: var(--white); }

.site-main { display: block; min-height: 50vh; }

/* ---------- 3. Type helpers ---------- */
.eyebrow {
  margin: 0 0 0.9em;
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--brass);
}

.note {
  max-width: var(--read);
  font-size: var(--fs-small);
  color: var(--graphite);
}

/* ---------- 4. Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.95em 1.6em;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-display);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.button:hover {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--white);
}

.button.secondary,
.button--secondary {
  background: transparent;
  border-color: var(--stone);
  color: var(--ink);
}

.button.secondary:hover,
.button--secondary:hover {
  background: var(--white);
  border-color: var(--ink);
  color: var(--ink);
}

.button--compact { padding: 0.7em 1.1em; }

.arrow { line-height: 1; }

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ivory);
  border-bottom: 1px solid var(--stone);
}

.site-header[data-scrolled="true"] { background: var(--white); }

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  min-height: var(--header-h);
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.brand-mark {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--brass);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-right: auto;
  font-size: var(--fs-small);
}

.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--brass); }
.nav-links a[aria-current="page"] {
  color: var(--brass);
  text-decoration: underline;
}

/* ---------- 6. Planning placeholder ---------- */
.planning { padding: var(--section-sm) 0; }

.planning__title {
  max-width: 24ch;
  margin-bottom: 0.5em;
}

.planning__status {
  display: inline-block;
  margin: 0;
  padding: 0.4em 0.9em;
  border: 1px dashed var(--brass);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brass);
}

.planning__note {
  max-width: var(--read);
  margin: 1.2em 0 0;
  font-size: var(--fs-small);
  color: var(--graphite);
}

/* ---------- 7. Search ---------- */
.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  max-width: var(--read);
  margin: 0 var(--gutter) var(--section-sm);
}

.search-form__input {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.8em 1em;
  border: 1px solid var(--stone);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

/* ---------- 8. Footer ---------- */
.site-footer {
  padding: var(--section-sm) 0 2.5rem;
  background: var(--ink);
  color: var(--ivory);
}

.site-footer a { color: inherit; }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--on-dark-line);
}

.footer-title {
  max-width: 24ch;
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: 1.25;
  letter-spacing: var(--track-tight);
}

.footer-note {
  max-width: 30ch;
  font-size: var(--fs-small);
  color: var(--on-dark-muted);
}

.footer-links {
  display: grid;
  gap: 0.5rem;
  font-size: var(--fs-small);
  text-decoration: none;
}

.footer-contact__row { margin-bottom: 0.5rem; font-size: var(--fs-small); }
.footer-contact__sep { color: var(--on-dark-dim); }

.footer-contact__row--address {
  max-width: 32ch;
  color: var(--on-dark-muted);
}

.footer-legal {
  padding-top: 1.5rem;
  font-size: var(--fs-small);
  color: var(--on-dark-muted);
}

/* ---------- 9. Utilities ---------- */
.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;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 40;
  padding: 0.8em 1.2em;
  background: var(--ink);
  color: var(--white);
}

.skip-link:focus { left: 0; }

/* ---------- 10. Motion ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- 11. Media block ---------- */
.media { margin: 0; }

.media__frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--stone);
  border-radius: var(--radius-sm);
}

.media__frame img { width: 100%; height: 100%; object-fit: cover; }
.media__ratio-4x3 .media__frame { aspect-ratio: 4 / 3; }
.media__ratio-3x2 .media__frame { aspect-ratio: 3 / 2; }
.media__ratio-1x1 .media__frame { aspect-ratio: 1 / 1; }
.media__ratio-3x4 .media__frame { aspect-ratio: 3 / 4; }
.media__ratio-16x9 .media__frame { aspect-ratio: 16 / 9; }
.media__ratio-tall .media__frame { aspect-ratio: 3 / 5; }

.media__label {
  padding: 0 1.5rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-small);
  color: var(--graphite);
}

.media__note {
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass);
}

.media__badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.3em 0.6em;
  border: 1px dashed var(--brass);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
}

.media__caption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  margin-top: 0.75rem;
  font-size: var(--fs-small);
  color: var(--graphite);
}

.media__caption span:first-child:not(:last-child) {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
}

/* ---------- 12. Section head ---------- */
.section-head { display: grid; gap: 1.5rem; margin-bottom: 3rem; }

.section-head__lead { max-width: var(--read); color: var(--graphite); }
.section-head__lead p { margin: 0; }
.section-head .accent, .accent { color: var(--brass); }

@media (min-width: 900px) {
  .section-head {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: end;
    gap: 3rem;
  }

  .section-head--stack { grid-template-columns: minmax(0, 1fr); }
}

.section-note {
  max-width: var(--read);
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--stone);
  font-size: var(--fs-small);
  color: var(--graphite);
}

/* ---------- 13. Page hero ---------- */
.page-hero { padding: calc(var(--section-sm) * 0.85) 0 var(--section-sm); }
.page-hero--white { background: var(--white); }
.page-hero--band { background: var(--ink); color: var(--ivory); }
.page-hero--band h1, .page-hero--band h2 { color: var(--ivory); }
.page-hero--band .page-hero__lead, .page-hero--band .note { color: var(--on-dark-muted); }
.page-hero--band .breadcrumb { color: var(--on-dark-dim); }
.page-hero--band .breadcrumb [aria-current="page"] { color: var(--ivory); }

.page-hero__inner { display: grid; gap: 2.5rem; }
.page-hero__body { min-width: 0; }
.page-hero__meta { margin: 0 0 1.25rem; }
.page-hero__title { max-width: 26ch; margin-bottom: 0.5em; }
.page-hero__lead { max-width: var(--read); margin: 0; font-size: 1.125rem; color: var(--graphite); }
.page-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.9rem; }
.page-hero__aside { min-width: 0; }

@media (min-width: 900px) {
  .page-hero--split .page-hero__inner {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    align-items: center;
    gap: 3.5rem;
  }
}

/* ---------- 14. Grids ---------- */
.grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
.grid--tight { gap: 1.25rem; }
.grid--wide { gap: 3rem; }

@media (min-width: 700px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 15. Card ---------- */
.card { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.card__meta {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
}
.card__title { margin: 0; font-size: var(--fs-h3); line-height: 1.25; }
.card__title a { text-decoration: none; }
.card__title a:hover { color: var(--brass); }
.card__text { margin: 0; font-size: var(--fs-small); color: var(--graphite); }
.card__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; }
.card__link {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 0.75rem;
  font-family: var(--font-display);
  font-size: var(--fs-small);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid var(--brass);
}

/* ---------- 16. Tag ---------- */
.tag {
  display: inline-block;
  padding: 0.35em 0.7em;
  border: 1px solid var(--stone);
  border-radius: 999px;
  background: var(--white);
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  color: var(--graphite);
}

.tag--brass { border-color: var(--brass); color: var(--brass); }

/* ---------- 17. Fact strip ---------- */
.fact-strip {
  display: grid;
  gap: 1.5rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.fact__label {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite);
}

.fact__value { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; letter-spacing: var(--track-tight); }
.band .fact__label { color: var(--on-dark-dim); }
.band .fact__value { color: var(--ivory); }

/* ---------- 18. Dark band and CTA ---------- */
.band { background: var(--ink); color: var(--ivory); }
.band h1, .band h2, .band h3 { color: var(--ivory); }
.band p, .band .note, .band .section-head__lead { color: var(--on-dark-muted); }
.band .eyebrow { color: var(--light); }
.band .button--secondary { border-color: var(--on-dark-line); color: var(--ivory); }
.band .button--secondary:hover { background: var(--ink-soft); border-color: var(--stone); color: var(--ivory); }

.cta-band { padding: var(--section-sm) 0; }
.cta-band__inner { display: grid; gap: 1.75rem; align-items: end; }
.cta-band__text { max-width: var(--read); margin: 0; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

@media (min-width: 900px) {
  .cta-band__inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 3rem; }
  .cta-band__actions { justify-content: flex-end; }
}


/* ---------- 19. Breadcrumb ---------- */
.breadcrumb { margin: 0; font-size: var(--fs-small); color: var(--graphite); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.breadcrumb li { display: flex; align-items: center; gap: 0.45rem; }
.breadcrumb li + li::before { content: "/"; color: var(--stone); }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--brass); }
.breadcrumb [aria-current="page"] { color: var(--ink); }

/* ---------- 20. Prose ---------- */
.prose { max-width: var(--read); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin: 1.9em 0 0.5em; font-size: var(--fs-h3); }
.prose h3 { margin: 1.6em 0 0.4em; font-size: 1.15rem; }
.prose ul { padding-left: 1.15em; list-style: disc; }
.prose ol { padding-left: 1.3em; list-style: decimal; }
.prose li + li { margin-top: 0.45em; }
.prose a { text-decoration: underline; }
.prose p:last-child { margin-bottom: 0; }

/* ---------- 21. Specification table ---------- */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--stone);
  border-radius: var(--radius-sm);
  background: var(--white);
  -webkit-overflow-scrolling: touch;
}

.spec-table { width: 100%; min-width: 60rem; border-collapse: collapse; font-size: var(--fs-small); }

.spec-table caption {
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: var(--fs-small);
  color: var(--graphite);
}

.spec-table th, .spec-table td {
  padding: 0.9em 1.1em;
  border-bottom: 1px solid var(--stone);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.spec-table thead th {
  background: var(--surface-soft);
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.spec-table tbody th { font-weight: 600; white-space: normal; }
.spec-table tbody tr:last-child th, .spec-table tbody tr:last-child td { border-bottom: 0; }

/* ---------- 22. Filter bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1.25rem 2rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--stone);
}

.filter-group { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }

.filter-group__label {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--graphite);
}

.filter-bar__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-left: auto; }
.filter-bar__count { margin: 0; font-size: var(--fs-small); color: var(--graphite); }

/* ---------- 23. Forms ---------- */
.form-grid { display: grid; gap: 1.25rem; }

@media (min-width: 760px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.field { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; }
.field--full { grid-column: 1 / -1; }

.field__label { font-family: var(--font-display); font-size: var(--fs-small); font-weight: 700; }
.field__label .required { color: var(--brass); }
.field__hint { font-size: var(--fs-label); color: var(--graphite); }

.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
  width: 100%;
  padding: 0.8em 1em;
  border: 1px solid var(--stone);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

.field textarea { min-height: 9rem; resize: vertical; }
.field--check { flex-direction: row; align-items: flex-start; gap: 0.6rem; }
.field--check input { margin-top: 0.35em; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1.75rem; }

.form-notice {
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--stone);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: var(--fs-small);
}

.form-notice--success { border-color: var(--success); color: var(--success); }
.form-notice--error { border-color: var(--error); color: var(--error); }
.honeypot { position: absolute; left: -9999px; }

/* ---------- 24. Empty state ---------- */
.empty-state {
  padding: 2.5rem;
  border: 1px dashed var(--stone);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.empty-state__title { margin: 0 0 0.6em; font-size: var(--fs-h3); }
.empty-state__text { max-width: var(--read); margin: 0; font-size: var(--fs-small); color: var(--graphite); }
.empty-state__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* ---------- 25. Lists ---------- */
.list-divided > li { padding: 1.15rem 0; border-top: 1px solid var(--stone); }
.list-divided > li:last-child { border-bottom: 1px solid var(--stone); }

.checklist > li { position: relative; padding-left: 1.35rem; }
.checklist > li + li { margin-top: 0.6rem; }
.checklist > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--brass);
}

/* ---------- 26. Split ---------- */
.split { display: grid; gap: 2.5rem; align-items: center; }

@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.5rem; }
  .split--reverse .split__body { order: -1; }
}

.split__body { min-width: 0; }

/* ---------- 27. Steps ---------- */
.steps { display: grid; gap: 1.5rem; }
.step { padding-top: 1.25rem; border-top: 1px solid var(--stone); }

.step__number {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
}

.step__title { margin: 0 0 0.4em; font-size: 1.1rem; }
.step__text { margin: 0; font-size: var(--fs-small); color: var(--graphite); }

/* ---------- 28. Utilities ---------- */
.lead { max-width: var(--read); font-size: 1.125rem; color: var(--graphite); }
.muted { color: var(--graphite); }
.small { font-size: var(--fs-small); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.stack-2 { display: grid; gap: 2rem; }
.stack-3 { display: grid; gap: 3rem; }
.cluster { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

