/*
Theme Name: ChatMaxima
Theme URI: https://chatmaxima.com/
Author: ChatMaxima
Author URI: https://chatmaxima.com/
Description: ChatMaxima custom child theme based on Astra. Matches the ChatMaxima homepage branding with Nunito Sans typography, blue primary palette, and modern SaaS styling.
Template: astra
Version: 1.0.0
Requires at least: 5.3
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: chatmaxima
*/

/* ==========================================================================
   ChatMaxima Global Color Palette - Overrides Astra defaults
   Colors sourced from chatmaxima.com homepage (cm_chatmaxima.css)
   ========================================================================== */

:root {
    /* Primary brand blue */
    --ast-global-color-0: #008aff;
    /* Primary hover / darker blue */
    --ast-global-color-1: #0070d6;
    /* Heading text color (dark navy) */
    --ast-global-color-2: #152c5b;
    /* Body text color */
    --ast-global-color-3: #718096;
    /* White background */
    --ast-global-color-4: #FFFFFF;
    /* Light background */
    --ast-global-color-5: #f8f9fd;
    /* Dark color */
    --ast-global-color-6: #171347;
    /* Border / muted */
    --ast-global-color-7: #e9ecef;
    /* Extra dark */
    --ast-global-color-8: #152c5b;
}

/* ==========================================================================
   Typography - Nunito Sans (matching ChatMaxima homepage)
   ========================================================================== */

body,
.ast-body-font-applied {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    color: #718096;
    line-height: 1.7;
}

h1, h2, h3, h4, h5, h6,
.entry-title,
.ast-archive-title,
.page-title,
.site-title {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #152c5b;
    font-weight: 700;
}

/* ==========================================================================
   Links and Buttons - ChatMaxima blue
   ========================================================================== */

a {
    color: #008aff;
    transition: color 0.3s ease;
}

a:hover,
a:focus {
    color: #0070d6;
}

/* Primary buttons */
.ast-custom-button,
.menu-toggle,
.ast-mobile-menu-buttons,
input#submit,
input[type="button"],
input[type="submit"],
input[type="reset"],
.wp-block-button .wp-block-button__link,
.ast-button,
button,
.button {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.ast-custom-button:hover,
input#submit:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
.wp-block-button .wp-block-button__link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 138, 255, 0.3);
}

/* ==========================================================================
   Header / Navigation - Clean, modern look
   ========================================================================== */

.ast-primary-header-bar,
.ast-main-header-bar-alignment,
.main-header-bar {
    border-bottom: none;
    box-shadow: none;
}

.ast-header-break-point .ast-mobile-header-wrap .ast-primary-header-bar,
.ast-header-break-point .ast-mobile-header-wrap .ast-below-header-bar {
    border-bottom: none;
}

/* Navigation links */
.main-header-menu > .menu-item > a,
.ast-header-break-point .ast-header-custom-item a,
.ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: #152c5b;
    transition: color 0.3s ease;
}

.main-header-menu > .menu-item > a:hover,
.ast-builder-menu-1 .main-header-menu > .menu-item:hover > .menu-link {
    color: #008aff;
}

/* Active menu item */
.main-header-menu > .current-menu-item > a,
.main-header-menu > .current-menu-ancestor > a,
.ast-builder-menu-1 .main-header-menu > .current-menu-item > .menu-link {
    color: #008aff;
}

/* ==========================================================================
   Content Area - Clean cards, spacing
   ========================================================================== */

/* Blog post content - flat, no card background */
.ast-separate-container .ast-article-single,
.ast-separate-container .ast-article-post {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 2em;
}

.ast-separate-container .ast-article-post:hover {
    box-shadow: none;
}

/* Remove Astra's default separate container backgrounds */
.ast-separate-container .ast-article-single:not(.ast-related-post),
.ast-separate-container .ast-article-post {
    background-color: transparent !important;
}

.ast-separate-container .site-main > .ast-row {
    background: transparent;
}

/* Post title */
.entry-title a {
    color: #152c5b;
    font-weight: 700;
    transition: color 0.3s ease;
}

.entry-title a:hover {
    color: #008aff;
}

