/* Рядок «Сьогодні» (руна дня, популярні імена, Місяць) — на головній і в сайдбарі статей.
   Тут же спільні токени для всіх секцій головної. */

.merkury-featured,
.merkury-random,
.merkury-today,
.merkury-cat,
.merkury-finance,
.merkury-author,
.merkury-related,
.merkury-places,
.merkury-places-widgets {
	--mf-radius: 12px;
	/* Бейдж усередині картки концентричний: 4px (його радіус) + 8px відступу = 12px */
	--mf-inset: 8px;
	--mf-shadow-border: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06), 0 2px 4px 0 rgba(0, 0, 0, 0.04);
	--mf-shadow-border-hover: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08), 0 2px 4px 0 rgba(0, 0, 0, 0.06);
	--mf-image-outline: rgba(0, 0, 0, 0.1);
}

.dark-theme .merkury-featured,
.dark-theme .merkury-random,
.dark-theme .merkury-today,
.dark-theme .merkury-cat,
.dark-theme .merkury-finance,
.dark-theme .merkury-author,
.dark-theme .merkury-related {
	--mf-shadow-border: 0 0 0 1px rgba(255, 255, 255, 0.08);
	--mf-shadow-border-hover: 0 0 0 1px rgba(255, 255, 255, 0.13);
	--mf-image-outline: rgba(255, 255, 255, 0.1);
}

.merkury-today {
	--mt-pad: 20px;
	--mt-accent-soft: #f4a6d7;
	margin-block: 8px 40px;
}

.mt-grid {
	display: grid;
	gap: 24px;
}

@media (min-width: 600px) {
	.mt-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mt-grid > :last-child:nth-child(odd) {
		grid-column: 1 / -1;
	}
}

@media (min-width: 1024px) {
	.mt-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.mt-grid > :last-child:nth-child(odd) {
		grid-column: auto;
	}
}

/* У сайдбарі статті колонки залежать від ширини самого блоку, а не екрана:
   у вузькому сайдбарі — одна, коли сайдбар опускається під статтю — дві-три. */
.merkury-today--sidebar {
	container-type: inline-size;
	margin-block: 0 30px;
}

.merkury-today--sidebar .ascendoor-wrapper {
	padding: 0;
}

.merkury-today--sidebar .mt-grid {
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
}

.merkury-today--sidebar .mt-grid > :last-child:nth-child(odd) {
	grid-column: auto;
}

@container (min-width: 600px) {
	.merkury-today--sidebar .mt-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.merkury-today--sidebar .mt-grid > :last-child:nth-child(odd) {
		grid-column: 1 / -1;
	}
}

@container (min-width: 900px) {
	.merkury-today--sidebar .mt-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.merkury-today--sidebar .mt-grid > :last-child:nth-child(odd) {
		grid-column: auto;
	}
}

.mt-card {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
	padding: var(--mt-pad);
	border-radius: var(--mf-radius);
	background-color: var(--clr-background);
	box-shadow: var(--mf-shadow-border);
}

.mt-card__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.mt-label {
	margin: 0;
	font-size: var(--font-size-xs);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--theme-color);
}

.mt-date {
	font-size: var(--font-size-xs);
	color: var(--text-color-light);
}

.mt-text {
	margin: 0;
	font-size: var(--font-size-sm);
	line-height: 1.5;
	color: var(--text-color-normal);
	text-wrap: pretty;
}

/* Посилання внизу картки: зона натискання 44px, візуальний відступ компенсуємо */
.mt-more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	align-self: flex-start;
	min-height: 44px;
	margin-block: auto -10px;
	font-size: var(--font-size-sm);
	font-weight: 600;
	text-decoration: none;
	color: var(--theme-color);
	transition: color 150ms ease-out;
}

.mt-more:hover,
.mt-more:focus {
	color: var(--clr-foreground);
}

/* Руна дня */

