/*
 * Blog and Realizácie (inc/Content.php). Tokens and the primitives of layout.css and base.css only; the page
 * hero is the one of the site (.pg-hero, layout.css, Template::hero()).
 * Components (shown in templates/styleguide-parts/obsah.php):
 *   .pg-topics          article topics and project types: the tag chips of the site (.pg-tag, base.css)
 *   .pg-chips           filter: heading and a row of link chips (blog topics, project types)
 *   .pg-post-card--row  article card with the photo left (blog as on the live site), stacked on a phone; --compact
 *                       without the excerpt, the photo left also on a phone (the list beside the large card)
 *   .pg-post-features   one large card of an article (.pg-post-feature, the text on its photo) and up to 3 compact cards
 *                       under one another beside it (Content::featured_posts(): the blog of the home page)
 *   .pg-box             the light panel of the site (layout.css): table of contents, lead, facts
 *   .pg-article         article: table of contents next to the text, one column on a tablet and phone
 *   .pg-toc             table of contents
 *   .pg-share           "Zdieľať na:" row
 *   .pg-project         project band of the archive; .pg-facts the facts of a project
 *   .pg-usp-large       Výhody on the home page and O nás: the USP row of the product page, larger from 768 px (Jaroslav 10. 11.)
 *   .pg-about           the page O nás: the text beside a photo, the call to the shop and Kontakt
 *   .pg-contact         the page Kontakt: the form in a panel, the contact details next to it
 *   .pg-legal           a legal document (templates/pravny-dokument.php): the title over the text, the box of the
 *                       document beside both (the contents, the line of the date and the version, Vytlačiť dokument),
 *                       previous versions, printing
 *   blocks of the editor in .pg-prose (caption, quote, separator, buttons, columns), also on pages (O nás)
 * Photo grid: profigarden-site, modules/projects/projects.css; its lightbox: lightbox.css.
 */

/* ---------- Tag chips and filter ----------
 * The chips are the one tag of the site (.pg-tag, base.css); here only their spacing. */

.pg-topics { gap: var(--pg-space-8); }
.pg-chips__list { gap: var(--pg-space-12); }

/* ---------- Article card in a row ---------- */

.pg-post-card--row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	border: 1px solid var(--pg-border);
	background: var(--pg-white);
}

/* The photo takes the height of the text next to it (site.css gives the stacked card 3:2). */
.pg-post-card--row .pg-post-card__media {
	position: relative;
	aspect-ratio: auto;
	min-height: 100%;
}

.pg-post-card--row .pg-post-card__media img {
	position: absolute;
	inset: 0;
}

.pg-post-card--row .pg-post-card__body {
	align-self: center;
	padding: var(--pg-space-20);
}

/* An article without a photo: the text takes the whole card. */
.pg-post-card--row > .pg-post-card__body:first-child { grid-column: 1 / -1; }

.pg-post-card__title a { text-decoration-color: transparent; }
.pg-post-card__title a:hover { text-decoration-color: currentColor; }

@media (max-width: 767px) {
	.pg-post-card--row { grid-template-columns: minmax(0, 1fr); }
	.pg-post-card--row .pg-post-card__media { aspect-ratio: 3 / 2; min-height: 0; }
	.pg-post-card--row .pg-post-card__body { padding: var(--pg-space-16); }
}

/* The compact card of the list beside the large card: the photo left on every width, a third of the card (a quarter on a
   tablet, where the list is as wide as the content). */
.pg-post-card--compact .pg-post-card__body { padding: var(--pg-space-16); }

@media (min-width: 768px) and (max-width: 1024px) {
	.pg-post-card--compact { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); }
}

