/* Somwyn — saved Art Direction implementation.
 * Tokens trace to 独立站建站策划.md §三:
 * bg #FAF9F6, ink #2D2A26, accent #3D7A5C, accent-2 #8B7355, highlight #E8E4DE, dark #1A1F1C.
 */

.pb-sleep-theme {
  --pb-bg: #faf9f6;
  --pb-surface: #ffffff;
  --pb-highlight: #e8e4de;
  --pb-ink: #2d2a26;
  --pb-muted: #5f5c56;
  --pb-accent: #3d7a5c;
  --pb-accent-dark: #2d5c44;
  --pb-accent-2: #8b7355;
  --pb-dark: #1a1f1c;
  --pb-on-dark: #f6f4ef;
  --pb-border: rgba(45, 42, 38, 0.14);
  --pb-radius: 18px;
  --pb-shadow: 0 18px 45px rgba(26, 31, 28, 0.08);
  color: var(--pb-ink);
  background: var(--pb-bg);
  font-family: "Source Sans 3", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Global header: one readable light surface on every page template. */
body.pb-sleep-theme .fusion-tb-header .fusion-builder-row-1 {
  --awb-background-color: var(--pb-bg) !important;
  position: relative;
  background-color: var(--pb-bg) !important;
  border-bottom: 1px solid var(--pb-border);
}

/* Avada's blog template absolutely positions the header over the page hero. */
body.pb-sleep-theme .fusion-tb-header .fusion-absolute-container {
  position: relative !important;
}

/* Header nav: dark ink on the light hero background */
.fusion-tb-header .awb-menu {
  --awb-color: var(--pb-ink) !important;
  --awb-icons-color: var(--pb-ink) !important;
  --awb-mobile-trigger-color: var(--pb-ink) !important;
  --awb-active-color: var(--pb-accent-dark) !important;
  --awb-active-border-color: var(--pb-accent-dark) !important;
  --awb-mobile-trigger-background-color: rgba(255, 255, 255, 0) !important;
}

.pb-sleep-theme h1,
.pb-sleep-theme h2,
.pb-sleep-theme h3,
.pb-sleep-theme .pb-display {
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  color: var(--pb-ink);
}

/* Layout primitives */
.pb-section {
  position: relative;
  padding: clamp(56px, 8vw, 112px) clamp(20px, 5vw, 64px);
}

.pb-section--tight {
  padding-top: clamp(40px, 5vw, 72px);
  padding-bottom: clamp(40px, 5vw, 72px);
}

/* Avada adds its own top offset on template pages; keep the first brand section compact. */
body.pb-sleep-theme #main .pb-section:first-child {
  padding-top: clamp(40px, 5vw, 64px);
}

/* Brand sections own their rhythm; prevent Avada from stacking another 90px above them. */
body.pb-sleep-theme #main:has(> .full-width .pb-section) {
  padding-top: 0;
}

.pb-section--dark {
  color: var(--pb-on-dark);
  background: var(--pb-dark);
}

.pb-section--dark h1,
.pb-section--dark h2,
.pb-section--dark h3 {
  color: var(--pb-on-dark);
}

.pb-container {
  max-width: 1180px;
  margin: 0 auto;
}

.pb-container--narrow {
  max-width: 820px;
}

.pb-eyebrow {
  margin: 0 0 14px;
  color: var(--pb-accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pb-title {
  margin: 0 0 20px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.pb-section--dark .pb-eyebrow {
  color: #b9cfc1;
}

.pb-lead {
  max-width: 680px;
  color: var(--pb-muted);
  font-size: 20px;
  line-height: 1.65;
}

.pb-section--dark .pb-lead,
.pb-section--dark p {
  color: rgba(246, 244, 239, 0.82);
}

/* Restore readable ink inside the white panel that sits in the dark section */
.pb-section--dark .pb-panel p,
.pb-section--dark .pb-panel .pb-note {
  color: var(--pb-muted);
}

.pb-section--dark .pb-panel .pb-eyebrow {
  color: var(--pb-accent);
}

.pb-section--dark .pb-panel .pb-price {
  color: var(--pb-accent);
}

.pb-section--dark .pb-panel h3 {
  color: var(--pb-ink);
}

/* Lift list-item contrast in the dark section */
.pb-section--dark .pb-list li {
  color: rgba(246, 244, 239, 0.82);
}

/* Hero: deliberately asymmetric; no three equal-width cards above the fold. */
.pb-hero {
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(61, 122, 92, 0.12), rgba(139, 115, 85, 0.08)),
    var(--pb-bg);
}

.pb-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.pb-hero__proof {
  margin: 26px 0 0;
  color: var(--pb-muted);
  font-size: 14px;
}

.pb-hero__visual {
  position: relative;
  min-height: 340px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--pb-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--pb-shadow);
}

.pb-hero__visual-label {
  margin: 0;
  color: var(--pb-muted);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pb-hero__visual-title {
  margin: 12px 0 18px;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.15;
}

.pb-visual-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  background: var(--pb-highlight);
}

.pb-visual-panel span {
  display: block;
  height: 9px;
  border-radius: 99px;
  background: rgba(45, 42, 38, 0.14);
}

.pb-visual-panel span:nth-child(2) { width: 78%; background: rgba(61, 122, 92, 0.48); }
.pb-visual-panel span:nth-child(3) { width: 56%; }
.pb-visual-panel span:nth-child(4) { width: 66%; background: rgba(139, 115, 85, 0.38); }

.pb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 30px;
}

