/*
Theme Name: NF Impact Theme
Text Domain: impact-theme
Version: 1.0.1
*/

/* Gardein heading style */
.wp-block-heading.is-style-gardein,
.wp-block-heading.is-style-gardein.has-huge-heading-font-size,
.wp-block-heading.is-style-gardein.has-heading-1-font-size,
.wp-block-heading.is-style-gardein.has-heading-2-font-size,
.wp-block-heading.is-style-gardein.has-heading-3-font-size,
.wp-block-heading.is-style-gardein.has-heading-4-font-size,
.wp-block-heading.is-style-gardein.has-heading-small-font-size {
  font-family: gardein, sans-serif !important;
  font-weight: 800 !important;
  line-height: 0.94 !important;
}

.wp-block-heading.is-style-gardein.has-number::after {
    display: none !important;
}

/* Huge Heading font weight */
.wp-block-heading.has-huge-heading-font-size {
  font-weight: 800 !important;
  font-size: clamp(88px, 8vw, 148px) !important;
}

/* Tree Bottom Morphing Animation */
#tree-bottom-container svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Growth heading style */
.wp-block-heading.is-style-growth {
  position: relative;
  display: inline-block;
}

.wp-block-heading.is-style-growth::after {
  content: '';
  display: inline-block;
  vertical-align: baseline;
  margin-left: 0.5em;
  /* position: absolute; */
  top: 50%;
  width: 2em; /* Scale with font size */
  height: 1.36em; /* Maintain SVG aspect ratio (96.52/141.095 ≈ 0.68) */
  background-image: url('app/assets/images/growth.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  /* transform: translateY(-50%); */
  pointer-events: none;
}

/* Gardein & Growth heading style */
.wp-block-heading.is-style-gardein-growth {
  position: relative;
  display: inline-block;
  font-family: "gardein", sans-serif !important;
}

.wp-block-heading.is-style-gardein-growth::after {
  content: '';
  display: inline-block;
  vertical-align: baseline;
  margin-left: 0.5em;
  /* position: absolute; */
  top: 50%;
  width: 2em; /* Scale with font size */
  height: 1.36em; /* Maintain SVG aspect ratio (96.52/141.095 ≈ 0.68) */
  background-image: url('app/assets/images/growth.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  /* transform: translateY(-50%); */
  pointer-events: none;
}

@media (max-width: 768px) {
  .wp-block-heading.is-style-gardein-growth::after {
    width: 1.5em;
    height: 1em;
    /* position: absolute; */
    top: unset;
  }
}

/* Maada heading style */
.wp-block-heading.is-style-maada {
  position: relative;
  display: inline-block;
  font-family: "gardein", sans-serif !important;
}

.wp-block-heading.is-style-maada::after {
  content: '';
  display: inline-block;
  vertical-align: baseline;
  margin-left: 0.5em;
  /* position: absolute; */
  top: 50%;
  width: 2em; /* Scale with font size */
  height: 1.43em; /* Maintain SVG aspect ratio (178.05/127.298 ≈ 1.4) */
  background-image: url('app/assets/images/maada-flower.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  /* transform: translateY(-50%); */
  pointer-events: none;
}

@media (max-width: 768px) {
  .wp-block-heading.is-style-maada::after {
    width: 1.5em;
    height: 1em;
    position: absolute;
    top: unset;
  }
}

/* List Link heading style */
.wp-block-heading.is-style-list-link {
  position: relative;
  display: flex;
  justify-content: space-between;
  background-color: transparent !important;
  border-bottom: 3px solid currentColor;
  font-weight: 600;
  padding-top: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 0;
  max-width: 420px;
  text-transform: uppercase;
}




/* Remove border from last List Link heading */
.wp-block-heading.is-style-list-link:last-child {
  border-bottom: none;
}

.wp-block-heading.is-style-list-link::after {
  content: '';
  display: inline-block;
  vertical-align: baseline;
  margin-left: 0.5em;
  width: 1em; /* Scale with font size */
  height: 1em; /* Square aspect ratio */
  mask-image: url('app/assets/images/link-arrow.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  background-color: var(--list-link-arrow-color, var(--wp--preset--color--sky-blue, #60C2EA)); /* Custom color or default */
  pointer-events: none;
  transition: transform 0.3s ease-in-out;
}

.wp-block-heading.is-style-list-link a:hover {
    color: currentColor !important;
}

.wp-block-heading.is-style-list-link:hover::after {
    transform: translateX(-10px);
}


/* Background color matching for List Link - Using exact hex values */
.wp-block-heading.is-style-list-link.has-red-background-color::after {
  background-color: #E34346 !important;
}

.wp-block-heading.is-style-list-link.has-orange-background-color::after {
  background-color: #FF5624 !important;
}

.wp-block-heading.is-style-list-link.has-yellow-background-color::after {
  background-color: #FF9E2E !important;
}

.wp-block-heading.is-style-list-link.has-green-background-color::after {
  background-color: #78C655 !important;
}

.wp-block-heading.is-style-list-link.has-sky-blue-background-color::after {
  background-color: #60C2EA !important;
}

.wp-block-heading.is-style-list-link.has-blue-background-color::after {
  background-color: #013465 !important;
}

.wp-block-heading.is-style-list-link.has-dark-blue-background-color::after {
  background-color: #012854 !important;
}

/* List Link SVG Injection Script */

/* WordPress Flex Layout Support */
.wp-block-group.is-layout-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wp--style--block-gap, 0.5em);
}

.wp-block-group.is-layout-flex.is-nowrap {
  flex-wrap: nowrap;
}

.wp-block-group.is-layout-flex.is-vertical {
  flex-direction: column;
}

.wp-block-group.is-layout-flex.is-content-justification-left {
  justify-content: flex-start;
}

.wp-block-group.is-layout-flex.is-content-justification-center {
  justify-content: center;
}

.wp-block-group.is-layout-flex.is-content-justification-right {
  justify-content: flex-end;
}

.wp-block-group.is-layout-flex.is-content-justification-space-between {
  justify-content: space-between;
}

/* WordPress Grid Layout Support */
.wp-block-group.is-layout-grid {
  display: grid;
  gap: var(--wp--style--block-gap, 0.5em);
}

/* Flex item controls */
.wp-block-group.is-layout-flex > * {
  margin: 0;
}

.wp-block-group.is-layout-flex > .wp-block {
  margin: 0;
}

/* Flex grow/shrink controls */
.wp-block-group.is-layout-flex > .wp-block[style*="flex-grow"] {
  flex-grow: var(--wp--style--flex-grow, 1);
}

.wp-block-group.is-layout-flex > .wp-block[style*="flex-shrink"] {
  flex-shrink: var(--wp--style--flex-shrink, 1);
}

/* WordPress flex basis controls */
.wp-block-group.is-layout-flex > .wp-block[style*="flex-basis"] {
  flex-basis: var(--wp--style--flex-basis, auto);
}

/* Specific flex grow classes that WordPress might generate */
.wp-block-group.is-layout-flex > .wp-block.has-flex-grow {
  flex-grow: 1;
}

.wp-block-group.is-layout-flex > .wp-block.has-flex-shrink {
  flex-shrink: 1;
}

/* Force flex items to respect their flex properties */
.wp-block-group.is-layout-flex > * {
  flex: 0 1 auto;
}

.wp-block-group.is-layout-flex > *[style*="flex-grow: 1"] {
  flex: 1 1 auto;
}

/* Additional selectors for WordPress flex grow */
.wp-block-group.is-layout-flex > *[style*="--wp--style--layout--flex-grow: 1"] {
  flex-grow: 1;
}

.wp-block-group.is-layout-flex > .wp-block-group[style*="flex-grow"] {
  flex-grow: 1;
}

/* More comprehensive flex-grow selectors */
.wp-block-group.is-layout-flex > *[style*="width"] {
  /* Check if WordPress is using width instead of flex-grow */
}

.wp-block-group.is-layout-flex > *[class*="grow"] {
  flex-grow: 1 !important;
}

.wp-block-group.is-layout-flex > *[class*="fill"] {
  flex-grow: 1 !important;
}

/* WordPress might use these data attributes or classes */
.wp-block-group.is-layout-flex > *[data-layout-width="grow"] {
  flex-grow: 1 !important;
}

.wp-block-group.is-layout-flex > .has-layout-width-grow {
  flex-grow: 1 !important;
}

/* Catch any CSS custom property variations */
.wp-block-group.is-layout-flex > *[style*="--wp--style--layout--flex-grow"] {
  flex-grow: var(--wp--style--layout--flex-grow, 1) !important;
}

/* WordPress container-based flex grow detection */
.wp-block-group.is-layout-flex > .wp-block-group[class*="wp-container-content"] {
  flex-grow: 1;
}

/* Alternative: Target groups with padding styles (often the content area) */
.wp-block-group.is-layout-flex > .wp-block-group[style*="padding"] {
  flex-grow: 1;
}

/* Debug: Temporarily force first child to grow to test CSS */
/* .wp-block-group.is-layout-flex > .wp-block-group:first-child {
  flex-grow: 1 !important;
  background-color: rgba(255, 0, 0, 0.1) !important;
} */

.prefooter .hills {
    overflow-x: clip;
}

.prefooter .hills svg {
    /* transform: translateY(10px); */
    /* width: calc(100% + 2rem); */
    /* margin: 0 -1rem; */
    width: 100%;
}

/* 2025 Font Size Styles */
.has-2025-h-1-font-size {
    font-size: clamp(60px, 8vw, 95px) !important;
}

.has-2025-h-2-font-size {
    font-size: clamp(42px, 5vw, 78px) !important;
}

.has-2025-h-3-font-size {
    font-size: clamp(42px, 5vw, 65px) !important;
}

.has-2025-h-4-font-size {
    font-size: 42px !important;
}

.has-2025-large-body-font-size {
    font-size: 28px !important;
}

.has-2025-body-font-size {
    font-size: clamp(20px, 4vw, 24px) !important;
}

/* Leaf List Style */
.wp-block-list.is-style-leaf-list {
    list-style: none;
    padding-left: 0;
    margin-top: 2em;
}

.wp-block-list.is-style-leaf-list li {
    position: relative;
    padding-left: 2em;
    margin-bottom: 0.5em;
}

.wp-block-list.is-style-leaf-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.2em;
    width: 20px !important;
    height: 20px !important;
    mask-image: url('app/assets/images/leaf.svg');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    background-color: #3BB5E5; /* Default color */
    background-image: none !important;
}

/* Leaf List nth-child colors */
.wp-block-list.is-style-leaf-list li:nth-child(5n+1)::before {
    background-color: #3BB5E5; /* Blue */
}

.wp-block-list.is-style-leaf-list li:nth-child(5n+2)::before {
    background-color: #F98A1A; /* Orange */
}

.wp-block-list.is-style-leaf-list li:nth-child(5n+3)::before {
    background-color: #00AA4F; /* Green */
}

.wp-block-list.is-style-leaf-list li:nth-child(5n+4)::before {
    background-color: #FFCB00; /* Yellow */
}

.wp-block-list.is-style-leaf-list li:nth-child(5n+5)::before {
    background-color: #DB2935; /* Red */
}

.prefooter--no-margin {
    margin-top: -50px !important;
}

figure.wp-block-table.has-2025-body-font-size table td, figure.wp-block-table.solid-lines table td {
    border-style: solid !important;
}

figure.wp-block-table.has-2025-body-font-size table thead tr th {
    font-size: 33px !important;
    white-space: nowrap !important;
}

figure.wp-block-table.is-style-2025 table {
    border-top: 3px solid currentColor; 
}

figure.wp-block-table.is-style-2025 table tr td:first-child {
    /* width: 600px; */
}

figure.wp-block-table.is-style-2025 table tr td strong {
    font-family: 'gardein', sans-serif !important;
}

/* Set minimum width for all table columns */
figure.wp-block-table.has-2025-body-font-size table td,
figure.wp-block-table.has-2025-body-font-size table th {
    min-width: 125px !important;
}

figure.wp-block-table.has-2025-body-font-size table td:nth-child(1n + 2),
figure.wp-block-table.has-2025-body-font-size table th:nth-child(1n + 2) {
    padding: 0.5rem 1.5rem;
}

/* Responsive table styles for 2025 body font size tables */
@media (max-width: 768px) {
    /* Hide the original table on mobile ONLY if it has responsive cards */
    figure.wp-block-table.has-2025-body-font-size.has-responsive-cards table {
        display: none;
    }
    
    /* Show the responsive card layout */
    figure.wp-block-table.has-2025-body-font-size .responsive-table-cards {
        display: block;
    }
    
    /* For tables without thead/tbody - make rows flex containers */
    figure.wp-block-table.has-2025-body-font-size:not(.has-responsive-cards) table {
        display: block;
        width: 100%;
    }
    
    figure.wp-block-table.has-2025-body-font-size:not(.has-responsive-cards) tbody,
    figure.wp-block-table.has-2025-body-font-size:not(.has-responsive-cards) thead {
        display: block;
        width: 100%;
    }
    
    /* Make rows flex containers */
    figure.wp-block-table.has-2025-body-font-size:not(.has-responsive-cards) tr {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 1rem;
        margin-top: 1rem;
        padding: 0 0 0.5rem 0;
        border: 0;
        border-bottom: 1px solid currentColor;
    }
    
    /* Remove border from last row */
    figure.wp-block-table.has-2025-body-font-size:not(.has-responsive-cards) tr:last-child {
        border-bottom: none;
    }
    
    /* First cell - 50% width */
    figure.wp-block-table.has-2025-body-font-size:not(.has-responsive-cards) td:first-child,
    figure.wp-block-table.has-2025-body-font-size:not(.has-responsive-cards) th:first-child {
        flex: 0 0 50%;
        min-width: 0;
        padding: 0.25rem 0;
        border: 0;
        text-align: left;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    /* Second cell - 30% width */
    figure.wp-block-table.has-2025-body-font-size:not(.has-responsive-cards) td:nth-child(2),
    figure.wp-block-table.has-2025-body-font-size:not(.has-responsive-cards) th:nth-child(2) {
        flex: 0 0 30%;
        padding: 0.25rem 0;
        border: 0;
        text-align: left;
    }
    
    /* Third cell - 20% width */
    figure.wp-block-table.has-2025-body-font-size:not(.has-responsive-cards) td:nth-child(3),
    figure.wp-block-table.has-2025-body-font-size:not(.has-responsive-cards) th:nth-child(3) {
        flex: 0 0 20%;
        padding: 0.25rem 0;
        border: 0;
        text-align: left;
    }
    
    /* Any additional cells beyond 3 - fit content */
    figure.wp-block-table.has-2025-body-font-size:not(.has-responsive-cards) td:nth-child(n+4),
    figure.wp-block-table.has-2025-body-font-size:not(.has-responsive-cards) th:nth-child(n+4) {
        flex: 0 0 auto;
        width: fit-content;
        padding: 0.25rem 0;
        border: 0;
        text-align: left;
    }
}
    
    /* Card styles */
    .responsive-table-cards .table-card {
        background: transparent;
        border: 0;
        border-radius: 0;
        margin-bottom: 1.5rem;
        padding: 0;
    }

    @media (max-width: 768px) {
    
    .responsive-table-cards .table-card .card-row {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 0.5rem;
        padding: 0.5rem 0;
        border-bottom: 1px solid #333;
    }
    
    .responsive-table-cards .table-card .card-row:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
    
    .responsive-table-cards .table-card .card-label {
        font-weight: 600;
        flex: 0 0 40%;
        font-size: 0.9rem;
    }
    
    .responsive-table-cards .table-card .card-value {
        flex: 1;
        text-align: right;
    }
    
    .responsive-table-cards .table-card .card-value strong {
        font-family: 'gardein', sans-serif !important;
        color: #333;
    }
}

/* Hide responsive cards on desktop */
@media (min-width: 769px) {
    figure.wp-block-table.has-2025-body-font-size.has-responsive-cards .responsive-table-cards {
        display: none;
    }
}

/* Override WordPress spacing CSS custom properties - Responsive */
:root {
    --wp--preset--spacing--30: clamp(0.5rem, 2vw, 40px) !important;  /* 8px - 12px */
}

@media (max-width: 1023px) {
    .is-stacked-on-mobile.chart {
        display: flex;
        flex-direction: column;
    }
    .is-stacked-on-mobile.chart .wp-block-media-text__media {
        max-width: 320px;
    }

    .is-stacked-on-mobile.chart .wp-block-media-text__content tr td:first-child img {
        max-width: 24px;
    }

}

.border-top {
    border-top: 3px solid currentColor;
}

.flowers-accent {
    max-width: 60vw;
}