/*
Theme Name: Luna Catamarans
Description: Motyw blokowy luna-catamarans.com. Wygląd jak Luna Charter: stałe zdjęcie w tle, półprzezroczyste karty, EB Garamond.
Version: 0.3.0
Requires at least: 6.9
Requires PHP: 7.4
Text Domain: luna-catamarans
License: GPL-2.0-or-later
*/

/* Drobne rzeczy, których nie da się wyrazić w theme.json. */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
[id] { scroll-margin-top: 7rem; }

/* Sekcje stykają się ze stopką i nagłówkiem bez białych szczelin */
.wp-site-blocks > footer,
.wp-site-blocks > .luna-naglowek--na-zdjeciu + main { margin-block-start: 0; }

/* ---------- Nagłówek: przyklejony, granatowa szyba nad zdjęciem ---------- */
.wp-site-blocks > header.luna-naglowek--na-zdjeciu {
	position: fixed; inset: 0 0 auto 0; z-index: 50;
	color: #fff;
	background: rgba(10, 34, 53, .35);
	/* bez backdrop-filter: tworzyłby blok zawierający i nakładka menu (position:fixed) mieściłaby się tylko w pasku */
}
.admin-bar .wp-site-blocks > header.luna-naglowek--na-zdjeciu { top: var(--wp-admin--admin-bar--height, 32px); }
/* Telefon: pasek admina (tylko u zalogowanych) przewija się z treścią — nagłówek pod nim, potem przy samej górze */
@media (max-width: 600px) {
	.admin-bar .wp-site-blocks > header.luna-naglowek--na-zdjeciu { position: absolute; top: var(--wp-admin--admin-bar--height, 46px); }
}