.mt-rune {
	color: rgba(255, 255, 255, 0.92);
	background-color: var(--text-color-dark);
	background-image: radial-gradient(120% 80% at 100% 0%, rgba(186, 26, 132, 0.45), transparent 60%);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.mt-rune .mt-label,
.mt-rune .mt-more {
	color: var(--mt-accent-soft);
}

.mt-rune .mt-more:hover,
.mt-rune .mt-more:focus {
	color: var(--white);
}

.mt-rune .mt-date {
	color: rgba(255, 255, 255, 0.6);
}

.mt-rune .mt-text {
	color: rgba(255, 255, 255, 0.8);
}

.mt-rune__body {
	display: flex;
	align-items: center;
	gap: 16px;
}

.mt-rune__glyph {
	flex-shrink: 0;
	display: grid;
	place-items: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.06);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.mt-rune__glyph svg {
	width: 26px;
	height: 39px;
	fill: none;
	stroke: var(--white);
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.mt-rune__name {
	margin: 0;
	font-size: var(--font-size-md);
	font-weight: 700;
	line-height: 1.2;
	color: var(--white);
}

.mt-rune__name a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: rgba(255, 255, 255, 0.35);
	text-underline-offset: 4px;
	transition: text-decoration-color 150ms ease-out;
}

.mt-rune__name a:hover,
.mt-rune__name a:focus {
	text-decoration-color: currentColor;
}

.mt-rune__meta {
	margin: 2px 0 0;
	font-size: var(--font-size-xs);
	color: rgba(255, 255, 255, 0.6);
}

.mt-rune__keywords {
	margin: 6px 0 0;
	font-size: var(--font-size-sm);
	font-weight: 600;
	color: var(--mt-accent-soft);
}

.mt-advice {
	margin: 0;
	padding-top: 12px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	font-size: var(--font-size-sm);
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.8);
	text-wrap: pretty;
}

.mt-advice strong {
	color: var(--white);
}

/* Популярні імена */

.mt-names {
	background-image: linear-gradient(160deg, rgba(186, 26, 132, 0.06), transparent 55%);
}

.mt-names::before {
	content: "";
	position: absolute;
	z-index: -1;
	top: -64px;
	inset-inline-end: -56px;
	width: 168px;
	aspect-ratio: 1;
	border-radius: 50%;
	background-color: rgba(186, 26, 132, 0.07);
}

.mt-sub {
	margin: -6px 0 0;
	font-size: var(--font-size-sm);
	color: var(--text-color-light);
}

.mt-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 4px 0 0;
	padding: 0;
	list-style: none;
}

.mt-chip {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 16px;
	border-radius: 999px;
	font-size: var(--font-size-sm);
	font-weight: 600;
	text-decoration: none;
	color: var(--clr-foreground);
	background-color: var(--clr-background);
	box-shadow: var(--mf-shadow-border);
	transition-property: color, background-color, box-shadow, scale;
	transition-duration: 150ms;
	transition-timing-function: ease-out;
}

.mt-chip:hover,
.mt-chip:focus-visible {
	color: var(--theme-color);
	box-shadow: var(--mf-shadow-border-hover);
}

.mt-chip:active {
	scale: 0.96;
}

/* Найпопулярніше ім'я виділене кольором сайту */
.mt-chips li:first-child .mt-chip {
	color: var(--white);
	background-color: var(--theme-color);
	box-shadow: none;
}

.mt-chips li:first-child .mt-chip:hover,
.mt-chips li:first-child .mt-chip:focus-visible {
	color: var(--white);
	background-color: var(--text-color-dark);
}

/* Місяць сьогодні */

.mt-moon {
	background-image: linear-gradient(180deg, rgba(26, 32, 43, 0.04), transparent 50%);
}

.mt-moon__body {
	display: flex;
	align-items: center;
	gap: 16px;
}

.mt-moon__disc {
	flex-shrink: 0;
	width: 72px;
	height: 72px;
}

.mt-moon__shadow {
	fill: #2b3140;
}

.mt-moon__light {
	fill: #f3ecd6;
}

.mt-moon__name {
	margin: 0;
	font-size: var(--font-size-md);
	font-weight: 700;
	line-height: 1.2;
	color: var(--clr-foreground);
}

.mt-moon__meta {
	margin: 4px 0 0;
	font-size: var(--font-size-sm);
	color: var(--text-color-light);
}

.mt-moon__next {
	margin: auto 0 0;
	padding-top: 12px;
	border-top: 1px solid var(--clr-sub-border);
	font-size: var(--font-size-sm);
	color: var(--text-color-normal);
}

.mt-moon__next strong {
	color: var(--clr-foreground);
}

@media (max-width: 599.98px) {
	.mt-chip {
		min-height: 44px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mt-chip {
		transition: none;
	}

	.mt-chip:active {
		scale: 1;
	}
}
