/* ============================================================
   Règles 定期お届け便 — Base
   デザイントークン / リセット / 両ページ共有パーツ
   index.html と select.html の両方が読み込む
   ============================================================ */

:root {
  /* ---- Color ----------------------------------------------
     白・黒・グレーで組み、水色はワンポイントに限る。
     水色を使う場所は「都度購入との差が出る箇所」だけ。
     色数ではなく、色を差す場所の少なさで意味を持たせる
     -------------------------------------------------------- */
  --ink: #14171b; /* 本文。わずかに寒色へ寄せた黒 */
  --ink-soft: #565c65; /* 補足・キャプション */
  --ink-faint: #8b929b; /* 注記・プレースホルダー文字 */

  --slab: #14171b; /* 濃い色面・CTA */
  --slab-deep: #0a0c0f; /* ホバー・フッター */
  --aqua-tint: #eaf6fc; /* ごく薄い水色。定期便の列・選択状態の地 */

  --paper: #ffffff;
  --mist: #f3f4f6; /* セクション地 */
  --mist-deep: #e2e5e9; /* グレー地の上の罫線 */
  --aqua: #4cb3e0; /* ワンポイント。面・罫・マーク用（文字には使わない） */
  --aqua-deep: #0d6d95; /* 水色の文字・リンク。白地でもコントラストが足りる */

  --hair: #e6e8ec; /* 白地の上の罫線 */
  --rule-dot: #c3c8cf; /* 点線のリーダー罫。グレー地でも見える濃さ */

  /* ---- Type -----------------------------------------------
     和文はWebフォントを配信せず、端末のフォントに任せる。
     iOS/macOS は Hiragino Sans、Android は末尾の sans-serif が
     Noto Sans CJK JP に解決される。どちらも同系統のサンセリフで、
     並べなければ違いは分からない。和文フォントは重く、
     LPの初回表示に効くため配信しない
     -------------------------------------------------------- */
  --font-ja:
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", YuGothic, sans-serif;

  /* ブランド名「Règles」専用。この4文字以外には使わない */
  --font-brand: "Baloo 2", "Hiragino Sans", sans-serif;

  /* 欧文・数字用。金額と杯数が主役の紙面なので、
     装飾的なセリフではなく数字が読めるグロテスクを選ぶ。
     和文が混ざる場面では2番目以降（端末のフォント）に落ちる */
  --font-display: "Archivo", "Hiragino Sans", "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;

  --fs-display: clamp(1.75rem, 5.6vw, 3rem);
  --fs-h2: clamp(1.35rem, 4vw, 2rem);
  --fs-h3: clamp(1.05rem, 2.4vw, 1.25rem);
  --fs-lead: clamp(0.95rem, 2.2vw, 1.05rem);
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.78rem;
  --fs-micro: 0.7rem;

  /* ---- Space ---- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* ---- Layout ---- */
  --wide: 1080px;
  --content: 720px;
  --narrow: 560px;
  --gutter: 20px;

  /* ---- Misc ---- */
  --radius: 10px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --shadow: 0 8px 28px rgba(16, 20, 26, 0.08);
}

@media (min-width: 768px) {
  :root {
    --gutter: 32px;
  }
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-ja);
  font-size: var(--fs-body);
  line-height: 1.85;
  letter-spacing: 0.03em;
  font-feature-settings: "palt" 1;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--aqua-deep);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* ブランド名。丸みのある書体なので、周囲の文字より
   わずかに大きく見える。字間を締めて重心を合わせる */
.brand {
  font-family: var(--font-brand);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* 数字は等幅で。価格が並ぶ場面で桁がずれない */
.tnum,
.price,
[class*="__price"] {
  font-variant-numeric: tabular-nums;
}

/* ---- Utility ---- */
.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;
}

/* ============================================================
   画像プレースホルダー
   実素材が入るまでの仮置き。差し替え手順は CLAUDE.md 参照。
   「灰色の穴」に見えないよう、グレー地＋細い破線＋薄い斜線で
   面として成立させる
   ============================================================ */
.ph {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius);
  background-color: var(--mist);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 9px,
    rgba(20, 23, 27, 0.045) 9px 18px
  );
  box-shadow: inset 0 0 0 1px var(--mist-deep);
  color: var(--ink-faint);
}

/* 破線の内枠。ボーダーを外に出さず内側に引くことで寸法が崩れない */
.ph::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(20, 23, 27, 0.22);
  border-radius: 6px;
  pointer-events: none;
}

.ph__label {
  position: relative;
  padding: 0 var(--s-4);
  font-size: var(--fs-micro);
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

/* 濃い色面の上に置くプレースホルダー */
.ph--on-slab {
  background-color: rgba(255, 255, 255, 0.07);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 9px,
    rgba(255, 255, 255, 0.05) 9px 18px
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.72);
}

.ph--on-slab::before {
  border-color: rgba(255, 255, 255, 0.28);
}

/* アスペクト比のバリエーション */
.ph--square {
  aspect-ratio: 1 / 1;
}
.ph--landscape {
  aspect-ratio: 4 / 3;
}
.ph--wide {
  aspect-ratio: 16 / 9;
}
.ph--portrait {
  aspect-ratio: 3 / 4;
}

/* 実画像に差し替えたとき、img がそのまま枠を埋める */
.ph > img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 画像が入ったら仮枠の装飾を消す */
.ph:has(img) {
  background: none;
  box-shadow: none;
}

.ph:has(img)::before {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