/* Pasek cookies na dole strony; przycisk „Dodaj uwagi” podnosi się nad niego */
.luna-ciasteczka {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 9980;
	display: flex; align-items: center; justify-content: center; gap: 1rem 1.5rem; flex-wrap: wrap;
	padding: .9rem clamp(1rem, 4vw, 2.5rem);
	background: rgba(10, 34, 53, .94); color: rgba(255, 255, 255, .9); font-size: .95rem; line-height: 1.45;
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.luna-ciasteczka p { margin: 0; max-width: 60rem; }
.luna-ciasteczka button {
	font: inherit; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
	padding: .55rem 1.6rem; border: 0; border-radius: 999px;
	background: var(--wp--preset--color--zachod); color: var(--wp--preset--color--glebia);
}
.luna-ciasteczka button:hover { background: #fff; }
.luna-uwagi-przycisk { bottom: calc(1rem + var(--luna-ciasteczka, 0px)) !important; }
.luna-uwagi-panel { bottom: calc(4.5rem + var(--luna-ciasteczka, 0px)) !important; }
.luna-naglowek--na-zdjeciu a { color: #fff; }
.luna-naglowek--na-zdjeciu .wp-block-navigation__responsive-container-open { color: #fff; }
.luna-naglowek .wp-block-navigation { font-size: 1.05rem; }
.luna-naglowek--na-zdjeciu .wp-block-navigation a { text-shadow: 0 1px 6px rgba(6, 20, 32, .7); }
.wp-block-navigation a { text-decoration: none; }
.wp-block-navigation a:hover { text-decoration: underline; text-underline-offset: .3em; }

/* Podmenu (Sailing / Motor Catamarans): granatowa szyba jak nagłówek */
.luna-naglowek .wp-block-navigation__submenu-container {
	background: rgba(10, 34, 53, .92) !important; color: #fff !important;
	border: 0 !important; border-radius: 10px; padding: .4rem 0;
	box-shadow: 0 16px 40px rgba(6, 20, 32, .35);
	min-width: 13rem !important;
}
.luna-naglowek .wp-block-navigation__submenu-container a { text-shadow: none; padding: .45rem 1.1rem !important; }
/* Menu otwarte (telefon, tablet): pozycje od lewej, większe */
.luna-naglowek .is-menu-open .wp-block-navigation__responsive-container-content,
.luna-naglowek .is-menu-open .wp-block-navigation__container,
.luna-naglowek .is-menu-open .wp-block-navigation-item { align-items: flex-start !important; text-align: left; }
.luna-naglowek .is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 3rem; }
.luna-naglowek .is-menu-open .wp-block-navigation__container { font-size: 1.5rem; gap: 1.1rem !important; }
.luna-naglowek .is-menu-open a { text-shadow: none; }
.luna-naglowek .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	background: transparent !important; box-shadow: none; padding: .5rem 0 0 1.2rem !important; font-size: 1.15rem; gap: .5rem !important;
	border-left: 2px solid var(--wp--preset--color--laguna) !important; border-radius: 0; margin-top: .4rem;
}
.luna-naglowek .is-menu-open .wp-block-navigation__submenu-container a { padding: .15rem 0 !important; }

/* ---------- Logo ---------- */
.luna-logo { display: inline-block; line-height: 0; flex-shrink: 0; }
.luna-logo img { display: block; width: auto; }
.luna-naglowek .luna-logo img { height: 3.25rem; }
@media (max-width: 600px) { .luna-naglowek .luna-logo img { height: 2.5rem; } }
.luna-stopka .luna-logo img { height: 3.5rem; }
.luna-stopka .luna-logo--charter { margin-top: var(--wp--preset--spacing--40); }
.luna-stopka .luna-logo--charter img { height: 3.5rem; opacity: .9; }
.luna-stopka .luna-logo--charter:hover img { opacity: 1; }

/* ---------- Stopka ---------- */
.luna-stopka { color: rgba(255,255,255,.82); }
.luna-stopka h2, .luna-stopka h3 { color: #fff; margin-bottom: .5rem; }
.luna-stopka a { color: #fff; text-decoration: none; }
.luna-stopka a:hover { text-decoration: underline; }
.luna-stopka__kontakt { line-height: 1.55; }
.luna-stopka__kontakt a { white-space: nowrap; }
.luna-stopka > .wp-block-columns { flex-wrap: wrap !important; row-gap: var(--wp--preset--spacing--40); }
.luna-stopka > .wp-block-columns > .wp-block-column { flex: 1 1 12rem !important; }
.luna-stopka > .wp-block-columns > .wp-block-column:first-child { flex: 1 1 16rem !important; }

/* Menu: do 1080 px mniejsze odstępy; poniżej (tablet) przycisk menu zamiast paska, jak na telefonie */
@media (max-width: 1180px) {
	.luna-naglowek .wp-block-navigation { font-size: .95rem; }
	.luna-naglowek .wp-block-navigation__container { gap: .9rem !important; }
	.luna-naglowek > .alignwide { gap: 1rem !important; }
	.luna-naglowek .luna-logo img { height: 2.75rem; }
}
@media (min-width: 600px) and (max-width: 1023px) {
	.luna-naglowek .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.luna-naglowek .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
	.luna-naglowek .wp-block-navigation__responsive-container-close:not(.always-shown) { display: flex; }
}
.luna-stopka .wp-block-separator { margin-block: var(--wp--preset--spacing--30); }
.luna-stopka__copyright { margin: 0; letter-spacing: .08em; text-align: center; }
.luna-stopka__copyright span { margin: 0 .5em; opacity: .6; }

/* ---------- Elementy wspólne ---------- */
.luna-etykieta {
	font-size: .85rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
	color: var(--wp--preset--color--morze);
}
.has-glebia-background-color .luna-etykieta,
.wp-block-cover .luna-etykieta { color: var(--wp--preset--color--laguna); }
.luna-etykieta a { color: inherit; text-decoration: none; }
.luna-etykieta a:hover { text-decoration: underline; }

/* Przycisk-kontur na ciemnym tle */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent; color: currentColor; border: 1.5px solid currentColor;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: #fff; color: var(--wp--preset--color--glebia); border-color: #fff;
}

/* Półprzezroczysta karta na zdjęciu — tło strony prześwituje */
.luna-szklo {
	background: rgba(246, 241, 232, .38);
	-webkit-backdrop-filter: blur(10px) saturate(1.1);
	backdrop-filter: blur(10px) saturate(1.1);
	border-radius: 14px;
	box-shadow: 0 20px 50px rgba(6, 20, 32, .25);
	container-type: inline-size;
}
.luna-szklo .luna-etykieta { color: var(--wp--preset--color--morze) !important; }
.luna-szklo .wp-block-columns { margin: 0; }
.luna-szklo h2 { margin-top: .25rem; }
.luna-szklo .wp-block-column h2 {
	font-size: clamp(1.6rem, 4.85cqi, 2.8rem); font-weight: 600; letter-spacing: -.005em;
	color: var(--wp--preset--color--glebia) !important;
	line-height: 1.08; overflow-wrap: normal; word-break: normal; hyphens: manual;
}
@media (max-width: 781px) { .luna-szklo .wp-block-column h2 { font-size: 2.1rem; } }
.luna-szklo a:not(.wp-block-button__link) { color: var(--wp--preset--color--glebia); }

/* Zdjęcie w karcie (About, The design, kafle łodzi) */
.luna-zdjecie-karty { margin: 0; }
.luna-zdjecie-karty img { width: 100%; height: auto; border-radius: 10px; display: block; aspect-ratio: 3 / 2; object-fit: cover; }
.luna-zdjecie-karty a img { transition: transform .6s ease; }
.luna-zdjecie-karty a { display: block; overflow: hidden; border-radius: 10px; }
.luna-zdjecie-karty a:hover img { transform: scale(1.03); }
.luna-mapa .luna-zdjecie-karty img { aspect-ratio: auto; }
@media (prefers-reduced-motion: reduce) { .luna-zdjecie-karty a:hover img { transform: none; } }

/* ---------- Tło stron: stałe zdjęcie pod całą stroną, karty na wierzchu ----------
   Pseudo-element position:fixed zamiast background-attachment:fixed — działa też na iPhone. */
html:has(.luna-strona-glowna) { background: var(--wp--preset--color--glebia); }
body:has(.luna-strona-glowna) { background: transparent; }
body:has(.luna-strona-glowna)::before {
	content: ""; position: fixed; inset: 0; z-index: -1;
	background: linear-gradient(rgba(10, 34, 53, .62), rgba(10, 34, 53, .22) 20%, rgba(10, 34, 53, .16) 60%, rgba(10, 34, 53, .10)), url(assets/images/tlo.webp) 50% 50% / cover no-repeat;
}
body:has(.luna-strona-glowna) .luna-stopka.has-glebia-background-color {
	background-color: rgba(10, 34, 53, .55) !important; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

/* Strona główna: zdjęcia slidera starej strony przenikają się w tle (7 × 6 s) */
.luna-pokaz { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--wp--preset--color--glebia); max-width: none !important; margin: 0 !important; }
.luna-pokaz img {
	position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
	opacity: 0; animation: luna-pokaz 42s infinite; margin: 0 !important; max-width: none;
}
.luna-pokaz img:nth-child(1) { opacity: 1; }
.luna-pokaz img:nth-child(2) { animation-delay: 6s; }
.luna-pokaz img:nth-child(3) { animation-delay: 12s; }
.luna-pokaz img:nth-child(4) { animation-delay: 18s; }
.luna-pokaz img:nth-child(5) { animation-delay: 24s; }
.luna-pokaz img:nth-child(6) { animation-delay: 30s; }
.luna-pokaz img:nth-child(7) { animation-delay: 36s; }
.luna-pokaz::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(rgba(10, 34, 53, .55), rgba(10, 34, 53, .12) 25%, rgba(10, 34, 53, .1) 60%, rgba(10, 34, 53, .35));
}
@keyframes luna-pokaz {
	0% { opacity: 0; }
	3% { opacity: 1; }
	16% { opacity: 1; }
	19% { opacity: 0; }
	100% { opacity: 0; }
}
.luna-pokaz img:nth-child(1) { animation-name: luna-pokaz-pierwszy; }
@keyframes luna-pokaz-pierwszy {
	0% { opacity: 1; }
	16% { opacity: 1; }
	19% { opacity: 0; }
	97% { opacity: 0; }
	100% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
	.luna-pokaz img { animation: none !important; }
}

.luna-start { min-height: 86vh; display: flex; flex-direction: column; justify-content: flex-end; padding-top: 10rem; padding-bottom: var(--wp--preset--spacing--40); }
.luna-start h1 { text-shadow: 0 2px 18px rgba(6, 20, 32, .5); margin-bottom: 0; }
.luna-start .wp-block-button__link { box-shadow: 0 10px 30px rgba(6, 20, 32, .3); }

/* Układ kart na stronie: szerokość ekranu z marginesem, maksymalnie 1120 px */
.luna-strona-glowna { padding-bottom: var(--wp--preset--spacing--60); }
.luna-strona-glowna .luna-szklo { margin-left: auto !important; margin-right: auto !important; width: calc(100% - 2 * var(--wp--style--root--padding-left, 1.5rem)); box-sizing: border-box; }
.luna-strona-glowna__tresc { max-width: none !important; width: 100%; --luna-karta-max: 1120px; }
.luna-strona-glowna__tresc > * { margin-block-start: 0; margin-block-end: 0; }
.luna-strona-glowna__tresc > * + * { margin-block-start: var(--wp--preset--spacing--50); }
.luna-strona-glowna__tresc > .luna-szklo { max-width: var(--luna-karta-max) !important; }
.luna-strona-glowna__tresc .luna-start > .alignwide {
	width: 100%; max-width: var(--luna-karta-max) !important;
	margin-left: auto !important; margin-right: auto !important; box-sizing: border-box;
	padding-left: var(--wp--preset--spacing--50);
}
.luna-sekcje, .luna-podstrona { padding-top: 7.5rem; }

/* Karta-nagłówek strony: zdjęcie z tytułem */
.luna-glowa__zdjecie { border-radius: 10px; overflow: hidden; }
.luna-glowa__zdjecie h1 { margin: .2rem 0 0; text-shadow: 0 2px 18px rgba(6, 20, 32, .45); }
.luna-glowa__zdjecie .luna-etykieta { color: var(--wp--preset--color--laguna) !important; letter-spacing: .22em; font-weight: 600; }
.luna-glowa__zdjecie .luna-etykieta a { color: inherit !important; }
.luna-glowa__zdjecie .wp-block-cover__background.has-background-gradient {
	opacity: 1 !important;
	background: linear-gradient(180deg, rgba(10, 34, 53, 0) 45%, rgba(10, 34, 53, .55) 80%, rgba(10, 34, 53, .85) 100%) !important;
}

/* Zwykłe podstrony (Privacy policy…): treść w półprzezroczystej karcie */
.luna-podstrona .wp-block-post-title { margin-top: 0; }
.luna-podstrona .wp-block-post-content h2 { color: var(--wp--preset--color--glebia); font-size: var(--wp--preset--font-size--large); }
.luna-podstrona .wp-block-post-content h3 { color: var(--wp--preset--color--glebia); margin-bottom: .5rem; }
.luna-podstrona .wp-block-post-content a { color: var(--wp--preset--color--glebia); text-decoration: none; font-weight: 600; }
.luna-podstrona .wp-block-post-content a:hover { text-decoration: underline; }

/* The design: podpis projektantów */
.luna-projekt h3 { font-size: 1.1rem; letter-spacing: .02em; }

/* Kafle łodzi (Sailing / Motor Catamarans): lista cech */
.luna-cechy { list-style: none; padding: 0; margin: 0; }
.luna-cechy li { position: relative; padding-left: 1.6rem; margin-bottom: .6rem; }
.luna-cechy li::before {
	content: ""; position: absolute; left: 0; top: .72em; width: .7rem; height: 2px;
	background: var(--wp--preset--color--laguna);
}

/* ---------- Strona łodzi ---------- */
.luna-galeria { gap: .6rem !important; margin: 0; }
.luna-galeria .wp-block-image img { border-radius: 6px; }
.luna-galeria .wp-block-image { cursor: zoom-in; }
.luna-galeria--uklad .wp-block-image img { object-fit: contain !important; background: #fff; }
.luna-galeria--uklad.is-cropped .wp-block-image img { height: auto !important; aspect-ratio: 16 / 10; }
@media (max-width: 600px) {
	.luna-galeria.columns-3 .wp-block-image { width: calc(50% - .3rem) !important; }
	.luna-galeria--uklad .wp-block-image { width: 100% !important; }
}

/* Specyfikacja: tabela w karcie */
.luna-specyfikacja { margin: 0; }
.luna-specyfikacja table { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
.luna-specyfikacja.wp-block-table, .luna-specyfikacja.wp-block-table.is-style-stripes { border: 0; }
.luna-specyfikacja tr { background: transparent !important; }
.luna-specyfikacja.is-style-stripes tbody tr:nth-child(odd) { background: rgba(255, 255, 255, .32) !important; }
.luna-specyfikacja td { border: 0; border-bottom: 1px solid rgba(10, 34, 53, .1); padding: .55rem .8rem; }
.luna-specyfikacja td:first-child { color: #33434f; }
.luna-specyfikacja td:last-child { text-align: right; font-weight: 600; color: var(--wp--preset--color--glebia); white-space: nowrap; }
.luna-specyfikacja td { word-break: normal; overflow-wrap: normal; hyphens: none; }
@media (max-width: 600px) {
	.luna-specyfikacja table { font-size: .95rem; }
	.luna-specyfikacja td { padding: .5rem .45rem; }
	.luna-specyfikacja td:last-child { white-space: normal; }
}
/* Stałe proporcje miniatur: brak skoków strony przy doczytywaniu zdjęć */
.luna-galeria.is-cropped:not(.luna-galeria--uklad) .wp-block-image img { aspect-ratio: 4 / 3; height: auto !important; }
.luna-specyfikacja-karta .wp-block-buttons { gap: .6rem; }

.luna-wideo video { width: 100%; border-radius: 10px; background: var(--wp--preset--color--glebia); }

/* ---------- Contact ---------- */
.luna-kontakt__adresy { margin-block: .5rem 1rem !important; }
.luna-kontakt__adresy p { margin: 0; }
.luna-kontakt__adresy .luna-etykieta { margin-bottom: .25rem; }
.luna-kontakt__dane { line-height: 1.7; }
.luna-kontakt .wpcf7 label { display: block; font-weight: 600; color: var(--wp--preset--color--glebia); }
.luna-kontakt .wpcf7 input:not([type=submit]):not([type=checkbox]),
.luna-kontakt .wpcf7 textarea {
	width: 100%; box-sizing: border-box; margin-top: .3rem; padding: .7rem .9rem;
	font: inherit; font-weight: 400; color: var(--wp--preset--color--atrament);
	background: rgba(255, 255, 255, .7); border: 1px solid rgba(10, 34, 53, .18); border-radius: 8px;
}
.luna-kontakt .wpcf7 textarea { min-height: 9rem; }
.luna-kontakt .wpcf7 input:focus, .luna-kontakt .wpcf7 textarea:focus { outline: 2px solid var(--wp--preset--color--laguna); outline-offset: 1px; }
.luna-kontakt .wpcf7 input[type=submit] {
	background: var(--wp--preset--color--glebia); color: #fff; border: 0; border-radius: 999px;
	padding: .85rem 1.9rem; font: inherit; font-size: .95rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
}
.luna-kontakt .wpcf7 input[type=submit]:hover { background: var(--wp--preset--color--morze); }
.luna-kontakt .wpcf7-acceptance label { font-weight: 400; color: inherit; }

/* ---------- Edytor: to samo tło co na stronie ---------- */
.editor-styles-wrapper:has(.luna-szklo), .editor-styles-wrapper:has(.luna-start) {
	background: linear-gradient(rgba(10, 34, 53, .62), rgba(10, 34, 53, .22) 20%, rgba(10, 34, 53, .16) 60%, rgba(10, 34, 53, .10)), url(assets/images/tlo.webp) 50% 0 / cover no-repeat fixed, var(--wp--preset--color--glebia);
}
.editor-styles-wrapper:has(.luna-szklo) .editor-post-title { color: #fff; }
.editor-styles-wrapper .luna-pokaz { position: relative; height: 0; }
.editor-styles-wrapper .luna-start { min-height: 50vh; padding-top: 4rem; }
