/* Mistic Lighting — subpages (everything except the front page). Tokens in main.css. */

/* ---------- Title band + breadcrumbs ---------- */

.ml-pagehead {
	color: var(--white);
	background: var(--navy);
}

/* Optional photo behind the band (ACF "Zdjęcie w tle paska nagłówka"), navy overlay keeps text readable. */
.ml-pagehead--image {
	background: linear-gradient(rgba(23, 55, 94, .78), rgba(23, 55, 94, .78)), var(--ml-head-image) center / cover no-repeat, var(--navy);
}

.ml-pagehead--image .ml-pagehead__inner {
	min-height: 220px;
}

.ml-listing-text--intro {
	margin: 0 0 26px;
}

.ml-listing-text--bottom {
	margin: 50px 0 0;
	padding-top: 30px;
	border-top: 1px solid #efefef;
}

.ml-listing-text > :first-child {
	margin-top: 0;
}

.ml-listing-text > :last-child {
	margin-bottom: 0;
}

.ml-pagehead__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 24px;
	max-width: 1000px;
	min-height: 99px;
	margin: 0 auto;
	padding: 20px 0;
}

.ml-pagehead__title {
	margin: 0;
	font-family: var(--font);
	font-size: 40px;
	font-weight: 300;
	line-height: 1.1;
	letter-spacing: -0.05em;
	text-transform: uppercase;
	color: var(--white);
}

.ml-crumbs {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .083em;
	text-transform: uppercase;
	color: var(--white);
}

.ml-crumbs ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .083em;
	text-transform: uppercase;
}

.ml-crumbs li + li::before {
	content: "›";
	margin: 0 7px;
	font-size: 13px;
}

.ml-crumbs a,
.ml-crumbs span {
	color: var(--white);
}

.ml-crumbs a:hover {
	color: var(--white);
	opacity: .75;
}

@media (max-width: 1032px) {
	.ml-pagehead__inner { padding: 20px 16px; }
}

@media (max-width: 600px) {
	.ml-pagehead__inner { min-height: 0; padding: 22px 16px; }
	.ml-pagehead__title { font-size: 28px; }
}

/* ---------- Layout basics for subpages ---------- */

.site-content {
	padding-top: 60px;
	padding-bottom: 80px;
}

.one-container .site-content {
	padding-left: 0;
	padding-right: 0;
}

@media (max-width: 1032px) {
	.one-container .site-content { padding-left: 16px; padding-right: 16px; }
}

.entry-content > h2,
.entry-content > h3 {
	margin: 1.4em 0 .6em;
}

.entry-content h2 { font-size: 26px; }
.entry-content h3 { font-size: 21px; }
.entry-content h4 { font-size: 18px; }

.entry-content table {
	width: 100%;
	margin: 0 0 1.5em;
	border-collapse: collapse;
	border: 0;
	font-size: 14px;
}

.entry-content th,
.entry-content td {
	padding: 7px 8px;
	text-align: left;
	vertical-align: top;
	border: 0;
	border-top: 1px solid #efefef;
}

.entry-content th {
	width: 45%;
	font-weight: 700;
}

.entry-content .wp-block-table {
	margin: 0 0 1.5em;
}

.ml-item__title {
	margin: 0 0 24px;
	font-size: 44px;
	font-weight: 300;
	line-height: 1.15;
	letter-spacing: -0.03em;
	text-transform: none;
	color: var(--heading);
}

@media (max-width: 600px) {
	.ml-item__title { font-size: 30px; }
}

.ml-side-title,
.entry-content .ml-side-title {
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -0.02em;
	text-transform: none;
	color: var(--card-title);
}

.ml-title--small {
	margin: 0 0 22px;
	font-size: 22px;
	color: var(--card-title);
}

.ml-title--small::before,
.ml-title--small::after {
	flex: 1 1 60px;
	background: #ddd;
}

/* ---------- Grids + cards ---------- */

.ml-grid {
	display: grid;
	gap: 20px;
}

.ml-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.ml-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ml-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
	.ml-grid--3,
	.ml-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
	.ml-grid--2,
	.ml-grid--3,
	.ml-grid--4 { grid-template-columns: 1fr; }
}

.ml-card[hidden] {
	display: none;
}

.ml-card__img--empty {
	display: block;
	aspect-ratio: 1;
	background: var(--light);
}

.ml-grid .ml-card__title {
	font-size: 16px;
}

/* ---------- Products listing ---------- */

.ml-shop {
	display: grid;
	grid-template-columns: 200px minmax(0, 1fr);
	gap: 40px;
}

