/*
Theme Name: KeySpot
Theme URI: https://keyspot.pl
Author: KeySpot
Description: Motyw blokowy strony sprzedażowej KeySpot – ewidencji kluczy dla zarządców najmu, administratorów budynków, biur nieruchomości i najmu krótkoterminowego. Wszystkie sekcje są wzorcami bloków edytowalnymi w Gutenbergu i Edytorze witryny.
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.0
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: keyspot
Tags: block-patterns, full-site-editing, block-styles, wide-blocks, one-column, custom-colors, editor-style
*/

/* ==========================================================================
   Podstawy
   ========================================================================== */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
body { -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { text-wrap: balance; }
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--brass);
	outline-offset: 3px;
}
.wp-block-button__link { transition: transform .15s ease, background-color .15s ease; }
.wp-block-button__link:hover { transform: translateY(-1px); }

/* Tekst na ciemnych sekcjach */
.has-ink-background-color, .has-ink-2-background-color, .has-ink-3-background-color { color: var(--wp--preset--color--white); }
:where(.has-ink-background-color, .has-ink-2-background-color, .has-ink-3-background-color) a:where(:not(.wp-element-button)) { color: var(--wp--preset--color--brass); }

/* ==========================================================================
   Nagłówek
   ========================================================================== */
.ks-header {
	position: sticky;
	top: 0;
	z-index: 50;
	backdrop-filter: saturate(1.4) blur(12px);
	-webkit-backdrop-filter: saturate(1.4) blur(12px);
	border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.admin-bar .ks-header { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .ks-header { top: 0; } }
.ks-header .wp-block-navigation a { color: var(--wp--preset--color--muted-dark); }
.ks-header .wp-block-navigation a:hover,
.ks-header .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--white); }
.ks-header .wp-block-navigation__submenu-container { background: var(--wp--preset--color--ink-2) !important; border: 1px solid var(--wp--preset--color--line-dark) !important; border-radius: 12px; padding: 6px; }
.ks-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--ink) !important; color: #fff !important; }
.ks-header .wp-block-navigation__responsive-container.is-menu-open a { color: #fff; font-size: 1.15rem; }
.ks-header .ks-header__login { margin: 0; }
.ks-header .ks-header__login a { color: #fff; text-decoration: none; font-weight: 500; font-size: .95rem; }
.ks-header .wp-block-button__link { padding: 11px 18px; font-size: .93rem; }
@media (max-width: 600px) {
	.ks-header .ks-header__login { display: none; }
	.ks-header .wp-block-button__link { padding: 10px 14px; font-size: .88rem; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.ks-hero { position: relative; overflow: hidden; }
.ks-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		radial-gradient(60% 50% at 85% 10%, rgba(227, 165, 58, .16), transparent 70%),
		linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 100% 44px;
}
.ks-hero > * { position: relative; }
.ks-hero h1 mark, .ks-accent { background: none; color: var(--wp--preset--color--brass); }
.ks-hero .ks-mockup { margin-bottom: -1px; }
@media (max-width: 781px) { .ks-hero .ks-mockup { margin-top: 1rem; } }

/* ==========================================================================
   Style bloków (rejestrowane w functions.php)
   ========================================================================== */

/* Akapit: nadtytuł */
.is-style-eyebrow {
	font-family: var(--wp--preset--font-family--mono);
	font-size: .78rem !important;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brass-ink);
	margin-bottom: 0 !important;
}
:where(.has-ink-background-color, .has-ink-2-background-color, .has-ink-3-background-color, .is-style-card-dark) .is-style-eyebrow { color: var(--wp--preset--color--brass); }

/* Akapit: identyfikator klucza (brelok) */
.is-style-keytag {
	display: inline-flex !important;
	align-items: center;
	gap: 10px;
	width: auto;
	background: var(--wp--preset--color--brass);
	color: var(--wp--preset--color--ink) !important;
	font-family: var(--wp--preset--font-family--mono);
	font-weight: 600;
	font-size: .82rem !important;
	line-height: 1;
	padding: 9px 14px 9px 10px;
	border-radius: 6px 999px 999px 6px;
}
.is-style-keytag::before {
	content: "";
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--wp--preset--color--paper);
	box-shadow: inset 0 0 0 2px rgba(12, 26, 43, .35);
	flex: none;
}

/* Akapit: plakietka */
.is-style-badge {
	display: inline-block;
	background: var(--wp--preset--color--brass);
	color: var(--wp--preset--color--ink) !important;
	font-family: var(--wp--preset--font-family--mono);
	font-weight: 600;
	font-size: .72rem !important;
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: 7px 10px;
	border-radius: 999px;
	line-height: 1;
}

/* Akapit: notatka do uzupełnienia */
.is-style-placeholder, .ks-todo {
	background: var(--wp--preset--color--brass-tint);
	color: var(--wp--preset--color--brass-ink) !important;
	font-family: var(--wp--preset--font-family--mono);
	font-size: .85em;
	padding: 2px 6px;
	border-radius: 4px;
}

/* Nagłówek: duża liczba */
.is-style-stat {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 800 !important;
	color: var(--wp--preset--color--brass);
	letter-spacing: -.03em;
	font-variant-numeric: tabular-nums;
	line-height: 1 !important;
}

/* Grupa: karta jasna / ciemna */
.is-style-card {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 20px;
	color: var(--wp--preset--color--ink);
}
.is-style-card-dark {
	background: var(--wp--preset--color--ink-2);
	border: 1px solid var(--wp--preset--color--line-dark);
	border-radius: 20px;
	color: var(--wp--preset--color--white);
}
.is-style-card-dark p:not(.is-style-eyebrow):not(.is-style-badge) { color: var(--wp--preset--color--muted-dark); }
.is-style-card-dark :is(h2, h3, h4, strong) { color: var(--wp--preset--color--white); }
.is-style-card-highlight {
	background: var(--wp--preset--color--ink);
	border-radius: 20px;
	color: var(--wp--preset--color--white);
	position: relative;
}
.is-style-card-highlight p:not(.is-style-badge):not(.is-style-eyebrow) { color: var(--wp--preset--color--muted-dark); }
.is-style-card-highlight :is(h2, h3, h4, strong, li) { color: var(--wp--preset--color--white); }

/* Grupa: kartka z zeszytu (porównanie) */
.is-style-notebook {
	background: repeating-linear-gradient(0deg, transparent 0 31px, #E7ECF2 31px 32px), #FAFBFC;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 20px;
}

/* Grupa: siatka z liniami (funkcje) */
.is-style-hairline-grid { gap: 1px !important; background: var(--wp--preset--color--line); border: 1px solid var(--wp--preset--color--line); border-radius: 20px; overflow: hidden; }
.is-style-hairline-grid > * { background: var(--wp--preset--color--white); margin: 0 !important; }

/* Grupa: krok (linia u góry) */
.is-style-step { border-top: 2px solid var(--wp--preset--color--line); }

/* Listy: ✓ ✕ → */
ul:is(.is-style-checks, .is-style-crosses, .is-style-arrows) { list-style: none; padding-left: 0; display: grid; gap: .7rem; }
ul:is(.is-style-checks, .is-style-crosses, .is-style-arrows) > li { position: relative; padding-left: 1.9rem; line-height: 1.45; }
ul:is(.is-style-checks, .is-style-crosses, .is-style-arrows) > li::before { position: absolute; left: 0; top: 0; font-weight: 700; font-family: var(--wp--preset--font-family--mono); }
ul.is-style-checks > li::before { content: "✓"; color: var(--wp--preset--color--ok); }
ul.is-style-crosses > li::before { content: "✕"; color: var(--wp--preset--color--late); }
ul.is-style-arrows > li::before { content: "→"; color: var(--wp--preset--color--brass); }
:where(.has-ink-background-color, .has-ink-2-background-color, .is-style-card-dark, .is-style-card-highlight) ul.is-style-checks > li::before { color: var(--wp--preset--color--brass); }
ul.is-style-checks > li:has(> s)::before { content: "–"; color: var(--wp--preset--color--muted); }
ul.is-style-checks > li > s { text-decoration: none; opacity: .55; }
.is-style-notebook ul.is-style-crosses > li { font-family: "Segoe Print", "Bradley Hand", var(--wp--preset--font-family--body); color: #4A5868; }

/* Przyciski */
.wp-block-button.is-style-ghost .wp-block-button__link { background: transparent; color: var(--wp--preset--color--white); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .3); }
.wp-block-button.is-style-ghost .wp-block-button__link:hover { box-shadow: inset 0 0 0 1.5px #fff; }
.wp-block-button.is-style-light .wp-block-button__link { background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink); box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--line); }
.wp-block-button.is-style-dark .wp-block-button__link { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--white); }
.wp-block-button.is-style-light .wp-block-button__link:hover, .wp-block-button.is-style-dark .wp-block-button__link:hover { filter: brightness(1.08); }

