/*
Theme Name: SHINAMICA
Theme URI: https://shinamica.com/
Author: SHINAMICA
Description: SHINAMICA コーポレートサイト用オリジナルテーマ。細い方眼紙の背景と、静かな余白、ときどき舞う黄色い図形。About / Service は固定ページ、メンバー・Works・News は管理画面から更新できます。Contact はメール作成(mailto)です。
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: shinamica
*/

/* ==========================================================
   Tokens  使用色: 白 / 黒 / #80E6FF / #1899B5 / #FFF450(アクセントのみ)
   ========================================================== */
:root {
  --white: #ffffff;
  --black: #000000;
  --sky: #80e6ff;
  --blue: #1899b5;
  --yellow: #fff450;

  /* 本文: Lexend(日本語はゴシック体にフォールバック) / 見出し・ナビ: Allenoire */
  --font-body: 'Lexend', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic Medium', 'Yu Gothic', 'Noto Sans JP', Meiryo, sans-serif;
  --font-display: 'Allenoire', Georgia, 'Lexend', 'Hiragino Sans', 'Yu Gothic', 'Noto Sans JP', sans-serif;

  --hair: rgba(0, 0, 0, 0.26);        /* 細い区切り線(黒の薄い色) */
  --gutter: clamp(20px, 5vw, 72px);
  --cell: 72px;                        /* 方眼のマス目 */
  --month-col: clamp(64px, 11.5vw, 156px);
  --ease: cubic-bezier(0.22, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 2;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--yellow); color: var(--black); }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 200;
  background: var(--black); color: var(--white); padding: 10px 18px; font-size: 13px;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ==========================================================
   背景 : 方眼紙(細く、さりげなく)
   ========================================================== */
.grid-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-color: var(--white);
  background-image:
    linear-gradient(to right, rgba(128, 230, 255, 0.5) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(128, 230, 255, 0.5) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-position: -1px -1px;
}
/* 紙の端を白くぼかして、中央に視線を集める */
.grid-bg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 35%, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.7) 100%);
}
@media (max-width: 720px) { :root { --cell: 48px; } }

/* 黄色い図形のレイヤー(shapes.js) */
.shapes { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.shape { position: absolute; left: 0; top: 0; opacity: 0; will-change: transform, opacity; line-height: 0; }
.shape svg { display: block; overflow: visible; }
.shape svg * { vector-effect: non-scaling-stroke; }

.site { position: relative; }

/* ==========================================================
   ヘッダー / ナビゲーション(全画面幅で常に横並び)
   ========================================================== */
.site-header { position: sticky; top: 0; z-index: 50; }
.site-header::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.35s;
}
.site-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--hair); opacity: 0; transition: opacity 0.35s;
}
.site-header.is-scrolled::before,
.site-header.is-scrolled::after { opacity: 1; }

.site-header__inner {
  max-width: 1480px; margin: 0 auto;
  padding: clamp(18px, 2.4vw, 32px) var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  transition: padding 0.35s var(--ease);
}
.site-header.is-scrolled .site-header__inner { padding-top: 14px; padding-bottom: 14px; }

.site-logo { display: block; flex: none; overflow: hidden; line-height: 0; }
.site-logo__img { display: block; width: clamp(110px, 11vw, 150px); height: auto; }
/* トップでは大きなロゴがあるので、スクロールするまで小さいロゴは畳んでおく */
.is-front .site-logo {
  max-width: 0; opacity: 0; margin-right: -24px;
  transition: max-width 0.6s var(--ease), opacity 0.4s, margin 0.6s var(--ease);
}
.is-front .site-header.is-scrolled .site-logo { max-width: 200px; opacity: 1; margin-right: 0; }
.is-front .site-header__inner { justify-content: flex-start; }
.is-front .site-header.is-scrolled .site-header__inner { justify-content: space-between; }

.gnav__list {
  display: flex; flex-wrap: nowrap; gap: clamp(14px, 3vw, 52px);
  list-style: none; margin: 0; padding: 0;
}
.gnav__list a {
  position: relative; display: inline-block; padding: 4px 0;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(13px, 3.4vw, 20px); line-height: 1.2; letter-spacing: 0.02em;
  color: var(--blue); text-decoration: none; white-space: nowrap;
  transition: font-size 0.35s var(--ease), color 0.25s;
}
.site-header.is-scrolled .gnav__list a { font-size: clamp(12px, 3.1vw, 16px); }
.gnav__list a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--blue); transform: scaleX(0); transform-origin: left center;
  transition: transform 0.45s var(--ease);
}
.gnav__list a:hover::after,
.gnav__list .is-current > a::after,
.gnav__list .current-menu-item > a::after,
.gnav__list .current_page_item > a::after { transform: scaleX(1); }
/* 触れる/タップ/フォーカスで #FFF450 に(黄色い文字が読めるよう、細い黒の縁取りを付ける) */
.gnav__list a:hover,
.gnav__list a:focus-visible,
.gnav__list a:active {
  color: var(--yellow);
  -webkit-text-stroke: 1px var(--black);
  paint-order: stroke fill;
}

