/*
 * PL Events / Past archive.
 *
 * Recreates the legacy Elementor page using the production Elementor Kit.
 * The archive title is visually matched to the rendered "twórczość" title
 * on /pl/works/. The Works title has a nominal 76px size, but the whole
 * Works composition is currently scaled to 0.7407 at the reference viewport:
 * 76px × 0.7407 = 56.2932px.
 */

.events-past {
	width: 100%;
	margin-top: 0;
	box-sizing: border-box;
}

.events-past__inner {
	width: 100%;
	max-width: 1100px;
	margin-inline: auto;
	padding: 10px;
	box-sizing: border-box;
}

.events-past__title {
	margin: 0 0 20px;
	font-family: "Futura", Arial, sans-serif;
	font-size: 56.3px;
	font-weight: 500;
	font-style: normal;
	line-height: 1.2;
	letter-spacing: 20px;
	text-align: center;
	color: #fff;
	/* Optical upward correction (including descender of „y").
	 * Paint-only: do not move the grid or alter thumbnail layout. */
	transform: translateY(-4px);
}

.events-past__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: 30px;
	row-gap: 35px;
}

.events-past__item {
	min-width: 0;
}

.events-past__thumbnail-link {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 0.62;
	overflow: hidden;
	background: #000;
	text-decoration: none;
}

.events-past__thumbnail {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform 180ms ease;
}

/*
 * TEDxSGH artwork places important text close to the right edge.
 * Shift only this event's crop so both the TEDx logo and the date remain visible.
 */
.events-past__item--tedxsgh .events-past__thumbnail {
	object-position: 82% center;
}

.events-past__thumbnail--empty {
	background: #111;
}

.events-past__item-title {
	margin: 20px 0 0;
	font-family: "Futura", Arial, sans-serif;
	font-size: 20px;
	font-weight: 500;
	font-style: normal;
	line-height: 1.25;
}

.events-past__item-title a,
.events-past__item-title a:visited {
	color: #fff;
	text-decoration: none;
}

.events-past__item-title a:hover,
.events-past__item-title a:focus-visible {
	color: #a1a1a1;
}

.events-past__empty {
	margin: 0;
	font-family: "Futura", Arial, sans-serif;
	font-size: 21px;
	font-weight: 400;
	text-align: center;
}

@media (hover: hover) and (pointer: fine) {
	.events-past__thumbnail-link:hover .events-past__thumbnail,
	.events-past__thumbnail-link:focus-visible .events-past__thumbnail {
		transform: scale(1.02);
	}
}

@media (max-width: 1024px) {
	.events-past__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.events-past__title {
		font-size: 52px;
		letter-spacing: 10px;
	}

	.events-past__grid {
		grid-template-columns: 1fr;
		column-gap: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.events-past__thumbnail {
		transition: none;
	}
}

/* Landscape phone: two readable, dominant cards above the fold.
 * A portrait poster (Lift Lady) fills the SAME landscape crop as desktop. */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 1024px) and (hover: none) and (pointer: coarse) {
    .events-past__inner {
        max-width: none;
        padding: 2px 12px 8px;
    }
    .events-past__title {
        margin: 0 0 8px;
        /* Optically center descenders between menu and first thumbnail. */
        transform: translateY(-2px);
        font-size: clamp(22px, 6svh, 30px);
        line-height: 1.05;
        letter-spacing: clamp(4px, 1.2vw, 10px);
    }
    .events-past__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: clamp(10px, 2vw, 18px);
        row-gap: clamp(50px, 20svh, 90px);
        align-items: start;
    }
    .events-past__thumbnail-link {
        display: flex;
        align-items: center;
        justify-content: center;
        height: clamp(138px, 57.5svh, 264px);
        width: min(100%, clamp(223px, 92.75svh, 427px));
        margin-inline: auto;
        overflow: hidden;
        aspect-ratio: auto;
    }
    .events-past__thumbnail,
    .events-past__thumbnail:not(.events-past__thumbnail--empty) {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
    }
    /* Featured poster: desktop crop, not the complete portrait poster. */
    .events-past__item#post-2390 .events-past__thumbnail {
        object-fit: cover;
        object-position: center;
    }
    .events-past__thumbnail--empty { width:100%; height:100%; aspect-ratio:auto; }
    .events-past__item-title {
        margin: 7px 0 0;
        font-size: clamp(13.5px, 3.92svh, 18px);
        line-height: 1.15;
        letter-spacing: 0;
        overflow-wrap: anywhere;
        text-align: center;
    }
}
