/* =====================================================================
   3 Grands Ice Cream - Events page (events.php): scrapbook wall + photo pop-up
   ===================================================================== */
.tg-ev {
	--pink: #fd3464; --pink-dk: #c8174a; --blue: #0073d1; --blue-dk: #00509a; --yellow: #ffc22e; --orange: #f68f18;
	--ink: #2b1d3a; --ink-2: #5a4b6b; --display: "Fredoka", "Poppins", system-ui, sans-serif;
	color: var(--ink); overflow-x: clip; font-family: "Poppins", system-ui, sans-serif;
}
.tg-ev *, .tg-ev *::before, .tg-ev *::after { box-sizing: border-box; }
.tg-ev-wrap { width: min(1180px, 100% - 40px); margin-inline: auto; position: relative; }
.tg-ev h2 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 4.6vw, 56px); line-height: 1.1; color: var(--ink); text-transform: none; letter-spacing: normal; margin: 0; }
.tg-ev h2 b { color: var(--pink); font-weight: 700; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the wall ---------- */
.tg-ev-wall {
	padding: clamp(90px, 9vw, 130px) 0 clamp(80px, 9vw, 120px);
	background: radial-gradient(circle at 1px 1px, rgba(253, 52, 100, .13) 1.5px, transparent 0) 0 0 / 26px 26px, #fff7fa;
}
.tg-ev-head { text-align: center; max-width: 720px; margin: 0 auto 60px; }
.tg-ev-eyebrow {
	font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: .22em; text-transform: uppercase; color: #d81b4f;
	display: inline-flex; align-items: center; gap: 10px; margin: 0 0 12px;
}
.tg-ev-eyebrow::before, .tg-ev-eyebrow::after { content: ""; width: 28px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--orange), var(--pink)); }
.tg-ev-lead { font-size: 17px; line-height: 1.75; color: var(--ink-2); margin: 18px 0 0; text-wrap: balance; }
.tg-ev-count {
	display: inline-flex; align-items: center; gap: 8px; margin: 22px 0 0; padding: 8px 18px; border-radius: 999px;
	background: #fff; box-shadow: 0 0 0 2px #ffd3df, 0 8px 18px -10px rgba(253, 52, 100, .5); font-size: 15px; color: var(--ink-2);
}
.tg-ev-count b { font-family: var(--display); font-size: 20px; color: var(--pink); }

.tg-ev-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 46px 34px; }
.tg-ev-item { rotate: var(--tilt, 0deg); transition: rotate .45s cubic-bezier(.3, 1.6, .5, 1), translate .45s cubic-bezier(.3, 1.6, .5, 1); }
/* hover lifts the card INSIDE its slot (the slot itself never moves), so scrolling past cards never makes them jump */
.tg-ev-item:hover { rotate: 0deg; }
.tg-ev-card { transition: box-shadow .3s ease, translate .45s cubic-bezier(.3, 1.6, .5, 1) !important; }
.tg-ev-item:hover .tg-ev-card { translate: 0 -8px; }
.tg-ev-item:hover .tg-ev-card { box-shadow: 0 34px 60px -24px rgba(43, 29, 58, .45); }

/* polaroid card */
.tg-ev-card {
	position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; margin: 0; padding: 14px 14px 22px;
	border: 0; border-radius: 10px; background: #fff; text-align: left; cursor: zoom-in; font: inherit; color: inherit;
	box-shadow: 0 22px 44px -26px rgba(43, 29, 58, .45), 0 2px 0 rgba(43, 29, 58, .06);
}
.tg-ev-card:focus-visible { outline: 3px dashed var(--blue); outline-offset: 8px; }
.tg-ev-card__tape {
	position: absolute; top: -14px; left: 50%; translate: -50% 0; rotate: -4deg; width: 110px; height: 30px; z-index: 2; opacity: .85;
	background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .45) 0 7px, transparent 7px 14px), var(--tape, var(--pink));
	clip-path: polygon(0 10%, 5% 0, 10% 10%, 15% 0, 85% 0, 90% 10%, 95% 0, 100% 10%, 100% 90%, 95% 100%, 90% 90%, 85% 100%, 15% 100%, 10% 90%, 5% 100%, 0 90%);
}
.tg-ev-card__num {
	position: absolute; top: 2px; right: 2px; z-index: 3; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
	font-family: var(--display); font-weight: 700; font-size: 17px; color: #fff; background: var(--pink);
	box-shadow: 0 4px 0 var(--pink-dk); rotate: 12deg; translate: 30% -30%;
}
.tg-ev-card__photo { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: #f3eef6; }
.tg-ev-card__photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s cubic-bezier(.2, .8, .3, 1); }
.tg-ev-item:hover .tg-ev-card__photo img { transform: scale(1.08); }
.tg-ev-card__zoom {
	position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
	font-family: var(--display); font-weight: 700; font-size: 26px; color: #fff; background: rgba(43, 29, 58, .72);
	scale: 0; transition: scale .35s cubic-bezier(.3, 1.8, .5, 1);
}
.tg-ev-item:hover .tg-ev-card__zoom, .tg-ev-card:focus-visible .tg-ev-card__zoom { scale: 1; }
.tg-ev-card__title { display: block; margin: 18px 6px 6px; font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.2; color: var(--ink); text-wrap: balance; }
.tg-ev-card__desc { display: block; margin: 0 6px; font-size: 15.5px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }

