/* ============================================
   Telisia Works - Main Stylesheet (11ty 静的サイト用)
   v1.0.0 - 2026-05-05
   ============================================ */

/* === CSS Variables === */
:root {
  /* Brand */
  --tw-bg: #0a0a0f;
  --tw-bg-2: #111118;
  --tw-bg-3: #1a1a22;
  --tw-bg-card: rgba(255, 255, 255, 0.03);
  --tw-accent: #ff8533;
  --tw-accent-2: #ff6030;
  --tw-accent-soft: rgba(255, 133, 51, 0.12);
  --tw-accent-gradient: linear-gradient(135deg, #ff8533, #ff6030);

  /* Text */
  --tw-text: #e8e8e8;
  --tw-text-2: #999;
  --tw-text-muted: #666;

  /* Border */
  --tw-border: rgba(255, 255, 255, 0.08);
  --tw-border-hover: rgba(255, 255, 255, 0.15);

  /* Layout */
  --tw-container: 1100px;
  --tw-container-narrow: 800px;
}

/* === Reset / Base === */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--tw-bg);
  color: var(--tw-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--tw-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--tw-accent-2); }

/* === Header === */
.tw-header {
  background: var(--tw-bg-2);
  border-bottom: 1px solid var(--tw-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.tw-header__inner {
  max-width: var(--tw-container);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.tw-header__logo {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 1.1rem;
  background: linear-gradient(135deg, #fff 0%, #ff8533 50%, #ff6030 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.02em;
}
.tw-nav {
  flex: 1 1 auto;
}
.tw-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 22px;
  justify-content: flex-end;
}
.tw-nav__list a {
  color: var(--tw-text);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.tw-nav__list a:hover {
  color: var(--tw-accent);
  border-bottom-color: var(--tw-accent);
}
.tw-header__sns {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--tw-bg-3);
  color: var(--tw-text);
  border: 1px solid var(--tw-border);
  transition: all 0.2s;
}
.tw-header__sns:hover {
  background: var(--tw-accent);
  color: #1a0a00;
  border-color: var(--tw-accent);
}

/* === ハンバーガーボタン（スマホ専用、PCでは display: none） === */
.tw-menu-btn {
  display: none;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--tw-border);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}
.tw-menu-btn:hover {
  border-color: var(--tw-accent);
  background: var(--tw-bg-3);
}
.tw-menu-btn__bar {
  display: block;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--tw-text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}
.tw-menu-btn__bar:nth-child(1) { top: 12px; }
.tw-menu-btn__bar:nth-child(2) { top: 19px; }
.tw-menu-btn__bar:nth-child(3) { top: 26px; }
/* オープン時 → ✕ 形状にアニメーション */
.tw-menu-btn--open .tw-menu-btn__bar:nth-child(1) {
  top: 19px;
  transform: translateX(-50%) rotate(45deg);
}
.tw-menu-btn--open .tw-menu-btn__bar:nth-child(2) {
  opacity: 0;
}
.tw-menu-btn--open .tw-menu-btn__bar:nth-child(3) {
  top: 19px;
  transform: translateX(-50%) rotate(-45deg);
}

/* === Main === */
.tw-main {
  min-height: calc(100vh - 200px);
  max-width: var(--tw-container);
  margin: 0 auto;
  padding: 40px 20px;
}

/* === Footer === */
.tw-footer {
  background: var(--tw-bg-2);
  border-top: 1px solid var(--tw-border);
  padding: 30px 20px;
  margin-top: 60px;
}
.tw-footer__inner {
  max-width: var(--tw-container);
  margin: 0 auto;
  text-align: center;
}
.tw-footer__nav ul {
  list-style: none;
  margin: 0 0 16px 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  justify-content: center;
}
.tw-footer__nav a {
  color: var(--tw-text-2);
  font-size: 0.86rem;
}
.tw-footer__nav a:hover {
  color: var(--tw-accent);
}
.tw-footer__copyright {
  margin: 0;
  color: var(--tw-text-muted);
  font-size: 0.78rem;
}

/* === Buttons === */
.tw-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--tw-accent-gradient);
  color: #1a0a00 !important;
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(255, 133, 51, 0.28);
  letter-spacing: 0.04em;
}
.tw-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 133, 51, 0.45);
}
.tw-btn--ghost {
  background: transparent;
  color: var(--tw-accent) !important;
  border: 1px solid var(--tw-accent);
  box-shadow: none;
}
.tw-btn--ghost:hover {
  background: var(--tw-accent-soft);
  transform: none;
  box-shadow: none;
}

