/**
 * PTTK Oddział Morski — drobne style poza theme.json.
 * Głównie nawigacja klasyczna (menu poziome + dropdown + hamburger)
 * oraz kilka pomocniczych klas używanych we wzorcach.
 */

:root {
	--pttk-green: #2e5d38;
	--pttk-green-dark: #244a2c;
	--pttk-green-light: #6f9b79;
	--pttk-cream: #f9fbf9;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------------------
   NAGŁÓWEK / MENU GŁÓWNE (blok pttk/menu -> wp_nav_menu)
   --------------------------------------------------------------------------- */
.pttk-primary-nav {
	display: flex;
	align-items: center;
}

.pttk-menu,
.pttk-primary-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem;
}

.pttk-menu li {
	position: relative;
	margin: 0;
}

.pttk-menu a {
	display: block;
	padding: 0.55rem 0.9rem;
	color: #ffffff;
	font-weight: 600;
	font-size: 0.95rem;
	text-decoration: none;
	border-radius: 6px;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.pttk-menu a:hover,
.pttk-menu .current-menu-item > a,
.pttk-menu .current_page_item > a,
.pttk-menu .current-menu-ancestor > a {
	background: rgba(255, 255, 255, 0.16);
	color: #ffffff;
}

/* Strzałka przy pozycjach z podmenu */
.pttk-menu .menu-item-has-children > a::after,
.pttk-menu .page_item_has_children > a::after {
	content: "";
	display: inline-block;
	width: 0.42em;
	height: 0.42em;
	margin-left: 0.45em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	opacity: 0.85;
}

/* Podmenu (dropdown) */
.pttk-menu ul.sub-menu,
.pttk-menu ul.children {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	flex-direction: column;
	gap: 0;
	background: #ffffff;
	border-radius: 10px;
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
	padding: 0.4rem;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
	z-index: 60;
}

.pttk-menu li:hover > ul.sub-menu,
.pttk-menu li:hover > ul.children,
.pttk-menu li:focus-within > ul.sub-menu,
.pttk-menu li:focus-within > ul.children {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.pttk-menu ul.sub-menu a,
.pttk-menu ul.children a {
	color: var(--pttk-green);
	font-weight: 500;
	padding: 0.55rem 0.75rem;
	border-radius: 6px;
}

.pttk-menu ul.sub-menu a:hover,
.pttk-menu ul.children a:hover {
	background: var(--pttk-cream);
	color: var(--pttk-green-dark);
}

.pttk-menu ul.sub-menu .menu-item-has-children > a::after {
	transform: rotate(-45deg);
}

/* Hamburger — ukryty na desktopie */
.pttk-nav-toggle {
	display: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	position: relative;
}

.pttk-nav-toggle__bar,
.pttk-nav-toggle__bar::before,
.pttk-nav-toggle__bar::after {
	content: "";
	position: absolute;
	left: 10px;
	width: 24px;
	height: 2px;
	background: #ffffff;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.pttk-nav-toggle__bar {
	top: 21px;
}
.pttk-nav-toggle__bar::before {
	top: -7px;
}
.pttk-nav-toggle__bar::after {
	top: 7px;
}

.is-open .pttk-nav-toggle__bar {
	background: transparent;
}
.is-open .pttk-nav-toggle__bar::before {
	transform: translateY(7px) rotate(45deg);
}
.is-open .pttk-nav-toggle__bar::after {
	transform: translateY(-7px) rotate(-45deg);
}

/* ---------------------------------------------------------------------------
   MENU MOBILNE
   --------------------------------------------------------------------------- */
@media (max-width: 860px) {
	.pttk-nav-toggle {
		display: block;
		margin-left: auto;
	}

	.pttk-primary-nav__inner {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--pttk-green-dark);
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.25s ease;
		z-index: 70;
	}

	.is-open .pttk-primary-nav__inner {
		max-height: 80vh;
		overflow-y: auto;
		box-shadow: 0 18px 30px rgba(0, 0, 0, 0.25);
	}

	.pttk-menu,
	.pttk-primary-nav ul {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 0.5rem;
	}

	.pttk-menu a {
		padding: 0.8rem 1rem;
	}

	/* Podmenu na mobile: w potoku, rozwijane klasą is-expanded */
	.pttk-menu ul.sub-menu,
	.pttk-menu ul.children {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		background: rgba(255, 255, 255, 0.06);
		border-radius: 0;
		padding: 0 0 0 0.75rem;
		display: none;
	}

	.pttk-menu li.is-expanded > ul.sub-menu,
	.pttk-menu li.is-expanded > ul.children {
		display: block;
	}

	.pttk-menu ul.sub-menu a,
	.pttk-menu ul.children a {
		color: #eaf2ec;
	}
}

/* ---------------------------------------------------------------------------
   KAFELKI / KARTY (wzorce: Aktualności, Kluby, Odznaki)
   --------------------------------------------------------------------------- */
.pttk-card {
	background: #ffffff;
	border: 1px solid #e3eae4;
	border-radius: 12px;
	overflow: hidden;
	height: 100%;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.pttk-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 16px 34px rgba(46, 93, 56, 0.14);
}

/* Klikalny kafelek (logo Koła / odznaka) */
.pttk-tile {
	text-align: center;
	transition: transform 0.18s ease;
}
.pttk-tile:hover {
	transform: translateY(-4px);
}
.pttk-tile img {
	transition: filter 0.18s ease;
}

/* ---------------------------------------------------------------------------
   HERO Z WIDEO W TLE (YouTube zapętlony, wyciszony) — jak na obecnej stronie
   --------------------------------------------------------------------------- */
.pttk-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	/* pełny full-bleed — od krawędzi do krawędzi, niezależnie od paddingu motywu */
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding-left: 0;
	padding-right: 0;
}

