/*
Theme Name: OfficialAI Child
Theme URI: https://officialai.io
Description: Child theme for OfficialAI blog
Author: Your Name
Author URI: https://officialai.io
Template: astra
Version: 1.0.0
Text Domain: officialai-child
*/

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Poppins:wght@400;500;600;700&display=swap');

/* Main Colors - Adjust to match your brand */
:root {
    --primary-color: #3a86ff;
    --secondary-color: #8338ec;
    --accent-color: #ff006e;
    --text-color: #333333;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
}

/* Global Styles */
body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    font-weight: 700;
}

/* Hero Section */
.hero-section {
    background-color: var(--light-bg);
    padding: 80px 0;
}

.featured-post {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
}

.featured-image {
    flex: 1;
    min-width: 300px;
}

.featured-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.featured-content {
    flex: 1;
    min-width: 300px;
}

.post-category {
    margin-bottom: 10px;
}

.post-category a {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
}

.post-title {
    font-size: 2.2rem;
    margin-bottom: 15px;
    line-height: 1.3;
}

.post-excerpt {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.read-more-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Newsletter Section */
.newsletter-section {
    /* background-color: var(--primary-color); */
    background-color: #1D4ED8;
    color: white;
    text-align: center;
    padding: 60px 10px 10px;
    margin-bottom: 10px;
}

.newsletter-section h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.newsletter-section p {
    max-width: 600px;
    margin: 0 auto 30px;
    font-size: 1.1rem;
}

.newsletter-form {
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input[type="email"] {
    width: 70%;
    padding: 12px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

.newsletter-form input[type="submit"] {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

/* Recent Posts Section */
.recent-posts-section {
    background-color: white;
    margin-top: 20px !important; /* Reduce this value for less space */
    padding-top: 0 !important;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.post-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-card .post-category,
.post-card .post-title,
.post-card .post-meta {
    padding: 0 20px;
}

.post-card .post-title {
    font-size: 1.3rem;
    margin: 10px 0;
}

.post-card .post-title a {
    color: var(--text-color);
    text-decoration: none;
}

.post-card .post-meta {
    color: #666;
    font-size: 0.9rem;
    padding-bottom: 20px;
}

/* Top Stories Section */
.top-stories-section {
    background-color: var(--light-bg);
    padding-top: 20px !important; /* Remove top padding */
    padding-bottom: 40px !important; /* Remove any bottom margin */
}

.top-stories-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.story-item {
    display: flex;
    gap: 20px;
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.story-thumbnail {
    flex: 0 0 100px;
}

.story-thumbnail img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.story-content {
    flex: 1;
}

.story-content .post-title {
    font-size: 1.2rem;
    margin: 5px 0;
}

/* Secondary CTA */
.secondary-cta {
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 60px 0;
}

.secondary-cta h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.secondary-cta p {
    max-width: 600px;
    margin: 0 auto 30px;
    font-size: 1.1rem;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 15px 30px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: #d90063;
    transform: translateY(-2px);
}

/* Header Styles */
.site-header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.site-branding img {
    max-height: 50px;
    width: auto;
}

.site-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.site-title a {
    color: var(--primary-color);
    text-decoration: none;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    margin: 0 15px;
}

.main-navigation a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
}

.header-search {
    position: relative;
}

.header-search .search-form {
    display: flex;
}

.header-search .search-field {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.header-search .search-submit {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    margin-left: 5px;
    border-radius: 4px;
    cursor: pointer;
}

/* Footer Styles */
.site-footer {
    background-color: var(--dark-bg);
    color: white;
}

.footer-widgets {
    padding: 60px 0;
}

.footer-widget-areas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.widget-title {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.widget-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

.footer-menu,
.footer-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu li,
.footer-categories li {
    margin-bottom: 10px;
}

.footer-menu a,
.footer-categories a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-menu a:hover,
.footer-categories a:hover {
    color: white;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.site-info {
    background-color: rgba(0,0,0,0.2);
    padding: 20px 0;
    text-align: center;
}

.site-info .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Center copyright text */
.site-info .container {
    justify-content: center;
    text-align: center;
}

.copyright {
    width: 100%;
}

.footer-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-left: 20px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
}


/* Header Styles */
.site-header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.site-branding img {
    max-height: 50px;
    width: auto;
}

.site-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.site-title a {
    text-decoration: none;
}

.text-primary {
    color: var(--primary-color);
}

.text-secondary {
    color: var(--secondary-color);
}

.text-muted {
    color: #6c757d;
    font-size: 1.4rem;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    margin: 0 15px;
}

.main-navigation a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.menu-icon {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    position: relative;
}

.menu-icon:before,
.menu-icon:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--text-color);
    left: 0;
}

.menu-icon:before {
    top: -8px;
}

.menu-icon:after {
    bottom: -8px;
}

.header-search {
    position: relative;
}

.header-search .search-form {
    display: flex;
    align-items: center;
}

.header-search .search-field {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 200px;
}

.header-search .search-submit {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    margin-left: 5px;
    border-radius: 4px;
    cursor: pointer;
}

/* Responsive Header */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }
    
    .site-branding {
        flex: 1;
    }
    
    .menu-toggle {
        display: block;
        order: 2;
    }
    
    .main-navigation {
        order: 3;
        width: 100%;
        display: none;
    }
    
    .main-navigation.toggled {
        display: block;
    }
    
    .main-navigation ul {
        flex-direction: column;
        width: 100%;
    }
    
    .main-navigation li {
        margin: 10px 0;
    }
    
    .header-search {
        order: 2;
        margin-left: auto;
    }
    
    .header-search .search-field {
        min-width: 150px;
    }
}



/* Responsive Styles */
@media (max-width: 768px) {
    /* Header responsive styles */
    .header-inner {
        flex-wrap: wrap;
    }
    
    .site-branding {
        flex: 1;
    }
    
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--text-color);
    }
    
    .menu-icon {
        display: block;
        width: 25px;
        height: 3px;
        background-color: var(--text-color);
        position: relative;
    }
    
    .menu-icon:before,
    .menu-icon:after {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        background-color: var(--text-color);
        left: 0;
    }
    
    .menu-icon:before {
        top: -8px;
    }
    
    .menu-icon:after {
        bottom: -8px;
    }
    
    .main-navigation ul {
        display: none;
        flex-direction: column;
        width: 100%;
    }
    
    .main-navigation.toggled ul {
        display: flex;
    }
    
    .main-navigation {
        order: 3;
        width: 100%;
    }
    
    .main-navigation li {
        margin: 10px 0;
    }
    
    .header-search {
        order: 2;
    }
    
    .site-info .container {
        flex-direction: column;
    }
    
    .footer-links {
        margin-top: 15px;
        justify-content: center;
    }
    
    .footer-links li {
        margin: 0 10px;
    }
    
    /* General responsive styles */
    .featured-post {
        flex-direction: column;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .post-title {
        font-size: 1.8rem;
    }
    
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 576px) {
    section {
        padding: 40px 0;
    }
    
    .newsletter-form input[type="email"] {
        width: 60%;
    }
}

/* Print Styles */
@media print {
    .site-header, 
    .site-footer, 
    .newsletter-section,
    .secondary-cta {
        display: none;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
    }
}

/* Header Styles with Mobile Fixes */
.site-header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 15px 0;
}

.site-branding {
    flex: 1;
}

.site-branding img {
    max-height: 50px;
    width: auto;
}

.site-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.site-title a {
    text-decoration: none;
}

.text-primary {
    color: var(--primary-color);
}

.text-secondary {
    color: var(--secondary-color);
}

.text-muted {
    color: #6c757d;
    font-size: 1.4rem;
}

/* Menu Toggle Button - Fixed for Mobile */
.menu-toggle {
    display: none;
    background-color: var(--primary-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    z-index: 100;
    padding: 0;
    margin-left: 10px;
}

.menu-icon,
.menu-icon:before,
.menu-icon:after {
    display: block;
    width: 22px;
    height: 2px;
    background-color: white;
    position: absolute;
    transition: all 0.3s ease;
}

.menu-icon {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.menu-icon:before {
    content: '';
    top: -7px;
    left: 0;
}

.menu-icon:after {
    content: '';
    bottom: -7px;
    left: 0;
}

.menu-toggle[aria-expanded="true"] .menu-icon {
    background-color: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-icon:before {
    transform: rotate(45deg);
    top: 0;
}

.menu-toggle[aria-expanded="true"] .menu-icon:after {
    transform: rotate(-45deg);
    bottom: 0;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Main Navigation */
.main-navigation {
    flex-basis: 100%;
    order: 4;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    margin: 0 15px;
}

.main-navigation a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    display: block;
    padding: 5px 0;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

/* Search Form */
.header-search {
    position: relative;
    margin-left: auto;
}

.header-search .search-form {
    display: flex;
    align-items: center;
}

.header-search .search-field {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 200px;
}

.header-search .search-submit {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    margin-left: 5px;
    border-radius: 4px;
    cursor: pointer;
}

/* Basic Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 10px 0;
    position: relative;
    z-index: 1000;
}

/* Header Row */
.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* Site Branding */
.site-branding {
    margin-right: 20px;
}

.site-title {
    font-size: 1.5rem;
    margin: 0;
    line-height: 1.2;
}

.site-title a {
    text-decoration: none;
}

.text-primary {
    color: #3a86ff;
}

.text-secondary {
    color: #8338ec;
}

.text-muted {
    color: #6c757d;
    font-size: 1.2rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: block;
    background: #3a86ff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}

.mobile-menu-toggle .bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: white;
    margin: 6px 0;
    transition: 0.3s;
}

.mobile-menu-toggle.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Search Form */
.header-search {
    margin-left: 10px;
    flex-grow: 1;
    max-width: 300px;
}

.search-form {
    display: flex;
    align-items: center;
}

.search-field {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.search-submit {
    background-color: #3a86ff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* Main Navigation */
.main-navigation {
    width: 100%;
    display: none;
    margin-top: 10px;
}

.main-navigation.active {
    display: block;
}

.menu-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-items li {
    border-bottom: 1px solid #eee;
}

.menu-items li:last-child {
    border-bottom: none;
}

.menu-items a {
    display: block;
    padding: 12px 0;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.menu-items a:hover {
    color: #3a86ff;
}

/* Desktop Styles */
@media (min-width: 769px) {
    .header-row {
        flex-wrap: nowrap;
    }
    
    .site-title {
        font-size: 1.8rem;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
    
    .main-navigation {
        display: block;
        margin-top: 0;
        width: auto;
    }
    
    .menu-items {
        display: flex;
    }
    
    .menu-items li {
        margin-right: 20px;
        border-bottom: none;
    }
    
    .menu-items a {
        padding: 0;
    }
    
    .header-search {
        order: 3;
        margin-left: auto;
    }
}

/* Small Mobile Adjustments */
@media (max-width: 480px) {
    .site-title {
        font-size: 1.3rem;
    }
    
    .text-muted {
        font-size: 1rem;
    }
    
    .header-search {
        max-width: 150px;
    }
}

/* Desktop Layout */
@media (min-width: 769px) {
    .main-navigation {
        flex-basis: auto;
        order: 2;
    }
    
    .header-search {
        order: 3;
    }
    
    .menu-toggle {
        display: none;
    }
}

/* Mobile Layout */
@media (max-width: 768px) {
    .header-inner {
        padding: 10px 0;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .text-muted {
        font-size: 1.2rem;
    }
    
    .menu-toggle {
        display: block;
        order: 3;
    }
    
    .header-search {
        order: 2;
    }
    
    .header-search .search-field {
        min-width: 150px;
    }
    
    .main-navigation {
        display: none;
        width: 100%;
        background-color: white;
        padding: 15px 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }
    
    .main-navigation.toggled {
        display: block;
    }
    
    .main-navigation ul {
        flex-direction: column;
    }
    
    .main-navigation li {
        margin: 0;
        border-bottom: 1px solid #eee;
    }
    
    .main-navigation li:last-child {
        border-bottom: none;
    }
    
    .main-navigation a {
        padding: 12px 15px;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .header-search .search-field {
        min-width: 120px;
    }
    
    .site-title {
        font-size: 1.3rem;
    }
    
    .text-muted {
        font-size: 1rem;
    }
}

/* ======================================
   CONTAINER SCOPING TO PREVENT ASTRA CONFLICTS
   ====================================== */

/* Scope container class to avoid conflicts with Astra on single posts */
.home .container,
.page:not(.single-post) .container,
.archive .container,
.search .container,
.error404 .container,
.blog .container,
.custom-section .container,
footer .container,
header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Reset container styles on single post pages to let Astra handle it */
.single-post .container:not(.custom-section .container):not(footer .container):not(header .container) {
    max-width: none;
    width: auto;
    margin: inherit;
    padding: inherit;
}
