/* =========================================================
   Fungii — common.css
   literacy.html を基準とする全ページ共通スタイル
   - カラートークン / タイポ / nav / footer / btn / section-* / reveal
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Forest（ダーク背景） */
  --forest:        #1e3a2a;
  --forest-mid:    #2d5940;
  --forest-light:  #3d7a56;

  /* Green アクセント */
  --moss:          #4e7c5e;
  --sage:          #7aab8a;
  --sage-light:    #a8c9b4;

  /* Cream（ライト背景） */
  --cream:         #f4f1ea;
  --cream-warm:    #ede7d9;

  /* Text */
  --text-dark:     #1a2e1f;
  --text-muted:    #5a7a62;

  /* Rule / Divider */
  --rule:          rgba(62,120,86,0.15);

  /* CTA Accent */
  --accent:        #b85c38;
  --accent-light:  #e07a52;

  /* Font stacks */
  --font-sans:  "Zen Kaku Gothic New", system-ui, sans-serif;
  --font-serif: "Lora", "Zen Kaku Gothic New", serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--cream);
  color: var(--text-dark);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* ---------- Navigation ---------- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 200;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 4rem;
  background: rgba(244,241,234,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--rule);
}
.nav-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  line-height: 1;
}
.nav-logo img {
  height: 36px;
  width: auto;
  display: block;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-right a {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-right a:hover { color: var(--text-dark); }
.nav-right a.is-active {
  color: var(--text-dark);
  position: relative;
}
.nav-right a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--forest-light);
}
.nav-cta {
  padding: 0.55rem 1.4rem;
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 700;
}
.nav-cta:hover { background: var(--accent-light) !important; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 210;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--text-dark);
  margin: 5px 0;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn-main {
  padding: 1rem 2.5rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  font-weight: 700;
  transition: background 0.25s;
  font-family: inherit;
  border: none;
  cursor: pointer;
  display: inline-block;
}
.btn-main:hover { background: var(--accent-light); }

