/* Gutenberg Styler for FluentCart — make block content fit the portal column.

   A custom dashboard tab renders inside FluentCart's portal shell without the
   dashboard bundle, so block content arrives with none of the width handling a
   normal template gives it. Everything below is scoped to the tab content and
   never touches the portal chrome itself. */

.gsfc-content,
.fluent-cart-custom-page-content {
	color: var(--fct-customer-dashboard-text-color, var(--fct-customer-dashboard-primary-text-color, inherit));
	max-width: 100%;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.gsfc-content > *:first-child,
.fluent-cart-custom-page-content > *:first-child {
	margin-top: 0;
}

.gsfc-content > *:last-child,
.fluent-cart-custom-page-content > *:last-child {
	margin-bottom: 0;
}

.gsfc-content-title {
	color: var(--fct-customer-dashboard-title-color, inherit);
	margin: 0 0 .75em;
}

/* Media never wider than the column. */
.gsfc-content img,
.gsfc-content video,
.gsfc-content iframe,
.gsfc-content embed,
.gsfc-content object,
.gsfc-content canvas,
.gsfc-content svg,
.fluent-cart-custom-page-content img,
.fluent-cart-custom-page-content video,
.fluent-cart-custom-page-content iframe {
	max-width: 100%;
	height: auto;
}

.gsfc-content figure {
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

/* Full-width blocks: the portal column is not the page, so the usual
   100vw breakout would punch straight through the shell. */
.gsfc-content .alignfull,
.fluent-cart-custom-page-content .alignfull {
	max-width: 100%;
	width: 100%;
	margin-left: 0;
	margin-right: 0;
}

.gsfc-content .alignwide,
.fluent-cart-custom-page-content .alignwide {
	max-width: 100%;
}

.gsfc-content .alignleft {
	float: left;
	margin: 0 1.25em 1em 0;
	max-width: 50%;
}

.gsfc-content .alignright {
	float: right;
	margin: 0 0 1em 1.25em;
	max-width: 50%;
}

.gsfc-content .aligncenter {
	margin-left: auto;
	margin-right: auto;
}

/* Columns stack rather than squeeze. */
.gsfc-content .wp-block-columns {
	flex-wrap: wrap;
}

@media ( max-width: 781px ) {
	.gsfc-content .wp-block-column {
		flex-basis: 100% !important;
	}
}

/* Tables scroll sideways instead of pushing the layout out. */
.gsfc-content .gsfc-table-scroll,
.gsfc-content .wp-block-table {
	overflow-x: auto;
	max-width: 100%;
	-webkit-overflow-scrolling: touch;
}

.gsfc-content table {
	border-collapse: collapse;
	max-width: 100%;
}

.gsfc-content th,
.gsfc-content td {
	border: 1px solid var(--fct-customer-dashboard-border-color, rgba(0, 0, 0, .1));
	padding: .5em .7em;
}

/* Long code and preformatted text. */
.gsfc-content pre {
	overflow-x: auto;
	max-width: 100%;
	white-space: pre-wrap;
	word-break: break-word;
}

/* Embeds keep their aspect ratio. */
.gsfc-content .wp-block-embed__wrapper {
	position: relative;
}

.gsfc-embed iframe {
	border: 1px solid var(--fct-customer-dashboard-border-color, rgba(0, 0, 0, .1));
	border-radius: 8px;
}
