/*
Theme Name: motrafic pro v2
Theme URI: https://example.com/
Author: mohamed ashraf
Author URI: https://example.com/
Description: قالب ووردبريس عربي احترافي لشركات الخدمات والمقاولات مع نظام مقالات متطور.
Version: 2.0.0
Text Domain: motrafic-v2
*/

@import url("./styles.css");

.articles-page { padding: 140px 0 80px; background: var(--bg); }
.articles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; align-items: stretch; }
.article-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; min-height: 100%; }
.article-body { padding: 18px; text-align: center; }
.article-title { font-size: 1.2rem; color: var(--primary); margin-bottom: 8px; }
.article-excerpt { color: var(--text-muted); }

.custom-logo-link { display: inline-flex; align-items: center; }
.custom-logo { max-height: 54px; width: auto; }

.page-numbers { display: inline-flex; gap: 8px; list-style: none; padding: 0; }
.page-numbers li a, .page-numbers li span {
    display: inline-flex; min-width: 38px; height: 38px; align-items: center; justify-content: center;
    border-radius: 10px; background: #fff; border: 1px solid #e2e8f0; color: var(--primary); padding: 0 10px;
}
.page-numbers .current { background: var(--accent); color: #fff; border-color: var(--accent); }

.single-article { max-width: 950px; margin: 0 auto; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.single-cover img { width: 100%; max-height: 460px; object-fit: cover; }
.single-body { padding: 30px; }
.single-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--text-muted); font-size: .95rem; margin-bottom: 14px; }
.single-title { font-size: clamp(1.8rem, 3vw, 2.5rem); color: var(--primary); margin-bottom: 16px; line-height: 1.4; }
.single-content { color: #334155; line-height: 2; font-size: 1.05rem; }
.single-content p, .single-content ul, .single-content ol, .single-content h2, .single-content h3 { margin-bottom: 14px; }
.single-content img { border-radius: 12px; margin: 18px auto; }
.single-tags { margin-top: 20px; color: var(--text-muted); }
.single-share { margin-top: 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.single-nav { max-width: 950px; margin: 16px auto 0; display: flex; justify-content: space-between; gap: 12px; }
.single-nav a { display: inline-flex; padding: 10px 16px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; color: var(--primary); }
.single-related { max-width: 950px; margin: 30px auto 0; }
.single-related h3 { margin-bottom: 16px; color: var(--primary); }

.reading-progress {
    position: fixed; top: 0; right: 0; width: 0; height: 4px;
    background: linear-gradient(90deg,var(--accent),var(--accent-dark)); z-index: 2000;
}

/* ===== Cards Tuning ===== */
.service-card,
.gallery-item,
.article-card,
.testimonial-card {
    border-radius: 14px !important;
    overflow: hidden !important;
    border: 1px solid #e7edf5 !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08) !important;
}

.service-card:hover,
.gallery-item:hover,
.article-card:hover,
.testimonial-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14) !important;
}

.services-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px !important;
}

.service-img-wrapper {
    height: 210px !important;
    background: #f1f5f9 !important;
}

.service-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
}

.service-content {
    padding: 14px 16px !important;
}

.service-title {
    font-size: 20px !important;
    line-height: 1.35 !important;
    margin-bottom: 8px !important;
}

.service-desc {
    font-size: 13px !important;
    line-height: 1.65 !important;
    margin-bottom: 0 !important;
}

.gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
    grid-auto-flow: row !important;
}

.gallery-item {
    height: 280px !important;
}

.gallery-item:nth-child(2),
.gallery-item:nth-child(5) {
    grid-row: auto !important;
    height: 280px !important;
}

.gallery-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
}

.article-card img {
    width: 100%;
    height: 210px;
    object-fit: cover;
}

@media (max-width: 992px) {
    .services-grid,
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    .services-grid,
    .gallery-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .service-img-wrapper {
        height: 190px !important;
    }

    .gallery-item {
        height: 240px !important;
    }

    .service-title {
        font-size: 18px !important;
    }
}