/* 画面が狭いときも一覧のまま。ロゴは省き、メニューを幅いっぱいに広げる */
@media (max-width: 720px) {
  .site-logo, .is-front .site-header.is-scrolled .site-logo { display: none; }
  .site-header__inner,
  .is-front .site-header__inner,
  .is-front .site-header.is-scrolled .site-header__inner { justify-content: space-between; padding-left: var(--gutter); padding-right: var(--gutter); }
  .gnav { width: 100%; }
  .gnav__list { justify-content: space-between; gap: 6px; }
}

/* ==========================================================
   トップ : ヒーロー(ロゴ)
   ========================================================== */
.hero { padding: clamp(24px, 5vw, 72px) var(--gutter) clamp(48px, 9vw, 120px); text-align: center; }
.hero__logo { margin: 0; }
.hero__img { display: block; width: min(100%, 1080px); height: auto; margin: 0 auto; }
.js .hero__img {
  clip-path: inset(0 100% 0 0);
  animation: logo-wipe 1.4s 0.15s cubic-bezier(0.7, 0, 0.2, 1) forwards;
}
@keyframes logo-wipe { to { clip-path: inset(-4% -2% -4% 0); } }
.hero__lead {
  margin: clamp(16px, 2vw, 28px) 0 0;
  font-size: 12px; letter-spacing: 0.3em; color: var(--blue);
}

/* ==========================================================
   タイムライン(年 → 月 → 項目。細い罫線だけで区切る)
   ========================================================== */
