/*--------------------------------------------------------------
# Tecblogger – Block (Gutenberg) styles
# Loaded on the front end AND inside the block editor, so keep
# selectors generic (no .post-text / .blog-* wrappers here).
--------------------------------------------------------------*/

/* Wide / full alignments ------------------------------------- */
.entry-content,
.post-text,
.tecblogger-page-post {
	--tecb-wide-extend: 0px;
	display: flow-root; /* contains floats without clipping wide/full blocks */
	overflow: visible;
}

/* Blog posts sit inside a 30px padded card: wide = card edge. */
.blog-details-card .entry-content,
.blog-post-item .entry-content {
	--tecb-wide-extend: 30px;
}

.entry-content > .alignwide,
.tecblogger-page-post > .alignwide {
	width: auto;
	max-width: none;
	margin-left: calc(-1 * var(--tecb-wide-extend));
	margin-right: calc(-1 * var(--tecb-wide-extend));
}

/* Pages without a sidebar have room to grow beyond the column. */
@media (min-width: 1200px) {
	body:not(.has-sidebar) .tecblogger-page-post {
		--tecb-wide-extend: 60px;
	}
}

.entry-content > .alignfull,
.tecblogger-page-post > .alignfull {
	width: auto;
	max-width: none;
	margin-left: calc(-1 * var(--tecb-wide-extend));
	margin-right: calc(-1 * var(--tecb-wide-extend));
}

/* No sidebar: full-width blocks may break out to the viewport edges. */
@media (min-width: 992px) {
	body:not(.has-sidebar) .entry-content > .alignfull,
	body:not(.has-sidebar) .tecblogger-page-post > .alignfull {
		width: 100vw;
		max-width: 100vw;
		margin-left: calc(50% - 50vw);
		margin-right: calc(50% - 50vw);
	}
}

.alignleft,
.wp-block-image.alignleft,
.wp-block-image .alignleft {
	float: left;
	margin: 0.4em 1.5em 1em 0;
}
.alignright,
.wp-block-image.alignright,
.wp-block-image .alignright {
	float: right;
	margin: 0.4em 0 1em 1.5em;
}
.aligncenter {
	clear: both;
	display: block;
	margin-left: auto;
	margin-right: auto;
}
.entry-content .alignleft,
.entry-content .alignright {
	max-width: 50%;
}
@media (max-width: 575px) {
	.entry-content .alignleft,
	.entry-content .alignright {
		float: none;
		max-width: 100%;
		margin-left: 0;
		margin-right: 0;
	}
}

/* Core block baselines -------------------------------------- */
.wp-block-image img,
.wp-block-post-featured-image img {
	max-width: 100%;
	height: auto;
}
.wp-block-image,
.wp-block-gallery,
.wp-block-video,
.wp-block-audio,
.wp-block-embed,
.wp-block-table,
.wp-block-code,
.wp-block-preformatted,
.wp-block-verse,
.wp-block-quote,
.wp-block-pullquote,
.wp-block-separator,
.wp-block-buttons,
.wp-block-columns,
.wp-block-group,
.wp-block-media-text,
.wp-block-file,
.wp-block-details {
	margin-top: 0;
	margin-bottom: 1.75rem;
}
.wp-block-image figcaption,
.wp-block-video figcaption,
.wp-block-audio figcaption,
.wp-block-embed figcaption,
.wp-block-table figcaption,
.wp-element-caption {
	margin-top: 0.5em;
	margin-bottom: 0;
	font-size: 14px;
	text-align: center;
}

/* Columns: undo legacy margin hacks, let core flex-gap do the work. */
.wp-block-columns .wp-block-column,
.wp-block-columns .wp-block-column:not(:first-child),
.wp-block-columns .wp-block-column:not(:last-child),
.wp-block-columns .wp-block-column:nth-child(2n),
.wp-block-columns .wp-block-column:nth-child(2n+1) {
	margin-left: 0;
	margin-right: 0;
}

/* Buttons: respect user-chosen colors. */
.wp-block-button__link {
	text-decoration: none;
	border-radius: 4px;
	transition: opacity 0.2s ease-in-out;
}
.wp-block-button__link:not(.has-background) {
	background-color: var(--primary-btn-bg-color, #44bbff);
}
.wp-block-button__link:not(.has-text-color) {
	color: var(--primary-btn-text-color, #fff);
}
.wp-block-button__link:hover,
.wp-block-button__link:focus {
	opacity: 0.88;
}
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background) {
	background-color: transparent;
}
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
	color: var(--heading-text-color, #333);
}

/* Quotes */
.wp-block-quote,
.wp-block-pullquote {
	overflow-wrap: break-word;
}
.wp-block-pullquote {
	padding: 1.5em 0;
}

/* Tables */
.wp-block-table {
	overflow-x: auto;
}
.wp-block-table table {
	width: 100%;
	border-collapse: collapse;
}
.wp-block-table th,
.wp-block-table td {
	border: 1px solid #d0e7ff;
	padding: 10px 14px;
}
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background-color: #f5faff;
}

