/**
 * Habitat Events — Front-end styles
 */

.he-event-meta {
	margin: 0 0 2em;
	padding: 1.5em;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	background: #f9f9f8;
	font-family: inherit;
}

.he-event-meta-row {
	display: flex;
	align-items: flex-start;
	gap: 0.75em;
	padding: 0.6em 0;
}

.he-event-meta-row + .he-event-meta-row {
	border-top: 1px solid #e8e8e6;
}

.he-event-meta-text {
	display: flex;
	flex-direction: column;
	gap: 0.2em;
}

.he-icon {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	margin-top: 0.1em;
	display: inline-block;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: 0.75;
}

.he-icon-calendar {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23046a38' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.he-icon-pin {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23046a38' stroke-width='2'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 1 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

.he-event-date {
	font-weight: 600;
	font-size: 1.05em;
}

.he-event-time {
	color: #555;
}

.he-event-address {
	font-weight: 500;
}

.he-maps-link {
	font-size: 0.9em;
	text-decoration: underline;
}

.he-cta-button {
	display: inline-block;
	padding: 0.7em 1.5em;
	background: #046a38;
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	border-radius: 5px;
	transition: background 0.15s ease-in-out;
}

.he-cta-button:hover,
.he-cta-button:focus {
	background: #03512b;
	color: #fff;
}

.he-event-add-to-calendar {
	flex-wrap: wrap;
	align-items: center;
}

.he-add-to-calendar-label {
	font-weight: 600;
	white-space: nowrap;
}

.he-add-to-calendar-links {
	display: flex;
	gap: 1em;
	flex-wrap: wrap;
}

.he-cal-link {
	font-size: 0.9em;
	text-decoration: underline;
	color: #046a38;
}

.he-cal-link:hover {
	color: #03512b;
}

/* Single event template (single-habitat_event.php) */

.single-content.habitat-event .single-hero__content {
	margin-bottom: 1.5em;
}

.single-content.habitat-event .single-hero__image img {
	display: block;
	width: 100%;
	height: auto;
}

.he-event-main {
	font-size: 1.05em;
	line-height: 1.6;
}

.he-event-cta {
	margin: 1.5em 0;
}

.he-add-to-calendar-list {
	list-style: none;
	margin: 0 0 2em;
	padding: 0;
}

.he-add-to-calendar-list li {
	margin: 0.4em 0;
}

.he-add-to-calendar-list .he-cal-link {
	color: #046a38;
	text-decoration: none;
	font-weight: 600;
}

.he-add-to-calendar-list .he-cal-link:hover {
	text-decoration: underline;
}

.he-event-details {
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	padding: 1.5em;
	background: #f9f9f8;
	align-self: flex-start;
}

.he-detail-block {
	padding: 0.9em 0;
}

.he-detail-block + .he-detail-block {
	border-top: 1px solid #e8e8e6;
}

.he-detail-block h3 {
	margin: 0 0 0.3em;
	font-size: 0.8em;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #046a38;
}

.he-detail-block p {
	margin: 0;
}

.he-detail-address {
	font-weight: 500;
}

.he-detail-share .he-share-links {
	display: flex;
	gap: 0.75em;
	flex-wrap: wrap;
}

.he-detail-share .he-share-links a {
	font-size: 0.85em;
	color: #046a38;
	text-decoration: none;
	border: 1px solid #046a38;
	border-radius: 4px;
	padding: 0.3em 0.7em;
}

.he-detail-share .he-share-links a:hover {
	background: #046a38;
	color: #fff;
}

@media (max-width: 640px) {
	.he-event-details {
		margin-top: 2em;
	}
}

/* Events grid shortcode — [habitat_events] */

/* Taxonomy filter bar */
.he-events-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6em;
	margin-bottom: 1.75em;
}

.he-filter-btn {
	font: inherit;
	cursor: pointer;
	padding: 0.5em 1.2em;
	border: 1px solid #046a38;
	border-radius: 999px;
	background: #fff;
	color: #046a38;
	font-weight: 600;
	font-size: 0.9em;
	transition: background 0.15s ease, color 0.15s ease;
}

.he-filter-btn:hover {
	background: #eaf3ee;
}

.he-filter-btn.is-active {
	background: #046a38;
	color: #fff;
}

/* Loading state while AJAX request is in flight */
.he-events-grid-container {
	position: relative;
	min-height: 80px;
	transition: opacity 0.15s ease;
}

.he-events-grid-container.is-loading {
	opacity: 0.45;
	pointer-events: none;
}

.he-events-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.75em;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Card — the anchor IS the card, so every part is clickable */
.he-event-card {
	display: flex;
	flex-direction: column;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #e2e2e2;
	background: #fff;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.he-event-card:hover {
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.he-event-card__link {
	display: flex;
	flex-direction: column;
	flex: 1;
	text-decoration: none;
	color: inherit;
	height: 100%;
}

.he-event-card__link:hover,
.he-event-card__link:focus {
	text-decoration: none;
	color: inherit;
	outline: 2px solid #046a38;
	outline-offset: 2px;
}

/* Photo */
.he-event-card__image {
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #e8e8e6;
	flex-shrink: 0;
}

.he-event-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.he-event-card:hover .he-event-card__image img {
	transform: scale(1.04);
}

.he-event-card__image-placeholder {
	width: 100%;
	height: 100%;
	background: #e8e8e6;
}

/* Body */
.he-event-card__body {
	padding: 1.2em 1.3em 1.4em;
	display: flex;
	flex-direction: column;
	gap: 0.45em;
	flex: 1;
}

.he-event-card__title {
	margin: 0 0 0.2em;
	font-size: 1.1em;
	line-height: 1.3;
	color: #111;
}

.he-event-card__date,
.he-event-card__location {
	margin: 0;
	font-size: 0.875em;
	color: #555;
	display: flex;
	align-items: flex-start;
	gap: 0.4em;
	line-height: 1.4;
}

.he-event-card__excerpt {
	margin: 0.35em 0 0;
	font-size: 0.875em;
	color: #666;
	line-height: 1.5;
}

/* Inline icons using inline SVG data URIs */
.he-event-card__icon {
	flex-shrink: 0;
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-top: 0.15em;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

.he-icon-cal {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23046a38' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.he-icon-pin {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23046a38' stroke-width='2'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 1 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

.he-no-events {
	padding: 1em;
	color: #666;
}

/* Responsive — 2 cols on tablet, 1 col on mobile */
@media (max-width: 900px) {
	.he-events-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.he-event-meta-row {
		flex-direction: column;
	}

	.he-add-to-calendar-links {
		flex-direction: column;
		gap: 0.4em;
	}
}
