/* =========================================================
   #year 道場の一年（墨・茶帯）
   月ごとの列が横に並ぶ年表。スマホ・タブレットは列の中だけ横スクロール（scroll-snap）。
   PC（1100px〜）は7か月を4列×2段の格子に並べる。
   ========================================================= */


/* ---------- 見出し ---------- */
.year__head {
  position: relative;
  display: grid; gap: 28px;
  margin-bottom: clamp(36px, 6vw, 64px);
}
.year__head-main { position: relative; z-index: 1; }
.year__legend { position: relative; z-index: 1; }
/* 背景の大きな年号：輪郭だけの墨の数字 */
.year__numeral {
  position: absolute; top: -.18em; right: -.04em; z-index: 0; pointer-events: none;
  font-size: clamp(4.5rem, 21vw, 13rem); font-weight: 800; line-height: 1; letter-spacing: -.02em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(242, 238, 230, .16);
  user-select: none;
}
.year__head .section-lead { max-width: 30em; }

/* 凡例：朱の丸＝支部主催／輪＝本部・他 */
.year__legend { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: var(--fs-small); color: var(--on-sumi-2); letter-spacing: .1em; }
.year__legend li { display: inline-flex; align-items: center; gap: .7em; }
.year__dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; }
.year__dot--branch { background: var(--shu); box-shadow: 0 0 0 3px rgba(200, 16, 46, .22); }
.year__dot--other { border: 1.5px solid var(--on-sumi-2); }

@media (min-width: 768px) {
  .year__head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .year__legend { flex-direction: column; gap: 10px; padding-bottom: .4em; }
}

/* ---------- 横スクロールの器（ページ自体ははみ出さない） ---------- */
.year__scroller {
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--shu) rgba(242, 238, 230, .1);
  padding-bottom: 20px;
}
.year__scroller:focus-visible { outline-offset: -2px; }
.year__scroller::-webkit-scrollbar { height: 4px; }
.year__scroller::-webkit-scrollbar-track { background: rgba(242, 238, 230, .1); }
.year__scroller::-webkit-scrollbar-thumb { background: var(--shu); }

.year__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78vw, 300px);
  gap: 0;
  width: max-content;
  position: relative;
}

/* ---------- 月の列 ---------- */
.year__month {
  scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 22px;
  padding-right: clamp(20px, 4vw, 32px);
  position: relative;
}
/* 年表の横線（月名の高さ）：列ごとに引くので、PC の2段組でも各段に線が通る */
.year__month::after {
  content: ""; position: absolute; left: 0; right: 0; top: 3.15rem;
  height: 1px; background: var(--line-sumi);
}
/* 月の区切り：細い縦線 */
.year__month + .year__month { border-left: 1px solid var(--line-sumi); padding-left: clamp(18px, 3vw, 24px); }

.year__mlabel {
  display: flex; align-items: baseline; gap: .15em;
  height: 3.15rem; padding-bottom: .5rem;
  font-family: var(--font-mincho); font-weight: 700; font-size: 1.05rem; letter-spacing: .08em;
  color: var(--on-sumi);
  white-space: nowrap;
}
.year__mnum { font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: 0; }
.year__mold {
  margin-left: auto; align-self: center;
  font-size: .78rem; font-weight: 500; letter-spacing: .3em; color: var(--on-sumi-2);
}

/* 写真：横長と縦長を交互に置いて、列が同じ顔にならないように */
.year__photo { position: relative; overflow: hidden; border-radius: var(--radius-s); background: var(--sumi-3); aspect-ratio: 3 / 2; }
.year__photo--tall { aspect-ratio: 4 / 5; }
.year__photo img { width: 100%; height: 100%; object-fit: cover; }
/* 写真のない月（12月）：季節の一字を輪郭だけで置き、列のリズムをそろえる */
.year__photo--blank {
  display: grid; place-items: center;
  background: var(--sumi-2);
  box-shadow: inset 0 0 0 1px var(--line-sumi);
}
.year__photo--blank::after { content: none; }
.year__blank {
  font-family: var(--font-mincho); font-weight: 800; font-size: clamp(4rem, 9vw, 6rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(242, 238, 230, .28);
}
.year__photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(15, 14, 13, .35), transparent 45%);
}