/* Obraz: mockup / ikona */
.is-style-mockup img { border-radius: 20px 20px 0 0; }
.is-style-icon img { width: 48px; height: 48px; display: block; }

/* FAQ (blok Szczegóły) */
.wp-block-details summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1.25rem; font-weight: 600; font-size: 1.08rem; line-height: 1.4; }
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after { content: "+"; font: 500 1.5rem/1 var(--wp--preset--font-family--mono); color: var(--wp--preset--color--brass-ink); transition: transform .2s; flex: none; }
.wp-block-details[open] summary::after { transform: rotate(45deg); }
.wp-block-details > :not(summary) { margin-top: .75rem; color: var(--wp--preset--color--muted); }

/* Sekcje stykają się bez przerw (odstęp bloków dotyczy treści, nie pasów) */
.wp-site-blocks > * + * { margin-block-start: 0; }
.wp-block-post-content > .alignfull { margin-block-start: 0 !important; margin-block-end: 0 !important; }

/* Liczby w kolumnach */
.ks-tnum { font-variant-numeric: tabular-nums; }

/* Karta planu: wyróżnienie */
.ks-plan-hot { position: relative; }
.ks-plan-hot > .is-style-badge:first-child { position: absolute; top: -12px; left: 24px; margin: 0; }
.ks-price { font-family: var(--wp--preset--font-family--display); font-weight: 800; font-size: 2.2rem !important; letter-spacing: -.03em; line-height: 1 !important; }
.ks-plan-buttons { margin-top: auto !important; }
.ks-plans > .wp-block-group { display: flex; flex-direction: column; }
.ks-plans > .wp-block-group > .wp-block-list { flex: 1; }

