/* ==========================================================================
   Base — Wesave
   Reset, typografia globalna, layout, nawigacja, stopka, dostępność.
   Wymaga wcześniej wczytanych: fonts.css, tokens.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Reset i podstawy
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--ws-bg);
	color: var(--ws-ink);
	font-family: var(--ws-font-body);
	font-size: var(--ws-text-base);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--ws-accent);
	text-decoration: none;
	transition: color var(--ws-transition);
}

a:hover,
a:focus {
	color: var(--ws-accent-hover);
}

button {
	font-family: inherit;
	cursor: pointer;
}

/* --------------------------------------------------------------------------
   2. Typografia
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--ws-font-head);
	color: var(--ws-ink);
	line-height: 1.2;
	letter-spacing: -0.015em;
	margin: 0 0 var(--ws-space-4);
	font-weight: 700;
}

h1 { font-size: var(--ws-text-4xl); }
h2 { font-size: var(--ws-text-3xl); }
h3 { font-size: var(--ws-text-2xl); }

p { margin: 0 0 var(--ws-space-5); }

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */
.ws-container {
	width: 100%;
	max-width: var(--ws-container);
	margin-inline: auto;
	padding-inline: var(--ws-space-5);
}

.ws-site-content {
	min-height: 40vh;
}

/* --------------------------------------------------------------------------
   4. Dostępność (a11y)
   -------------------------------------------------------------------------- */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	word-wrap: normal !important;
}

.ws-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	background: var(--ws-ink);
	color: var(--ws-on-dark);
	padding: var(--ws-space-3) var(--ws-space-4);
	border-radius: 0 0 var(--ws-radius) 0;
}

.ws-skip-link:focus {
	left: 0;
	color: var(--ws-on-dark);
}

:focus-visible {
	outline: 2px solid var(--ws-accent);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   5. Pasek postępu czytania
   -------------------------------------------------------------------------- */
.ws-progress {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 20;
	height: 3px;
	background: var(--ws-line-soft);
}

.ws-progress__bar {
	height: 100%;
	width: 0;
	background: var(--ws-accent);
	transition: width 0.1s linear;
}

/* --------------------------------------------------------------------------
   6. Pasek górny (najnowsze artykuły)
   -------------------------------------------------------------------------- */
.ws-topbar {
	background: var(--ws-ink);
	color: var(--ws-on-dark-soft);
	font-size: var(--ws-text-xs);
}

.ws-topbar__inner {
	display: flex;
	align-items: center;
	gap: var(--ws-space-5);
	min-height: 36px;
}

.ws-topbar__label {
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ws-accent);
	flex-shrink: 0;
}

.ws-topbar__list {
	display: flex;
	gap: var(--ws-space-5);
	margin: 0;
	padding: 0;
	list-style: none;
	overflow: hidden;
	flex: 1;
	min-width: 0;
}