/* dark-bg outline */
.btn-sub {
  padding: 1rem 2.5rem;
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.25s;
  font-family: inherit;
  display: inline-block;
}
.btn-sub:hover { border-color: rgba(255,255,255,0.5); color: #fff; }

/* light-bg outline (cream面の二次ボタン) */
.btn-sub--light {
  color: var(--text-dark);
  border-color: rgba(30,58,42,0.3);
}
.btn-sub--light:hover {
  border-color: var(--text-dark);
  color: var(--text-dark);
  background: rgba(30,58,42,0.04);
}

/* ---------- Sections (common pattern) ---------- */
section { position: relative; z-index: 1; }
section[id] { scroll-margin-top: 70px; }

.section-tag {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.section-tag::before {
  content: "";
  width: 20px;
  height: 1px;
  background: var(--moss);
}
.section-title {
  font-weight: 900;
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1.25;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}
.section-title .acc { color: var(--forest-light); }
.section-body {
  font-size: 0.9rem;
  line-height: 2.1;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

/* dark-section overrides */
.section--dark .section-tag { color: var(--sage); }
.section--dark .section-tag::before { background: var(--sage); }
.section--dark .section-title { color: #fff; }
.section--dark .section-title .acc { color: var(--sage-light); }
.section--dark .section-body { color: rgba(255,255,255,0.7); }

/* centered variant (e.g., CTA / hero message) */
.section-tag--center {
  justify-content: center;
}
.section-tag--center::before { display: none; }

/* ---------- Footer ---------- */
footer {
  background: var(--forest);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 3rem 5rem 2rem;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.4rem 2rem;
  padding-bottom: 2rem;
  margin-bottom: 1.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-nav a {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-nav a:hover { color: #fff; }
.footer-nav a.is-active { color: var(--sage); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-logo {
  display: inline-block;
  text-decoration: none;
  line-height: 1;
}
.footer-logo img {
  height: 40px;
  width: auto;
  display: block;
}
.footer-copy { font-size: 0.7rem; color: rgba(255,255,255,0.2); letter-spacing: 0.05em; }

/* ---------- Feature card (shared: learn / colaboworks) ----------
   横並びカード（画像/ビジュアル左 + 詳細右）。
   .ws-feature__visual に <img class="ws-feature__img"> を入れると
   画像が前面を覆い、無い/読込失敗時は内側のグラデ＋テキストが見える。 */
.ws-feature {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 0;
  background: var(--cream);
  border-top: 3px solid var(--forest-light);
  overflow: hidden;
}
.ws-feature__visual {
  position: relative;
  min-height: 340px;
  background: linear-gradient(150deg, #5a7d4f 0%, var(--forest) 55%, var(--forest-mid) 100%);
  padding: 2.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.ws-feature__visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 25%, rgba(255,222,150,0.18) 0%, transparent 40%),
    radial-gradient(circle at 80% 75%, rgba(122,171,138,0.22) 0%, transparent 45%);
  pointer-events: none;
}
/* 実画像（あれば前面を覆う） */
.ws-feature__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}
.ws-feature__series {
  position: relative;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage-light);
  font-weight: 600;
  line-height: 1.8;
}
.ws-feature__emoji {
  position: relative;
  font-size: 3.4rem;
  line-height: 1;
}
.ws-feature__visual-cap {
  position: relative;
  color: rgba(255,255,255,0.9);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.6;
}
.ws-feature__body {
  padding: 2.8rem 2.6rem;
  display: flex;
  flex-direction: column;
}
.ws-eyebrow {
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--forest-light);
  font-weight: 700;
  margin-bottom: 0.9rem;
}
.ws-title {
  font-weight: 900;
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  line-height: 1.4;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}
.ws-title__en {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--moss);
  margin-top: 0.4rem;
}
.ws-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.95;
  margin: 1.2rem 0 1.5rem;
}
.ws-themes {
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.2rem;
}
.ws-theme {
  font-size: 0.78rem;
  color: var(--text-dark);
  line-height: 1.6;
  padding-left: 0.9rem;
  position: relative;
}
.ws-theme::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--forest-light);
}
.ws-theme strong { color: var(--forest); font-weight: 700; }
.ws-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  padding: 1.3rem 0;
  margin-bottom: 1.5rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.ws-meta__k {
  font-size: 0.72rem;
  color: var(--moss);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.ws-meta__v {
  font-size: 0.8rem;
  color: var(--text-dark);
  line-height: 1.6;
}
.ws-meta__v strong { color: var(--forest); font-weight: 700; }
.ws-cta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: flex-start;
}
.ws-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.ws-note--ext::before { content: "↗ "; color: var(--moss); }

/* ---------- Abstract art decoration（抽象SVGアート） ----------
   .has-art を付けた要素の内側に .bg-art を置くと、装飾SVGが背面に敷かれる。
   opacity / background-image / size は呼び出し側（inline style 等）で調整。 */
.has-art { position: relative; overflow: hidden; }
.has-art > *:not(.bg-art) { position: relative; z-index: 1; }
.bg-art {
  position: absolute;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
}
.bg-art--cover { inset: 0; background-position: center; background-size: cover; }
.bg-art--corner { right: 0; bottom: 0; width: 60%; height: 70%; background-position: right bottom; background-size: contain; }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js-ready .reveal { opacity: 0; transform: translateY(22px); }
.js-ready .reveal.visible { opacity: 1; transform: none; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  nav { padding: 1rem 1.5rem; }
  .nav-right {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: rgba(244,241,234,0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2rem 1.5rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--rule);
  }
  .nav-right.is-open { display: flex; }
  .nav-right a { font-size: 0.9rem; }
  .nav-cta { align-self: stretch; text-align: center; }
  .nav-toggle { display: block; }

  section { padding: 5rem 1.5rem; }

  footer { padding: 2.5rem 1.5rem 1.5rem; }
  .footer-nav { gap: 0.9rem 1.5rem; padding-bottom: 1.5rem; margin-bottom: 1.5rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }

  /* shared feature card → stack */
  .ws-feature { grid-template-columns: 1fr; }
  .ws-feature__visual { min-height: 200px; padding: 2.2rem 1.7rem; }
  .ws-feature__body { padding: 2.2rem 1.7rem; }
  .ws-themes { grid-template-columns: 1fr; }
}