/* Wpisy na blogu */
.ks-post-card { height: 100%; }
.ks-post-card .wp-block-post-featured-image img { border-radius: 12px; aspect-ratio: 16 / 10; object-fit: cover; }
.ks-post-card .wp-block-post-title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.ks-post-card .wp-block-post-title a:hover { color: var(--wp--preset--color--brass-ink); }
.wp-block-post-content > p, .wp-block-post-content > ul, .wp-block-post-content > ol { max-width: 68ch; }

/* ==========================================================================
   Contact Form 7
   ========================================================================== */
.ks-form { background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink); border-radius: 20px; }
.wpcf7 form { display: grid; gap: 14px; }
.wpcf7 form p { margin: 0; }
.wpcf7 label { display: grid; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--wp--preset--color--ink); }
.wpcf7 :is(input[type="text"], input[type="email"], input[type="tel"], select, textarea) {
	font: inherit;
	font-size: 1rem;
	font-weight: 400;
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--wp--preset--color--line);
	border-radius: 10px;
	background: #fff;
	color: var(--wp--preset--color--ink);
	box-sizing: border-box;
}
.wpcf7 textarea { min-height: 110px; resize: vertical; }
.wpcf7 :is(input, select, textarea):focus { border-color: var(--wp--preset--color--brass); outline: none; }
.wpcf7 .wpcf7-form-control-wrap { display: block; }
.wpcf7 .ks-row2 > p { display: contents; }
.wpcf7 .ks-row2 br { display: none; }
.wpcf7 .ks-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 480px) { .wpcf7 .ks-row2 { grid-template-columns: minmax(0, 1fr); } }
.wpcf7 .wpcf7-acceptance label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: .8rem; color: var(--wp--preset--color--muted); }
.wpcf7 input[type="submit"] {
	font: 600 1rem/1 var(--wp--preset--font-family--body);
	background: var(--wp--preset--color--brass);
	color: var(--wp--preset--color--ink);
	border: 0;
	border-radius: 999px;
	padding: 15px 22px;
	cursor: pointer;
	width: 100%;
}
.wpcf7 input[type="submit"]:hover { background: var(--wp--preset--color--brass-hi); }
.wpcf7 .wpcf7-not-valid-tip { font-size: .8rem; color: var(--wp--preset--color--late); }
.wpcf7 form .wpcf7-response-output { margin: 0; border-radius: 10px; padding: 12px 14px; font-size: .9rem; }
.wpcf7 .wpcf7-spinner { display: none; }

/* ==========================================================================
   Stopka
   ========================================================================== */
.ks-footer a { color: var(--wp--preset--color--muted-dark); text-decoration: none; }
.ks-footer a:hover { color: var(--wp--preset--color--white); }
.ks-footer h4 { margin-bottom: .9rem !important; }
.ks-footer .ks-footer__links { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
