/* Blogs Page Specific Styles */

/* Blog Main Heading */
.blogs-page .main-h1-heading.blog {
	padding-top: 160px;
	padding-bottom: 60px;
	font-size: 56px;
}

/* Blog Date */
.blogs-page .blog-date-main {
	color: var(--amp-gray);
	letter-spacing: .08em;
	text-transform: uppercase;
	font-size: 14px;
	font-weight: 700;
	line-height: 24px;
}

/* Blog Image - General (if used outside cards) */
.blogs-page .blog-image {
	aspect-ratio: 16/9;
	width: auto;
	height: auto;
	padding-top: 0;
}

/* Blogs Section */
.blogs-page .blogs-section {
	width: 100%;
	max-width: 1280px;
	min-height: 40px;
	margin-top: 0;
	margin-bottom: 0;
	padding: 0 30px 40px;
}

/* Blog page section header wrapper - padding handled by .section-header-title */
.blogs-page .section-header-wrapper {
	padding-top: 0;
}

/* Blog listing page title - use standard gray color (not yellow like blog posts) */
.blogs-page .blogs-section .section-header-wrapper .section-header-title {
	color: var(--amp-yellow) !important;
}

/* Blogs Wrapper - Vertical Loop Container */
.blogs-page .blogs-wrapper {
	width: 100%;
	overflow: visible; /* Show cards at top */
	min-height: 100vh; /* Ensure enough height for floating effect */
	padding-top: 0; /* Cards start at very top */
}

/* Blogs Columns Container */
.blogs-page .blogs-columns-container {
	display: flex;
	width: 100%;
	flex-wrap: nowrap;
	gap: 2%;
	overflow: visible; /* Show cards at top */
	min-height: 100vh; /* Ensure columns have height */
	padding-top: 0; /* Cards start at top */
}

/* Blog Column */
.blogs-page .blogs-column {
	width: 32%;
	will-change: transform;
	display: flex;
	flex-direction: column;
	opacity: 1; /* Show columns immediately */
	position: relative; /* For floating effect */
	align-items: flex-start; /* Align cards to top */
}

/* Blog Card - Vertical Loop Item */
.blogs-page .blogs-column .blogs-card {
	width: 100%;
	margin-bottom: 24px;
	flex-shrink: 0;
	position: relative; /* For floating animation */
	height: auto; /* Let content determine height */
}

/* Blog Title */
.blogs-page .blog-title {
	color: var(--amp-gray);
	height: auto;
	font-size: 20px;
	line-height: 25px;
}

/* Blog Entry - Base styles (blogs-card overrides these) */
/* Styles are handled by .blogs-card */

/* Blog Card */
.blogs-page .blogs-card {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	height: auto; /* Let content determine height */
	min-height: 350px; /* Reduced minimum height */
	max-height: none; /* Allow natural height */
	padding: 0;
	overflow: hidden; /* Keep hidden to maintain card shape */
	cursor: pointer;
	text-decoration: none;
	color: inherit;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	border-radius: 8px; /* Card has rounded corners */
	background-color: var(--amp-light-gray);
	box-shadow: 0 2px 4px #0003;
	flex-shrink: 0; /* Prevent cards from shrinking */
}

