/*
 * Component-level accessibility and pastel restyling.
 * Targets category/tag/search/archive cards and controls.
 */

/* Site shells */
.site-header,
.main-header-nav-bar,
.site-footer,
.widget,
.blog-first-post,
.archive .post,
.search .post {
	background: var(--mb-surface);
	border-color: var(--mb-border);
}

.widget,
.blog-first-post,
.archive .post,
.search .post {
	box-shadow: var(--mb-shadow-soft);
}

/* Category pills / tags */
.cat-links a,
.archive-card__cats .cat-links a,
.single-hero__cats a {
	background: var(--mb-chip-bg) !important;
	color: var(--mb-chip-text) !important;
	border: 1px solid var(--mb-chip-border) !important;
	border-radius: 999px !important;
	font-weight: 700 !important;
}

.cat-links a:hover,
.archive-card__cats .cat-links a:hover,
.single-hero__cats a:hover {
	background: #cbe6ee !important;
	color: #0d4453 !important;
	border-color: #84b3c1 !important;
}

/* Buttons and form controls */
button,
input[type="submit"],
input[type="button"],
.wp-element-button,
.wp-block-search__button {
	background: var(--mb-primary) !important;
	color: #ffffff !important;
	border: 1px solid transparent !important;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.wp-element-button:hover,
.wp-block-search__button:hover {
	background: var(--mb-primary-hover) !important;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
textarea {
	background: #ffffff;
	color: var(--mb-text);
	border: 1px solid var(--mb-border);
}

/* Navigation links around posts (previous/next) */
.default-theme-post-navigation a,
.default-theme-posts-navigation a {
	color: var(--mb-primary);
	font-weight: 600;
}

.default-theme-post-navigation a:hover,
.default-theme-posts-navigation a:hover {
	color: var(--mb-primary-hover);
}

/* Archive/search card readability */
.archive-card__utility {
	background: var(--mb-bg-alt) !important;
	border-color: var(--mb-border) !important;
}

.archive-card__meta,
.archive-card__meta .posted-on,
.archive-card__meta .byline {
	color: var(--mb-text-muted) !important;
}

.archive-card__title {
	background: rgba(255, 255, 255, 0.94) !important;
	color: var(--mb-text) !important;
}

.archive-card__excerpt {
	background: #ffffff !important;
	border-color: var(--mb-border) !important;
}

.archive-card__excerpt p {
	color: var(--mb-text) !important;
}

/* Fallback thumbnails: keep clean cloud look without extra outer frame */
body.archive .post-thumbnail-fallback,
body.search .post-thumbnail-fallback,
body.blog .post-thumbnail-fallback {
	border: 0 !important;
	box-shadow: none !important;
}

/* Top latest-news strip in header */
.top-header-bar,
.top-header-bar .top-header-container,
.top-header-bar.mb-light-top-bar,
.top-header-bar.mb-light-top-bar .top-header-container {
	background: var(--mb-bg-alt) !important;
	color: var(--mb-text-muted) !important;
	border-bottom: 0 !important;
}

.top-header-bar {
	padding: 7px 0 !important;
}

.top-header-bar .mb-header-date {
	color: var(--mb-text-muted) !important;
}

.top-header-bar .mb-latest-posts .mb-latest-posts-label {
	color: #0d4453 !important;
	background: #d8edf3 !important;
	border: 1px solid #9ec5cf !important;
	border-radius: 999px !important;
	padding: 1px 10px !important;
	font-weight: 700 !important;
	letter-spacing: 0.02em !important;
}

.top-header-bar .mb-latest-posts a,
.top-header-bar.mb-light-top-bar .mb-latest-posts a {
	color: var(--mb-primary) !important;
	font-weight: 600 !important;
}

.top-header-bar .mb-latest-posts a:hover,
.top-header-bar.mb-light-top-bar .mb-latest-posts a:hover {
	color: var(--mb-primary-hover) !important;
}

/* Sidebar search widget: lighter and smaller */
#secondary .widget_search,
#secondary .widget_block.widget_search {
	padding: 0.9rem 1rem !important;
	border-radius: 14px !important;
}

#secondary .wp-block-search__label {
	font-size: 0 !important;
	margin: 0 0 0.45rem !important;
	display: block !important;
}

#secondary .wp-block-search__label::after {
	content: "Szybkie wyszukiwanie";
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: var(--mb-text-muted);
}

#secondary .wp-block-search__inside-wrapper {
	gap: 0.42rem;
	align-items: center;
}

#secondary .wp-block-search__input {
	min-height: 34px !important;
	padding: 0.36rem 0.52rem !important;
	font-size: 0.82rem !important;
	border-radius: 8px !important;
}

#secondary .wp-block-search__button {
	min-height: 34px !important;
	padding: 0.3rem 0.82rem !important;
	font-size: 0.76rem !important;
	border-radius: 999px !important;
}

