/**
 * CCT Event Calendar CSS
 */

:root {
	/* 体験入学 */
	--ev_experience: hsl(330, 75%, 59%);

	/* 半日体験入学 */
	--ev_half: #FF3300;

	/* 学校説明会 */
	--ev_briefing: #128FCE;

	/* 総合型選抜入試エントリー説明会 */
	--ev_sogo: #01A8E3;

	/* 保護者対象学校説明会 */
	--ev_parents_briefing: #F3981B;

	/* オープンキャンパス */
	--ev_opencampus: #004098;

	/*1st STEP 学校説明会*/
	--ev_onstep_briefing: #000;

	/* 1st STEP 体験入学 */
	--ev_onestep: #35C38D;

	/* 個別入学相談会 */
	 --ev_kobetsu: #652480;
}

/* カレンダー全体のスタイル */
.cct-event-calendar {
	font-family: "Helvetica Neue", Arial, sans-serif;
	margin: 20px 0;
	max-width: 100%;
}

/* ナビゲーション */

.calendar-navigation {
	display: flex;
	justify-content: space-between;
	align-items: center;

	padding: 10px 0;
}

.calendar-navigation .current-month {
	font-size: 1.5em;
	font-weight: bold;
}

a.back-to-current-month,
.calendar-navigation a {
	text-decoration: none;
	padding: 5px 10px;
	border-radius: 6px;
	background-color: #f5f5f5;
	color: #333;
	transition: background-color 0.3s;
	font-size: 13px;
}

/* 🙆‍♂ Recommended */
@media (any-hover: hover) {
	a.back-to-current-month:hover,
	.calendar-navigation a:hover {
		background-color: #e0e0e0;
	}
}


.calendar-footer {
	margin-top: 1em;
}

/* カレンダーテーブル */
.calendar-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	background-color: #fff;
}

.calendar-table th {
	padding: .375em;
	text-align: center;
	background-color: #f5f5f5;
	border: 1px solid #ddd;
	color: #6e6d6d;
}

.calendar-table td {
	border: 1px solid #ddd;
	vertical-align: top;
	padding: .5em .3em;
	color: #6e6d6d;
}

/* 日曜日と土曜日と祝日 */
.calendar-table th.sunday,
.calendar-table td.sunday .date-number,
.calendar-table td.holiday .date-number {
	color: #ba0022;
}

.calendar-table th.saturday,
.calendar-table td.saturday .date-number {
	color: #1e88e5;
}

/* 空のセル */
.calendar-table td.empty {
	background-color: #f9f9f9;
}

/* 日付番号 */
.date-number {
	font-weight: bold;
	font-size: 1.1rem;
	line-height: 1;
	margin-bottom: 12px;
/*	display: flex;
	gap: 6px;*/
	align-items: baseline;
}

/* 祝日名 */
.holiday-name {
	display: block;
	margin-top: 4px;
	font-size: .625rem;
	color: #e53935;
	font-weight: normal;
}

/* 今日の日付 */
.calendar-table td.today {
	background-color: #fff8e1;
}



/* イベントタイトルのベーススタイル */
.event-title {
	position: relative; /* ツールチップ用の基準位置 */
	padding: 0;
	display: block;
	text-decoration: none;
}

.event-title .cal-marker {
	display: block;
	margin: 2px 0;
	padding: 3px 5px;
	font-size: .75rem;
	line-height: 1.2;
	border-radius: 3px;
	text-decoration: none;
	background-color: #333;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	/* text-overflow: ellipsis; */
	position: relative; /* ツールチップ用の基準位置 */
	transition: background-color 0.3s ease; /* 背景色のアニメーション用 */
}

/* 祝日 */
.sunday,
.holiday {
	background-color: #f8f3f4;
}

.event-title.event-experience .cal-marker {
	background-color: var(--ev_experience);	
}

.event-title.event-half .cal-marker {
	background-color: var(--ev_half);	
}

.event-title.event-onestep .cal-marker {
	background-color: var(--ev_onestep);	
}

.event-title.event-opencampus .cal-marker {
	background-color: var(--ev_opencampus);	
}

.event-title.event-sogo .cal-marker {
	background-color: var(--ev_sogo);	
}

.event-title.event-kobetsu .cal-marker {
	background-color: var(--ev_kobetsu);	
}

.event-title.event-briefing .cal-marker {
	background-color: var(--ev_briefing);	
}

.event-title.event-parents_briefing .cal-marker {
	background-color: var(--ev_parents_briefing);	
}






