/**
 * TBDH Class Scheduler — Public styles (v1.2)
 * Modernized: soft shadows, clickable event chips, refined list view.
 */

.tbdh-public-wrap {
	max-width: 960px;
	margin: 0 auto;
	font-family: inherit;
	--tbdh-accent: #c0392b;
	--tbdh-border: #e6e8ec;
	--tbdh-muted: #6b7280;
}

.tbdh-cal-loading {
	padding: 48px 20px;
	text-align: center;
	color: var(--tbdh-muted);
}

/* --------------------------------------------------------- View toggle */

.tbdh-view-toggle {
	display: inline-flex;
	background: #f1f3f6;
	border-radius: 999px;
	padding: 4px;
	margin-bottom: 18px;
	gap: 2px;
}

.tbdh-toggle-btn {
	border: 0;
	background: transparent;
	border-radius: 999px;
	padding: 8px 22px;
	font-size: 14px;
	font-weight: 600;
	color: var(--tbdh-muted);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.tbdh-toggle-btn:hover { color: #1f2937; }

.tbdh-toggle-active {
	background: #fff;
	color: #1f2937;
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}

/* ------------------------------------------------------- Calendar grid */

.tbdh-pub-cal {
	background: #fff;
	border: 1px solid var(--tbdh-border);
	border-radius: 14px;
	box-shadow: 0 2px 8px rgba(16, 24, 40, 0.06);
	padding: 20px;
}

.tbdh-pub-cal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.tbdh-pub-cal-header h3 { margin: 0; font-size: 1.25em; }

.tbdh-pub-nav {
	background: #f6f7f9;
	border: 1px solid var(--tbdh-border);
	border-radius: 10px;
	width: 40px;
	height: 40px;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #374151;
	transition: background 0.15s ease;
}
.tbdh-pub-nav:hover { background: #eceef2; }

.tbdh-pub-dow-row, .tbdh-pub-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
}

.tbdh-pub-dow-row { gap: 4px; margin-bottom: 4px; }

.tbdh-pub-dow-cell {
	text-align: center;
	font-weight: 600;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.7px;
	color: var(--tbdh-muted);
	padding: 6px 0;
}

.tbdh-pub-grid { gap: 4px; }

.tbdh-pub-cell {
	min-height: 92px;
	border: 1px solid #eef0f3;
	border-radius: 10px;
	padding: 6px;
	background: #fcfcfd;
}

.tbdh-other-month { background: #f5f6f8; opacity: 0.55; }

.tbdh-today { border-color: var(--tbdh-accent); background: #fdf5f4; }
.tbdh-today .tbdh-pub-day-num { color: var(--tbdh-accent); font-weight: 700; }

.tbdh-pub-day-num {
	font-size: 12px;
	font-weight: 600;
	display: block;
	margin-bottom: 4px;
	color: #374151;
}

/* Chips — <span> normally, <a> when the event has a link */

.tbdh-pub-chip {
	display: block;
	border-radius: 7px;
	color: #fff;
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1.3;
	padding: 4px 8px;
	margin-bottom: 4px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.18);
	text-decoration: none;
	overflow: hidden;
}

a.tbdh-pub-chip {
	cursor: pointer;
	transition: filter 0.12s ease, transform 0.08s ease, box-shadow 0.12s ease;
}
a.tbdh-pub-chip:hover,
a.tbdh-pub-chip:focus {
	filter: brightness(1.14);
	transform: translateY(-1px);
	box-shadow: 0 3px 8px rgba(16, 24, 40, 0.25);
	color: #fff;
	text-decoration: none;
}

.tbdh-pub-linked::after {
	content: " \2197"; /* ↗ marks clickable events */
	font-size: 10px;
	opacity: 0.85;
}

.tbdh-pub-chip-time {
	display: block;
	font-weight: 400;
	font-size: 10.5px;
	opacity: 0.9;
}

.tbdh-replaced { outline: 2px dashed rgba(255, 255, 255, 0.85); outline-offset: -3px; }

.tbdh-pub-once { border-left: 4px solid rgba(255, 255, 255, 0.9); }

/* ----------------------------------------------------------- List view */

.tbdh-pub-list {
	background: #fff;
	border: 1px solid var(--tbdh-border);
	border-radius: 14px;
	box-shadow: 0 2px 8px rgba(16, 24, 40, 0.06);
	overflow: hidden;
}

.tbdh-pub-list-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--tbdh-border);
	background: #fafbfc;
}

.tbdh-pub-list-header h3 { margin: 0; font-size: 1.15em; }

.tbdh-pub-list-body { padding: 8px 20px 16px; }

.tbdh-pub-empty { color: var(--tbdh-muted); padding: 24px 0; text-align: center; }

.tbdh-pub-list-day { padding: 14px 0 4px; }

.tbdh-pub-list-day-heading {
	font-weight: 700;
	font-size: 13.5px;
	color: #1f2937;
	border-bottom: 1px solid #eef0f3;
	padding-bottom: 6px;
	margin-bottom: 8px;
}

.tbdh-pub-list-event {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 8px 4px;
	border-radius: 8px;
	transition: background 0.12s ease;
}
.tbdh-pub-list-event:hover { background: #f8f9fb; }

.tbdh-pub-list-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	margin-top: 5px;
	flex-shrink: 0;
}

.tbdh-pub-list-info { flex: 1; }

.tbdh-pub-list-title {
	margin: 0;
	font-weight: 600;
	font-size: 14.5px;
	color: #1f2937;
}

a.tbdh-pub-list-link {
	display: inline-block;
	text-decoration: none;
	color: #1f2937;
	border-bottom: 1px dashed #9ca3af;
	transition: color 0.12s ease, border-color 0.12s ease;
}
a.tbdh-pub-list-link:hover {
	color: var(--tbdh-accent);
	border-color: var(--tbdh-accent);
}

.tbdh-replaced-label::before {
	content: "Updated: ";
	font-weight: 400;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--tbdh-muted);
}

.tbdh-pub-list-meta {
	margin: 2px 0 0;
	font-size: 12.5px;
	color: var(--tbdh-muted);
}

.tbdh-pub-list-desc {
	margin: 4px 0 0;
	font-size: 13px;
	color: #4b5563;
	line-height: 1.45;
}

/* -------------------------------------------------------------- Legend */

.tbdh-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 18px;
	margin-top: 14px;
	padding: 12px 16px;
	background: #fafbfc;
	border: 1px solid var(--tbdh-border);
	border-radius: 10px;
}

.tbdh-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 12.5px;
	font-weight: 500;
	color: #374151;
}

.tbdh-legend-dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
}

/* ---------------------------------------------------------- Responsive */

@media (max-width: 640px) {
	.tbdh-pub-cell { min-height: 64px; padding: 4px; }
	.tbdh-pub-chip { font-size: 9.5px; padding: 3px 5px; }
	.tbdh-pub-chip-time { display: none; }
	.tbdh-pub-cal { padding: 12px; }
	.tbdh-pub-list-body { padding: 4px 14px 12px; }
}
