/* Hub & Blog shared styles — Emany */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0f0f10;
  --bg2:        #1a1a1e;
  --bg3:        #222228;
  --border:     rgba(255,255,255,0.07);
  --border2:    rgba(255,255,255,0.12);
  --text:       #ececf1;
  --text-muted: #8888a8;
  --text-dim:   #555570;
  --accent:     #20b2aa;
  --accent2:    #4299e1;
  --green:      #22c55e;
}

/* Kenko green theme override */
.theme-kenko {
  --accent:  #22c55e;
  --accent2: #16a34a;
}

/* Shokuji yellow theme override */
.theme-shokuji {
  --accent:  #eab308;
  --accent2: #ca8a04;
}
.theme-shokuji .hub-nav-link.active { background: rgba(234,179,8,.08); }
.theme-shokuji .hub-nav-cta { border-color: rgba(234,179,8,.28); color: #eab308; }
.theme-shokuji .hub-nav-cta:hover { background: rgba(234,179,8,.08); }
.theme-shokuji .hub-hero-tag {
  background: rgba(234,179,8,.1);
  border-color: rgba(234,179,8,.22);
  color: #eab308;
}
.theme-shokuji .post-card-tag { background: rgba(234,179,8,.1); color: #b45309; }
.theme-shokuji .btn-primary { background: #eab308; color: #1a1400; }

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* ── NAVBAR ──────────────────────────────────── */
.hub-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,15,16,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.hub-nav-logo {
  display: flex;
  align-items: center;
  gap: .45rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: -.01em;
}

.hub-nav-logo-icon {
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hub-nav-links {
  display: flex;
  align-items: center;
  gap: .2rem;
}

.hub-nav-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .85rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: .855rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.hub-nav-link:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.hub-nav-link.active { color: var(--accent); background: rgba(32,178,170,.08); }
.theme-kenko .hub-nav-link.active { background: rgba(34,197,94,.08); }

.hub-nav-cta {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .42rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: .855rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid rgba(32, 178, 170, .28);
  transition: background .15s;
}
.hub-nav-cta:hover { background: rgba(32,178,170,.08); }
.theme-kenko .hub-nav-cta { border-color: rgba(34,197,94,.28); }
.theme-kenko .hub-nav-cta:hover { background: rgba(34,197,94,.08); }

/* ── LAYOUT ──────────────────────────────────── */
.hub-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hub-container-narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── HERO ────────────────────────────────────── */
.hub-hero {
  padding: 5.5rem 2rem 4.5rem;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}

.hub-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .8rem;
  border-radius: 20px;
  background: rgba(32,178,170,.1);
  border: 1px solid rgba(32,178,170,.22);
  font-size: .77rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 1.6rem;
}
.theme-kenko .hub-hero-tag {
  background: rgba(34,197,94,.1);
  border-color: rgba(34,197,94,.22);
}

.hub-hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.1;
  margin-bottom: 1.3rem;
}

.hub-hero-title span {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hub-hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 560px;
  margin: 0 auto 2.25rem;
}

.hub-hero-btns {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  padding: .68rem 1.6rem;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  transition: opacity .15s;
}
.btn-primary:hover { opacity: .85; }

.btn-secondary {
  padding: .68rem 1.6rem;
  border-radius: 10px;
  background: var(--bg3);
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  border: 1px solid var(--border2);
  transition: background .15s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.06); }

/* ── FEATURES ────────────────────────────────── */
.hub-features {
  padding: 3rem 0 4rem;
}

.hub-section-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 1.75rem;
  color: var(--text);
}

.hub-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.2rem;
}

.feature-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  transition: border-color .2s;
}
.feature-card:hover { border-color: var(--border2); }

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .5rem;
  color: var(--text);
}

.feature-card p {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ── LATEST POSTS SECTION ───────────────────── */
.hub-posts-section {
  padding: 3rem 0 5rem;
  border-top: 1px solid var(--border);
}

.hub-posts-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.hub-view-all {
  font-size: .855rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.hub-view-all:hover { text-decoration: underline; }

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.2rem;
}

.post-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  transition: border-color .2s, transform .15s;
}
.post-card:hover { border-color: var(--border2); transform: translateY(-2px); }

