/* ==========================================================================
   2027年度 修錬会 年間スケジュール スタイルシート
   青年向け・フォルダタブ型一体UI＆高視認性設計
   ========================================================================== */

:root {
  --bg: #EBF0F5;
  --surface: #FFFFFF;
  --surface-muted: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --ink: #0F172A;
  --ink-muted: #475569;

  /* 明るく見分けやすいカテゴリカラー */
  --dai-color: #2563EB;
  --dai-text: #1D4ED8;
  --dai-bg: #EFF6FF;
  --dai-border: #BFDBFE;

  --forty-color: #10B981;
  --forty-text: #047857;
  --forty-bg: #ECFDF5;
  --forty-border: #A7F3D0;

  --three-color: #F97316;
  --three-text: #C2410C;
  --three-bg: #FFF7ED;
  --three-border: #FED7AA;

  --special-color: #DC2626;
  --special-bg: #FEF2F2;
  --special-border: #FECACA;

  /* アクティブタブ・接続パネル用デフォルト（月別一覧） */
  --active-color: #334155;
  --active-tint: #F1F5F9;
  --active-text: #1E293B;
  --active-border: #CBD5E1;

  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
}

body[data-active-tab="all"] {
  --active-color: #334155;
  --active-tint: #FFFFFF;
  --active-text: #0F172A;
  --active-border: #CBD5E1;
}

body[data-active-tab="daiekiji"] {
  --active-color: #2563EB;
  --active-tint: #EFF6FF;
  --active-text: #1D4ED8;
  --active-border: #BFDBFE;
}

body[data-active-tab="forty"] {
  --active-color: #10B981;
  --active-tint: #ECFDF5;
  --active-text: #047857;
  --active-border: #A7F3D0;
}

body[data-active-tab="three"] {
  --active-color: #F97316;
  --active-tint: #FFF7ED;
  --active-text: #C2410C;
  --active-border: #FED7AA;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

.nowrap {
  display: inline-block;
  white-space: nowrap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', Meiryo, sans-serif;
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  padding-bottom: 4.5rem;
}

button,
input,
a {
  font-family: inherit;
}

.is-hidden,
[hidden] {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

.icon-svg {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  background: linear-gradient(155deg, #1E3A8A 0%, #2563EB 100%);
  color: #FFFFFF;
  padding: 16px 0 18px;
  border-bottom: 3px solid #60A5FA;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.doc-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.site-title {
  margin: 0 0 4px;
  font-size: 1.38rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.site-subtitle {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.92);
}

.header-note {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(15, 23, 42, 0.2);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Sticky Connected Folder-Tab Navigation
   ========================================================================== */
.tab-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(235, 240, 245, 0.97);
  backdrop-filter: blur(8px);
  padding: 10px 0 0;
}

.tab-nav.is-stuck {
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.tab-nav-inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  border-bottom: 2px solid var(--active-color);
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 48px;
  margin-top: 4px;
  padding: 8px 2px 9px;
  background: #DCE4EE;
  border: 1px solid var(--border-strong);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  color: var(--ink-muted);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.tab-label {
  line-height: 1.2;
  white-space: nowrap;
}

.tab-count {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-muted);
}

.tab-btn.is-active {
  position: relative;
  z-index: 2;
  margin-top: 0;
  margin-bottom: -2px;
  background: var(--active-tint);
  border-top: 3px solid var(--active-color);
  border-left: 2px solid var(--active-color);
  border-right: 2px solid var(--active-color);
  border-bottom: 2px solid var(--active-tint);
  color: var(--active-text);
}

.tab-btn.is-active .tab-count {
  background: var(--active-text);
  color: #FFFFFF;
}

/* ==========================================================================
   Connected Tab Panel Sheet & Banner
   ========================================================================== */
.main-content {
  padding-top: 0;
}

.tab-panel {
  border: 2px solid var(--active-color);
  border-top: none;
  border-radius: 0 0 14px 14px;
  background: #F8FAFC;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.panel-banner {
  background: var(--active-tint);
  padding: 12px 14px;
  border-bottom: 1px solid var(--active-border);
}

.panel-banner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--active-text);
  line-height: 1.35;
}

.panel-banner-title::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--active-color);
  flex-shrink: 0;
}

.panel-banner-desc {
  margin: 0;
  padding-left: 18px;
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

.panel-body {
  padding: 12px;
}

/* ==========================================================================
   Quick Calendar
   ========================================================================== */
.quick-calendar-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.quick-cal-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

@media (min-width: 560px) {
  .quick-cal-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.section-mini-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--ink);
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.legend-daiekiji {
  background: var(--dai-bg);
  color: var(--dai-text);
  border-color: var(--dai-border);
}

.legend-forty {
  background: var(--forty-bg);
  color: var(--forty-text);
  border-color: var(--forty-border);
}

.legend-three {
  background: var(--three-bg);
  color: var(--three-text);
  border-color: var(--three-border);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-daiekiji { background: var(--dai-color); }
.dot-forty { background: var(--forty-color); }
.dot-three { background: var(--three-color); }

.month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

@media (min-width: 560px) {
  .month-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.month-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 6px 4px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink);
}

.month-cell:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
}

