/* Google Docs Embed Styles */

.gde-container {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    margin: 20px 0;
}

.gde-container iframe {
    display: block;
    border: none;
    margin: 0;
    padding: 0;
    vertical-align: top;
}

.google-docs-embed-iframe {
    width: 100%;
    height: auto !important; /* Remove fixed viewport height to allow content-based sizing */
    border: none;
    display: block;
    min-height: 400px; /* Maintain a reasonable minimum height */
    border-radius: 5px; /* Slightly reduced rounded corners */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08); /* Lighter shadow to avoid overpowering page builder styles */
    background-color: #ffffff; /* White background for consistency */
    transition: box-shadow 0.3s ease; /* Smooth transition for hover effects */
    box-sizing: border-box; /* Ensure padding and borders are included in width */
    margin: 0;
    padding: 0;
    vertical-align: top;
    overflow: hidden;
}

.google-docs-embed-iframe:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12); /* Slightly enhanced shadow on hover */
}

/* Container styles with higher specificity to avoid conflicts with page builders like WPBakery */
.google-docs-embed-container {
    margin: 0 auto; /* Center the container */
    padding: 5px; /* Reduced padding for tighter integration */
    width: 100%;
    max-width: 100%; /* Allow full width within parent container */
    height: auto;
    position: relative;
    background-color: transparent; /* Transparent background to blend with page builder */
    border-radius: 5px; /* Slightly reduced rounded corners */
    box-sizing: border-box; /* Ensure padding is included in width */
    overflow: hidden; /* Prevent overflow issues in page builder layouts */
}

/* Responsive design adjustments */
@media (max-width: 768px) {
    .google-docs-embed-iframe {
        min-height: 300px; /* Adjusted for smaller screens */
    }
    .google-docs-embed-container {
        padding: 3px; /* Further reduced padding on smaller screens */
    }
}

/* Ensure compatibility with WPBakery and other page builders */
.vc_row .google-docs-embed-container,
.vc_column_container .google-docs-embed-container {
    margin: 0; /* Remove margins that might conflict with page builder rows/columns */
    padding: 0; /* Remove padding to fit within page builder elements */
    width: 100%; /* Full width within column */
    max-width: 100%; /* Ensure it doesn't exceed column width */
}

.vc_row .google-docs-embed-iframe,
.vc_column_container .google-docs-embed-iframe {
    width: 100%; /* Full width within column */
    height: auto !important; /* Allow height to adjust based on content */
    min-height: 350px; /* Adjusted minimum height */
}

@media (max-width: 768px) {
    .vc_row .google-docs-embed-iframe,
    .vc_column_container .google-docs-embed-iframe {
        min-height: 280px; /* Adjusted for smaller screens */
    }
}

/* Additional styles to remove Google Docs whitespace */
.gde-container,
.google-docs-embed-container {
    line-height: 0; /* Remove line height that can cause spacing */
}

.gde-container iframe,
.google-docs-embed-iframe {
    line-height: normal; /* Restore normal line height inside iframe */
}

/* Force remove any potential margins/padding from Google Docs content */
.gde-container iframe[src*="docs.google.com"],
.google-docs-embed-iframe[src*="docs.google.com"] {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: none !important;
    vertical-align: top !important;
    display: block !important;
} 