/* zanikająca zielona nakładka — ukrywa rozruch filmu (logo/panel YouTube) */
.pttk-hero__poster {
	position: absolute;
	inset: 0;
	z-index: 2;
	background: linear-gradient(160deg, #2e5d38, #244a2c);
	animation: pttkHeroPoster 0.8s ease 2s forwards;
	pointer-events: none;
}
@keyframes pttkHeroPoster {
	to { opacity: 0; visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
	.pttk-hero__poster { animation: none; opacity: 0; visibility: hidden; }
}

/* Warstwa tła: wideo + zielona nakładka.
   max-width:none + margin:0 — wyłamuje się z „constrained layout" grupy,
   żeby wideo wypełniało pełną szerokość (a nie tylko 1140 px). */
.pttk-hero .pttk-hero__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	max-width: none;
	width: auto;
	margin: 0;
}

.pttk-hero__video {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: #2e5d38; /* widoczne zanim wideo wstanie */
}

/* Sztuczka "cover" dla proporcji 16:9 — wideo zawsze wypełnia kadr */
.pttk-hero__video iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100vw;
	height: 56.25vw; /* 100 / 16 * 9 */
	min-height: 100%;
	min-width: 177.78vh; /* 100 / 9 * 16 */
	transform: translate(-50%, -50%);
	border: 0;
	pointer-events: none;
}

.pttk-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(46, 93, 56, 0.45), rgba(36, 74, 44, 0.62));
}

/* Treść hero zawsze nad tłem */
.pttk-hero__content {
	position: relative;
	z-index: 1;
	padding-left: 1.25rem;
	padding-right: 1.25rem;
}

/* Wariant bez wideo (gradient) — gdyby kiedyś usunąć film */
.pttk-hero--plain::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(160deg, rgba(46, 93, 56, 1), rgba(36, 74, 44, 1));
	z-index: 0;
}

/* ---------------------------------------------------------------------------
   HERO W EDYTORZE — spokojny zielony blok, bez full-bleed i bez wideo YouTube
   (na froncie ten selektor nie istnieje, więc nic nie zmienia)
   --------------------------------------------------------------------------- */
