/**
 * Hero: pattern "Hero – samo slika" (patterns/hero-image.php).
 * Full-bleed image, full viewport height, brush-stroke bottom edge.
 *
 * Loaded on the front end AND in the block editor (enqueue_block_assets).
 * Edge colour: block setting "Boja ruba" → --pivnica-hero-edge (default black).
 * Fonts and colour tokens: fonts.css.
 */

.wp-block-cover.pivnica-hero {
	min-height: 100vh;
	overflow: hidden;
	/* Height of the brush edge (room for address + hours/phone line). */
	--pivnica-edge-h: clamp(170px, calc(10vw + 86px), 236px);
}

/* Mobile: the block's inline "min-height:100vh" is the height with the browser bar hidden, so on a real
 * phone (not DevTools) the hours/phone line ends up below the visible screen. 100svh = height with the
 * bar shown. !important is needed to beat the inline style. */
@supports (height: 100svh) {
	.wp-block-cover.pivnica-hero {
		min-height: 100svh !important;
	}
}

/* The edge is drawn with ::before, NOT ::after: the block editor draws the
 * selected-block outline with ::after on the block wrapper, which would merge
 * with these rules and move the edge to the top of the block when selected. */
.wp-block-cover.pivnica-hero::before {
	content: "";
	position: absolute;
	z-index: 2;
	left: 0;
	right: 0;
	bottom: -1px;
	height: var(--pivnica-edge-h);
	/* Should match the background of the section below the hero. */
	background: var(--pivnica-hero-edge, #000);
	-webkit-mask: url("../images/brush-edge.svg") center bottom / 100% 100% no-repeat;
	mask: url("../images/brush-edge.svg") center bottom / 100% 100% no-repeat;
	pointer-events: none;
}

/* Info on the black brush edge, right-aligned: the hero block's own content
 * (paragraphs, editable in the block editor):
 *   .pivnica-hero-address  – address, links to Google Maps (large)
 *   .pivnica-hero-hours    – opening hours                (smaller)
 *   .pivnica-hero-phone    – phone, tel: link             (smaller, same line)
 * The inner container is pinned to the bottom, above the ::before edge. */
.wp-block-cover.pivnica-hero .wp-block-cover__inner-container {
	position: absolute;
	z-index: 3;
	left: 0;
	right: 0;
	bottom: clamp(14px, 1.8vw, 28px);
	width: auto;
	max-width: none; /* Kadence limits the cover's inner container to the content width. */
	margin: 0;
	/* Right edge lines up with the header/content container. */
	padding: 0 max(var(--global-content-edge-padding, 1.5rem), calc((100vw - var(--global-content-width, 1290px)) / 2 + var(--global-content-edge-padding, 1.5rem)));
	text-align: right;
	font-family: var(--pivnica-font-script);
	line-height: 1.2;
	color: var(--pivnica-logo-gold);
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.wp-block-cover.pivnica-hero .wp-block-cover__inner-container > p {
	max-width: none;
	margin: 0;
}

.wp-block-cover.pivnica-hero .pivnica-hero-address {
	font-size: clamp(1.5rem, 1rem + 1.9vw, 2.9rem);
}

.wp-block-cover.pivnica-hero .pivnica-hero-hours,
.wp-block-cover.pivnica-hero .pivnica-hero-phone {
	display: inline-block;
	margin-top: 0.15em !important;
	font-size: clamp(1rem, 0.75rem + 0.9vw, 1.75rem);
}

.wp-block-cover.pivnica-hero .pivnica-hero-phone {
	margin-left: 1.1em !important;
}

.wp-block-cover.pivnica-hero .wp-block-cover__inner-container a {
	color: inherit;
	text-decoration: none;
}

.wp-block-cover.pivnica-hero .wp-block-cover__inner-container a:hover,
.wp-block-cover.pivnica-hero .wp-block-cover__inner-container a:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

/* Icons (decorative, CSS-only: not part of the editable text and ignored by
 * screen readers). Coloured with the text colour. */
.wp-block-cover.pivnica-hero .pivnica-hero-address a::before,
.wp-block-cover.pivnica-hero .pivnica-hero-hours::before,
.wp-block-cover.pivnica-hero .pivnica-hero-phone a::before {
	content: "";
	display: inline-block;
	width: 0.72em;
	height: 0.9em;
	margin-right: 0.32em;
	vertical-align: -0.08em;
	background-color: currentColor;
	-webkit-mask: var(--pivnica-icon) center / contain no-repeat;
	mask: var(--pivnica-icon) center / contain no-repeat;
}

.wp-block-cover.pivnica-hero .pivnica-hero-address a::before { --pivnica-icon: url("../images/map-pin.svg"); }
.wp-block-cover.pivnica-hero .pivnica-hero-hours::before { --pivnica-icon: url("../images/clock.svg"); width: 0.8em; height: 0.8em; vertical-align: -0.06em; }
.wp-block-cover.pivnica-hero .pivnica-hero-phone a::before { --pivnica-icon: url("../images/phone.svg"); width: 0.8em; height: 0.8em; vertical-align: -0.06em; }

/* Phones: hours and phone each on their own line. */
@media (max-width: 600px) {
	.wp-block-cover.pivnica-hero .pivnica-hero-hours,
	.wp-block-cover.pivnica-hero .pivnica-hero-phone {
		display: block;
		margin-left: 0 !important;
	}
}

/* ------------------------------------------------------------------
 * Subpage hero: pattern "Hero podstranice" (patterns/page-hero.php).
 * Shorter than the home hero, no brush edge, optional text on the left:
 * breadcrumbs (block "Putokaz"), gold script title (H1), lead paragraph.
 * Image/video, focal point (hotspot) and darkening are the Cover block's own
 * settings. Pages starting with it get a transparent header automatically
 * (functions.php → pivnica_child_page_hero_layout()).
 * ------------------------------------------------------------------ */

.wp-block-cover.pivnica-page-hero {
	min-height: clamp(370px, 56vh, 570px);
	margin-top: 0;
	margin-bottom: 0;
	/* Room for the transparent header (logo 135 px + padding) above the text. */
	padding: calc(153px + clamp(16px, 3vw, 40px)) 0 clamp(40px, 6vw, 72px);
	align-items: center;
}

/* Core's "content position: left" rules (5 classes) set width:auto and
 * margin:0; the text column must line up with the header's logo instead. */
.wp-block-cover.pivnica-page-hero.pivnica-page-hero .wp-block-cover__inner-container {
	width: 100% !important;
	max-width: var(--global-content-width, 1290px);
	margin: 0 auto !important;
	padding: 0 var(--global-content-edge-padding, 1.5rem);
	color: #f5ecd7;
	text-align: left;
}

.wp-block-cover.pivnica-page-hero.pivnica-page-hero .wp-block-cover__inner-container > * {
	max-width: 720px;
	margin-left: 0 !important; /* Constrained layout centres children with auto margins. */
	margin-right: 0 !important;
}

.pivnica-page-hero h1.pivnica-page-hero__title {
	margin: 0.15em 0 0.25em;
	font-family: var(--pivnica-font-script);
	font-weight: 400;
	font-size: clamp(2.8rem, 1.8rem + 3.6vw, 5rem);
	line-height: 1.05;
	letter-spacing: 0;
	text-transform: none;
	color: var(--pivnica-logo-gold);
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.pivnica-page-hero p.pivnica-page-hero__lead {
	margin: 0;
	font-family: var(--pivnica-font-sans);
	font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.35rem);
	font-weight: 500;
	line-height: 1.55;
	color: #f5ecd7;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* Breadcrumbs ("Putokaz"): small caps, gold separators. */
.pivnica-putokaz.pivnica-putokaz ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0 0.5em;
	margin: 0;
	padding: 0 !important; /* The theme indents ordered lists in content. */
	list-style: none;
	font-family: var(--pivnica-font-sans);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.pivnica-putokaz li + li::before {
	content: "›";
	margin-right: 0.5em;
	color: var(--pivnica-logo-gold);
}

.pivnica-putokaz a {
	color: inherit;
	text-decoration: none;
	opacity: 0.85;
}

.pivnica-putokaz a:hover,
.pivnica-putokaz a:focus-visible {
	opacity: 1;
	text-decoration: underline;
}

/* Content below the hero: breathing room, and space above the footer's edge. */
.has-pivnica-page-hero .entry-content > .pivnica-page-hero + * {
	margin-top: clamp(40px, 6vw, 80px);
}

.has-pivnica-page-hero .content-area {
	padding-bottom: clamp(80px, 10vw, 150px);
}

/* Editor: the header isn't shown there, so no room is needed for it. */
.editor-styles-wrapper .wp-block-cover.pivnica-page-hero {
	padding-top: clamp(40px, 6vw, 72px);
}

@media (max-width: 767px) {
	.wp-block-cover.pivnica-page-hero {
		min-height: 350px;
	}
}