.ml-side-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ml-side-list a {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	padding: 6px 0;
	font-size: 15px;
	color: #111;
	border-bottom: 1px solid #f0f0f0;
}

.ml-side-list a span {
	font-size: 12px;
	color: #999;
}

.ml-side-list a:hover,
.ml-side-list a[aria-current] {
	color: var(--red);
}

.ml-side-list a[aria-current] {
	font-weight: 700;
}

.ml-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 22px;
	margin: 0 0 26px;
	padding: 16px 18px;
	background: #f6f7f9;
}

.ml-filters__toggle {
	display: none;
}

@media (max-width: 768px) {
	.ml-filters__toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex-basis: 100%;
		font-size: 12px;
		font-weight: 700;
		letter-spacing: .083em;
		text-transform: uppercase;
		color: var(--navy);
		cursor: pointer;
		list-style: none;
	}

	.ml-filters__toggle::-webkit-details-marker {
		display: none;
	}

	.ml-filters__toggle::after {
		content: "+";
		font-size: 18px;
		font-weight: 400;
	}

	.ml-filters[open] .ml-filters__toggle::after {
		content: "–";
	}
}

.ml-filters__group {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.ml-filters__label {
	margin-right: 2px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .083em;
	text-transform: uppercase;
	color: var(--card-title);
}

.ml-chip,
.ml-filters__reset,
.ml-link-btn {
	font-family: var(--font);
	text-shadow: none;
}

.ml-chip {
	padding: 5px 12px;
	font-size: 11px;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--navy);
	background: var(--white);
	border: 1px solid #d6dbe3;
	border-radius: 14px;
}

.ml-chip:hover {
	color: var(--navy);
	background: var(--white);
	border-color: var(--navy);
}

.ml-chip[aria-pressed="true"],
.ml-chip[aria-pressed="true"]:hover {
	color: var(--white);
	background: var(--navy);
	border-color: var(--navy);
}

.ml-filters__bar {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-basis: 100%;
	font-size: 12px;
	color: #666;
}

.ml-filters__reset,
.ml-link-btn {
	padding: 0;
	font-size: 12px;
	color: var(--red);
	background: none;
	border: 0;
	text-decoration: underline;
}

.ml-filters__reset:hover,
.ml-link-btn:hover {
	color: var(--red-light);
	background: none;
}

.ml-empty {
	padding: 30px;
	text-align: center;
	background: #f6f7f9;
}

@media (max-width: 560px) {
	.ml-shop .ml-grid--3,
	.ml-see-also .ml-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.ml-shop .ml-card,
	.ml-see-also .ml-card { padding: 6px 6px 16px; }
	.ml-shop .ml-card__title,
	.ml-see-also .ml-card__title { font-size: 13px; margin-top: 10px; }
	.ml-shop .ml-card__link,
	.ml-see-also .ml-card__link { margin-top: 12px; font-size: 11px; }
	.ml-filters { padding: 12px; }
}

@media (max-width: 768px) {
	.ml-shop { grid-template-columns: 1fr; gap: 24px; }
	.ml-side-list { display: flex; flex-wrap: wrap; gap: 6px; }
	.ml-side-list a { padding: 5px 12px; font-size: 13px; border: 1px solid #e3e3e3; border-radius: 16px; }
	.ml-side-list a span { display: none; }
}

/* ---------- Product single ---------- */

.ml-product__top {
	display: grid;
	grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
	gap: 40px;
	margin-bottom: 50px;
}

.ml-product__image {
	display: block;
	padding: 10px;
	border: 2px solid var(--border);
}

.ml-product__image img {
	display: block;
	width: 100%;
	height: auto;
}

.ml-product__body > :first-child {
	margin-top: 0;
}

.ml-product__rel {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 40px;
	margin-bottom: 50px;
}

.ml-product__rel > section:only-child {
	grid-column: 1 / -1;
}

.ml-files,
.ml-links {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ml-files li,
.ml-links li {
	position: relative;
	padding: 6px 0 6px 30px;
	font-size: 14px;
	line-height: 1.5;
}

.ml-files li::before,
.ml-links li::before {
	content: "";
	position: absolute;
	top: 7px;
	left: 0;
	width: 18px;
	height: 20px;
	background: currentColor;
	-webkit-mask: var(--icon) no-repeat center / contain;
	mask: var(--icon) no-repeat center / contain;
	color: var(--navy);
}

.ml-files li {
	--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zm4 18H6V4h7v5h5zM8 13h8v2H8zm0 4h8v2H8z'/%3E%3C/svg%3E");
}

.ml-links li {
	--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7h-2zM14 3v2h3.6l-9.8 9.8 1.4 1.4L19 6.4V10h2V3z'/%3E%3C/svg%3E");
}

.ml-files a,
.ml-links a {
	color: #111;
}

.ml-files a:hover,
.ml-links a:hover {
	color: var(--red);
}

.ml-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 22px;
}

.ml-share__label {
	margin-right: 6px;
	font-size: 11px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--body);
}