@media (max-width: 767px) {
	.pg-post-card--compact { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
	.pg-post-card--compact .pg-post-card__media { aspect-ratio: auto; min-height: 100%; }
	/* The title of a small card a step smaller on a phone (zadanie 11, pripomienka 9): the size of body text. */
	.pg-post-card--compact .pg-post-card__title { font-size: var(--pg-text-m); }
}

/* ---------- Large card and the list beside it (.pg-post-features, Content::featured_posts()) ----------
 * The featured article of the old home page (Jaroslav 7. 11.): the large card about 55 % of the content, up to 3 compact
 * cards under one another in the rest, they share its height; up to 1024 px the large card over the whole width and the
 * list under it. The large card: the photo behind the whole card, the topics top left, at the bottom the author | the
 * date, the title and the lead, white on a dark band (--pg-scrim where the text starts, 4.7:1 also over a white photo,
 * --pg-scrim-strong at the bottom). Its height: the list beside it, at least --pg-hero-tall, more when its text needs it
 * (a phone). The whole card is the link of the title. */
.pg-post-features {
	display: grid;
	grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
	gap: var(--pg-gap-grid);
}

.pg-post-features.is-single { grid-template-columns: minmax(0, 1fr); }

.pg-post-features__list {
	display: flex;
	flex-direction: column;
	gap: var(--pg-gap-grid);
}

.pg-post-features__list > * { flex: 1 1 auto; }

@media (max-width: 1024px) {
	.pg-post-features { grid-template-columns: minmax(0, 1fr); }
}

.pg-post-feature {
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	min-block-size: var(--pg-hero-tall);
	overflow: hidden;
	background: var(--pg-green-dark);
	color: var(--pg-white);
}

.pg-post-feature__img {
	position: absolute;
	inset: 0;
	z-index: var(--pg-z-below);
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform var(--pg-dur-slow) var(--pg-ease);
}

/* The topics stay links above the link of the card (its ::after covers the card). */
.pg-post-feature > .pg-topics {
	position: relative;
	z-index: var(--pg-z-raised);
	padding: var(--pg-gap-block) var(--pg-gap-block) 0;
}

.pg-post-feature__body {
	margin-block-start: auto;
	padding: var(--pg-space-64) var(--pg-gap-block) var(--pg-gap-block);
	background: linear-gradient(to bottom, transparent, var(--pg-scrim) var(--pg-space-64), var(--pg-scrim-strong));
}

.pg-post-feature__meta { font-size: var(--pg-text-s); }
.pg-post-feature__title { color: inherit; overflow-wrap: anywhere; }

.pg-post-feature__link {
	color: inherit;
	text-decoration-color: transparent;
	transition: text-decoration-color var(--pg-dur-fast) var(--pg-ease);
}

.pg-post-feature__link:hover { color: inherit; text-decoration-color: currentColor; }
.pg-post-feature__link::after { content: ""; position: absolute; inset: 0; }
.pg-post-feature__link:focus-visible { outline: 2px solid var(--pg-white); outline-offset: 2px; }
.pg-post-feature:has(.pg-post-feature__link:focus-visible) { outline: 2px solid var(--pg-focus-color); outline-offset: 2px; }

@media (hover: hover) and (pointer: fine) {
	.pg-post-feature:hover .pg-post-feature__img { transform: scale(1.03); }
}

/* ---------- Article ---------- */

.pg-article {
	display: grid;
	grid-template-columns: minmax(0, var(--pg-narrow));
	justify-content: center;
	align-items: start;
	gap: var(--pg-gap-head) var(--pg-gap-pdp);
}

/* Two columns: the contents of an article (has-toc), the box of a legal document (has-aside, every document). */
.pg-article.has-toc,
.pg-article.has-aside { grid-template-columns: var(--pg-toc-w) minmax(0, var(--pg-narrow)); }

.pg-article__aside {
	position: sticky;
	top: var(--pg-sticky-top);
	max-height: calc(100vh - var(--pg-sticky-top) - var(--pg-gap-block));
	overflow-y: auto;
}

/* A long contents scrolls inside the column with the thin bar of the product rail, upright (Jaroslav 7. 11.: the bar of
   the system looked out of place): the thumb in the colour of the primary button on a light track, rounded, 4 px in
   Chrome and Safari, "thin" in Firefox (the tokens of layout.css). */
.pg-article__aside::-webkit-scrollbar { width: var(--pg-rail-bar-h); }
.pg-article__aside::-webkit-scrollbar-track { background: var(--pg-rail-bar); }
.pg-article__aside::-webkit-scrollbar-thumb { background: var(--pg-rail-thumb); border-radius: var(--pg-radius-pill); }

@supports not selector(::-webkit-scrollbar) {
	.pg-article__aside {
		scrollbar-width: thin;
		scrollbar-color: var(--pg-rail-thumb) var(--pg-rail-bar);
	}
}

.pg-article__lead { color: var(--pg-text-2); }

/* The text fills the column of the article (--pg-narrow, the text column of the blog and the legal pages) as the lead,
   the topics and the share row around it, and as the text of a page (O nás): with the measure of .pg-prose it ended
   150 px before them. */
.pg-article__main > .pg-prose { max-width: none; }

/* Wide tables scroll inside the text column instead of widening the page (phone). */
.pg-prose .wp-block-table,
.pg-prose > table { display: block; max-width: 100%; overflow-x: auto; }
.pg-prose .wp-block-table table { min-width: 100%; }

/* ---------- Blocks of the editor in the text (articles, O nás and the other pages) ----------
 * The rhythm and the type are .pg-prose (base.css), the button block is the button of the site (base.css). Here what
 * WordPress draws its own way: the caption, the source of a quote, the separator, the row of buttons and columns. */

.pg-prose figure img { margin-block: 0; }

.pg-prose figcaption,
.pg-prose .wp-element-caption {
	margin: var(--pg-space-8) 0 0;
	color: var(--pg-muted);
	font-size: var(--pg-text-s);
	line-height: var(--pg-lh-snug);
}

.pg-prose blockquote > * + * { margin-block-start: .6em; }

.pg-prose blockquote cite {
	display: block;
	color: var(--pg-muted);
	font-size: var(--pg-text-s);
	font-style: normal;
}

.pg-prose hr {
	margin-block: 2em;
	border: 0;
	border-block-start: 1px solid var(--pg-line);
}

.pg-prose .wp-block-buttons { gap: var(--pg-space-12); }
.pg-prose .wp-block-button__link { white-space: normal; } /* a long label wraps on a phone instead of leaving the column */
.pg-prose .wp-block-columns { gap: var(--pg-gap-block) var(--pg-gap-grid); }

/* Images aligned in the editor (Zarovnať vľavo, vpravo, na stred): the CSS of the image block floats only its old markup
   (.wp-block-image .alignright), a classic theme draws the classes itself. From a tablet up the text flows around the
   image, at most half of the column wide; on a phone the image stands alone. */
.pg-prose .aligncenter { margin-inline: auto; }

/* A chapter, a separator and an image in the middle start under an aligned image, not beside it. */
.pg-prose > :is(h2, h3, h4, hr, .aligncenter) { clear: both; }

@media (min-width: 768px) {
	.pg-prose :is(.alignleft, .alignright) { max-width: 50%; }
	.pg-prose .alignleft { float: left; margin: .4em 1.5em 1em 0; }
	.pg-prose .alignright { float: right; margin: .4em 0 1em 1.5em; }
}

/* One column up to 1024 px: the contents above the text, both in the column of the text in the middle (they took the
   whole content, the contents and the lead box ran 200 px past the text on a tablet). */
@media (max-width: 1024px) {
	.pg-article.has-toc,
	.pg-article.has-aside { grid-template-columns: minmax(0, var(--pg-narrow)); }
	.pg-article__aside { position: static; max-height: none; overflow: visible; }
}

/* ---------- Table of contents ---------- */

.pg-toc__list {
	display: flex;
	flex-direction: column;
	gap: var(--pg-space-8);
	padding-inline-start: var(--pg-space-20);
	font-size: var(--pg-text-s);
	line-height: var(--pg-lh-snug);
}

.pg-toc__list .pg-toc__list { margin-block-start: var(--pg-space-8); }
.pg-toc__list li::marker { color: var(--pg-accent); }
.pg-toc a { color: var(--pg-text-2); text-decoration-color: transparent; }
.pg-toc a:hover { color: var(--pg-accent-text-hover); text-decoration-color: currentColor; }

/* ---------- Labels in a row, share ---------- */

.pg-meta-label {
	font-size: var(--pg-text-s);
	font-weight: var(--pg-fw-bold);
}

/* "Zdieľať na:" and the networks as grey icons (Jaroslav 10. 11.), each a --pg-share-target square; on hover and focus the
   icon turns black on a light circle. Grey --pg-muted is 4.8:1 on white (an icon needs 3:1). */
.pg-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--pg-space-4) var(--pg-space-12);
	padding-block-start: var(--pg-gap-block);
	border-block-start: 1px solid var(--pg-line);
}