/* ===== SEO / archive template improvements ===== */
.article-card img,
.article-image-link img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block;
}
.article-image-link { display: block; }
.article-meta { color: var(--text-muted); font-size: .9rem; margin-bottom: 8px; }
.article-readmore {
    display: inline-flex;
    margin-top: 12px;
    color: var(--accent);
    font-weight: 700;
}
.article-title a,
.service-title a { color: inherit; }
.pagination-wrap { text-align: center; margin-top: 32px; }
.nav-links .menu-item { list-style: none; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: inherit; }
.motrafic-breadcrumbs { margin-bottom: 20px; font-size: .95rem; color: var(--text-muted); }
.search-page-form,
.not-found-actions { margin: 24px auto; max-width: 760px; text-align: center; }
.not-found-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.search-page-form form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.search-page-form input[type="search"],
.search-page-form input[type="text"] {
    min-width: min(420px, 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
}
.search-page-form input[type="submit"],
.search-page-form button[type="submit"] {
    border: 0;
    border-radius: 10px;
    padding: 12px 18px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

/* ===== Custom post type templates: services and projects ===== */
.service-detail-page,
.service-archive-page,
.project-detail-page,
.project-archive-page {
    padding: 110px 0 70px;
    background: #f8fafc;
}

.service-detail,
.project-detail {
    display: block;
}

.service-detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
    gap: 28px;
    align-items: center;
    background: #fff;
    border: 1px solid #e7edf5;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    margin-bottom: 28px;
}

.service-detail-copy .single-title {
    margin: 12px 0 14px;
}

.service-lead {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.9;
    margin-bottom: 22px;
}

.service-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.service-actions-center {
    justify-content: center;
}

.btn-whatsapp {
    background: #25d366;
    color: #fff !important;
    border: 1px solid #25d366;
}

.service-detail-image img,
.project-hero img {
    width: 100%;
    height: 360px;
    object-fit: cover;
    border-radius: 16px;
    display: block;
}

.service-content-main,
.project-content-main {
    background: #fff;
    border: 1px solid #e7edf5;
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.service-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.service-feature-card,
.service-steps,
.service-cta-box {
    background: #fff;
    border: 1px solid #e7edf5;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.service-feature-card i {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(0, 100, 80, .08);
    color: var(--accent);
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.service-feature-card h2,
.service-steps h2,
.service-cta-box h2,
.service-related h2 {
    font-size: 1.35rem;
    margin-bottom: 10px;
}

.service-feature-card p,
.service-cta-box p,
.service-steps li {
    color: var(--text-muted);
    line-height: 1.8;
}

.service-steps {
    margin-bottom: 28px;
}

.service-steps ol {
    margin: 0;
    padding-right: 22px;
}

.service-cta-box {
    text-align: center;
    margin-bottom: 34px;
}

.archive-cta-box {
    margin-top: 36px;
}

.service-img-wrapper {
    display: block;
}

.project-hero {
    position: relative;
    background: #fff;
    border: 1px solid #e7edf5;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 28px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.project-hero img {
    border-radius: 0;
    height: 430px;
}

.project-hero-title {
    position: absolute;
    right: 24px;
    left: 24px;
    bottom: 24px;
    background: rgba(255, 255, 255, .94);
    border-radius: 16px;
    padding: 20px;
}

.project-archive-grid .gallery-item {
    height: 310px !important;
}

@media (max-width: 992px) {
    .service-detail-hero,
    .service-feature-grid {
        grid-template-columns: 1fr;
    }

    .service-detail-image img,
    .project-hero img {
        height: 280px;
    }
}

@media (max-width: 768px) {
    .service-detail-page,
    .service-archive-page,
    .project-detail-page,
    .project-archive-page {
        padding-top: 90px;
    }

    .service-detail-hero,
    .service-content-main,
    .project-content-main,
    .service-feature-card,
    .service-steps,
    .service-cta-box {
        padding: 18px;
    }

    .project-hero-title {
        position: static;
        margin: 0;
        border-radius: 0;
    }
}
