/*
 * Feature pages (/features/geelark-ai/, AI tools, model pages, automation,
 * synchronizer, team collaboration, API). Loaded after landing.css; every
 * rule is scoped to .feat-page (set on <main> in templates/page-<slug>.html)
 * or to feat-* classes that only these pages use.
 */

/* ---------- Shared: section rhythm (reference rows use 60px top and bottom) ---------- */

.feat-page > .geelark-section:not(.geelark-hero-section):not(.geelark-cta-section) {
	padding-block: 60px;
}

@media (max-width: 781px) {
	.feat-page > .geelark-section:not(.geelark-hero-section):not(.geelark-cta-section) {
		padding-block: 40px;
	}
}

/* ---------- Shared: linked tool tiles and model chips ---------- */

.feat-page .geelark-feature-tile,
.feat-page .geelark-tool-row,
.feat-page .geelark-model-tile {
	position: relative;
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.feat-page .geelark-feature-tile .wp-block-heading a,
.feat-page .geelark-tool-row .wp-block-heading a,
.feat-page .geelark-model-tile .wp-block-heading a {
	color: inherit;
	text-decoration: none;
}

/* The heading link covers the whole tile. */
.feat-page .geelark-feature-tile .wp-block-heading a::after,
.feat-page .geelark-tool-row .wp-block-heading a::after,
.feat-page .geelark-model-tile .wp-block-heading a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.feat-page .geelark-feature-tile:hover,
.feat-page .geelark-tool-row:hover {
	box-shadow: 0 6px 20px rgba(11, 61, 145, 0.1);
}

.feat-page .geelark-model-tile:hover {
	background: var(--wp--preset--color--tint);
}

.feat-page .geelark-feature-tile .wp-block-heading a:focus-visible,
.feat-page .geelark-tool-row .wp-block-heading a:focus-visible,
.feat-page .geelark-model-tile .wp-block-heading a:focus-visible {
	outline: 0;
}

.feat-page .geelark-feature-tile:has(a:focus-visible),
.feat-page .geelark-tool-row:has(a:focus-visible),
.feat-page .geelark-model-tile:has(a:focus-visible) {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

.feat-page .geelark-models:has(.is-named) {
	gap: 12px 16px;
	justify-content: center !important;
	padding-inline: 0;
}

.feat-page .geelark-model-badge.is-named {
	display: block;
	width: auto;
	height: auto;
	padding: 0;
	background: none;
	font-size: 0.875rem;
	line-height: 1;
}

.feat-page .geelark-model-badge.is-named a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--golos);
	font-weight: 500;
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.feat-page .geelark-model-badge.is-named a::before {
	content: "";
	width: 18px;
	height: 18px;
	border-radius: 5px;
	background: linear-gradient(135deg, #5aa2ff, #0170f9);
}

.feat-page .geelark-model-badge.is-named:nth-child(even) a::before {
	background: linear-gradient(135deg, #ffb066, #ff6a00);
}

.feat-page .geelark-model-badge.is-named a:hover,
.feat-page .geelark-model-badge.is-named a:focus-visible {
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

/* Demo panels: the label is a paragraph (not a heading) so the outline
   keeps the reference's heading order. */
.feat-page .geelark-demo-title {
	margin: 0 0 0.5rem !important;
	font-family: var(--wp--preset--font-family--golos);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 600;
	line-height: 1.2;
	color: var(--wp--preset--color--contrast);
}

/* ---------- Shared: blog carousel (resources sections) ---------- */

.feat-carousel {
	position: relative;
	margin-top: 2.5rem !important;
}

.feat-carousel .feat-carousel-track {
	display: grid !important;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 60px) / 3);
	gap: 30px;
	margin: 0;
	padding: 4px 4px 12px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	position: relative;
}

.feat-carousel .feat-carousel-track::-webkit-scrollbar {
	display: none;
}

.feat-carousel .feat-carousel-track > li {
	position: relative;
	margin: 0;
	scroll-snap-align: start;
}

.feat-post-card {
	height: 100%;
	padding-bottom: 20px;
	border-radius: 12px;
	background: var(--wp--preset--color--base);
}

.feat-post-card .wp-block-post-featured-image {
	margin: 0 0 1rem;
	overflow: hidden;
	border-radius: 12px;
}

.feat-post-card .wp-block-post-featured-image img {
	transition: transform 0.3s ease;
}

.feat-post-card:hover .wp-block-post-featured-image img {
	transform: scale(1.03);
}

.feat-post-card .feat-post-title {
	margin: 0 0 0.5rem;
	font-family: var(--wp--preset--font-family--golos);
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.35;
}

.feat-post-card .feat-post-title a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.feat-post-card .feat-post-title a:hover {
	color: var(--wp--preset--color--primary);
}

.feat-post-card .wp-block-post-excerpt {
	margin: 0 0 0.75rem;
	font-size: var(--wp--preset--font-size--small);
}

.feat-post-card .wp-block-post-excerpt__excerpt {
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.feat-post-card .wp-block-read-more {
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}

.feat-carousel-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 1.25rem;
}

.feat-carousel-nav[hidden] {
	display: none;
}

.feat-carousel-dots {
	display: flex;
	gap: 6px;
}

.feat-carousel-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #cbd5e1;
	cursor: pointer;
	transition: width 0.2s ease, background-color 0.2s ease;
}

.feat-carousel-dot.is-active {
	width: 20px;
	background: var(--wp--preset--color--primary);
}

.feat-carousel-arrow {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
}

.feat-carousel-arrow:disabled {
	opacity: 0.4;
	cursor: default;
}

.feat-carousel-dot:focus-visible,
.feat-carousel-arrow:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

@media (max-width: 1023px) {
	.feat-carousel .feat-carousel-track {
		grid-auto-columns: calc((100% - 30px) / 2);
	}
}

@media (max-width: 600px) {
	.feat-carousel .feat-carousel-track {
		grid-auto-columns: 86%;
		gap: 16px;
	}
}

/* ---------- Model pages (Seedance, Veo, KLING, Nano Banana, Hailuo) ---------- */

.feat-model-hero {
	padding-block: 80px 70px !important;
}

.feat-model-hero h1,
.feat-model-hero .has-lead-font-size {
	max-width: 480px;
}

.feat-model-overview,
.feat-model-create {
	padding-top: 128px !important;
}

.feat-model-hero .geelark-kicker {
	margin-bottom: 1rem !important;
}

.feat-model-hero .geelark-media {
	background: none;
}

.feat-model-hero .wp-block-buttons {
	margin-top: 2rem !important;
	padding-bottom: 2rem;
	border-bottom: 1px solid #e2e8f0;
	max-width: 560px;
}

.feat-model-overview .wp-block-columns {
	gap: 48px;
}

.feat-model-overview .geelark-lead-muted + .geelark-lead-muted {
	margin-top: 0.75rem !important;
}

.feat-spec-table {
	margin: 0;
}

.feat-spec-table table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.feat-spec-table th,
.feat-spec-table td {
	padding: 10px 12px;
	border: 0;
	text-align: left;
	vertical-align: top;
	color: var(--wp--preset--color--contrast);
}

.feat-spec-table thead th {
	font-weight: 600;
	border-bottom: 1px solid #e2e8f0;
}

.feat-spec-table tbody tr:nth-child(odd) td {
	background: var(--wp--preset--color--card, #f7f9fc);
}

.feat-spec-table td:first-child {
	width: 42%;
	color: var(--wp--preset--color--secondary);
}

.feat-spec-table figcaption {
	margin-top: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #e2e8f0;
	color: var(--wp--preset--color--secondary);
	font-size: 0.8125rem;
	font-style: italic;
	text-align: center;
}

.feat-create-tabs {
	margin-top: 2rem !important;
}

.feat-create-tabs .geelark-tab-list {
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #e2e8f0;
}

.feat-create-tabs .geelark-tab-panel .wp-block-columns {
	gap: 48px;
	margin-top: 1.5rem;
}

.feat-create-tabs .geelark-tab-panel h3 {
	margin-bottom: 0.75rem;
}

.feat-model-more .geelark-feature-tiles {
	max-width: 880px;
	margin-inline: auto !important;
}

.feat-model-chips {
	margin-top: 2.5rem !important;
}

@media (max-width: 781px) {
	.feat-model-hero {
		padding-block: 48px 24px !important;
	}

	.feat-model-overview,
	.feat-model-create {
		padding-top: 64px !important;
	}

	.feat-model-hero .geelark-hero {
		gap: 24px;
	}

	.feat-model-overview .wp-block-columns,
	.feat-create-tabs .geelark-tab-panel .wp-block-columns {
		gap: 24px;
	}

	.feat-create-tabs .geelark-tab-list {
		overflow-x: auto;
		flex-wrap: nowrap !important;
	}

	.feat-create-tabs .geelark-tab {
		white-space: nowrap;
	}
}

/* ---------- Phones: centred heroes and separate step cards (as on the reference) ---------- */

@media (max-width: 599px) {
	.feat-model-hero .geelark-hero > .wp-block-column:first-child,
	.feat-team-collaboration .geelark-hero-section .wp-block-column:first-child {
		text-align: center;
	}

	.feat-model-hero h1,
	.feat-model-hero .has-lead-font-size {
		margin-inline: auto;
	}

	.feat-model-hero .wp-block-buttons {
		flex-direction: column;
		align-items: center;
		margin-inline: auto;
	}

	.feat-model-workflow .geelark-joined-steps {
		gap: 16px !important;
		overflow: visible;
		border: 0;
	}

	.feat-model-workflow .geelark-joined-step,
	.feat-model-workflow .geelark-joined-step + .geelark-joined-step {
		border: 2px solid #edf2f7;
		border-radius: 16px;
	}
}

/* ---------- Tablets (600-781px): the reference keeps multi-column rows ---------- */

@media (min-width: 600px) and (max-width: 781px) {
	.feat-page .wp-block-columns:not(.is-not-stacked-on-mobile) {
		flex-wrap: nowrap !important;
		gap: 32px;
	}

	.feat-page .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
		flex-basis: 0 !important;
		flex-grow: 1;
	}

	.feat-page .wp-block-group.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	.feat-page .wp-block-group.is-layout-grid:has(> :nth-child(3):last-child),
	.feat-page .wp-block-group.is-layout-grid:has(> :nth-child(6):last-child) {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}

	.feat-page .geelark-joined-step + .geelark-joined-step {
		border-top: 0;
		border-left: 2px solid #edf2f7;
	}

	.feat-page .geelark-joined-steps.is-four .geelark-joined-step:nth-child(3) {
		border-left: 0;
	}

	.feat-page .geelark-joined-steps.is-four .geelark-joined-step:nth-child(n + 3) {
		border-top: 2px solid #edf2f7;
	}
}
