/*
Theme Name: Coffee Race
Theme URI: https://coffeerace.pl
Author: Coffee Race
Description: Motyw strony coffeerace.pl — wariant B z aplikacji (ciemny, Archivo, kształt squircle). Blog, eventy, podcast, aplikacja.
Version: 0.1.0
Requires at least: 6.6
Requires PHP: 8.1
License: Proprietary
Text Domain: coffeerace
*/

/* Kształt squircle (superelipsa n = 4) tam, gdzie przeglądarka go obsługuje; reszta dostaje zwykłe zaokrąglenie. */
@supports (corner-shape: squircle) {
	.is-style-squircle,
	.cr-tile,
	.cr-card,
	.wp-block-post-featured-image img,
	.wp-block-button__link:not(.is-pill .wp-block-button__link) {
		corner-shape: squircle;
	}
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--wp--preset--color--primary); color: var(--wp--preset--color--on-light); }
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}
img { height: auto; max-width: 100%; }

/* ── Nagłówek ─────────────────────────────────────────────── */
.cr-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--wp--preset--color--bg) 82%, transparent);
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
	border-bottom: 1px solid var(--wp--preset--color--line-soft);
}
.cr-logo { display: inline-flex; color: var(--wp--preset--color--ink); }
.cr-logo svg { width: 96px; height: auto; display: block; }
.cr-header .wp-block-navigation a { text-decoration: none; }
.cr-header .wp-block-navigation a:hover { color: var(--wp--preset--color--primary-text); }
.cr-header .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--primary-text); }
.cr-lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: 28px; background: var(--wp--preset--color--surface); font-size: 12px; font-weight: 800; }
.cr-lang a { min-width: 36px; min-height: 30px; display: grid; place-items: center; border-radius: 28px; color: var(--wp--preset--color--muted); text-decoration: none; }
.cr-lang a[aria-current="true"] { background: var(--wp--preset--color--on-light); color: var(--wp--preset--color--star); }
@media (max-width: 781px) {
	.cr-header .cr-header__cta { display: none; }
}

/* ── Etykieta nad tytułem sekcji ──────────────────────────── */
.cr-overline {
	font-size: 12px !important;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary-text);
}

/* ── Hero ─────────────────────────────────────────────────── */
.cr-hero { position: relative; overflow: hidden; }
.cr-hero__title { font-size: clamp(48px, 9vw, 120px) !important; line-height: 0.92 !important; letter-spacing: -0.035em !important; }
.cr-hero__title em { font-style: normal; color: var(--wp--preset--color--primary); }
.cr-hero__glow {
	position: absolute; inset: auto -20% -60% auto; width: 70vw; aspect-ratio: 1; pointer-events: none;
	background: radial-gradient(closest-side, color-mix(in srgb, var(--wp--preset--color--primary) 28%, transparent), transparent);
	filter: blur(20px);
}
.cr-stats { gap: 0 !important; border-top: 1px solid var(--wp--preset--color--line); }
.cr-stats > * { padding-top: 20px; }
.cr-stat__num { font-size: clamp(32px, 4vw, 48px) !important; font-weight: 900; letter-spacing: -0.02em; line-height: 1 !important; }

