/*
Theme Name: Kilimo Kwanza
Theme URI: https://kilimokwanza.com
Author: Kilimo Kwanza Team
Author URI: https://kilimokwanza.com
Description: A professional, accessible WordPress theme for agricultural platforms. Features include responsive design, AI-powered advisor integration, resource management, and comprehensive service showcases. Perfect for agricultural extension services, farming organizations, and agricultural marketplaces.
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
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: kilimo-kwanza
Tags: agriculture, farming, responsive-design, accessibility-ready, custom-header, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, theme-options, translation-ready, two-columns

Kilimo Kwanza WordPress Theme, Copyright 2025
Kilimo Kwanza is distributed under the terms of the GNU GPL v2 or later.
*/

/* ========================================
   CSS Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #4CAF50;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2E7D32;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #333;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

/* ========================================
   Layout Structure
   ======================================== */
.site-main {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* ========================================
   Header Styles
   ======================================== */
.site-header {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.site-branding {
    display: flex;
    align-items: center;
}

.site-logo {
    max-height: 60px;
    width: auto;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #2E7D32;
}

.site-title a {
    color: #2E7D32;
}

.site-description {
    font-size: 0.875rem;
    color: #666;
    margin: 0;
}

/* Navigation */
.main-navigation {
    display: flex;
    align-items: center;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    color: #333;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.main-navigation a:hover,
.main-navigation a:focus {
    color: #4CAF50;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
    position: relative;
    padding: 6rem 0;
    background: linear-gradient(135deg, #2E7D32 0%, #1B5E20 100%);
    color: #ffffff;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><path d="M30 0L60 30L30 60L0 30Z" fill="rgba(255,255,255,0.03)"/></svg>') repeat;
    opacity: 0.1;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: #ffffff;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    line-height: 1.6;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    line-height: 1.5;
}

.btn-primary {
    background-color: #4CAF50;
    color: #ffffff;
    border-color: #4CAF50;
}

.btn-primary:hover {
    background-color: #45a049;
    border-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    background-color: #ffffff;
    color: #2E7D32;
    border-color: #ffffff;
}

.btn-secondary:hover {
    background-color: #f5f5f5;
    border-color: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-outline {
    background-color: transparent;
    color: #ffffff;
    border-color: #ffffff;
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    color: #ffffff;
}

/* ========================================
   Section Styles
   ======================================== */
.section {
    padding: 5rem 0;
}

.section.bg-light {
    background-color: #f8f9fa;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

.section-subtitle {
    font-size: 1.125rem;
    color: #666;
    line-height: 1.6;
}

.section-footer {
    text-align: center;
    margin-top: 3rem;
}

/* ========================================
   Features/Services Grid
   ======================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.feature-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 1rem;
}

.feature-link {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.feature-link:hover {
    color: #2E7D32;
}

/* ========================================
   Posts/Resources Grid
   ======================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.post-thumbnail-wrapper {
    overflow: hidden;
    background-color: #f5f5f5;
    aspect-ratio: 16 / 9;
}

.post-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-thumbnail {
    transform: scale(1.05);
}

.post-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #888;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.post-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.post-categories a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 500;
}

.post-categories a:hover {
    color: #2E7D32;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: #4CAF50;
}

.post-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 1.5rem;
    flex: 1;
}

.read-more {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    align-self: flex-start;
}

.read-more:hover {
    color: #2E7D32;
}

.no-posts {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.125rem;
}

/* ========================================
   Call to Action Section
   ======================================== */
.cta-section {
    background: linear-gradient(135deg, #2E7D32 0%, #1B5E20 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><circle cx="30" cy="30" r="2" fill="rgba(255,255,255,0.05)"/></svg>') repeat;
    opacity: 0.05;
    z-index: 1;
}

.cta-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.cta-description {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    line-height: 1.6;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background: #1B5E20;
    color: #ffffff;
    padding: 3rem 0 1rem;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-widget {
    color: #ffffff;
}

.footer-widget h3 {
    color: #ffffff;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.footer-widget ul {
    list-style: none;
    padding: 0;
}

.footer-widget li {
    margin-bottom: 0.5rem;
}

.footer-widget a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.footer-widget a:hover {
    color: #ffffff;
}

.site-info {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center {
    text-align: center;
}

.mt-lg {
    margin-top: 3rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 992px) {
    .section {
        padding: 4rem 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .features-grid,
    .posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 4rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .cta-title {
        font-size: 2rem;
    }
    
    .cta-description {
        font-size: 1.1rem;
    }
    
    /* Mobile Navigation */
    .menu-toggle {
        display: block;
    }
    
    .main-navigation ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        padding: 1rem;
    }
    
    .main-navigation.toggled ul {
        display: flex;
    }
    
    .header-container {
        flex-wrap: wrap;
    }
}

@media (max-width: 576px) {
    .section {
        padding: 3rem 0;
    }
    
    .section-header {
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .features-grid,
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .btn {
        width: 100%;
        padding: 0.75rem 1.5rem;
    }
    
    .hero-buttons,
    .cta-buttons {
        flex-direction: column;
    }
}

/* ========================================
   Accessibility
   ======================================== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    z-index: 100;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

a:focus,
button:focus,
.btn:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .feature-card,
    .post-card {
        border: 2px solid currentColor;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .site-header,
    .hero-buttons,
    .cta-buttons,
    .read-more,
    .feature-link,
    .site-footer {
        display: none;
    }
    
    .post-card,
    .feature-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    body {
        font-size: 12pt;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}