/* PCのみのホバー効果 */
@media (any-hover: hover) {
	.event-title {
			cursor: pointer;
	}
	
	/* ホバー時の背景色アニメーション */
	.event-title:hover .cal-marker {
			filter: brightness(60%);
	}
	
	/* ツールチップのスタイル */
	.tooltip-text {
		opacity: 0;
		visibility: hidden;
		position: absolute;
		left: 50%;
		bottom: calc( 100% + 8px );
		transform: translateX(-50%);
		color: #fff;
		padding: 5px 8px;
		font-size: 1rem;
		font-weight: bold;
		border-radius: 4px;
		white-space: nowrap;
		transition: opacity 0.3s ease, visibility 0.3s ease;
		background-color: #333;
		z-index: 9999;
	}

	/* ホバー時にツールチップを表示 */
	.event-title:hover .tooltip-text {
		opacity: 1;
		visibility: visible;
	}

	.tooltip-text::before {
		position: absolute;
		content: "";
		height: 10px;
		width: 10px;
		bottom: -4px;
		left: 50%;
		background-color: #333;
		transform: translate(-50%) rotate(45deg);
		transition: all 0.3s ease;
	}
	
	.event-experience .tooltip-text {
		background-color: var(--ev_experience);
	}

	.event-experience .tooltip-text::before {
		background-color: var(--ev_experience);
	}

	.event-half .tooltip-text {
		background-color: var(--ev_half);
	}

	.event-half .tooltip-text::before {
		background-color: var(--ev_half);
	}

	.event-briefing .tooltip-text {
		background-color: var(--ev_briefing);
	}

	.event-briefing .tooltip-text::before {
		background-color: var(--ev_briefing);
	}

	.event-sogo .tooltip-text {
		background-color: var(--ev_sogo);
	}

	.event-sogo .tooltip-text::before {
		background-color: var(--ev_sogo);
	}

	.event-parents_briefing .tooltip-text {
		background-color: var(--ev_parents_briefing);
	}

	.event-parents_briefing .tooltip-text::before {
		background-color: var(--ev_parents_briefing);
	}

	.event-opencampus .tooltip-text {
		background-color: var(--ev_opencampus);
	}

	.event-opencampus .tooltip-text::before {
		background-color: var(--ev_opencampus);
	}

	.event-onstep_briefing .tooltip-text {
		background-color: var(--ev_onstep_briefing);
	}

	.event-onstep_briefing .tooltip-text::before {
		background-color: var(--ev_onstep_briefing);
	}

	.event-onestep .tooltip-text {
		background-color: var(--ev_onestep);
	}

	.event-onestep .tooltip-text::before {
		background-color: var(--ev_onestep);
	}

	.event-kobetsu .tooltip-text {
		background-color: var(--ev_kobetsu);
	}

	.event-kobetsu .tooltip-text::before {
		background-color: var(--ev_kobetsu);
	}


}


.eventCat {
	display: flex;
	gap: 1em;
	flex-wrap: wrap;
	list-style: none;
	padding: 0;
	margin: 0;
}

.eventCat li::before {
	content: "●";
}






@media screen and (min-width: 769px) {
	.calendar-table td.today {
		padding-top: 2px;
	}
}


/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
	.calendar-table {
			font-size: 0.9em;
	}
	
	.calendar-table td {
			padding: 3px;
	}
	
	.event-title {
			font-size: 0.8em;
			padding: 2px 3px;
	}
}

@media screen and (max-width: 480px) {

	.calendar-table {
		margin: 0 calc(50% - 50vw);
		width: 100vw;
	}

	.calendar-table th {
			padding: 5px 2px;
			font-size: 0.8em;
	}
	
	
	
	.date-number {
		align-items: center;
		font-size: 1rem;
		justify-content: center;
		text-align: center;
		flex-direction: column;
	}
	
	.event-list {
			max-height: 50px;
	}

	.event-title {
		padding: 0;
	}

	.holiday-name {
		display: block;
		text-align: left;
		font-size: 8px;
	}

	.tooltip-text {
		display: none;
	}

	
}


.calendar-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 20px;
  background: rgba(255,255,255,0.9);
  border: 1px solid #ccc;
  border-radius: 6px;
  font-weight: bold;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cct-event-calendar {
  position: relative;
}

.event-categories {
	margin-top: 1.5em;
}


/* ===== モーダル ===== */
.cct-modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.cct-modal.is-open{ display:block; }

.cct-modal__overlay{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.45);
}

.cct-modal__dialog{
  position: relative;
  width: min(720px, calc(100% - 24px));
  margin: 24px auto;
  background:#fff;
  border-radius:12px;
  padding: 16px 16px 18px;
}


.cct-modal__close {
	border: none;
	cursor: pointer;
	outline: 1px solid #fff;
	padding: 0;
	appearance: none;
	background-color: #000;
	border-radius: 100%;
	color: #fff;
	padding: 10px;
	position: absolute;
	width: 42px;
	height: 42px;
	right: 10px;
	top: -10px;
}

.cct-modal__close .close {
	fill: #fff;
}

