/*
Theme Name:   Expertly Child
Theme URI:    https://wparena.com
Description:  Child theme of Expertly theme for customizations
Author:       WPArena
Author URI:   https://wparena.com
Template:     expertly
Version:      1.0.0
Text Domain:  expertly-child
License:      GNU General Public License v3 or later
License URI:  http://www.gnu.org/licenses/gpl-3.0.html
*/

/* 
 * All custom styles should be added below this line
 * Parent theme styles are automatically enqueued via functions.php
 */

/* ========================================
   WordPress Hosting Page Custom Styles
   ======================================== */

/* Fix image alignment and prevent overlapping */
.wp-block-image.alignright {
    float: right;
    margin: 0 0 1.5em 1.5em;
    max-width: 300px;
    clear: right;
}

.wp-block-image.alignright + * {
    clear: right;
}

/* Ensure proper spacing after right-aligned images */
.wp-block-image.alignright::after {
    content: ;
    display: table;
    clear: both;
}

/* Beautiful button styling */
.button.wp-element-button,
a.button.wp-element-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #1e73be;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.button.wp-element-button:hover,
a.button.wp-element-button:hover {
    background-color: #155a94;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: #ffffff !important;
}

.button.wp-element-button:active,
a.button.wp-element-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Fix columns layout for hosting providers */
.wp-block-columns.has-background {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
}

.wp-block-columns .wp-block-column {
    margin-bottom: 1rem;
}

/* Improve list styling in hosting cards */
.wp-block-columns .wp-block-list {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.wp-block-columns .wp-block-list li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Fix spacing issues */
.wp-block-separator {
    margin: 2rem 0;
    border-color: #e0e0e0;
}

/* Improve table styling */
.wp-block-table {
    margin: 2rem 0;
    overflow-x: auto;
}

.wp-block-table table {
    border-collapse: collapse;
    width: 100%;
}

.wp-block-table th {
    background-color: #f5f5f5;
    font-weight: 600;
    padding: 12px;
    text-align: left;
}

.wp-block-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
}

.wp-block-table tr:hover {
    background-color: #f9f9f9;
}

/* Responsive image fixes */
@media (max-width: 782px) {
    .wp-block-image.alignright {
        float: none;
        margin: 1rem auto;
        display: block;
        max-width: 100%;
    }
}

/* Fix any remaining spacing issues */
.page-updated-date {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.9em;
}

/* Improve heading spacing */
.wp-block-heading {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.wp-block-heading:first-child {
    margin-top: 0;
}

/* Clean up any visual glitches */
.wp-block-spacer {
    display: block;
    clear: both;
}

/* ========================================
@media (max-width: 782px) {
    .wp-block-image.alignright {
        float: none;
        margin: 1rem auto;
        display: block;
        max-width: 100%;
    }
}

/* ========================================
   Fix Right-Aligned Images - No Empty Space
   ======================================== */

/* Right-aligned images float right with text wrapping on left */
.wp-block-image.alignright {
    float: right;
    margin: 0 0 1em 1.5em;
    max-width: 300px;
}

/* All headings must clear floats to appear below images */
h1.wp-block-heading,
h2.wp-block-heading,
h3.wp-block-heading,
h4.wp-block-heading,
h5.wp-block-heading,
h6.wp-block-heading,
.wp-block-heading {
    clear: both !important;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Paragraphs flow around the image naturally */
.wp-block-paragraph {
    overflow: hidden; /* Creates new block formatting context */
}

/* Separators clear floats */
.wp-block-separator {
    clear: both;
    margin: 2rem 0;
    border-color: #e0e0e0;
}

/* Lists after headings should also be on new line */
.wp-block-heading + .wp-block-list {
    clear: both;
}

/* Remove any pseudo-elements that might add spacing */
.wp-block-image.alignright::after {
    display: none;
}

/* On mobile, images should not float */
@media (max-width: 782px) {
    .wp-block-image.alignright {
        float: none;
        margin: 1rem auto;
        display: block;
        max-width: 100%;
    }
}

/* ========================================
   Contact Us & Services Pages Styles
   ======================================== */

/* Full-width page content spacing */
.cs-page-layout-disabled .entry-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Beautiful group blocks with proper spacing */
.wp-block-group.alignwide {
    margin: 0 auto;
}

/* Column spacing for contact info */
.wp-block-columns .wp-block-column {
    padding: 1.5rem;
}

/* Heading styles using theme defaults */
.entry-content h1,
.entry-content h2,
.entry-content h3 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.entry-content h1 {
    margin-bottom: 1.5rem;
}

/* Paragraph spacing */
.entry-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Link styling using theme colors */
.entry-content a {
    color: var(--accent-2, #1e73be);
    text-decoration: none;
    transition: color 0.3s ease;
}

.entry-content a:hover {
    color: var(--accent-1, #145289);
    text-decoration: underline;
}

/* Separator styling */
.wp-block-separator.alignwide {
    margin: 3rem auto;
    border: none;
    border-top: 1px solid #e0e0e0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cs-page-layout-disabled .entry-content {
        padding: 0 1rem;
    }
    
    .wp-block-columns {
        flex-direction: column;
    }
    
    .wp-block-columns .wp-block-column {
        padding: 1rem 0;
    }
}
