/*
Theme Name: Jagellonská 22
Description: Jednostránková prezentace bytu 4+1 v Jagellonské 22, Plzeň. Blokové téma – texty i fotky se upravují v editoru (Vzhled → Editor).
Version: 1.13
Requires at least: 6.4
Requires PHP: 7.4
Author: Kamil Valeš
Text Domain: jagellonska22
License: GPLv2 or later
*/

:root {
	--j-ink: #1d1d1b;
	--j-muted: #5f5c57;
	--j-line: #d6d2cb;
	--j-accent: #1f5e5e;
	--j-warm: #9a5a2c;
	--j-bg: #ffffff;
	--j-soft: #f4f2ee;
	--j-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
	--j-display: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }

/* ---------- hlavička ---------- */
.j-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255,255,255,.94);
	backdrop-filter: blur(6px);
	border-bottom: 1px solid transparent;
}
.admin-bar .j-header { top: 32px; }
.j-header .wp-block-site-title, .j-brand { font-family: var(--j-display); font-weight: 700; font-size: 1.05rem; margin: 0; }
.j-brand a { color: inherit; text-decoration: none; }
.j-header .wp-block-navigation { font-family: var(--j-mono); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.j-header .wp-block-navigation a { text-decoration: none; }
.j-header .wp-block-navigation a:hover { color: var(--j-accent); }

/* ---------- typografie ---------- */
.j-label {
	font-family: var(--j-mono);
	font-size: .78rem !important;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--j-muted);
	margin-bottom: .6rem !important;
}
.j-hero-title { font-family: var(--j-display); font-weight: 800; letter-spacing: -.03em; line-height: 1.02; }
.j-lead { font-size: clamp(1.15rem, 2vw, 1.4rem); max-width: 30ch; }
.j-section h2 { font-family: var(--j-display); font-weight: 700; letter-spacing: -.015em; }
.j-section { border-top: 1px solid var(--j-ink); scroll-margin-top: 80px; }
.j-section p { max-width: 68ch; }

/* ---------- tlačítka ---------- */
.wp-block-button .wp-block-button__link { border-radius: 2px; }
.j-btn-outline .wp-block-button__link {
	background: transparent !important; color: var(--j-accent) !important;
	border: 2px solid var(--j-accent) !important;
}
.j-btn-solid .wp-block-button__link {
	background: transparent !important; color: var(--j-ink) !important;
	border: 2px solid var(--j-accent) !important;
}
.j-btn-solid .wp-block-button__link:hover,
.j-btn-outline .wp-block-button__link:hover { background: var(--j-accent) !important; color: #fff !important; }

/* ---------- fotky ---------- */
.j-hero-photos { gap: 0 !important; border: 1px solid var(--j-line); }
.j-hero-photos > .wp-block-column + .wp-block-column { border-left: 1px solid var(--j-muted); }
.j-hero-photos figure { margin: 0; }
.j-hero-photos img { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; }
.j-hero-photos figcaption { text-align: left; padding: .6rem .9rem; margin: 0; font-size: .9rem; }
.j-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.j-photo figcaption, .j-note { font-size: .9rem; color: var(--j-ink); text-align: left; line-height: 1.55; }
.j-wide img { aspect-ratio: 16/9; }
.j-badge {
	display: inline-block; font-family: var(--j-mono); font-size: .68rem; letter-spacing: .1em;
	text-transform: uppercase; color: var(--j-warm); border: 1px solid var(--j-warm);
	padding: .1em .45em; margin-right: .4em; vertical-align: 1px;
}

/* ---------- čísla ---------- */
.j-stats .j-stat-value { font-family: var(--j-display); font-weight: 700; font-size: 1.8rem; margin: 0; line-height: 1.1; }
.j-stats .j-label { margin-top: .2rem !important; }

/* ---------- video ---------- */
.j-video {
	aspect-ratio: 16/9; background: var(--j-soft); border: 1px solid var(--j-line);
	display: flex; align-items: center; justify-content: center; text-align: center;
}
.j-video .wp-block-embed, .j-video iframe { width: 100%; height: 100%; margin: 0; }

/* ---------- podsekce s linkou ---------- */
.j-ruled > .wp-block-column { border-top: 1px solid var(--j-ink); padding-top: .9rem; }
.j-ruled h3 { font-family: var(--j-display); font-size: 1.05rem; margin: 0 0 .4rem; }

/* ---------- časová osa ---------- */
.j-timeline .j-event { border-top: 1px solid var(--j-line); padding-top: .9rem; }
.j-timeline .j-date { font-family: var(--j-mono); color: var(--j-warm); font-size: .85rem; margin: 0 0 .2rem; }
.j-timeline .j-event p:last-child { margin-top: 0; }

/* ---------- tabulka ---------- */
.j-table table { border-collapse: collapse; width: 100%; font-size: .92rem; border: 1px solid var(--j-line); }
.j-table th { font-family: var(--j-mono); font-weight: 400; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--j-muted); text-align: left; }
.j-table th, .j-table td { border: 0; border-bottom: 1px solid var(--j-line); padding: .9rem 1rem; vertical-align: top; }
.j-table td:first-child { font-weight: 600; }
.j-params > .wp-block-column > p { border-bottom: 1px solid var(--j-line); padding-bottom: .9rem; }

