:root {
    --color-white: rgb(255, 255, 255);
    --color-black: rgb(51, 51, 51);
    --color-border-main: rgb(192, 195, 202);
    --color-border-sub: rgb(223, 226, 233);
    --color-background-gray: rgb(247, 247, 247);
    --color-primary-dark: rgb(0, 83, 181);
    --color-primary-medium: rgb(11, 136, 227);
    --color-primary-light: rgb(103, 191, 255);
    --color-gray-700: rgb(44, 47, 53);
    --color-gray-600: rgb(65, 69, 78);
    --color-gray-500: rgb(99, 105, 119);
    --color-gray-400: rgb(158, 164, 177);
    --color-gray-300: rgb(196, 201, 210);
    --color-gray-200: rgb(235, 237, 241);
    --color-gray-100: rgb(246, 247, 248);
    --gradient-primary: linear-gradient(180deg, var(--color-primary-medium) 0%, var(--color-primary-dark) 100%);
}

/* Use a wrapper class for the block */
.b-cases {
    padding: 120px 0;
    background-color: var(--color-background-gray);
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-black);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.b-cases *,
.b-cases *::before,
.b-cases *::after {
    box-sizing: border-box;
}

.b-cases img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

.b-cases a {
    /* color: inherit; */
    text-decoration: none;
}

/* Re-use l_container or define a block-specific container */
.b-cases .l_container {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

@media (min-width: 1400px) {
  .b-cases .l_container {
     max-width: 1140px;
  }
}
@media (max-width: 1399.98px) {
 .b-cases .l_container {
     max-width: 960px;
  }
}
@media (max-width: 991.98px) {
 .b-cases .l_container {
    max-width: 720px;
  }
}
@media (max-width: 767.98px) {
    .b-cases .l_container {
        max-width: none;
        padding-left: 20px;
        padding-right: 20px;
    }
   .b-cases {
     padding: 60px 0;
   }
}


.b-cases__section__head {
  text-align: center;
  margin-bottom: 64px;
}

.b-cases__section__label {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.3em;
  line-height: 1.38;
  color: var(--color-primary-medium);
  margin: 0 0 16px 0;
  text-transform: uppercase;
}

.b-cases__section__title {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.5;
  color: var(--color-black);
  margin: 0;
}

.b-cases__card__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 64px;
}

/* Style for the individual card item (likely rendered by case-item.php) */
/* Assuming case-item.php outputs an article tag that needs to match these styles */
.b-cases__card {
    background-color: var(--color-white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.3s ease;
}
.b-cases__card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.b-cases__card__tag {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1.7;
    color: var(--color-primary-medium);
    margin: 0 0 16px 0;
}

.b-cases__card__title {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.1em;
    line-height: 1.5;
    color: var(--color-black);
    margin: 0 0 16px 0;
    flex-grow: 1;
}

.b-cases__card__client {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1.7;
    color: var(--color-gray-500);
    margin: 0;
}

.b-cases__button__wrapper {
    text-align: center;
}

/* General button style */
.b-cases__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 40px;
    border-radius: 100px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    border: none;
    text-decoration: none;
}

.b-cases__button--primary {
    background: var(--gradient-primary);
    color: var(--color-white);
    /* box-shadow: 0 4px 10px rgba(11, 136, 227, 0.3); */
}

.b-cases__button--primary:hover {
     background: linear-gradient(180deg, var(--color-primary-light) 0%, var(--color-primary-medium) 100%);
    box-shadow: 0 6px 15px rgba(11, 136, 227, 0.4);
}

.b-cases__button--icon_right .material-icons {
    font-size: 20px;
    margin-left: 12px;
    line-height: 1;
    vertical-align: middle;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .b-cases__card__list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {
    .b-cases {
        padding: 60px 0;
    }
    .b-cases__section__head {
       margin-bottom: 40px;
    }
    .b-cases__section__title {
        font-size: 28px;
    }
    .b-cases__card__list {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 40px;
    }
     .b-cases__card {
        padding: 24px;
    }
     .b-cases__button {
        padding: 12px 30px;
        font-size: 14px;
    }
     .b-cases__button--icon_right .material-icons {
        font-size: 18px;
        margin-left: 8px;
    }
} 

        /* Object / Component */
        .c-sp-cases-button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 14px 16px 14px 16px; /* Adjusted padding for responsiveness */
            background-color: rgb(11, 136, 227);
            border-radius: 100px;
            width: 100%; /* Allow button to take full width */
            max-width: 297px; /* Max width from Figma */
            min-height: 60px; /* Use min-height instead of fixed height */
            height: auto; /* Allow height to adjust */
            text-decoration: none;
            gap: 16px; /* Reduced gap for potentially smaller screens */
            box-sizing: border-box; /* Ensure padding is included in width */
        }

        .c-sp-cases-button__text-wrapper {
            display: flex;
            align-items: center;
            justify-content: center;
            padding-top: 2px;
            /* Removed fixed width/height for flexibility */
            flex-grow: 1; /* Allow text wrapper to take available space */
            text-align: center; /* Center text within the wrapper */
        }


        .c-sp-cases-button__text {
            color: rgb(255, 255, 255);
            font-size: 16px; /* Slightly smaller base font size for mobile */
            font-weight: 500;
            line-height: 1.5;
            letter-spacing: 0.1em;
            /* Removed fixed width/height */
            white-space: nowrap; /* Prevent text wrapping */
        }

        .c-sp-cases-button__icon-wrapper {
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: rgb(255, 255, 255);
            border-radius: 9999px;
            width: 32px;
            height: 32px;
            flex-shrink: 0; /* Prevent icon wrapper from shrinking */
        }

        .c-sp-cases-button__icon {
            font-family: 'Material Icons';
            font-weight: normal;
            font-style: normal;
            font-size: 15px;
            display: inline-block;
            line-height: 1;
            text-transform: none;
            letter-spacing: normal;
            word-wrap: normal;
            white-space: nowrap;
            direction: ltr;
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
            -moz-osx-font-smoothing: grayscale;
            font-feature-settings: 'liga';
            color: rgb(11, 136, 227);
             width: 32px;
             height: 32px;
             display: flex;
             align-items: center;
             justify-content: center;
        }

        /* Media Query for larger screens (optional adjustments) */
        @media (min-width: 600px) {
             .c-sp-cases-button {
                 padding: 14px 16px 14px 80px; /* Restore original padding */
                 gap: 32px; /* Restore original gap */
             }
            .c-sp-cases-button__text {
                font-size: 18px; /* Restore original font size */
            }
             .c-sp-cases-button__text-wrapper {
                 flex-grow: 0; /* Disable grow on larger screens if needed */
                 width: 137px; /* Restore original width if needed */
             }
        }