/* ==========================================================================
   WTF Events — grid + card styles for the [wtf_events] shortcode
   FILE LOCATION: css/wtf-events.css
   ========================================================================== */

.wtf-events-section {
	margin-bottom: 3rem;
}

.wtf-events-heading {
	display: inline-block;
	margin-bottom: 1.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 3px solid #ffcc00;
}

.wtf-events-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 2rem;
}

.wtf-event-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.wtf-event-card__image-trigger {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
}

.wtf-event-card__image {
	display: block;
	overflow: hidden;
}

.wtf-event-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top; /* crop from the bottom, keep the top of the image in view */
}

/* Fixed image height only above the mobile single-column breakpoint —
   on mobile there's no row to keep aligned, so let the image show in full. */
@media (min-width: 481px) {
	.wtf-event-card__image {
		height: 200px;
	}
}

.wtf-event-card__body {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	padding: 1.25rem;
}

.wtf-event-card__badge {
	align-self: flex-start;
	margin-bottom: 0.5rem;
	padding: 0.2rem 0.6rem;
	border-radius: 3px;
	background: #f0f0f0;
	color: #777;
	font-size: 0.75rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.wtf-event-card__title {
	margin: -1.25rem -1.25rem 1rem -1.25rem;
	padding: 0.75rem 1.25rem;
	background: #ffcc00;
	color: #000;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.3;
}

.wtf-event-card__meta {
	margin: 0 0 0.9rem;
	color: #1a1a1a;
	font-size: 0.9rem;
	font-weight: 700;
}

.wtf-event-card__content {
	margin-bottom: 1rem;
	font-size: 0.95rem;
	line-height: 1.5;
}

.wtf-event-card__content p:last-child {
	margin-bottom: 0;
}

.wtf-event-card__content-wrap {
	display: flex;
	flex-direction: column;
}

/* Clamp the description only above the mobile breakpoint — see note above. */
@media (min-width: 481px) {
	.wtf-event-card__content--clamped {
		display: -webkit-box;
		-webkit-line-clamp: 4;
		line-clamp: 4;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
}

/* No `display` set here on purpose — the button's native default plays
   nicely with its `hidden` attribute, which JS toggles based on whether
   the description above is actually being truncated. */
.wtf-event-card__readmore {
	align-self: flex-start;
	margin: 0 0 1rem;
	padding: 0;
	background: none;
	border: 0;
	color: #a67c00;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

/* !important here is deliberate: your theme's generic button:hover/:focus
   rule (background-color: #3f4047, color: #ffffff) matches this <button>
   at specificity (0,2,1), and I'd only overridden color, not background —
   forcing both properties removes the dark charcoal box entirely. */
.wtf-event-card__readmore:hover,
.wtf-event-card__readmore:focus,
.wtf-event-card__readmore:active {
	color: #a67c00 !important;
	background-color: transparent !important;
	text-decoration: underline;
}

.wtf-event-card__booking {
	margin-top: auto;
	padding-top: 0.5rem;
}

.wtf-event-card__booking-link {
	display: inline-block;
	padding: 0.6rem 1.1rem;
	background: #ffcc00;
	border-radius: 8px;
	color: #000;
	font-weight: 700;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

/* Specificity bump (two classes) plus !important: I can't see your theme's
   own link-color rule (e.g. `.entry-content a`), and even a specificity
   tie would be decided by load order rather than intent — this guarantees
   black text regardless of what's competing. */
.wtf-event-card__booking .wtf-event-card__booking-link,
.wtf-event-card__booking .wtf-event-card__booking-link:hover,
.wtf-event-card__booking .wtf-event-card__booking-link:focus,
.wtf-event-card__booking .wtf-event-card__booking-link:visited,
.wtf-event-card__booking .wtf-event-card__booking-link:active {
	color: #000 !important;
}

.wtf-event-card__booking-link:hover {
	background: #e6b800;
}

.wtf-event-card__booking-link::after {
	content: "\2192";
	margin-left: 6px;
}

/* Past events: greyed out */
.wtf-event-card--past {
	opacity: 0.65;
}

.wtf-event-card--past .wtf-event-card__image img {
	filter: grayscale(100%);
}

.wtf-event-card--past .wtf-event-card__title {
	background: #cfcfcf;
}

/* Small screens: single column */
@media (max-width: 480px) {
	.wtf-events-grid {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Shared modal — opened by either the image trigger or "Read more"
   ========================================================================== */

.wtf-events-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	background: rgba(0, 0, 0, 0.6);
}

.wtf-events-modal.is-open {
	display: flex;
}

.wtf-events-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 640px;
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 6px;
	padding: 1.75rem;
}

.wtf-events-modal__close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	width: 2.25rem;
	height: 2.25rem;
	background: none;
	border: 0;
	color: #000;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
}

/* Same theme button:hover/:focus rule as the read-more fix above
   (background-color: #3f4047, color: #ffffff) — neutralized here too. */
.wtf-events-modal__close:hover,
.wtf-events-modal__close:focus {
	color: #000 !important;
	background-color: transparent !important;
}

.wtf-event-modal__image {
	display: block;
	width: 100%;
	height: auto;
	margin-bottom: 1rem;
	border-radius: 4px;
}

.wtf-event-modal__title {
	margin: 0 0 0.5rem;
}

.wtf-event-modal__meta {
	margin: 0 0 1rem;
	color: #555;
}

.wtf-event-modal__content p:last-child {
	margin-bottom: 0;
}