/* ---------- 行事 ---------- */
.year__events { display: grid; gap: 22px; }
.year__event {
  position: relative; display: grid; gap: 4px;
  padding-left: 22px;
}
/* 印：支部主催＝朱の丸、本部・他＝輪 */
.year__event::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 11px; height: 11px; border-radius: 50%;
  box-sizing: border-box;
}
.year__event--branch::before { background: var(--shu); box-shadow: 0 0 0 3px rgba(200, 16, 46, .22); }
.year__event--other::before { border: 1.5px solid var(--on-sumi-2); }

.year__date {
  font-family: var(--font-mincho); font-weight: 700; font-size: 1.05rem; letter-spacing: .04em; line-height: 1.6;
  color: var(--on-sumi); font-feature-settings: "palt" 1;
}
.year__date time { white-space: nowrap; }
.year__date small { font-size: .78em; font-weight: 500; color: var(--on-sumi-2); }
.year__name {
  font-size: 1.25rem; line-height: 1.55; letter-spacing: .06em;
}
.year__name small { display: block; font-size: .78em; font-weight: 500; letter-spacing: .04em; color: var(--on-sumi-2); }
.year__event--other .year__name { font-weight: 500; }
.year__venue { font-size: .95rem; line-height: 1.75; color: var(--on-sumi-2); }
.year__host { font-size: .8rem; font-weight: 700; letter-spacing: .14em; line-height: 1.7; margin-top: 2px; }
.year__event--branch .year__host { color: #E0435B; }
.year__event--other .year__host { color: var(--on-sumi-2); }

/* ---------- 横スクロールの合図（スマホ・タブレットのみ） ---------- */
.year__hint {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px;
  font-size: var(--fs-small); letter-spacing: .12em; color: var(--on-sumi-2);
}
.year__hint-line { position: relative; width: 48px; height: 1px; background: var(--on-sumi-2); overflow: hidden; }
.year__hint-line::after {
  content: ""; position: absolute; inset: 0; background: var(--shu);
  transform: translateX(-100%); animation: year-hint 2.4s var(--ease) infinite;
}
@keyframes year-hint { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }

.year__note { margin-top: clamp(28px, 5vw, 44px); max-width: 40em; }

/* ---------- タブレット ---------- */
@media (min-width: 768px) {
  .year__track { grid-auto-columns: 296px; }
}

/* ---------- PC：前半（6〜9月）と後半（10〜12月）の2段 ---------- */
@media (min-width: 1100px) {
  .year__scroller {
    margin-inline: 0; padding-inline: 0;
    overflow: visible; scroll-snap-type: none; padding-bottom: 0;
  }
  .year__track {
    width: 100%; grid-auto-flow: row;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 72px;
  }
  .year__track { column-gap: 48px; }
  /* 列幅をそろえる：区切り線は余白の中央に引く */
  .year__month, .year__month + .year__month { padding: 0; border-left: 0; }
  .year__month:not(:nth-child(4n + 1))::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: -24px; width: 1px; background: var(--line-sumi);
  }
  .year__month::after { left: -24px; right: -24px; }
  .year__month:nth-child(4n + 1)::after { left: 0; }
  .year__month:nth-child(4n)::after, .year__month:last-child::after { right: 0; }
  .year__numeral { top: -.12em; }
  .year__mnum { font-size: 3.2rem; }
  .year__mlabel { height: 3.6rem; }
  .year__month::after { top: 3.6rem; }
  .year__photo--tall { aspect-ratio: 5 / 4; }
  .year__hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .year__hint-line::after { animation: none; transform: none; }
}
