/*
Theme Name: Affinite FSE
Theme URI: https://affinite.io
Author: Affinite.io
Author URI: https://affinite.io
Description: FSE tema pro affinite.io - digitalni partner pro firmy, ktere to mysli vazne.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: affinite-fse
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, editor-style, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* Remove default margin from main element */
main {
	margin-block-start: 0;
	margin-block-end: 0;
}

main > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

main :where(.wp-site-blocks) > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* Mobile column spacing fix */
@media (max-width: 781px) {
	.wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
		padding-left: 10px;
		padding-right: 10px;
	}
}

/* Custom block styles — extend per project */

/* ---------------------------------------------------------------------------
   Affinite block styles
   Ikony: Lucide (ISC) — inline SVG jako CSS mask, barva z currentColor.
   --------------------------------------------------------------------------- */

/* Verzálkové číslice — Raleway má výchozí minuskové, metriky by jinak "skákaly" */
:root {
	--aff-lnum: "lnum" 1;
}

.wp-block-table,
.has-x-small-font-size,
.aff-metric {
	font-feature-settings: var(--aff-lnum);
}

/* Eyebrow label nad nadpisy sekcí — Bold 11px / uppercase / tracking 12 % */
.is-style-aff-eyebrow {
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	margin-bottom: var(--wp--preset--spacing--30);
}

/* Pill tlačítko s kruhovou ikonou šipky (lucide arrow-up-right) */
.wp-block-button.is-style-aff-pill > .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.625em;
	border-radius: 999px;
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	font-weight: 600;
	padding: 0.75em 1.5em;
	transition: background-color 0.2s ease;
}

.wp-block-button.is-style-aff-pill > .wp-block-button__link:hover,
.wp-block-button.is-style-aff-pill > .wp-block-button__link:focus-visible {
	background-color: var(--wp--preset--color--primary-dark);
}

.wp-block-button.is-style-aff-pill > .wp-block-button__link::after {
	content: "";
	inline-size: 1em;
	block-size: 1em;
	background-color: currentColor;
	/* lucide: arrow-up-right */
	mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 7h10v10"/><path d="M7 17 17 7"/></svg>');
	mask-repeat: no-repeat;
	mask-size: contain;
}

/* Inverzní varianta pro tmavá a oranžová pásma */
.wp-block-button.is-style-aff-pill-inverse > .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.625em;
	border-radius: 999px;
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--foreground);
	font-weight: 600;
	padding: 0.75em 1.5em;
}

/* Textový odkaz se šipkou vpravo (lucide arrow-right) */
.wp-block-button.is-style-aff-textlink > .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	background: none;
	border-radius: 0;
	padding: 0;
	color: var(--wp--preset--color--foreground);
	font-weight: 600;
}

.wp-block-button.is-style-aff-textlink > .wp-block-button__link::after {
	content: "";
	inline-size: 1em;
	block-size: 1em;
	background-color: var(--wp--preset--color--primary);
	/* lucide: arrow-right */
	mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>');
	mask-repeat: no-repeat;
	mask-size: contain;
	transition: transform 0.2s ease;
}

.wp-block-button.is-style-aff-textlink > .wp-block-button__link:hover::after {
	transform: translateX(0.25em);
}

/* FAQ — core/details v LP šabloně */
.is-style-aff-faq {
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding-block: var(--wp--preset--spacing--30);
}

.is-style-aff-faq > summary {
	cursor: pointer;
	font-weight: 600;
	list-style: none;
}

.is-style-aff-faq > summary::-webkit-details-marker {
	display: none;
}

/* Tlačítko zpět nahoru — skryté, dokud návštěvník neodscrolluje */
.aff-scroll-top {
	position: fixed;
	inset-block-end: clamp(1rem, 3vw, 2rem);
	inset-inline-end: clamp(1rem, 3vw, 2rem);
	z-index: 100;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 3rem;
	block-size: 3rem;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(0.5rem);
	transition:
		opacity 0.2s ease,
		transform 0.2s ease,
		visibility 0.2s,
		background-color 0.2s ease;
}

.aff-scroll-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.aff-scroll-top:hover,
.aff-scroll-top:focus-visible {
	background-color: var(--wp--preset--color--primary-dark);
}

.aff-scroll-top svg {
	inline-size: 1.25rem;
	block-size: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
	.aff-scroll-top {
		transition: none;
	}
}

/* Kotvy v menu — plynulé scrollování s odstupem od horní hrany */
html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

.aff-anchor,
#contact {
	scroll-margin-block-start: var(--wp--preset--spacing--40, 2rem);
}

/* Foto pás — čtyři dlaždice na plnou šířku, bez mezer, stejná výška */
.aff-photo-band {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0;
}

.aff-photo-band .aff-photo-band__tile {
	margin: 0;
	block-size: clamp(16rem, 24vw, 22rem);
	overflow: hidden;
}

.aff-photo-band .aff-photo-band__tile img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	display: block;
}

@media (max-width: 47.99em) {
	.aff-photo-band {
		grid-template-columns: repeat(2, 1fr);
	}

	.aff-photo-band .aff-photo-band__tile {
		block-size: clamp(10rem, 40vw, 16rem);
	}
}

/* Ručně kreslené podtržení pod hero nadpisem (doodle z návrhu) */
.aff-hero-underline::after {
	content: "";
	display: block;
	inline-size: clamp(90px, 9vw, 130px);
	block-size: 0.6rem;
	margin-block-start: 0.45em;
	background-color: var(--wp--preset--color--primary);
	mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 12" preserveAspectRatio="none"><path d="M1.6 8.7c19-4.2 46-6.4 73-5.4 21 .8 44 2.8 64.4 6.2-20.6-1.5-43.6-3-64.6-3.1C47.6 6.3 20.8 7.2 1.6 8.7z"/></svg>');
	mask-repeat: no-repeat;
	mask-size: 100% 100%;
}