/* Post meta */
.entry-meta,
.entry-meta * {
    color: #a0aec0;
    font-size: 14px;
}

.entry-meta a:hover {
    color: #008aff;
}

/* Post content typography */
.entry-content {
    color: #4a5568;
    font-size: 16px;
    line-height: 1.8;
}

.entry-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 0.75em;
    color: #152c5b;
}

.entry-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #152c5b;
}

.entry-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #152c5b;
}

/* Blockquotes */
.entry-content blockquote {
    border-left: 4px solid #008aff;
    background: #f8f9fd;
    padding: 1.25em 1.5em;
    border-radius: 0 6px 6px 0;
    margin: 1.5em 0;
    font-style: italic;
    color: #4a5568;
}

/* Code blocks */
.entry-content code {
    background: #f0f5fa;
    color: #152c5b;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.entry-content pre {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 1.5em;
    overflow-x: auto;
}

.entry-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* Lists */
.entry-content ul li,
.entry-content ol li {
    margin-bottom: 0.5em;
    color: #4a5568;
}

/* ==========================================================================
   Sidebar - Widget area styled as grouped container
   ========================================================================== */

.widget-area.secondary {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 1.5em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.widget-area.secondary .widget {
    margin-bottom: 0.5em;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.widget-area.secondary .widget:last-child {
    margin-bottom: 0;
}

/* Widget headings (h5 blocks used as section titles in Gutenberg widgets) */
.widget-area.secondary .wp-block-heading,
.widget-title {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #152c5b;
    border-bottom: 2px solid #008aff;
    padding-bottom: 0.5em;
    margin-bottom: 0.75em;
    margin-top: 0;
}

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

/* Remove extra spacing between widget blocks (Gutenberg creates separate asides) */
.widget-area.secondary .sidebar-main {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Widget search form */
.widget-area.secondary .wp-block-search {
    margin-bottom: 0.5em;
}

.widget-area.secondary .wp-block-search__input {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-family: 'Nunito Sans', sans-serif;
    padding: 8px 12px;
    transition: border-color 0.3s ease;
}

.widget-area.secondary .wp-block-search__input:focus {
    border-color: #008aff;
    box-shadow: 0 0 0 3px rgba(0, 138, 255, 0.15);
    outline: none;
}

.widget-area.secondary .wp-block-search__button {
    background: #008aff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    padding: 8px 16px;
    transition: background 0.3s ease;
}

.widget-area.secondary .wp-block-search__button:hover {
    background: #0070d6;
}

/* Widget separator */
.widget-area.secondary .wp-block-separator {
    border-color: #e9ecef;
    margin: 0.75em 0;
}

/* Widget recent posts / categories / archives lists */
.widget-area.secondary .wp-block-latest-posts,
.widget-area.secondary .wp-block-categories,
.widget-area.secondary .wp-block-archives {
    padding-left: 0;
    list-style: none;
}

.widget-area.secondary .wp-block-latest-posts li,
.widget-area.secondary .wp-block-categories li,
.widget-area.secondary .wp-block-archives li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f5fa;
}

.widget-area.secondary .wp-block-latest-posts li:last-child,
.widget-area.secondary .wp-block-categories li:last-child,
.widget-area.secondary .wp-block-archives li:last-child {
    border-bottom: none;
}

.widget-area.secondary .wp-block-latest-posts li a,
.widget-area.secondary .wp-block-categories li a,
.widget-area.secondary .wp-block-archives li a {
    color: #4a5568;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
}

.widget-area.secondary .wp-block-latest-posts li a:hover,
.widget-area.secondary .wp-block-categories li a:hover,
.widget-area.secondary .wp-block-archives li a:hover {
    color: #008aff;
}

/* ==========================================================================
   Post Tags (bottom of single posts)
   ========================================================================== */

.chatmaxima-post-tags {
    margin-top: 2em;
    padding-top: 1.5em;
    border-top: 1px solid #e9ecef;
}

.chatmaxima-post-tags .tags-label {
    font-weight: 700;
    color: #152c5b;
    font-size: 14px;
    margin-right: 4px;
}

.chatmaxima-post-tags a {
    display: inline-block;
    background: #f0f5fa;
    color: #008aff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    margin: 3px 4px 3px 0;
    transition: all 0.3s ease;
    text-decoration: none;
}

.chatmaxima-post-tags a:hover {
    background: #008aff;
    color: #fff;
}

/* ==========================================================================
   Footer - Dark themed footer matching ChatMaxima
   ========================================================================== */

.ast-footer-copyright {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    color: #a0aec0;
}

/* ==========================================================================
   Category / Tag badges
   ========================================================================== */

.cat-links a,
.tags-links a {
    background: #f0f5fa;
    color: #008aff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 2px;
}

.cat-links a:hover,
.tags-links a:hover {
    background: #008aff;
    color: #fff;
}

/* ==========================================================================
   Read More button
   ========================================================================== */

.ast-read-more-container a,
.read-more a {
    color: #008aff;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ast-read-more-container a:hover,
.read-more a:hover {
    color: #0070d6;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.ast-pagination .page-numbers {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.ast-pagination .page-numbers.current {
    background: #008aff;
    border-color: #008aff;
    color: #fff;
}

.ast-pagination .page-numbers:hover:not(.current) {
    background: #f0f5fa;
    color: #008aff;
    border-color: #008aff;
}

/* ==========================================================================
   Search form
   ========================================================================== */

.search-form .search-field {
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-family: 'Nunito Sans', sans-serif;
    transition: border-color 0.3s ease;
}

.search-form .search-field:focus {
    border-color: #008aff;
    box-shadow: 0 0 0 3px rgba(0, 138, 255, 0.15);
    outline: none;
}

/* ==========================================================================
   Comments
   ========================================================================== */

.comments-area {
    border-top: 2px solid #e9ecef;
    padding-top: 2em;
}

.comment-author .fn {
    font-weight: 700;
    color: #152c5b;
}

.comment-content {
    color: #4a5568;
}

.comment-respond .comment-reply-title {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    color: #152c5b;
}

/* ==========================================================================
   Scroll to top button
   ========================================================================== */

#ast-scroll-top {
    border-radius: 50%;
    background: #008aff;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 138, 255, 0.3);
    transition: all 0.3s ease;
}

#ast-scroll-top:hover {
    background: #0070d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 138, 255, 0.4);
}

/* ==========================================================================
   Selection color
   ========================================================================== */

::selection {
    background: rgba(0, 138, 255, 0.15);
    color: #152c5b;
}

::-moz-selection {
    background: rgba(0, 138, 255, 0.15);
    color: #152c5b;
}

/* ==========================================================================
   Responsive adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .entry-content {
        font-size: 15px;
    }

    .entry-content h2 {
        font-size: 1.35rem;
    }

    .entry-content h3 {
        font-size: 1.15rem;
    }
}

/* ==========================================================================
   MegaMenu overrides - Match ChatMaxima.com homepage navigation
   Homepage: white bg, dark text, blue hover, rounded dropdown, shadow
   ========================================================================== */

/* Menu bar background - white, no border */
#mega-menu-wrap-primary {
    background: #fff !important;
    border: none !important;
    box-shadow: none !important;
}