.pg-share__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--pg-space-4);
}

.pg-share__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: var(--pg-share-target);
	block-size: var(--pg-share-target);
	border-radius: var(--pg-radius-pill);
	color: var(--pg-muted);
	transition: color var(--pg-dur-fast) var(--pg-ease), background-color var(--pg-dur-fast) var(--pg-ease);
}

.pg-share__link:hover,
.pg-share__link:focus-visible {
	color: var(--pg-text);
	background: var(--pg-surface-hover);
}

.pg-share__link svg {
	inline-size: var(--pg-space-24);
	block-size: var(--pg-space-24);
}

/* ---------- Realizácie ---------- */

.pg-project__split { align-items: center; }
.pg-project__title { text-decoration-color: transparent; }
.pg-project__title:hover { text-decoration-color: currentColor; }

/* Description wide, the facts panel narrow (the split default is 55/45). */
.pg-project__about { --pg-split: minmax(0, 2fr) minmax(0, 1fr); }
.pg-project__about:not(.pg-split) > .pg-project__facts { max-width: var(--pg-narrow); }

.pg-facts {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: var(--pg-space-8) var(--pg-space-16);
	font-size: var(--pg-text-s);
}

.pg-facts dt { font-weight: var(--pg-fw-bold); }
.pg-facts dd { margin: 0; }

