/*
 * Readora block styles and pattern styles.
 * Loaded on the front end and in the block editor. Colors come from the theme
 * tokens, so every box follows the accent color and light/dark mode.
 *
 * 1. Boxes (group styles)
 * 2. Lists
 * 3. Section label (heading style)
 * 4. Pattern details
 */

/* 1. Boxes -------------------------------------------------------------- */
.is-style-readora-note,
.is-style-readora-tip,
.is-style-readora-warning {
	--readora-box: var(--readora-accent, #2563eb);
	margin-block: 1.75em;
	padding: 1.25rem 1.5rem;
	border-inline-start: 4px solid var(--readora-box);
	border-radius: var(--readora-radius, 10px);
	background: color-mix(in srgb, var(--readora-box) 9%, var(--readora-bg, #fff));
}

.is-style-readora-tip {
	--readora-box: #16a34a;
}

.is-style-readora-warning {
	--readora-box: #d97706;
}

.is-style-readora-card {
	margin-block: 1.75em;
	padding: 1.5rem;
	border: 1px solid var(--readora-border, #e4e7eb);
	border-radius: var(--readora-radius, 10px);
	background: var(--readora-bg, #fff);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

:is(.is-style-readora-note, .is-style-readora-tip, .is-style-readora-warning, .is-style-readora-card) > :first-child {
	margin-top: 0;
}

:is(.is-style-readora-note, .is-style-readora-tip, .is-style-readora-warning, .is-style-readora-card) > :last-child {
	margin-bottom: 0;
}

/* Columns inside a box: no extra space above the first or below the last block. */
:is(.is-style-readora-note, .is-style-readora-tip, .is-style-readora-warning, .is-style-readora-card) .wp-block-columns {
	margin-block: 0;
}

:is(.is-style-readora-note, .is-style-readora-tip, .is-style-readora-warning, .is-style-readora-card) .wp-block-column > :first-child {
	margin-top: 0;
}

:is(.is-style-readora-note, .is-style-readora-tip, .is-style-readora-warning, .is-style-readora-card) .wp-block-column > :last-child {
	margin-bottom: 0;
}

/* Small title line at the top of a box. */
.readora-box-title {
	margin: 0 0 0.5rem;
	color: var(--readora-box, var(--readora-accent, #2563eb));
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* 2. Lists -------------------------------------------------------------- */
ul.is-style-readora-check,
ul.is-style-readora-cross,
ol.is-style-readora-steps {
	list-style: none;
	padding-inline-start: 0;
}

.is-style-readora-check > li,
.is-style-readora-cross > li {
	position: relative;
	margin-bottom: 0.5em;
	padding-inline-start: 2em;
}

.is-style-readora-check > li::before,
.is-style-readora-cross > li::before {
	position: absolute;
	inset-inline-start: 0;
	top: 0.2em;
	display: grid;
	place-items: center;
	width: 1.3em;
	height: 1.3em;
	border-radius: 50%;
	color: #fff;
	font-size: 0.8em;
	font-weight: 800;
	line-height: 1;
}

.is-style-readora-check > li::before {
	content: "\2713";
	background: #16a34a;
}

.is-style-readora-cross > li::before {
	content: "\2715";
	background: #dc2626;
}

ol.is-style-readora-steps {
	counter-reset: readora-step;
}

.is-style-readora-steps > li {
	position: relative;
	counter-increment: readora-step;
	min-height: 2.2em;
	margin-bottom: 1.1em;
	padding-inline-start: 3em;
}

.is-style-readora-steps > li::before {
	content: counter(readora-step);
	position: absolute;
	inset-inline-start: 0;
	top: 0;
	display: grid;
	place-items: center;
	width: 2em;
	height: 2em;
	border-radius: 50%;
	background: var(--readora-accent, #2563eb);
	color: #fff;
	font-weight: 800;
	line-height: 1;
}

/* 3. Section label ------------------------------------------------------ */
.wp-block-heading.is-style-readora-section {
	padding-bottom: 0.55rem;
	border-bottom: 1px solid var(--readora-border, #e4e7eb);
	font-family: var(--readora-font, sans-serif);
	font-size: 0.95rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	background: linear-gradient(var(--readora-accent, #2563eb), var(--readora-accent, #2563eb)) no-repeat left bottom / 3.5rem 3px;
}

[dir="rtl"] .wp-block-heading.is-style-readora-section,
.rtl .wp-block-heading.is-style-readora-section {
	background-position: right bottom;
}

/* 4. Pattern details ---------------------------------------------------- */

/* Review verdict: star rating line. */
.readora-rating {
	margin: 0 0 0.5rem;
	color: #f59e0b;
	font-size: 1.35rem;
	letter-spacing: 0.08em;
}

.readora-rating strong {
	margin-inline-start: 0.5rem;
	color: var(--readora-text, #1f2933);
	font-size: 1rem;
	letter-spacing: 0;
}

/* Recipe card: prep / cook / serves row. */
.readora-recipe-meta {
	gap: 1rem;
	margin-block: 1rem 1.5rem;
	padding-block: 0.9rem;
	border-block: 1px solid var(--readora-border, #e4e7eb);
}

.readora-recipe-meta p {
	margin: 0;
	font-size: 0.95rem;
}

.readora-recipe-meta strong {
	display: block;
	color: var(--readora-muted, #616e7c);
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* Newsletter / call to action. */
.readora-cta {
	margin-block: 2em;
	padding: 2rem 1.75rem;
	border-radius: var(--readora-radius, 10px);
	background: linear-gradient(135deg, var(--readora-accent, #2563eb), color-mix(in srgb, var(--readora-accent, #2563eb) 55%, #000));
	color: #fff;
	text-align: center;
}

.readora-cta :is(h2, h3, p) {
	color: #fff;
}

.readora-cta > :first-child {
	margin-top: 0;
}

.readora-cta .wp-block-buttons {
	justify-content: center;
}

.readora-cta .wp-block-button__link {
	background: #fff;
	color: var(--readora-accent, #2563eb);
	font-weight: 700;
}

/* Buttons in general follow the accent color. */
.wp-block-button__link {
	border-radius: 999px;
	background: var(--readora-accent, #2563eb);
	color: #fff;
	padding: 0.7em 1.5em;
	text-decoration: none;
}

.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--readora-accent, #2563eb);
}

/* FAQ: question rows. */
.wp-block-details {
	padding-block: 0.9rem;
	border-bottom: 1px solid var(--readora-border, #e4e7eb);
}

.wp-block-details summary {
	cursor: pointer;
	font-weight: 700;
}

.wp-block-details[open] summary {
	margin-bottom: 0.5rem;
}

.wp-block-details > :not(summary) {
	margin-block: 0.5rem 0;
	color: var(--readora-muted, #616e7c);
}

/* Stats row on the About page. */
.readora-stats {
	text-align: center;
}

.readora-stat {
	margin: 0;
	color: var(--readora-accent, #2563eb);
	font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
	font-weight: 800;
	line-height: 1.1;
}

.readora-stats p:not(.readora-stat) {
	margin-top: 0.25rem;
	color: var(--readora-muted, #616e7c);
}

/* Lead paragraph at the top of a page or post. */
.readora-lead {
	color: var(--readora-muted, #616e7c);
	font-size: 1.3rem;
	line-height: 1.6;
}

/* Tables: stripes and borders follow the theme colors (readable in dark mode). */
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background: var(--readora-surface, #f5f7fa);
}

.wp-block-table.is-style-stripes {
	border-bottom-color: var(--readora-border, #e4e7eb);
}

.wp-block-table thead {
	border-bottom-color: var(--readora-text, #1f2933);
}

.wp-block-table th {
	text-align: start;
}
