/*
Theme Name: CLUEGROUP
Theme URI: https://cluegroup.pl
Author: CLUEGROUP
Author URI: https://cluegroup.pl
Description: Autorski, lekki motyw blokowy agencji SEO CLUEGROUP. Minimalistyczna typografia, czysty kod, zero zbędnych zależności — zbudowany w całości na edytorze blokowym (Gutenberg) z myślą o wydajności i SEO.
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 7.4
Version: 1.1.9
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cluegroup
Tags: block-patterns, block-styles, full-site-editing, one-column, custom-colors, custom-logo, editor-style, translation-ready
*/

/* ==========================================================================
   CLUEGROUP — minimalne style uzupełniające theme.json
   ========================================================================== */

/* Płynne przewijanie do kotwic */
html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

/* Wyrównanie optyczne dużych nagłówków */
.wp-block-heading.is-style-cg-display,
h1,
h2 {
	text-wrap: balance;
}

/* Przyciski — subtelna animacja jak w minimalistycznych motywach */
.wp-block-button__link {
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
}

/* Logotypy klientów — wyciszone, kolor wraca po najechaniu */
.cg-logos img {
	filter: grayscale(1);
	opacity: 0.55;
	transition: filter 0.3s ease, opacity 0.3s ease;
}

.cg-logos img:hover {
	filter: grayscale(0);
	opacity: 1;
}

