/* EasyDarija - Main Stylesheet */
/* Moroccan Flag Color Scheme */

:root {
    --morocco-red: #C1272D;
    --morocco-green: #006233;
    --dark-red: #9A1F23;
    --light-green: #008040;
    --text-dark: #333;
    --text-light: #777;
    --bg-light: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--morocco-red) 0%, var(--morocco-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: color 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--morocco-red);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--morocco-red);
    border-radius: 3px;
    transition: all 0.3s;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--morocco-red) 0%, var(--morocco-green) 100%);
    color: white;
    padding: 100px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 40px;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 18px 40px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s;
    display: inline-block;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--morocco-red) 0%, var(--dark-red) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(193, 39, 45, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(193, 39, 45, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--morocco-red);
    border: 2px solid var(--morocco-red);
}

.btn-secondary:hover {
    background: var(--morocco-red);
    color: white;
}

.btn-full {
    width: 100%;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--morocco-red) 0%, var(--morocco-green) 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
}

.page-header p {
    font-size: 1.3rem;
    opacity: 0.95;
}

/* Features Section */
.features {
    padding: 80px 20px;
    background: var(--bg-light);
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--morocco-red);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--morocco-red);
    box-shadow: 0 8px 30px rgba(193, 39, 45, 0.2);
}

.feature-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--morocco-green);
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.8;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--morocco-green) 0%, var(--morocco-red) 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 60px 20px 20px 20px;
}

.footer-contact-section {
    margin-bottom: 60px;
}

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

.footer-section h4 {
    color: var(--morocco-red);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.footer-section p {
    color: #bbb;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #444;
    color: #999;
}

/* Blog */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

.blog-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.blog-card:hover {
    transform: translateY(-5px);
    border-color: var(--morocco-red);
    box-shadow: 0 8px 30px rgba(193, 39, 45, 0.2);
}

.blog-card-content {
    padding: 25px;
}

.blog-card h3 {
    color: var(--morocco-green);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.blog-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tag {
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    color: var(--text-dark);
}

/* Blog Post Single */
.blog-post-single {
    padding: 60px 20px;
    background: var(--bg-light);
}

.back-link {
    display: inline-block;
    color: var(--morocco-red);
    text-decoration: none;
    margin-bottom: 30px;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.post-header {
    margin-bottom: 40px;
}

.post-header h1 {
    font-size: 2.5rem;
    color: var(--morocco-red);
    margin-bottom: 20px;
}

.post-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    color: var(--morocco-green);
    margin-top: 30px;
    margin-bottom: 15px;
}

.post-content p {
    margin-bottom: 20px;
}

.post-content ul,
.post-content ol {
    margin: 20px 0 20px 40px;
}

.post-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 20px 0;
}

/* App Showcase */
.app-showcase {
    padding: 80px 20px;
    background: white;
}

.app-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.app-info h2 {
    font-size: 2.5rem;
    color: var(--morocco-red);
    margin-bottom: 20px;
}

.app-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.app-features {
    margin: 30px 0;
}

.feature {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.feature-icon {
    color: var(--morocco-green);
    font-weight: 700;
    font-size: 1.5rem;
}

.app-download-btns {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.app-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: black;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s;
}

.app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.app-btn-icon svg {
    width: 30px;
    height: 30px;
}

.app-btn-label {
    font-size: 0.75rem;
    display: block;
}

.app-btn-store {
    font-size: 1.1rem;
    font-weight: 700;
    display: block;
}

.phone-frame {
    background: linear-gradient(135deg, var(--morocco-red) 0%, var(--morocco-green) 100%);
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 300px;
    margin: 0 auto;
}

.phone-content {
    background: white;
    border-radius: 20px;
    padding: 40px 20px;
    min-height: 500px;
}

/* FAQ */
.app-faq {
    padding: 80px 20px;
    background: var(--bg-light);
}

.app-faq h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--morocco-red);
    margin-bottom: 40px;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.faq-item:hover {
    border-color: var(--morocco-red);
}

.faq-item summary {
    font-weight: 700;
    color: var(--morocco-green);
    cursor: pointer;
    font-size: 1.1rem;
}

.faq-item p {
    margin-top: 15px;
    color: var(--text-light);
    line-height: 1.8;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        padding: 20px;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .features h2,
    .cta-section h2 {
        font-size: 2rem;
    }
    
    .app-hero {
        grid-template-columns: 1fr;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer contact form: fit small screens (inputs were wider than the phone screen) */
.footer-contact-section input,
.footer-contact-section textarea { box-sizing: border-box; min-width: 0; max-width: 100%; }
@media (max-width: 600px) {
    .footer-contact-section { padding: 40px 20px !important; }
    .footer-contact-section form > div { grid-template-columns: 1fr !important; }
}

/* Translate button */
.ed-translate { position: fixed; left: 16px; bottom: 16px; z-index: 1000; font-family: inherit; }
.ed-translate-btn { background: #006233; color: #fff; border: none; border-radius: 30px; padding: 10px 18px; font-weight: 700; font-size: 0.95rem; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.2); transition: all 0.3s; }
.ed-translate-btn:hover { background: #008040; transform: translateY(-2px); }
.ed-translate-menu { position: absolute; left: 0; bottom: 52px; background: #fff; list-style: none; margin: 0; padding: 8px 0; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,0.18); max-height: 60vh; overflow-y: auto; min-width: 190px; }
.ed-translate-menu a { display: block; padding: 8px 18px; color: #333; text-decoration: none; }
.ed-translate-menu a:hover { background: #e8f5ee; color: #006233; }

/* Blog list: search, tag filter and crawlable article cards (built by scripts/build.py) */
.blog-controls { margin-bottom: 2rem; background: #fff; padding: 2rem; border-radius: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
#search-input { width: 100%; box-sizing: border-box; padding: 16px 22px; border: 2px solid #e5e5e5; border-radius: 14px; font-size: 1.05rem; margin-bottom: 1.25rem; font-family: inherit; transition: all 0.3s; }
#search-input:focus { outline: none; border-color: #006233; box-shadow: 0 0 0 4px rgba(0, 98, 51, 0.1); }
.tag-filters { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.tag-filters .tag { cursor: pointer; border: 2px solid transparent; font-weight: 700; font-family: inherit; transition: all 0.3s; }
.tag-filters .tag:hover, .tag-filters .tag.active { background: #006233; color: #fff; border-color: #006233; }
.blog-card { position: relative; }
.blog-card h3 a { color: inherit; text-decoration: none; }
.blog-card h3 a::after { content: ""; position: absolute; inset: 0; }
.blog-card h3 a:hover { color: #C1272D; }
.blog-card-meta { color: var(--text-light); font-size: 0.9rem; margin-bottom: 12px; font-weight: 600; }
.blog-card-excerpt { color: var(--text-light); margin-bottom: 1.25rem; line-height: 1.6; }
.blog-card-tags { position: relative; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.no-results { text-align: center; padding: 3rem; color: var(--text-light); font-size: 1.15rem; font-weight: 600; }
.post-meta { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; color: var(--text-light); font-weight: 600; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 600px) {
    .post-content { padding: 22px; font-size: 1rem; }
    .post-header h1 { font-size: 1.9rem; }
    .blog-grid { grid-template-columns: 1fr; }
    .blog-controls { padding: 1.25rem; }
}
@media print { .ed-translate { display: none; } }
