/*
Theme Name: JT Portfolio
Theme URI: https://jantrnka.cz/
Description: Čistá portfolio šablona: jméno/logo vlevo nahoře, menu vpravo, mřížka náhledů v původním poměru stran (masonry), lightbox pro fotky i videa, stránka „kdo jsem“ a kontaktní formulář. Obsah se vkládá běžnými bloky WordPressu (Galerie, Obrázek, Video, YouTube/Vimeo odkaz).
Version: 1.4.1
Requires at least: 6.3
Requires PHP: 7.4
Author: lineart.cz
Text Domain: jt-portfolio
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* Layout: one quiet header row (name left, menu right), wide margins, generous grid gaps. */
:root {
	--jt-font: "Inter Tight";          /* přepisuje se z Přizpůsobit → Písmo */
	--jt-bg: #ffffff;
	--jt-text: #111111;
	--jt-muted: #9a9a9a;              /* neaktivní položky menu, popisky */
	--jt-line: #ececec;
	--jt-tile: #f3f3f3;               /* pozadí dlaždice, než se načte obrázek */
	--jt-accent: #111111;             /* hover odkazů v textu */
	--jt-side: clamp(20px, 5.3vw, 72px);   /* okraj stránky */
	--jt-gap: clamp(10px, 1.4vw, 20px);    /* mezera mezi dlaždicemi */
	--jt-header-pad: 30px;
	--jt-text-w: 34rem;               /* šířka textového sloupce */
	--jt-sans: var(--jt-font), "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--jt-bg);
	color: var(--jt-text);
	font-family: var(--jt-sans);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.8;
	letter-spacing: -0.005em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}
img, video, iframe { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s ease, opacity .2s ease; }
:focus-visible { outline: 1px solid var(--jt-text); outline-offset: 4px; }
::selection { background: var(--jt-text); color: var(--jt-bg); }
.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;
}
.skip-link:focus {
	position: fixed !important; top: 8px; left: 8px; width: auto; height: auto; clip: auto;
	z-index: 1000; background: var(--jt-text); color: var(--jt-bg); padding: 8px 14px; font-size: 14px;
}

/* ---------- Header ---------- */
.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-header {
	position: sticky; top: 0; z-index: 50;
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
	padding: 20px var(--jt-side);
	background: var(--jt-bg);
}
.site-title {
	margin: 0; font-size: 15px; font-weight: 400; line-height: 1.4; letter-spacing: 0;
}
.site-title a:hover { opacity: .55; }
.site-logo img { max-height: 36px; width: auto; }

.menu-toggle {
	appearance: none; border: 0; background: none; cursor: pointer; padding: 8px; margin: -8px;
	color: var(--jt-text); display: inline-flex; align-items: center;
}
.menu-toggle .bars { position: relative; width: 20px; height: 9px; display: inline-block; }
.menu-toggle .bars::before, .menu-toggle .bars::after {
	content: ""; position: absolute; left: 0; right: 0; height: 1px; background: currentColor;
	transition: transform .25s ease, top .25s ease;
}
.menu-toggle .bars span { display: none; }
.menu-toggle .bars::before { top: 0; }
.menu-toggle .bars::after { top: 8px; }
.menu-open .menu-toggle .bars::before { top: 4px; transform: rotate(45deg); }
.menu-open .menu-toggle .bars::after { top: 4px; transform: rotate(-45deg); }