/* Top-level menu links - match homepage .navbar-light .navbar-nav .nav-link */
#mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link {
    font-family: 'Nunito Sans', sans-serif !important;
    color: rgba(31, 45, 61, 0.6) !important;
    font-weight: normal !important;
    font-size: 1rem !important;
    padding: 0.25rem 1rem !important;
    line-height: 1.7 !important;
    height: auto !important;
    transition: color 0.3s ease !important;
    background: none !important;
    background-color: transparent !important;
}

/* Hover and focus - ChatMaxima blue */
#mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link:hover,
#mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link:focus,
#mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-toggle-on > a.mega-menu-link {
    color: rgba(0, 138, 255, 0.9) !important;
    background: none !important;
    background-color: transparent !important;
}

/* Active / current page */
#mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-current-menu-item > a.mega-menu-link,
#mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-current-menu-ancestor > a.mega-menu-link {
    color: rgba(0, 138, 255, 0.9) !important;
    background: none !important;
    background-color: transparent !important;
}

/* Keyboard navigation focus */
#mega-menu-wrap-primary.mega-keyboard-navigation > li.mega-menu-item > a.mega-menu-link:focus {
    background: none !important;
    background-color: transparent !important;
    color: #008aff !important;
}

/* Dropdown / sub-menu - matching homepage dropdown-menu-single style */
#mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu,
#mega-menu-wrap-primary #mega-menu-primary ul.mega-sub-menu {
    background: #fff !important;
    border: 1px solid #eaecf3 !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 0 1.25rem rgba(31, 45, 61, 0.05) !important;
    padding: 0.35rem 0 !important;
}

