/* Race Registration – Kappingarskrá
 * Designed to blend into the Soledad theme on athletics.fo:
 * headings use the theme heading font (Raleway), body text inherits the
 * theme body font, and the accent colour falls back to the theme accent
 * variable (--pcaccent-cl) before the plugin default. */

.rrcal {
	--rrcal-accent-final: var(--rrcal-accent, var(--pcaccent-cl, #6eb48c));
	--rrcal-border: var(--pcborder-cl, #dedede);
	--rrcal-heading: var(--pcheading-cl, #313131);
	--rrcal-meta: var(--pcmeta-cl, #888888);
	margin: 0 0 2em;
}

.rrcal * {
	box-sizing: border-box;
}

/* Defensive resets: the calendar may land inside arbitrary theme/builder
 * containers (entry content, pre/code blocks, narrow columns). Make the
 * layout-critical rules immune to inherited or elementwise theme styles. */
.rrcal,
.rrcal .rrcal-list,
.rrcal .rrcal-item {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	white-space: normal !important;
	font-family: var(--pcbody-font, inherit);
}

/* Optional list heading ([race_calendar title="…"]) */
.rrcal-heading {
	margin: 0 0 0.6em !important;
	font-family: var(--pchead-font, 'Raleway', sans-serif);
	font-size: 26px;
	font-weight: 900;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--rrcal-heading);
}

/* Month heading */
.rrcal-month {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 2.2em 0 0.9em;
	font-family: var(--pchead-font, 'Raleway', sans-serif);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--rrcal-heading);
}

.rrcal-month:first-child {
	margin-top: 0;
}

.rrcal-month::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--rrcal-border);
}

.rrcal .rrcal-month span {
	background: transparent !important;
	padding: 0 !important;
	font: inherit !important;
	color: inherit !important;
}

/* Month grid: vertical cards side by side */
.rrcal .rrcal-list {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
	gap: 18px;
}

/* Event card (vertical) */
.rrcal .rrcal-item {
	display: flex !important;
	flex-direction: column;
	background: var(--pcbg-cl, #fff);
	border: 1px solid var(--rrcal-border);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.rrcal .rrcal-item:hover {
	box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
	transform: translateY(-2px);
}

/* Image / logo area */
.rrcal-media {
	position: relative;
	display: block;
	width: 100%;
	height: 150px;
	flex: 0 0 auto;
	background: #f2f4f3;
	overflow: hidden;
}

.rrcal-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	margin: 0;
	transition: transform 0.25s ease;
}

.rrcal-item:hover .rrcal-media img {
	transform: scale(1.03);
}

.rrcal-media-fallback {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--pchead-font, 'Raleway', sans-serif);
	font-size: 44px;
	font-weight: 900;
	color: #fff;
	background: var(--rrcal-accent-final);
	background: linear-gradient(135deg, var(--rrcal-accent-final), color-mix(in srgb, var(--rrcal-accent-final) 55%, #1f2937));
}

.rrcal-cat {
	position: absolute;
	top: 10px;
	right: 10px;
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-family: var(--pchead-font, 'Raleway', sans-serif);
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	backdrop-filter: blur(2px);
}

/* Date tile overlapping the image bottom-left */
.rrcal-date {
	position: absolute;
	left: 12px;
	bottom: 10px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0;
	min-width: 52px;
	padding: 6px 8px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.94);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.22);
	text-decoration: none;
	backdrop-filter: blur(2px);
}

.rrcal-date-wd,
.rrcal-date-mon {
	font-family: var(--pchead-font, 'Raleway', sans-serif);
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	line-height: 1.4;
	color: var(--rrcal-accent-final);
}

.rrcal-date-day {
	font-family: var(--pchead-font, 'Raleway', sans-serif);
	font-size: 24px;
	font-weight: 900;
	line-height: 1.05;
	color: var(--rrcal-heading);
}

/* Text body */
.rrcal-body {
	flex: 1 1 auto;
	min-width: 0;
	padding: 14px 16px 10px;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.rrcal-title {
	margin: 0 !important;
	padding: 0;
	font-family: var(--pchead-font, 'Raleway', sans-serif);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.rrcal-title a {
	color: var(--rrcal-heading);
	text-decoration: none;
	transition: color 0.15s ease;
}

.rrcal-title a:hover {
	color: var(--rrcal-accent-final);
}

.rrcal-meta {
	margin: 0 !important;
	font-size: 13px;
	line-height: 1.5;
	color: var(--rrcal-meta);
}

.rrcal-meta--date {
	font-weight: 600;
	color: var(--rrcal-heading);
	opacity: 0.75;
}

.rrcal-deadline {
	margin: 0 !important;
	font-size: 12px;
	font-style: italic;
	color: var(--rrcal-meta);
}

.rrcal-source {
	margin-top: 5px;
	font-family: var(--pchead-font, 'Raleway', sans-serif);
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: #a8a8a8;
	color: color-mix(in srgb, var(--rrcal-meta) 75%, #fff);
}

/* Register button + participant bubble */
.rrcal-actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	padding: 4px 16px 16px;
	flex: 0 0 auto;
}

.rrcal-actions .rrcal-btn {
	text-align: center;
}

.rrcal-actions .rrcal-cbtnwrap {
	display: flex;
}

.rrcal-actions .rrcal-cbtnwrap .rrcal-btn {
	flex: 1 1 auto;
}

.rrcal-btn {
	display: inline-block;
	padding: 10px 22px;
	border-radius: 999px;
	background: var(--rrcal-accent-final);
	color: #fff !important;
	font-family: var(--pchead-font, 'Raleway', sans-serif);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	text-decoration: none !important;
	white-space: nowrap;
	transition: filter 0.15s ease, box-shadow 0.15s ease;
	box-shadow: 0 6px 16px rgba(110, 180, 140, 0.35);
	box-shadow: 0 6px 16px color-mix(in srgb, var(--rrcal-accent-final) 35%, transparent);
}

.rrcal-btn:hover {
	filter: brightness(0.92);
}

.rrcal-btn--ghost {
	background: transparent;
	color: var(--rrcal-accent-final) !important;
	border: 1.5px solid var(--rrcal-accent-final);
	box-shadow: none;
}

.rrcal-empty {
	padding: 24px;
	border: 1px dashed var(--rrcal-border);
	border-radius: 12px;
	text-align: center;
	color: var(--rrcal-meta);
}

/* Compact sidebar list ([race_calendar style="compact"] / widget) */
.rrcal--compact {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.rrcal--compact .rrcal-citem {
	display: flex !important;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px 10px;
	background: var(--pcbg-cl, #fff);
	border: 1px solid var(--rrcal-border);
	border-radius: 10px;
	box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.rrcal--compact .rrcal-citem:hover {
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
	transform: translateY(-1px);
}

.rrcal-cdate {
	flex: 0 0 44px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1px;
	padding: 6px 4px;
	border-radius: 8px;
	background: #f1f7f3;
	background: color-mix(in srgb, var(--rrcal-accent-final) 10%, #ffffff);
	text-decoration: none !important;
}

.rrcal-cday {
	font-family: var(--pchead-font, 'Raleway', sans-serif);
	font-size: 19px;
	font-weight: 900;
	line-height: 1;
	color: var(--rrcal-heading);
}

.rrcal-cmon {
	font-family: var(--pchead-font, 'Raleway', sans-serif);
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--rrcal-accent-final);
}

.rrcal-cbody {
	flex: 1 1 auto;
	min-width: 0;
}

.rrcal-ctitle {
	display: block;
	font-family: var(--pchead-font, 'Raleway', sans-serif);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--rrcal-heading) !important;
	text-decoration: none !important;
	transition: color 0.15s ease;
}

.rrcal-ctitle:hover {
	color: var(--rrcal-accent-final) !important;
}

.rrcal-cmeta {
	display: block;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: 11px;
	line-height: 1.5;
	color: var(--rrcal-meta);
}

.rrcal-cbtnwrap {
	position: relative;
	flex: 0 0 auto;
	display: inline-flex;
}

/* Participant count bubble on the Skráset button — the button itself keeps
 * a constant size no matter how large the number gets. */
.rrcal-cbadge {
	position: absolute;
	top: -12px;
	right: -8px;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 999px;
	background: #fff;
	border: 1.5px solid var(--rrcal-accent-final);
	color: var(--rrcal-accent-final) !important;
	font-family: var(--pchead-font, 'Raleway', sans-serif);
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
	text-decoration: none !important;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
	transition: filter 0.15s ease;
}

.rrcal-cbadge:hover {
	filter: brightness(0.9);
}

.rrcal-cbtn {
	flex: 0 0 auto;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--rrcal-accent-final);
	color: #fff !important;
	font-family: var(--pchead-font, 'Raleway', sans-serif);
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	text-decoration: none !important;
	white-space: nowrap;
	transition: filter 0.15s ease;
}

.rrcal-cbtn:hover {
	filter: brightness(0.92);
}
