/* style.css - Feature Grid block (provenworks/feature-grid +
 * provenworks/feature-item). Registered via block.json's "style" field, so
 * only loaded when the block is present. Legacy feature-text/feature-row/
 * stat-item/icon-panel CSS (separate static patterns) is in
 * assets/css/patterns/features.css.
 */

.pw-feature-item {
	display:        flex;
	flex-direction: column;
	gap:            0.625rem;
	box-sizing:     border-box;
}

.pw-feature-item > * {
	margin-block: 0;
}

.pw-feature-item-image {
	display:         flex;
	align-items:     center;
	justify-content: center;
	width:           100%;
	min-height:      9rem;
	aspect-ratio:    16 / 9;
	margin:          0 0 0.75rem;
	padding:         0;
	overflow:        hidden;
	background:      transparent;
	border:          0;
	border-radius:   calc(var(--card-radius) / 2);
	box-shadow:      none;
	cursor:          pointer;
}

figure.pw-feature-item-image {
	cursor: default;
}

.pw-feature-item-image img {
	display:    block;
	width:      100%;
	height:     100%;
	object-fit: contain;
}

.pw-feature-item-image__placeholder {
	display:         flex;
	align-items:     center;
	justify-content: center;
	width:           100%;
	height:          100%;
	padding:         1rem;
	color:           var(--color-text-muted);
	background:      var(--color-brand-primary-tint);
	border:          1px dashed var(--color-border);
	border-radius:   inherit;
	box-sizing:      border-box;
}

.pw-feature-item .pw-feature-item-body > * {
	margin-block: 0.5em;
}

.pw-feature-item .pw-feature-item-body > *:first-child {
	margin-top: 0;
}

.pw-feature-item .wp-block-buttons {
	margin-top:  auto;
	padding-top: var(--space-sm);
}

.pw-feature-items > .wp-block-buttons {
	grid-column:     1 / -1;
	order:           2;
	justify-content: center;
	margin:          clamp(0.75rem, 2vw, 1.5rem) 0 0;
	padding-top:     var(--space-sm);
}

.pw-feature-item-list {
	display:        flex;
	flex-direction: column;
	gap:            0.75rem;
	margin:         0.25rem 0 0;
	padding:        0;
	list-style:     none;
}

.pw-feature-item-bullet {
	display:     flex;
	align-items: flex-start;
	gap:         0.75rem;
	line-height: var(--line-height-relaxed);
}

.pw-feature-item-bullet::before {
	content:     "\2022";
	flex:        0 0 1.125rem;
	font-size:   1.2em;
	font-weight: 800;
	line-height: 1.35;
	text-align:  center;
}

.pw-feature-item-bullet--tick::before {
	content: "\2713";
	color:   var(--color-brand-primary);
}

.pw-feature-item-bullet--cross::before {
	content: "\00D7";
	color:   var(--color-text-subtle);
}

.pw-feature-item--muted {
	filter: saturate(0.2);
}

.pw-feature-items--card .pw-feature-item.pw-feature-item--muted {
	border-color: var(--color-border);
	box-shadow:   none;
}

.pw-feature-section .pw-feature-items--card .pw-feature-item.pw-feature-item--muted :is(.pw-feature-item-title, .pw-feature-item-body, .pw-feature-item-bullet) {
	color: var(--color-text-muted) !important;
}

.block-editor-block-list__block .pw-feature-item-bullet {
	align-items: center;
}

.block-editor-block-list__block .pw-feature-item-bullet-style {
	display:       flex;
	flex:          0 0 auto;
	align-self:    flex-start;
	border:        1px solid var(--color-border);
	border-radius: 4px;
	overflow:      hidden;
}

.block-editor-block-list__block .pw-feature-item-bullet-style .components-button {
	min-width:     2rem;
	height:        2rem;
	padding:       0.25rem;
	border-radius: 0;
}

.block-editor-block-list__block .pw-feature-item-bullet-text {
	flex: 1 1 auto;
}

.pw-feature-item-add-bullet {
	align-self: flex-start;
}

.pw-feature-item-support-text {
	display: none;
}

.pw-feature-grid-editor-actions {
	display:         flex;
	justify-content: center;
	gap:             0.75rem;
	margin-top:      1.5rem;
	padding-top:     1rem;
	border-top:      1px dashed var(--color-border);
}

.pw-feature-grid-panel-actions {
	display:        flex;
	flex-direction: column;
	align-items:    stretch;
	gap:            0.75rem;
}

.pw-feature-items > .block-editor-inner-blocks,
.pw-feature-items > .block-editor-inner-blocks > .block-editor-block-list__layout {
	display: contents;
}

.pw-feature-items > .block-editor-inner-blocks > .block-editor-block-list__layout > .block-editor-block-list__block:has(.wp-block-buttons) {
	order:       2;
	grid-column: 1 / -1;
}

/* Plain-text item styles (like the old feature-text-3/4). "Subtle" keeps
 * the green top rule; "Text only" drops it entirely. */
