/* テーマ（公開サイト）のスタイル。案件ごとにこのファイルを書き換える。cms.css には依存しない */
/* Zen Maru Gothic は layout の <link> で読み込む（Next の next/font 相当） */
:root { --font-maru: 'Zen Maru Gothic'; }

/*
  トーン：白い紙の上の文房具（参考: nigoro.co.jp）
  - 紙の白と鉛筆の墨、アクセントは1色（ティール）
  - 丸ゴシック（Zen Maru Gothic）で温かみと柔らかさ
  - 角はピル／大きめの丸、影はごく薄く
  - シグネチャ：見出しの下の「マーカーで引いた」ティールの丸い下線
  機能・クラス名・data-testid は一切変えていない（見た目だけ）
*/

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* hidden 属性は display を指定する作者スタイル（.login-card の flex 等）に負けるため、常に勝たせる */
[hidden] {
  display: none !important;
}

:root {
  /* 紙と鉛筆 */
  --paper: #fbfaf7;
  --card: #ffffff;
  --ink: #2b2a28;
  --sub: #7a766f;
  --line: #e6e2da;
  --line-soft: #f0ede6;

  /* アクセント：ティール。文字・ボタンは深め（コントラスト確保）、装飾は明るめ */
  --accent: #0a8a8a;
  --accent-bright: #00adad;
  --accent-tint: #e6f5f5;
  --accent-ink: #086b6b;

  /* 差分・状態 */
  --added-bg: #e4f6ea;
  --added-ink: #1f7a43;
  --removed-bg: #fbe9e6;
  --removed-ink: #b34a3a;
  --warn-bg: #fff4dc;
  --warn-ink: #8a5a00;

  --radius: 14px;
  --radius-sm: 10px;
  --pill: 9999px;
  --shadow: 0 1px 2px rgba(43, 42, 40, 0.04), 0 6px 20px -8px rgba(43, 42, 40, 0.12);

  --font: var(--font-maru), "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  --header-h: 76px;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.9;
  font-size: 16px;
  /* 丸ゴシックの 400 は細く見えるので既定を 500 に（見出しは 700） */
  font-weight: 500;
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- ヘッダー ---------- */

.site-header {
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-header .brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-header nav {
  display: flex;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
}

.site-header nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 6px 14px;
  border-radius: var(--pill);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-header nav a:hover {
  background: var(--accent-tint);
  color: var(--accent-ink);
}

/* ---------- ページ共通 ---------- */

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 24px 112px;
}

/* シグネチャ：マーカーで引いたようなティールの丸い下線 */
.page-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.01em;
  margin-bottom: 36px;
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}

.page-title::after {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 0;
  width: 2.2em;
  height: 6px;
  border-radius: var(--pill);
  background: var(--accent-bright);
  opacity: 0.85;
}

.date {
  color: var(--sub);
  font-size: 13px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.body-text {
  white-space: pre-wrap;
  margin-bottom: 32px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 56px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-bright);
  flex-shrink: 0;
}

