/*
 * Editor styles: loaded only in the Editor, never on the front.
 * It mirrors the parts of style.css that must also show in the Editor; the
 * Cards section stays front-only on purpose. See the map at the top of
 * style.css for where the rest of Benday's CSS lives.
 *
 * Sections: Ichi base, Marquee, Hamburger, Card placeholder.
 */

/* ==========================================================================
   Ichi base (inherited, mirrored in style.css)
   ========================================================================== */

/* Font smoothing */
body {
	text-rendering: geometricprecision;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Large headings break into lines of similar length. */
h1, h2 {
	text-wrap: balance;
}

/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: 0.1em;
}

/*
 * Make sure footers have no margin.
 * https://github.com/WordPress/gutenberg/issues/47637
 */
footer.wp-block-template-part {
	margin-block-start: 0 !important;
}

/* ==========================================================================
   Marquee (mirror of style.css: keep both copies in sync)
   Posts, or the blocks of a Row, inside a Group with the class "marquee" run
   in one line from right to left. Hovering pauses them, and so does selecting
   a block inside, so the text can be edited while still.
   ========================================================================== */

/* The row never sizes the wrapper: the wrapper only fills the space left. */
.marquee {
	overflow: hidden;
	contain: inline-size;
}

.marquee > .wp-block-query {
	min-width: 0;
}

/* A Row placed directly in the wrapper keeps its full length. */
.marquee > .wp-block-group {
	flex: none;
}

/*
 * One line of posts or blocks. A Row sets its own gap (Block spacing); the
 * post loop follows Styles > Layout > Block spacing.
 */
.marquee .wp-block-post-template,
.marquee > .wp-block-group {
	display: flex;
	flex-wrap: nowrap;
	width: max-content;
	max-width: none;
}

.marquee .wp-block-post-template {
	gap: var(--wp--style--block-gap);
}

.marquee .wp-block-post-template > li,
.marquee > .wp-block-group > * {
	flex: none;
	margin-block: 0;
}

/*
 * The row starts just past the right edge (padding of one wrapper width) and
 * moves by its own full width, so it leaves completely on the left before
 * looping. Speed: the duration of one pass.
 */
@media (prefers-reduced-motion: no-preference) {
	.marquee .wp-block-post-template,
	.marquee > .wp-block-group {
		padding-left: 100%;
		animation: benday-marquee 10s linear infinite;
	}

	.marquee:hover .wp-block-post-template,
	.marquee:focus-within .wp-block-post-template,
	.marquee:hover > .wp-block-group,
	.marquee:focus-within > .wp-block-group {
		animation-play-state: paused;
	}
}

@keyframes benday-marquee {
	to {
		transform: translateX(-100%);
	}
}

/* ==========================================================================
   Hamburger (mirror of style.css: keep both copies in sync)
   The black circle around the menu icon in the header. The rest of the
   push-down overlay stays front-only.
   ========================================================================== */

/*
 * The Editor draws this button as a components button and resets it with
 * ".components-button.wp-block-navigation__responsive-container-open
 * .wp-block-navigation__responsive-container-open" (padding 0, colour
 * inherit). Repeating that chain inside .header-row wins over it.
 */
.header-row .components-button.wp-block-navigation__responsive-container-open.wp-block-navigation__responsive-container-open {
	padding: var(--wp--preset--spacing--30);
	border-radius: 50%;
	background-color: var(--wp--preset--color--theme-2);
	color: var(--wp--preset--color--theme-4);
}

/* ==========================================================================
   Card placeholder (Editor only)
   In a Query Loop, the editable card of a post without a featured image
   shows the Cover's "no image" placeholder: a diagonal line plus a 10% tint
   of the text colour, so that card looked darker than the others. Hiding it
   keeps every card on its palette colour, as on the front.
   ========================================================================== */

.wp-block-post-template .wp-block-cover__image--placeholder-image {
	display: none;
}
