/* ============================================================
   AlgeriaPilot v2 — Main Stylesheet (مطابق للتصاميم المرفقة)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:'Tajawal',sans-serif;background-color:hsl(40,25%,97%);color:hsl(210,25%,15%);direction:rtl;line-height:1.6;min-height:100vh;display:flex;flex-direction:column}
main{flex:1}
a{text-decoration:none;color:inherit}
img{max-width:100%;height:auto;display:block}
ul,ol{list-style:none}
button{cursor:pointer;font-family:'Tajawal',sans-serif}

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

/* ── NAVBAR ── */
.navbar{position:sticky;top:0;z-index:100;background:rgba(255,255,255,.95);backdrop-filter:blur(8px);border-bottom:1px solid hsl(210,20%,88%)}
.navbar__inner{display:flex;align-items:center;justify-content:space-between;height:64px}
.navbar__logo{display:flex;align-items:center;gap:.5rem;font-size:1.25rem;font-weight:700;color:hsl(210,25%,15%)}
.navbar__logo-icon{display:flex;align-items:center;justify-content:center;background:hsl(195,72%,37%);color:#fff;border-radius:.5rem;width:32px;height:32px;flex-shrink:0}
.navbar__links{display:flex;align-items:center;gap:.25rem}
.navbar__link{display:inline-block;padding:.5rem 1rem;border-radius:.5rem;font-size:.875rem;font-weight:500;color:hsl(210,10%,50%);transition:background .2s,color .2s}
.navbar__link:hover{background:hsl(195,50%,95%);color:hsl(210,25%,15%)}
.navbar__link--active{background:hsla(195,72%,37%,.1);color:hsl(195,72%,37%)}
.navbar__mobile-toggle{display:none;padding:.5rem;border:none;background:none;color:hsl(210,10%,50%);border-radius:.5rem;line-height:0}
.navbar__mobile-toggle:hover{background:hsl(195,50%,95%)}
.navbar__mobile-menu{display:none;border-top:1px solid hsl(210,20%,88%);background:#fff;padding:.75rem 1rem 1rem}
.navbar__mobile-menu.is-open{display:block}
.navbar__mobile-link{display:block;padding:.75rem 1rem;border-radius:.5rem;font-size:.875rem;font-weight:500;color:hsl(210,10%,50%);transition:all .2s}
.navbar__mobile-link:hover{background:hsl(195,50%,95%)}
.navbar__mobile-link--active{background:hsla(195,72%,37%,.1);color:hsl(195,72%,37%)}
@media(max-width:768px){.navbar__links{display:none}.navbar__mobile-toggle{display:flex}}

/* ── HERO ── */
.hero{background:linear-gradient(135deg,hsl(195,72%,37%),hsl(195,55%,28%));padding:5rem 1rem;text-align:center;color:#fff}
@media(min-width:768px){.hero{padding:7rem 1rem}}
.hero__title{font-size:2.5rem;font-weight:800;margin-bottom:1rem;line-height:1.3;color:#fff}
@media(min-width:768px){.hero__title{font-size:3rem}}
.hero__subtitle{font-size:1.125rem;opacity:.9;max-width:36rem;margin:0 auto 2.5rem;color:#fff}
.hero__search{display:flex;align-items:center;max-width:36rem;margin:0 auto;background:#fff;border-radius:.75rem;overflow:hidden;box-shadow:0 10px 25px rgba(0,0,0,.15)}
.hero__search-input{flex:1;border:none;padding:1rem 1.25rem;font-size:1rem;font-family:'Tajawal',sans-serif;color:hsl(210,25%,15%);background:transparent;outline:none;direction:rtl}
.hero__search-input::placeholder{color:hsl(210,10%,50%)}
.hero__search-btn{padding:0 1.25rem;border:none;background:none;color:hsl(210,10%,50%);transition:color .2s;display:flex;align-items:center;height:56px}
.hero__search-btn:hover{color:hsl(195,72%,37%)}

/* ── CATEGORIES ── */
.categories{padding:4rem 0}
.categories__title{text-align:center;font-size:1.5rem;font-weight:700;margin-bottom:2rem}
.categories__grid{display:grid;grid-template-columns:repeat(2,1fr);gap:1rem}
@media(min-width:640px){.categories__grid{grid-template-columns:repeat(3,1fr)}}
@media(min-width:768px){.categories__grid{grid-template-columns:repeat(5,1fr)}}
.categories__card{display:flex;flex-direction:column;align-items:center;gap:.75rem;padding:1.5rem;border:1px solid hsl(210,20%,88%);border-radius:.75rem;background:#fff;text-align:center;transition:border-color .2s,box-shadow .2s;color:inherit}
.categories__card:hover{border-color:hsla(195,72%,37%,.3);box-shadow:0 4px 12px rgba(0,0,0,.08)}
.categories__card-icon{font-size:1.875rem;line-height:1}
.categories__card-label{font-size:.875rem;font-weight:600;color:hsl(210,25%,15%)}
.categories__card:hover .categories__card-label{color:hsl(195,72%,37%)}
.categories__card-count{font-size:.75rem;color:hsl(210,10%,50%)}

/* ── AD SPACE ── */
.ad-space{padding:2rem 0}
.ad-space__inner{border:2px dashed hsl(210,20%,88%);border-radius:.75rem;padding:2rem;text-align:center;color:hsl(210,10%,50%);font-size:.875rem;background:#fff}

/* ── TEMPLATES SECTION ── */
.templates{padding:3rem 0}
.templates__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:2rem;flex-wrap:wrap;gap:.5rem}
.templates__title{font-size:1.5rem;font-weight:700}
.templates__view-all{font-size:.875rem;font-weight:500;color:hsl(195,72%,37%)}
.templates__view-all:hover{text-decoration:underline}
.templates__grid{display:grid;gap:1.5rem;grid-template-columns:1fr}
@media(min-width:640px){.templates__grid{grid-template-columns:repeat(2,1fr)}}
@media(min-width:1024px){.templates__grid{grid-template-columns:repeat(4,1fr)}}

/* ── TEMPLATE CARD ── */
.template-card{display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(210,20%,88%);border-radius:.75rem;background:#fff;transition:border-color .2s,box-shadow .2s;color:inherit}
.template-card:hover{border-color:hsla(195,72%,37%,.3);box-shadow:0 8px 24px rgba(0,0,0,.1)}
.template-card__icon-area{display:flex;align-items:center;justify-content:center;background:hsla(210,15%,93%,.5);padding:2.5rem 0}
.template-card__icon{width:3rem;height:3rem;color:hsla(210,10%,50%,.4);transition:color .2s}
.template-card:hover .template-card__icon{color:hsla(195,72%,37%,.5)}
.template-card__body{display:flex;flex-direction:column;flex:1;padding:1.25rem}
.template-card__category{font-size:.75rem;font-weight:500;color:hsl(195,72%,37%);margin-bottom:.25rem;display:block}
.template-card__title{font-size:1rem;font-weight:700;color:hsl(210,25%,15%);margin-bottom:.5rem}
.template-card:hover .template-card__title{color:hsl(195,72%,37%)}
.template-card__desc{font-size:.875rem;line-height:1.7;color:hsl(210,10%,50%);flex:1;margin-bottom:1rem}
.template-card__meta{display:flex;align-items:center;justify-content:space-between;font-size:.75rem;color:hsl(210,10%,50%);flex-wrap:wrap;gap:.25rem}
.template-card__footer{border-top:1px solid hsl(210,20%,88%);background:hsla(195,50%,95%,.3);padding:.75rem 1.25rem;text-align:center;font-size:.875rem;font-weight:500;color:hsl(195,72%,37%);opacity:0;transition:opacity .2s}
.template-card:hover .template-card__footer{opacity:1}

/* ── BLOG SECTION ── */
.blog{padding:3rem 0}
.blog__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:2rem;flex-wrap:wrap;gap:.5rem}
.blog__title{font-size:1.5rem;font-weight:700}
.blog__view-all{font-size:.875rem;font-weight:500;color:hsl(195,72%,37%)}
.blog__view-all:hover{text-decoration:underline}
.blog__grid{display:grid;gap:1.5rem;grid-template-columns:1fr}
@media(min-width:640px){.blog__grid{grid-template-columns:repeat(2,1fr)}}
@media(min-width:1024px){.blog__grid{grid-template-columns:repeat(3,1fr)}}

/* ── BLOG CARD ── */
.blog-card{display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(210,20%,88%);border-radius:.75rem;background:#fff;transition:border-color .2s,box-shadow .2s;color:inherit}
.blog-card:hover{border-color:hsla(195,72%,37%,.3);box-shadow:0 8px 24px rgba(0,0,0,.1)}
.blog-card__icon-area{display:flex;align-items:center;justify-content:center;background:hsla(210,15%,93%,.5);padding:2rem 0}
.blog-card__icon{width:2.5rem;height:2.5rem;color:hsla(210,10%,50%,.4);transition:color .2s}
.blog-card:hover .blog-card__icon{color:hsla(195,72%,37%,.5)}
.blog-card__body{display:flex;flex-direction:column;flex:1;padding:1.25rem}
.blog-card__date{font-size:.75rem;color:hsl(210,10%,50%);margin-bottom:.5rem;display:block}
.blog-card__title{font-size:1rem;font-weight:700;color:hsl(210,25%,15%);margin-bottom:.5rem}
.blog-card:hover .blog-card__title{color:hsl(195,72%,37%)}
.blog-card__excerpt{font-size:.875rem;line-height:1.7;color:hsl(210,10%,50%);flex:1;margin-bottom:1rem}
.blog-card__read-more{font-size:.875rem;font-weight:500;color:hsl(195,72%,37%);display:block}

/* ── FOOTER ── */
.footer{border-top:1px solid hsl(210,20%,88%);background:#fff;margin-top:auto}
.footer__grid{display:grid;gap:2rem;padding:3rem 0}
@media(min-width:640px){.footer__grid{grid-template-columns:repeat(2,1fr)}}
@media(min-width:1024px){.footer__grid{grid-template-columns:repeat(4,1fr)}}
.footer__brand{display:flex;align-items:center;gap:.5rem;font-size:1.125rem;font-weight:700;margin-bottom:1rem;color:hsl(210,25%,15%)}
.footer__brand-icon{display:flex;align-items:center;justify-content:center;background:hsl(195,72%,37%);color:#fff;border-radius:.5rem;width:28px;height:28px;flex-shrink:0}
.footer__desc{font-size:.875rem;line-height:1.7;color:hsl(210,10%,50%)}
.footer__section-title{font-size:.875rem;font-weight:700;margin-bottom:1rem;color:hsl(210,25%,15%)}
.footer__list li{margin-bottom:.5rem}
.footer__list a{font-size:.875rem;color:hsl(210,10%,50%);transition:color .2s}
.footer__list a:hover{color:hsl(195,72%,37%)}
.footer__bottom{border-top:1px solid hsl(210,20%,88%);padding:1.5rem 0;text-align:center;font-size:.75rem;color:hsl(210,10%,50%)}

/* ============================================================
   PAGES — مطابق للملفات المرفقة
   ============================================================ */

/* ── BLOG PAGE (archive) ── */
.blog-page{padding:3rem 0}
.blog-page__title{font-size:1.875rem;font-weight:700;margin-bottom:2rem}

/* ── SINGLE BLOG POST ── */
.blog-post{padding:3rem 0}
.blog-post__container{max-width:800px;margin:0 auto}
.blog-post__back{display:inline-flex;align-items:center;gap:.25rem;font-size:.875rem;color:#6b7280;margin-bottom:1.5rem;transition:color .2s}
.blog-post__back:hover{color:hsl(195,72%,37%)}
.blog-post__header{margin-bottom:2rem;padding-bottom:1.5rem;border-bottom:1px solid hsl(210,20%,88%)}
.blog-post__date{font-size:.875rem;color:#6b7280;display:block;margin-bottom:.5rem}
.blog-post__title{font-size:2rem;font-weight:700;color:hsl(210,25%,15%);line-height:1.4}
.blog-post__content{font-size:1.0625rem;line-height:1.9;color:hsl(210,15%,30%)}
.blog-post__content h2{font-size:1.375rem;font-weight:700;color:hsl(210,25%,15%);margin:2rem 0 .75rem}
.blog-post__content h2:first-child{margin-top:0}
.blog-post__content p{margin-bottom:1rem}
.blog-post__content ul,.blog-post__content ol{margin:1rem 0;padding-right:1.5rem;list-style:initial}
.blog-post__content ol{list-style:decimal}
.blog-post__content li{margin-bottom:.5rem}
.blog-post__content strong{font-weight:700;color:hsl(210,25%,15%)}
.blog-post__content a{color:hsl(195,72%,37%);text-decoration:underline}

/* ── TEMPLATES PAGE ── */
.templates-page{padding:3rem 0}
.templates-page__title{font-size:1.875rem;font-weight:700;margin-bottom:2rem}
.templates-page__filters{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:2rem}
.templates-page__filter{padding:.5rem 1rem;border:1px solid hsl(210,20%,88%);border-radius:9999px;background:#fff;font-size:.875rem;font-weight:500;font-family:'Tajawal',sans-serif;color:hsl(210,10%,50%);transition:all .2s;text-decoration:none;display:inline-block}
.templates-page__filter:hover{border-color:hsla(195,72%,37%,.3);color:hsl(195,72%,37%)}
.templates-page__filter--active{background:hsl(195,72%,37%);color:#fff!important;border-color:hsl(195,72%,37%)}

/* ── TEMPLATE DETAIL (مطابق للملف المرفق) ── */
.template-detail{padding:3rem 0}
.template-detail__back{display:inline-flex;align-items:center;gap:.25rem;font-size:.875rem;color:#6b7280;margin-bottom:1.5rem;transition:color .2s}
.template-detail__back:hover{color:hsl(195,72%,37%)}
.template-detail__grid{display:grid;gap:2rem;grid-template-columns:1fr}
@media(min-width:1024px){.template-detail__grid{grid-template-columns:2fr 1fr}}
.template-detail__preview{display:flex;align-items:center;justify-content:center;background:hsl(40,15%,95%);border:1px solid hsl(40,15%,88%);border-radius:.75rem;padding:6rem 2rem}
.template-detail__preview-icon{color:hsl(40,10%,80%)}
.template-detail__sidebar{display:flex;flex-direction:column;gap:1.5rem}
.template-detail__meta{background:#fff;border:1px solid hsl(210,20%,88%);border-radius:.75rem;padding:1.5rem}
.template-detail__category{font-size:.875rem;font-weight:500;color:hsl(195,72%,37%);display:block;margin-bottom:.5rem}
.template-detail__title{font-size:1.5rem;font-weight:700;color:hsl(210,25%,15%);margin-top:.5rem;line-height:1.3}
.template-detail__description{margin-top:.75rem;line-height:1.8;color:#6b7280}
.template-detail__stats{display:flex;gap:1.5rem;font-size:.875rem;color:#6b7280;flex-wrap:wrap}
.template-detail__stat{display:flex;align-items:center;gap:.375rem}
.template-detail__stat svg{color:hsl(195,72%,37%);flex-shrink:0}
.template-detail__download-btn{display:flex;align-items:center;justify-content:center;gap:.5rem;width:100%;padding:.875rem 1.5rem;font-size:1rem;font-weight:600;color:#fff;background:hsl(195,72%,37%);border-radius:.5rem;transition:background .2s;border:none;font-family:'Tajawal',sans-serif}
.template-detail__download-btn:hover{background:hsl(195,55%,28%);color:#fff}

/* ── CONTACT ── */
.contact{padding:3rem 0}
.contact__inner{max-width:48rem;margin:0 auto}
.contact__title{font-size:1.875rem;font-weight:700;margin-bottom:1rem}
.contact__intro{font-size:1.125rem;color:hsl(210,10%,50%);margin-bottom:2.5rem}
.contact__info-grid{display:grid;gap:1rem;margin-bottom:2.5rem}
@media(min-width:640px){.contact__info-grid{grid-template-columns:repeat(3,1fr)}}
.contact__info-card{border:1px solid hsl(210,20%,88%);border-radius:.75rem;background:#fff;padding:1.25rem;text-align:center}
.contact__info-icon{display:block;margin:0 auto .5rem;color:hsl(195,72%,37%)}
.contact__info-label{font-size:.75rem;color:hsl(210,10%,50%)}
.contact__info-value{font-size:.875rem;font-weight:500;margin-top:.25rem}
.contact__form{border:1px solid hsl(210,20%,88%);border-radius:.75rem;background:#fff;padding:1.5rem}
.contact__form-row{display:grid;gap:1rem;margin-bottom:0}
@media(min-width:640px){.contact__form-row{grid-template-columns:repeat(2,1fr)}}
.contact__input,.contact__textarea{width:100%;border:1px solid hsl(210,20%,88%);border-radius:.5rem;background:hsl(40,25%,97%);padding:.75rem 1rem;font-size:.875rem;font-family:'Tajawal',sans-serif;outline:none;transition:border-color .2s,box-shadow .2s;display:block;margin-bottom:1rem;direction:rtl;color:hsl(210,25%,15%)}
.contact__input:focus,.contact__textarea:focus{border-color:hsl(195,72%,37%);box-shadow:0 0 0 3px hsla(195,72%,37%,.12)}
.contact__submit-btn{width:100%;padding:.875rem;border:none;border-radius:.5rem;background:hsl(195,72%,37%);color:#fff;font-size:1rem;font-weight:600;font-family:'Tajawal',sans-serif;transition:background .2s}
.contact__submit-btn:hover{background:hsl(195,55%,28%)}
.contact__feedback{margin-top:1rem;padding:.75rem 1rem;border-radius:.5rem;font-size:.875rem;display:none;text-align:center}
.contact__feedback--success{background:hsla(142,70%,45%,.1);color:hsl(142,60%,30%);display:block}
.contact__feedback--error{background:hsla(0,70%,55%,.1);color:hsl(0,60%,40%);display:block}

/* ── ABOUT ── */
.about{padding:3rem 0}
.about__inner{max-width:48rem;margin:0 auto}
.about__title{font-size:1.875rem;font-weight:700;margin-bottom:1.5rem}
.about__intro{font-size:1.125rem;line-height:1.8;color:hsl(210,10%,50%);margin-bottom:2.5rem}
.about__grid{display:grid;gap:1.5rem;margin-top:2.5rem}
@media(min-width:640px){.about__grid{grid-template-columns:repeat(3,1fr)}}
.about__card{border:1px solid hsl(210,20%,88%);border-radius:.75rem;background:#fff;padding:1.5rem;text-align:center}
.about__card-icon{display:block;margin:0 auto .75rem;color:hsl(195,72%,37%)}
.about__card-title{font-weight:700;margin-bottom:.5rem;font-size:1.125rem}
.about__card-desc{font-size:.875rem;color:hsl(210,10%,50%)}

/* ── DISCLAIMER ── */
.disclaimer{padding:3rem 0}
.disclaimer__inner{max-width:48rem;margin:0 auto}
.disclaimer__title{font-size:1.875rem;font-weight:700;margin-bottom:2rem}
.disclaimer__content{display:flex;flex-direction:column;gap:1.5rem}
.disclaimer__section{background:#fff;border:1px solid hsl(210,20%,88%);border-radius:.75rem;padding:1.5rem}
.disclaimer__section-title{font-size:1.125rem;font-weight:600;margin-bottom:.75rem}
.disclaimer__text{font-size:.9375rem;line-height:1.8;color:hsl(210,10%,50%)}

/* ── 404 ── */
.error-page{display:flex;align-items:center;justify-content:center;min-height:60vh;padding:3rem 1rem}
.error-page__container{display:flex;flex-direction:column;align-items:center;gap:1.25rem;text-align:center;max-width:32rem;margin:0 auto}
.error-page__icon{color:hsl(40,10%,75%)}
.error-page__code{font-size:6rem;font-weight:800;color:hsl(195,72%,37%);line-height:1}
.error-page__message{font-size:1.25rem;font-weight:600}
.error-page__hint{color:#6b7280;line-height:1.7}
.error-page__btn{display:inline-flex;align-items:center;padding:.875rem 2rem;background:hsl(195,72%,37%);color:#fff;border-radius:.625rem;font-weight:600;font-family:'Tajawal',sans-serif;font-size:1rem;transition:background .2s}
.error-page__btn:hover{background:hsl(195,55%,28%);color:#fff}

/* ── PAGINATION ── */
.pagination{display:flex;justify-content:center;align-items:center;gap:.5rem;margin-top:3rem;flex-wrap:wrap}
.pagination a,.pagination span{display:inline-flex;align-items:center;justify-content:center;min-width:2.5rem;height:2.5rem;padding:0 .75rem;border:1px solid hsl(210,20%,88%);border-radius:.5rem;font-size:.875rem;font-weight:500;color:hsl(210,10%,50%);background:#fff;transition:all .2s}
.pagination a:hover{border-color:hsl(195,72%,37%);color:hsl(195,72%,37%)}
.pagination .current{background:hsl(195,72%,37%);color:#fff;border-color:hsl(195,72%,37%)}

/* ── WP EDITOR CONTENT ── */
.wp-content h1,.wp-content h2,.wp-content h3{font-weight:700;color:hsl(210,25%,15%);margin:1.5rem 0 .75rem}
.wp-content h2{font-size:1.375rem}
.wp-content h3{font-size:1.125rem}
.wp-content p{margin-bottom:1rem;line-height:1.8;color:hsl(210,15%,30%)}
.wp-content ul{list-style:disc;padding-right:1.5rem;margin-bottom:1rem}
.wp-content ol{list-style:decimal;padding-right:1.5rem;margin-bottom:1rem}
.wp-content li{margin-bottom:.5rem;color:hsl(210,15%,30%)}
.wp-content strong{font-weight:700;color:hsl(210,25%,15%)}
.wp-content a{color:hsl(195,72%,37%);text-decoration:underline}
.wp-content img{border-radius:.75rem;margin:1.5rem 0}
.wp-content blockquote{border-right:4px solid hsl(195,72%,37%);padding:.75rem 1rem;background:hsl(195,50%,97%);border-radius:0 .5rem .5rem 0;margin:1.5rem 0;color:hsl(210,10%,40%);font-style:italic}

/* ── SEARCH ── */
.search-results{padding:3rem 0}
.search-results__title{font-size:1.875rem;font-weight:700;margin-bottom:2rem}
.search-results__empty{text-align:center;padding:4rem 1rem;color:hsl(210,10%,50%)}

/* ── TAXONOMY ── */
.taxonomy-header{padding:2rem 0 0}
.taxonomy-header h1{font-size:1.875rem;font-weight:700;margin-bottom:.5rem}
.taxonomy-header p{color:hsl(210,10%,50%);margin-bottom:2rem}

/* ── ADMIN BAR FIX ── */
.admin-bar .navbar{top:32px}
@media(max-width:782px){.admin-bar .navbar{top:46px}}