.cct-modal__date{
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.cct-modal__item{
  border-top: 1px solid #eee;
  padding: 12px 0;
}
.cct-modal__item:first-child{ border-top:none; }

.cct-modal__item-title{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight: 700;
}

.cct-modal__item-meta{
  font-size: 12px;
  opacity: .7;
  margin-top: 4px;
}

.cct-modal__item-details{
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  opacity: .7;
}

.cct-modal__item-actions{
  display:flex;
  gap:10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Googleカレンダー追加ボタン */
.cct-gcal-btn{
  display:inline-block;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration:none;
  color: #fff;
  background: #20286F;
  font-size: 13px;
}

/* ===== バッジ（モーダル内） ===== */
.event-slot-badge{
  display:inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  border: .3px solid currentColor;
  line-height: 1.2;
  white-space: nowrap;
}
.event-slot-badge.is-day{ color:#fff; background:#E98B2A; border-color:#E98B2A; }
.event-slot-badge.is-night,
.event-slot-badge.is-night_1,
.event-slot-badge.is-night_2 {
	color:#fff; background:#88816E; border-color:#88816E;
}

.event-list .event-slot-badge{
	font-size: 8px;
	margin-left: 5px;
}
.event-list .event-slot-badge.is-day, .event-list .event-slot-badge.is-night{
	background: #fff;
	border-color: #fff;
	color: #333;
}
.cct-modal__item .event-slot-badge{
	font-size: 12px;
	padding: 2px 6px;
	font-weight: normal;
}
/* セルをバーの基準にする */
.calendar-day{
  position: relative;
  overflow: visible; /* ←重要：はみ出しOKにする */
  height: 116px;	  /* 見た目の固定高 */
  vertical-align: top;
}
.calendar-day .date-number{
  position: relative;
  height: 18px;	  /* 日付の行を固定 */
  line-height: 18px;
}
/* リストが高さを確保できるように */
.event-list{
  position: relative;
  overflow: visible;
  min-height: 22px; /* バーが入る高さ */
}
.calendar-day .holiday-name{
  position: absolute;
  left: 0;
  top: 18px;		 /* 日付の下に重ねて表示 */
  font-size: 8px;
  line-height: 1.2;
}


/* 横断バー本体 */
.event-chip {
  cursor: pointer;
}

.event-chip.is-span{
  position: absolute;
  left: 0;
  top: calc(2px + (var(--lane) * 22px));
  width: calc(var(--span) * 100% + (var(--span) - 1) * 10.5px);
  z-index: 5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  border-radius: 0px;
  border-width: 0px;
  background-color: #e9e9f0;
  text-align:left;
}
/* 開始だけ丸める（左端） */
.event-chip.is-span.is-start{
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

/* 終了だけ丸める（右端） */
.event-chip.is-span.is-end{
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* 開始かつ終了（span:1など）は両端丸める */
.event-chip.is-span.is-start.is-end{
  border-radius: 10px;
}

button.event-chip.is-span.is-night,
button.event-chip.is-span.is-night-1,
button.event-chip.is-span.is-night-2 {
	background: #88816E;
	color: #fff;
}
button.event-chip.is-span.is-day {
	background: #E98B2A;
	color: #fff;
}
button.event-chip.is-span.is-all {
	background: #303DAA;
	color: #fff;
}
.event-more{
  position: absolute;
  right: 0px;
  bottom: -58px;
  font-size: 10px;
  color: #555;
  cursor: pointer;
  z-index: 40;
}

.event-more:hover{
  text-decoration: underline;
}
.cct-modal__item span.event-title-text {
	font-size: 16px;
}
.cct-modal__body{
	overflow: hidden;
	flex: 1;
}

@media screen and (max-width: 781px){
	.event-chip.is-span{
		width: calc(var(--span) * 100% + (var(--span) - 1) * 6.5px);
	}
	
}

@media screen and (max-width: 500px){
	.event-chip.is-span{
		width: calc(var(--span) * 100% + (var(--span) - 1) * 7px);

	}
	.cct-schedule-calendar {
	margin-top: 28px!important;
	}
	

}


/* モーダル全体：画面からはみ出さない */
.cct-modal__dialog{
	max-height: calc(90vh -  env(safe-area-inset-bottom) );
	display: flex;
	flex-direction: column;
}

/* ヘッダーは固定、本文だけスクロール */
	.cct-modal__body{
	overflow: hidden;
	flex: 1;
}

/* 一覧が入るコンテンツ部分をスクロールさせる */
.cct-modal__content{
	overflow: auto;
	flex:1;
	max-height: 75vh; /* だいたい。見た目で微調整OK */
	padding-right: 8px;			/* スクロールバーで文字が隠れないように */
}
span.event-title-text {
	font-weight: bold;
}

td.calendar-day.today .date-number {
	background: #100cff;
	color: #fff;
	border-radius: 100%;
	width: 20px;
	height: 20px;

}

@media screen and (min-width: 769px) {
	td.calendar-day.today .date-number {
		width: 28px;
		height: 28px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}
}

@media ( max-width: 480px ) {
	td.calendar-day.today .date-number {
		text-align: center;
		margin: 0 auto;
	}
}