:root {
  --font-heading: 'MODERNIZ', sans-serif;
  --font-body: 'Degular', sans-serif;
}

.features-grid {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    /* gap: 24px; */
    width: 90%;
}

@media (min-width: 1024px) {
  .features-grid {
    padding: 42px 0;
  }
}

/* Header Section (Centered at Top) */
.features-grid__header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;

  @media (max-width: 768px) {
    text-align: left;
  }
}

.features-grid__header .section__label {
  display: inline-block;
  margin-bottom: 8px;  
}

.features-grid__header .section__title {
  margin-top: 4px;
  margin-bottom: 12px;
}

/* GRID SPLIT AND ROW*/

.grid-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 24px;
  width: 100%;
}
@media (max-width: 768px) {
  .grid-row {
    flex-direction: column;
  }
}

.grid-row--split {
  display: contents;
  width: 100%;
  align-items: flex-end;
  justify-content: space-between;
}
@media (min-width: 1024px) {
  .grid-row--split {
    flex-direction: row;
    display: flex;
  }
}
.grid-row--split .grid-col {
  transition: transform 0.2s ease;
  display: contents;
}
@media (min-width: 1024px) {
  .grid-row--split .grid-col {
    display: flex;
  }
}
.grid-row--split .grid-col:nth-child(1) {
  flex: 0 0 calc(48% - 6px);
}
@media (min-width: 1024px) {
  .grid-row--split .grid-col:nth-child(1) {
    min-height: 246px;
  }
}
.grid-row--split .grid-col:nth-child(1) .card-content {
  justify-content: flex-end;
}
.grid-row--split .grid-col:nth-child(1) .feature-card {
  padding: 0;
  background: transparent;
  border-color: transparent;
}
.grid-row--split .grid-col:nth-child(2), .grid-row--split .grid-col:nth-child(3) {
  flex: 0 0 calc(25% - 9px);
}
@media (min-width: 1024px) {
  .grid-row--split .grid-col:nth-child(2), .grid-row--split .grid-col:nth-child(3) {
    min-height: 240px;
  }
}
.grid-row--split .grid-col:nth-child(2) .card-content, .grid-row--split .grid-col:nth-child(3) .card-content {
  width: 100%;
}

/* Flexbox Grid Row for Cards */
.grid-row--equal {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  width: 100%;
}

@media (max-width: 768px) {
    .grid-row--equal {
        gap: 0;
    }
}

/* Mobile Default: Full Width Stacked */
.grid-row--equal .grid-col {
  flex: 0 0 100%;
  display: flex;
}

/* Tablet (640px - 1023px): 2 Columns */
@media (min-width: 640px) and (max-width: 1023px) {
  .grid-row--equal .grid-col {
    flex: 0 0 calc(50% - 12px);
  }
}

/* Desktop (1024px+): 3 Columns Top (Cards 1-3), 2 Equal Columns Bottom (Cards 4-5) */
@media (min-width: 1024px) {
  /* Top 3 Cards: 33.333% width each */
  .grid-row--equal .grid-col {
    flex: 0 0 calc(33.333% - 16px);
  }

  /* Bottom 2 Cards: 50% width each to equalize edges with top row */
  .grid-row--equal .grid-col:nth-child(4),
  .grid-row--equal .grid-col:nth-child(5) {
    flex: 0 0 calc(50% - 12px);
  }
}

.grid-row--equal .feature-card {
  width: 100%;
}

.grid-col .feature-card .section__label {
  width: fit-content;
}

/* Mobile Stacking Cards Support */
@media (max-width: 1023px) {
  .feature-card.is-stacking-card {
    position: sticky;
    top: 90px;
  }
}


/* ==========================================================================
   Cambodia Home Page Layout Override (Header Top-Left, Card 01 Top-Right,
   Cards 02 & 03 Bottom Row)
   ========================================================================== */
@media (min-width: 1024px) {
  /* 1. Turn container into CSS Grid */
  .node--type-cambodia-home-page .features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

  /* 2. Position Header in Top-Left and vertically center its content */
  .node--type-cambodia-home-page .features-grid__header {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    text-align: left;
    margin: 0;
    max-width: 100%;
    
    /* Vertically center card-content */
    display: flex;
    flex-direction: column;
    justify-content: center; 
    height: 100%;
  }

  /* Ensure card-content takes full width inside header */
  .node--type-cambodia-home-page .features-grid__header .card-content {
    width: 100%;
  }

  /* 3. Unwrap grid-row flex wrapper for grid placement */
  .node--type-cambodia-home-page .features-grid .grid-row--equal {
    display: contents;
  }

  /* 4. Reset desktop flex basis so grid handles card sizing */
  .node--type-cambodia-home-page .grid-row--equal .grid-col {
    flex: none;
    width: 100%;
  }

  /* 5. Card 01: Top Right */
  .node--type-cambodia-home-page .features-grid .grid-col:nth-child(1) {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
  }

  /* 6. Card 02: Bottom Left */
  .node--type-cambodia-home-page .features-grid .grid-col:nth-child(2) {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
  }

  /* 7. Card 03: Bottom Right */
  .node--type-cambodia-home-page .features-grid .grid-col:nth-child(3) {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
  }
}

.page-node-31 .features-grid__header {
    text-align: left;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}