/*
 * WP Monthly Events — site styles (front end and block editor).
 *
 * Colours, spacing, borders and type sizes are set on each block in the
 * editor sidebar. This file only adds what blocks can't do themselves:
 * the block styles (Card, Note, Browser frame, Check list, Numbered steps,
 * Brand table), hover and focus states, and a few small details.
 */

/* Brand colours. WordPress normally outputs these from the editor palette;
   they are repeated here so the pages keep their colours with any theme. */
:root {
	--wpme-violet: #7120f3;
	--wpme-violet-dark: #4a13b8;
	--wpme-ink: #120b2e;
	--wpme-text: #2e2a45;
	--wpme-lilac: #f6f2ff;
	--wpme-line: #e6defa;
}

.has-wpme-violet-color { color: #7120f3 !important; }
.has-wpme-violet-dark-color { color: #4a13b8 !important; }
.has-wpme-ink-color { color: #120b2e !important; }
.has-wpme-text-color { color: #2e2a45 !important; }
.has-wpme-muted-color { color: #5b5675 !important; }
.has-wpme-on-dark-color { color: #d7ccff !important; }
.has-wpme-white-color { color: #fff !important; }
.has-wpme-violet-background-color { background-color: #7120f3 !important; }
.has-wpme-ink-background-color { background-color: #120b2e !important; }
.has-wpme-lilac-background-color { background-color: #f6f2ff !important; }
.has-wpme-white-background-color { background-color: #fff !important; }
.has-wpme-line-border-color { border-color: #e6defa !important; }
.has-wpme-hero-gradient-background { background: radial-gradient(70% 60% at 50% 0%, rgba(113, 32, 243, 0.45) 0%, rgba(18, 11, 46, 0) 70%), linear-gradient(180deg, #120b2e 0%, #1a1040 100%) !important; }
.has-wpme-cta-gradient-background { background: linear-gradient(135deg, #7120f3 0%, #4a13b8 100%) !important; }

/* Sections sit edge to edge, whatever spacing the theme adds between blocks. */
.entry-content > section.wp-block-group.alignfull,
.wp-block-post-content > section.wp-block-group.alignfull {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

section.wp-block-group > :first-child,
section.wp-block-group > .wp-block-group__inner-container > :first-child {
	margin-top: 0;
}

/* ---------- Block style: Card ---------- */

.is-style-wpme-card {
	height: 100%;
	box-sizing: border-box;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.is-style-wpme-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 18px 40px -22px rgba(42, 16, 110, 0.35);
}

:is(.is-style-wpme-card, .is-style-wpme-note) > :first-child,
:is(.is-style-wpme-card, .is-style-wpme-note) > .wp-block-group__inner-container > :first-child {
	margin-top: 0;
}

:is(.is-style-wpme-card, .is-style-wpme-note) > :last-child,
:is(.is-style-wpme-card, .is-style-wpme-note) > .wp-block-group__inner-container > :last-child {
	margin-bottom: 0;
}

/* ---------- Block style: Note (callout) ---------- */

.wp-block-group.is-style-wpme-note {
	margin-top: 1.75rem;
	margin-bottom: 1.75rem;
	padding: 1.25rem 1.5rem;
	border-left: 4px solid #7120f3;
	border-radius: 12px;
	background-color: #f6f2ff;
	color: #2e2a45;
}

/* ---------- Icon block ---------- */

.wp-block-icon svg {
	display: block;
	box-sizing: content-box;
}

/* ---------- Block style: Browser frame (images) ---------- */

.wp-block-image.is-style-wpme-browser {
	position: relative;
	overflow: hidden;
	padding-top: 34px;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 30px 70px -30px rgba(18, 11, 46, 0.45), 0 0 0 1px rgba(18, 11, 46, 0.08);
}

.wp-block-image.is-style-wpme-browser::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 34px;
	background:
		radial-gradient(circle at 18px 17px, #ff5f57 5px, transparent 6px),
		radial-gradient(circle at 36px 17px, #febc2e 5px, transparent 6px),
		radial-gradient(circle at 54px 17px, #28c840 5px, transparent 6px),
		#f3f0fa;
	border-bottom: 1px solid #e6defa;
}

.wp-block-image.is-style-wpme-browser img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 0;
}

.wp-block-image.is-style-wpme-browser figcaption {
	margin: 0;
	padding: 0.65rem 1rem;
	border-top: 1px solid #e6defa;
	background: #fbf9ff;
	color: #5b5675;
	font-size: 0.875rem;
	text-align: center;
}

.has-wpme-hero-gradient-background .wp-block-image.is-style-wpme-browser {
	box-shadow: 0 40px 100px -30px rgba(113, 32, 243, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* ---------- Block style: Check list ---------- */

.wp-block-list.is-style-wpme-checks {
	list-style: none;
	padding-left: 0;
}

.wp-block-list.is-style-wpme-checks > li {
	position: relative;
	margin-bottom: 0.65em;
	padding-left: 2em;
}

.wp-block-list.is-style-wpme-checks > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.2em;
	width: 1.25em;
	height: 1.25em;
	border-radius: 50%;
	background: #7120f3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 62% no-repeat;
}

/* ---------- Block style: Numbered steps ---------- */

ol.wp-block-list.is-style-wpme-steps {
	counter-reset: wpme-step;
	list-style: none;
	padding-left: 0;
}

ol.wp-block-list.is-style-wpme-steps > li {
	position: relative;
	min-height: 2.25rem;
	margin-bottom: 1.1rem;
	padding-left: 3.25rem;
	counter-increment: wpme-step;
}

ol.wp-block-list.is-style-wpme-steps > li::before {
	content: counter(wpme-step);
	position: absolute;
	left: 0;
	top: -0.2rem;
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: #7120f3;
	color: #fff;
	font-weight: 800;
	font-size: 0.95rem;
	line-height: 1;
}

/* ---------- Block style: Brand table ---------- */

.wp-block-table.is-style-wpme-table {
	overflow-x: auto;
	border: 1px solid #e6defa;
	border-radius: 14px;
}

.wp-block-table.is-style-wpme-table table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.wp-block-table.is-style-wpme-table :is(th, td) {
	padding: 0.8rem 1rem;
	border: 0;
	border-bottom: 1px solid #e6defa;
	text-align: left;
	vertical-align: top;
}

.wp-block-table.is-style-wpme-table thead th {
	border-bottom: 2px solid #e6defa;
	background: #f6f2ff;
	color: #120b2e;
	font-weight: 700;
}

.wp-block-table.is-style-wpme-table tbody tr:last-child td {
	border-bottom: 0;
}

.wp-block-table.is-style-wpme-table td:first-child {
	color: #120b2e;
	font-weight: 600;
}

/* ---------- Small details ---------- */

.wpme-pill {
	width: fit-content;
	margin-left: auto !important;
	margin-right: auto !important;
	padding: 0.45em 1em;
	border: 1px solid rgba(215, 204, 255, 0.3);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
}

.wpme-step-num {
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	margin: 0;
	border-radius: 50%;
	background: #7120f3;
	font-weight: 800;
	line-height: 1;
}

.wpme-shot-media .wp-block-media-text__media img {
	border: 1px solid rgba(18, 11, 46, 0.08);
	border-radius: 14px;
	box-shadow: 0 24px 60px -30px rgba(18, 11, 46, 0.4);
}

.wp-block-media-text.wpme-shot-media .wp-block-media-text__content {
	padding: 0 clamp(1.25rem, 4vw, 3rem);
}

@media (max-width: 600px) {
	.wp-block-media-text.wpme-shot-media .wp-block-media-text__content {
		padding: 1.5rem 0 0;
	}
}

/* Breadcrumbs inside page headers. */
.wpme-crumbs {
	font-size: 0.875rem;
}

.wpme-crumbs a {
	color: inherit;
	text-decoration: none;
}

.wpme-crumbs a:hover,
.wpme-crumbs a:focus-visible {
	text-decoration: underline;
}

/* Links: underlined in running text; "Explore…" links underline on hover. */
:is(.entry-content, .wp-block-post-content, .editor-styles-wrapper) :is(p, li, td) a:not(.wp-block-button__link) {
	text-decoration: underline;
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}

:is(.entry-content, .wp-block-post-content, .editor-styles-wrapper) p.wpme-more a {
	text-decoration: none;
}

:is(.entry-content, .wp-block-post-content, .editor-styles-wrapper) p.wpme-more a:hover,
:is(.entry-content, .wp-block-post-content, .editor-styles-wrapper) p.wpme-more a:focus-visible {
	text-decoration: underline;
}

/* Buttons */
.wp-block-button__link {
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.wp-block-button__link:hover {
	transform: translateY(-1px);
}

.has-wpme-violet-background-color.wp-block-button__link:hover {
	background-color: #4a13b8 !important;
}

.has-wpme-white-background-color.wp-block-button__link:hover {
	background-color: #f6f2ff !important;
}

.is-style-outline .wp-block-button__link.has-wpme-violet-color,
.is-style-outline .wp-block-button__link.has-wpme-white-color {
	border: 2px solid currentColor;
	background: transparent;
}

.is-style-outline .wp-block-button__link.has-wpme-violet-color:hover {
	background: rgba(113, 32, 243, 0.08);
}

.is-style-outline .wp-block-button__link.has-wpme-white-color:hover {
	background: rgba(255, 255, 255, 0.12);
}

/* Keyboard focus: always visible (WCAG 2.4.7), white on dark backgrounds. */
:is(.entry-content, .wp-block-post-content) :is(a, summary, button):focus-visible {
	outline: 3px solid #7120f3;
	outline-offset: 3px;
	border-radius: 4px;
}

:is(.has-wpme-hero-gradient-background, .has-wpme-cta-gradient-background, .has-wpme-ink-background-color) :is(a, summary, button):focus-visible {
	outline-color: #fff !important;
}

/* FAQ */
.wpme-faq {
	border-top: 1px solid #e6defa;
}

.wpme-faq .wp-block-details {
	margin: 0;
	padding: 1.15rem 0;
	border-bottom: 1px solid #e6defa;
}

.wpme-faq summary {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	list-style: none;
	cursor: pointer;
	color: #120b2e;
	font-size: 1.0625rem;
	font-weight: 700;
}

.wpme-faq summary::-webkit-details-marker {
	display: none;
}

.wpme-faq summary::after {
	content: "+";
	flex: none;
	color: #7120f3;
	font-size: 1.4em;
	line-height: 1;
}

.wpme-faq details[open] summary::after {
	content: "\2013";
}

.wpme-faq details > p {
	margin: 0.75rem 0 0;
}

/* Code */
.wp-block-code {
	position: relative;
	margin: 0.75rem 0 1.25rem;
	padding: 0.9rem 1rem;
	border: 0;
	border-radius: 10px;
	background: #17142b;
	color: #ecebff;
	font-size: 0.9rem;
	overflow-x: auto;
}

.wp-block-code code {
	background: none;
	color: inherit;
	/* Long lines wrap instead of scrolling sideways, so there is no hidden
	   content for keyboard users to reach (WCAG 2.1.1). */
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

:is(.entry-content, .wp-block-post-content, .editor-styles-wrapper) :not(pre) > code {
	padding: 0.1em 0.35em;
	border-radius: 5px;
	background: rgba(113, 32, 243, 0.09);
	color: inherit;
	font-size: 0.9em;
}

pre.wp-block-code.wpme-has-copy {
	padding-right: 4.75rem;
}

.wpme-copy {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	padding: 0.25rem 0.6rem;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 6px;
	background: transparent;
	color: #fff;
	font-size: 0.75rem;
	cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
	.is-style-wpme-card,
	.wp-block-button__link {
		transition: none;
	}

	.is-style-wpme-card:hover,
	.wp-block-button__link:hover {
		transform: none;
	}
}
