/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

:root {
	--wtbi-timeline-color: #000;
	--wtbi-timeline-line-width: 0.25rem;
	--wtbi-timeline-icon-size: 3.75rem;
	--wtbi-timeline-content-width: 45%;
	--wtbi-timeline-spacing: 2rem;
	--wtbi-timline-arrow-border-color: #000;
}

.wtbi-timeline-express {
	/* Container
    ========================================================================== */
	&.container {
		position: relative;
		width: 100%;
		margin-top: 2rem;
		padding: 2rem 0;

		/* Vertical line */
		&::before {
			content: '';
			position: absolute;
			top: 0;
			left: 50%;
			transform: translateX(-50%);
			width: var(--wtbi-timeline-line-width);
			height: 100%;
			background-color: var(--wtbi-timeline-color);
		}
	}

	/* Timeline Block (each announcement)
    ========================================================================== */
	.timeline-block {
		position: relative;
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		margin-bottom: var(--wtbi-timeline-spacing);
		width: 100%;

		&:nth-child(even) {
			justify-content: flex-end;
		}
	}

	/* Timeline Icon (circle on the line)
    ========================================================================== */
	.timeline-circle {
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
		width: var(--wtbi-timeline-icon-size);
		height: var(--wtbi-timeline-icon-size);
		border-radius: 50%;
		background: var(--wtbi-timeline-color);
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 10;
		border: 4px solid #fff;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

		.timeline-icon {
			width: 1rem;
			height: 1rem;
			border-radius: 100%;
			background-color: #fff;
		}
	}

	/* Timeline Content Card
    ========================================================================== */
	.timeline-block {
		.timeline-content {
			position: relative;
			width: var(--wtbi-timeline-content-width);
			padding: 1.5rem;
			background: var(--wtbi-timeline-color);
			color: #fff;
			border-radius: 4px;
			box-shadow: 0 3px 0 #B9C5CD;

			/* Arrow pointing to timeline */
			.timeline-arrow {
				position: absolute;
				top: 16px;
				width: 0;
				height: 0;
			}

			/* Title */
			.timeline-title-container {
				margin-bottom: 0.75rem;

				.timeline-item-title {
					line-height: 1;
					margin: 0;
					color: #fff;
					letter-spacing: 0.02em;
				}
			}

			/* Image */
			.timeline-item-img {
				display: block;
				width: 100%;
				height: auto;
				max-height: 220px;
				object-fit: cover;
				margin-bottom: 0.75rem;
				border-radius: 3px;
			}

			/* Text */
			.timeline-text-container {
				color: rgba(255, 255, 255, 0.9);

				p {
					margin: 0;

					& + p {
						margin-top: 0.5rem;
					}
				}
			}
		}

		/* Odd items: card on the right, arrow points left */
		&:nth-child(odd) {
			.timeline-content {
				margin-right: calc(50% + 30px);
			}

			.timeline-arrow {
				right: -24px;
				border: 12px solid;
				border-color: transparent transparent transparent var(--wtbi-timline-arrow-border-color);
			}
		}

		/* Even items: card on the left, arrow points right */
		&:nth-child(even) {
			.timeline-content {
				margin-left: calc(50% + 30px);
			}

			.timeline-arrow {
				left: -24px;
				border: 12px solid;
				border-color: transparent var(--wtbi-timline-arrow-border-color) transparent transparent;
			}
		}
	}
}

/* ==========================================================================
   Responsive Styles - Tablet
   ========================================================================== */

@media screen and (max-width: 1024px) {
	:root {
		--wtbi-timeline-content-width: 42%;
	}
}

/* ==========================================================================
   Responsive Styles - Mobile
   ========================================================================== */

@media screen and (max-width: 768px) {
	:root {
		--wtbi-timeline-icon-size: 32px;
	}

	.wtbi-timeline-express {
		/* Move vertical line to the left */
		&.container::before {
			left: 20px;
			transform: none;
		}

		/* Stack all blocks vertically */
		.timeline-block {
			justify-content: flex-start !important;
			padding-left: 50px;

			/* Position icon on the left */
			.timeline-circle {
				left: 20px;
				transform: translateX(-50%);

				.timeline-icon {
					width: 8px;
					height: 8px;
				}
			}

			/* Full-width cards */
			.timeline-content {
				width: 100% !important;
				margin-left: 0 !important;
				margin-right: 0 !important;
			}

			/* Arrow always points left on mobile */
			.timeline-arrow {
				left: -8px !important;
				top: 6px !important;
				right: auto !important;
				border-right-style: solid !important;
				border-right-width: 12px !important;
				border-left: none !important;
				border-color: transparent var(--wtbi-timline-arrow-border-color) transparent transparent !important;
			}

			.timeline-item-img {
				max-height: 150px;
			}
		}
	}
}

/* ==========================================================================
   Responsive Styles - Small Mobile
   ========================================================================== */

@media screen and (max-width: 480px) {
	.wtbi-timeline-express {
		&.container {
			padding: 1rem 0.5rem;

			&::before {
				left: 14px;
			}
		}

		.timeline-block {
			padding-left: 40px;

			.timeline-circle {
				left: 8px;
				width: 28px;
				height: 28px;
			}

			.timeline-content {
				padding: 1rem;
			}
		}
	}
}