.ws-topbar__list li {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ws-topbar__list a {
	color: var(--ws-on-dark-soft);
}

.ws-topbar__list a:hover,
.ws-topbar__list a:focus {
	color: var(--ws-on-dark);
}

.ws-topbar__actions {
	display: flex;
	gap: var(--ws-space-4);
	flex-shrink: 0;
	margin-left: auto;
}

.ws-topbar__actions a { color: var(--ws-on-dark-soft); }
.ws-topbar__actions a:last-child { color: var(--ws-on-dark); }

/* --------------------------------------------------------------------------
   7. Nagłówek główny + nawigacja
   -------------------------------------------------------------------------- */
.ws-header__main {
	background: var(--ws-surface);
	border-bottom: 1px solid var(--ws-line);
	position: sticky;
	top: 0;
	z-index: 10;
}

.ws-header__inner {
	display: flex;
	align-items: center;
	gap: var(--ws-space-5);
	min-height: var(--ws-header-height);
}

.ws-branding {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.ws-branding img,
.ws-branding .custom-logo {
	width: var(--ws-logo-width);
	height: auto;
	max-height: none;
}

.ws-branding__title {
	font-family: var(--ws-font-head);
	font-size: var(--ws-text-2xl);
	font-weight: 700;
	color: var(--ws-ink);
	margin: 0;
}

.ws-nav {
	flex: 1;
	min-width: 0;
}

.ws-nav__list {
	display: flex;
	gap: var(--ws-space-1);
	margin: 0;
	padding: 0;
	list-style: none;
	flex-wrap: wrap;
}

.ws-nav__list a {
	display: flex;
	align-items: center;
	height: var(--ws-header-height);
	padding-inline: var(--ws-space-3);
	font-weight: 600;
	font-size: 0.875rem;
	color: var(--ws-ink);
	border-bottom: 3px solid transparent;
	white-space: nowrap;
}

.ws-nav__list .current-menu-item > a,
.ws-nav__list a:hover,
.ws-nav__list a:focus {
	color: var(--ws-accent);
	border-bottom-color: var(--ws-accent);
}

/* Przycisk menu mobilnego — czysty przycisk-ikona, bez ramki i tła */
.ws-nav-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	margin-left: auto;
	width: 44px;
	height: 44px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: var(--ws-radius);
	color: var(--ws-ink);
}

.ws-nav-toggle:hover,
.ws-nav-toggle:focus-visible { background: var(--ws-paper); }

.ws-nav-toggle__bars {
	display: inline-block;
	width: 18px;
	height: 2px;
	background: var(--ws-ink);
	position: relative;
}

.ws-nav-toggle__bars::before,
.ws-nav-toggle__bars::after {
	content: "";
	position: absolute;
	left: 0;
	width: 18px;
	height: 2px;
	background: var(--ws-ink);
}

.ws-nav-toggle__bars::before { top: -6px; }
.ws-nav-toggle__bars::after { top: 6px; }

/* Szukajka w nagłówku */
.ws-header__search {
	display: flex;
	align-items: center;
	gap: var(--ws-space-2);
	height: 40px;
	padding-inline: var(--ws-space-3);
	border: 1px solid var(--ws-line);
	border-radius: var(--ws-radius);
	background: var(--ws-surface);
	width: 200px;
	flex-shrink: 0;
}

.ws-header__search input {
	border: 0;
	outline: 0;
	flex: 1;
	min-width: 0;
	background: transparent;
	font: inherit;
	font-size: var(--ws-text-sm);
	color: var(--ws-ink);
}

/* --------------------------------------------------------------------------
   8. Przyciski
   -------------------------------------------------------------------------- */
.ws-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--ws-space-2);
	padding: var(--ws-space-3) var(--ws-space-5);
	background: var(--ws-accent);
	color: var(--ws-on-dark);
	border: 1px solid var(--ws-accent);
	border-radius: var(--ws-radius);
	font-weight: 600;
	font-size: var(--ws-text-sm);
	line-height: 1;
	transition: background var(--ws-transition);
}

.ws-btn:hover,
.ws-btn:focus {
	background: var(--ws-accent-hover);
	color: var(--ws-on-dark);
}

.ws-btn--ghost {
	background: var(--ws-surface);
	color: var(--ws-ink-soft);
	border-color: var(--ws-line);
}

.ws-btn--ghost:hover,
.ws-btn--ghost:focus {
	background: var(--ws-paper);
	color: var(--ws-ink);
}

/* --------------------------------------------------------------------------
   9. Stopka
   -------------------------------------------------------------------------- */
.ws-footer {
	background: var(--ws-ink);
	color: var(--ws-on-dark-soft);
	border-top: 3px solid var(--ws-accent);
	padding-bottom: var(--ws-space-6);
	margin-top: var(--ws-space-8);
}

.ws-footer__main {
	padding-top: var(--ws-space-8);
}

.ws-footer__cols {
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr;
	gap: var(--ws-space-7);
	padding-bottom: var(--ws-space-7);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Pasek „Najnowsze" na górze stopki */
.ws-latest-bar {
	background: #0F1828;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	padding-block: var(--ws-space-6);
}

.ws-latest-bar__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ws-space-4);
	margin-bottom: var(--ws-space-5);
}

.ws-latest-bar__title {
	font-size: var(--ws-text-xs);
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ws-on-dark);
	font-family: var(--ws-font-body);
	margin: 0;
}