/* Direct-link copy card under single post content */
.single-post .entry-meta .mb-direct-link-card {
	margin: 1rem 0 0.7rem;
	padding: 0.72rem 0.78rem;
	border-radius: 12px;
	background: linear-gradient(180deg, #f9fcff 0%, #f3f9fc 100%);
	border: 1px solid var(--mb-border);
}

.single-post .entry-meta .mb-direct-link-card__title {
	margin: 0 0 0.46rem;
	font-family: "Barlow Semi Condensed", sans-serif;
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--mb-text);
}

.single-post .entry-meta .mb-direct-link-card__row {
	display: flex;
	align-items: center;
	gap: 0.46rem;
}

.single-post .entry-meta .mb-direct-link-card__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 36px;
	padding: 0 0.6rem;
	font-size: 0.82rem;
	border-radius: 8px;
	border: 1px solid var(--mb-border);
	background: #ffffff;
}

.single-post .entry-meta .mb-direct-link-card__copy {
	flex: 0 0 auto;
	height: 36px;
	padding: 0 0.84rem !important;
	font-size: 0.76rem;
	font-weight: 700;
	border-radius: 999px !important;
}

/* Front-page banner cards/images aligned with archive card language */
.front-page-banner-section .theme-banner-slider .splide__track,
.front-page-banner-section .banner-featured-post {
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid var(--mb-border);
	box-shadow: var(--mb-shadow-soft);
	background: #ffffff;
}

.front-page-banner-section .theme-banner-slider .splide__slide img,
.front-page-banner-section .banner-featured-post img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

.front-page-banner-section .theme-banner-slider .post-thumbnail-fallback,
.front-page-banner-section .banner-featured-post .post-thumbnail-fallback {
	width: 100% !important;
	height: 100% !important;
	min-height: 100% !important;
	border-radius: 0 !important;
	display: block !important;
}

.front-page-banner-section .theme-banner-slider .splide__slide {
	min-height: 500px;
}

.front-page-banner-section .banner-featured-post {
	min-height: 234px;
}

.front-page-banner-section .theme-overlay-link {
	background: linear-gradient(to bottom, rgba(17, 35, 46, 0.05) 35%, rgba(16, 34, 45, 0.82) 100%);
}

/* Sidebar widgets: more breathing room and soft raised surface */
#secondary .widget {
	padding: 1rem 1rem 1.05rem !important;
	margin-bottom: 1.25rem !important;
	border-radius: 16px !important;
	border: 1px solid var(--mb-border) !important;
	background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%) !important;
	box-shadow: 0 10px 24px rgba(24, 48, 62, 0.09), 0 2px 6px rgba(24, 48, 62, 0.06) !important;
	overflow: hidden;
}

#secondary .widget:last-child {
	margin-bottom: 0.7rem !important;
}

/* Category_Posts widget cards */
#secondary .widget .mb-widget-mini-post {
	margin: 0 0 0.9rem !important;
}

#secondary .widget .mb-widget-mini-post:last-child {
	margin-bottom: 0 !important;
}

#secondary .widget .mb-widget-mini-card {
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid var(--mb-border);
	background: #ffffff;
}

#secondary .widget .mb-widget-mini-card__media {
	position: relative;
}

#secondary .widget .mb-widget-mini-card__media .post-thumbnail,
#secondary .widget .mb-widget-mini-card__media .post-thumbnail-fallback {
	margin: 0;
	width: 100% !important;
	aspect-ratio: 16 / 9;
	display: block !important;
}

#secondary .widget .mb-widget-mini-card__media .post-thumbnail-fallback {
	min-height: 170px !important;
}

#secondary .widget .mb-widget-mini-card__media .post-thumbnail-fallback__word {
	font-size: 0.72rem !important;
}

#secondary .widget .mb-widget-mini-card__media .post-thumbnail img {
	width: 100% !important;
	max-width: none !important;
	height: 100% !important;
	object-fit: cover;
	object-position: center;
	display: block;
}

#secondary .widget .mb-widget-mini-card__header {
	position: absolute !important;
	left: 0.42rem;
	right: 0.42rem;
	bottom: 0.36rem;
	z-index: 3;
}

#secondary .widget .mb-widget-mini-card__title {
	margin: 0 !important;
	font-size: clamp(0.76rem, 1.15vw, 0.9rem) !important;
	line-height: 1.24 !important;
	font-weight: 600 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
}

#secondary .widget .mb-widget-mini-card__title span,
#secondary .widget .mb-widget-mini-card__title a {
	background: rgba(255, 255, 255, 0.92) !important;
	color: #173543 !important;
	border-radius: 7px !important;
	padding: 0.14em 0.34em 0.2em !important;
	text-decoration: none !important;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
}

