/*
 * GAON - investor reports slider.
 *
 * Logical properties throughout: the section turns round on its own on the
 * English page, and nothing here pins a side.
 *
 * Absolute sizes measured from the 1440 frame, fluid down to 360 with a single
 * clamp per value. The heading column and the card width are also exposed as
 * custom properties so they can be moved from the editor.
 */

.girs {
	--girs-head: clamp(280px, 27.8vw, 401px);
	--girs-card: clamp(262px, 33.26vw, 479px);
	--girs-gap: clamp(16px, 2.71vw, 39px);
	--girs-radius: clamp(10px, 1.39vw, 20px);

	/* The page gutter, so the last card can stop level with the rest of the
	   page instead of touching the screen. Measured from the viewport rather
	   than a percentage, because a percentage inside the track would resolve
	   against the track. On a platform with a classic scrollbar this lands a
	   few pixels wide of the page gutter, which errs on the safe side. */
	--girs-edge: max(2rem, (100vw - 80rem) / 2);

	--girs-ink: #1e1e1e;
	--girs-muted: #6a6a6a;
	--girs-badge-border: #8eb1f2;

	display: grid;
	grid-template-columns: var(--girs-head) minmax(0, 1fr);
	gap: clamp(24px, 2.8vw, 40px);
	align-items: start;
}

/* ---------- heading ---------- */

.girs__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: clamp(12px, 1.5vw, 22px);
	text-align: start;
}

.girs__badge {
	margin: 0;
	font-family: "Noto Sans Hebrew", sans-serif;
	font-size: clamp(0.625rem, 0.479rem + 0.65vw, 1.0625rem);
	line-height: 1;
	color: #040404;
	background-color: #ffffff;
	border: 1px solid var(--girs-badge-border);
	border-radius: 0.6em;
	padding-block: 0.32em;
	padding-inline: 2.2em;
	white-space: nowrap;
}

.girs__title {
	margin: 0;
	font-family: "Noto Sans Hebrew", sans-serif;
	font-weight: 500;
	font-size: clamp(2.375rem, 1.656rem + 3.19vw, 4.526rem);
	line-height: clamp(2.8125rem, 2.1rem + 3.167vw, 4.95rem);
	color: #040404;
	text-align: start;
	text-wrap: balance;
}

.girs__body {
	margin: 0;
	max-width: 62ch;
	font-family: "Noto Sans Hebrew", sans-serif;
	font-weight: 400;
	font-size: 1rem;
	line-height: 1.5625;
	color: var(--girs-ink);
	text-align: start;
}

/* ---------- track controls ---------- */

.girs__nav {
	display: flex;
	gap: 10px;
	margin-block-start: clamp(4px, 0.7vw, 10px);
}

.girs__btn {
	inline-size: clamp(38px, 3.4vw, 49px);
	block-size: clamp(38px, 3.4vw, 49px);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid #d2d2d2;
	border-radius: 50%;
	background-color: #ffffff;
	color: #040404;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.girs__btn:hover,
.girs__btn:focus-visible {
	background-color: #040404;
	border-color: #040404;
	color: #ffffff;
}

.girs__btn:focus-visible {
	outline: 2px solid #040404;
	outline-offset: 2px;
}

.girs__btn[disabled] {
	opacity: 0.3;
	cursor: default;
}

.girs__btn[disabled]:hover {
	background-color: #ffffff;
	border-color: #d2d2d2;
	color: #040404;
}

.girs__btn svg {
	inline-size: 40%;
	block-size: auto;
}

/* ---------- track ---------- */

.girs__stage {
	min-inline-size: 0;
	position: relative;
}

.girs__track {
	display: flex;
	gap: var(--girs-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;

	/* The track itself reaches the screen. This keeps the last card level with
	   the page gutter once it is scrolled to the end. */
	padding-inline-end: var(--girs-edge);
}

.girs__track::-webkit-scrollbar {
	display: none;
}

.girs__track:focus-visible {
	outline: 2px solid #040404;
	outline-offset: 4px;
}

.girs__slide {
	flex: 0 0 var(--girs-card);
	scroll-snap-align: start;
	display: flex;
}

/* ---------- card ---------- */

.girs__card {
	position: relative;
	inline-size: 100%;
	display: flex;
	flex-direction: column;
	gap: clamp(12px, 1.32vw, 19px);
	padding-block-start: clamp(6px, 0.7vw, 10px);
	padding-block-end: clamp(20px, 2.36vw, 34px);
	padding-inline: clamp(6px, 0.7vw, 10px);
	background-color: #ffffff;
	border-radius: var(--girs-radius);
	box-shadow: 5px 4px 24.9px rgba(0, 0, 0, 0.03);
}

.girs__media {
	position: relative;
	aspect-ratio: 457 / 328;
	border-radius: var(--girs-radius);
	overflow: hidden;
	background-color: #e4e4e4;
}

.girs__media img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	display: block;
}

.girs__chip {
	position: absolute;
	inset-block-start: clamp(8px, 0.9vw, 13px);
	inset-inline-end: clamp(9px, 1.04vw, 15px);
	margin: 0;
	font-family: "Noto Sans Hebrew", sans-serif;
	font-weight: 300;
	font-size: clamp(12px, calc(10.5px + 0.41vw), 17.42px);
	line-height: 1.105;
	color: #1e1e1e;
	background-color: #ffffff;
	border: 1px solid #d2d2d2;
	border-radius: clamp(6px, 0.7vw, 10px);
	padding-block: 0.3em;
	padding-inline: 0.6em;
	white-space: nowrap;
}

.girs__row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: clamp(8px, 1vw, 14px);
	padding-inline: clamp(8px, 1.04vw, 15px);
}

