/* ========================================
   Global Styles - موقع المعلم عبد الله
   (NO sticky header + mobile header stacked)
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --gray: #6c757d;
    --border-color: #dee2e6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Arial', sans-serif;
    line-height: 1.8;
    color: var(--text-color);
    background-color: var(--white);
    direction: rtl;
    text-align: right;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles (✅ NOT sticky, scrolls normally) */
header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);

    /* ✅ remove sticky behavior */
    position: static;
    top: auto;
    z-index: auto;
}

/* Desktop header layout (logo | nav | social) */
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px; /* helps when wrapping occurs */
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--white);
    text-decoration: none;
}

/* Nav */
nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

nav ul li a {
    color: var(--white);
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
    padding: 5px 10px;
}

nav ul li a:hover {
    color: var(--secondary-color);
}

/* Social Media Icons */
.social-media {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.social-media a img {
    width: 30px;
    height: 30px;
    transition: transform 0.3s;
}

.social-media a:hover img {
    transform: scale(1.2);
}

/* Main Content */
main {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 80px 20px;
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* Article Card */
.article-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 30px;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.article-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.article-card-content {
    padding: 25px;
}

.article-card h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.article-card p {
    color: var(--gray);
    margin-bottom: 15px;
    line-height: 1.6;
}

.article-card a {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 10px 25px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.article-card a:hover {
    background-color: var(--primary-color);
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Article Content Page */
.article-content {
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.article-content h1 {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 20px;
    line-height: 1.4;
}

.article-content h2 {
    font-size: 28px;
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
}

.article-content h3 {
    font-size: 22px;
    color: var(--secondary-color);
    margin-top: 25px;
    margin-bottom: 12px;
}

.article-content p {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
    margin: 20px 0;
    padding-right: 40px;
}

.article-content li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.article-content blockquote {
    background-color: var(--light-bg);
    border-right: 5px solid var(--secondary-color);
    padding: 20px;
    margin: 25px 0;
    font-style: italic;
    border-radius: 5px;
}

/* Related Articles */
.related-articles {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.related-articles h2 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 30px;
    text-align: center;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
}

/* Carousel Styles */
.carousel {
    position: relative;
    max-width: 100%;
    margin: 40px auto;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.carousel-inner {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-item {
    min-width: 100%;
    position: relative;
}

.carousel-item img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: var(--white);
    padding: 30px;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.carousel-control {
    background-color: rgba(0,0,0,0.5);
    color: var(--white);
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 24px;
    transition: background-color 0.3s;
}

.carousel-control:hover {
    background-color: rgba(0,0,0,0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* ✅ Mobile header becomes vertical "one after one" and scrolls normally */
    header .container {
        flex-direction: column;
        align-items: stretch;   /* full width blocks */
        gap: 14px;
    }

    .logo {
        text-align: center;
    }

    nav ul {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        align-items: center;
    }

    .social-media {
        justify-content: center;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero p {
        font-size: 16px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .article-content {
        padding: 20px;
    }

    .article-content h1 {
        font-size: 28px;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mt-40 {
    margin-top: 40px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-40 {
    margin-bottom: 40px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--secondary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn:hover {
    background-color: var(--primary-color);
}

.btn-primary {
    background-color: var(--secondary-color);
}

.btn-accent {
    background-color: var(--accent-color);
}
@media (max-width: 768px) {
  /* header items still stacked (logo, nav, socials) */
  header .container{
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .logo{
    text-align:center;
  }

  /* ✅ NAV stays HORIZONTAL on mobile */
  nav ul{
    flex-direction: row;      /* was column */
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;          /* allows wrapping to next line if too many links */
    text-align: center;
  }

  nav ul li a{
    display: inline-block;
    padding: 8px 10px;
    font-size: 15px;
    white-space: nowrap;      /* keeps each link on one line */
  }

  /* socials centered */
  .social-media{
    justify-content: center;
  }

  .hero h1{ font-size: 32px; }
  .hero p{ font-size: 16px; }

  .articles-grid{ grid-template-columns: 1fr; }
  .article-content{ padding: 20px; }
  .article-content h1{ font-size: 28px; }
  .footer-content{ grid-template-columns: 1fr; }
}