/* Renovise Projects — parent + teaser card styles (front end + editor). */
.renovise-projects{
	--pr-font: 'Barlow', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; /* Renovise: Barlow (headings) */
	counter-reset: rp;
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1180px);
	margin-inline: auto;
	padding-block: clamp(2.5rem, 6vw, 4.5rem);
	padding-inline: clamp(1.25rem, 5vw, 2rem);
	color: #14161A;
}

/* ---- header (subline? · title · rule · subtitle) ---- */
.renovise-projects__head{ max-width: 760px; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.renovise-projects__subline{ margin: 0 0 1rem; color: #D81F26; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8125rem; }
.renovise-projects__title{ margin: 0 0 1rem; font-family: var(--pr-font); font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; line-height: 0.95; font-size: clamp(2rem, 3vw + 1rem, 3.5rem); }
.renovise-projects__rule{ height: 4px; border: 0; margin: 0 0 1rem; opacity: 1; }
.renovise-projects__subtitle{ margin: 0; max-width: 52ch; color: #5B636F; font-size: clamp(1rem, 0.3vw + 0.95rem, 1.125rem); line-height: 1.6; }

/* ---- viewport + arrows ---- */
.renovise-projects__viewport{ position: relative; }

/* Arrows sit in their own row under the track, both together on the right.
   Shown wherever the track can actually scroll: always on mobile/tablet, and on
   desktop only when swipe is enabled (the grid layout has nothing to scroll). */
.renovise-projects__nav-row{
	display: flex;
	justify-content: flex-end;
	gap: 0.625rem;
	margin-top: 1.25rem;
}
.renovise-projects__nav{
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: #14161A;
	color: #fff;
	cursor: pointer;
	transition: background 0.18s ease, opacity 0.18s ease;
}
.renovise-projects__nav:hover:not(:disabled){ background: #D81F26; }
.renovise-projects__nav:disabled{ opacity: 0.3; cursor: default; }
.renovise-projects__nav svg{ width: 22px; height: 22px; }

/* ---- track: horizontal swipe (mobile/tablet, and desktop when enabled) ---- */
.renovise-projects__track{
	display: flex;
	gap: clamp(1rem, 2vw, 1.75rem);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 0.5rem;
	scrollbar-width: none;
}
.renovise-projects__track::-webkit-scrollbar{ display: none; }

.renovise-projects__card{
	counter-increment: rp;
	flex: 0 0 85%;              /* mobile: 1 visible + a peek of the next */
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
}
@media (min-width: 601px){     /* tablet: 2 visible */
	.renovise-projects__card{ flex-basis: calc((100% - clamp(1rem, 2vw, 1.75rem)) / 2); }
}
@media (min-width: 1025px){
	/* desktop, swipe ON: 3 visible in a scroll row + arrows */
	.renovise-projects--swipe-desktop .renovise-projects__card{ flex-basis: calc((100% - 2 * clamp(1rem, 2vw, 1.75rem)) / 3); }
	/* Grid mode does not scroll, so the arrows would do nothing — hide the row. */
	.renovise-projects--grid-desktop .renovise-projects__nav-row{ display: none; }

	/* desktop, swipe OFF (default): static 3-up grid, wraps to next rows */
	.renovise-projects--grid-desktop .renovise-projects__track{
		display: grid; grid-template-columns: repeat(3, 1fr);
		overflow: visible; scroll-snap-type: none; padding-bottom: 0;
	}
}

/* ---- card visuals ---- */
.renovise-projects__thumb{ position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #E0E3E7; }
.renovise-projects__thumb img{ width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.renovise-projects__card:hover .renovise-projects__thumb img{ transform: scale(1.04); }

.renovise-projects__meta{ display: block; padding-top: 1rem; }
.renovise-projects__num{ display: block; margin-bottom: 0.5rem; color: #D81F26; font-weight: 700; font-size: 0.8125rem; letter-spacing: 0.05em; }
.renovise-projects__num::before{ content: counter(rp, decimal-leading-zero) " /"; }
.renovise-projects__ptitle{ margin: 0 0 0.4rem; font-family: var(--pr-font); font-weight: 700; text-transform: uppercase; letter-spacing: -0.005em; font-size: 1.1875rem; line-height: 1.2; color: #14161A; }
.renovise-projects__desc{ margin: 0; color: #5B636F; font-size: 0.9375rem; line-height: 1.55; }
/* Optional all-caps text after the "01 /" counter, in the counter's own red. */
.renovise-projects__label{ margin-left: 0.35em; text-transform: uppercase; }
/* Optional short text between the counter and the title: the description's
   colour and line height, one step smaller. Block so it gets its own line. */
.renovise-projects__intro{ display: block; margin: 0 0 0.35rem; color: #5B636F; font-size: 0.8125rem; line-height: 1.5; }

/* editor placeholder for a teaser without an image yet */
.renovise-projects__thumbph{ display: grid; place-items: center; aspect-ratio: 4 / 3; color: #5B636F; font-size: 13px; }

/* ---- gallery signals -------------------------------------------------
   These two corner labels are what separate a PROJECT card from a service
   teaser at a glance: the teaser is something you read, the project is a
   photo set you open. Both sit flush in the corners, square, in brand red,
   so they read as one system rather than two stray badges. */

/* "GALERIJA" tag — top left, on every project card. */
.renovise-projects__tag{
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	padding: 0.35rem 0.6rem;
	background: #D81F26;
	color: #fff;
	font-family: var(--pr-font);
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	line-height: 1;
}
/* Parent toggle: hide the tag without touching the child block's markup. */
.renovise-projects--no-tag .renovise-projects__tag{ display: none; }

/* "N photos" badge — top right, only when a teaser has more than one image. */
.renovise-projects__count{
	position: absolute;
	top: 0;
	right: 0;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.35rem 0.6rem;
	background: #D81F26;
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1;
}

/* extra gallery images: present in the DOM (so the lightbox groups them) but not shown */
.renovise-projects__extra{
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Rules around the title. Only the NEW position gets margins here — the
   position this block already used keeps the margins it always had, so
   existing pages are untouched. margin-block only: some of these rules are
   centred with `margin: 0 auto`, which must survive. */
.renovise-projects__rule--above{ margin-block: 0 1.25rem; }

/* Fallback colour: the rule normally gets its background from the block's
   inline style. Without this it renders 4px tall and transparent whenever
   that value is missing. */
.renovise-projects__rule{ background: #D81F26; }

/* ---- clickable affordance --------------------------------------------
   A project card is a link that opens a lightbox; a teaser card is not a
   link at all. Nothing said so before. A hairline under each card plus a
   red line that grows across it on hover, and a chevron after the title,
   make that difference visible — and pair with the red left bar the teaser
   card carries in teaser-row/style.css. */
.renovise-projects__card{
	padding-bottom: 1rem;
	border-bottom: 1px solid #E0E3E7;
}

.renovise-projects__meta{ position: relative; }

.renovise-projects__meta::after{
	content: "";
	position: absolute;
	left: 0;
	/* Sits on top of the card's own bottom hairline: 1rem of card padding
	   plus the 1px border. */
	bottom: calc(-1rem - 1px);
	height: 3px;
	width: 0;
	background: #D81F26;
	transition: width 0.3s ease;
}
.renovise-projects__card:hover .renovise-projects__meta::after,
.renovise-projects__card:focus-visible .renovise-projects__meta::after{ width: 100%; }

.renovise-projects__ptitle::after{
	content: "\203A"; /* › */
	display: inline-block;
	margin-left: 0.4rem;
	color: #D81F26;
	transition: transform 0.25s ease;
}
.renovise-projects__card:hover .renovise-projects__ptitle::after,
.renovise-projects__card:focus-visible .renovise-projects__ptitle::after{ transform: translateX(0.25rem); }

@media (prefers-reduced-motion: reduce){
	.renovise-projects__nav{ transition: none; }
	.renovise-projects__meta::after,
	.renovise-projects__ptitle::after{ transition: none; }
}

/* Optional smaller title scale, matching h2 of the Blog Title block. Two
   classes so it outranks this file's own .renovise-projects__title rule. */
.renovise-projects__title.renovise-projects__title--blog{ font-size: clamp(1.5rem, 1.4vw + 1.1rem, 2.25rem); }