/* Mobil: menu přes celou obrazovku */
.site-nav {
	display: none;
	position: fixed; inset: 0; top: var(--jt-header-h, 70px); z-index: 49;
	background: var(--jt-bg); padding: 16px var(--jt-side) 40px; overflow-y: auto;
	flex-direction: column; gap: 28px;
}
.menu-open .site-nav { display: flex; }
.menu-open { overflow: hidden; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li { margin: 0; position: relative; }
.site-nav a {
	display: inline-block; padding: 4px 0;
	font-size: 26px; line-height: 1.3; color: var(--jt-muted);
}
.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a,
.site-nav .current-menu-ancestor > a { color: var(--jt-text); }
.site-nav .sub-menu { padding-left: 14px; }
.site-nav .sub-menu a { font-size: 18px; }

.social { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.social a { display: inline-flex; color: var(--jt-muted); padding: 4px 0; }
.social a:hover { color: var(--jt-text); }
.social svg { width: 15px; height: 15px; }

@media (min-width: 900px) {
	.site-header { padding: var(--jt-header-pad) var(--jt-side) 26px; }
	.menu-toggle { display: none; }
	.site-nav, .menu-open .site-nav {
		display: flex; flex-direction: row; align-items: center; gap: 30px;
		position: static; padding: 0; overflow: visible; background: none;
	}
	.site-nav .menu { display: flex; flex-wrap: wrap; gap: 4px 26px; }
	.site-nav a { font-size: 15px; padding: 0; line-height: 1.4; }
	.site-nav .sub-menu {
		position: absolute; top: 100%; left: -14px; min-width: 190px; padding: 10px 14px;
		background: var(--jt-bg); opacity: 0; visibility: hidden; transition: opacity .2s ease;
	}
	.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; }
	.site-nav .sub-menu a { font-size: 15px; padding: 3px 0; }
	.menu-open { overflow: auto; }
}

/* ---------- Main + footer ---------- */
.site-main { flex: 1; padding: 6px var(--jt-side) calc(var(--jt-gap) * 1.4); }
.site-footer {
	padding: 0 var(--jt-side) 30px;
	font-size: 13px; color: var(--jt-muted);
}
.site-footer p { margin: 0; }

/* ---------- Gallery ---------- */
.jt-gallery-intro { max-width: var(--jt-text-w); margin: 0 0 calc(var(--jt-gap) * .8); }
.jt-gallery-intro > :first-child { margin-top: 0; }

/* Jednotný výřez 3:2 (volitelně) */
.jt-grid--crop {
	display: grid; grid-template-columns: 1fr; gap: var(--jt-gap);
}
@media (min-width: 560px) { .jt-grid--crop { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .jt-grid--crop.jt-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .jt-grid--crop.jt-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.jt-grid--crop .jt-media { aspect-ratio: 3 / 2; }
.jt-grid--crop .jt-media img,
.jt-grid--crop .jt-media video { width: 100%; height: 100%; object-fit: cover; }

/* Masonry: každý obrázek ve svém poměru stran (výchozí) */
.jt-grid--masonry { columns: 3 260px; column-gap: var(--jt-gap); }
.jt-grid--masonry > .jt-item { break-inside: avoid; margin-bottom: var(--jt-gap); }
.jt-grid--masonry.is-js { columns: auto; display: flex; gap: var(--jt-gap); align-items: flex-start; }
.jt-grid--masonry.is-js .jt-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--jt-gap); }
.jt-grid--masonry.is-js .jt-item { margin: 0; }
.jt-grid--masonry .jt-media { aspect-ratio: var(--ar, auto); }
.jt-grid--masonry .jt-media img,
.jt-grid--masonry .jt-media video { width: 100%; height: 100%; object-fit: cover; }
.jt-cols-2.jt-grid--masonry { columns: 2 280px; }
.jt-cols-4.jt-grid--masonry { columns: 4 220px; }

.jt-item { display: block; color: inherit; cursor: pointer; min-width: 0; }
.jt-media {
	position: relative; display: block; overflow: hidden; background: var(--jt-tile);
}
.jt-media img, .jt-media video { transition: opacity .5s ease; }
.jt-item:hover .jt-media img, .jt-item:hover .jt-media video { opacity: .82; }
.jt-fade .jt-item img { opacity: 0; }
.jt-fade .jt-item img.is-loaded { opacity: 1; }
.jt-fade .jt-item:hover img.is-loaded { opacity: .82; }
.jt-item video { pointer-events: none; }

.jt-play {
	position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px;
	pointer-events: none; color: #fff; filter: drop-shadow(0 1px 8px rgba(0,0,0,.25));
	transition: transform .3s ease;
}
.jt-item:hover .jt-play { transform: scale(1.06); }
.jt-caption {
	display: block; margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--jt-muted);
	transition: color .2s ease;
}
.jt-item:hover .jt-caption { color: var(--jt-text); }
.jt-empty {
	border: 1px solid var(--jt-line); padding: 40px; font-size: 14px; color: var(--jt-muted);
}

/* ---------- Lightbox ---------- */
.jt-lightbox {
	position: fixed; inset: 0; z-index: 1000; display: none;
	background: var(--jt-bg); color: var(--jt-text);
}
.jt-lightbox.is-open { display: block; animation: jt-in .25s ease; }
@keyframes jt-in { from { opacity: 0; } to { opacity: 1; } }
.jt-lb-stage {
	position: absolute; inset: 72px 90px 72px; display: flex; align-items: center; justify-content: center;
}
.jt-lb-stage img, .jt-lb-stage video {
	max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
}
.jt-lb-stage .jt-lb-frame { position: relative; width: min(100%, calc((100vh - 150px) * 16 / 9)); aspect-ratio: 16 / 9; }
.jt-lb-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.jt-lb-btn {
	position: absolute; appearance: none; border: 0; background: none; cursor: pointer;
	width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center;
	color: var(--jt-text); opacity: .7; transition: opacity .2s ease;
}
.jt-lb-btn:hover { opacity: 1; }
.jt-lb-btn svg { width: 22px; height: 22px; }
.jt-lb-close { top: 16px; right: calc(var(--jt-side) - 14px); }
.jt-lb-prev { left: calc(var(--jt-side) - 24px); top: 50%; margin-top: -24px; }
.jt-lb-next { right: calc(var(--jt-side) - 24px); top: 50%; margin-top: -24px; }
.jt-lb-meta {
	position: absolute; left: 0; right: 0; bottom: 24px; margin: 0; text-align: center;
	font-size: 13px; color: var(--jt-muted); padding: 0 70px; font-variant-numeric: tabular-nums;
}
@media (max-width: 700px) {
	.jt-lb-stage { inset: 64px 0 80px; }
	.jt-lb-prev, .jt-lb-next { top: auto; bottom: 12px; margin: 0; }
	.jt-lb-prev { left: 8px; } .jt-lb-next { right: 8px; }
}