/* ---------- kontakt ---------- */
.j-contact a { color: var(--j-ink); }
.j-copy {
	font-family: var(--j-mono); font-size: .65rem; letter-spacing: .1em; text-transform: uppercase;
	background: none; color: var(--j-accent); border: 1px solid var(--j-accent);
	padding: .2em .5em; margin-left: .6em; cursor: pointer; vertical-align: 2px;
}
.j-copy:hover { background: var(--j-accent); color: #fff; }
.j-arrows p { margin: .3rem 0; }
.j-footer { border-top: 1px solid var(--j-ink); font-size: .85rem; color: var(--j-muted); }

a { text-underline-offset: 3px; }

@media (max-width: 781px) {
	.j-hero-photos > .wp-block-column + .wp-block-column { border-left: 0; border-top: 1px solid var(--j-muted); }
	.j-header .wp-block-navigation { font-size: .75rem; }
	.admin-bar .j-header { top: 46px; }
}

/* ---------- rozestupy ---------- */
.j-header-inner { padding: 1.1rem 0; }
.j-main { padding-bottom: 2rem; }
.j-hero { padding-top: clamp(2rem, 6vw, 4rem); }
.j-hero-title { font-size: clamp(2.6rem, 7vw, 4.6rem) !important; margin: .4rem 0 1.4rem !important; }
.j-hero .wp-block-buttons { margin: 1.6rem 0 2.2rem; }
.j-stats-wrap { border-top: 1px solid var(--j-ink); margin-top: 3.5rem !important; padding-top: 2rem; }
.j-stats { margin-bottom: 1.2rem !important; }
.j-section { margin-top: 4rem !important; padding-top: 2.2rem; }
.j-section > h2 { margin-top: .2rem; margin-bottom: 1.2rem; }
.j-photo-grid { margin-top: 2rem !important; }
.j-photo figcaption { margin-top: .8rem; }
.j-wide { margin-top: 2rem !important; }
.j-timeline { margin: 1.6rem 0 2rem !important; }
.j-bio { margin-top: 2rem !important; }
.j-params { margin-top: .8rem !important; }
.j-footer { margin-top: 4rem; padding: 1.6rem 0 3rem; }
.j-footer p { margin: .3rem 0; }
.j-contact .j-label { margin-top: 1.6rem !important; margin-bottom: .2rem !important; }
.j-copyable { margin-top: 0 !important; font-size: 1.05rem; }
.j-ruled > .wp-block-column:empty { border-top: 0; }

/* ---------- půdorysy a video ---------- */
.j-plan img { object-fit: contain; background: #fff; border: 1px solid var(--j-line); }
.j-reel { margin: 0 !important; }
.j-reel video { width: 100%; aspect-ratio: 16/9; background: #000; display: block; }
.j-hero-photos img { object-position: center; }

/* ---------- lepivá hlavička (oprava) ---------- */
.wp-site-blocks > .wp-block-template-part:has(.j-header) { position: sticky; top: 0; z-index: 50; }
.admin-bar .wp-site-blocks > .wp-block-template-part:has(.j-header) { top: 32px; }
.j-header { position: static; }
@media (max-width: 781px) {
	.admin-bar .wp-site-blocks > .wp-block-template-part:has(.j-header) { top: 46px; }
	.j-hero-photos img { aspect-ratio: 4/3; }
}

/* ---------- logo 22 ---------- */
.j-brand a { display: inline-flex; align-items: center; gap: .7rem; }
.j-logo {
	display: inline-flex; align-items: center; justify-content: center;
	width: 2.1rem; height: 2.1rem; border: 2px solid var(--j-ink);
	font-family: var(--j-display); font-weight: 800; font-size: 1rem; letter-spacing: -.04em; line-height: 1;
}
.j-brand a:hover .j-logo { background: var(--j-ink); color: #fff; }

/* ---------- fotka domu celá ---------- */
#dum .j-wide img { aspect-ratio: auto; height: auto; }

/* ---------- menu na mobilu na jednom řádku ---------- */
@media (max-width: 600px) {
	.j-header-inner { row-gap: .5rem !important; padding: .8rem 0 .7rem; }
	.j-header .wp-block-navigation { width: 100%; font-size: .68rem; letter-spacing: .05em; overflow-x: auto; scrollbar-width: none; }
	.j-header .wp-block-navigation::-webkit-scrollbar { display: none; }
	.j-header .wp-block-navigation__container { flex-wrap: nowrap !important; gap: .85rem !important; justify-content: space-between !important; width: 100%; }
	.j-header .wp-block-navigation-item { white-space: nowrap; }
}

/* ---------- menu na mobilu tučně ---------- */
@media (max-width: 600px) {
	.j-header .wp-block-navigation { font-size: .74rem; font-weight: 600; letter-spacing: .02em; }
	.j-header .wp-block-navigation__container { gap: .5rem !important; }
}

/* ---------- úvodní fotky celé ---------- */
.j-hero-photos img, .j-hero-photos .wp-block-image img { aspect-ratio: auto !important; height: auto; object-fit: initial; }

/* ---------- úvodní fotky pod sebou ---------- */
.j-hero-photos { flex-direction: column !important; flex-wrap: nowrap !important; }
.j-hero-photos > .wp-block-column { flex-basis: auto !important; width: 100%; }
.j-hero-photos > .wp-block-column + .wp-block-column { border-left: 0; border-top: 1px solid var(--j-muted); }

/* ---------- fotky na celou obrazovku ---------- */
.j-lightbox { position: fixed; inset: 0; z-index: 100000; background: rgba(15,15,14,.94); display: none; align-items: center; justify-content: center; }
.j-lightbox.is-open { display: flex; }
.j-lightbox figure { margin: 0; max-width: 94vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; }
.j-lightbox img { max-width: 94vw; max-height: 84vh; object-fit: contain; display: block; }
.j-lightbox figcaption { color: #e9e6e0; font-size: .9rem; margin-top: .8rem; max-width: 70ch; text-align: center; line-height: 1.5; }
.j-lightbox figcaption .j-badge { color: #e0a878; border-color: #e0a878; }
.j-lightbox button { position: absolute; background: none; border: 0; color: #fff; cursor: pointer; font-size: 2.6rem; line-height: 1; padding: .6rem 1rem; opacity: .8; }
.j-lightbox button:hover { opacity: 1; }
.j-lb-close { top: .5rem; right: .5rem; }
.j-lb-prev { left: .3rem; top: 50%; transform: translateY(-50%); }
.j-lb-next { right: .3rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .j-lb-prev, .j-lb-next { font-size: 2rem; top: auto; bottom: .5rem; transform: none; } }

/* ---------- logo vyjede úplně nahoru ---------- */
#top { scroll-margin-top: 100vh; }

/* ---------- logo Happy-Living ---------- */
.j-brand a { gap: .9rem; }
.j-logo-img { height: 42px; width: auto; display: block; }
.j-brand-text { border-left: 1px solid var(--j-line); padding-left: .9rem; line-height: 1.2; }
@media (max-width: 600px) {
	.j-logo-img { height: 32px; }
	.j-brand a { gap: .7rem; }
	.j-brand-text { padding-left: .7rem; font-size: .95rem; }
}