/* A project without photos (or locked by a password): the text alone keeps a readable line length. */
.pg-project__split:not(.pg-split) > .pg-project__body { max-width: var(--pg-narrow); }

/* ---------- Kontakt (page-kontakt.php) ----------
 * The form in the panel of the site, wider, the contact details next to it; one column up to 1024 px (.pg-split). */

/* As the page Kontakt of the live site (Jaroslav 10. 11.): the form without a panel on white beside the contact details,
   about half and half. The details: the rows with their icons 32 px large in a thin line (--pg-icon-stroke-l, the same
   line on the screen as the 24 px icons), the text larger; the blocks one under the other with a line between them. */
.pg-contact__split { --pg-split: minmax(0, 1fr) minmax(0, 1fr); }
.pg-contact__split:not(.pg-split) > * { max-width: var(--pg-narrow); }

.pg-contact__info {
	display: flex;
	flex-direction: column;
	gap: var(--pg-gap-head);
}

.pg-contact__block + .pg-contact__block {
	padding-block-start: var(--pg-gap-head);
	border-block-start: 1px solid var(--pg-line);
}

.pg-contact__info .pg-footer__contact-list {
	display: flex;
	flex-direction: column;
	gap: var(--pg-gap-block);
	font-size: var(--pg-lead);
}

.pg-contact__info .pg-footer__contact-item {
	align-items: center;
	gap: var(--pg-space-16);
	color: var(--pg-text);
}

.pg-contact__info .pg-footer__contact-item svg {
	width: var(--pg-space-32);
	height: var(--pg-space-32);
	stroke-width: var(--pg-icon-stroke-l);
	color: var(--pg-text);
}

.pg-contact__text { font-size: var(--pg-lead); }
.pg-contact__company { margin: 0; font-style: normal; }
.pg-contact__map-image { display: block; }
.pg-contact__map-image img { width: 100%; }

/* ---------- Legal document (templates/pravny-dokument.php) ----------
 * The layout of an article (.pg-article, .pg-toc): on a desktop the box of the document in the left column from the top
 * of the title down, the title and the text in the column of the text; up to 1024 px one column in the order of the
 * page: the title, the box, the text. The box is the same on every document (Legal::box(), Jaroslav 7. 11.): the
 * contents, the line of the date and the version and Vytlačiť dokument, a line between them. */

@media (min-width: 1025px) {
	.pg-legal .pg-article.has-aside > .pg-legal__head,
	.pg-legal .pg-article.has-aside > .pg-article__main { grid-column: 2; }
	.pg-legal .pg-article.has-aside > .pg-article__aside { grid-column: 1; grid-row: 1 / span 2; }
}

.pg-legal__box > * + * {
	padding-block-start: var(--pg-gap-block);
	border-block-start: 1px solid var(--pg-line);
}

/* Without JavaScript Vytlačiť dokument and a box with only it are hidden by a rule in <noscript> of <head>
 * (Legal::no_script()), before the page is drawn: no script shows anything later. */

.pg-legal__meta {
	--pg-cluster-gap: var(--pg-space-4) var(--pg-space-20);
	color: var(--pg-muted);
	font-size: var(--pg-text-s);
}