/* ---------- Content pages (kdo jsem, kontakt) ---------- */
.entry { max-width: var(--jt-text-w); }
.entry-title { font-size: 15px; font-weight: 400; margin: 0 0 30px; color: var(--jt-muted); }
.entry-content > * { margin-top: 0; margin-bottom: 1.6em; }
.entry-content p { margin-top: 0; }
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4 {
	font-size: 15px; font-weight: 600; line-height: 1.6; letter-spacing: 0;
	margin: 2.4em 0 .5em; text-wrap: balance;
}
.entry-content > :first-child { margin-top: 0; }
.entry-content strong, .entry-content b { font-weight: 600; }
.entry-content a { border-bottom: 1px solid var(--jt-line); }
.entry-content a:hover { border-bottom-color: currentColor; color: var(--jt-accent); }
.entry-content .wp-block-image { margin: 0 0 2.4em; }
.entry-content .wp-block-image img { height: auto; }
.entry-content .wp-block-image.aligncenter,
.entry-content .wp-block-image .aligncenter { margin-left: 0; margin-right: 0; text-align: left; }
.entry-content .wp-block-image.aligncenter img { margin: 0; }
.entry-content .wp-block-columns { display: flex; flex-wrap: wrap; gap: 2em 48px; }
.entry-content .wp-block-column { flex: 1 1 220px; min-width: 0; }
.entry-content .wp-block-column > :first-child { margin-top: 0; }
.entry-content figcaption { font-size: 13px; color: var(--jt-muted); margin-top: 10px; }
.entry-content .wp-block-separator { border: 0; border-top: 1px solid var(--jt-line); margin: 2.4em 0; }
.entry-content blockquote { margin: 0 0 2em; padding: 0; border: 0; }
.entry-content blockquote p { margin-bottom: .2em; }
.entry-content blockquote cite { font-style: normal; font-weight: 600; font-size: 15px; }
.entry-content ul, .entry-content ol { padding-left: 1.2em; }
/* Široké prvky (např. velká fotka) mohou přesáhnout textový sloupec */
.entry .alignwide, .entry .alignfull { max-width: none; width: calc(100vw - 2 * var(--jt-side)); }

/* ---------- Kontaktní formulář ---------- */
.jt-form { display: grid; gap: 22px; margin-top: 8px; }
.jt-form label { display: block; font-size: 13px; color: var(--jt-muted); margin-bottom: 4px; }
.jt-form input[type="text"], .jt-form input[type="email"], .jt-form textarea {
	width: 100%; padding: 8px 0; font: inherit; color: inherit; background: transparent;
	border: 0; border-bottom: 1px solid #cfcfcf; border-radius: 0; transition: border-color .2s ease;
}
.jt-form input:focus, .jt-form textarea:focus { outline: none; border-bottom-color: var(--jt-text); }
.jt-form textarea { min-height: 140px; resize: vertical; }
.jt-form .jt-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.jt-form button {
	justify-self: start; appearance: none; cursor: pointer; margin-top: 6px;
	border: 1px solid var(--jt-text); background: transparent; color: var(--jt-text);
	padding: 10px 28px; font: inherit; font-size: 14px; border-radius: 0;
	transition: background .2s ease, color .2s ease;
}
.jt-form button:hover { background: var(--jt-text); color: var(--jt-bg); }
.jt-form-note { font-size: 14px; padding: 0; margin: 0 0 22px; }
.jt-form-note.is-ok { color: var(--jt-text); }
.jt-form-note.is-err { color: #b3261e; }

/* ---------- Blog / fallback ---------- */
.post-list { list-style: none; margin: 0; padding: 0; max-width: var(--jt-text-w); }
.post-list li { padding: 14px 0; border-bottom: 1px solid var(--jt-line); }
.post-list time { display: block; font-size: 13px; color: var(--jt-muted); }
.nav-links { margin-top: 28px; font-size: 14px; display: flex; gap: 20px; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
