/*
 * SDAweb Calendar Sync — Upcoming view.
 *
 * Compact vertical event list designed for sidebars and widgets. Sits on
 * ANY background (light, dark, branded). Uses currentColor and transparent
 * backgrounds so the surrounding theme's text and background cascade
 * through. The single brand-color use is the date column accent (weekday
 * + month abbreviations) — the day-of-month number itself uses inherited
 * text color so the most prominent glyph stays readable.
 *
 * Specificity strategy: every theme-vulnerable rule is scoped under
 * `.sdaweb-gcal.sdaweb-gcal--upcoming` (0-3-0). The wrapper carries both
 * classes, so doubling them is a valid CSS technique that wins against
 * common theme compound selectors like `.footer .widget a` (0-2-1) or
 * `aside.widget_block a` (0-2-1) without resorting to !important.
 *
 * Borders use `rgba(128,128,128,…)` rather than `currentColor` because
 * `currentColor` cannot accept opacity directly without `color-mix()`,
 * which breaks on Safari < 15.4.
 *
 * Acknowledged limitations (not solvable at CSS level):
 *   - brand event-color colliding with surrounding background (user-side
 *     color choice problem, document in help text)
 *   - busy image/pattern backgrounds may obscure thin neutral borders
 *   - themes that use `!important` on link styling defeat any non-important
 *     plugin rule by design
 */

.sdaweb-gcal--upcoming {
	background: transparent;
	color: inherit;
	font-size: 14px;
	line-height: 1.4;
}

.sdaweb-gcal.sdaweb-gcal--upcoming .sdaweb-gcal-upcoming__title {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
	padding-bottom: 8px;
	margin-bottom: 4px;
	border-bottom: 1px solid rgba( 128, 128, 128, 0.2 );
	font-size: 15px;
	font-weight: 500;
}

.sdaweb-gcal.sdaweb-gcal--upcoming .sdaweb-gcal-upcoming__link {
	font-size: 13px;
	font-weight: 400;
	text-decoration: none;
	color: var( --sdaweb-gcal-event-color, var( --sdaweb-gcal-color-primary, currentColor ) );
	flex-shrink: 0;
}

.sdaweb-gcal.sdaweb-gcal--upcoming .sdaweb-gcal-upcoming__link:hover,
.sdaweb-gcal.sdaweb-gcal--upcoming .sdaweb-gcal-upcoming__link:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.sdaweb-gcal.sdaweb-gcal--upcoming .sdaweb-gcal-upcoming__list,
.sdaweb-gcal.sdaweb-gcal--upcoming li.sdaweb-gcal-upcoming__row {
	list-style: none;
	padding-left: 0;
	margin-left: 0;
	margin-block: 0;
}

.sdaweb-gcal.sdaweb-gcal--upcoming .sdaweb-gcal-upcoming__row {
	display: flex;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid;
	border-bottom-color: rgba( 128, 128, 128, 0.18 );
}

.sdaweb-gcal.sdaweb-gcal--upcoming .sdaweb-gcal-upcoming__row:last-child {
	border-bottom: 0;
}

.sdaweb-gcal.sdaweb-gcal--upcoming .sdaweb-gcal-upcoming__date {
	flex: 0 0 44px;
	text-align: center;
	line-height: 1.1;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var( --sdaweb-gcal-event-color, var( --sdaweb-gcal-color-primary ) );
	font-weight: 500;
	padding-top: 1px;
}

.sdaweb-gcal.sdaweb-gcal--upcoming .sdaweb-gcal-upcoming__date-weekday,
.sdaweb-gcal.sdaweb-gcal--upcoming .sdaweb-gcal-upcoming__date-month {
	display: block;
}

/*
 * Day-of-month number uses inherited text color, not the brand accent —
 * it's the most prominent glyph in the row and needs to read cleanly
 * against any background.
 */
.sdaweb-gcal.sdaweb-gcal--upcoming .sdaweb-gcal-upcoming__date-day {
	display: block;
	font-size: 22px;
	font-weight: 500;
	color: inherit;
	margin: 1px 0 1px;
	line-height: 1;
}

.sdaweb-gcal.sdaweb-gcal--upcoming .sdaweb-gcal-upcoming__content {
	flex: 1;
	min-width: 0;
}

.sdaweb-gcal.sdaweb-gcal--upcoming .sdaweb-gcal-upcoming__name {
	color: inherit;
	text-decoration: none;
	font-size: 13px;
	line-height: 1.35;
	display: block;
	word-wrap: break-word;
}

.sdaweb-gcal.sdaweb-gcal--upcoming a.sdaweb-gcal-upcoming__name:hover,
.sdaweb-gcal.sdaweb-gcal--upcoming a.sdaweb-gcal-upcoming__name:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
	color: inherit;
}

.sdaweb-gcal.sdaweb-gcal--upcoming .sdaweb-gcal-upcoming__meta {
	margin-top: 2px;
	font-size: 11px;
	color: inherit;
	opacity: 0.7;
}

.sdaweb-gcal.sdaweb-gcal--upcoming .sdaweb-gcal-upcoming__empty {
	padding: 12px 0;
	margin: 0;
	color: inherit;
	opacity: 0.7;
	font-size: 13px;
	text-align: center;
}