/* お知らせ一覧：紙のカード */
.news-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.news-list--card {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.news-list li {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* ホバーの影と浮き上がりは枠（li）側に。中の a に付けると枠だけ残って見える */
.news-list li:hover {
  border-color: var(--line);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.news-list .date {
  flex-shrink: 0;
  min-width: 6.5em;
}

.news-list li > a {
  padding: 14px 18px;
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  text-decoration: none;
  border-radius: var(--radius); /* フォーカス枠が角丸に沿う */
  transition: color 0.15s ease;
}

.news-list--card li > a {
  height: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.news-list li > a:hover {
  color: var(--accent-ink);
}

.news-list .news-thumb img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

main > p > a {
  font-weight: 500;
}

/* 本文（richtext） */
.rich-body {
  line-height: 2;
  margin-bottom: 32px;
  max-width: 720px;
}
.rich-body p { margin: 0 0 1.1em; }
.rich-body h2 {
  font-size: 21px;
  font-weight: 700;
  margin: 2em 0 0.7em;
  padding-left: 14px;
  border-left: 5px solid var(--accent-bright);
  border-radius: 3px;
  line-height: 1.5;
}
.rich-body h3 { font-size: 17px; font-weight: 700; margin: 1.6em 0 0.5em; color: var(--accent-ink); }
.rich-body ul, .rich-body ol { margin: 0 0 1.1em 1.5em; }
.rich-body li { margin-bottom: 0.25em; }
.rich-body a { color: var(--accent); text-decoration: underline; }
.rich-body strong { font-weight: 700; }
.rich-body figure { margin: 1.6em 0; }
.rich-body figure img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }
.rich-body figcaption { color: var(--sub); font-size: 13px; margin-top: 8px; }
/* 表と説明リスト（CMS 着手順30）。本文の HTML は属性を持たないので、見た目はすべてここで決める。
   表は幅いっぱいでセルの中を折り返す（display: block で横スクロールにすると、読み上げで表として扱われなくなる） */
.rich-body table {
  width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 15px;
}
.rich-body th, .rich-body td {
  border: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top; overflow-wrap: anywhere;
}
.rich-body thead th { background: var(--line-soft); font-weight: 700; }
.rich-body tbody th { background: var(--line-soft); font-weight: 700; }
.rich-body dl { margin: 1.4em 0; border-top: 1px solid var(--line); }
.rich-body dt { font-weight: 700; padding: 12px 0 4px; }
.rich-body dd { margin: 0; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
@media (min-width: 720px) {
  /* 広い画面では項目名と内容を横に並べる（dt と dd が1対1でない Q&A も崩れない並べ方） */
  .rich-body dl { display: grid; grid-template-columns: minmax(8em, 28%) 1fr; }
  .rich-body dt { grid-column: 1; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); }
  .rich-body dd { grid-column: 2; padding: 12px 0; }
}

.eyecatch { margin: 0 0 32px; }
.eyecatch img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); box-shadow: var(--shadow); }
/* 一覧のフォールバック画像（No Image）は少し淡く */
.news-thumb.is-fallback img { opacity: 0.8; }

/* プレビュー中の帯 */
.preview-banner {
  background: var(--warn-bg);
  color: var(--warn-ink);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  /* 文と移動のリンクを1行に並べ、狭い画面では折り返して中央にそろえる */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 16px;
  text-align: center;
  line-height: 1.6;
}
.preview-banner-nav {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
}
.preview-banner-nav a {
  color: inherit;
  /* 文字が小さいので、押せる範囲を上下に広げる */
  padding: 4px 2px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* ---------- 狭い画面 ---------- */

@media (max-width: 640px) {
  :root { --header-h: 108px; }
  main { padding: 36px 18px 80px; }
  .page-title { font-size: 25px; }
  .site-header .inner { padding: 12px 18px; }
  .chat-main { padding: 20px 14px 16px; }
  .chat-main .page-title { font-size: 20px; margin-bottom: 10px; }
  .chat-hint { display: none; }
  .chat-box { border-radius: 16px; }
  .chat-log { padding: 14px; }
  .bubble { max-width: 92%; }
  .rt-diff-cols { grid-template-columns: 1fr; }
  .diff-table th { width: 5em; }
  .news-list .date { min-width: 0; }
}


/* ---------- トップのスライダー（Splide + slide コンテンツタイプ） ---------- */

.top-slider {
  margin-bottom: 44px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
/* 高さは track に確定値（縦横比）を与える。Splide の CSS が .splide__list { height:100% } を
   持っているため、親の高さが不定だとスライドが伸びる */
.top-slider .splide__track { aspect-ratio: 16 / 7; }
.top-slider .splide__slide {
  position: relative;
  height: 100%;
}
.top-slider .splide__slide > a {
  display: block;
  height: 100%;
}
.top-slider img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.slide-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 20px 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.45));
}
.top-slider .splide__pagination__page.is-active { background: var(--accent-bright); }

/* ---------- 製品一覧（product コンテンツタイプ） ---------- */

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}
.filter-pill {
  display: inline-block;
  padding: 7px 18px;
  border: 1.5px solid var(--accent);
  border-radius: var(--pill);
  background: var(--card);
  color: var(--accent-ink);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.filter-pill:hover { background: var(--accent-tint, #e3f4f4); }
.filter-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.product-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.product-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 10px;
  box-sizing: border-box;
}
.product-thumb.is-fallback img { object-fit: cover; padding: 0; }
.product-cat {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--pill);
}
.product-body { padding: 14px 16px 18px; }
.product-name { font-weight: 700; font-size: 15.5px; line-height: 1.5; margin-bottom: 6px; }
.product-desc {
  font-size: 13px;
  color: var(--sub);
  line-height: 1.75;
  white-space: pre-line;
}

@media (max-width: 640px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
}

/* 言語切替（§8）。訳がある言語だけを並べる（NewsDetailPage の LangSwitch） */
.lang-switch { display: flex; gap: 8px; margin-bottom: 14px; }
.lang-pill {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  color: var(--sub);
  text-decoration: none;
}
.lang-pill.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 新しい型の表示例（CMS 着手順33）：ピックアップ欄・外部リンクの印・関連リンク・価格・カタログ */
.pickup { margin-bottom: 32px; }
.external-mark { margin-left: 6px; color: var(--sub); font-size: 0.9em; }
/* 読み上げにだけ届ける文字（「新しいタブで開きます」など） */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.related-link { margin: 32px 0 0; }
.related-link a {
  display: inline-block; padding: 10px 22px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-weight: 700; text-decoration: none;
}
.related-link a:hover { opacity: 0.9; }
.category-tag {
  display: inline-block; margin-left: 10px; padding: 2px 10px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 12px; text-decoration: none; vertical-align: 1px;
}
.category-tag:hover { opacity: 0.9; }
.related-news { margin: 48px 0 0; }
.related-news h2 { font-size: 18px; margin: 0 0 12px; }
.product-price { margin: 8px 0 0; font-weight: 700; font-size: 17px; }
.product-catalog { margin: 8px 0 0; font-size: 14px; }
.product-catalog a { color: var(--accent); text-decoration: underline; }

/* フッター（着手順38）。中身は CMS の1件だけの種類 site_footer とメニュー（置き場所：フッター） */
.site-footer { margin-top: 64px; padding: 32px 0; border-top: 1px solid rgba(0, 0, 0, 0.08); font-size: 13px; color: #555; }
.site-footer .inner { display: grid; gap: 6px; }
.site-footer p { margin: 0; white-space: pre-line; }
.footer-menu, .footer-sns { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-menu a, .footer-sns a { color: inherit; }
.footer-copyright { margin-top: 10px !important; color: #888; }
