/* XERF Section 5 – Results, Benefits & Dual Feature cards
   - Core blocks only (Group, Columns, Image, Heading, Paragraph, List)
   - Image placeholders use core/image with empty src (Media Library upload UI)
   - Layout encoded via core/columns with explicit widths (40/60, 60/40)
*/

:root{
  --x5-brand: #8B2332;
  --x5-accent: #D4AF37;
  --x5-dark: #1C1C1C;
  --x5-text: #2A2A2A;
  --x5-muted: #6F6F6F;
  --x5-soft: #FAF7F2;
  --x5-light-bg: #FDFCFA;
  --x5-max: 1400px;
}

/* ---------------- Shared inner containers ---------------- */
.x5-inner,
.x5-hero-container{
  max-width: var(--x5-max);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 80px);
}

/* ==================== HERO ==================== */
.x5-hero{
  background: linear-gradient(180deg, #F3E6DA 0%, #FAF7F2 100%);
  padding-block: clamp(60px, 8vw, 100px);
}

.x5-hero-row{
  gap: 40px;
}

.x5-hero-title{
  margin: 0 0 16px;
  font-weight: 600;
  color: var(--x5-dark);
  line-height: 1.2;
  font-size: clamp(24px, 3.5vw, 32px);
}

.x5-hero-desc{
  margin: 0 0 12px;
  font-size: clamp(14px, 1.6vw, 16px);
  color: var(--x5-text);
  line-height: 1.8;
}

/* Image styling: default = pure image (no frame). Placeholder frame only when src is empty. */
figure.x5-hero-image{
  width: 100%;
  margin: 0;
  border: none;
  padding: 0;
  background: none;
  border-radius: 12px;
  overflow: hidden;
}
figure.x5-hero-image img{
  width: 100%;
  height: auto;
  display: block;
}
/* Placeholder frame for empty image in editor */
figure.x5-hero-image:has(img[src=""]),
.editor-styles-wrapper figure.x5-hero-image:has(img[src=""]){
  aspect-ratio: 7 / 8;
  background: #f5f5f5;
  border: 2px dashed #ddd;
  padding: 16px;
}

/* ==================== BENEFITS ==================== */
.x5-benefits{
  background: #fff;
  padding-block: clamp(60px, 8vw, 100px);
}

.x5-benefits-title{
  text-align: center;
  font-weight: 700;
  color: var(--x5-dark);
  font-size: clamp(24px, 3.5vw, 36px);
  margin: 0 0 40px;
}

/* Use Columns for grid, just refine spacing/visuals */
.x5-benefits-grid{
  gap: 30px;
}

.x5-benefit-item{
  background: var(--x5-light-bg);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  transition: transform .3s ease, box-shadow .3s ease;
  position: relative;
}

.x5-benefit-item:hover{
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

/* Icon via pseudo element */
.x5-benefit-item::before{
  content: "✓";
  position: absolute;
  top: 16px;
  left: 16px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--x5-brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.x5-benefit-text{
  margin: 0;
  padding-left: 34px; /* space for icon */
  font-size: clamp(14px, 1.5vw, 16px);
  color: var(--x5-text);
  line-height: 1.8;
}

/* ==================== DUAL FEATURE SECTIONS ==================== */
.x5-dual-features{
  background: linear-gradient(135deg, var(--x5-light-bg) 0%, #ffffff 100%);
  padding-block: clamp(60px, 8vw, 100px);
}

/* Container: try grid gap first, but we’ll also add a robust sibling-gap below */
.x5-dual-container{
  display: grid !important;
  row-gap: clamp(48px, 6vw, 80px) !important;
}

/* Neutralize theme block-gap margins that can collapse with our spacing */
.x5-dual-container > .wp-block-group{ margin: 0 !important; }
.editor-styles-wrapper .x5-dual-container > .wp-block-group{ margin: 0 !important; }

/* Card shell */
.x5-feature-card{
  margin: 0;
  background: #fff;
  border-radius: 16px;
  padding: clamp(24px, 4vw, 40px);
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.editor-styles-wrapper .x5-feature-card{ margin: 0; }

.x5-feature-columns{
  gap: 40px;
}

/* Core/image inside feature card: pure image by default */
figure.x5-feature-image{
  width: 100%;
  margin: 0;
  background: none;
  border-radius: 12px;
  border: none;
  padding: 0;
  overflow: hidden;
}
figure.x5-feature-image img{
  width: 100%;
  height: auto;
  display: block;
}
/* Placeholder frame when no image has been selected yet */
figure.x5-feature-image:has(img[src=""]),
.editor-styles-wrapper figure.x5-feature-image:has(img[src=""]){
  aspect-ratio: 2860 / 1376; /* keeps an inviting upload box shape */
  background: #f5f5f5;
  border: 2px dashed #ddd;
  padding: 16px;
}

.x5-feature-tag{
  display: inline-block;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--x5-brand);
  font-size: clamp(16px, 1.8vw, 20px);
  font-weight: 700;
  color: var(--x5-dark);
}

.x5-feature-title{
  margin: 0 0 12px;
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 700;
  color: var(--x5-dark);
  line-height: 1.3;
}

.x5-feature-desc{
  margin: 0 0 10px;
  font-size: clamp(14px, 1.5vw, 16px);
  color: var(--x5-text);
  line-height: 1.8;
}

.x5-feature-note{
  margin: 12px 0 0;
  font-size: clamp(13px, 1.4vw, 14px);
  color: var(--x5-muted);
  font-style: italic;
}

/* Custom list style */
.x5-feature-list{
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.x5-feature-list li{
  position: relative;
  padding-left: 26px;
  font-size: clamp(14px, 1.5vw, 16px);
  color: var(--x5-text);
  line-height: 1.6;
}
.x5-feature-list li::before{
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--x5-brand);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px){
  .x5-hero-row{ gap: 30px; }
  .x5-feature-columns{ gap: 30px; }
  .x5-dual-container{ row-gap: clamp(28px, 5vw, 48px); }
}
@media (max-width: 782px){
  .x5-inner,
  .x5-hero-container{ padding-inline: 20px; }
  .x5-benefits-title{ margin-bottom: 30px; }
  figure.x5-hero-image{ max-width: 300px; }
}

/* ==================== Robust hard-gap (theme-proof) ==================== */
/* Ensure a consistent vertical gap even if Kadence overrides container layout */
.x5-dual-container > .wp-block-group.x5-feature-card + .wp-block-group.x5-feature-card,
.editor-styles-wrapper .x5-dual-container > .wp-block-group.x5-feature-card + .wp-block-group.x5-feature-card{
  margin-top: clamp(48px, 6vw, 80px) !important; /* exact space between the two cards */
}

/* Extra safety: ensure gap even if container class is altered */
.x5-dual-features .x5-feature-card + .x5-feature-card{
  margin-top: clamp(48px, 6vw, 80px) !important;
}