.post-card-tag {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(32,178,170,.1);
  padding: .2rem .55rem;
  border-radius: 6px;
  width: fit-content;
}
.theme-kenko .post-card-tag { background: rgba(34,197,94,.1); }

.post-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.post-card-excerpt {
  font-size: .855rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.post-card-meta {
  font-size: .775rem;
  color: var(--text-dim);
  display: flex;
  gap: .75rem;
}

/* ── BLOG LISTING ────────────────────────────── */
.blog-header {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.blog-header-tag {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .75rem;
}

.blog-header-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.2;
}

.blog-header-sub {
  font-size: .95rem;
  color: var(--text-muted);
  margin-top: .5rem;
}

.blog-posts-list {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  padding-bottom: 4.5rem;
}

.blog-list-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: border-color .2s;
}
.blog-list-card:hover { border-color: var(--border2); }

.blog-list-card-title {
  font-size: 1.075rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.blog-list-card-excerpt {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.blog-list-card-meta {
  font-size: .775rem;
  color: var(--text-dim);
  display: flex;
  gap: 1rem;
  margin-top: .2rem;
}

/* ── ARTICLE ────────────────────────────────── */
.article-header {
  padding: 3.5rem 0 2rem;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .855rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color .15s;
}
.article-back:hover { color: var(--text); }

.article-tag {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .75rem;
}

.article-title {
  font-size: clamp(1.65rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text);
}

.article-meta {
  font-size: .855rem;
  color: var(--text-muted);
  display: flex;
  gap: 1.25rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

/* Article body */
.article-body {
  padding: 2.5rem 0 5rem;
  font-size: 1.025rem;
  line-height: 1.82;
  color: var(--text);
}
.article-body h1, .article-body h2, .article-body h3, .article-body h4 {
  font-weight: 700;
  letter-spacing: -.018em;
  margin: 2.25rem 0 .75rem;
  line-height: 1.25;
  color: var(--text);
}
.article-body h1 { font-size: 2rem; }
.article-body h2 { font-size: 1.45rem; }
.article-body h3 { font-size: 1.15rem; }
.article-body h4 { font-size: 1rem; color: var(--text-muted); }
.article-body p { margin-bottom: 1.3rem; }
.article-body ul, .article-body ol { padding-left: 1.5rem; margin-bottom: 1.3rem; }
.article-body li { margin-bottom: .5rem; }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body em { color: var(--text-muted); }
.article-body a { color: var(--accent); text-decoration: none; }
.article-body a:hover { text-decoration: underline; }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: .75rem 1.25rem;
  color: var(--text-muted);
  margin: 1.5rem 0;
  font-style: italic;
  background: var(--bg2);
  border-radius: 0 10px 10px 0;
}
.article-body pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-size: .875rem;
  line-height: 1.65;
  margin-bottom: 1.3rem;
}
.article-body code {
  background: var(--bg3);
  padding: .18rem .4rem;
  border-radius: 5px;
  font-size: .875em;
  color: var(--accent);
  font-family: 'Fira Code', 'Cascadia Code', monospace;
}
.article-body pre code {
  background: none;
  padding: 0;
  color: var(--text);
  border-radius: 0;
}
.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── SHARED UTILITIES ───────────────────────── */
.posts-empty {
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
  border: 1px dashed var(--border2);
  border-radius: 16px;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  color: var(--text-muted);
  font-size: .9rem;
  gap: .75rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── FOOTER ─────────────────────────────────── */
.hub-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 100%;
}

.hub-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.hub-footer-links {
  display: flex;
  gap: 1.5rem;
}

.hub-footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color .15s;
}
.hub-footer-links a:hover { color: var(--text-muted); }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 640px) {
  .hub-nav { padding: 0 1.25rem; }
  .hub-hero { padding: 3.5rem 1.25rem 3rem; }
  .hub-container, .hub-container-narrow { padding: 0 1.25rem; }
  .hub-features-grid { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: 1fr; }
  .hub-nav-links { display: none; }
}