/* Slider logotypów — płynna karuzela bez JS (pauza po najechaniu) */
.cg-logo-slider {
	overflow: hidden;
	-webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
	mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.cg-logo-track {
	display: flex;
	width: max-content;
	animation: cg-marquee 70s linear infinite;
}

.cg-logo-slider:hover .cg-logo-track {
	animation-play-state: paused;
}

.cg-logo-set {
	align-items: center;
	display: flex;
	gap: 5.5rem;
	padding-right: 5.5rem;
}

.cg-logo-set img {
	display: block;
	height: 84px;
	max-width: none;
	width: auto;
}

@media screen and (max-width: 781px) {
	.cg-logo-set {
		gap: 3.5rem;
		padding-right: 3.5rem;
	}

	.cg-logo-set img {
		height: 60px;
	}
}

@keyframes cg-marquee {
	to {
		transform: translateX(-50%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cg-logo-track {
		animation: none;
	}

	.cg-logo-slider {
		-webkit-mask-image: none;
		mask-image: none;
		overflow-x: auto;
	}
}

/* Karty usług — cienka linia u góry, akcent po najechaniu */
.cg-card {
	border-top: 1px solid var(--wp--preset--color--contrast);
	transition: border-color 0.25s ease;
}

.cg-card:hover {
	border-top-color: var(--wp--preset--color--primary);
}

/* Przyklejony nagłówek z rozmyciem (sticky na wrapperze części szablonu) */
.wp-block-template-part:has(> .cg-header) {
	position: sticky;
	top: 0;
	z-index: 90;
}

body.admin-bar .wp-block-template-part:has(> .cg-header) {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .wp-block-template-part:has(> .cg-header) {
		top: 46px;
	}
}

.cg-header {
	background: rgba(255, 255, 255, 0.88) !important;
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	backdrop-filter: saturate(1.4) blur(10px);
}

/* Mobile: backdrop-filter wiezi position:fixed — wyłącz, gdy otwarte menu pełnoekranowe */
html.has-modal-open .cg-header,
.cg-header:has(.is-menu-open) {
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}

/* Social media w nagłówku — wyciszone, malinowe po najechaniu */
.cg-header-socials .wp-block-social-link a {
	transition: transform 0.2s ease;
}

.cg-header-socials .wp-block-social-link:hover a {
	color: var(--wp--preset--color--primary) !important;
	transform: translateY(-1px);
}

@media screen and (max-width: 781px) {
	.cg-header-socials {
		display: none !important;
	}
}

/* Rozwijana lista kategorii na blogu */
.cg-cat-dropdown {
	display: inline-block;
	margin-top: 1rem;
	position: relative;
	min-width: 260px;
}

.cg-cat-dropdown summary {
	border: 1px solid var(--wp--preset--color--contrast);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 0.9375rem;
	font-weight: 500;
	gap: 1.5rem;
	list-style: none;
	padding: 0.7rem 1.25rem;
	transition: border-color 0.25s ease;
}

.cg-cat-dropdown summary::-webkit-details-marker {
	display: none;
}

.cg-cat-dropdown summary .cg-cat-plus {
	color: var(--wp--preset--color--primary);
	transition: transform 0.25s ease;
}

.cg-cat-dropdown[open] summary .cg-cat-plus {
	transform: rotate(45deg);
}

.cg-cat-dropdown:hover summary {
	border-color: var(--wp--preset--color--primary);
}

.cg-cat-dropdown ul {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--gray-200);
	box-shadow: 0 14px 34px rgba(11, 11, 13, 0.08);
	list-style: none;
	margin: 0.35rem 0 0;
	padding: 0.5rem 0;
	position: absolute;
	left: 0;
	right: 0;
	z-index: 40;
}

.cg-cat-dropdown ul li a {
	color: var(--wp--preset--color--contrast);
	display: block;
	font-size: 0.9375rem;
	padding: 0.45rem 1.25rem;
	text-decoration: none;
}

.cg-cat-dropdown ul li a:hover {
	background: var(--wp--preset--color--rose);
	color: var(--wp--preset--color--primary);
}

/* Zdjęcia zespołu - jednolity kadr */
.cg-team-photo img {
	aspect-ratio: 3 / 4;
	object-fit: cover;
	width: 100%;
	height: auto;
}

/* Wizytówka osoby na stronach ofertowych */
.cg-person-photo img {
	border-radius: 50%;
	height: 104px;
	object-fit: cover;
	width: 104px;
}

/* Formularze - ukryj podetykiety (Pierwszy/Ostatni) */
.wpforms-field-sublabel {
	display: none !important;
}

/* Menu — wskaźnik podmenu „+" jak w Lulo */
.wp-block-navigation .wp-block-navigation__submenu-icon svg {
	display: none;
}

.wp-block-navigation .wp-block-navigation__submenu-icon::after {
	content: "+";
	display: inline-block;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.05em;
	font-weight: 500;
	line-height: 1;
	color: var(--wp--preset--color--primary);
	transition: transform 0.25s ease;
}

.wp-block-navigation-item.is-open .wp-block-navigation__submenu-icon::after,
li.wp-block-navigation-submenu:hover > .wp-block-navigation-item__content + button .wp-block-navigation__submenu-icon::after,
li.wp-block-navigation-submenu:hover > button .wp-block-navigation__submenu-icon::after {
	transform: rotate(45deg);
}

/* Rozwijane podmenu — czysta biała karta (tylko desktop; w mobilnej nakładce zwykła lista) */
@media screen and (min-width: 782px) {
	.wp-block-navigation .wp-block-navigation__submenu-container {
		border: 1px solid var(--wp--preset--color--gray-200) !important;
		border-radius: 0 !important;
		box-shadow: 0 14px 34px rgba(11, 11, 13, 0.08) !important;
		min-width: 250px !important;
		padding: 0.5rem 0 !important;
	}

	.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
		padding: 0.5rem 1.25rem !important;
	}
}

/* Formularze WPForms — spójne z motywem */
.wpforms-container input[type="text"],
.wpforms-container input[type="email"],
.wpforms-container input[type="url"],
.wpforms-container input[type="tel"],
.wpforms-container select,
.wpforms-container textarea {
	background: var(--wp--preset--color--base) !important;
	border: 1px solid var(--wp--preset--color--gray-200) !important;
	border-radius: 0 !important;
	color: var(--wp--preset--color--contrast) !important;
	font-family: inherit !important;
	padding: 0.7em 0.9em !important;
}

.wpforms-container input:focus,
.wpforms-container textarea:focus {
	border-color: var(--wp--preset--color--primary) !important;
	box-shadow: none !important;
}

.wpforms-container .wpforms-field-label {
	font-family: var(--wp--preset--font-family--heading) !important;
	font-size: 0.9375rem !important;
	font-weight: 500 !important;
}

.wpforms-container button[type="submit"],
.wpforms-form button[type="submit"],
.wpforms-submit {
	background: var(--wp--preset--color--primary) !important;
	border: 1px solid var(--wp--preset--color--primary) !important;
	border-radius: 0 !important;
	color: var(--wp--preset--color--base) !important;
	font-family: var(--wp--preset--font-family--heading) !important;
	font-size: 0.9375rem !important;
	font-weight: 500 !important;
	letter-spacing: 0.02em !important;
	padding: 0.85rem 2rem !important;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease !important;
}

.wpforms-container button[type="submit"]:hover,
.wpforms-form button[type="submit"]:hover,
.wpforms-submit:hover {
	background: var(--wp--preset--color--primary-dark) !important;
	border-color: var(--wp--preset--color--primary-dark) !important;
	color: var(--wp--preset--color--base) !important;
}

/* Nawigacja — dyskretne podkreślenie aktywnego linku */
.wp-block-navigation a:hover {
	color: var(--wp--preset--color--primary);
}

.wp-block-navigation .current-menu-item > a {
	color: var(--wp--preset--color--primary);
}

/* Karty opinii */
.cg-review {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--gray-200);
	height: 100%;
	margin: 0;
	padding: 1.75rem;
}