.pb-button,
.pb-sleep-theme .pb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 13px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--pb-accent);
  color: #ffffff;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

.pb-button:hover,
.pb-button:focus {
  background: var(--pb-accent-dark);
  color: #ffffff;
  transform: translateY(-1px);
}

.pb-button--ghost,
.pb-sleep-theme .pb-button--ghost {
  border: 1px solid rgba(246, 244, 239, 0.42);
  background: transparent;
  color: var(--pb-on-dark);
}

.pb-button--ghost:hover,
.pb-button--ghost:focus {
  border-color: #ffffff;
  background: rgba(246, 244, 239, 0.12);
  color: #ffffff;
}

.pb-button--outline {
  border: 1px solid var(--pb-border);
  background: transparent;
  color: var(--pb-ink);
}

.pb-button--outline:hover,
.pb-button--outline:focus {
  border-color: var(--pb-accent);
  background: rgba(61, 122, 92, 0.08);
  color: var(--pb-ink);
}

/* Ritual flow: a numbered path, not a generic card row. */
.pb-ritual {
  display: grid;
  grid-template-columns: minmax(180px, 0.26fr) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 52px);
  align-items: start;
}

.pb-ritual__step {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 18px;
  padding: 24px 0;
  border-top: 1px solid var(--pb-border);
}

.pb-ritual__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--pb-accent);
  color: #ffffff;
  font-family: Fraunces, Georgia, serif;
  font-size: 18px;
}

.pb-ritual__step h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.pb-ritual__step p {
  margin: 0;
  color: var(--pb-muted);
}

.pb-ritual__aside {
  position: sticky;
  top: 100px;
  padding: 28px;
  border-radius: var(--pb-radius);
  background: var(--pb-surface);
  box-shadow: var(--pb-shadow);
}

.pb-ritual__aside h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

/* Trust bar */
.pb-trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius);
  background: var(--pb-border);
}

.pb-trust__item {
  padding: 26px 22px;
  background: var(--pb-surface);
}

.pb-trust__number {
  display: block;
  margin-bottom: 6px;
  color: var(--pb-accent);
  font-family: Fraunces, Georgia, serif;
  font-size: 27px;
}

.pb-trust__label {
  color: var(--pb-muted);
  font-size: 14px;
}

/* Content / offer blocks */
.pb-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.pb-panel {
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius);
  background: var(--pb-surface);
  box-shadow: var(--pb-shadow);
}

.pb-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.pb-list li {
  position: relative;
  margin-bottom: 13px;
  padding-left: 30px;
  color: var(--pb-muted);
}

.pb-list li::before {
  position: absolute;
  left: 0;
  color: var(--pb-accent);
  content: "—";
}

.pb-price {
  margin: 24px 0 4px;
  color: var(--pb-ink);
  font-family: Fraunces, Georgia, serif;
  font-size: 30px;
}

.pb-note {
  color: var(--pb-muted);
  font-size: 13px;
}

.pb-faq {
  max-width: 820px;
  margin: 0 auto;
}

.pb-faq details {
  margin-bottom: 12px;
  padding: 18px 22px;
  border: 1px solid var(--pb-border);
  border-radius: 14px;
  background: var(--pb-surface);
}

.pb-faq summary {
  color: var(--pb-ink);
  font-weight: 700;
  cursor: pointer;
}

.pb-faq p {
  margin: 12px 0 0;
  color: var(--pb-muted);
}

.pb-disclaimer {
  max-width: 900px;
  margin: 34px auto 0;
  padding: 18px 22px;
  border-left: 3px solid var(--pb-accent);
  border-radius: 6px;
  background: rgba(61, 122, 92, 0.07);
  color: var(--pb-muted);
  font-size: 14px;
  line-height: 1.6;
}

