/* ========================================
   schoollife.css — 園の生活ページ
   ======================================== */

/* ---- ページヒーロー調整 ---- */
.schoollife-hero {
  background: linear-gradient(160deg, #3a5a4a 0%, #2a4039 50%, #354840 100%);
}

/* 横長のヒーローでも子どもの顔が切れないよう、表示位置を上側へ寄せる */
.schoollife-hero .page-hero-bg img {
  object-position: center 5%;
}

/* 写真スタックは各段の高さを固定し、下段2枚を同じ高さで揃える */
@media (min-width: 769px) {
  .schoollife-page .about-img-stacked {
    height: 480px;
    grid-template-rows: 280px 188px;
  }

  .schoollife-page .about-img-stacked > img:first-child,
  .schoollife-page .about-img-sub2,
  .schoollife-page .about-img-sub2 img {
    height: 100%;
    aspect-ratio: auto;
  }
}

/* ========================================
   １日の流れ（タイムライン）
   ======================================== */

.schoollife-schedule {
  padding: 72px 32px;
}

.schoollife-schedule-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.schoollife-page .about-img-single img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
}

.schedule-layout {
  margin-top: 48px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 24px;
  align-items: stretch;
}

.schedule-timeline {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 8px 32px;
}

.schedule-photo-column {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.schedule-photo-column img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border-radius: var(--radius-image);
  box-shadow: var(--shadow-subtle);
}

.schedule-timeline::before {
  content: '';
  position: absolute;
  left: 97px; /* 32px padding + 65px (center of 130px column) */
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, #a8c8e0, #c8d8e8);
}

.schedule-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0;
  position: relative;
  align-items: flex-start;
  margin-bottom: 4px;
}

.schedule-time {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  position: relative;
  z-index: 2;
}

/* 時刻あり → 青いピルバッジ */
.schedule-time:not(:empty) {
  background: #0874C7;
  color: #fff;
  border-radius: 999px;
  padding: 17px 11px 18px 7px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  gap: 5px;
  min-width: 82px;
  justify-content: center;
  margin-top: 14px; /* schedule-body の padding-top に合わせる */
}

/* 時計アイコン（SVG inline） */
.schedule-time:not(:empty)::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='rgba(255,255,255,0.2)' stroke='white' stroke-width='1.5'/%3E%3Cline x1='12' y1='7' x2='12' y2='12' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3Cline x1='12' y1='12' x2='15.5' y2='14' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.schedule-item::before {
  content: '';
  position: absolute;
  left: 58px; /* 65px (column center) - 7px (half of 14px dot) */
  top: 25px; /* padding-top(14px) + タイトル行の中央(約11px) */
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0874C7;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #0874C7;
  z-index: 1;
}

/* 時刻バッジがある行はドット不要 */
.schedule-item.is-accent::before {
  display: none;
}

.schedule-body {
  padding: 14px 0 14px 32px;
  border-bottom: 1px dotted #d4e0ec;
}

.schedule-item:last-child .schedule-body {
  border-bottom: none;
}

.schedule-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: 4px;
  line-height: 1.4;
}

.schedule-desc {
  font-size: 16px;
  color: var(--color-text);
  line-height: 1.8;
}

.schedule-tag {
  display: inline-block;
  font-size: var(--font-ui);
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 100px;
  margin-left: 8px;
  vertical-align: middle;
}

.schedule-tag--lunch {
  background: #FDF3E7;
  color: #D98345;
  border: 1px solid #F0D0A0;
}

.schedule-tag--care {
  background: #EBF3FC;
  color: #0874C7;
  border: 1px solid #B8D0F0;
}

/* ========================================
   年間行事カレンダー
   ======================================== */

.events-calendar {
  padding: 72px 32px;
}

.events-calendar-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* ----- スライダー ----- */

.events-slider-wrap {
  margin-bottom: 56px;
}

.events-slider-viewport {
  overflow: hidden;
}

.events-slider-track {
  display: flex;
  gap: 16px;
  will-change: transform;
}

.events-slide {
  flex: 0 0 calc(33.333% - 11px);
}

.events-slide img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.events-slide-caption {
  display: block;
  text-align: center;
  font-size: var(--font-note);
  color: var(--color-muted);
  margin-top: 8px;
}

/* ----- 3学期ペイン ----- */

.events-terms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.events-term {
  padding: 32px 28px;
  background: transparent;
}

.events-term-title {
  font-size: var(--font-subsection-title);
  font-weight: 900;
  color: var(--color-ink, #1A1A1A);
  line-height: 1;
  margin: 0 0 24px;
  letter-spacing: 0.05em;
}

.events-term-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.events-term-list li {
  font-size: var(--font-body);
  color: var(--color-text);
  padding: 10px 0;
  border-bottom: 2px dotted #C8D4E4;
  display: flex;
  align-items: center;
  gap: 10px;
}

.events-term-list li:last-child {
  border-bottom: none;
}

.events-term-list li::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0874C7;
  flex-shrink: 0;
}

.events-calendar-note {
  font-size: var(--font-note);
  color: var(--color-muted);
  margin: 20px 0 0;
}

/* ========================================
   レスポンシブ
   ======================================== */

@media (max-width: 768px) {
  .schoollife-schedule { padding: 56px 20px; }

  .schedule-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 32px;
  }

  .schedule-photo-column {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .schedule-photo-column img {
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: 16px;
  }

  .schedule-timeline::before { left: 71px; } /* 16px padding + 55px (center of 110px column) */

  .schedule-item { grid-template-columns: 110px 1fr; }

  .schedule-item::before { left: 48px; } /* 55px - 7px */

  .schedule-time:not(:empty) { font-size: var(--font-ui); padding: 4px 9px 4px 6px; gap: 4px; }

  .schedule-time:not(:empty)::before { width: 14px; height: 14px; }

  .schedule-body { padding: 12px 0 12px 24px; }

  .schedule-timeline { padding: 8px 16px; border-radius: 12px; }

  /* 年間行事 モバイル */
  .events-calendar { padding: 48px 20px; }

  .events-slide {
    flex: 0 0 calc(80% - 8px);
  }

  .events-slide img { height: 200px; }

  .events-terms-grid {
    grid-template-columns: 1fr;
  }

  .events-term {
    padding: 24px 20px;
  }

  .events-term-title { font-size: var(--font-subsection-title); margin-bottom: 16px; }
}

/* ==========================================================
   行事スライダー：スマホのスワイプ操作
   横スワイプはスライダー、縦スワイプはページスクロールに任せる
   ========================================================== */
.events-slider-wrap {
  touch-action: pan-y;
  overscroll-behavior-x: contain;   /* 横スワイプでブラウザの「戻る」が暴発しないように */
}

.events-slider-wrap .events-slider-track {
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .events-slider-wrap .events-slider-track {
    transition: none;
  }
}
