/* ==========================================================
   正のページだけの見た目
   ==========================================================
   site.css の後に読み、<body class="theme-sei"> の中でだけ効く。
   骨格（ヘッダー・余白・見出しの大きさ）は site.css のまま使い、
   色・字・地をアプリに合わせて差し替える。Nakaguro の theme.css の共通の部分を写した。

   色の値はアプリの lib/app/theme/paper_colors.dart と同じ（Nakaguro と同じ）。
   大元は ~/dev/flutter/sei/tool/site/theme.css。サイトの側で直さず、ここを直して
   tool/build_site_pages.py を流す。
   ========================================================== */

/* 字はアプリと同じものを、ページで使う文字だけに絞って同梱している。
   生成：~/dev/flutter/sei/tool/build_site_pages.py
   ページの文言を足したら流し直す（足りない字は下の代替フォントで出る）。 */
@font-face {
  font-family: "Zen Kaku Gothic New";
  src: url("fonts/zen-kaku-gothic-new-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Zen Kaku Gothic New";
  src: url("fonts/zen-kaku-gothic-new-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

.theme-sei {
  --ink:        #2b2a27;
  --ink-soft:   #5e5a52;
  --ink-faint:  #8a857a;
  --ground:     #f5f1e8;   /* 生成り */
  --surface:    #ede7da;
  --rule:       #d9d3c5;
  --accent:     #c8553d;   /* 朱 */
  --grid-dot:   #d3ccbc;

  --sans: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
          "Noto Sans JP", "Yu Gothic", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* 紙のざらつき（不透明度3%ほど）。アプリと同じく、ごく薄く */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  .theme-sei {
    --ink:        #e8e3d8;
    --ink-soft:   #b3ada1;
    --ink-faint:  #8e887c;
    --ground:     #1c1b19;   /* 墨 */
    --surface:    #252320;
    --rule:       #34322e;
    --accent:     #e07a5f;
    --grid-dot:   #3a3833;
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
  }
}

/* 紙の地：ごく薄いざらつき（正の画面はドット方眼を敷かないので、ページにも敷かない） */
body.theme-sei {
  background-color: var(--ground);
  background-image: var(--grain);
  background-size: 160px 160px;
  letter-spacing: .02em;
}

/* 太字は持たない。アプリと同じく Medium までで強弱を付ける
   （同梱していない 700 を指定すると、ブラウザが字を太らせて崩れる） */
.theme-sei h1,
.theme-sei h2,
.theme-sei h3,
.theme-sei strong,
.theme-sei b,
.theme-sei th,
.theme-sei .brand,
.theme-sei .store,
.theme-sei .contact { font-weight: 500; }

.theme-sei h1 { letter-spacing: .01em; }
.theme-sei .eyebrow { letter-spacing: .12em; }

/* アイコンの地は生成りで、紙の地と同じ色。輪郭が消えないよう細い線を引く */
.theme-sei .app-hero img { box-shadow: 0 0 0 1px var(--rule); }

/* ストアのボタンは塗らない線のまま（アプリの「塗りボタンを使わない」に合わせる） */
.theme-sei .store:hover { background: transparent; color: var(--ink); text-decoration: underline; }

/* 紹介のページの画面の画像（/assets/sei/*.webp。tool/build_site_pages.py がストアの画像から作る）。
   横に並べ、収まらない幅では横にすべらせて見る。影は付けず、紙の地に細い線で縁を付ける（site.css の決まり） */
.sei-shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 1fr);
  gap: var(--s4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--s3);
  margin: 0;
  /* 横のスクロールバーの色。指定しないとダークの表示で白い帯が浮く */
  scrollbar-width: thin;
  scrollbar-color: var(--ink-faint) transparent;
}
.sei-shots figure { margin: 0; scroll-snap-align: start; min-width: 0; }
.sei-shots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 0 0 1px var(--rule);
}
.sei-shots figcaption {
  margin-top: var(--s2);
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}