.timeline { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.timeline__label {
  margin: 0 0 clamp(20px, 3.4vw, 48px);
  font-family: var(--font-display); font-weight: 400; color: var(--blue);
  font-size: clamp(15px, 1.4vw, 18px); letter-spacing: 0.06em; line-height: 1.2;
}
.timeline__list { position: relative; }
.timeline__list::after { content: ''; display: block; height: 1px; background: var(--hair); }
.timeline__empty { padding: 32px 0; margin: 0; font-size: 14px; border-bottom: 1px solid var(--hair); }

.tl-year {
  display: flex; align-items: center; gap: clamp(14px, 2vw, 28px);
  padding-left: var(--month-col); margin: 0 0 clamp(6px, 1.2vw, 14px);
}
.tl-item + .tl-year { margin-top: clamp(44px, 7vw, 96px); }
.tl-year__num {
  font-family: var(--font-display); color: var(--blue);
  font-size: clamp(20px, 2.1vw, 28px); line-height: 1; letter-spacing: 0.02em;
}
.tl-rule { display: block; flex: 1; height: 1px; background: var(--hair); }

.tl-item { position: relative; }
/* 項目の上の線: 月の最初の項目は全幅、同じ月の続きは本文の列だけ */
.tl-item::before {
  content: ''; position: absolute; top: 0; left: var(--month-col); right: 0; height: 1px; background: var(--hair);
}
.tl-item--month::before { left: 0; }
.tl-item--first::before { display: none; }

.tl-item__link {
  display: grid; grid-template-columns: var(--month-col) minmax(0, 1fr) auto;
  align-items: baseline; padding: clamp(22px, 3.2vw, 44px) 0;
  color: var(--black); text-decoration: none;
}
.tl-item__month { font-size: clamp(12px, 1.1vw, 14px); font-weight: 600; letter-spacing: 0.04em; line-height: 1; }
.tl-item__month b { font-weight: 600; }
.tl-item__title {
  position: relative; display: block;
  font-size: clamp(15px, 1.75vw, 24px); font-weight: 400; line-height: 1.85; letter-spacing: 0.015em;
  text-wrap: pretty; word-break: auto-phrase;
  transition: transform 0.5s var(--ease), color 0.3s;
}
/* ホバーで小さな黄色いドットが現れる */
.tl-item__title::before {
  content: ''; position: absolute; left: -22px; top: 0.95em; width: 9px; height: 9px;
  border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 1px var(--black);
  opacity: 0; transform: scale(0.3); transition: opacity 0.3s, transform 0.45s var(--ease);
}
.tl-item__link:hover .tl-item__title,
.tl-item__link:focus-visible .tl-item__title { transform: translateX(14px); }
.tl-item__link:hover .tl-item__title::before,
.tl-item__link:focus-visible .tl-item__title::before { opacity: 1; transform: scale(1); }
.tl-item__type {
  margin-left: 24px; font-size: 10px; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(0, 0, 0, 0.5); white-space: nowrap;
}
.tl-item--works .tl-item__type { color: var(--blue); }

@media (max-width: 620px) {
  .tl-item__link { grid-template-columns: var(--month-col) minmax(0, 1fr); grid-template-areas: 'm t' '. y'; }
  .tl-item__month { grid-area: m; }
  .tl-item__title { grid-area: t; }
  .tl-item__type { grid-area: y; margin: 2px 0 0; }
  .tl-item__title::before { display: none; }
  .tl-item__link:hover .tl-item__title { transform: none; }
}

/* スクロールで静かに現れる(JS有効時のみ) */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- ボタン ---------- */
.timeline__more { display: grid; place-items: center; padding: clamp(44px, 7vw, 88px) 0 0; }
.btn-more {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 200px; height: 54px; padding: 0 40px;
  border: 1px solid var(--black); border-radius: 999px;
  background: transparent; color: var(--black); cursor: pointer; text-decoration: none;
  font-family: var(--font-display); font-size: 15px; letter-spacing: 0.1em; line-height: 1;
  transition: background 0.4s var(--ease), color 0.3s, transform 0.4s var(--ease);
}
.btn-more:hover { background: var(--yellow); transform: translateY(-2px); }
.btn-more:active { transform: none; }
.btn-more[disabled] { opacity: 0.5; cursor: progress; }
.btn-more[hidden] { display: none; }
.btn-more--link { min-width: 150px; height: 46px; padding: 0 28px; font-size: 14px; }

/* ==========================================================
   内側ページ共通
   ========================================================== */
.site-main { min-height: 50vh; }

.page-hero { max-width: 1240px; margin: 0 auto; padding: clamp(40px, 8vw, 112px) var(--gutter) clamp(32px, 5vw, 72px); }
.page-hero__title {
  margin: 0; overflow: hidden; padding: 0.05em 0 0.12em;
  font-family: var(--font-display); font-weight: 400; color: var(--blue);
  font-size: clamp(48px, 9vw, 128px); line-height: 1; letter-spacing: -0.005em;
}
.page-hero__title .char {
  display: inline-block; transform: translateY(115%);
  animation: char-rise 1s calc(var(--i, 0) * 60ms + 0.1s) cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}
@keyframes char-rise { to { transform: none; } }
.page-hero__sub { margin: clamp(10px, 1.4vw, 20px) 0 0; font-size: 13px; letter-spacing: 0.22em; line-height: 1.6; }
.page-hero__sub span { display: inline-flex; align-items: center; gap: 16px; }
.page-hero__sub span::before { content: ''; width: 36px; height: 1px; background: var(--black); }

.eyebrow {
  max-width: 1240px; margin: 0 auto; padding: clamp(36px, 6vw, 88px) var(--gutter) 0;
  font-family: var(--font-display); color: var(--blue);
  font-size: clamp(15px, 1.4vw, 18px); letter-spacing: 0.06em; line-height: 1;
}

.entry { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.entry-content--narrow { max-width: 1240px; margin: 0 auto clamp(24px, 4vw, 40px); padding: 0 var(--gutter); }
.entry .entry-content--narrow { padding: 0; margin-left: 0; }
.center { text-align: center; }

.entry-head { padding: clamp(12px, 2vw, 24px) 0 clamp(24px, 3.6vw, 48px); max-width: 880px; }
.entry-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0 0 14px;
  font-size: 12px; letter-spacing: 0.14em; color: rgba(0, 0, 0, 0.55); line-height: 1.6;
}
.tl-tag {
  display: inline-block; margin: 0; padding: 0; border: 0; background: none;
  font-size: 10px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--blue); text-decoration: none;
}
.entry-title { margin: 0; font-size: clamp(22px, 3.2vw, 38px); line-height: 1.6; font-weight: 400; letter-spacing: 0.01em; }
.entry-thumb { margin: 0 0 clamp(28px, 4vw, 52px); overflow: hidden; background: rgba(128, 230, 255, 0.25); max-width: 960px; }
.entry-thumb img { display: block; width: 100%; height: auto; }

/* Works 情報 */
.work-info {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 32px;
  margin: 0 0 clamp(32px, 5vw, 56px); padding: 0; max-width: 960px;
}
.work-info > div { padding: 16px 0 18px; border-top: 1px solid var(--hair); }
.work-info dt { font-size: 10px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--blue); line-height: 1.6; }
.work-info dd { margin: 2px 0 0; font-size: 14px; word-break: break-word; }
.work-info a { text-underline-offset: 4px; }

