/*
 * 北区の子どもイベント（WordPress 版）v1.7。2026-10-05 UI/UX 見直し反映。
 * v1.7（2026-10-15 追加・CEO 承認・第1段）: 申込受付中の先の催しの欄（.ke-upcoming・.ke-card-upcoming・.ke-up-*）、分類の印（.ke-tags・.ke-tag）、
 *   持ち物（.ke-bring）・主催／問い合わせ（.ke-org）の行。
 * v1.6（2026-10-13）: 地区で絞ったときの「地区が書かれていない催し」の折りたたみ（.ke-noarea）と、先着順の一行（.ke-firstcome）。
 * v1.5（2026-10-11 第3回）: 雨の日の印（屋内・雨天時は屋内・一部屋内は .ke-indoor を共用）、館ごとの出典（.ke-fac-note）。
 * v1.4（2026-10-11）: 誰向け・屋内の印（.ke-aud-*・.ke-indoor・.ke-card-parent）と、毎日行ける場所（.ke-facilities・.ke-fac-*）。
 * テーマの見た目に影響しないよう、一覧の部品はすべて .kita-page の中に限定する。
 * テーマ（SWELL）側の調整は、プラグインが一覧のページの body に付ける .kita-events-page の中だけで行う。
 * 文字色 --ke-primary-text / --ke-accent-text は、小さな文字でもコントラスト 4.5:1 を満たす濃さ。
 */
.kita-page {
  --ke-bg: #fbf6f0;
  --ke-fg: #3a332e;
  --ke-sub: #6b625b;
  --ke-primary: #e17b57;
  --ke-primary-dark: #c8613f;
  --ke-primary-text: #a94e2e;
  --ke-accent: #7a9471;
  --ke-accent-dark: #5f7657;
  --ke-accent-text: #4a5f43;
  --ke-surface: #ffffff;
  --ke-line: rgba(0, 0, 0, 0.1);
  --ke-blue: #2a5a8f;
  --ke-red: #b23a25;
  color: var(--ke-fg);
  line-height: 1.6;
  font-size: 16px;
}
.kita-page *,
.kita-page *::before,
.kita-page *::after { box-sizing: border-box; }
.kita-page p,
.kita-page ul,
.kita-page h2,
.kita-page h3 { margin: 0; padding: 0; }
.kita-page ul { list-style: none; }
.kita-page a:focus-visible,
.kita-page button:focus-visible,
.kita-page summary:focus-visible { outline: 2px solid var(--ke-primary-dark); outline-offset: 2px; }
.kita-page [hidden] { display: none !important; }

