/*
 * Sugar Calendar Weekly – Styles
 * Used for both the Gutenberg editor preview and the public frontend.
 */

/* ------------------------------------------------------------------ */
/* Inspector sidebar – calendar picker                                 */
/* ------------------------------------------------------------------ */

.scwv-cal-row {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-bottom: 2px;
	/* paddingLeft is set inline per-row to express tree depth */
}

/* The CheckboxControl takes remaining width; swatch goes after it. */
.scwv-cal-row .components-checkbox-control {
	flex: 1;
	min-width: 0;
}

/* Override WordPress load-styles.css which adds 16px margin-bottom to every
   .components-base-control. That makes the calendar list extremely long. */
.scwv-cal-row .components-base-control {
	margin-bottom: 0 !important;
}

/* ▼ / ▶ expand-collapse button */
.scwv-toggle {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	font-size: 9px;
	line-height: 1;
	color: #555;
	flex-shrink: 0;
	width: 14px;
	text-align: center;
    transform: translateY(-4px);
}

.scwv-toggle:hover {
	color: #1e73be;
}

/* Invisible placeholder to keep leaf-row text aligned with parent-row text. */
.scwv-toggle-placeholder {
	display: inline-block;
	width: 14px;
	flex-shrink: 0;
}

.scwv-swatch {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 2px;
	border: 1px solid rgba(0,0,0,0.15);
	flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/* Block wrapper                                                        */
/* ------------------------------------------------------------------ */

/* Current block wrapper class */
.wp-block-sugar-calendar-weekly-week-calendar {
	font-family: inherit;
	box-sizing: border-box;
}

/* Legacy alias kept for any older saved blocks */
.wp-block-sc-week-view {
	font-family: inherit;
	box-sizing: border-box;
}

/* ------------------------------------------------------------------ */
/* Header (navigation bar)                                             */
/* ------------------------------------------------------------------ */

.scwv-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
	gap: 0px;
}

.scwv-week-label {
	font-weight: 600;
	font-size: 18px;
	line-height: 1;
	flex: 1;
}

.scwv-pdf-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 8px 16px;
	background: var(--theme-palette-color-12);
	color: var(--theme-palette-color-1);
	border: 1px solid var(--theme-palette-color-12);
	border-radius: 20px;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	margin-right: 6px;
	transition: background 0.15s ease;
	margin-right: 5px;
}

.scwv-pdf-btn svg {
	flex-shrink: 0;
}

.scwv-pdf-btn:hover,
.scwv-pdf-btn:focus {
	background: #fff;
}

.scwv-nav {
	padding: 0px;
	background: var(--theme-palette-color-3);
	color: #fff;
	border: none;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s ease;
	/* transform: translateY(54px); */
}

.scwv-nav svg {
	width: 12px;
	height: 12px;
	fill: currentColor;
}

.scwv-nav:hover,
.scwv-nav:focus {
	background: var(--theme-palette-color-2);
}
.scwv-nav.scwv-prev {
	border-top-left-radius: 20px;
	border-bottom-left-radius: 20px;
	padding: 8px 16px;
}
.scwv-nav.scwv-next {
	border-top-right-radius: 20px;
	border-bottom-right-radius: 20px;
	padding: 8px 16px;
}

/* ------------------------------------------------------------------ */
/* 7-column grid                                                        */
/* ------------------------------------------------------------------ */

.scwv-grid {
	display: grid;
	grid-template-columns: repeat( 7, minmax( 0, 1fr ) );
	gap: 0px;
	border: 1px solid var(--theme-palette-color-6);
	border-radius: 20px;
	background: #fff;
	padding-bottom: 80px;
}

/* Responsive: stack to 2 columns on small screens */
@media ( max-width: 640px ) {
	.scwv-grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}

/* ------------------------------------------------------------------ */
/* Day column                                                           */
/* ------------------------------------------------------------------ */