/* 前後ナビ */
.post-nav {
  max-width: 1240px; margin: clamp(56px, 8vw, 112px) auto 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center;
}
.post-nav a:not(.btn-more) { display: block; text-decoration: none; font-size: 14px; line-height: 1.7; }
.post-nav a:not(.btn-more) span { display: block; font-size: 10px; letter-spacing: 0.18em; color: var(--blue); text-transform: uppercase; margin-bottom: 2px; }
.post-nav a:not(.btn-more):hover { color: var(--blue); }
.post-nav__next { text-align: right; }
@media (max-width: 700px) {
  .post-nav { grid-template-columns: 1fr 1fr; }
  .post-nav .btn-more { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
}

/* ページ送り */
.pagination { margin: clamp(40px, 6vw, 80px) 0 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.page-numbers {
  display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 6px;
  color: var(--blue); text-decoration: none;
  font-family: var(--font-display); font-size: 16px; line-height: 1;
  transition: color 0.3s;
}
a.page-numbers:hover { color: var(--black); }
.page-numbers.current { color: var(--black); box-shadow: inset 0 -1px 0 var(--black); }
.timeline--page { padding-bottom: 0; }

/* ==========================================================
   メンバー一覧(About)
   ========================================================== */
.entry-content:has(> .members) { max-width: 1240px; }
.entry-content:has(> .members) > *:not(.members) { max-width: 760px; }
.members {
  list-style: none; margin: 0 0 clamp(48px, 7vw, 96px); padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 72px) clamp(20px, 3vw, 40px);
}
@media (max-width: 900px) { .members { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .members { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 18px; } }
.member { margin: 0; padding: 0; }
.member__link { display: block; color: var(--black); text-decoration: none; }
.member__photo { display: block; aspect-ratio: 1 / 1; }
/* 背景が白のイラストは、方眼紙になじむよう白を透かす */
.member__photo img, .member__ph {
  display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom;
  mix-blend-mode: multiply; transition: transform 0.7s var(--ease);
}
a.member__link:hover .member__photo img, a.member__link:hover .member__ph { transform: translateY(-6px); }
.member__name { display: block; margin-top: clamp(14px, 1.6vw, 22px); font-size: clamp(12px, 1.05vw, 14px); letter-spacing: 0.08em; line-height: 1.6; }
.member__rule { display: block; width: 14px; height: 1px; margin: 8px 0; background: var(--black); }
.member__role { display: block; font-size: clamp(11px, 0.95vw, 13px); letter-spacing: 0.08em; line-height: 1.6; }
.members__empty { font-size: 13px; padding: 16px; border: 1px solid var(--hair); }

/* ==========================================================
   Works 一覧
   ========================================================== */
.chips {
  max-width: 1240px; margin: 0 auto clamp(28px, 4vw, 52px); padding: 0 var(--gutter);
  display: flex; flex-wrap: wrap; gap: 6px 28px; list-style: none;
}
.chip {
  position: relative; display: inline-block; padding: 4px 0; text-decoration: none;
  font-family: var(--font-display); font-size: 15px; line-height: 1.4; color: rgba(0, 0, 0, 0.45);
  transition: color 0.3s;
}
.chip::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease); }
.chip:hover { color: var(--black); }
.chip:hover::after, .chip.is-current::after { transform: scaleX(1); }
.chip.is-current { color: var(--black); }

.works-grid {
  max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(36px, 5vw, 72px) clamp(20px, 3vw, 40px);
}
@media (max-width: 960px) { .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .works-grid { grid-template-columns: minmax(0, 1fr); } }

.work-card__link { display: block; text-decoration: none; color: var(--black); }
.work-card__thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: rgba(128, 230, 255, 0.25); }
.work-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1s var(--ease); }
.work-card__noimg {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-size: clamp(40px, 5vw, 64px); color: var(--blue);
}
.work-card__link:hover .work-card__thumb img { transform: scale(1.04); }
.work-card__meta {
  display: flex; align-items: center; gap: 14px; margin: 16px 0 2px;
  font-size: 11px; letter-spacing: 0.14em; color: rgba(0, 0, 0, 0.5); line-height: 1.6;
}
.work-card__title { margin: 0; font-size: clamp(15px, 1.4vw, 17px); line-height: 1.7; font-weight: 400; transition: color 0.3s; }
.work-card__link:hover .work-card__title { color: var(--blue); }

/* ==========================================================
   フッター
   ========================================================== */
.site-footer { margin-top: clamp(72px, 11vw, 150px); }
.site-footer__inner {
  max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter) 32px;
}
.site-footer__inner::before { content: ''; display: block; height: 1px; background: var(--hair); margin-bottom: 22px; }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.site-footer__inner::before { flex: 0 0 100%; }
.copy { margin: 0; font-family: var(--font-display); color: var(--blue); font-size: clamp(12px, 1.2vw, 14px); letter-spacing: 0.02em; line-height: 1.6; }
.to-top { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none; color: var(--black); line-height: 1.6; transition: color 0.3s; }
.to-top:hover { color: var(--blue); }

/* ==========================================================
   動きを減らす設定
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .hero__img { clip-path: none; }
  .page-hero__title .char { transform: none; }
}

/* WordPress 管理バー分のずれ */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
