/**
 * Flexible Page Template Styles
 *
 * Covers the intro section, alternating content rows, content section
 * buttons, "View More" button, and 4-column case studies grid.
 *
 * @package PK30
 */

/* ---------------------------------------------------------------
 * Page Title
 * --------------------------------------------------------------- */
.flexible-page-title {
	text-align: left;
	margin: 40px auto 20px;
	font-size: 2rem;
	font-weight: 600;
}

/* ---------------------------------------------------------------
 * Intro Text
 * --------------------------------------------------------------- */
.flexible-intro-text {
	text-align: left;
	margin: 0 auto 50px;
	font-size: 1.05rem;
	line-height: 1.7;
}

/* ---------------------------------------------------------------
 * Content Sections — alternating image / text rows
 * --------------------------------------------------------------- */
.content-section {
	display: flex;
	align-items: flex-start;
	gap: 24px;
	padding: 100px 0;
	margin: 0;
}

/* ---------------------------------------------------------------
 * Content Section dividers — full-width separators between rows
 * Matches the wp-block-separator style on reference pages.
 * --------------------------------------------------------------- */
.content-section + hr.sep {
	border: none;
	border-top: 2px solid rgb(128, 128, 128);
	margin-top: 16px;
	margin-bottom: 16px;
}

/* Media on the right: reverse the flex order. */
.content-section.media-right {
	flex-direction: row-reverse;
}

.content-section-media,
.content-section-text {
	flex: 1 1 50%;
	min-width: 0; /* prevent flex overflow */
}

.content-section-img {
	width: 100%;
	height: auto;
	display: block;
}

.content-section-video iframe {
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	display: block;
}

.content-section-text {
	padding: 0 100px;
}

.content-section-text h2 {
	margin: 0 0 24px;
	font-size: 1.5rem;
	font-weight: 600;
}

.content-section-body {
	line-height: 1.7;
}

.content-section-body p:last-child {
	margin-bottom: 0;
}

/* ---------------------------------------------------------------
 * Content Section buttons — orange outline style
 * Matches the site's Gutenberg outline button appearance.
 * --------------------------------------------------------------- */
.content-section-btn {
	display: inline-block;
	margin-top: 30px;
	padding: 10px 24px;
	border: 1px solid #f6961d;
	background-color: #fff;
	color: #f6961d;
	font-size: inherit;
	font-weight: 400;
	text-decoration: none;
	transition: background-color 0.3s, color 0.3s;
}

.content-section-btn:after {
	content: " ";
	color: currentColor;
	background-repeat: no-repeat;
	background-position: 50%;
	background-size: 10px;
	vertical-align: middle;
	background-image: url(/wp-content/themes/pk30/img/link-arrow-orange.svg);
	width: 13px;
	height: 13px;
	margin-left: 0.5em;
	display: inline-block;
}

.content-section-btn:hover,
.content-section-btn:focus {
	background-color: #f2f3f3;
	color: #f6961d;
	text-decoration: none;
}

/* ---------------------------------------------------------------
 * Case Studies grid — 4 columns on the flexible page template
 * Clean card style: no gradient overlay, black text below image.
 * Dual selectors cover both pages and system CPT posts.
 * --------------------------------------------------------------- */
.page-template-flexible-page .sim-proj-wrap .sim-link,
.system-template-flexible-page .sim-proj-wrap .sim-link {
	width: calc(25% - 25px);
}

.page-template-flexible-page .sim-proj-wrap .sim-link .title,
.system-template-flexible-page .sim-proj-wrap .sim-link .title {
	font-weight: 600;
	line-height: 1.1;
	padding-bottom: 8px;
	color: #000;
}

.page-template-flexible-page .sim-proj-wrap .sim-link .caption,
.system-template-flexible-page .sim-proj-wrap .sim-link .caption {
	font-size: 14px;
	position: static;
	line-height: 1.1;
	padding: 6px 0 0;
	color: #000;
}

/* Disable the dark gradient overlay — use clean cards instead. */
.page-template-flexible-page .sim-proj-wrap .sim-link:before,
.system-template-flexible-page .sim-proj-wrap .sim-link:before {
	display: none;
}

/* ---------------------------------------------------------------
 * Case Studies — "View More" button
 * Same orange-outline style as content section buttons.
 * --------------------------------------------------------------- */
.case-studies-view-more {
	text-align: center;
	margin: 30px 0 0;
}

.view-more-btn {
	display: inline-block;
	padding: 12px 32px;
	border: 1px solid #f6961d;
	background-color: #fff;
	color: #f6961d;
	font-weight: 400;
	text-decoration: none;
	transition: background-color 0.3s, color 0.3s;
}

.view-more-btn:after {
	content: " ";
	color: currentColor;
	background-repeat: no-repeat;
	background-position: 50%;
	background-size: 10px;
	vertical-align: middle;
	background-image: url(/wp-content/themes/pk30/img/link-arrow-orange.svg);
	width: 13px;
	height: 13px;
	margin-left: 0.5em;
	display: inline-block;
}

.view-more-btn:hover,
.view-more-btn:focus {
	background-color: #f2f3f3;
	color: #f6961d;
	text-decoration: none;
}

/* ---------------------------------------------------------------
 * Responsive — stack on smaller screens
 * --------------------------------------------------------------- */
@media (max-width: 768px) {
	.content-section,
	.content-section.media-right {
		flex-direction: column;
	}

	.content-section-media,
	.content-section-text {
		flex-basis: 100%;
	}

	.flexible-page-title {
		font-size: 1.5rem;
		margin: 30px auto 15px;
	}

	.flexible-intro-text {
		margin-bottom: 30px;
	}

	.content-section {
		padding: 40px 0;
		gap: 25px;
	}

	.content-section-text {
		padding: 0;
	}

	.page-template-flexible-page .sim-proj-wrap .sim-link,
	.system-template-flexible-page .sim-proj-wrap .sim-link {
		width: 100%;
	}
}
