/* ===========================
   由々庵 — Minimal & Premium
   =========================== */

:root {
  --cream: #faf6ef;
  --cream-2: #f5efe3;
  --paper: #fdfbf6;
  --earth: #5c4433;
  --earth-soft: #786250;          /* darker for WCAG AA on cream (was #8a7261) */
  --earth-meta: #6a5645;          /* even safer for small meta text */
  --bark: #c4a882;                /* decorative only — borders, large type */
  --sage: #7a8c6e;
  --ink: #2c2420;
  --ink-soft: #5a4f47;
  --line: rgba(44, 36, 32, 0.14);
  --line-soft: rgba(44, 36, 32, 0.06);

  --serif: "Shippori Mincho B1", "Hiragino Mincho ProN", "游明朝", "Yu Mincho", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "游ゴシック", "Yu Gothic", sans-serif;

  --max: 1280px;
  --gutter: clamp(24px, 5vw, 80px);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 2.1;
  letter-spacing: 0.08em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  word-break: auto-phrase;
  line-break: strict;
}

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

/* ===== 日本語の改行ユーティリティ =====
   .ph  : 文節チャンク。途中で折らせず、句の境目だけで自然に折る
   .br-pc: PC（>600px）でだけ改行
   .br-sp: SP（≤600px）でだけ改行 */
.ph { display: inline-block; }
.br-sp { display: none; }
@media (max-width: 600px) {
  .br-pc { display: none; }
  .br-sp { display: inline; }
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.4s var(--ease);
}
a:hover { opacity: 0.55; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--ink);
  line-height: 1.6;
  margin: 0;
  overflow-wrap: break-word;
  /* 行末の1〜2文字孤立を防ぐ */
  text-wrap: balance;
}

p {
  margin: 0;
  /* 段落末尾の短い孤立行を防ぐ */
  text-wrap: pretty;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 28px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transition: background 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
  background: linear-gradient(to bottom, rgba(253,251,246,0.88) 0%, rgba(253,251,246,0) 100%);
}
.site-header.is-scrolled {
  background: rgba(253, 251, 246, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 18px var(--gutter);
  border-bottom-color: var(--line-soft);
}
.site-logo {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.5em;
  color: var(--ink);
  padding-left: 0.5em; /* tracking compensation */
}
.site-logo small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.42em;
  color: var(--earth-soft);
  margin-top: 4px;
  font-family: var(--sans);
  font-weight: 300;
}

.site-nav {
  display: flex;
  gap: clamp(20px, 2.6vw, 44px);
  align-items: center;
}
.site-nav a {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}
.site-nav a.is-active::after {
  content: "";
  position: absolute; left: 50%; bottom: -6px;
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--earth);
  transform: translateX(-50%);
}

.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 8px; width: 40px; height: 40px;
}
.nav-toggle span {
  display: block; width: 22px; height: 1px;
  background: var(--ink); margin: 6px auto;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
  transform-origin: center;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

/* ===== Language Switcher ===== */
.lang-switch {
  position: relative;
  margin-left: 8px;
}
/* __btn は site.js が生成するボタン要素 */
.lang-switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px 8px 12px;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--ink);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.lang-switch__btn:hover {
  border-color: var(--earth);
  background: rgba(255,255,255,0.4);
}
/* __current は現在言語の短縮表示 (JA / EN) */
.lang-switch__current {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--earth);
}
.lang-switch__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 140px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px;
  box-shadow: 0 12px 40px rgba(44,36,32,0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  z-index: 100;
}
.lang-switch.is-open .lang-switch__menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.lang-switch__menu button {
  width: 100%;
  display: block;
  padding: 10px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-align: left;
  color: var(--ink);
  border-radius: 2px;
  transition: background 0.2s var(--ease);
}
.lang-switch__menu button:hover {
  background: var(--cream-2);
}
.lang-switch__menu button.is-active {
  background: var(--cream-2);
  color: var(--earth);
}

@media (max-width: 820px) {
  .lang-switch__btn { padding: 6px 10px; font-size: 10px; }
  .lang-switch__menu { right: -8px; }
}

@media (max-width: 820px) {
  .site-header { padding: 20px var(--gutter); }
  .site-nav {
    position: fixed;
    inset: 0;
    background: rgba(253, 251, 246, 0.96);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    backdrop-filter: blur(20px) saturate(150%);
    flex-direction: column;
    justify-content: center;
    gap: 32px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.45s var(--ease), transform 0.5s var(--ease), visibility 0s 0.45s;
    z-index: 40;
  }
  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.45s var(--ease), transform 0.5s var(--ease), visibility 0s;
  }
  .site-nav a {
    font-size: 18px;
    letter-spacing: 0.4em;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  }
  .site-nav.is-open a { opacity: 1; transform: translateY(0); }
  .site-nav.is-open a:nth-child(1) { transition-delay: 0.18s; }
  .site-nav.is-open a:nth-child(2) { transition-delay: 0.24s; }
  .site-nav.is-open a:nth-child(3) { transition-delay: 0.30s; }
  .site-nav.is-open a:nth-child(4) { transition-delay: 0.36s; }
  .site-nav.is-open a:nth-child(5) { transition-delay: 0.42s; }
  .nav-toggle { display: block; position: relative; z-index: 60; }
}