.editor-styles-wrapper .pttk-hero {
	width: auto;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
	/* ciemne tło, żeby biały tekst hero był czytelny podczas edycji */
	background: linear-gradient(160deg, #2e5d38, #244a2c);
}
.editor-styles-wrapper .pttk-hero__video,
.editor-styles-wrapper .pttk-hero__poster {
	display: none;
}
.editor-styles-wrapper .pttk-hero__overlay {
	background: linear-gradient(160deg, #2e5d38, #244a2c);
}

/* Stopka — linki jaśniejsze */
.pttk-footer a {
	color: #ffffff;
}
.pttk-footer a:hover {
	color: #cfe3d4;
	text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   OŚ CZASU (Historia)
   --------------------------------------------------------------------------- */
.pttk-timeline {
	position: relative;
	margin-top: 1rem;
	padding-left: 2rem;
}
.pttk-timeline::before {
	content: "";
	position: absolute;
	left: 7px;
	top: 6px;
	bottom: 6px;
	width: 2px;
	background: var(--pttk-green-light);
}
.pttk-timeline__item {
	position: relative;
	margin: 0 0 2rem;
	padding: 1.25rem 1.5rem;
	background: #ffffff;
	border: 1px solid #e3eae4;
	border-radius: 12px;
}
.pttk-timeline__item::before {
	content: "";
	position: absolute;
	left: -2rem;
	top: 1.4rem;
	width: 16px;
	height: 16px;
	margin-left: 0;
	background: var(--pttk-green);
	border: 3px solid #fff;
	border-radius: 50%;
	box-shadow: 0 0 0 2px var(--pttk-green-light);
}
.pttk-timeline__item--future::before {
	background: var(--pttk-cream);
	border-color: var(--pttk-green);
	box-shadow: 0 0 0 2px var(--pttk-green);
}
.pttk-timeline__year {
	display: inline-block;
	margin: 0 0 0.4rem;
	padding: 0.2rem 0.7rem;
	background: var(--pttk-green);
	color: #fff;
	font-weight: 700;
	font-size: 0.85rem;
	border-radius: 999px;
	letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------------------
   KROKI (Dołącz do nas)
   --------------------------------------------------------------------------- */
.pttk-steps .pttk-step {
	background: #ffffff;
	border: 1px solid #e3eae4;
	border-radius: 12px;
	padding: 1.5rem 1.25rem;
	text-align: center;
}
.pttk-step__num {
	width: 48px;
	height: 48px;
	margin: 0 auto 0.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--pttk-green);
	color: #fff;
	font-family: Comfortaa, sans-serif;
	font-weight: 700;
	font-size: 1.4rem;
	border-radius: 50%;
}
.pttk-note {
	background: #eef4ef;
	padding: 1rem 1.25rem;
	border-radius: 8px;
	border-left: 4px solid var(--pttk-green-light);
}

/* Zielony box „Do pobrania" (Odznaki) */
.pttk-download-box { border-radius: 10px; }
.pttk-download-box, .pttk-download-box li { color: #fff; }
.pttk-download-box a { color: #fff; text-decoration: underline; }
.pttk-download-box a:hover { color: #cfe3d4; }

/* Tabela (np. składki) */
.pttk-table table {
	border-collapse: collapse;
	width: 100%;
}
.pttk-table th {
	background: var(--pttk-green);
	color: #fff;
	text-align: left;
	padding: 0.7rem 1rem;
	font-weight: 600;
}
.pttk-table td {
	padding: 0.65rem 1rem;
	border-bottom: 1px solid #e3eae4;
}
.pttk-table.is-style-stripes tbody tr:nth-child(odd) {
	background: #f3f8f4;
}
.pttk-table figcaption {
	font-size: 0.88rem;
	color: var(--pttk-contrast-soft, #5a6b5e);
}

/* ---------------------------------------------------------------------------
   KARTY KONTAKTU
   --------------------------------------------------------------------------- */
.pttk-info { text-align: left; }
.pttk-info__icon {
	font-size: 1.9rem;
	margin: 0 0 0.25rem;
	line-height: 1;
}

/* ---------------------------------------------------------------------------
   OKRUSZKI (breadcrumbs)
   --------------------------------------------------------------------------- */
.pttk-breadcrumbs {
	font-size: 0.85rem;
	color: var(--pttk-green-light);
}
.pttk-breadcrumbs ol {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
}
.pttk-breadcrumbs li { display: flex; align-items: center; gap: 0.4rem; }
.pttk-breadcrumbs li:not(:last-child)::after {
	content: "›";
	color: #9bb3a1;
}
.pttk-breadcrumbs a { color: var(--pttk-green); }
.pttk-breadcrumbs a:hover { color: var(--pttk-green-dark); text-decoration: underline; }
.pttk-breadcrumbs [aria-current="page"] { color: #5a6b5e; }

/* ---------------------------------------------------------------------------
   CREDITS — logo CDI (szare → kolor po najechaniu)
   --------------------------------------------------------------------------- */
.pttk-credit-logo {
	display: inline-block;
	vertical-align: middle;
	margin-left: 0.35rem;
}
.pttk-credit-logo img {
	height: 1.5em;
	width: auto;
	vertical-align: middle;
	filter: grayscale(1) brightness(1.7) opacity(0.85);
	transition: filter 0.25s ease;
}
.pttk-credit-logo:hover img,
.pttk-credit-logo:focus img {
	filter: none;
}
