/*
 Theme Name:   Semikr Child
 Theme URI:    https://semikr.com
 Description:  Child theme for Semikr, featuring forced legal disclaimers for financial information.
 Author:       Semikr
 Author URI:   https://semikr.com
 Template:     twentytwentyfour
 Version:      1.0.0
*/

/* Add any custom CSS overrides below */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

body, 
.editor-styles-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
}

h1, h2, h3, h4, h5, h6,
.wp-block-heading {
    font-family: 'Outfit', sans-serif !important;
    color: #0f172a !important;
}

/* 1. Newsletter Form (Substack Style) */
.semikr-newsletter-form {
    margin-top: 25px;
    margin-bottom: 10px;
    max-width: 500px;
}
.semikr-newsletter-form form {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.semikr-newsletter-form input[type="email"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.semikr-newsletter-form input[type="email"]:focus {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}
.semikr-newsletter-form button[type="submit"] {
    background-color: #059669;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.semikr-newsletter-form button[type="submit"]:hover {
    background-color: #047857;
}
.semikr-newsletter-form .newsletter-subtext {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}


/* 3. Feed Cards (Substack & Insight Stream style) */
.semikr-feed-card {
    background: transparent !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 24px 0 !important;
    margin-bottom: 0 !important;
    transition: transform 0.2s;
}
.semikr-feed-card:last-child {
    border-bottom: none !important;
}
.semikr-feed-card a {
    text-decoration: none !important;
    color: #0f172a !important;
    transition: color 0.15s;
}
.semikr-feed-card a:hover {
    color: #059669 !important;
}
.semikr-feed-card .wp-block-post-terms-category a {
    color: #059669 !important;
    background-color: #ecfdf5 !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
}
.semikr-feed-card .wp-block-post-date {
    color: #64748b !important;
}

/* 4. Global & Post Disclaimers */
.semikr-disclaimer {
    font-size: 13px !important;
    line-height: 1.6 !important;
    color: #475569 !important;
    background-color: #f8fafc !important;
    padding: 20px !important;
    margin-top: 40px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    text-align: left !important;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.semikr-disclaimer.warning-disclaimer {
    border-left: 4px solid #059669 !important;
}
.semikr-disclaimer.global-disclaimer {
    border-top: 1px solid #e2e8f0 !important;
    text-align: center !important;
    background: #f8fafc !important;
    margin-top: 60px !important;
    padding: 24px !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
}

/* 5. Navigation overrides for cleaner menu */
.wp-block-navigation-item__label {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: #475569;
    transition: color 0.15s;
}
.wp-block-navigation-item:hover .wp-block-navigation-item__label {
    color: #059669;
}

/* 6. Mobile Responsiveness Overrides */
@media (max-width: 600px) {
    .semikr-newsletter-form form {
        flex-direction: column !important;
        gap: 12px !important;
    }
    .semikr-newsletter-form input[type="email"],
    .semikr-newsletter-form button[type="submit"] {
        width: 100% !important;
    }
}

/* 7. Desktop Grid Alignment and Width Unification */
@media (min-width: 601px) {
    /* Center-align upper hero row (intro + widget) at 1200px max-width */
    .semikr-hero-row {
        max-width: 1200px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
    }
    
    /* Center-align lower query container at 1200px max-width */
    .wp-block-query {
        max-width: 1200px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
    }

    /* Center-align section title heading at 1200px max-width to match others */
    .section-title {
        max-width: 1200px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
    }

    /* Break default WP constrained container widths for templates */
    .wp-block-post-template,
    .wp-block-post-template > li {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
    }

    /* Expand feed card width to 1200px matching the upper section's total span */
    .semikr-feed-card {
        max-width: 1200px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
    }
    .semikr-feed-card > * {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}
/* ==========================================================================
   8. (Reserved — market widget styled via plugin inline CSS)
   ========================================================================== */

/* ==========================================================================
   9. Custom Responsive Overrides for Archive Grids and Credit Cleanups
   ========================================================================== */

/* Tablet viewports: Force 2-columns for ALL post templates and grids inside Query Loops */
@media (max-width: 991px) and (min-width: 601px) {
    .wp-block-post-template,
    .wp-block-post-template.is-grid,
    ul.wp-block-post-template {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        display: grid !important;
        gap: 24px !important;
    }
    
    /* Footer columns only: wrap on tablet viewports to prevent squishing */
    footer .wp-block-columns {
        flex-wrap: wrap !important;
    }
    footer .wp-block-column {
        flex-basis: calc(50% - 12px) !important;
        max-width: calc(50% - 12px) !important;
        margin-bottom: 24px !important;
    }
}

/* Mobile viewports: Force 1-column layout for post templates */
@media (max-width: 600px) {
    .wp-block-post-template {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}

/* Hide default WordPress credits and footer boilerplate */
.wp-block-credits, 
.site-info, 
.wordpress-credit, 
footer a[href*="wordpress.org"],
p.has-contrast-2-color.has-text-color.has-link-color.has-small-font-size,
.wp-block-group.alignwide p.has-contrast-2-color,
.wp-block-group.has-background.has-link-color p:has(a[href*="wordpress.org"]) {
    display: none !important;
}
