/* مدونة الويب - Frontend CSS */

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

:root {
    --primary-color: #e91e8c;
    --secondary-color: #6f42c1;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --bg-light: #f8f9fa;
    --white: #ffffff;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    direction: rtl;
    background: var(--white);
}

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

/* Header */
.site-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo a {
    text-decoration: none;
}

.main-nav {
    display: flex;
    gap: 30px;
}

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

.nav-link:hover {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 15px;
}

.search-toggle,
.menu-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s;
}

.search-toggle:hover,
.menu-toggle:hover {
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
}

/* Search Box */
.search-box {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.search-box.active {
    max-height: 100px;
    padding: 20px 0;
}

.search-box form {
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 14px;
}

.search-box button {
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
}

/* Hero Section */
.hero-section {
    padding: 60px 0;
    background: linear-gradient(135deg, rgba(233, 30, 140, 0.05), rgba(111, 66, 193, 0.05));
}

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

.hero-image {
    display: block;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.hero-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: transform 0.3s;
}

.hero-image:hover img {
    transform: scale(1.05);
}

.category-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 15px;
}

.hero-title {
    font-size: 36px;
    line-height: 1.4;
    margin-bottom: 15px;
}

.hero-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.hero-title a:hover {
    color: var(--primary-color);
}

.post-meta {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
}

.hero-excerpt {
    color: var(--text-light);
    font-size: 16px;
    line-height: 1.8;
}

/* Categories Section */
.categories-section {
    padding: 60px 0;
    background: var(--bg-light);
}

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

.category-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon img {
    width: 50px;
    height: 50px;
}

.category-card h3 {
    font-size: 20px;
    font-weight: 700;
}

/* Posts Section */
.posts-section {
    padding: 60px 0;
}

.section-title {
    font-size: 32px;
    margin-bottom: 40px;
    text-align: center;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.post-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.post-image {
    display: block;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .post-image img {
    transform: scale(1.1);
}

.post-content {
    padding: 25px;
}

.post-title {
    font-size: 20px;
    line-height: 1.4;
    margin: 15px 0;
}

.post-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination-btn {
    padding: 10px 20px;
    background: white;
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.pagination-btn:hover,
.pagination-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

/* Single Post */
.post-header {
    padding: 60px 0 40px;
    text-align: center;
}

.post-header h1 {
    font-size: 42px;
    line-height: 1.3;
    margin: 20px 0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.post-featured-image {
    margin: 40px 0;
}

.post-featured-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 15px;
}

.post-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    font-size: 18px;
    line-height: 1.8;
}

.post-body h2,
.post-body h3 {
    margin: 30px 0 15px;
    color: var(--text-color);
}

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

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
}

/* Footer */
.site-footer {
    background: #2c3e50;
    color: white;
    padding: 60px 0 20px;
    margin-top: 80px;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

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

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

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

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.social-links a:hover {
    background: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* Scroll to Top */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .hero-main {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .post-header h1 {
        font-size: 32px;
    }
}

/* Contact Info in Footer */
.footer-links.contact-info li {
    color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.footer-links.contact-info i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}