/* ── Kafelki (jak ekran główny aplikacji) ─────────────────── */
.cr-tiles { gap: 12px !important; }
.cr-tile {
	position: relative;
	min-height: 260px;
	padding: 22px !important;
	border-radius: 58px;
	color: var(--wp--preset--color--on-light);
	display: flex !important;
	flex-direction: column;
	justify-content: space-between;
	text-decoration: none;
	transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
@supports not (corner-shape: squircle) { .cr-tile { border-radius: 40px; } }
.cr-tile:hover { transform: translateY(-4px); }
.cr-tile a { color: inherit; text-decoration: none; }
.cr-tile a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cr-tile__top { display: flex; justify-content: space-between; align-items: flex-start; }
.cr-tile__num { font-size: 15px; font-weight: 800; }
.cr-tile__icon { width: 40px; height: 40px; border-radius: 12px; background: var(--wp--preset--color--on-light); display: grid; place-items: center; }
.cr-tile__icon svg { width: 22px; height: 22px; }
.cr-tile h3 { margin: 0; font-size: clamp(26px, 2.6vw, 34px); font-weight: 900; letter-spacing: -0.02em; line-height: 1; }
.cr-tile p { margin: 8px 0 0; font-size: 14px; font-weight: 600; opacity: .8; }
.cr-tile--ev   { background: conic-gradient(from 0deg at 72% 30%, #ff8a73 0deg, #fd8f71 45deg, #ff9d6e 135deg, #ffa46b 180deg, #feab68 225deg, #ffb868 315deg, #ffbd66 360deg); }
.cr-tile--ev .cr-tile__icon { color: #ffbd66; }
.cr-tile--cafe { background: conic-gradient(from 0deg at 72% 30%, #5c3288 0deg, #663d8c 45deg, #8c6cb8 135deg, #7c92b7 180deg, #79abb9 225deg, #6dd4b9 315deg, #68e1bb 360deg); }
.cr-tile--cafe .cr-tile__icon { color: #68e1bb; }
.cr-tile--bike { background: conic-gradient(from 0deg at 72% 30%, #3f5845 0deg, #4e6948 45deg, #728f4c 135deg, #87aa4c 180deg, #a1c250 225deg, #c6e951 315deg, #d3fa53 360deg); }
.cr-tile--bike .cr-tile__icon { color: #d3fa53; }
.cr-tile--kb   { background: conic-gradient(from 0deg at 72% 30%, #672149 0deg, #73254f 45deg, #91325b 135deg, #a03661 180deg, #af3e68 225deg, #ce4873 315deg, #d84d78 360deg); color: var(--wp--preset--color--cream); }
.cr-tile--kb .cr-tile__icon { color: #d84d78; }
.cr-tile--blog { background: conic-gradient(from 0deg at 72% 30%, #5b1fe0 0deg, #6320d6 45deg, #9557ba 135deg, #a76db0 180deg, #b67da6 225deg, #dba694 315deg, #ecb98a 360deg); }
.cr-tile--blog .cr-tile__icon { color: #ecb98a; }

/* ── Karty (wpisy, eventy) ────────────────────────────────── */
.cr-card { border-radius: 28px; background: var(--wp--preset--color--surface); overflow: hidden; height: 100%; transition: transform .25s cubic-bezier(.2,.8,.2,1), background .2s; position: relative; }
.cr-card:hover { transform: translateY(-4px); background: var(--wp--preset--color--surface-2); }
.cr-card .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; }
.cr-card .wp-block-post-title a { text-decoration: none; }
.cr-card .wp-block-post-featured-image { margin: 0; }
.cr-card .wp-block-post-featured-image img { border-radius: 0; }
.cr-card .wp-block-post-terms a { position: relative; z-index: 1; }
.wp-block-post-template.is-layout-grid { gap: 16px; }

.cr-chip, .cr-card .wp-block-post-terms a {
	display: inline-block; padding: 5px 10px; border-radius: 28px;
	background: var(--wp--preset--color--primary-tint); color: var(--wp--preset--color--primary-text);
	font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
}
.cr-card .wp-block-post-terms__separator { display: none; }

/* Event: data w kwadracie */
.cr-event__date { min-width: 76px; text-align: center; padding: 10px 8px; border-radius: 18px; background: var(--wp--preset--color--primary); color: var(--wp--preset--color--on-light); }
.cr-event__date .d { display: block; font-size: 30px; font-weight: 900; line-height: 1; }
.cr-event__date .m { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.cr-event-row { border-top: 1px solid var(--wp--preset--color--line); }
.cr-event-row:hover .wp-block-post-title a { color: var(--wp--preset--color--primary-text); }
.cr-event-row .wp-block-post-title a { text-decoration: none; }
.cr-event-row .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; }
.cr-event-row { position: relative; }
.cr-meta { color: var(--wp--preset--color--muted); font-size: 14px; }
.cr-meta strong { color: var(--wp--preset--color--ink); }

/* ── Sekcja aplikacji ─────────────────────────────────────── */
.cr-app { border-radius: 58px; overflow: hidden; position: relative; }
@supports not (corner-shape: squircle) { .cr-app { border-radius: 40px; } }
.cr-app__icon img { border-radius: 52px; box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.cr-checklist { list-style: none; padding: 0; margin: 0; }
.cr-checklist li { padding: 12px 0 12px 34px; border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent); position: relative; font-weight: 600; }
.cr-checklist li::before { content: ""; position: absolute; left: 0; top: 14px; width: 20px; height: 20px; border-radius: 6px; background: var(--wp--preset--color--on-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='%23b5e27b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }

/* ── Spotify ──────────────────────────────────────────────── */
.cr-spotify iframe { width: 100%; border: 0; border-radius: 16px; display: block; }

/* ── Treść wpisu ──────────────────────────────────────────── */
.cr-prose > * + * { margin-block-start: 1.2em; }
.cr-prose a { color: var(--wp--preset--color--primary-text); text-underline-offset: 3px; }
.cr-prose img, .cr-prose .wp-block-image img { border-radius: 18px; }
.cr-prose blockquote { border-left: 3px solid var(--wp--preset--color--primary); padding-left: 20px; margin-left: 0; font-size: 1.15em; font-weight: 700; }
.cr-prose figcaption { color: var(--wp--preset--color--muted); font-size: 13px; text-align: center; }

/* ── Paginacja ────────────────────────────────────────────── */
.wp-block-query-pagination { gap: 8px; }
.wp-block-query-pagination a, .wp-block-query-pagination .page-numbers { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; border-radius: 12px; background: var(--wp--preset--color--surface); text-decoration: none; padding: 0 12px; }
.wp-block-query-pagination .page-numbers.current { background: var(--wp--preset--color--primary); color: var(--wp--preset--color--on-light); }

/* ── Stopka ───────────────────────────────────────────────── */
.cr-footer__big { font-size: clamp(56px, 12vw, 180px) !important; line-height: .85 !important; letter-spacing: -0.04em !important; font-weight: 900; color: var(--wp--preset--color--surface-2); }
.cr-footer a { text-decoration: none; }
.cr-footer a:hover { color: var(--wp--preset--color--primary-text); }
.cr-social { display: flex; gap: 8px; flex-wrap: wrap; }
.cr-social a { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink); }
.cr-social a:hover { background: var(--wp--preset--color--primary); color: var(--wp--preset--color--on-light) !important; }
.cr-social svg { width: 20px; height: 20px; }

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}

.cr-event-row__arrow { width: 44px; height: 44px; display: grid; place-items: center; flex-shrink: 0; border-radius: 14px; background: var(--wp--preset--color--surface); transition: background .2s, color .2s; }
.cr-event-row__arrow svg { width: 20px; height: 20px; }
.cr-event-row:hover .cr-event-row__arrow { background: var(--wp--preset--color--primary); color: var(--wp--preset--color--on-light); }
.cr-event-row .wp-block-post-title { margin: 0; }
.cr-event__date p { margin: 0; }

/* Filtr kategorii bloga (pigułki) */
.cr-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.cr-filter a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 18px; border-radius: 28px; background: var(--wp--preset--color--surface); font-size: 14px; font-weight: 700; text-decoration: none; }
.cr-filter a:hover { background: var(--wp--preset--color--surface-2); color: var(--wp--preset--color--ink); }
.cr-filter a[aria-current="page"] { background: var(--wp--preset--color--primary); color: var(--wp--preset--color--on-light); }
.wp-block-post-terms.cr-terms a { display: inline-block; padding: 5px 10px; border-radius: 28px; background: var(--wp--preset--color--primary-tint); color: var(--wp--preset--color--primary-text); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; }
.wp-block-post-terms.cr-terms .wp-block-post-terms__separator { display: none; }
.wp-block-post-navigation-link { font-weight: 800; }
.wp-block-post-navigation-link a { text-decoration: none; }

/* Kroki „Jak to działa” */
.cr-steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; counter-reset: step; }
.cr-steps li { padding: 24px; counter-increment: step; }
.cr-steps li::before { content: counter(step, decimal-leading-zero) "."; display: block; font-size: 15px; font-weight: 800; color: var(--wp--preset--color--primary-text); margin-bottom: 40px; }
.cr-steps h3 { margin: 0 0 8px; font-size: 24px; }
.cr-steps p { margin: 0; color: var(--wp--preset--color--muted); font-size: 15px; }

/* FAQ */
.cr-faq { border-top: 1px solid var(--wp--preset--color--line); padding: 4px 0; }
.cr-faq summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 18px; font-weight: 800; cursor: pointer; list-style: none; padding: 14px 0; }
.cr-faq summary::-webkit-details-marker { display: none; }
.cr-faq summary::after { content: "+"; font-size: 26px; font-weight: 400; color: var(--wp--preset--color--primary-text); transition: transform .2s; }
.cr-faq[open] summary::after { transform: rotate(45deg); }
.cr-faq p { color: var(--wp--preset--color--muted); margin-top: 0; }
.wp-block-embed-spotify iframe { border-radius: 16px; }

@media (max-width: 600px) {
	.cr-tiles { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
	.cr-tile { min-height: 180px; padding: 16px !important; border-radius: 40px; }
	.cr-tile h3 { font-size: 22px; }
	.cr-tile p { font-size: 12px; }
	.cr-stats > * { padding-right: 8px; }
	.cr-stat__num + p { font-size: 12px !important; }
	.cr-event__date { min-width: 60px; }
	.cr-event__date .d { font-size: 24px; }
	.cr-event-row__arrow { display: none; }
}

/* O nas: trzy wartości */
.cr-values { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.cr-values li { padding: 24px; }
.cr-values__icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--wp--preset--color--primary); color: var(--wp--preset--color--on-light); margin-bottom: 32px; }
.cr-values__icon svg { width: 22px; height: 22px; }
.cr-values h3 { margin: 0 0 6px; font-size: 24px; }
.cr-values p { margin: 0; color: var(--wp--preset--color--muted); font-size: 15px; }
.cr-contact:hover { transform: none; }
.cr-contact h2 a { text-decoration: none; color: var(--wp--preset--color--ink); overflow-wrap: anywhere; }
.cr-contact h2 a:hover { color: var(--wp--preset--color--primary-text); }
.cr-episodes { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }

/* ── Partnerzy: karuzela logotypów ────────────────────────── */
.cr-partners {
	display: flex;
	overflow: hidden;
	margin-top: 16px;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.cr-partners__track {
	display: flex;
	flex-shrink: 0;
	gap: 12px;
	margin: 0;
	padding: 0 12px 0 0;
	list-style: none;
	animation: cr-marquee var(--cr-marquee-duration, 30s) linear infinite;
}
.cr-partners:hover .cr-partners__track,
.cr-partners:focus-within .cr-partners__track { animation-play-state: paused; }
.cr-partners__item > * {
	width: 180px;
	height: 96px;
	display: grid;
	place-items: center;
	padding: 14px 22px;
	border-radius: 24px;
	background: var(--wp--preset--color--cream);
	transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
@supports (corner-shape: squircle) { .cr-partners__item > * { corner-shape: squircle; border-radius: 32px; } }
.cr-partners__item a:hover { transform: translateY(-3px); }
.cr-partners__item img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; mix-blend-mode: multiply; }
@keyframes cr-marquee { to { transform: translateX(-100%); } }
@media (max-width: 600px) {
	.cr-partners__item > * { width: 140px; height: 76px; padding: 10px 16px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) {
	.cr-partners { -webkit-mask-image: none; mask-image: none; }
	.cr-partners__track { animation: none; flex-wrap: wrap; flex-shrink: 1; justify-content: center; padding: 0 16px; }
	.cr-partners__track[aria-hidden="true"] { display: none; }
}

/* ── Zgoda na cookies ─────────────────────────────────────── */
.cr-consent {
	position: fixed;
	z-index: 100;
	left: 16px;
	bottom: max(16px, env(safe-area-inset-bottom));
	width: min(520px, calc(100vw - 32px));
	max-height: calc(100dvh - 32px);
	overflow: auto;
	padding: 22px;
	border-radius: 28px;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
	color: var(--wp--preset--color--ink);
	animation: cr-consent-in .35s cubic-bezier(.2,.8,.2,1);
}
@supports (corner-shape: squircle) { .cr-consent { corner-shape: squircle; border-radius: 44px; } }
.cr-consent[hidden] { display: none; }
@keyframes cr-consent-in { from { opacity: 0; transform: translateY(16px); } }
.cr-consent__title { margin: 0 0 8px; font-size: 20px; font-weight: 900; letter-spacing: -.01em; }
.cr-consent__text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--wp--preset--color--muted); }
.cr-consent__text a { color: var(--wp--preset--color--primary-text); }
.cr-consent__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.cr-consent__btn {
	min-height: 44px; padding: 0 18px; border-radius: 14px; cursor: pointer;
	font: inherit; font-size: 14px; font-weight: 800;
	border: 2px solid var(--wp--preset--color--line); background: transparent; color: var(--wp--preset--color--ink);
}
.cr-consent__btn.is-primary { background: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary); color: var(--wp--preset--color--on-light); }
.cr-consent__btn:hover { border-color: var(--wp--preset--color--cream); }
.cr-consent__btn[hidden], .cr-consent__link[hidden] { display: none; }
.cr-consent__link, .cr-linkbtn {
	min-height: 44px; padding: 0 6px; border: 0; background: none; cursor: pointer;
	font: inherit; font-size: 14px; font-weight: 700; color: var(--wp--preset--color--ink); text-decoration: underline; text-underline-offset: 3px;
}
.cr-linkbtn { min-height: 0; padding: 0; font-size: inherit; font-weight: inherit; color: inherit; }
.cr-linkbtn:hover, .cr-consent__link:hover { color: var(--wp--preset--color--primary-text); }
.cr-consent__prefs { display: grid; gap: 8px; margin-top: 16px; }
.cr-consent__prefs[hidden] { display: none; }
.cr-switch { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: var(--wp--preset--color--surface-2); font-size: 13px; line-height: 1.4; color: var(--wp--preset--color--muted); cursor: pointer; }
.cr-switch strong { display: block; color: var(--wp--preset--color--ink); font-size: 14px; }
.cr-switch.is-locked { cursor: default; opacity: .75; }
.cr-switch input { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--wp--preset--color--primary); }
@media (max-width: 600px) {
	.cr-consent { left: 8px; right: 8px; width: auto; bottom: max(8px, env(safe-area-inset-bottom)); padding: 18px; }
	.cr-consent__btn { flex: 1 1 140px; }
}

/* Zaślepka odtwarzacza do czasu zgody */
.cr-gate { display: grid; place-items: center; min-height: 152px; padding: 20px; border-radius: 16px; background: var(--wp--preset--color--surface-2); text-align: center; }
.cr-gate__ph { max-width: 420px; }
.cr-gate__title { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.cr-gate__text { margin: 0; font-size: 13px; color: var(--wp--preset--color--muted); }
.cr-gate__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin-top: 12px; font-size: 14px; font-weight: 700; }
.cr-gate__actions a { color: var(--wp--preset--color--primary-text); }
.cr-gate__btn { min-height: 44px; padding: 0 18px; border: 0; border-radius: 14px; cursor: pointer; font: inherit; font-weight: 800; background: var(--wp--preset--color--primary); color: var(--wp--preset--color--on-light); }
.has-surface-background-color .cr-gate { background: var(--wp--preset--color--bg); }

/* Tabela (polityka prywatności) */
.cr-table-wrap { overflow-x: auto; }
.cr-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cr-table th, .cr-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--wp--preset--color--line); vertical-align: top; }
.cr-table th { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--wp--preset--color--muted); }
.cr-table td:nth-child(2) { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; white-space: nowrap; }
.cr-todo { padding: 14px 16px; border-radius: 14px; background: var(--wp--preset--color--primary-tint); color: var(--wp--preset--color--primary-text); font-weight: 700; font-size: 14px; }