/* ---------- 上部: 期間・鮮度・共有 ---------- */
.kita-page .ke-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 8px; }
.kita-page .ke-summary-range { flex: 1 1 200px; font-size: 14px; color: var(--ke-sub); }
.kita-page .ke-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kita-page .ke-share-btn,
.kita-page .ke-copy-btn { min-height: 44px; padding: 8px 14px; border: 0; border-radius: 9999px; font: inherit; font-size: 14px; font-weight: 700; line-height: 1.2; cursor: pointer; }
.kita-page .ke-share-btn { background: #047a35; color: #fff; } /* LINE を連想させる緑。白文字で 4.5:1 以上になる濃さ */
.kita-page .ke-copy-btn { background: rgba(0, 0, 0, 0.06); color: var(--ke-fg); }
.kita-page .ke-share-status { font-size: 13px; color: var(--ke-accent-text); }

/* ---------- 注意書き（警告に見えないよう、薄いベージュ・枠なし） ---------- */
.kita-page .ke-notice { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #f4efe7; font-size: 13px; color: var(--ke-fg); }
.kita-page .ke-notice > * + * { margin-top: 4px; }
.kita-page .ke-small { font-size: 13px; color: var(--ke-sub); }
.kita-page .ke-inline-link { display: inline-block; padding: 4px 0; font-weight: 700; color: var(--ke-primary-text); text-decoration: underline; text-underline-offset: 2px; }
.kita-page details summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 700; color: var(--ke-primary-text); }
.kita-page details > div > * + * { margin-top: 6px; }

/* ---------- 絞り込み ---------- */
#kita-app > * + * { margin-top: 12px; }
.kita-page .ke-warn { padding: 8px 12px; border: 1px solid rgba(225, 123, 87, 0.3); border-radius: 8px; background: rgba(225, 123, 87, 0.05); font-size: 14px; color: var(--ke-primary-text); }
.kita-page .ke-stopped { padding: 16px; border-radius: 12px; background: var(--ke-surface); box-shadow: 0 0 0 1px var(--ke-line); }
.kita-page .ke-stopped > * + * { margin-top: 8px; }
.kita-page .ke-row-toggle { align-items: center; justify-content: space-between; }
.kita-page .ke-filters { padding: 10px 8px; border-radius: 14px; background: var(--ke-surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.05); }
.kita-page .ke-filters > * + * { margin-top: 8px; }
.kita-page .ke-row { display: flex; flex-wrap: wrap; gap: 6px; }
.kita-page .ke-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 8px 9px; border: 0; border-radius: 9999px; background: rgba(0, 0, 0, 0.05); color: var(--ke-fg); font: inherit; font-size: 14px; font-weight: 700; line-height: 1.2; cursor: pointer; }
.kita-page .ke-btn:hover { background: rgba(0, 0, 0, 0.09); }
.kita-page .ke-btn-count { min-width: 1.4em; padding: 1px 5px; border-radius: 9999px; background: rgba(255, 255, 255, 0.85); font-size: 12px; color: var(--ke-sub); text-align: center; }
.kita-page .ke-btn-on,
.kita-page .ke-btn-on:hover { background: var(--ke-accent-dark); color: #fff; }
.kita-page .ke-btn-on .ke-btn-count { background: rgba(255, 255, 255, 0.25); color: #fff; }
.kita-page .ke-btn-zero { color: #8a8078; }
.kita-page .ke-count { padding-right: 4px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.kita-page .ke-restored { font-size: 12px; color: var(--ke-sub); }

/* ---------- 日付の帯（固定ヘッダーの下に貼り付く） ---------- */
.kita-page .ke-strip { position: sticky; top: var(--ke-sticky-top, 0px); z-index: 5; margin-left: -4px; margin-right: -4px; padding: 6px 4px; background: rgba(251, 246, 240, 0.97); box-shadow: 0 6px 8px -8px rgba(0, 0, 0, 0.25); }
.kita-page .ke-strip ul { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); padding-right: 32px; scroll-behavior: smooth; }
.kita-page .ke-strip ul::-webkit-scrollbar { display: none; }
.kita-page .ke-strip li { flex-shrink: 0; }
.kita-page .ke-chip { display: inline-flex; align-items: baseline; gap: 4px; min-height: 44px; padding: 10px 12px; border-radius: 12px; background: var(--ke-surface); box-shadow: 0 0 0 1px var(--ke-line); font-size: 14px; font-weight: 700; color: var(--ke-fg); text-decoration: none; white-space: nowrap; }
.kita-page .ke-chip-sub { font-size: 12px; font-weight: 400; }
.kita-page .ke-chip-count { padding: 0 6px; border-radius: 9999px; background: rgba(0, 0, 0, 0.06); font-size: 12px; color: var(--ke-sub); }
.kita-page .ke-chip.ke-blue { color: var(--ke-blue); }
.kita-page .ke-chip.ke-red { color: var(--ke-red); }
.kita-page .ke-chip-weekend { background: #fff4d6; box-shadow: 0 0 0 1px #f0d48a; color: #7a5300; }
.kita-page .ke-chip.ke-current { background: var(--ke-accent-dark); box-shadow: none; color: #fff; }
.kita-page .ke-chip.ke-current .ke-chip-count { background: rgba(255, 255, 255, 0.25); color: #fff; }

/* ---------- 日ごとの見出しとカード ---------- */
.kita-page .ke-day { scroll-margin-top: calc(var(--ke-sticky-top, 0px) + 64px); }
.kita-page .ke-day + .ke-day { margin-top: 20px; }
.kita-page .ke-dayhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 6px 2px 6px 12px; border-left: 4px solid var(--ke-primary); background: none; color: var(--ke-fg); font-size: 18px; font-weight: 700; line-height: 1.4; }
.kita-page .ke-dayhead.ke-blue { color: var(--ke-blue); }
.kita-page .ke-dayhead.ke-red { color: var(--ke-red); }
.kita-page .ke-dayhead-period { border-left-color: var(--ke-accent); }
.kita-page .ke-today { padding: 0 8px; border-radius: 9999px; background: var(--ke-primary-text); color: #fff; font-size: 13px; }
.kita-page .ke-holiday { font-size: 13px; font-weight: 400; color: var(--ke-red); }
.kita-page .ke-daycount { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--ke-sub); }
.kita-page .ke-list { display: grid; gap: 8px; margin-top: 8px; }

.kita-page .ke-card { padding: 12px; border: 1px solid var(--ke-line); border-radius: 14px; background: var(--ke-surface); }
.kita-page .ke-card > * + * { margin-top: 4px; }
.kita-page .ke-card-ended { background: #faf8f5; }
.kita-page .ke-cardtop { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; }
.kita-page .ke-time { font-size: 17px; font-weight: 700; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.kita-page .ke-time-unknown { font-size: 14px; color: var(--ke-sub); }
.kita-page .ke-app { padding: 3px 10px; border-radius: 9999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.kita-page .ke-app-free { background: rgba(122, 148, 113, 0.18); color: var(--ke-accent-text); }
.kita-page .ke-app-need { background: rgba(225, 123, 87, 0.12); color: var(--ke-primary-text); }
.kita-page .ke-app-unknown { border: 1px dashed #b8aea5; color: var(--ke-sub); font-weight: 400; }
.kita-page .ke-ended { display: inline-block; padding: 0 8px; border-radius: 6px; background: #ece7e1; font-size: 12px; color: var(--ke-sub); }
.kita-page .ke-title { font-size: 16px; font-weight: 700; line-height: 1.45; }
.kita-page .ke-dim { color: #7d736b; }
.kita-page .ke-band { padding: 4px 8px; border-radius: 6px; background: rgba(225, 123, 87, 0.12); font-size: 13px; font-weight: 700; color: var(--ke-primary-text); }
.kita-page .ke-datenote { font-size: 14px; }
.kita-page .ke-place { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 14px; }
.kita-page .ke-place-name { color: var(--ke-fg); }
.kita-page .ke-map { display: inline-block; padding: 4px 0; font-size: 13px; font-weight: 700; color: var(--ke-accent-text); text-decoration: underline; text-underline-offset: 2px; }
.kita-page .ke-pills { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.kita-page .ke-pill { padding: 2px 9px; border-radius: 9999px; background: rgba(0, 0, 0, 0.05); font-size: 13px; color: var(--ke-sub); }
.kita-page .ke-kind-cc { background: #fdecdf; color: #8a4422; }
.kita-page .ke-kind-lib { background: #e3edf7; color: #2a5a8f; }
.kita-page .ke-kind-park { background: #e5f0df; color: #3f5a35; }
/* v1.4（2026-10-11）: 誰向け・屋内の印。保護者向けのカードは左の線で子ども向けと見分けられるようにする（隠しはしない） */
.kita-page .ke-aud-parent { background: #ede7f3; color: #5b4777; font-weight: 700; }
.kita-page .ke-aud-family { background: #fff1cc; color: #6f5000; font-weight: 700; }
.kita-page .ke-indoor { background: #dff1f0; color: #1f5f5b; } /* 図書館の印（.ke-kind-lib の青）と見分けるため青緑（独立レビュー L6） */
.kita-page .ke-card-parent { border-left: 4px solid #a993c4; background: #fcfbfe; }
.kita-page .ke-note { font-size: 13px; color: var(--ke-sub); }
.kita-page .ke-appnote { font-size: 13px; line-height: 1.6; color: var(--ke-fg); overflow-wrap: anywhere; }
.kita-page .ke-link { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; min-height: 44px; padding-top: 10px; font-size: 14px; font-weight: 700; color: var(--ke-primary-text); text-decoration: underline; text-underline-offset: 2px; }
.kita-page .ke-src { font-size: 12px; font-weight: 400; text-decoration: none; color: var(--ke-sub); }
.kita-page .ke-report { display: inline-block; margin-left: 12px; padding: 10px 0; font-size: 12px; color: var(--ke-sub); text-decoration: underline; text-underline-offset: 2px; }
.kita-page .ke-nolink + .ke-report { margin-left: 0; }
.kita-page .ke-nolink { padding-top: 6px; font-size: 13px; color: var(--ke-sub); }

/* v1.6（2026-10-13）: 先着順で受付開始から日がたった催しの一行。申込みの文の下に、目立ちすぎない色で */
.kita-page .ke-firstcome { color: var(--ke-primary-text); }
/* v1.6: 地区で絞ったときの「地区が書かれていない催し」。一覧の最後に折りたたんで出す（毎日行ける場所の箱と同じ作り） */
.kita-page .ke-noarea { margin-top: 20px; padding: 4px 14px 14px; border-radius: 14px; background: var(--ke-surface); box-shadow: 0 0 0 1px var(--ke-line); scroll-margin-top: calc(var(--ke-sticky-top, 0px) + 64px); }
.kita-page .ke-noarea > summary { font-size: 16px; }
.kita-page .ke-noarea-lead { font-size: 13px; color: var(--ke-sub); }
/* v1.7（2026-10-15）: 分類の印・持ち物・主催／問い合わせ・申込受付中の先の催し */
.kita-page .ke-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.kita-page .ke-tag { margin: 0; padding: 1px 8px; border: 1px solid rgba(95, 118, 87, 0.35); border-radius: 9999px; background: none; font-size: 12px; color: var(--ke-accent-text); }
.kita-page .ke-bring { font-size: 13px; line-height: 1.6; color: var(--ke-fg); overflow-wrap: anywhere; }
.kita-page .ke-org { font-size: 12px; line-height: 1.6; color: var(--ke-sub); overflow-wrap: anywhere; }
.kita-page .ke-upcoming { margin-top: 24px; scroll-margin-top: calc(var(--ke-sticky-top, 0px) + 64px); }
.kita-page .ke-upcoming[hidden] { display: none; }
.kita-page .ke-dayhead-upcoming { border-left-color: var(--ke-accent-dark); }
.kita-page .ke-upcoming-lead { margin: 4px 0 0; font-size: 13px; color: var(--ke-sub); }
.kita-page .ke-up-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding-bottom: 6px; border-bottom: 1px dashed var(--ke-line); }
.kita-page .ke-up-deadline { margin: 0; font-size: 16px; font-weight: 700; color: var(--ke-primary-text); }
.kita-page .ke-up-date { margin: 0; font-size: 14px; font-weight: 700; color: var(--ke-fg); }
.kita-page .ke-chip-upcoming { background: #eef3ea; box-shadow: 0 0 0 1px rgba(95, 118, 87, 0.35); color: var(--ke-accent-text); }

/* ---------- 0件・今日なし・終わり ---------- */
.kita-page .ke-empty { padding: 16px; border-radius: 12px; background: var(--ke-surface); box-shadow: 0 0 0 1px var(--ke-line); text-align: center; }
.kita-page .ke-empty > * + * { margin-top: 10px; }
.kita-page .ke-today-none { margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: #f4efe7; font-size: 14px; }
.kita-page .ke-today-none > * + * { margin-top: 8px; }
.kita-page .ke-end { margin-top: 28px !important; padding: 16px; border-radius: 14px; background: #f4efe7; font-size: 14px; }
.kita-page .ke-end > * + * { margin-top: 8px; }
.kita-page .ke-end-lead { font-weight: 700; }
.kita-page .ke-hint { font-size: 13px; color: var(--ke-sub); }

.kita-page .ke-sources { margin-top: 32px; padding-top: 12px; border-top: 1px solid rgba(0, 0, 0, 0.06); font-size: 12px; color: var(--ke-sub); }
.kita-page .ke-sources > * + * { margin-top: 4px; }
.kita-page .ke-sources a { color: var(--ke-sub); }

/* ---------- 催しが無い日も行ける場所（児童館など。v1.4） ---------- */
.kita-page .ke-facilities { margin-top: 28px !important; padding: 4px 14px 14px; border-radius: 14px; background: var(--ke-surface); box-shadow: 0 0 0 1px var(--ke-line); }
.kita-page .ke-facilities > summary { flex-wrap: wrap; gap: 2px 8px; font-size: 16px; }
.kita-page .ke-fac-count { font-size: 13px; font-weight: 400; color: var(--ke-sub); }
.kita-page .ke-fac-body > * + * { margin-top: 8px; }
.kita-page .ke-fac-lead { font-size: 13px; color: var(--ke-fg); }
.kita-page h3.ke-fac-area { margin: 14px 0 0; padding: 0 0 0 10px; border: 0; border-left: 4px solid var(--ke-accent); background: none; font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--ke-fg); }
.kita-page .ke-fac-list { display: grid; gap: 8px; }
.kita-page .ke-fac { padding: 10px 12px; border: 1px solid var(--ke-line); border-radius: 12px; }
.kita-page .ke-fac > * + * { margin-top: 2px; }
.kita-page .ke-fac-name { font-weight: 700; }
.kita-page .ke-fac-addr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 14px; overflow-wrap: anywhere; }
.kita-page .ke-fac-links { display: flex; flex-wrap: wrap; gap: 0 16px; }
.kita-page .ke-fac-tel,
.kita-page .ke-fac-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 700; color: var(--ke-primary-text); text-decoration: underline; text-underline-offset: 2px; }
.kita-page .ke-fac-note { font-size: 12px; color: var(--ke-sub); } /* v1.5: 区の公式ページから写した館の出典 */
.kita-page .ke-fac-source { font-size: 12px; color: var(--ke-sub); overflow-wrap: anywhere; }
.kita-page .ke-fac-source a { color: var(--ke-sub); }
@media (min-width: 960px) {
  .kita-page .ke-fac-list { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* JS が動かないときの簡易一覧 */
.kita-page .ke-fallback li { margin-top: 4px; font-size: 14px; }

/* ---------- 小さいスマホ（360px 前後）: 地区のボタンを1行に収める ---------- */
@media (max-width: 379px) {
  .kita-page .ke-btn { padding: 8px 6px; font-size: 13px; }
  .kita-page .ke-btn-count { padding: 1px 4px; font-size: 11px; }
  .kita-page .ke-row { gap: 4px; }
}

/* ---------- PC: カードを2列に ---------- */
@media (min-width: 960px) {
  .kita-page .ke-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

/* ---------- テーマ（SWELL）との調整。一覧のページだけ（body.kita-events-page） ----------
 * 2026-10-04〜05 実機で確認: SWELL は h2 を白文字にし、h2・h3 に飾りの線（疑似要素）を付ける。
 * パンくず・サイドバーは一覧のページでは使わない。見出しと本文の間の空きを詰める。 */
.kita-page .ke-dayhead::before,
.kita-page .ke-dayhead::after,
.kita-page .ke-title::before,
.kita-page .ke-title::after,
.kita-page .ke-fac-area::before,
.kita-page .ke-fac-area::after { content: none; display: none; }
.kita-page .ke-title { border: 0; background: none; padding: 0; margin: 0; }
.kita-page h2.ke-dayhead { margin: 0; }
.kita-events-page .p-breadcrumb,
.kita-events-page #breadcrumb { display: none; }
.kita-events-page #sidebar,
.kita-events-page .l-sidebar { display: none; }
.kita-events-page .l-mainContent { width: 100%; max-width: 100%; }
.kita-events-page .c-pageTitle,
.kita-events-page .l-mainContent__inner > .post_content { margin-top: 0; }
.kita-events-page .c-pageTitle { margin-bottom: 8px; }
.kita-events-page .l-content { padding-top: 16px; }
.kita-events-page .post_content { margin-top: 0; }
