/*
Theme Name: TOFU Lab Affiliate
Theme URI: https://community.tofulab.app/
Author: Codex
Description: WordPress no-code production blog for introducing TOFU Lab through practical articles.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
Text Domain: tofu-lab-affiliate
*/

:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-soft: #eef5f2;
  --ink: #18211f;
  --muted: #5d6964;
  --line: #dbe3df;
  --teal: #087f72;
  --teal-dark: #075f58;
  --accent: #e58b34;
  --accent-soft: #fff1df;
  --shadow: 0 22px 60px rgba(20, 37, 33, 0.12);
  --radius: 8px;
  --container: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Yu Gothic UI", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
}

a {
  color: var(--teal-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(219, 227, 223, 0.9);
  background: rgba(247, 248, 246, 0.94);
  backdrop-filter: blur(16px);
}

.wrap {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.site-brand strong {
  font-size: 18px;
  line-height: 1.2;
}

.site-brand span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 18px;
  font-size: 14px;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
}

.button,
.nav .cta-link,
.wp-block-button__link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  padding: 12px 18px;
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  color: var(--teal-dark);
}

.hero {
  padding: 56px 0 44px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  align-items: center;
  gap: 36px;
}

.eyebrow,
.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  padding: 7px 12px;
}

.hero h1,
.page-title {
  margin: 18px 0 18px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero p {
  max-width: 42em;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions,
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.hero-media {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-media img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.section {
  padding: 48px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.2;
}

.section-head p {
  max-width: 40em;
  margin: 8px 0 0;
  color: var(--muted);
}

.feature-grid,
.post-grid,
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card,
.post-card,
.cta-panel,
.article-body {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.card,
.post-card {
  padding: 22px;
}

.post-card-thumb {
  display: block;
  overflow: hidden;
  margin: -22px -22px 18px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface-soft);
}

.post-card-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-featured-image {
  overflow: hidden;
  margin: 28px 0 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.post-featured-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card h3,
.post-card h2,
.post-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.35;
}

.card p,
.post-card p {
  margin: 0;
  color: var(--muted);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.post-card a {
  color: var(--ink);
  text-decoration: none;
}

.post-card:hover {
  border-color: rgba(8, 127, 114, 0.45);
  box-shadow: 0 16px 36px rgba(20, 37, 33, 0.08);
}

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

.cta-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 30px;
}

.cta-panel h2,
.cta-panel h3 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.2;
}

.cta-panel p {
  margin: 0;
  color: var(--muted);
}

.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  padding: 44px 0 64px;
}

.article-body {
  padding: min(7vw, 58px);
}

.article-body h1 {
  margin: 0 0 18px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.14;
}

.article-body h2 {
  margin-top: 42px;
  font-size: 28px;
  line-height: 1.35;
}

.article-body h3 {
  margin-top: 28px;
  font-size: 22px;
}

.article-body p,
.article-body li {
  color: #293431;
}

.article-body blockquote {
  margin: 28px 0;
  border-left: 4px solid var(--teal);
  background: var(--surface-soft);
  padding: 18px 22px;
}

.pr-note {
  margin-bottom: 24px;
  border: 1px solid #f0c99d;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: #5c3b18;
  font-size: 14px;
  padding: 12px 14px;
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 94px;
}

.sidebar-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px;
}

.sidebar-box + .sidebar-box {
  margin-top: 18px;
}

.sidebar-box h2,
.sidebar-box h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.sidebar-box p,
.sidebar-box li {
  color: var(--muted);
  font-size: 14px;
}

.sidebar-box ul {
  margin: 12px 0 0;
  padding-left: 1.2em;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.pagination {
  margin-top: 28px;
}

.pagination .page-numbers {
  display: inline-flex;
  min-width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-right: 6px;
  text-decoration: none;
}

.pagination .current {
  background: var(--teal);
  color: #fff;
}

@media (max-width: 860px) {
  .header-inner,
  .section-head,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-grid,
  .main-layout,
  .cta-panel {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .post-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 560px) {
  .wrap {
    width: min(100% - 22px, var(--container));
  }

  .hero {
    padding-top: 34px;
  }

  .nav {
    justify-content: flex-start;
  }

  .article-body {
    padding: 24px 18px;
  }
}