/* ===== Footer ===== */
.site-footer {
  margin-top: clamp(120px, 16vw, 200px);
  padding: clamp(80px, 10vw, 120px) var(--gutter) 48px;
  background: var(--cream);
  color: var(--ink);
  border-top: 1px solid var(--line-soft);
}
.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  padding-bottom: 64px;
  border-bottom: 1px solid var(--line);
}
.site-footer__brand .site-logo { padding-left: 0.5em; }
.site-footer__brand p {
  margin-top: 32px;
  font-size: 13px;
  line-height: 2.2;
  color: var(--ink-soft);
  max-width: 24em;
}
.site-footer h4 {
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.42em;
  margin-bottom: 24px;
  color: var(--earth-soft);
}
.site-footer ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 14px;
  font-size: 13px;
  letter-spacing: 0.12em;
}
.site-footer__copy {
  max-width: var(--max);
  margin: 32px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--earth-soft);
}
@media (max-width: 820px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
  .site-footer__copy { flex-direction: column; gap: 10px; }
  /* SP のタップサイズを確保 */
  .site-footer ul { gap: 4px; }
  .site-footer ul li a,
  .site-footer__brand a { display: inline-block; padding: 10px 0; min-height: 44px; line-height: 1.6; }
  .site-nav a { padding: 8px 0; }
  .lang-switch__btn { padding: 10px 14px; min-height: 40px; }
}

/* ===== Layout ===== */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: clamp(100px, 14vw, 180px) 0; }
.section--narrow .container { max-width: 960px; }

.eyebrow {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.6em;
  color: var(--earth-soft);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--earth-soft);
}

.section-title {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 400;
  letter-spacing: 0.2em;
  line-height: 1.8;
  text-wrap: balance;
}

.lead {
  font-family: var(--serif);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 2.4;
  letter-spacing: 0.14em;
  color: var(--ink);
}

/* ===== Buttons / links ===== */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--ink);
  padding: 8px 0;
  border-bottom: 1px solid var(--ink);
  transition: gap 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.link-arrow:hover {
  gap: 28px;
  color: var(--earth);
  border-color: var(--earth);
  opacity: 1;
}
.link-arrow svg { width: 18px; height: 8px; }

.btn-line {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 22px 44px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.4em;
  cursor: pointer;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
.btn-line:hover {
  background: var(--ink);
  color: var(--paper);
  opacity: 1;
}
.btn-line--filled {
  background: var(--ink);
  color: var(--paper);
}
.btn-line--filled:hover {
  background: var(--earth);
  border-color: var(--earth);
}

/* ===== Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.4s var(--ease), transform 1.4s var(--ease);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
.reveal[data-delay="1"] { transition-delay: 0.15s; }
.reveal[data-delay="2"] { transition-delay: 0.3s; }
.reveal[data-delay="3"] { transition-delay: 0.45s; }
.reveal[data-delay="4"] { transition-delay: 0.6s; }

/* ===== Page hero (sub) ===== */
.page-hero {
  padding: clamp(160px, 22vw, 260px) var(--gutter) clamp(60px, 8vw, 100px);
  text-align: center;
}
.page-hero__en {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.6em;
  color: var(--earth-soft);
  margin-bottom: 24px;
}
.page-hero__title {
  font-size: clamp(32px, 4.4vw, 52px);
  letter-spacing: 0.24em;
  font-weight: 400;
  text-wrap: balance;
}
.page-hero__lead {
  margin: 36px auto 0;
  max-width: 42em;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 2.4;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ===== Generic image (cream tinted placeholder) ===== */
.fig {
  position: relative;
  background: var(--cream-2);
  overflow: hidden;
}
.fig img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* 写真本来の艶を残しつつ、サイト全体のトーンに馴染ませる */
  filter: saturate(0.92) contrast(0.97);
}
.fig.is-broken::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 30% 20%, #ede4d2, transparent 60%),
    radial-gradient(80% 80% at 80% 90%, #b89f78, transparent 60%),
    linear-gradient(135deg, #d9c8a8, #8a7261);
}
.fig.is-broken::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 120px; height: 120px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* ===== Post gallery (複数写真) ===== */
.post-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: clamp(32px,4vw,48px) 0;
}
.post-gallery.is-3 { grid-template-columns: repeat(3, 1fr); }
.post-gallery__item {
  background: var(--cream-2);
}
.post-gallery__item img {
  width: 100%; height: auto;
}
.post-gallery__item.is-wide {
  grid-column: span 2;
}
@media (max-width: 600px) {
  .post-gallery { grid-template-columns: 1fr; }
  .post-gallery__item.is-wide { grid-column: span 1; }
}

/* =========================================
   レスポンシブ タイポグラフィ 共通規格
   =========================================
   PC     : 821px〜
   tablet : 481〜820px
   mobile : 〜480px
   ========================================= */

/* ── タブレット〜モバイル（820px以下）────────── */
@media (max-width: 820px) {

  /* ページタイトル（お稽古について など）
     letter-spacing を縮めて1行に収める */
  .page-hero__title {
    letter-spacing: 0.12em;
  }

  /* セクション見出し */
  .section-title {
    letter-spacing: 0.1em;
    line-height: 1.7;
  }

  /* ページリード：文字間を詰めて1文が1行に収まるように
     375px幅 - 48px gutter = 327px、13px × 1.04 × 24chars = 325px */
  .page-hero__lead {
    letter-spacing: 0.04em;
    font-size: 13px;
    line-height: 2.2;
  }
}

/* ── スモールモバイル（480px以下）────────── */
@media (max-width: 480px) {

  /* ページタイトル：さらに字間を詰める */
  .page-hero__title {
    letter-spacing: 0.06em;
  }

  /* セクション見出し */
  .section-title {
    font-size: 22px;
    letter-spacing: 0.06em;
  }

  /* ボタン：狭い画面でも収まるよう余白を縮小 */
  .btn-line {
    padding: 18px 28px;
    letter-spacing: 0.24em;
  }

  /* フッター字間 */
  .site-footer__copy {
    letter-spacing: 0.18em;
    font-size: 10px;
  }
}