.pg-legal__history {
	padding-block-start: var(--pg-gap-block);
	border-block-start: 1px solid var(--pg-line);
}

.pg-legal__history-list {
	display: flex;
	flex-direction: column;
	gap: var(--pg-space-8);
	font-size: var(--pg-text-s);
}

/* A wording effective from a later day, above the text (Legal::future_html()). */
.pg-legal__future {
	padding: var(--pg-space-12) var(--pg-space-16);
	border-inline-start: var(--pg-space-4) solid var(--pg-accent);
	background: var(--pg-surface-light);
}

.pg-legal__note {
	padding: var(--pg-space-12) var(--pg-space-16);
	border: 1px dashed currentColor;
	font-size: var(--pg-text-s);
}

/* Printing a document: only the document, without the header, the footer, the contents, Vytlačiť dokument and the note
 * (no link or button works on paper), in one column: the title, the line of the date and the version, the text. */
@media print {
	.pg-legal-page > :not(.pg-main),
	.pg-legal-page .pg-main > :not(.pg-legal),
	.pg-legal__box > :not(.pg-legal__meta),
	.pg-legal__box:not(:has(> .pg-legal__meta)),
	.pg-legal__note { display: none !important; }
	.pg-legal-page .pg-main { padding-block: 0; }
	.pg-legal .pg-article,
	.pg-legal .pg-article.has-aside { display: block; }
	.pg-legal .pg-article > * + * { margin-block-start: var(--pg-gap-head); }
	.pg-legal .pg-article__aside { position: static; max-height: none; overflow: visible; }
	.pg-legal__box { padding: 0; background: none; }
	.pg-legal__box > .pg-legal__meta { padding-block-start: 0; border: 0; }
}

/* ---------- Výhody large (.pg-usp-large: the home page, O nás) ----------
 * The row of the product page (modules/usp) made to catch the eye (Jaroslav 10. 11.): icons twice as large, the title in
 * the heading font a step under a card title (--pg-usp-title-l, zadanie 10, bod 4), the text at the size of body text in the dark grey of a lead. One row from
 * 1025 px; up to 1024 px two in a row. Larger only from 768 px: on a phone it is the list of the shop as everywhere
 * else, one under another (site.css; zadanie 11, pripomienky 2 a 13). */
@media (min-width: 768px) {
	.pg-usp-large .pg-usp__item {
		gap: var(--pg-gap-block);
		padding: var(--pg-gap-block);
	}

	.pg-usp-large .pg-usp__icon {
		width: var(--pg-usp-icon-l);
		height: var(--pg-usp-icon-l);
	}

	.pg-usp-large .pg-usp__title {
		font-family: var(--pg-font-display);
		font-size: var(--pg-usp-title-l);
		font-weight: var(--pg-fw-display);
		line-height: var(--pg-lh-snug);
	}

	.pg-usp-large .pg-usp__sub {
		margin-top: var(--pg-space-4);
		font-size: var(--pg-text-m);
		line-height: var(--pg-lh-snug);
		color: var(--pg-text-2);
	}
}

/* Right under the hero of the home page a smaller gap (--pg-gap-usp instead of the gap of the page between sections), so a
   14" notebook (1512 x 860) shows the top of the icons and titles of the row (zadanie 10, bod 4). */
.pg-home-hero + .pg-usp-large { margin-block-start: calc(var(--pg-gap-usp) - var(--pg-gap-section)); }

@media (min-width: 768px) and (max-width: 1024px) {
	.pg-usp-large .pg-usp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pg-usp-large .pg-usp__item:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---------- O nás (templates/o-nas.php, inc/About.php) ----------
 * The text beside its photo (half and half from 1025 px, the photo first below), the call to the shop and to Kontakt in
 * the middle of the light band before the band Za rok sme nasadili. */
.pg-about__split { align-items: center; }
.pg-about__text { max-width: var(--pg-measure); }
.pg-about__photo { margin: 0; }
.pg-about__photo img { width: 100%; height: auto; }

.pg-about__cta-inner {
	align-items: center;
	justify-self: center;
	max-width: var(--pg-narrow);
	text-align: center;
}

.pg-about__actions { justify-content: center; }

@media (max-width: 1024px) {
	.pg-about__photo { order: -1; }
}