.girs__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: clamp(8px, 1.04vw, 15px);
	min-inline-size: 0;
}

.girs__ctitle {
	margin: 0;
	font-family: "Noto Sans Hebrew", sans-serif;
	font-weight: 500;
	font-size: clamp(20px, calc(14.78px + 1.45vw), 35.66px);
	line-height: 1.105;
	color: var(--girs-ink);
	text-align: start;
	text-wrap: balance;
}

.girs__desc {
	margin: 0;
	font-family: "Noto Sans Hebrew", sans-serif;
	font-weight: 500;
	font-size: clamp(13px, calc(11.67px + 0.37vw), 17px);
	line-height: 1.353;
	color: var(--girs-muted);
	text-align: start;
}

/* The date is the one number on the card, so it is isolated with bdi in the
   markup as well - a slash between two numbers flips without it. */
.girs__date {
	margin: 0;
	flex: none;
	font-family: "Noto Sans Hebrew", sans-serif;
	font-weight: 500;
	font-size: clamp(13px, calc(11.67px + 0.37vw), 17px);
	line-height: 2.3;
	color: #757575;
	white-space: nowrap;
}

/* ---------- card link ----------
 * One link per card, stretched over the whole card by a pseudo element, so the
 * card is clickable without a second link competing with it in the tab order.
 * The report name rides along inside it, hidden, so "לדוח המלא" six times over
 * is not what a screen reader announces.
 */

.girs__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	font-family: "Noto Sans Hebrew", sans-serif;
	font-weight: 700;
	font-size: clamp(14px, calc(12.48px + 0.421vw), 18.55px);
	line-height: 1.25;
	color: var(--girs-ink);
	text-decoration: none;
	border-block-end: 1px solid currentColor;
	padding-block-end: 0.22em;
}

.girs__cta::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: var(--girs-radius);
}

.girs__cta:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.girs__cta-icon {
	display: inline-flex;
	inline-size: clamp(12px, 1.3vw, 19px);
	flex: none;
}

.girs__cta-icon svg {
	inline-size: 100%;
	block-size: auto;
}

.girs__sr,
.girs__live {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.girs__empty {
	margin: 0;
	font-family: "Noto Sans Hebrew", sans-serif;
	color: var(--girs-muted);
}

/* ---------- phone ---------- */

@media (max-width: 767px) {
	.girs {
		--girs-card: 72vw;
		--girs-edge: 1.75rem;

		grid-template-columns: minmax(0, 1fr);
		gap: clamp(20px, 5vw, 28px);
	}

	/* The section drops its gutter on the track side, and with one column the
	   heading would inherit that. It keeps its own. */
	.girs__head {
		padding-inline-end: 1.75rem;
	}

	.girs__title {
		font-size: clamp(2rem, 1.5rem + 2.5vw, 2.375rem);
		line-height: 1.18;
	}
}

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

	.girs__btn {
		transition: none;
	}
}