.cg-review cite {
	display: block;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.8125rem;
	font-style: normal;
	font-weight: 700;
	margin-top: 1rem;
}

/* Cytaty w stylu Lulo */
.wp-block-quote.is-style-cg-quote {
	border: 0;
	padding-left: 0;
}

.wp-block-quote.is-style-cg-quote p {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 300;
	line-height: 1.55;
}

.wp-block-quote.is-style-cg-quote cite {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-style: normal;
	font-weight: 700;
}

/* Obrazy wpisów — delikatne przybliżenie na listingu bloga */
.cg-post-card .wp-block-post-featured-image img {
	transition: transform 0.4s ease;
}

.cg-post-card:hover .wp-block-post-featured-image img {
	transform: scale(1.03);
}

/* Osadzenia w treściach (YouTube itp.) — nigdy szersze niż ekran */
.wp-block-post-content iframe {
	max-width: 100%;
}

.wp-block-post-content iframe[src*="youtube"] {
	aspect-ratio: 16 / 9;
	height: auto;
}

/* Wizytówka autorki pod wpisem */
.cg-author-box {
	align-items: flex-start;
	border-top: 1px solid var(--wp--preset--color--gray-200);
	display: flex;
	gap: 1.5rem;
	margin-top: var(--wp--preset--spacing--50);
	padding-top: 1.75rem;
}

.cg-author-photo {
	border-radius: 50%;
	flex: none;
	height: 96px;
	object-fit: cover;
	width: 96px;
}

.cg-author-text p {
	margin: 0;
}

.cg-author-kicker {
	color: var(--wp--preset--color--primary);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.cg-author-name {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.25rem;
	font-weight: 500;
	margin-top: 0.35rem !important;
}

.cg-author-name a {
	color: inherit;
	text-decoration: none;
}

.cg-author-name a:hover {
	color: var(--wp--preset--color--primary);
}

.cg-author-role {
	color: var(--wp--preset--color--gray-600);
	font-size: var(--wp--preset--font-size--small);
	margin-top: 0.35rem !important;
	max-width: 46rem;
}

@media screen and (max-width: 600px) {
	.cg-author-box {
		gap: 1rem;
	}

	.cg-author-photo {
		height: 72px;
		width: 72px;
	}
}

/* Tabele - na telefonie przewijane w sobie, ale z czytelnymi kolumnami */
@media screen and (max-width: 781px) {
	.wp-block-table table {
		min-width: 34rem;
	}
}

/* Bloki kodu - przewijane w sobie, żeby nie rozpychały strony na telefonie */
.wp-block-code {
	overflow-x: auto;
}

.wp-block-code code {
	white-space: pre;
}

/* Krótkie wstawki kodu w tekście - łamane, gdy nie mieszczą się w kolumnie */
:not(pre) > code {
	overflow-wrap: anywhere;
}

/* Szerokie wykresy - na mobile przewijane w poziomie zamiast nieczytelnego zmniejszania */
@media screen and (max-width: 781px) {
	.cg-chart {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.wp-block-image.cg-chart img {
		max-width: none;
		width: 760px;
	}

	.cg-chart figcaption {
		position: sticky;
		left: 0;
		width: 100%;
		max-width: 100vw;
	}
}

/* Tabele w treściach (słownik, cenniki) */
.wp-block-post-content table {
	border-collapse: collapse;
	width: 100%;
}

.wp-block-post-content td,
.wp-block-post-content th {
	border: 1px solid var(--wp--preset--color--gray-200);
	padding: 0.6em 0.9em;
	text-align: left;
}

/* Formularze (WPForms / CF7 itp.) — dziedziczą typografię motywu */
.wp-block-post-content input[type="text"],
.wp-block-post-content input[type="email"],
.wp-block-post-content input[type="url"],
.wp-block-post-content input[type="tel"],
.wp-block-post-content select,
.wp-block-post-content textarea {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--gray-200);
	border-radius: 0;
	color: var(--wp--preset--color--contrast);
	font-family: inherit;
	font-size: 1rem;
	padding: 0.7em 0.9em;
	width: 100%;
}

.wp-block-post-content input:focus,
.wp-block-post-content select:focus,
.wp-block-post-content textarea:focus {
	border-color: var(--wp--preset--color--primary);
	outline: 2px solid transparent;
}