.month-cell-label {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
}

.month-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 5px;
  min-height: 10px;
}

/* ==========================================================================
   Filter Bar
   ========================================================================== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chip-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.filter-chip {
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 0.81rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
}

.hide-past-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  font-size: 0.84rem;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px 2px;
}

.hide-past-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--dai-color);
}

/* ==========================================================================
   Callouts
   ========================================================================== */
.info-callout {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.callout-daiekiji {
  background: var(--dai-bg);
  border-color: var(--dai-border);
}

.callout-forty {
  background: var(--forty-bg);
  border-color: var(--forty-border);
}

.callout-three {
  background: var(--three-bg);
  border-color: var(--three-border);
}

.callout-title {
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.callout-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.84rem;
  color: var(--ink);
}

.callout-list li + li {
  margin-top: 4px;
}

/* ==========================================================================
   Timeline & Cards
   ========================================================================== */
.month-section {
  margin-bottom: 20px;
  scroll-margin-top: 68px;
}

.month-section:last-child {
  margin-bottom: 4px;
}

.month-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
  padding: 4px 2px 6px;
  border-bottom: 2px solid var(--border-strong);
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--ink);
}

.month-heading-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.cards-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.schedule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 5px;
  border-radius: var(--radius-md);
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
}

.schedule-card.is-ended {
  opacity: 0.72;
}

.card-daiekiji { border-left-color: var(--dai-color); }
.card-forty { border-left-color: var(--forty-color); }
.card-three { border-left-color: var(--three-color); }
.card-three.is-special { border-left-color: var(--special-color); }

.card-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.badge-daiekiji {
  background: var(--dai-bg);
  color: var(--dai-text);
  border: 1px solid var(--dai-border);
}

.badge-forty {
  background: var(--forty-bg);
  color: var(--forty-text);
  border: 1px solid var(--forty-border);
}

.badge-three {
  background: var(--three-bg);
  color: var(--three-text);
  border: 1px solid var(--three-border);
}

.badge-special {
  background: var(--special-bg);
  color: var(--special-color);
  border: 1px solid var(--special-border);
}

.badge-connect {
  background: #FEF9C3;
  color: #854D0E;
  border: 1px solid #FDE047;
}

.badge-ended {
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.card-date-main {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
  line-height: 1.4;
}

.card-title {
  margin: 0 0 6px;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
}

.card-official-title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

.card-meta-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.card-meta-item {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
}

.card-meta-key {
  font-weight: 700;
  color: var(--ink);
}

.card-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: #F8FAFC;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   Common Bottom Section (Notices & Contacts)
   ========================================================================== */
.common-bottom {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accordion-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.chevron-svg {
  width: 22px;
  height: 22px;
  color: var(--ink-muted);
  transition: transform 0.2s ease;
}

.accordion-card[open] .chevron-svg {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.bullet-list {
  margin: 12px 0 0;
  padding-left: 1.2rem;
  font-size: 0.86rem;
  color: var(--ink);
}

.bullet-list li + li {
  margin-top: 6px;
}

.contacts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding-top: 12px;
}

@media (min-width: 560px) {
  .contacts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.contact-card {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.contact-name {
  margin: 0 0 2px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.contact-role {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.contact-row {
  margin: 4px 0 0;
  font-size: 0.83rem;
  color: var(--ink);
  word-break: break-word;
}

.contact-row a {
  color: var(--dai-text);
  font-weight: 700;
  text-decoration: underline;
}

/* ==========================================================================
   Footer & Back to Top
   ========================================================================== */
.site-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.footer-inner p {
  margin: 0 0 4px;
}

.back-to-top {
  position: fixed;
  right: 12px;
  bottom: 14px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

/* ==========================================================================
   Print
   ========================================================================== */
@media print {
  .tab-nav,
  .filter-bar,
  .quick-calendar-box,
  .back-to-top {
    display: none !important;
  }

  body {
    background: #FFFFFF;
    color: #000000;
    padding-bottom: 0;
  }

  .site-header {
    background: #FFFFFF;
    color: #000000;
    border-bottom: 2px solid #000000;
  }

  .doc-badge,
  .site-subtitle,
  .header-note {
    color: #333333;
    background: transparent;
    border-color: #999999;
  }

  .tab-panel {
    border: none;
    border-radius: 0;
    background: #FFFFFF;
    box-shadow: none;
  }

  .tab-panel[hidden] {
    display: block !important;
  }

  .schedule-card {
    break-inside: avoid;
    box-shadow: none;
  }
}