#secondary .widget .mb-widget-mini-card__excerpt {
	padding: 0.56rem 0.62rem 0.62rem !important;
	min-height: 0 !important;
}

#secondary .widget .mb-widget-mini-card__excerpt p {
	font-size: 0.8rem !important;
	line-height: 1.4 !important;
	-webkit-line-clamp: 4 !important;
}

/* Inline CTA block inside article content (legacy ctaText/postTitle upgrade) */
.entry-content .mb-content-cta {
	position: relative;
	margin: 1.05rem 0 1.15rem;
	padding: 0.8rem 0.95rem 0.88rem 1rem;
	border-radius: 12px;
	border: 1px solid var(--mb-border);
	border-left: 4px solid var(--mb-primary);
	background: linear-gradient(180deg, #f8fcff 0%, #f2f8fc 100%);
	box-shadow: 0 8px 18px rgba(21, 46, 61, 0.08);
}

.entry-content .mb-content-cta__label {
	margin: 0 0 0.28rem;
	font-family: "Barlow Semi Condensed", sans-serif;
	font-size: 0.92rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: var(--mb-primary);
}

.entry-content .mb-content-cta__title {
	margin: 0;
	font-family: "Barlow Semi Condensed", sans-serif;
	font-size: clamp(1.02rem, 1.9vw, 1.26rem);
	font-weight: 700;
	line-height: 1.3;
	color: #143444;
}

.entry-content .mb-content-cta__title a {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.entry-content .mb-content-cta__title a:hover {
	color: var(--mb-primary-hover);
}

/* Sidebar gallery widget styling */
#secondary .widget .wp-block-gallery,
#secondary .widget .blocks-gallery-grid {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.55rem !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

#secondary .widget .wp-block-gallery .blocks-gallery-item,
#secondary .widget .blocks-gallery-grid .blocks-gallery-item {
	margin: 0 !important;
	padding: 0 !important;
}

#secondary .widget .wp-block-gallery .blocks-gallery-item figure,
#secondary .widget .blocks-gallery-grid .blocks-gallery-item figure {
	position: relative;
	overflow: hidden;
	border-radius: 10px;
	border: 1px solid rgba(40, 76, 95, 0.18);
	background: #f8fcff;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

#secondary .widget .wp-block-gallery .blocks-gallery-item img,
#secondary .widget .blocks-gallery-grid .blocks-gallery-item img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	object-position: center;
	filter: saturate(0.96) contrast(1.02);
	transition: transform 0.28s ease, filter 0.28s ease;
}

#secondary .widget .wp-block-gallery .blocks-gallery-item a:hover img,
#secondary .widget .blocks-gallery-grid .blocks-gallery-item a:hover img,
#secondary .widget .wp-block-gallery .blocks-gallery-item a:focus img,
#secondary .widget .blocks-gallery-grid .blocks-gallery-item a:focus img {
	transform: scale(1.035);
	filter: saturate(1.04) contrast(1.04);
}

#secondary .widget .wp-block-gallery .blocks-gallery-item a:focus,
#secondary .widget .blocks-gallery-grid .blocks-gallery-item a:focus {
	outline: 2px solid rgba(35, 115, 149, 0.35);
	outline-offset: 2px;
	border-radius: 10px;
}

/* Sidebar calendar widget styling */
#secondary .widget #wp-calendar,
#secondary .widget .wp-block-calendar table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid rgba(40, 76, 95, 0.16);
	border-radius: 12px;
	overflow: hidden;
	background: #ffffff;
}

#secondary .widget #wp-calendar caption,
#secondary .widget .wp-block-calendar caption {
	caption-side: bottom;
	padding: 0.6rem 0.4rem 0.45rem;
	font-family: "Barlow Semi Condensed", sans-serif;
	font-size: 1rem;
	font-weight: 600;
	color: #3c5b6d;
}

#secondary .widget #wp-calendar th,
#secondary .widget .wp-block-calendar th {
	padding: 0.42rem 0.2rem;
	text-align: center;
	font-family: "Barlow Semi Condensed", sans-serif;
	font-size: 0.84rem;
	font-weight: 700;
	color: #2a495d;
	background: linear-gradient(180deg, #f4f9fc 0%, #edf5fa 100%);
	border-bottom: 1px solid rgba(40, 76, 95, 0.14);
}

#secondary .widget #wp-calendar td,
#secondary .widget .wp-block-calendar td {
	padding: 0.38rem 0.2rem;
	text-align: center;
	font-size: 0.88rem;
	line-height: 1;
	color: #2e4b5d;
	border-bottom: 1px solid rgba(40, 76, 95, 0.1);
	border-right: 1px solid rgba(40, 76, 95, 0.1);
}

