/*
 * Style bloków i wzorców motywu WOZZ (inc/blocks.php).
 * Ładowane na stronie oraz w edytorze bloków (add_editor_style()),
 * żeby redaktor widział w edytorze to samo, co odwiedzający.
 */

/* --------------------------------------------------
   Styl grupy "Karta"
-------------------------------------------------- */
.wp-block-group.is-style-wozz-card {
	height: 100%;
	padding: 1.5rem;
	border: 1px solid #e0e4e8;
	border-top: 3px solid #2ea3f2;
	border-radius: 4px;
	background-color: #ffffff;
	box-shadow: 0 6px 24px rgba( 11, 61, 89, 0.08 );
}

.wp-block-group.is-style-wozz-card > :first-child {
	margin-top: 0;
}

.wp-block-group.is-style-wozz-card > :last-child {
	margin-bottom: 0;
}

.wp-block-group.is-style-wozz-card h3 {
	margin: 0 0 0.25rem;
	font-size: 1.25rem;
}

.wozz-card-subtitle {
	margin-top: 0;
	color: #0c71c3;
	font-size: 0.875rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* --------------------------------------------------
   Styl grupy "Wezwanie do działania"
-------------------------------------------------- */
.wp-block-group.is-style-wozz-cta {
	margin-block: 2rem;
	padding: 2.5rem 2rem;
	border-radius: 6px;
	background: linear-gradient( 135deg, #0b3d59 0%, #0c71c3 100% );
	color: #ffffff;
	text-align: center;
}

.wp-block-group.is-style-wozz-cta h2,
.wp-block-group.is-style-wozz-cta h3 {
	margin-top: 0;
	color: #ffffff;
}

.wp-block-group.is-style-wozz-cta a:not( .wp-block-button__link ) {
	color: #ffffff;
}

.wp-block-group.is-style-wozz-cta .wp-block-buttons {
	justify-content: center;
}

.wp-block-group.is-style-wozz-cta .wp-block-button__link {
	border: 2px solid #ffffff;
	background-color: #ffffff;
	color: #0b3d59;
}

.wp-block-group.is-style-wozz-cta .wp-block-button__link:hover,
.wp-block-group.is-style-wozz-cta .wp-block-button__link:focus {
	background-color: transparent;
	color: #ffffff;
}

/* --------------------------------------------------
   Oś czasu (wzorzec "Oś czasu")
   Pionowa linia pośrodku, wpisy naprzemiennie po lewej i prawej.
-------------------------------------------------- */
.wozz-timeline {
	position: relative;
	margin-block: 2rem;
	padding-block: 0.5rem;
}

.wozz-timeline::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 3px;
	border-radius: 2px;
	background: linear-gradient( 180deg, #2ea3f2, #0b3d59 );
	transform: translateX( -50% );
}

.wozz-timeline > .wozz-timeline__item {
	position: relative;
	width: calc( 50% - 2rem );
	max-width: none;
	margin: 0 0 2rem;
	padding: 1.25rem 1.5rem;
	border-radius: 4px;
	background-color: #f5f7f9;
}

.wozz-timeline > .wozz-timeline__item:nth-child( odd ) {
	margin-right: auto;
	margin-left: 0;
}

.wozz-timeline > .wozz-timeline__item:nth-child( even ) {
	margin-left: auto;
	margin-right: 0;
}

/* Kropka na osi. */
.wozz-timeline > .wozz-timeline__item::before {
	content: "";
	position: absolute;
	top: 1.6rem;
	width: 16px;
	height: 16px;
	border: 3px solid #ffffff;
	border-radius: 50%;
	background-color: #2ea3f2;
	box-shadow: 0 0 0 2px #2ea3f2;
}

.wozz-timeline > .wozz-timeline__item:nth-child( odd )::before {
	right: calc( -2rem - 8px );
}

.wozz-timeline > .wozz-timeline__item:nth-child( even )::before {
	left: calc( -2rem - 8px );
}

.wozz-timeline__year {
	margin: 0 0 0.5rem;
	color: #0c71c3;
	font-size: 1.75rem;
}

.wozz-timeline__item > :last-child {
	margin-bottom: 0;
}

@media ( max-width: 700px ) {
	.wozz-timeline::before {
		left: 8px;
	}

	.wozz-timeline > .wozz-timeline__item,
	.wozz-timeline > .wozz-timeline__item:nth-child( odd ),
	.wozz-timeline > .wozz-timeline__item:nth-child( even ) {
		width: auto;
		margin-left: 2rem;
		margin-right: 0;
	}

	.wozz-timeline > .wozz-timeline__item:nth-child( odd )::before,
	.wozz-timeline > .wozz-timeline__item:nth-child( even )::before {
		right: auto;
		left: calc( -2rem + 1px );
	}
}

/* --------------------------------------------------
   Tabela "Wyniki regat"
-------------------------------------------------- */
.wp-block-table.is-style-wozz-results table {
	border-collapse: collapse;
	width: 100%;
	font-variant-numeric: tabular-nums;
}

.wp-block-table.is-style-wozz-results th {
	background-color: #0b3d59;
	color: #ffffff;
	font-weight: 400;
	text-align: left;
}

.wp-block-table.is-style-wozz-results th,
.wp-block-table.is-style-wozz-results td {
	padding: 0.6em 0.8em;
	border: 0;
	border-bottom: 1px solid #e0e4e8;
}

.wp-block-table.is-style-wozz-results tbody tr:nth-child( even ) {
	background-color: #f5f7f9;
}

/* Podium: złoto, srebro, brąz w pierwszej kolumnie. */
.wp-block-table.is-style-wozz-results tbody tr:nth-child( -n + 3 ) td:first-child {
	font-size: 1.1em;
}

.wp-block-table.is-style-wozz-results tbody tr:nth-child( 1 ) td:first-child {
	box-shadow: inset 4px 0 0 #d4a017;
}

.wp-block-table.is-style-wozz-results tbody tr:nth-child( 2 ) td:first-child {
	box-shadow: inset 4px 0 0 #a8a9ad;
}

.wp-block-table.is-style-wozz-results tbody tr:nth-child( 3 ) td:first-child {
	box-shadow: inset 4px 0 0 #b0703c;
}

.wp-block-table.is-style-wozz-results tbody tr:hover {
	background-color: rgba( 46, 163, 242, 0.08 );
}

/* --------------------------------------------------
   Galeria "Logotypy partnerów"
   Logotypy w kolorze, lekkie powiększenie po najechaniu; bez przycinania.
-------------------------------------------------- */
.wp-block-gallery.is-style-wozz-logos {
	align-items: center;
	justify-content: center;
	gap: 2rem 2.5rem;
}

.wp-block-gallery.is-style-wozz-logos .wp-block-image,
.wp-block-gallery.is-style-wozz-logos figure.wp-block-image:not( #individual-image ) {
	flex-grow: 0;
	width: auto;
	max-width: 180px;
	margin: 0;
}

.wp-block-gallery.is-style-wozz-logos figure.wp-block-image img {
	width: auto;
	max-width: 100%;
	max-height: 80px;
	height: auto;
	object-fit: contain;
	border-radius: 0;
	box-shadow: none;
	transition: transform 0.3s ease;
}

.wp-block-gallery.is-style-wozz-logos figure.wp-block-image:hover img,
.wp-block-gallery.is-style-wozz-logos figure.wp-block-image a:focus img {
	transform: scale( 1.05 );
}

.wp-block-gallery.is-style-wozz-logos figcaption {
	display: none;
}

/* --------------------------------------------------
   Blok "Plik" — lista dokumentów do pobrania
   (typ i rozmiar dodawane w inc/blocks.php)
-------------------------------------------------- */
.wp-block-file.wozz-file {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	margin: 0 0 0.75rem;
	padding: 0.9rem 1rem 0.9rem 4rem;
	border: 1px solid #e0e4e8;
	border-radius: 4px;
	background-color: #ffffff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wp-block-file.wozz-file:hover {
	border-color: #2ea3f2;
	box-shadow: 0 6px 24px rgba( 11, 61, 89, 0.08 );
}

/* Ikona typu pliku: kartka z zagiętym rogiem i skrótem rozszerzenia. */
.wp-block-file.wozz-file::before {
	content: "DOC";
	position: absolute;
	top: 50%;
	left: 1rem;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	width: 2.25rem;
	height: 2.75rem;
	padding-bottom: 0.35rem;
	border-radius: 3px 12px 3px 3px;
	background-color: #0c71c3;
	color: #ffffff;
	font-size: 0.625rem;
	letter-spacing: 0.04em;
	transform: translateY( -50% );
}

.wp-block-file.wozz-file--pdf::before {
	content: "PDF";
	background-color: #c62828;
}

.wp-block-file.wozz-file--doc::before,
.wp-block-file.wozz-file--docx::before,
.wp-block-file.wozz-file--odt::before {
	content: "DOC";
	background-color: #1565c0;
}

.wp-block-file.wozz-file--xls::before,
.wp-block-file.wozz-file--xlsx::before,
.wp-block-file.wozz-file--ods::before {
	content: "XLS";
	background-color: #2e7d32;
}

.wp-block-file.wozz-file--zip::before {
	content: "ZIP";
	background-color: #6d4c41;
}

.wp-block-file.wozz-file--jpg::before,
.wp-block-file.wozz-file--jpeg::before,
.wp-block-file.wozz-file--png::before {
	content: "IMG";
	background-color: #6a1b9a;
}

.wp-block-file.wozz-file > a:not( .wp-block-file__button ) {
	flex: 1 1 auto;
	color: #333333;
	text-decoration: none;
}

.wp-block-file.wozz-file .wozz-file-meta {
	order: 3;
	flex-basis: 100%;
	margin-top: -0.4rem;
	color: #6b6b6b;
	font-size: 0.8125rem;
}

.wp-block-file.wozz-file .wp-block-file__button {
	order: 2;
	margin-left: auto;
	padding: 0.4em 1.1em;
	border-radius: 3px;
	background-color: #0c71c3;
	color: #ffffff;
	font-size: 0.875rem;
	text-decoration: none;
	text-transform: uppercase;
}

.wp-block-file.wozz-file .wp-block-file__button:hover,
.wp-block-file.wozz-file .wp-block-file__button:focus {
	background-color: #0b3d59;
}

/* --------------------------------------------------
   Treść przeniesiona z Divi (inc/divi-legacy.php)
   Wiersze i kolumny Divi zamienione na elastyczne kontenery.
-------------------------------------------------- */
.wozz-legacy-row {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
	margin: 0 0 2rem;
}

.wozz-legacy-col {
	flex: 1 1 0;
	min-width: 240px;
}

/* Proporcje kolumn Divi (np. 3_5 + 2_5 = 60% + 40%). Podstawa 0 + flex-grow
   równy licznikowi ułamka daje dokładne proporcje; min-width zawija kolumny
   pod sobą, gdy robi się za wąsko. */
.wozz-legacy-col--4-4 {
	flex-basis: 100%;
}

.wozz-legacy-col--2-3,
.wozz-legacy-col--2-4,
.wozz-legacy-col--2-5 {
	flex-grow: 2;
}

.wozz-legacy-col--3-4,
.wozz-legacy-col--3-5 {
	flex-grow: 3;
}

.wozz-legacy-col--4-5 {
	flex-grow: 4;
}

.wozz-legacy-col--5-6 {
	flex-grow: 5;
}

/* Siatka kart wpisów w kolumnie: tyle kolumn, ile się zmieści (min. 250 px). */
.wozz-legacy-col .cards,
.wozz-legacy-blog,
.wozz-latest-posts {
	grid-template-columns: repeat( auto-fill, minmax( 250px, 1fr ) );
}

/* Kolumna złożona z samych przycisków (np. Kalendarz imprez, Wyniki regat)
   → pionowa lista przycisków na pełną szerokość. */
.wozz-legacy-col > .wozz-legacy-buttons {
	margin: 0 0 0.75rem;
}

.wozz-legacy-col > .wozz-legacy-buttons .wozz-legacy-button {
	justify-content: center;
	width: 100%;
	padding-block: 0.75em;
	text-align: center;
}

.wozz-legacy-col > :first-child,
.wozz-legacy-header > :first-child,
.wozz-legacy-person > :first-child {
	margin-top: 0;
}

.wozz-legacy-col > :last-child,
.wozz-legacy-person > :last-child,
.wozz-legacy-blurb > :last-child,
.wozz-legacy-cta > :last-child {
	margin-bottom: 0;
}

/* Nagłówek pełnej szerokości → tytuł sekcji. */
.wozz-legacy-header {
	margin: 2.5rem 0 1.5rem;
	text-align: center;
}

.wozz-legacy-header__title {
	margin: 0 0 0.5rem;
	font-size: clamp( 1.5rem, 3vw, 2rem );
}

.wozz-legacy-header__lead {
	margin: 0 auto 1rem;
	max-width: 60ch;
	font-size: 1.125rem;
}

/* Karty osób z jednego wiersza Divi → jedna siatka o równych rzędach
   (inc/divi-legacy.php). Karty w rzędzie mają jednakową wysokość. */
.wozz-legacy-people {
	display: grid;
	/* Najwyżej 3 kolumny (jak w oryginale), min. 240 px na kartę. */
	grid-template-columns: repeat( auto-fill, minmax( max( 240px, calc( ( 100% - 3rem ) / 3 ) ), 1fr ) );
	gap: 1.5rem;
	margin: 0 0 2rem;
}

/* Osoba (zarząd, komisje) → karta. Bez sztywnej wysokości — wcześniej
   height: 100% rozciągało każdą kartę na całą wysokość kolumny. */
.wozz-legacy-person {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 1.5rem 1.25rem;
	border: 1px solid #e0e4e8;
	border-top: 3px solid #2ea3f2;
	border-radius: 4px;
	background-color: #ffffff;
	text-align: center;
	box-shadow: 0 6px 24px rgba( 11, 61, 89, 0.08 );
}

/* Karty ułożone jedna pod drugą (gdy wiersz nie jest siatką). */
.wozz-legacy-person + .wozz-legacy-person {
	margin-top: 1.5rem;
}

.wozz-legacy-people > .wozz-legacy-person {
	margin: 0;
}

.wozz-legacy-person > * {
	width: 100%;
}

.wozz-legacy-person p:empty,
.wozz-legacy-person h5:empty {
	display: none;
}

.wozz-legacy-person a[href^="mailto:"] {
	overflow-wrap: anywhere;
}

.wozz-legacy-person img {
	width: 130px;
	height: 130px;
	margin-inline: auto;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.12 );
}

.wozz-legacy-person h3,
.wozz-legacy-person h4,
.wozz-legacy-person h5 {
	margin: 1rem 0 0.35rem;
	font-size: 1.25rem;
}

.wozz-legacy-person p {
	font-size: 0.9375rem;
}

.wozz-legacy-person__position {
	color: #0c71c3;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 0.8125rem;
}

/* Blurb (obrazek + tytuł + opis) i wezwanie do działania. */
.wozz-legacy-blurb {
	text-align: center;
}

.wozz-legacy-blurb__img {
	max-width: 160px;
	margin: 0 auto 1rem;
}

.wozz-legacy-cta {
	padding: 2rem;
	border-radius: 6px;
	background-color: #f5f7f9;
	text-align: center;
}

.wozz-legacy-slide {
	margin-bottom: 1.5rem;
	padding: 1.5rem;
	border-left: 4px solid #2ea3f2;
	background-color: #f5f7f9;
}

/* Przyciski z modułów Divi. */
.wozz-legacy-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 1rem 0;
}