/* "your event could be next" card */
.tg-ev-next {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 100%; min-height: 320px;
	padding: 34px 26px; border-radius: 22px; text-align: center; text-decoration: none !important;
	border: 3px dashed #ffb3c7; background: radial-gradient(circle at 1px 1px, rgba(253, 52, 100, .15) 1.5px, transparent 0) 0 0 / 22px 22px, #fff;
	transition: border-color .2s ease, background-color .2s ease;
}
.tg-ev-next:hover { border-color: var(--pink); }
.tg-ev-next__ico { font-size: 54px; line-height: 1; transform: scaleX(-1); animation: tg-ev-drive 3s ease-in-out infinite; }
.tg-ev-next__title { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.15; color: var(--ink); }
.tg-ev-next__desc { font-size: 15.5px; color: var(--ink-2); }
.tg-ev-next__btn {
	margin-top: 8px; padding: 14px 26px 13px; border-radius: 999px; font-family: var(--display); font-weight: 600; font-size: 17px; color: #fff;
	background: var(--pink); box-shadow: 0 5px 0 var(--pink-dk), 0 12px 24px rgba(253, 52, 100, .35); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.tg-ev-next:hover .tg-ev-next__btn { transform: translateY(-3px) scale(1.04); }
@keyframes tg-ev-drive { 0%, 100% { translate: -8px 0; } 50% { translate: 8px -3px; } }

/* while the page is scrolling, the photo wall ignores the mouse: cards sliding under a still cursor would otherwise
   keep hover-lifting and dropping, and with lots of tilted cards that read as the page flickering (tg-events.js) */
html.tg-ev-scrolling .tg-ev-grid { pointer-events: none; }

/* reveal on scroll (only hidden once the script is running) */
html.tg-ev-ready .tg-ev-item { opacity: 0; translate: 0 40px; }
html.tg-ev-ready .tg-ev-item.is-in { opacity: 1; translate: 0 0; transition: opacity .7s ease var(--rd, 0s), translate .9s cubic-bezier(.2, .9, .3, 1.15) var(--rd, 0s), rotate .45s cubic-bezier(.3, 1.6, .5, 1); }
html.tg-ev-ready .tg-ev-item.is-in:hover { transition-delay: 0s; }

/* ---------- closing CTA (flows into the footer) ---------- */
.tg-ev-cta {
	padding: clamp(80px, 9vw, 120px) 0; text-align: center; color: #fff; background-color: #005fbd;
	background-image:
		radial-gradient(circle at 14px 20px, rgba(255, 255, 255, .5) 0 2.4px, transparent 3px),
		radial-gradient(circle at 74px 44px, rgba(255, 194, 46, .85) 0 2.4px, transparent 3px),
		radial-gradient(circle at 118px 96px, rgba(31, 192, 214, .8) 0 2.4px, transparent 3px),
		linear-gradient(160deg, #0a7fe0 0%, #005fbd 100%);
	background-size: 140px 140px, 140px 140px, 140px 140px, 100% 100%;
}
.tg-ev-cta h2 { color: #fff; text-shadow: 0 5px 0 rgba(0, 40, 100, .35); }
.tg-ev-cta h2 b { color: var(--yellow); }
.tg-ev-cta p { font-size: 18px; line-height: 1.7; color: rgba(255, 255, 255, .92); margin: 18px auto 0; max-width: 620px; text-wrap: balance; }
.tg-ev-cta__btns { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 32px; }
.tg-ev-btn {
	display: inline-flex; align-items: center; justify-content: center; padding: 16px 30px 15px; border-radius: 999px;
	font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 1; text-decoration: none !important;
	transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.tg-ev-btn:hover { transform: translateY(-4px) scale(1.03); }
.tg-ev-btn--pink { background: var(--pink); color: #fff !important; box-shadow: 0 6px 0 var(--pink-dk), 0 14px 28px rgba(253, 52, 100, .35); }
.tg-ev-btn--white { background: #fff; color: var(--blue) !important; box-shadow: 0 6px 0 #b9d8f5, 0 14px 28px rgba(0, 0, 0, .18); }
body.page-template-events footer.footer { margin-top: 0 !important; background-color: #005fbd; }
@media (min-width: 1000px) { .tg-ev-cta { padding-bottom: 300px; } }
@media (min-width: 1101px) { .tg-ev-cta { padding-bottom: 315px; } }

/* ---------- photo pop-up ---------- */
.tg-ev-lb { border: 0; padding: 0; margin: auto; background: transparent; overflow: visible; width: auto; max-width: min(92vw, 980px); max-height: none; color: var(--ink); }
.tg-ev-lb::backdrop { background: radial-gradient(60% 60% at 50% 45%, rgba(253, 52, 100, .45), rgba(43, 29, 58, .88)); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tg-ev-lb__card { position: relative; padding: 14px 14px 0; border-radius: 14px; background: #fff; rotate: var(--lt, -1.2deg); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .55); }
.tg-ev-lb[open] .tg-ev-lb__card { animation: tg-ev-pop .5s cubic-bezier(.2, 1.4, .35, 1); }
@keyframes tg-ev-pop { from { scale: .6; opacity: 0; rotate: -10deg; } }
.tg-ev-lb__photo { border-radius: 6px; overflow: hidden; background: #1b1424; }
.tg-ev-lb__photo img { display: block; width: auto; max-width: 100%; max-height: min(64vh, 660px); margin: 0 auto; }
.tg-ev-lb__foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 6px 20px; }
.tg-ev-lb__title { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15; }
.tg-ev-lb__desc { margin: 6px 0 0; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); max-width: 60ch; }
.tg-ev-lb__count {
	flex: 0 0 auto; margin: 0; white-space: nowrap; font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--ink-2);
	background: #fff; padding: 8px 15px 7px; border-radius: 999px; border: 2px solid #cfe3f8; box-shadow: 0 4px 0 #cfe3f8;
}
.tg-ev-lb__count b { font-size: 20px; color: var(--blue); }
.tg-ev-lb__x, .tg-ev-lb__nav { border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; border-radius: 50%; transition: transform .35s cubic-bezier(.3, 1.8, .5, 1); }
.tg-ev-lb__x { position: absolute; top: -18px; right: -18px; z-index: 3; width: 50px; height: 50px; color: #fff; background: var(--pink); box-shadow: 0 5px 0 var(--pink-dk), 0 12px 24px rgba(0, 0, 0, .3); }
.tg-ev-lb__x:hover { transform: rotate(90deg) scale(1.1); }
.tg-ev-lb__nav { position: fixed; top: 50%; translate: 0 -50%; z-index: 4; width: 62px; height: 62px; color: var(--pink); background: #fff; box-shadow: 0 6px 0 #f6c3d1, 0 16px 30px rgba(0, 0, 0, .35); }
.tg-ev-lb__nav--prev { left: max(14px, calc(50vw - 590px)); }
.tg-ev-lb__nav--next { right: max(14px, calc(50vw - 590px)); }
.tg-ev-lb__nav:hover { transform: scale(1.12); }
.tg-ev-lb__x svg, .tg-ev-lb__nav svg { width: 46%; height: 46%; fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.tg-ev-lb__x:focus-visible, .tg-ev-lb__nav:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.tg-ev-lb__nav[hidden] { display: none; }

@media (max-width: 767px) {
	.tg-ev-grid { grid-template-columns: 1fr; gap: 40px; max-width: 420px; margin: 0 auto; }
	.tg-ev-next { min-height: 260px; }
	.tg-ev-cta__btns .tg-ev-btn { width: min(320px, 100%); }
	.tg-ev-lb__card { padding: 10px 10px 0; }
	.tg-ev-lb__photo img { max-height: 56vh; }
	.tg-ev-lb__foot { flex-direction: column-reverse; gap: 10px; }
	.tg-ev-lb__nav { top: auto; bottom: 18px; translate: none; width: 54px; height: 54px; }
	.tg-ev-lb__nav--prev { left: calc(50% - 68px); }
	.tg-ev-lb__nav--next { right: calc(50% - 68px); }
	.tg-ev-lb__x { top: -16px; right: -10px; width: 46px; height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
	.tg-ev *, .tg-ev *::before, .tg-ev *::after { animation: none !important; transition: none !important; }
	html.tg-ev-ready .tg-ev-item { opacity: 1; translate: none; }
}