.pb-section--dark .pb-disclaimer {
  border-left-color: #b9cfc1;
  background: rgba(246, 244, 239, 0.07);
}

/* Blog / library cards */
.pb-library {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.pb-library__item {
  padding: 26px;
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius);
  background: var(--pb-surface);
}

.pb-library__item h3 {
  margin: 0 0 10px;
  font-size: 21px;
}

.pb-library__item p {
  margin: 0;
  color: var(--pb-muted);
}

/* WooCommerce integration */
.pb-sleep-theme.woocommerce ul.products li.product {
  background: var(--pb-surface);
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius);
  overflow: hidden;
}

.pb-sleep-theme.woocommerce ul.products li.product .price {
  color: var(--pb-accent);
  font-family: Fraunces, Georgia, serif;
}

.pb-spec-table {
  width: 100%;
  margin-top: 24px;
  border-collapse: collapse;
}

.pb-spec-table th,
.pb-spec-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--pb-border);
  text-align: left;
}

.pb-spec-table th {
  width: 38%;
  color: var(--pb-ink);
}

.pb-spec-table td {
  color: var(--pb-muted);
}

.pb-form {
  display: grid;
  gap: 12px;
  max-width: 520px;
  margin-top: 26px;
}

.pb-form input[type="email"],
.pb-form input[type="text"],
.pb-form textarea {
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  border: 1px solid var(--pb-border);
  border-radius: 12px;
  background: #ffffff;
  color: var(--pb-ink);
}

.pb-form label {
  color: var(--pb-muted);
  font-size: 14px;
}

.pb-footer-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.2fr) minmax(180px, 0.8fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.pb-footer-brand {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 20px;
  color: var(--pb-on-dark);
}

.pb-footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pb-footer-nav a,
.pb-footer-meta a,
.pb-footer-cta a {
  color: #c7ddd0;
  text-decoration: none;
}

.pb-footer-cta a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pb-footer-nav a:hover,
.pb-footer-nav a:focus,
.pb-footer-meta a:hover,
.pb-footer-meta a:focus,
.pb-footer-cta a:hover,
.pb-footer-cta a:focus {
  color: #ffffff;
}

.pb-footer-cta {
  margin: 0;
  color: rgba(246, 244, 239, 0.78);
  font-size: 15px;
  line-height: 1.6;
}

.pb-footer-meta {
  max-width: 860px;
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(246, 244, 239, 0.16);
  color: rgba(246, 244, 239, 0.66);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 960px) {
  .pb-hero__grid,
  .pb-split,
  .pb-ritual {
    grid-template-columns: minmax(0, 1fr);
  }

  .pb-ritual__aside {
    position: static;
  }

  .pb-trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .pb-library {
    grid-template-columns: minmax(0, 1fr);
  }

  .pb-footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pb-trust {
    grid-template-columns: minmax(0, 1fr);
  }

  .pb-ritual__step {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pb-mobile-cta {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 18px;
  border-radius: 999px;
  background: var(--pb-accent);
  box-shadow: 0 12px 30px rgba(26, 31, 28, 0.24);
  color: #ffffff;
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  pointer-events: none;
}

.pb-mobile-cta:focus,
.pb-mobile-cta:hover {
  background: var(--pb-accent-dark);
  color: #ffffff;
  text-decoration: none;
}

.pb-mobile-cta.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Avada archive meta links are too short to tap reliably on phones. */
@media (max-width: 1024px) {
  .fusion-meta-info .fusion-alignleft a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
  }

  .fusion-read-more {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
  }
}

@media (max-width: 768px) {
  .pb-mobile-cta {
    display: flex;
  }

  body.pb-sleep-theme {
    padding-bottom: 82px;
  }
}

/* Footer legal links */
.pb-footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: center;
  list-style: none;
  margin: 28px 0 16px;
  padding: 0;
}

.pb-footer-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: #c7ddd0;
  font-size: 0.875rem;
  text-decoration: none;
}

.pb-footer-legal a:hover,
.pb-footer-legal a:focus {
  color: #ffffff;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .pb-footer-legal {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
}

/* ---- v2 additions: article badges & table polish (2026-09-14) ---- */
.pb-tag {
  display: inline-block;
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pb-muted, #7a6f63);
  background: var(--pb-highlight);
  border-radius: 999px;
  padding: 3px 12px;
  margin-left: 8px;
  vertical-align: middle;
}
.pb-table th {
  font-weight: 600;
}
.pb-table td {
  vertical-align: top;
}