/* Sub-menu links */
#mega-menu-wrap-primary #mega-menu-primary ul.mega-sub-menu li.mega-menu-item a.mega-menu-link,
#mega-menu-wrap-primary #mega-menu-primary li.mega-menu-megamenu ul.mega-sub-menu li.mega-menu-item a.mega-menu-link {
    font-family: 'Nunito Sans', sans-serif !important;
    color: #718096 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 6px 20px !important;
    line-height: 1.7 !important;
    transition: all 0.2s ease !important;
    background: transparent !important;
}

/* Sub-menu link hover */
#mega-menu-wrap-primary #mega-menu-primary ul.mega-sub-menu li.mega-menu-item a.mega-menu-link:hover,
#mega-menu-wrap-primary #mega-menu-primary ul.mega-sub-menu li.mega-menu-item a.mega-menu-link:focus,
#mega-menu-wrap-primary #mega-menu-primary li.mega-menu-megamenu ul.mega-sub-menu li.mega-menu-item a.mega-menu-link:hover {
    color: #008aff !important;
    background: #f8f9fd !important;
}

/* Sub-menu headings / column titles */
#mega-menu-wrap-primary #mega-menu-primary li.mega-menu-megamenu ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link {
    font-weight: 700 !important;
    color: #152c5b !important;
    font-size: 14px !important;
    text-transform: none !important;
}

/* Mobile toggle button */
#mega-menu-wrap-primary .mega-menu-toggle {
    background: #fff !important;
    border-bottom: 1px solid #e9ecef;
}

#mega-menu-wrap-primary .mega-menu-toggle .mega-toggle-block-0 .mega-toggle-animated-inner,
#mega-menu-wrap-primary .mega-menu-toggle .mega-toggle-block-0 .mega-toggle-animated-inner::before,
#mega-menu-wrap-primary .mega-menu-toggle .mega-toggle-block-0 .mega-toggle-animated-inner::after {
    background-color: #152c5b !important;
}

/* Mobile menu background */
@media only screen and (max-width: 768px) {
    #mega-menu-wrap-primary #mega-menu-primary {
        background: #fff !important;
    }
    #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link {
        color: rgba(31, 45, 61, 0.7) !important;
        border-bottom: 1px solid #f0f5fa !important;
    }
    #mega-menu-wrap-primary #mega-menu-primary ul.mega-sub-menu {
        background: #f8f9fd !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
}

/* Astra header bar - white background, no border */
.ast-primary-header-bar,
.ast-main-header-bar-alignment,
.main-header-bar,
#masthead {
    background: #fff !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* Wider content container */
:root {
    --ast-normal-container-width: 1400px;
}

.ast-container {
    max-width: 1400px !important;
}

/* ==========================================================================
   Image styling
   ========================================================================== */

.entry-content img {
    border-radius: 8px;
}

.post-thumb img,
.ast-blog-featured-section img {
    border-radius: 8px 8px 0 0;
}

/* ==========================================================================
   Table styling
   ========================================================================== */

.entry-content table {
    border-collapse: collapse;
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
}

.entry-content table th {
    background: #f0f5fa;
    color: #152c5b;
    font-weight: 700;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
}

.entry-content table td {
    padding: 10px 16px;
    border: 1px solid #e9ecef;
    color: #4a5568;
}

.entry-content table tr:nth-child(even) {
    background: #f8f9fd;
}