.blogs-page .blogs-card:hover {
	transform: translateY(-8px) scale(1.02);
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover effect on image */
.blogs-page .blogs-card:hover .blog-image {
	transform: scale(1.05);
	transition: transform 0.3s ease;
}

/* Blog Image - top of card */
.blogs-page .blogs-card .blog-image {
	width: 100%;
	height: auto;
	aspect-ratio: 16/9;
	object-fit: fill;
	display: block;
	margin-bottom: 0;
	border-radius: 8px 8px 0 0; /* Only top corners rounded - no bottom radius */
	transition: transform 0.3s ease;
	overflow: hidden; /* Contain zoom effect */
}

/* Blog Title - middle of card */
.blogs-page .blogs-card .blog-title {
	margin: 16px 24px 12px 24px; /* Same horizontal margin as summary */
	padding: 0;
	padding-bottom: 2px; /* Small padding to prevent clipping */
	width: calc(100% - 48px);
	box-sizing: border-box;
	text-decoration: none;
	color: inherit;
	display: -webkit-box;
	-webkit-line-clamp: 2; /* Limit to 2 complete lines */
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.25; /* Consistent line height */
	/* Use line-height * number of lines for accurate height */
	max-height: calc(1.25 * 1em * 2); /* 2 lines: line-height * font-size * 2 */
	word-wrap: break-word;
	overflow-wrap: break-word;
	/* Ensure text doesn't get cut mid-line */
	text-rendering: optimizeLegibility;
}

/* Summary - bottom of card */
.blogs-page .blogs-card .summary {
	position: relative;
	width: calc(100% - 48px);
	margin: 0 24px 24px 24px; /* Same horizontal margin as title */
	padding: 0;
	padding-bottom: 4px; /* Small padding to prevent clipping */
	box-sizing: border-box;
	flex: 1;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 4; /* Limit to 4 complete lines */
	line-clamp: 4;
	-webkit-box-orient: vertical;
	text-overflow: ellipsis;
	line-height: 1.5; /* Consistent line height */
	/* Use line-height * number of lines for accurate height */
	max-height: calc(1.5 * 1em * 4); /* 4 lines: line-height * font-size * 4 */
	word-wrap: break-word;
	overflow-wrap: break-word;
	/* Ensure text doesn't get cut mid-line */
	text-rendering: optimizeLegibility;
}

/* Responsive Styles */
@media screen and (max-width: 991px) {
	.blogs-page .main-h1-heading.blog,
	.blogs-page .main-h1-heading.case-studies {
		padding-top: 120px;
		padding-bottom: 40px;
	}

	.blogs-page .main-h1-heading.blog {
		font-size: 40px;
	}

	.blogs-page .blog-title {
		font-size: 18px;
	}

	/* Tablet: 2 columns */
	.blogs-page .blogs-columns-container {
		gap: 2%;
	}
	
	.blogs-page .blogs-column {
		width: 49%;
	}

	.blogs-page .blogs-card {
		min-height: 320px; /* Reduced for tablet */
	}
}

@media screen and (max-width: 767px) {
	.blogs-page .blogs-section {
		margin-top: 0;
		margin-bottom: 0;
		padding: 0 15px 20px;
	}

	.blogs-page .blog-title {
		text-align: left;
		margin-top: 10px;
	}

	/* Mobile: 1 column */
	.blogs-page .blogs-columns-container {
		flex-direction: column;
		gap: 0;
	}
	
	.blogs-page .blogs-column {
		width: 100%;
	}

	.blogs-page .blogs-card {
		min-height: 300px; /* Reduced for mobile */
	}
}

/* ============================================
   BLOG POST STYLES (content-container.bordered)
   Styles for individual blog post pages
   ============================================ */

/* Content container with borders (for blog posts) */
.content-container.bordered {
	max-width: 1320px; /* 1200px content + 60px padding on each side */
	width: 100%;
	margin-left: auto;
	margin-right: auto;
	padding-left: 60px;
	padding-right: 60px;
	padding-bottom: 80px; /* Consistent spacing at end of blog posts */
	box-sizing: border-box;
}

@media screen and (max-width: 1439px) {
	.content-container.bordered {
		padding-left: 5%;
		padding-right: 5%;
		padding-bottom: 80px; /* Consistent spacing at end of blog posts */
		max-width: calc(1200px + 10%);
	}
}

/* Blog post titles - apply section title styling with yellow color */
.content-container.bordered .section-header-title {
	color: var(--amp-yellow);
}

/* Blog post section header wrapper - match content width within container */
.content-container.bordered .section-header-wrapper {
	max-width: 100%;
	width: 100%;
	margin-left: 0;
	margin-right: 0;
	box-sizing: border-box;
	padding-top: 0; /* Padding handled by .section-header-title */
}

/* Blog post date styling - positioned right after title */
.section-header-wrapper .blog-date-main {
	margin-top: -80px; /* Negative margin to position right after title (accounts for title's margin-bottom: 24px) */
	margin-bottom: 0;
	color: var(--amp-gray);
	font-family: Gotham Book, Arial, sans-serif;
	font-size: 18px;
	line-height: 1.6;
	text-align: center;
}

/* Blog images and videos - add spacing and center alignment */
.content-container.bordered figure,
.content-container.bordered img,
.content-container.bordered video {
	margin-top: 32px;
	margin-bottom: 32px;
	margin-left: auto;
	margin-right: auto;
	display: block;
}

/* Center all images in blog posts */
.content-container.bordered img {
	max-width: 100%;
	height: auto;
	margin-left: auto;
	margin-right: auto;
}

/* Center figure elements in blog posts */
.content-container.bordered figure {
	text-align: center;
	margin-left: auto;
	margin-right: auto;
	display: block;
}

/* Center images inside figures */
.content-container.bordered figure img {
	margin-left: auto;
	margin-right: auto;
	display: block;
}

/* Ensure w-richtext figures are centered in blog posts */
.content-container.bordered .w-richtext figure {
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.content-container.bordered .w-richtext figure img {
	margin-left: auto;
	margin-right: auto;
	display: block;
}

/* Center images in w-richtext-align-center figures */
.content-container.bordered .w-richtext figure.w-richtext-align-center {
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

/* Center images in w-richtext-align-fullwidth figures */
.content-container.bordered .w-richtext figure.w-richtext-align-fullwidth {
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

/* Blog post section titles (h2) - apply yellow color like main title */
.content-container.bordered h2,
.content-container.bordered .w-richtext h2,
.content-container.bordered .rich-text-block-3 h2 {
	font-family: Gotham, Arial, sans-serif;
	color: var(--amp-yellow) !important;
	letter-spacing: -0.02em;
	text-transform: uppercase;
	word-break: normal;
	margin-top: 64px;
	margin-bottom: 24px;
	padding-top: 0;
	padding-bottom: 0;
	font-size: 52px;
	line-height: 1.2;
	font-weight: 700;
	text-align: center; /* Center align like other h2 headings */
}

/* Responsive styles for blog posts */
@media screen and (max-width: 991px) {
	/* Blog post section titles (h2) - responsive tablet */
	.content-container.bordered h2,
	.content-container.bordered .w-richtext h2,
	.content-container.bordered .rich-text-block-3 h2 {
		font-size: 42px;
		margin-bottom: 24px;
	}
}

@media screen and (max-width: 767px) {
	/* Blog post section titles (h2) - responsive mobile */
	.content-container.bordered h2,
	.content-container.bordered .w-richtext h2,
	.content-container.bordered .rich-text-block-3 h2 {
		font-size: 32px;
		margin-bottom: 20px;
	}
}
