/*
Theme Name: Archtrip
Theme URI: https://archtrip.pl
Author: Archtrip
Description: Lekki motyw blokowy czasopisma podróżniczego Archtrip. Czerń i żółć, trzy działy, cykle, szablon wpisu z leadem, „W skrócie”, spisem treści i nagraniem.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: archtrip
*/

/* ---------- podstawy ---------- */
html { -webkit-text-size-adjust: 100%; }
body { text-rendering: optimizeLegibility; }
:where(a) { text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
:where(a):hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #FCD103; outline-offset: 2px; }
img { height: auto; }

/* tekst ciągły: justowanie + dzielenie wyrazów */
.at-prose p,
.wp-block-post-content > p,
.at-justify { text-align: justify; -webkit-hyphens: auto; hyphens: auto; }
/* kafelki i boksy: do lewej, bez dzielenia */
.at-box p, .at-card p, .at-box li, .at-card li { text-align: left; -webkit-hyphens: manual; hyphens: manual; }

/* ---------- nagłówek ---------- */
.at-header { position: relative; z-index: 20; }
.at-header .wp-block-navigation a { text-decoration: none; font-weight: 600; }
.at-header .wp-block-navigation a:hover { color: #FCD103; }
.at-header .wp-block-navigation__responsive-container.is-menu-open { background: #111111; color: #ffffff; }
.at-logo-tag { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #bdbdbd; line-height: 1.2; }

/* ---------- etykiety (kicker) ---------- */
.at-kicker { font-family: var(--wp--preset--font-family--sans); font-size: 14px !important; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #6b5800; }
.has-czern-background-color .at-kicker, .at-dark .at-kicker { color: #FCD103; }

/* ---------- karty ---------- */
.at-card { background: #fff; border: 1px solid #dddddd; border-radius: 10px; overflow: hidden; height: 100%; display: flex; flex-direction: column; transition: box-shadow .15s ease, transform .15s ease; }
.at-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.08); transform: translateY(-2px); }
.at-card .wp-block-post-featured-image { margin: 0; }
.at-card .wp-block-post-featured-image img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.at-card-body { padding: 20px !important; display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.at-card .wp-block-post-title a { text-decoration: none; }
.at-card .wp-block-post-title a:hover { text-decoration: underline; }
.at-card .wp-block-post-terms { font-size: 14px; font-weight: 700; color: #6b5800; }
.at-card .wp-block-post-terms a { text-decoration: none; color: inherit; }
.at-meta { font-size: 14px; color: #555555; margin-top: auto !important; }
.at-meta p, .at-meta div { margin: 0; }

.wp-block-post-template.is-layout-grid { gap: 22px; }
.at-dark .at-card { background: #1a1a1a; border-color: #333; color: #fff; }

/* kafel działu */
.at-dzial { border-top: 6px solid #FCD103 !important; }
.at-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.at-chips li, .at-chip { background: #f5f5f5; border-radius: 999px; padding: 6px 12px; font-size: 15px; font-weight: 600; }
.at-chips a, a.at-chip { text-decoration: none; color: #111; }
.at-chips a:hover, a.at-chip:hover { text-decoration: underline; }

/* na skróty */
.at-shortcuts a { text-decoration: none; color: #111; }
.at-shortcuts .wp-block-column { padding: 6px 0; }
.at-shortcuts h3 a::after { content: " →"; }

/* przyciski */
.wp-block-button.is-style-outline .wp-block-button__link { border-width: 2px; }
.at-dark .wp-block-button.is-style-outline .wp-block-button__link { color: #fff; border-color: #fff; }

/* cytat w hero */
.at-quote { border-left: 6px solid #FCD103 !important; padding-left: 24px !important; margin: 0 !important; margin-top: 32px !important; }
.at-quote p { font-family: var(--wp--preset--font-family--serif); font-style: italic; }
.at-quote cite { font-style: normal; font-size: 15px; color: #bdbdbd; }

/* ---------- wpis ---------- */
.at-breadcrumbs { font-size: 15px; color: #555; display: flex; flex-wrap: wrap; gap: 8px; }
.at-breadcrumbs a { color: #555; }
.at-lead { font-family: var(--wp--preset--font-family--serif); }
.at-metabar { border-top: 1px solid #dddddd; border-bottom: 1px solid #dddddd; padding: 14px 0; }
.at-metabar .wp-block-post-author { align-items: center; }
.at-metabar .wp-block-post-author__avatar img { border-radius: 50%; }
.at-metabar .wp-block-post-author__name { font-weight: 700; margin: 0; }
.at-listen { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.at-listen button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 2px solid #111; background: #FCD103; font: inherit; font-weight: 700; cursor: pointer; color: #111; }
.at-listen small { color: #555; font-size: 14px; }
.at-listen audio { display: none; width: 100%; max-width: 420px; }
.at-listen.is-open audio { display: block; }

.single .wp-block-post-featured-image img { border-radius: 10px; aspect-ratio: 21 / 9; object-fit: cover; width: 100%; }
.at-caption { font-size: 15px; color: #555; margin-top: 8px; }

.wp-block-post-content { font-family: var(--wp--preset--font-family--serif); }
.wp-block-post-content h2 { margin-top: 1.4em; scroll-margin-top: 24px; }
.wp-block-post-content h3 { margin-top: 1.2em; }
.wp-block-post-content figure { margin: 1.4em 0; }
.wp-block-post-content figure img { border-radius: 8px; }
.wp-block-post-content figcaption { font-family: var(--wp--preset--font-family--sans); font-size: 15px; color: #555; text-align: left; }
.wp-block-post-content blockquote { border-left: 6px solid #FCD103; margin-left: 0; padding: 4px 0 4px 26px; font-style: italic; font-size: 1.15em; }

.at-box { font-family: var(--wp--preset--font-family--sans); border-radius: 10px; padding: 22px 26px; }
.at-skrot { background: #fff6cc; }
.at-skrot ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 18px; line-height: 1.5; }
.at-gdzie { border: 1px solid #ddd; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; font-size: 16px; padding: 16px 20px; }
.at-gdzie a { font-weight: 700; }
.at-box-title { font-weight: 700; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: #6b5800; margin: 0 0 10px; }

.at-sidebar { position: sticky; top: 24px; }
.at-toc { border: 1px solid #ddd; border-radius: 10px; padding: 20px; font-family: var(--wp--preset--font-family--sans); }
.at-toc ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.at-tags { background: #f5f5f5; border-radius: 10px; padding: 20px; }
.at-tags .wp-block-post-terms { display: flex; flex-wrap: wrap; gap: 8px; font-size: 15px; font-weight: 600; }
.at-tags .wp-block-post-terms a { background: #fff; border: 1px solid #ddd; border-radius: 999px; padding: 6px 12px; text-decoration: none; color: #111; }
.at-tags .wp-block-post-terms__separator { display: none; }

.at-author { border: 1px solid #ddd; border-radius: 10px; padding: 22px; font-family: var(--wp--preset--font-family--sans); }
.at-author img { border-radius: 50%; }

/* newsletter */
.at-newsletter form { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.at-newsletter input[type=email] { flex: 1 1 240px; min-width: 0; font: inherit; padding: 14px 16px; border-radius: 6px; border: 2px solid #111; background: #fff; }
.at-newsletter button { font: inherit; font-weight: 700; padding: 14px 22px; border-radius: 6px; border: 2px solid #111; background: #111; color: #FCD103; cursor: pointer; }
.at-dark .at-newsletter button, .at-newsletter.on-dark button { background: #FCD103; color: #111; border-color: #FCD103; }
.at-newsletter label.at-optin { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; flex-basis: 100%; }
.at-newsletter .at-hp { position: absolute; left: -9999px; }
.at-newsletter .at-msg { flex-basis: 100%; font-weight: 700; margin: 0; }

/* FAQ */
.wp-block-details { background: #fff; border: 1px solid #ddd; border-radius: 10px; padding: 18px 22px; }
.wp-block-details summary { font-weight: 700; font-size: 19px; cursor: pointer; }
.wp-block-details p { font-size: 17px; }

/* stopka */
.at-footer a { color: #cccccc; text-decoration: none; }
.at-footer a:hover { color: #FCD103; text-decoration: underline; }
.at-footer h2 { color: #FCD103; }

/* paginacja */
.wp-block-query-pagination { gap: 12px; font-weight: 700; }

@media (max-width: 781px) {
  .at-sidebar { position: static; }
  .at-hide-mobile { display: none !important; }
}

/* bez odstępu między nagłówkiem, treścią i stopką */
.wp-site-blocks > * + * { margin-block-start: 0; }

/* strony: wideo pionowe, numeracja kroków */
.wp-block-video video { max-height: 620px; width: auto; max-width: 100%; display: block; margin: 0 auto; border-radius: 10px; background: #0a0a0a; }
.at-num { color: #7e6c0d; margin-right: 6px; }

/* formularze Contact Form 7 */
.wpcf7 { max-width: 640px; }
.kgw-f label { display: block; font-size: 16px; font-weight: 600; margin: 0 0 16px; }
.kgw-f label span { font-weight: 400; color: #666; }
.kgw-f input[type=email], .kgw-f input[type=text], .kgw-f input[type=tel], .kgw-f textarea { box-sizing: border-box; display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font: inherit; font-weight: 400; border: 1px solid #cfcac0; border-radius: 8px; background: #fff; }
.kgw-f textarea { min-height: 96px; }
.kgw-zgoda { font-size: 14px; line-height: 1.5; color: #444; margin: 4px 0 18px; }
.kgw-zgoda .wpcf7-list-item { margin: 0; }
.kgw-zgoda input { margin-right: 8px; }
.wpcf7-submit { background: #FCD103; color: #0a0a0a; border: 0; border-radius: 8px; padding: 14px 26px; font: 700 16px/1 var(--wp--preset--font-family--sans, sans-serif); cursor: pointer; }
.wpcf7-submit:hover { background: #0a0a0a; color: #FCD103; }
.wpcf7-not-valid-tip { font-size: 14px; color: #b3261e; margin-top: 4px; }
.wpcf7 form .wpcf7-response-output { margin: 16px 0 0; padding: 12px 14px; border-radius: 8px; font-size: 15px; }

/* telefon: WordPress zmniejsza czcionki „płynnie” za mocno – pilnujemy minimum w kartach */
@media (max-width: 781px) {
  .at-card .wp-block-post-title, .at-card h3.wp-block-heading { font-size: 21px !important; line-height: 1.25; }
  .at-card p, .at-card li, .at-card .wp-block-post-excerpt { font-size: 16px !important; }
}

/* puste akapity po krótkich kodach nie robią odstępów */
.wp-site-blocks p:empty { display: none; }

/* linki do innych stron */
a.at-ext::after { content: "\2009↗"; font-size: .8em; text-decoration: none; display: inline-block; }
a.at-ext:has(img)::after, .wp-block-social-links a.at-ext::after, .wp-block-button a.at-ext::after, .at-footer a.at-ext::after { content: none; }

/* kafelek Podcast na stronie głównej: kadr na zdjęcie z rozmowy */
figure:has(> img[src*="POdcast-ArchTrip"]), a:has(> img[src*="POdcast-ArchTrip"]) { overflow: hidden; display: block; }
img[src*="POdcast-ArchTrip"] { width: 100% !important; object-position: 50% 64% !important; transform: scale(1.08); transform-origin: 50% 64%; }

/* kafelek Głowa w murze: kadr wyżej, żeby było widać kapelusz i twarz Gawędziarza */
img[src*="glowa-w-murze-gawedziarz-okladka"] { object-position: 50% 30% !important; }

/* oba kafelki: trochę żywsze kolory (plik zdjęcia bez zmian) */
img[src*="POdcast-ArchTrip"], img[src*="glowa-w-murze-gawedziarz-okladka"] { filter: saturate(1.2) contrast(1.08) brightness(1.02); }

/* Telefon: większe litery.
   Punkt odniesienia: GOV.UK Design System od wersji 6 – tekst główny 19 px na każdym ekranie, drobny 16 px;
   badanie Rello, Pielot, Marcos (Uniwersytet Pompeu Fabra, CHI 2016) – czytelność rośnie do ok. 18 pt;
   Apple HIG – tekst główny 17 pt, przy cienkich krojach większy. */
@media (max-width: 781px) {
	:root {
		--wp--preset--font-size--small: 16px;
		--wp--preset--font-size--medium: 18px;
		--wp--preset--font-size--large: 21px;
	}
	body { font-size: 18px; }
	main p, main li, .wp-block-post-excerpt__excerpt { font-size: 18px !important; line-height: 1.55; }
	.at-prose p, .at-prose li { font-size: 19px !important; line-height: 1.6; }
	.single main .wp-block-post-excerpt__excerpt, main blockquote p, main p.has-serif-font-family { font-size: 20px !important; line-height: 1.45; }
	main p.at-kicker, main .at-kicker a, main time, .wp-block-post-date, .wp-block-post-author__name, .at-czas, .at-badge, main cite, .at-caption, .at-breadcrumbs, .at-optin, .at-optin span,
	footer p, footer li, footer a, .wp-block-button__link, main button { font-size: 16px !important; }
	main summary { font-size: 19px; }
	/* kafelki: opisy jak zwykły tekst, zajawki wpisów jak treść wpisu */
	.at-card p, .at-card li { font-size: 18px !important; line-height: 1.55; }
	.at-card .wp-block-post-excerpt, .at-card .wp-block-post-excerpt__excerpt, main .wp-block-post-excerpt__excerpt { font-size: 19px !important; line-height: 1.55; }
	.at-card time, .at-card .at-czas, .at-card .wp-block-post-date { font-size: 16px !important; }
	.at-card p.has-zolty-color { font-size: 15px !important; } /* etykieta „Najnowszy tekst” */
	/* nadtytuły wersalikami z rozstrzeleniem czyta się jak większe – zostają 15 px, żeby mieściły się w jednym wierszu */
	main p.at-kicker, main .at-kicker a, .has-zolty-background-color .at-kicker { font-size: 15px !important; }
	/* na żółtym tle: o stopień większe i w pełni czarne */
	.has-zolty-background-color p, .has-zolty-background-color li { font-size: 19px !important; color: #000 !important; }
	.has-zolty-background-color .at-kicker, .has-zolty-background-color .at-optin, .has-zolty-background-color .at-optin span, .has-zolty-background-color .at-optin a { font-size: 17px !important; color: #000 !important; }
	.at-shortcuts a { font-size: 19px !important; color: #000 !important; }
}

/* Menu na telefonie: duże pozycje, wygodne do kliknięcia */
.wp-block-navigation__responsive-container.is-menu-open { padding: 24px 28px !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { align-items: stretch !important; padding-top: 56px !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { align-items: stretch !important; width: 100%; gap: 0 !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { width: 100%; border-bottom: 1px solid rgba(255,255,255,.14); }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block; width: 100%; padding: 16px 0 !important;
	font-size: 26px !important; font-weight: 700 !important; line-height: 1.2; text-align: left;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:focus { color: #FCD103 !important; }
.wp-block-navigation__responsive-container-close { top: 22px !important; right: 22px !important; }
.wp-block-navigation__responsive-container-close svg { width: 36px !important; height: 36px !important; }

/* „Listy z drogi” jako żółty przycisk na dole menu na telefonie (na komputerze jest osobny przycisk w nagłówku) */
.wp-block-navigation .at-nav-cta { display: none !important; }
.wp-block-navigation__responsive-container.is-menu-open .at-nav-cta { display: block !important; border-bottom: 0 !important; margin-top: 32px; }
.wp-block-navigation__responsive-container.is-menu-open .at-nav-cta .wp-block-navigation-item__content {
	background: #FCD103; color: #111 !important; text-align: center; border-radius: 6px; box-sizing: border-box; width: 100%; max-width: 100%;
	padding: 16px 20px !important; font-size: 22px !important;
}
.wp-block-navigation__responsive-container.is-menu-open .at-nav-cta .wp-block-navigation-item__content:hover,
.wp-block-navigation__responsive-container.is-menu-open .at-nav-cta .wp-block-navigation-item__content:focus { color: #111 !important; background: #ffe04d; }
