/**
 * The following styles get applied both on the front of your site
 * and in the editor.
 *
 * Replace them with your own styles or remove the file completely.
 */

.wp-block-pablo-moratinos-speaking-events {
	.speaking-events-container {
		max-width: 800px;
		margin: 0 auto;
	}

	.speaking-events-year-section {
		margin-bottom: 1.5rem;
		border: 1px solid #e2e8f0;
		border-radius: 8px;
		overflow: hidden;
		background: #ffffff;
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);

		&:last-child {
			margin-bottom: 0;
		}
	}

	.year-toggle {
		width: 100%;
		padding: 1.25rem 1.5rem;
		border: none;
		background: #f8fafc; /* Default fallback */
		color: #1e293b; /* Default fallback */
		font-size: 1.25rem;
		font-weight: 600;
		text-align: left;
		cursor: pointer;
		display: flex;
		justify-content: space-between;
		align-items: center;
		transition: all 0.3s ease;
		border-bottom: 1px solid #e2e8f0;

		&:hover {
			opacity: 0.9;
			transform: translateY(-1px);
		}

		&.expanded {
			.toggle-icon {
				transform: rotate(180deg);
			}
		}

		.year-text {
			font-size: 1.25rem;
			font-weight: 600;
		}

		.toggle-icon {
			width: 0;
			height: 0;
			border-left: 6px solid transparent;
			border-right: 6px solid transparent;
			border-top: 8px solid currentColor;
			transition: transform 0.3s ease;
			opacity: 0.7;
			display: inline-block;
		}
	}

	.events-list {
		transition: all 0.3s ease;
		overflow: hidden;

		&.expanded {
			display: block !important;
		}
	}

	.event-item {
		padding: 1.5rem;
		border-bottom: 1px solid #f1f5f9;
		display: flex;
		gap: 1.25rem;
		align-items: flex-start;

		&:last-child {
			border-bottom: none;
		}

		@media (max-width: 768px) {
			flex-direction: column;
			gap: 0.75rem;
		}
	}

	.event-date {
		flex-shrink: 0;
		width: 140px;
		color: #64748b;
		font-size: 0.875rem;
		font-weight: 500;
		text-transform: uppercase;
		letter-spacing: 0.025em;

		@media (max-width: 768px) {
			width: auto;
			font-size: 0.8rem;
		}
	}

	.event-content {
		flex: 1;
		min-width: 0;
	}

	.event-header {
		margin-bottom: 0.5rem;
	}

	.event-name {
		font-size: 1.125rem;
		font-weight: 600;
		color: #1e293b;
		margin: 0 0 0.25rem 0;
		line-height: 1.4;

		.event-name-link {
			/* Inherit all link styles from the active theme */
			color: inherit;
			text-decoration: inherit;
			font-weight: inherit;
			font-size: inherit;
			line-height: inherit;
			
			/* Reset any custom styling to let theme styles take precedence */
			all: unset;
			
			/* Restore essential link properties */
			cursor: pointer;
			display: inline;
			
			/* Allow theme to style the link completely */
			font-size: 1.125rem;
			font-weight: 600;
			line-height: 1.4;
			
			/* Add underline to indicate it's a clickable link */
			text-decoration: underline;
		}
	}

	.event-venue {
		color: #64748b;
		font-size: 0.875rem;
		font-weight: 500;
	}

	.presentation-title {
		color: #374151;
		font-size: 1rem;
		line-height: 1.5;
		margin-bottom: 0.75rem;
	}

	.event-description {
		color: #64748b;
		font-size: 0.9rem;
		line-height: 1.6;
		margin-top: 0.75rem;
		padding: 0.75rem;
		background-color: #f8fafc;
		border-radius: 6px;
		border-left: 3px solid #e2e8f0;
		font-style: italic;
	}

	// Empty state for when no events are present
	.speaking-events-empty {
		text-align: center;
		padding: 3rem 1.5rem;
		color: #64748b;

		p {
			font-size: 1.125rem;
			margin: 0;
		}
	}

	// Responsive adjustments
	@media (max-width: 640px) {
		.speaking-events-container {
			margin: 0 -1rem;
		}

		.speaking-events-year-section {
			border-radius: 0;
			border-left: none;
			border-right: none;
		}

		.year-toggle {
			padding: 1rem 1.25rem;
			font-size: 1.125rem;
		}

		.event-item {
			padding: 1.25rem;
		}

		.event-name {
			font-size: 1rem;
		}

		.presentation-title {
			font-size: 0.875rem;
		}

		.event-description {
			font-size: 0.85rem;
			padding: 0.5rem;
		}
	}
}

// Animation keyframes
@keyframes slideDown {
	from {
		max-height: 0;
		opacity: 0;
	}
	to {
		max-height: 1000px;
		opacity: 1;
	}
}

@keyframes slideUp {
	from {
		max-height: 1000px;
		opacity: 1;
	}
	to {
		max-height: 0;
		opacity: 0;
	}
}

.wp-block-pablo-moratinos-speaking-events .events-list {
	&.expanding {
		animation: slideDown 0.3s ease-out forwards;
	}

	&.collapsing {
		animation: slideUp 0.3s ease-out forwards;
	}
}