.wozz-legacy-buttons--center {
	justify-content: center;
}

.wozz-legacy-buttons--right {
	justify-content: flex-end;
}

.wozz-legacy-header .wozz-legacy-buttons,
.wozz-legacy-cta .wozz-legacy-buttons,
.wozz-legacy-blurb .wozz-legacy-buttons {
	justify-content: center;
}

.wozz-legacy-button {
	display: inline-flex;
	align-items: center;
	padding: 0.45em 1.4em;
	border: 2px solid #0c71c3;
	border-radius: 3px;
	color: #0c71c3;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.wozz-legacy-button:hover,
.wozz-legacy-button:focus {
	background-color: #0c71c3;
	color: #ffffff;
}

.wozz-legacy-image {
	margin: 0 0 1.5rem;
}

.wozz-legacy-image.aligncenter img {
	margin-inline: auto;
}

.wozz-legacy-divider {
	margin: 2rem 0;
	border: 0;
	border-top: 1px solid #e0e4e8;
}

/* Przełącznik / akordeon → natywne <details>. */
.wozz-legacy-toggle {
	margin: 0 0 0.75rem;
	border: 1px solid #e0e4e8;
	border-radius: 4px;
	background-color: #ffffff;
}

.wozz-legacy-toggle summary {
	padding: 0.85rem 1.25rem;
	color: #333333;
	cursor: pointer;
}

.wozz-legacy-toggle[open] summary {
	border-bottom: 1px solid #e0e4e8;
	color: #0c71c3;
}

.wozz-legacy-toggle > :not( summary ) {
	margin-inline: 1.25rem;
}

.wozz-legacy-testimonial cite {
	display: block;
	margin-top: 0.5rem;
	font-style: normal;
}

.wozz-legacy-blog {
	margin-block: 1.5rem 2.5rem;
}

@media ( max-width: 700px ) {
	.wozz-legacy-row {
		gap: 1.5rem;
	}

	.wozz-legacy-col {
		flex-basis: 100%;
	}
}

/* --------------------------------------------------
   Blok "Najnowsze wpisy"
   Na stronie zastępowany siatką kart motywu (inc/blocks.php);
   poniższe style dotyczą podglądu w edytorze.
-------------------------------------------------- */
.wp-block-latest-posts.is-grid {
	gap: 1.5rem;
	padding: 0;
}

.wp-block-latest-posts.is-grid li {
	margin: 0;
	padding: 0 0 1rem;
	overflow: hidden;
	border: 1px solid #e0e4e8;
	border-radius: 4px;
	background-color: #ffffff;
	box-shadow: 0 6px 24px rgba( 11, 61, 89, 0.08 );
}

.wp-block-latest-posts.is-grid li > :not( .wp-block-latest-posts__featured-image ) {
	margin-inline: 1rem;
}

.wp-block-latest-posts__featured-image img {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.wp-block-latest-posts__post-title {
	display: block;
	margin-top: 0.75rem;
	color: #333333;
	font-size: 1.125rem;
}

.wp-block-latest-posts__post-date {
	display: block;
	color: #6b6b6b;
	font-size: 0.8125rem;
}
