/*
Theme Name: GeneratePress Child
Template: generatepress
*/

/*
==================================================
HEADER LAYOUT & STYLING
==================================================
*/

/* --- FINAL HEADER OVERRIDE --- */
@media (min-width: 769px) {
    #masthead .inside-header {
        display: flex;
        align-items: center;
    }
    #masthead .site-branding {
        flex-shrink: 0;
        margin-right: auto;
    }
    #masthead .main-navigation {
        flex-shrink: 0;
    }
    #masthead .main-navigation .main-nav > ul {
        display: flex !important;
        flex-wrap: nowrap !important;
    }
}

/*
==================================================
 --- START: NEW Colorful WordPress Search Bar ---
 (MODIFIED FOR COMPACT WIDTH)
==================================================
*/
.custom-wp-search-container {
    max-width: 600px;
    margin: 24px auto;
    padding: 0;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0, 77, 0, 0.1);
    border: 1px solid #fff;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #ffffff;
}
.custom-wp-search-container:focus-within {
    box-shadow: 0 5px 25px rgba(0, 100, 0, 0.2);
    transform: translateY(-2px);
}
.custom-wp-search-container .search-form {
    display: flex;
    margin: 0;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
    border: none;
    overflow: visible; 
}
.custom-wp-search-container label { flex-grow: 1; display: block; margin: 0; }
.custom-wp-search-container .search-field {
    width: 100%;
    border: none;
    background: transparent;
    padding: 16px 24px;
    font-size: 16px;
    color: #333;
    outline: none;
    line-height: 1.5;
    border-radius: 50px 0 0 50px;
}
.custom-wp-search-container .search-field::placeholder { color: #888; opacity: 1; }
.custom-wp-search-container .search-submit {
    background: linear-gradient(45deg, #0073aa, #005a8e);
    color: white;
    border: none;
    padding: 0 28px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0 50px 50px 0;
}
.custom-wp-search-container .search-submit:hover {
    background: linear-gradient(45deg, #005a8e, #004d00);
    transform: scale(1.05);
}
.custom-wp-search-container .screen-reader-text { display: none; }

/*
==================================================
 --- END: NEW Colorful WordPress Search Bar ---
==================================================
*/


/*
==================================================
CONTENT & OTHER STYLING
(Your original code)
==================================================
*/

/* === Hide Featured Image at Top on Single Posts === */
.entry-header .post-thumbnail:not(.custom-bottom-featured-image),
.page-header-image:not(.custom-bottom-featured-image),
.hero-featured-image:not(.custom-bottom-featured-image),
.featured-image:not(.custom-bottom-featured-image),
.generate-featured-page-header:not(.custom-bottom-featured-image),
.page-header-image-single:not(.custom-bottom-featured-image) {
    display: none !important;
}
.custom-featured-image-below {
    margin: 32px auto 20px auto; text-align: center; max-width: 100%;
}
.custom-featured-image-below img.custom-bottom-featured-image {
    display: block; max-width: 100%; height: auto; border-radius: 12px;
    margin-left: auto; margin-right: auto; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.related-posts {
    margin-top: 40px; padding: 20px; background: #f9f9f9;
    border: 1px solid #e0e0e0; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.related-posts h3 {
    font-size: 1.5em; margin-bottom: 20px; color: #006400; font-weight: 700;
    border-bottom: 2px solid #ddd; padding-bottom: 8px;
}
.rp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.rp-item {
    background: #fff; border: 1px solid #eaeaea; border-radius: 10px;
    transition: all 0.3s ease; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.rp-item:hover { transform: translateY(-4px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.rp-item a {
    text-decoration: none; color: inherit; display: flex;
    flex-direction: column; gap: 12px; padding: 12px;
}
.rp-item .rp-title { font-size: 16px; font-weight: 600; line-height: 1.4; color: #006400; }
.rp-item a:hover .rp-title { color: #0073e6; }
.rp-item img {
    width: 100%; height: auto; aspect-ratio: 16 / 9;
    object-fit: cover; border-radius: 6px; display: block;
}
.last-updated {
    font-size: 0.85em; font-weight: 600; color: #005a00; background-color: #f0f7f0;
    border: 1px solid #d4e8d4; padding: 5px 12px; border-radius: 20px;
    margin-top: -5px; margin-bottom: 25px; display: inline-block; line-height: 1.4;
}
.last-updated::before { content: '🔄'; margin-right: 8px; vertical-align: -0.1em; }
.last-updated strong { font-weight: 700; }
.typing-links {
    margin: 30px 0; padding: 20px; background: #f4faff; border: 1px solid #dce7f5;
    border-radius: 12px; box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.typing-links h2 {
    text-align: center; font-size: 1.6em; margin-bottom: 20px; color: #006400; font-weight: 700;
}
.typing-links .links-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; }
.links-grid a,
.links-grid .current-link-item {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px; text-align: center; background: #ffffff;
    border: 1px solid #cfe1f7; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.links-grid a {
    text-decoration: none; font-size: 15px; font-weight: 600; color: #0066cc; transition: all 0.3s ease;
}
.links-grid .current-link-item {
    font-size: 15px; font-weight: bold; color: #000000; background: #f0f0f0;
    border-color: #ddd; cursor: default;
}
.links-grid a::before,
.links-grid .current-link-item::before { content: "⌨️"; font-size: 16px; }
.links-grid a:hover {
    background: #e9f3ff; color: #004a99; transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.home .entry-content { font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.7; }
.home .homepage-section { max-width: 900px; margin: 60px auto; padding: 0 20px; text-align: center; }
.home .homepage-section h2 { font-size: 2.2em; margin-bottom: 15px; font-weight: 700; }
.home .homepage-section p { font-size: 1.1em; max-width: 750px; margin-left: auto; margin-right: auto; color: #555; }
.home .features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; max-width: 1200px; margin: 60px auto; padding: 0 20px; }
.home .feature-card {
    background-color: #fff; border: 1px solid #e0e0e0; border-radius: 15px; padding: 30px;
    text-align: center; box-shadow: 0 5px 25px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.home .feature-card:hover { transform: translateY(-8px); box-shadow: 0 12px 35px rgba(0,0,0,0.08); }
.home .feature-card img { width: 80px; height: 80px; margin-bottom: 20px; }
.home .feature-card h3 { font-size: 1.5em; margin-bottom: 10px; font-weight: 600; }
.home .feature-card p { color: #666; font-size: 1em; margin-bottom: 25px; }
.home .hp-button {
    display: inline-block; padding: 12px 30px; font-size: 1em; font-weight: 700; border-radius: 8px;
    color: #fff; text-decoration: none; cursor: pointer; transition: all 0.2s ease-in-out;
    background: linear-gradient(45deg, #0073aa, #005a8e);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1); box-shadow: 0 4px 15px rgba(0, 115, 170, 0.2);
}
.home .hp-button:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0, 115, 170, 0.3); }
.home .hp-button.hp-button-green { background: linear-gradient(45deg, #28a745, #218838); box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3); }
.home .hp-button.hp-button-green:hover { box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4); }
.home .faq-section { max-width: 800px; margin: 60px auto; text-align: left; padding: 0 20px; }
.home .faq-section h3 { font-size: 1.3em; border-top: 1px solid #eee; padding-top: 20px; margin-top: 20px; }
@media (max-width: 600px) { .rp-grid { grid-template-columns: 1fr; } }

/*
==========================================================================
 --- START PWA & STYLING INTEGRATION ---
==========================================================================
*/

/* --- 1. PWA INSTALL BANNER (TRUE CLS OPTIMIZATION) --- */
#pwa-install-banner {
    /* Set display:flex from the start so it occupies space */
    display: flex; 
    visibility: hidden;
    opacity: 0;
    /* Start collapsed */
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden;

    /* Original styles (unchanged) */
    background-color: #e3f2fd; color: #1e3a56;
    margin-left: auto; margin-right: auto;
    max-width: 600px; border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); text-align: center;
    align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 16px; border: none;
    
    /* Smooth transition for appearing */
    transition: all 0.5s ease-in-out;
}
#pwa-install-banner.is-visible {
    /* Expand to full size when class is added */
    visibility: visible;
    opacity: 1;
    max-height: 200px; /* A large value to allow content to fit */
    padding-top: 16px;
    padding-bottom: 16px;
    margin-top: 20px;
    margin-bottom: 20px;
}
#pwa-install-banner p { margin: 0; font-size: 17px; font-weight: 500; }
#pwa-install-button {
    background: linear-gradient(45deg, #2196F3, #1976D2); color: #ffffff;
    border: none; border-radius: 8px; padding: 12px 24px;
    font-size: 16px; font-weight: bold; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); transition: all 0.3s ease; flex-shrink: 0;
}
#pwa-install-button:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); }

/* --- 2. High-Readability Main Navigation --- */
.main-navigation { background-color: #ffffff !important; border-bottom: 1px solid #e5e7eb; box-shadow: 0 2px 4px rgba(0,0,0,0.04); }
.main-navigation .main-nav ul li a { color: #333745 !important; font-weight: 600; padding: 20px; transition: all 0.25s ease-in-out; border-bottom: 3px solid transparent; background-color: transparent !important; }
.main-navigation .main-nav ul li:not(.current-menu-item) a:hover { color: #4A90E2 !important; background-color: #f7f9fb !important; }
.main-navigation .main-nav ul li.current-menu-item > a { color: #4A90E2 !important; font-weight: 700; border-bottom-color: #4A90E2; background-color: transparent !important; }

/* --- 3. TYPOGRAPHY (PERFORMANCE OPTIMIZED) --- */
.entry-title { font-size: 26px; font-weight: 700; color: #1e3a56; padding-bottom: 15px; border-bottom: 4px solid #4A90E2; line-height: 1.4; }
@media (max-width: 768px) { .entry-title { font-size: 21px; } }
.archive .entry-title a, .blog .entry-title a { font-size: 22px; color: #1e3a56; text-decoration: none; transition: color 0.3s ease; }
.archive .entry-title a:hover, .blog .entry-title a:hover { color: #4A90E2; }

/* --- 4. BUTTONS & POST NAVIGATION (NEW STYLE) --- */
.read-more-button a.button, a.read-more { background: linear-gradient(45deg, #4A90E2, #1976D2); color: #ffffff !important; border-radius: 25px; padding: 10px 25px; font-weight: bold; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); display: inline-block; text-decoration: none; transition: all 0.3s ease; }
.read-more-button a.button:hover, a.read-more:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); }
.post-navigation { display: flex; justify-content: space-between; gap: 40px; margin-top: 40px; padding-top: 20px; border-top: 1px solid #e5e7eb; }
.post-navigation .nav-previous, .post-navigation .nav-next { flex: 1; min-width: 0; }
.post-navigation .nav-next { text-align: right; }
.post-navigation a { color: #4A90E2 !important; font-weight: 600; text-decoration: none; transition: all 0.3s ease; display: block; padding: 10px 0; background: none !important; border: none !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-navigation a:hover { color: #1e3a56 !important; text-shadow: 0 0 8px rgba(74, 144, 226, 0.6); }
.post-navigation .nav-links .meta-nav { font-size: 14px; font-weight: 400; color: #6b7280; display: block; margin-bottom: 5px; }

/*
==========================================================================
 --- END PWA & STYLING INTEGRATION ---
==========================================================================
*/
/* This is an EXAMPLE - use the real class/ID from your site */
.install-banner-container {
  min-height: 60px; /* <-- Change this to the banner's actual height */
}
