/* General styling for figure and its contents */
figure {
    display: block;
    margin: 0; /* No outside margins */
    padding: 0; /* Remove padding */
    box-sizing: border-box; /* Ensure total size includes padding and border */
    border: none; /* Remove any default borders */
    box-shadow: none; /* Ensure no shadow is applied to the figure itself */
}

/* Ensure image styles are applied correctly */
figure img {
    display: block; /* Prevent inline spacing issues */
    width: 100%; /* Full width to match container */
    border-radius: 4px; /* Rounded corners */
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.4); /* Apply shadow only to the image */
    padding: 0; /* No extra padding */
    margin: 0; /* Remove any margin */
    border: none; /* Ensure no outline or border around the image */
    box-sizing: border-box; /* Include padding and border in element's total width and height */
}

/* Specific styling for all text elements within figure */
figure p, figure figcaption, figure span, figure div {
    font-family: 'Open Sans', 'Arial', 'Helvetica', 'Verdana', 'Tahoma', sans-serif !important;
    text-align: left !important; /* Left-align the text */
    font-style: italic !important; /* Italic text */
    font-size: 0.9em !important; /* Slightly smaller font size */
    color: #555 !important; /* Soft gray color */
    padding: 5px 8px; /* Padding for text */
    margin: 0; /* Remove any margin */
    width: 100%; /* Match the width of the image */
    background-color: #f9f9f9 !important; /* Background color for text elements */
    border-radius: 4px !important; /* Rounded corners for background */
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.4) !important; /* Matching shadow with moderate opacity */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

/* Ensure figcaption styles are applied */
figure figcaption {
    /* Additional specific styling for <figcaption> if needed */
}