.scwv-col {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.scwv-col-header {
	display: flex;
	flex-direction: row;
	gap: 5px;
	justify-content: center;
	font-size: 18px;
	line-height: 1;
	font-weight: 600;
	text-transform: lowercase;
	padding: 20px 0px;
	border-bottom: 1px solid var(--theme-palette-color-6);
}
.scwv-day-label {

}
.scwv-day-date {

}

/* ------------------------------------------------------------------ */
/* Events list inside a column                                          */
/* ------------------------------------------------------------------ */

.scwv-events {
	display: flex;
	flex-direction: column;
	gap: 0px;
	padding: 5px 0px;
	flex: 1;
}

.scwv-no-events {
	color: var(--theme-palette-color-6);
	text-align: center;
	padding: 4px 0;
}

/* ------------------------------------------------------------------ */
/* Single event card                                                    */
/* ------------------------------------------------------------------ */

.scwv-event {
	border-left: 5px solid var(--theme-palette-color-3);
	padding: 10px;
	word-break: break-word;
	font-size: 14px;
	line-height: 1.2;
}

.scwv-event-title {
	display: block;
	font-weight: 600;
	color: var(--theme-palette-color-1);
	text-decoration: none;
}

.scwv-event-title:hover {
	text-decoration: underline;
}

a.scwv-event-title {
	color: var(--theme-palette-color-1);
}

.scwv-event-time {
	display: block;
	margin-top: 1px;
}

/* ------------------------------------------------------------------ */
/* Loading / error states                                               */
/* ------------------------------------------------------------------ */

.scwv-loading {
	display: flex;
	justify-content: center;
	padding: 24px;
	color: #888;
}

.scwv-error {
	padding: 12px;
	color: #c00;
	background: #fff0f0;
	border: 1px solid #f5c2c2;
	border-radius: 4px;
}

/* ------------------------------------------------------------------ */
/* Filter bar                                                           */
/* ------------------------------------------------------------------ */

.scwv-filter {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
  	background: var(--theme-palette-color-12);
  	padding: 6px 6px;
  	border-radius: 60px;
	margin-bottom: 20px;
}

.scwv-filter-btn {
	padding: 6px 16px;
	font-size: 16px;
  	font-weight: 600;
  	color: var(--theme-palette-color-1);
	cursor: pointer;
	border-radius: 50px;
	border: none;
	transition: background 0.15s;
	white-space: nowrap;
	background: none;
}

.scwv-filter-btn:hover {
	background: #fff;
}

.scwv-filter-btn.is-active {
	background-color: #fff;
}

/* The "Toon alles" button uses the WP blue as its colour swatch */
.scwv-filter-all {
	border-left-color: #1e73be;
}

.scwv-filter-all.is-active {
	background: #fff;
}

/* ------------------------------------------------------------------ */
/* Tag filter bar                                                       */
/* ------------------------------------------------------------------ */

.scwv-tag-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	align-items: center;
	margin-bottom: 20px;
}

.scwv-tag-btn {
	padding: 4px 10px;
	font-size: 13px;
	font-weight: 500;
	color: var(--theme-palette-color-1);
	cursor: pointer;
	border-radius: 50px;
	border: 1px solid var(--theme-palette-color-12);
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	white-space: nowrap;
	background: none;
}

.scwv-tag-btn:hover {
	background: var(--theme-palette-color-12);
	border-color: var(--theme-palette-color-12);
}

.scwv-tag-btn.is-active {
	background-color: var(--theme-palette-color-12);
	border-color: var(--theme-palette-color-12);
	color: var(--theme-palette-color-1);
}

/* Color indicator dot shown inside tag buttons when a color is assigned. */
.scwv-tag-color-dot {
	display: inline-block;
	width: 15px;
	height: 15px;
	border-radius: 50%;
	margin-right: 5px;
	vertical-align: middle;
	flex-shrink: 0;
	box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
	border: 2px solid #fff;
	margin-top: -2px;
}

/* ------------------------------------------------------------------ */
/* Loading spinner (CSS-only, frontend only)                           */
/* ------------------------------------------------------------------ */

.scwv-spinner {
	display: inline-block;
	width: 24px;
	height: 24px;
	border: 3px solid #e0e0e0;
	border-top-color: #1e73be;
	border-radius: 50%;
	animation: scwv-spin 0.7s linear infinite;
}

@keyframes scwv-spin {
	to { transform: rotate( 360deg ); }
}


@media (max-width: 999.98px) {

}
@media (max-width: 689.98px) {
	.scwv-grid {
		grid-template-columns: 1fr;
	}
	.scwv-col-header {
		border-bottom: none;
		border-top: 1px solid var(--theme-palette-color-6);
		justify-content: left;
		padding: 20px 15px;
	}
	.scwv-col:first-child .scwv-col-header {
		border-top: none;
	}
	.scwv-filter {
		display: flex;
		flex-wrap: wrap;
		gap: 6px;
		align-items: center;
		background: none;
		padding: 0;
		border-radius: 0;
	}
	.scwv-filter-btn {
		padding: 4px 8px;
		font-size: 12px;
		color: var(--theme-palette-color-1);
		border-radius: 50px;
		background: var(--theme-palette-color-12);
	}
	.scwv-filter-btn:hover,
	.scwv-filter-btn.is-active,
	.scwv-filter-all.is-active {
		color: #fff;
		background: var(--theme-palette-color-2);
	}
	.scwv-tag-filter {
		margin-bottom: 10px;
	}
	.scwv-tag-btn {
		padding: 3px 10px;
		font-size: 12px;
	}
	.scwv-pdf-btn {
		padding: 5px 10px;
		font-size: 12px;
	}
}