/* ==========================================================================
   DeckCMS Event Calendar Widget
   ========================================================================== */

.dcal-wrap {
	font-family: inherit;
	line-height: 1.4;
	position: relative;
}

/* Loading state */
.dcal-wrap.dcal-loading {
	pointer-events: none;
	opacity: 0.6;
}

/* View visibility — toggled by JS based on active breakpoint */
.dcal-view              { display: none; }
.dcal-view--active      { display: block; }
.dcal-list-item--hidden { display: none; }

/* --------------------------------------------------------------------------
   Calendar header (month/year + nav arrows)
   -------------------------------------------------------------------------- */

.dcal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background-color: #1e3a5f;
	color: #ffffff;
	padding: 12px 16px;
	border-radius: 6px 6px 0 0;
}

.dcal-month-label {
	font-size: 1.1rem;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.dcal-nav {
	background: none;
	border: none;
	color: inherit;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	padding: 2px 8px;
	border-radius: 4px;
	transition: background-color 0.15s;
}

.dcal-nav:hover {
	background-color: rgba(255, 255, 255, 0.15);
}

.dcal-nav:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

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

.dcal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	border: 1px solid #e5e7eb;
	border-top: none;
	border-radius: 0 0 6px 6px;
	overflow: hidden;
	background-color: #ffffff;
}

/* Day-of-week headers */
.dcal-day-label {
	background-color: #f3f4f6;
	color: #6b7280;
	font-size: 0.75rem;
	font-weight: 600;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 8px 4px;
	border-bottom: 1px solid #e5e7eb;
}

/* Day cells */
.dcal-day {
	min-height: 90px;
	padding: 4px 5px 6px;
	border-right: 1px solid #e5e7eb;
	border-bottom: 1px solid #e5e7eb;
	vertical-align: top;
	background-color: #ffffff;
	position: relative;
}

.dcal-day:nth-child(7n) {
	border-right: none;
}

.dcal-day--empty {
	background-color: #fafafa;
}

.dcal-day--today {
	background-color: #eff6ff;
}

.dcal-day-number {
	display: block;
	text-align: right;
	font-size: 0.8rem;
	color: #374151;
	font-weight: 500;
	margin-bottom: 4px;
	line-height: 1;
}

.dcal-day--empty .dcal-day-number {
	color: #d1d5db;
}

/* --------------------------------------------------------------------------
   Event tiles inside day cells
   -------------------------------------------------------------------------- */

.dcal-event-tile {
	display: block;
	background-color: #1e3a5f;
	color: #ffffff;
	font-size: 0.8125rem;
	line-height: 1.35;
	padding: 3px 6px;
	border-radius: 4px;
	margin-bottom: 3px;
	text-decoration: none;
	overflow: hidden;
	white-space: normal;
	word-break: break-word;
	cursor: pointer;
	transition: opacity 0.15s;
}

.dcal-event-tile:hover {
	opacity: 0.85;
	color: #ffffff;
	text-decoration: none;
}

.dcal-event-tile--members-only {
	opacity: 0.55;
}

.dcal-members-badge {
	margin-right: 3px;
	font-style: normal;
}

.dcal-overflow {
	display: block;
	font-size: 0.72rem;
	color: #6b7280;
	margin-top: 2px;
	padding-left: 2px;
}

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

.dcal-view--list .dcal-list-events {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.dcal-list-item {
	display: grid;
	grid-template-columns: 160px 1fr auto;
	grid-template-rows: auto auto;
	column-gap: 16px;
	align-items: start;
	padding: 14px 16px;
	background-color: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	text-decoration: none;
	color: inherit;
	transition: background-color 0.15s, box-shadow 0.15s;
}

.dcal-list-item:hover {
	background-color: #f9fafb;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
	text-decoration: none;
}

.dcal-list-item__date {
	font-size: 0.8125rem;
	color: #6b7280;
	grid-row: 1 / 3;
	padding-top: 2px;
}

.dcal-list-item__title {
	font-size: 0.9375rem;
	font-weight: 600;
	color: #111827;
	grid-column: 2;
	grid-row: 1;
}

.dcal-list-item__location {
	font-size: 0.8125rem;
	color: #6b7280;
	grid-column: 2;
	grid-row: 2;
	margin-top: 2px;
}

.dcal-list-item__price {
	font-size: 0.875rem;
	font-weight: 600;
	color: #1e3a5f;
	grid-column: 3;
	grid-row: 1 / 3;
	align-self: center;
	white-space: nowrap;
}

.dcal-no-events {
	color: #9ca3af;
	font-size: 0.9rem;
	text-align: center;
	padding: 24px 0;
}

/* Load More */
.dcal-load-more-wrap {
	text-align: center;
	margin-top: 16px;
}

.dcal-load-more {
	display: inline-block;
	padding: 10px 28px;
	background-color: #1e3a5f;
	color: #ffffff;
	border: none;
	border-radius: 5px;
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.15s;
}

.dcal-load-more:hover {
	background-color: #16305a;
}

/* --------------------------------------------------------------------------
   Error state
   -------------------------------------------------------------------------- */

.deckcms-error {
	padding: 12px 16px;
	background-color: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 6px;
	color: #dc2626;
	font-size: 0.875rem;
}

.deckcms-error--editor {
	border-style: dashed;
}

/* --------------------------------------------------------------------------
   Responsive — ≤768px: list-item grid reflow
   -------------------------------------------------------------------------- */

@media ( max-width: 768px ) {
	.dcal-list-item {
		grid-template-columns: 1fr auto;
		grid-template-rows: auto auto auto;
	}

	.dcal-list-item__date {
		grid-column: 1;
		grid-row: 1;
	}

	.dcal-list-item__title {
		grid-column: 1;
		grid-row: 2;
	}

	.dcal-list-item__location {
		grid-column: 1;
		grid-row: 3;
	}

	.dcal-list-item__price {
		grid-column: 2;
		grid-row: 1 / 4;
	}
}