/* === Cards === */
.tw-card {
  background: var(--tw-bg-card);
  border: 1px solid var(--tw-border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
}
.tw-card:hover {
  border-color: var(--tw-accent);
  transform: translateY(-2px);
}

/* === Section common === */
.tw-section {
  margin: 60px 0;
}
.tw-section__head {
  text-align: center;
  margin-bottom: 30px;
}
.tw-section__label {
  display: inline-block;
  padding: 4px 14px;
  background: var(--tw-accent-soft);
  color: var(--tw-accent);
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin-bottom: 12px;
}
.tw-section__title {
  font-size: 1.7rem;
  font-weight: 800;
  margin: 0 0 8px;
  background: linear-gradient(135deg, #fff 0%, #ff8533 50%, #ff6030 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tw-section__desc {
  color: var(--tw-text-2);
  font-size: 0.95rem;
  margin: 0 auto;
  max-width: 600px;
}

/* === Article (post) styles ===
   ブログ記事のH2/H3、装飾ボックス、表など。
   article-template や custom-style.css と同じ思想を継承。 */
.tw-article {
  max-width: var(--tw-container-narrow);
  margin: 0 auto;
  padding: 0 20px;
}
.tw-article p { margin-bottom: 1.4em; }
.tw-article h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 2.5em 0 1em;
  padding: 0.4em 0 0.4em 0.9em;
  border-left: 5px solid var(--tw-accent);
  border-bottom: 1px solid var(--tw-border);
  background: var(--tw-accent-soft);
}
.tw-article h3 {
  font-size: 1.18rem;
  font-weight: 700;
  margin: 2em 0 0.8em;
  padding-bottom: 0.3em;
  border-bottom: 2px dotted rgba(255, 133, 51, 0.4);
}
.tw-article .tw-lead {
  background: linear-gradient(135deg, rgba(255, 133, 51, 0.08), rgba(255, 96, 48, 0.05));
  border-left: 4px solid var(--tw-accent);
  padding: 18px 24px;
  margin: 0 0 2em;
  border-radius: 0 10px 10px 0;
  font-size: 1.02rem;
}
.tw-article .tw-lead::before {
  content: "▾ この記事の概要";
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--tw-accent);
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}
.tw-article .tw-box {
  padding: 16px 22px;
  margin: 1.5em 0;
  border-radius: 8px;
  border-left: 4px solid;
  background: var(--tw-bg-card);
}
.tw-article .tw-box > *:last-child { margin-bottom: 0; }
.tw-article .tw-box-tip { border-left-color: #4ade80; background: rgba(74, 222, 128, 0.06); }
.tw-article .tw-box-tip::before {
  content: "💡 ヒント";
  display: block; font-weight: 800; margin-bottom: 8px; color: #4ade80; font-size: 0.85rem;
}
.tw-article .tw-box-warn { border-left-color: #ff8c00; background: rgba(255, 140, 0, 0.06); }
.tw-article .tw-box-warn::before {
  content: "⚠ 注意";
  display: block; font-weight: 800; margin-bottom: 8px; color: #ff8c00; font-size: 0.85rem;
}
.tw-article .tw-box-point { border-left-color: var(--tw-accent); background: var(--tw-accent-soft); }
.tw-article .tw-box-point::before {
  content: "✨ ポイント";
  display: block; font-weight: 800; margin-bottom: 8px; color: var(--tw-accent); font-size: 0.85rem;
}
.tw-article table {
  width: 100%;
  margin: 1.5em 0;
  border-collapse: collapse;
  background: var(--tw-bg-2);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--tw-border);
}
.tw-article th, .tw-article td {
  padding: 10px 14px;
  border: 1px solid var(--tw-border);
  text-align: left;
}
.tw-article th {
  background: var(--tw-accent-soft);
  color: var(--tw-accent);
  font-weight: 700;
  font-size: 0.9rem;
}
.tw-article tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.tw-article blockquote {
  margin: 1.5em 0;
  padding: 14px 22px;
  border-left: 4px solid var(--tw-accent);
  background: rgba(255, 255, 255, 0.02);
  color: var(--tw-text-2);
}
.tw-article a.tw-internal {
  display: inline-block;
  font-weight: 700;
  border-bottom: 1px dashed rgba(255, 133, 51, 0.5);
}
.tw-article a.tw-internal::before { content: "→ "; }
.tw-article .tw-cta { text-align: center; margin: 2.5em 0; }
.tw-article .tw-cta-note { margin-top: 8px; font-size: 0.78rem; color: var(--tw-text-2); }

/* === Mobile === */
@media (max-width: 768px) {
  .tw-header__inner { gap: 10px; padding: 10px 14px; position: relative; }

  /* [v1.0.0] X アイコンを右側に寄せる（ロゴと X/ハンバーガー の間に余白） */
  .tw-header__sns { margin-left: auto; }

  /* ハンバーガーボタンを表示 */
  .tw-menu-btn { display: inline-flex; align-items: center; justify-content: center; }

  /* ナビ：display 切替 + 中身を順番にスライドイン */
  .tw-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--tw-bg-2);
    border-top: 1px solid var(--tw-border);
    border-bottom: 1px solid var(--tw-border);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    z-index: 99;
    animation: twNavFadeIn 0.18s ease-out;
  }
  .tw-nav.tw-nav--open { display: block; }
  @keyframes twNavFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .tw-nav__list {
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }
  .tw-nav__list a {
    display: block;
    padding: 14px 22px;
    font-size: 0.95rem;
    border-bottom: none;
    border-left: 3px solid transparent;
  }
  .tw-nav__list a:hover {
    color: var(--tw-accent);
    border-left-color: var(--tw-accent);
    background: var(--tw-accent-soft);
  }
  .tw-nav__list li:not(:last-child) a {
    border-bottom: 1px solid var(--tw-border);
  }
  /* [v1.0.0] 各ナビアイテムを順番にスライドイン */
  .tw-nav__list li {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.28s ease-out, transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .tw-nav--open .tw-nav__list li {
    opacity: 1;
    transform: translateY(0);
  }
  .tw-nav--open .tw-nav__list li:nth-child(1) { transition-delay: 0.06s; }
  .tw-nav--open .tw-nav__list li:nth-child(2) { transition-delay: 0.12s; }
  .tw-nav--open .tw-nav__list li:nth-child(3) { transition-delay: 0.18s; }
  .tw-nav--open .tw-nav__list li:nth-child(4) { transition-delay: 0.24s; }

  .tw-main { padding: 24px 16px; }
  .tw-section__title { font-size: 1.35rem; }
  .tw-article h2 { font-size: 1.25rem; }
  .tw-article h3 { font-size: 1.08rem; }
  .tw-article table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
