/*
Theme Name: Meru AI Lab Theme
Theme URI: https://ai.merucon.net/
Author: RUCO INC
Description: Membership-first WordPress theme for ai.merucon.net.
Version: 0.2.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: meru-ai-lab-theme
*/

:root {
  --theme-bg: #fcfbf8;
  --theme-bg-soft: #f3eee8;
  --theme-panel: rgba(255, 255, 255, 0.9);
  --theme-panel-strong: #ffffff;
  --theme-line: rgba(40, 48, 66, 0.12);
  --theme-text: #1f2430;
  --theme-muted: #677185;
  --theme-soft: #8f4e78;
  --theme-accent: #d9669f;
  --theme-accent-strong: #b94a82;
  --theme-shadow: rgba(33, 36, 49, 0.08);
  --theme-shadow-strong: rgba(33, 36, 49, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(217, 102, 159, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(245, 213, 231, 0.8), transparent 18%),
    linear-gradient(180deg, #fffdfa 0%, #faf6f2 48%, #f4eee7 100%);
  color: var(--theme-text);
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-shell {
  max-width: 1080px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 18px 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0 22px;
}

.topbar__brand {
  font-family: "Futura", "Avenir Next", sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar__link,
.topbar__button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.topbar__link,
.topbar__button--ghost,
.button--secondary {
  border: 1px solid var(--theme-line);
  background: rgba(255, 255, 255, 0.74);
  color: var(--theme-soft);
}

.topbar__button,
.button--primary {
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--theme-accent) 0%, var(--theme-accent-strong) 100%);
  box-shadow: 0 12px 28px rgba(217, 102, 159, 0.22);
  color: #fff;
}

.topbar__link:hover,
.topbar__button:hover,
.button:hover {
  transform: translateY(-1px);
}

.member-gate,
.page-summary,
.archive-shell,
.article-shell,
.empty-state {
  border: 1px solid var(--theme-line);
  border-radius: 28px;
  background: var(--theme-panel);
  box-shadow: 0 22px 42px var(--theme-shadow);
  backdrop-filter: blur(14px);
}

.member-gate {
  max-width: 720px;
  margin: 48px auto 0;
  padding: 40px;
}

.member-gate__eyebrow,
.article-shell__eyebrow {
  margin: 0 0 12px;
  color: var(--theme-accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.member-gate__title,
.archive-heading__title,
.empty-state__title,
.article-shell__title {
  margin: 0;
  font-family: "Futura", "Avenir Next", sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.member-gate__title {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.06;
}

.member-gate__description,
.page-summary__text,
.archive-heading__description,
.empty-state__description,
.article-shell__content,
.article-shell__content p,
.article-shell__content li {
  color: var(--theme-muted);
  font-size: 16px;
  line-height: 1.9;
}

.member-gate__description {
  max-width: 560px;
  margin: 16px 0 0;
}

.member-gate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.member-gate__points {
  margin: 26px 0 0;
  padding-left: 18px;
  color: var(--theme-muted);
  line-height: 1.9;
}

.page-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px 22px;
}

.page-summary__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-summary__stats span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(217, 102, 159, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--theme-soft);
  font-size: 13px;
  font-weight: 700;
}

.page-summary__text {
  margin: 0;
}

.curriculum {
  display: grid;
  gap: 14px;
}

.chapter-accordion {
  border: 1px solid var(--theme-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 32px var(--theme-shadow);
  overflow: hidden;
}

.chapter-accordion[open] {
  border-color: rgba(217, 102, 159, 0.24);
  box-shadow: 0 18px 36px rgba(217, 102, 159, 0.12);
}

.chapter-accordion__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.chapter-accordion__summary::-webkit-details-marker {
  display: none;
}

.chapter-accordion__lead {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.chapter-accordion__chapter {
  color: var(--theme-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.chapter-accordion__title {
  margin: 0;
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1.18;
}

.chapter-accordion__meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
  text-align: right;
  color: var(--theme-muted);
  font-size: 13px;
  font-weight: 700;
}

.chapter-accordion__panel {
  border-top: 1px solid rgba(40, 48, 66, 0.08);
  padding: 8px 14px 14px;
}

.lesson-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lesson-item + .lesson-item {
  border-top: 1px solid rgba(40, 48, 66, 0.08);
}

.lesson-item__link {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 0 10px;
}

.lesson-item__sequence {
  color: var(--theme-soft);
  font-size: 14px;
  font-weight: 700;
}

.lesson-item__title {
  color: var(--theme-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.lesson-item__date {
  color: var(--theme-muted);
  font-size: 13px;
}

.lesson-item--pending .lesson-item__title,
.lesson-item--pending .lesson-item__date {
  color: var(--theme-muted);
}

.archive-shell {
  padding: 28px;
}

.archive-heading {
  margin-bottom: 18px;
}

.archive-heading__title {
  font-size: clamp(26px, 3vw, 40px);
}

.archive-heading__description {
  margin: 10px 0 0;
}

.archive-list {
  display: grid;
  gap: 12px;
}

.archive-card {
  border: 1px solid rgba(40, 48, 66, 0.08);
  border-radius: 22px;
  background: var(--theme-panel-strong);
}

.archive-card__link {
  display: block;
  padding: 18px 20px;
}

.archive-card__chapter {
  color: var(--theme-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.archive-card__title {
  margin: 10px 0 0;
  font-size: 22px;
  line-height: 1.24;
}

.archive-card__meta,
.article-shell__meta,
.article-nav__label {
  color: var(--theme-muted);
  font-size: 13px;
  font-weight: 700;
}

.archive-card__meta {
  margin: 10px 0 0;
}

.article-shell {
  padding: 34px;
}

.article-shell__title {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
}

.article-shell__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 18px;
}

.article-shell__content {
  margin-top: 28px;
}

.article-shell__content h2,
.article-shell__content h3 {
  margin-top: 34px;
  margin-bottom: 14px;
  color: var(--theme-text);
  font-family: "Futura", "Avenir Next", sans-serif;
  letter-spacing: -0.03em;
}

.article-shell__content ul,
.article-shell__content ol {
  padding-left: 22px;
}

.article-shell__content blockquote {
  margin: 24px 0;
  padding-left: 18px;
  border-left: 3px solid rgba(217, 102, 159, 0.28);
  color: var(--theme-muted);
}

.article-shell__footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
}

.article-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 96px;
  padding: 18px;
  border: 1px solid rgba(40, 48, 66, 0.08);
  border-radius: 22px;
  background: var(--theme-panel-strong);
}

.article-nav--next {
  text-align: right;
}

.article-nav__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.55;
}

.empty-state {
  padding: 36px;
  text-align: center;
}

.empty-state__title {
  font-size: clamp(26px, 4vw, 42px);
}

.empty-state__description {
  margin: 14px auto 0;
  max-width: 560px;
}

@media (max-width: 860px) {
  .page-summary,
  .chapter-accordion__summary,
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .chapter-accordion__meta {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .article-shell__footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-shell {
    padding: 14px 12px 40px;
  }

  .topbar__brand {
    font-size: 24px;
  }

  .member-gate,
  .archive-shell,
  .article-shell,
  .empty-state {
    padding: 24px;
  }

  .page-summary {
    padding: 16px;
  }

  .lesson-item__link {
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 6px;
  }

  .lesson-item__date {
    font-size: 12px;
  }
}