.ws-latest-bar__nav { display: flex; gap: var(--ws-space-2); }

.ws-latest-bar__btn {
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: var(--ws-radius);
	color: var(--ws-on-dark-soft);
	font-size: var(--ws-text-base);
	transition: background var(--ws-transition), color var(--ws-transition);
}

.ws-latest-bar__btn:hover,
.ws-latest-bar__btn:focus-visible {
	background: rgba(255, 255, 255, 0.08);
	color: var(--ws-on-dark);
}

.ws-latest-bar__track {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: var(--ws-space-5);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.ws-latest-bar__track::-webkit-scrollbar { display: none; }

.ws-latest-bar__item {
	flex: 0 0 calc((100% - 3 * var(--ws-space-5)) / 4);
	scroll-snap-align: start;
}

.ws-latest-bar__card { display: block; }

.ws-latest-bar__media {
	display: block;
	aspect-ratio: 16 / 9;
	border-radius: var(--ws-radius);
	overflow: hidden;
	background: var(--ws-ink);
	margin-bottom: var(--ws-space-3);
}

.ws-latest-bar__media img { width: 100%; height: 100%; object-fit: cover; }

.ws-latest-bar__cat {
	display: block;
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ws-accent);
	margin-bottom: var(--ws-space-1);
}

.ws-latest-bar__name {
	display: block;
	font-family: var(--ws-font-head);
	font-size: var(--ws-text-sm);
	font-weight: 600;
	line-height: 1.35;
	color: var(--ws-on-dark);
}

.ws-latest-bar__card:hover .ws-latest-bar__name,
.ws-latest-bar__card:focus .ws-latest-bar__name { color: var(--ws-accent); }

@media (max-width: 1024px) {
	.ws-latest-bar__item { flex-basis: calc((100% - 2 * var(--ws-space-5)) / 3); }
}

@media (max-width: 782px) {
	.ws-latest-bar__item { flex-basis: calc((100% - var(--ws-space-5)) / 2); }
}

@media (max-width: 480px) {
	.ws-latest-bar__item { flex-basis: 78%; }
}

.ws-footer__desc {
	font-size: var(--ws-text-sm);
	line-height: 1.55;
	color: #9099A8;
	margin: 0 0 var(--ws-space-4);
	max-width: 32ch;
}

.ws-footer__logo {
	width: 120px;
	height: auto;
	margin-bottom: var(--ws-space-4);
}

.ws-footer__brand p {
	font-size: var(--ws-text-sm);
	color: #9099A8;
	margin: 0;
}

.ws-footer__heading {
	font-size: var(--ws-text-xs);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ws-on-dark);
	margin: 0 0 var(--ws-space-4);
	font-family: var(--ws-font-body);
}

.ws-footer__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--ws-space-3);
}

.ws-footer__list a {
	color: var(--ws-on-dark-soft);
	font-size: var(--ws-text-sm);
}

.ws-footer__list a:hover,
.ws-footer__list a:focus { color: var(--ws-on-dark); }

.ws-footer__bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ws-space-4);
	flex-wrap: wrap;
	padding-top: var(--ws-space-5);
	font-size: var(--ws-text-xs);
	color: #6C7384;
}

.ws-to-top {
	color: var(--ws-on-dark-soft);
	font-weight: 600;
	white-space: nowrap;
}

.ws-to-top:hover,
.ws-to-top:focus { color: var(--ws-on-dark); }

/* Ikony social (wspólne) */
.ws-social {
	display: flex;
	gap: var(--ws-space-2);
	flex-wrap: wrap;
}

.ws-social__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: var(--ws-radius);
	color: inherit;
	transition: background var(--ws-transition), color var(--ws-transition);
}

.ws-social__icon {
	width: 20px;
	height: 20px;
	display: block;
}

.ws-footer__social {
	margin-top: var(--ws-space-2);
	color: var(--ws-on-dark-soft);
}

.ws-footer__social .ws-social__link:hover,
.ws-footer__social .ws-social__link:focus {
	background: rgba(255, 255, 255, 0.08);
	color: var(--ws-on-dark);
}