#secondary .widget #wp-calendar tr td:last-child,
#secondary .widget .wp-block-calendar tr td:last-child {
	border-right: 0;
}

#secondary .widget #wp-calendar tbody tr:last-child td,
#secondary .widget .wp-block-calendar tbody tr:last-child td {
	border-bottom: 0;
}

#secondary .widget #wp-calendar #today,
#secondary .widget .wp-block-calendar #today {
	font-weight: 700;
	color: #0f4f66;
	background: rgba(200, 233, 244, 0.7);
	box-shadow: inset 0 0 0 1px rgba(81, 143, 171, 0.35);
}

#secondary .widget #wp-calendar a,
#secondary .widget .wp-block-calendar a {
	color: var(--mb-primary);
	font-weight: 700;
	text-decoration: none;
}

#secondary .widget #wp-calendar a:hover,
#secondary .widget .wp-block-calendar a:hover {
	color: var(--mb-primary-hover);
	text-decoration: underline;
	text-underline-offset: 2px;
}

#secondary .widget #wp-calendar tfoot td,
#secondary .widget .wp-block-calendar tfoot td {
	padding: 0.52rem 0.4rem;
	font-size: 0.78rem;
	border-top: 1px solid rgba(40, 76, 95, 0.12);
	background: #f8fcff;
}

/* Footer widgets: unify all blocks to premium, clean style */
.footer-widget-area .widget {
	padding: 0.95rem 1rem 1rem !important;
	margin-bottom: 1rem !important;
	border-radius: 14px !important;
	border: 1px solid rgba(45, 82, 102, 0.15) !important;
	background: linear-gradient(180deg, #ffffff 0%, #f7fbfd 100%) !important;
	box-shadow: 0 8px 20px rgba(18, 42, 58, 0.08) !important;
}

.footer-widget-area .widget .widget-title,
.footer-widget-area .widget .widgettitle,
.footer-widget-area .widget .wp-block-heading {
	margin: 0 0 0.72rem !important;
	padding: 0 0 0.34rem !important;
	font-family: "Barlow Semi Condensed", sans-serif !important;
	font-size: 1.26rem !important;
	font-weight: 700 !important;
	color: #173748 !important;
	border-bottom: 1px solid rgba(40, 76, 95, 0.18) !important;
}

.footer-widget-area .widget ul,
.footer-widget-area .widget ol {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.footer-widget-area .widget li {
	margin: 0 !important;
	padding: 0.28rem 0 !important;
	border-bottom: 1px dashed rgba(40, 76, 95, 0.14);
}

.footer-widget-area .widget li:last-child {
	border-bottom: 0;
}

.footer-widget-area .widget a {
	color: #1a4c63 !important;
	text-decoration: none;
}

.footer-widget-area .widget a:hover {
	color: #0d5e7e !important;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Handle long/dirty text blocks from old widgets */
.footer-widget-area .widget,
.footer-widget-area .widget p,
.footer-widget-area .widget li,
.footer-widget-area .widget a {
	overflow-wrap: anywhere;
	word-break: break-word;
	line-height: 1.45;
}

/* Footer tag cloud as clean chips, not giant words */
.footer-widget-area .widget_tag_cloud .tagcloud,
.footer-widget-area .wp-block-tag-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 0.38rem;
}

.footer-widget-area .widget_tag_cloud .tagcloud a,
.footer-widget-area .wp-block-tag-cloud a {
	display: inline-flex;
	align-items: center;
	padding: 0.16rem 0.5rem;
	border-radius: 999px;
	border: 1px solid rgba(63, 122, 151, 0.28);
	background: rgba(214, 236, 245, 0.66);
	color: #17485f !important;
	font-size: 0.82rem !important;
	font-weight: 600;
	line-height: 1.2;
}

.footer-widget-area .widget_tag_cloud .tagcloud a:hover,
.footer-widget-area .wp-block-tag-cloud a:hover {
	background: rgba(195, 228, 240, 0.9);
	border-color: rgba(54, 111, 139, 0.45);
}

/* Footer galleries reuse neat spacing */
.footer-widget-area .wp-block-gallery,
.footer-widget-area .blocks-gallery-grid {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.5rem !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.footer-widget-area .wp-block-gallery .blocks-gallery-item,
.footer-widget-area .blocks-gallery-grid .blocks-gallery-item {
	margin: 0 !important;
}

.footer-widget-area .wp-block-gallery .blocks-gallery-item figure,
.footer-widget-area .blocks-gallery-grid .blocks-gallery-item figure {
	border-radius: 9px;
	overflow: hidden;
	border: 1px solid rgba(40, 76, 95, 0.16);
}

.footer-widget-area .wp-block-gallery .blocks-gallery-item img,
.footer-widget-area .blocks-gallery-grid .blocks-gallery-item img {
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}