/* Code */
.wp-block-code,
.wp-block-preformatted,
.wp-block-verse {
	overflow: auto;
}
.wp-block-code {
	padding: 1em;
	background: #f4f4f4;
	border: 1px solid #e4e1e1;
	border-radius: 4px;
}
.wp-block-code code {
	display: block;
	padding: 0;
	background: transparent;
	white-space: pre;
	font-size: 14px;
}

/* Separator */
.wp-block-separator {
	border: 0;
	border-top: 2px solid currentColor;
	opacity: 0.25;
	clear: both;
}
.wp-block-separator.is-style-dots {
	border: 0;
	opacity: 1;
}

/* Embeds & media: responsive by default */
.wp-block-embed iframe,
.wp-block-video video,
.wp-block-embed__wrapper iframe {
	max-width: 100%;
}
.wp-block-embed.is-type-video .wp-block-embed__wrapper iframe {
	width: 100%;
}
.wp-block-media-text__media img,
.wp-block-media-text__media video {
	height: auto;
	max-width: 100%;
}

/* Cover: readable text by default */
.wp-block-cover,
.wp-block-cover-image {
	margin-bottom: 1.75rem;
}
.wp-block-cover .wp-block-cover__inner-container {
	color: inherit;
}

/* Lists inside blocks */
.wp-block-list,
.wp-block-latest-posts,
.wp-block-categories-list,
.wp-block-archives-list {
	padding-left: 1.25em;
}

/* Gallery (block-based, nested images) */
.wp-block-gallery.has-nested-images {
	margin-bottom: 1.75rem;
}
.wp-block-gallery.has-nested-images figure.wp-block-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.wp-block-gallery.has-nested-images figure.wp-block-image:not(.has-custom-caption) figcaption {
	color: #fff;
	text-align: center;
}

/* Details / accordion */
.wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
}

/* Social links */
.wp-block-social-links {
	padding-left: 0;
	margin-bottom: 1.75rem;
}
.wp-block-social-links li {
	margin-bottom: 0;
}

/* Page links */
.page-links {
	clear: both;
	margin: 0 0 1.5em;
}
.page-links a,
.page-links > span:not(.page-links-title) {
	display: inline-block;
	padding: 0 0.5em;
}

/* Accessibility: visible keyboard focus (theme resets removed it) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
	outline: 2px solid var(--primary-color, #44bbff);
	outline-offset: 2px;
}

/* Skip link */
.skip-link {
	z-index: 100000;
}
.skip-link:focus {
	position: fixed !important;
	top: 8px;
	left: 8px;
	clip: auto;
	clip-path: none;
	width: auto;
	height: auto;
	margin: 0;
	background: #fff;
	color: #21759b;
	font-weight: 600;
	text-decoration: none;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.3);
}

/* Page template: Full Width Canvas ----------------------------- */
.tecblogger-canvas {
	padding: 40px 0;
}
.tecblogger-canvas .entry-content {
	--tecb-wide-extend: 0px;
}
/* Default blocks: centered reading width. */
.tecblogger-canvas .entry-content > * {
	max-width: min(740px, calc(100% - 30px));
	margin-left: auto;
	margin-right: auto;
}
/* Wide blocks: same width as the site container. */
.tecblogger-canvas .entry-content > .alignwide {
	max-width: min(1140px, calc(100% - 30px));
	width: auto;
	margin-left: auto;
	margin-right: auto;
}
/* Full blocks: edge to edge (no container to break out of). */
body .tecblogger-canvas .entry-content > .alignfull {
	max-width: none;
	width: auto;
	margin-left: 0;
	margin-right: 0;
}
.tecblogger-canvas .entry-content > .alignfull:first-child {
	margin-top: -40px;
}
.tecblogger-canvas .entry-content > .alignfull:last-child {
	margin-bottom: -40px;
}

/* Text color set on a container block must reach its text.
   The theme gives p and headings their own color, which would otherwise
   win over the color chosen on the Group / Columns / Cover block. */
.wp-block-group.has-text-color :is(p, h1, h2, h3, h4, h5, h6, li, figcaption, cite):not(.has-text-color),
.wp-block-columns.has-text-color :is(p, h1, h2, h3, h4, h5, h6, li, figcaption, cite):not(.has-text-color),
.wp-block-column.has-text-color :is(p, h1, h2, h3, h4, h5, h6, li, figcaption, cite):not(.has-text-color),
.wp-block-cover.has-text-color :is(p, h1, h2, h3, h4, h5, h6, li, figcaption, cite):not(.has-text-color),
.wp-block-media-text.has-text-color :is(p, h1, h2, h3, h4, h5, h6, li, figcaption, cite):not(.has-text-color) {
	color: inherit;
}