/* Social w pasku górnym — mniejsze, dopasowane do wysokości paska */
.ws-topbar__social { gap: var(--ws-space-1); }

.ws-topbar__social .ws-social__link {
	width: 28px;
	height: 28px;
	color: var(--ws-on-dark-soft);
}

.ws-topbar__social .ws-social__icon { width: 16px; height: 16px; }

.ws-topbar__social .ws-social__link:hover,
.ws-topbar__social .ws-social__link:focus { color: var(--ws-on-dark); }

/* --------------------------------------------------------------------------
   9b. Komponenty współdzielone (nadtytuł, karty, placeholder)
   -------------------------------------------------------------------------- */
.ws-eyebrow {
	display: inline-block;
	font-family: var(--ws-font-body);
	font-size: var(--ws-text-xs);
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ws-accent);
}

.ws-eyebrow--sm { font-size: 0.625rem; letter-spacing: 0.14em; }
.ws-eyebrow--plain { color: var(--ws-accent); }
.ws-eyebrow--on-dark { color: var(--ws-accent); }

a.ws-eyebrow:hover,
a.ws-eyebrow:focus { color: var(--ws-accent-hover); }

/* Placeholder miniatury (gradient ustawiany inline wg ID wpisu) */
.ws-thumb-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
}

/* Siatka kart */
.ws-cards-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--ws-space-6);
}

/* Karta artykułu */
.ws-card__media {
	display: block;
	aspect-ratio: 4 / 3;
	border-radius: var(--ws-radius);
	overflow: hidden;
	margin-bottom: var(--ws-space-4);
	background: var(--ws-paper);
}

.ws-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ws-card__title {
	font-size: var(--ws-text-lg);
	line-height: 1.3;
	margin: var(--ws-space-2) 0 var(--ws-space-3);
}

.ws-card__title a { color: var(--ws-ink); }
.ws-card__title a:hover,
.ws-card__title a:focus { color: var(--ws-accent); }

.ws-card__meta {
	display: flex;
	gap: var(--ws-space-2);
	font-size: var(--ws-text-xs);
	color: var(--ws-muted);
}

/* --------------------------------------------------------------------------
   10. Responsywność
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.ws-footer__cols {
		grid-template-columns: 1fr 1fr;
		gap: var(--ws-space-6);
	}

	.ws-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 782px) {
	.ws-header__search { display: none; }

	.ws-branding img,
	.ws-branding .custom-logo { width: var(--ws-logo-width-mobile); }

	.ws-nav-toggle { display: inline-flex; }

	.ws-nav {
		position: fixed;
		inset: 0 0 0 auto;
		width: min(320px, 85vw);
		background: var(--ws-surface);
		padding: var(--ws-space-6) var(--ws-space-5);
		transform: translateX(100%);
		transition: transform var(--ws-transition);
		box-shadow: var(--ws-shadow);
		overflow-y: auto;
		z-index: 30;
	}

	.ws-nav.is-open { transform: translateX(0); }

	.ws-nav__list { flex-direction: column; gap: 0; }

	.ws-nav__list a {
		height: auto;
		padding: var(--ws-space-4) 0;
		border-bottom: 1px solid var(--ws-line-soft);
		border-left: 3px solid transparent;
	}

	.ws-nav__list .current-menu-item > a,
	.ws-nav__list a:hover,
	.ws-nav__list a:focus {
		border-bottom-color: var(--ws-line-soft);
		border-left-color: var(--ws-accent);
		padding-left: var(--ws-space-3);
	}

	.ws-nav-backdrop {
		position: fixed;
		inset: 0;
		background: rgba(11, 18, 32, 0.4);
		z-index: 25;
		opacity: 0;
		visibility: hidden;
		transition: opacity var(--ws-transition);
	}

	.ws-nav-backdrop.is-visible { opacity: 1; visibility: visible; }
}

@media (max-width: 560px) {
	.ws-topbar { display: none; }

	.ws-footer__cols { grid-template-columns: 1fr; }

	.ws-cards-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   11. Ograniczenie animacji
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }

	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}