.ml-share a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	color: var(--white);
	background: var(--red);
	border-radius: 4px;
}

.ml-share a:hover {
	color: var(--white);
	background: var(--navy);
}

.ml-see-also {
	margin-top: 20px;
}

@media (max-width: 800px) {
	.ml-product__top,
	.ml-product__rel { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Project single ---------- */

.ml-project__layout {
	display: grid;
	grid-template-columns: 200px minmax(0, 1fr);
	gap: 40px;
}

.ml-project__layout--single {
	grid-template-columns: 1fr;
}

.ml-project__body > :first-child {
	margin-top: 0;
}

.entry-content .wp-block-gallery {
	margin: 36px 0;
}

@media (max-width: 768px) {
	.ml-project__layout { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- Blog ---------- */

.ml-post-card {
	display: flex;
	flex-direction: column;
	padding: 24px;
	border: 1px solid #efefef;
}

.ml-post-card__title {
	min-height: 2.6em;
	margin: 0 0 14px;
	font-size: 22px;
	line-height: 1.25;
	text-align: center;
}

.ml-post-card__title a {
	color: var(--heading);
}

.ml-post-card__title a:hover {
	color: var(--red);
}

.ml-post-card__img {
	display: block;
	margin: 0 0 16px;
	padding: 6px;
	border: 1px solid #efefef;
}

.ml-post-card__img img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.ml-post-card__excerpt {
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 1.8;
}

.ml-post-card__more {
	margin-top: auto;
	font-size: 13px;
	font-weight: 700;
	text-decoration: underline;
}

/* Blog page = core Query Loop (Strony → Blog). Columns/fields are set in the editor — only card look here. */
/* Gap must stay 24px: the grid formula of the block ("50% - 12px" per column) assumes it. */
.ml-posts-grid {
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ml-posts-grid > .wp-block-post {
	display: flex;
	flex-direction: column;
	padding: 24px;
	border: 1px solid #efefef;
}

.ml-posts-grid .wp-block-post-title {
	min-height: 2.5em;
	margin: 0 0 6px;
	font-size: 22px;
	line-height: 1.25;
	text-align: center;
}

.ml-posts-grid .wp-block-post-title a {
	color: var(--heading);
}

.ml-posts-grid .wp-block-post-title a:hover {
	color: var(--red);
}

.ml-posts-grid .wp-block-post-date,
.ml-posts-grid .wp-block-post-author,
.ml-posts-grid .wp-block-post-terms {
	margin: 0 0 12px;
	font-size: 12px;
	text-align: center;
	color: #777;
}

.ml-posts-grid .wp-block-post-featured-image {
	margin: 0 0 16px;
	padding: 6px;
	border: 1px solid #efefef;
}

.ml-posts-grid .wp-block-post-excerpt {
	margin: 0;
	font-size: 13px;
	line-height: 1.8;
}

.ml-posts-grid .wp-block-post-excerpt__more-text {
	margin: 12px 0 0;
}

.ml-posts-grid .wp-block-post-excerpt__more-link {
	font-size: 13px;
	font-weight: 700;
	text-decoration: underline;
}

.wp-block-query-pagination.ml-pagination {
	gap: 6px;
}

.wp-block-query-pagination.ml-pagination > a {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	margin: 0;
	color: var(--navy);
	border: 1px solid #dfe3ea;
	border-radius: 17px;
}

.wp-block-query-pagination-numbers {
	display: flex;
	gap: 6px;
}

.single-post .site-main {
	max-width: 760px;
	margin: 0 auto;
}

.single-post .entry-title {
	font-size: 36px;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: -0.03em;
}

.single-post .entry-content img {
	height: auto;
}

.ml-post-cta {
	margin: 40px 0 0;
	padding: 18px 22px;
	font-size: 15px;
	background: #f6f7f9;
	border-left: 4px solid var(--navy);
}

.ml-post-cta p {
	margin: 0;
}

/* ---------- Pagination ---------- */

.ml-pagination {
	margin-top: 50px;
}

.ml-pagination .nav-links {
	display: flex;
	justify-content: center;
	gap: 6px;
}

.ml-pagination .page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 8px;
	font-size: 13px;
	color: var(--navy);
	border: 1px solid #dfe3ea;
	border-radius: 17px;
}

.ml-pagination[hidden] {
	display: none;
}

.ml-pagination .page-numbers.dots {
	border-color: transparent;
}

.ml-pagination .page-numbers.current,
.ml-pagination a.page-numbers:hover {
	color: var(--white);
	background: var(--navy);
	border-color: var(--navy);
}

/* ---------- Downloads page ---------- */

.ml-downloads {
	display: grid;
	grid-template-columns: 200px minmax(0, 1fr);
	gap: 40px;
}

.ml-downloads__nav {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--header-h) + 20px);
	align-self: start;
}

.ml-downloads section + section {
	margin-top: 44px;
}

.ml-downloads h2 {
	margin: 0 0 14px;
	font-size: 28px;
	text-transform: none;
}

@media (max-width: 768px) {
	.ml-downloads { grid-template-columns: 1fr; }
	.ml-downloads__nav { position: static; }
}

/* ---------- Contact page ---------- */

.ml-contact {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	gap: 50px;
}

.ml-contact h2 {
	margin: 0 0 16px;
	font-size: 26px;
}

.ml-contact__block {
	margin: 0 0 22px;
	line-height: 1.8;
}

.ml-form p {
	margin: 0 0 14px;
}

.ml-form input[type="text"],
.ml-form input[type="email"],
.ml-form textarea {
	width: 100%;
	padding: 8px 10px;
	font-family: var(--font);
	font-size: 14px;
	color: var(--body);
	background: var(--white);
	border: 2px solid #e5e8ee;
}

.ml-form input:focus,
.ml-form textarea:focus {
	border-color: var(--navy);
	outline: none;
}

.ml-form__consent {
	font-size: 13px;
	line-height: 1.7;
}

.ml-form__consent input {
	margin-right: 6px;
}

/* Contact Form 7 markup */
.ml-form .wpcf7-form-control-wrap {
	display: block;
}

.ml-form .wpcf7-not-valid {
	border-color: var(--red);
}

.ml-form .wpcf7-not-valid-tip {
	margin-top: 4px;
	font-size: 12px;
	color: var(--red);
}

.ml-form .wpcf7-list-item {
	margin: 0;
}

.ml-form .wpcf7-response-output {
	margin: 16px 0 0 !important;
	padding: 12px 16px !important;
	font-size: 14px;
	border-width: 0 0 0 4px !important;
	background: #f6f7f9;
}

.ml-form.sent .wpcf7-response-output { border-color: #2e7d32 !important; }
.ml-form.invalid .wpcf7-response-output,
.ml-form.failed .wpcf7-response-output,
.ml-form.unaccepted .wpcf7-response-output { border-color: var(--red) !important; }

.ml-form .wpcf7-spinner {
	margin: 0 0 0 12px;
}

@media (max-width: 768px) {
	.ml-contact { grid-template-columns: 1fr; gap: 32px; }
}

.ml-contact a[href^="tel:"] {
	color: inherit;
}

/* Full-bleed bands inside page content (100vw includes the scrollbar → clip horizontally). */
body {
	overflow-x: clip;
}

.page .entry-content > .ml-newsletter {
	margin: 60px calc(50% - 50vw) -80px;
}

/* ---------- Distributors ---------- */

.ml-stores__map {
	height: 460px;
	margin: 0 0 36px;
	background: var(--light);
}

.ml-stores__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ml-store {
	padding: 18px 20px;
	font-size: 13px;
	line-height: 1.7;
	border: 1px solid #efefef;
}

.ml-store h3 {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 700;
	text-transform: none;
	letter-spacing: 0;
	color: var(--card-title);
}

.ml-store.is-active {
	border-color: var(--navy);
	box-shadow: 0 0 0 1px var(--navy);
}

.ml-store__focus {
	margin-top: 6px;
	padding: 0;
	font-size: 12px;
	color: var(--red);
	background: none;
	border: 0;
	text-decoration: underline;
	text-shadow: none;
}

.ml-store__focus:hover {
	color: var(--red-light);
	background: none;
}

@media (max-width: 900px) {
	.ml-stores__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
	.ml-stores__list { grid-template-columns: 1fr; }
	.ml-stores__map { height: 340px; }
}