.pw-feature-items--subtle .pw-feature-item,
.pw-feature-items--text-only .pw-feature-item {
	padding-top: 1.25rem;
}

.pw-feature-items--subtle .pw-feature-item {
	border-top: 2px solid var(--color-brand-primary);
}

.pw-feature-items--subtle .pw-feature-item-body,
.pw-feature-items--text-only .pw-feature-item-body {
	color:       var(--color-text-muted);
	line-height: var(--line-height-relaxed);
}

/* Card item style (like the old feature-cards-4/feature-cards/feature-usecases-6) */
.pw-feature-items--card .pw-feature-item {
	background-color: var(--card-bg);
	border-radius:     var(--card-radius);
	border:            1px solid var(--card-border-color);
	box-shadow:        var(--card-shadow);
	padding:           var(--card-padding);
	border-top:        3px solid var(--color-brand-primary);
	align-self:        stretch;
	transition:        box-shadow var(--transition-base), transform var(--transition-base);
}

.pw-feature-items--card .pw-feature-item-body {
	color:       var(--color-text-muted);
	line-height: var(--line-height-relaxed);
}

/* Support-centre cards: logo, subtext, divider, description and CTA. */
.pw-feature-items--support-centre .pw-feature-item {
	position:         relative;
	align-items:      center;
	align-self:       stretch;
	gap:              0;
	padding:          clamp(1.75rem, 3vw, 2.5rem) var(--card-padding) 1.5rem;
	overflow:         hidden;
	text-align:       center;
	background-color: var(--card-bg);
	border:           1px solid var(--card-border-color);
	border-radius:    var(--card-radius);
	box-shadow:       var(--card-shadow);
}

.pw-feature-items--support-centre .pw-feature-item::after {
	position:         absolute;
	right:            0;
	bottom:           0;
	left:             0;
	height:           0.5rem;
	content:          "";
	background-color: var(--color-brand-primary);
}

.pw-feature-items--support-centre .pw-feature-item-image {
	width:         calc(100% + var(--card-padding) + var(--card-padding));
	height:        3.5rem;
	min-height:    0;
	margin:        0 calc(var(--card-padding) * -1);
	aspect-ratio:  auto;
	border-radius: 0;
}

.pw-feature-items--support-centre .pw-feature-item-image img {
	width:     auto;
	height:    2.5rem;
	max-width: 100%;
}

.pw-feature-items--support-centre .pw-feature-item-support-text {
	display:        block;
	width:          min(100%, 14rem);
	margin:         0.5rem auto 0;
	padding-bottom: 1rem;
	color:          var(--color-heading);
	font-size:      1rem;
	font-weight:    600;
	line-height:    1.3;
	border-bottom:  1px solid var(--color-border);
}

.pw-feature-items--support-centre .pw-feature-item-title {
	display: none;
}

.pw-feature-items--support-centre .pw-feature-item-body {
	flex:          1 1 auto;
	width:         100%;
	margin-top:    0;
	padding:       1.25rem 0;
	color:         var(--color-text-muted);
	line-height:   var(--line-height-relaxed);
	border-bottom: 1px solid var(--color-border);
}

.pw-feature-items--support-centre .pw-feature-item .wp-block-buttons {
	justify-content: center;
	width:           100%;
	margin-top:      0;
	padding:         1rem 0 0.25rem;
}

:is(.is-style-section-white, .is-style-section-subtle, .is-style-section-green-lighter, .is-style-section-green-light, .is-style-section-green-700) .pw-feature-items--support-centre .pw-feature-item .pw-feature-item-support-text {
	color: var(--color-heading) !important;
}

:is(.is-style-section-white, .is-style-section-subtle, .is-style-section-green-lighter, .is-style-section-green-light, .is-style-section-green-700) .pw-feature-items--support-centre .pw-feature-item .pw-feature-item-body {
	color: var(--color-text-muted) !important;
}

/* Cards keep dark text regardless of the section background switcher — same
   principle/!important rationale as the generic .card rule in components.css. */
:is(.is-style-section-white, .is-style-section-subtle, .is-style-section-green-lighter, .is-style-section-green-light, .is-style-section-green-700) .pw-feature-items--card .pw-feature-item :is(h1, h2, h3, h4, h5, h6, .wp-block-heading) {
	color: var(--color-heading) !important;
}

:is(.is-style-section-white, .is-style-section-subtle, .is-style-section-green-lighter, .is-style-section-green-light, .is-style-section-green-700) .pw-feature-items--card .pw-feature-item :is(p, li, .wp-block-paragraph, .pw-feature-item-body) {
	color: var(--color-text-muted) !important;
}

:is(.is-style-section-white, .is-style-section-subtle, .is-style-section-green-lighter, .is-style-section-green-light, .is-style-section-green-700) .pw-feature-items--card .pw-feature-item :is(a, .wp-block-paragraph a):not(.wp-block-button__link) {
	color: var(--color-link) !important;
}

/* Header (eyebrow/heading/intro) hidden — cards sit flush against
   whatever section precedes this block. */
.pw-feature-section--no-header {
	padding-block-start: 0;
}
