/* ================================================================
   أجابة — Design System
   ================================================================ */

:root {
    --primary:       #f4952f;
    --primary-dark:  #d97c1a;
    --dark:          #1a1a2e;
    --dark-2:        #16213e;
    --light:         #f8f9fa;
    --white:         #ffffff;
    --text:          #2d2d2d;
    --text-muted:    #777;
    --border:        #eeeeee;
    --shadow:        0 2px 16px rgba(0,0,0,0.08);
    --radius:        8px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { color: var(--text); background: #fff; }

a { transition: color 0.2s; }
a:hover { text-decoration: none; }

img { max-width: 100%; }

/* ---- Buttons ---- */
.site-btn,
.primary-btn {
    background: var(--primary) !important;
    border: none !important;
    color: #fff !important;
    border-radius: 25px !important;
    padding: 10px 28px !important;
    font-weight: 600 !important;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s !important;
    cursor: pointer;
}
.site-btn:hover,
.primary-btn:hover {
    background: var(--primary-dark) !important;
    color: #fff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(244,149,47,0.35) !important;
}

/* ================================================================
   HEADER
   ================================================================ */

/* Hide old header sections — replaced by .ajabaa-header */
.header { display: none !important; }
.header__top { display: none !important; }

.ajabaa-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 3px solid var(--primary);
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

.ajabaa-header__inner {
    display: flex;
    align-items: center;
    height: 68px;
    gap: 16px;
    padding: 0 16px;
}

/* Logo */
.ajabaa-header__logo { flex-shrink: 0; }
.ajabaa-header__logo img {
    height: 52px;
    width: auto;
    display: block;
    transition: opacity 0.2s;
}
.ajabaa-header__logo img:hover { opacity: 0.85; }

/* Nav */
.ajabaa-header__nav { flex: 1; }
.ajabaa-header__nav > ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}
.ajabaa-header__nav > ul > li { position: relative; }
.ajabaa-header__nav > ul > li > a {
    display: block;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-transform: none;
    color: var(--text);
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}
.ajabaa-header__nav > ul > li > a:hover,
.ajabaa-header__nav > ul > li > a.active {
    color: var(--primary);
    background: rgba(244,149,47,0.08);
}

/* Mega menu */
.ajabaa-header__nav .header__megamenu__wrapper {
    position: absolute;
    top: 100%;
    right: 0;
    width: 600px;
    padding: 16px;
    background: #fff;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    border-top: 3px solid var(--primary);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s;
    z-index: 999;
}
.ajabaa-header__nav > ul > li:hover .header__megamenu__wrapper {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Grid layout — 5 equal square items */
.ajabaa-header__nav .header__megamenu {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 0;
}
.ajabaa-header__nav .header__megamenu__item {
    width: auto;
    float: none;
    margin: 0;
}
.ajabaa-header__nav .header__megamenu__item--pic {
    aspect-ratio: 1 / 1;
    height: auto !important;
    border-radius: 6px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    margin-bottom: 8px;
    position: relative;
}
.ajabaa-header__nav .header__megamenu__item--pic .label {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    padding: 4px 6px;
    font-size: 10px;
    font-family: inherit;
    font-weight: 600;
    text-transform: none;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    border-radius: 0 0 6px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ajabaa-header__nav .header__megamenu__item--text {
    text-align: center;
}
.ajabaa-header__nav .header__megamenu__item--text h5 {
    font-size: 11px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.ajabaa-header__nav .header__megamenu__item--text h5 a {
    color: var(--text);
}
.ajabaa-header__nav .header__megamenu__item--text h5 a:hover {
    color: var(--primary);
}

/* Actions (search + hamburger) */
.ajabaa-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.ajabaa-header__actions button {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.ajabaa-header__actions button:hover {
    background: rgba(244,149,47,0.1);
    color: var(--primary);
}
.ajabaa-header__hamburger { display: none; }

@media (max-width: 991px) {
    .ajabaa-header__nav { display: none; }
    .ajabaa-header__hamburger { display: flex !important; }
}

/* ================================================================
   FOOTER
   ================================================================ */

/* Hide old footer */
footer.footer { display: none !important; }

.ajabaa-footer {
    background: var(--dark);
    color: #b0b8cc;
    margin-top: 60px;
    padding-top: 50px;
}

.ajabaa-footer h5 {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

/* About column */
.ajabaa-footer__logo {
    height: 70px;
    width: auto;
    margin-bottom: 14px;
    filter: brightness(1.1);
}
.ajabaa-footer__desc {
    font-size: 13px;
    line-height: 1.8;
    color: #9aa3b8;
    margin-bottom: 18px;
}
.ajabaa-footer__social { display: flex; gap: 10px; flex-wrap: wrap; }
.ajabaa-footer__social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #fff;
    transition: transform 0.2s, opacity 0.2s;
    text-decoration: none;
}
.ajabaa-footer__social a:hover { transform: translateY(-3px); opacity: 0.85; }
.ajabaa-footer__social .s-fb  { background: #3b5998; }
.ajabaa-footer__social .s-tw  { background: #1da1f2; }
.ajabaa-footer__social .s-ig  { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.ajabaa-footer__social .s-yt  { background: #ff0000; }
.ajabaa-footer__social .s-em  { background: #555; }

/* Quick links */
.ajabaa-footer__links { list-style: none; padding: 0; margin: 0; }
.ajabaa-footer__links li { margin-bottom: 10px; }
.ajabaa-footer__links li a {
    color: #9aa3b8;
    font-size: 13px;
    transition: color 0.2s, padding-right 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.ajabaa-footer__links li a::before {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.ajabaa-footer__links li a:hover {
    color: var(--primary);
    padding-right: 4px;
}
.ajabaa-footer__links li a:hover::before { transform: scale(1.4); }

/* Latest posts */
.ajabaa-footer__post {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    text-decoration: none;
}
.ajabaa-footer__post img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.ajabaa-footer__post span {
    font-size: 12px;
    color: var(--primary);
    display: block;
    margin-bottom: 3px;
}
.ajabaa-footer__post p {
    font-size: 12px;
    color: #9aa3b8;
    margin: 0;
    line-height: 1.4;
    transition: color 0.2s;
}
.ajabaa-footer__post:hover p { color: #fff; }

/* Copyright bar */
.ajabaa-footer__copyright {
    background: var(--dark-2);
    margin-top: 40px;
    padding: 16px 0;
    text-align: center;
}
.ajabaa-footer__copyright p {
    margin: 0;
    font-size: 13px;
    color: #6b7491;
}
.ajabaa-footer__copyright a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.ajabaa-footer__copyright a:hover { color: var(--primary-dark); }

/* ================================================================
   PAGE HERO / BREADCRUMB
   ================================================================ */

.page-hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
    padding: 32px 0 28px;
    margin-bottom: 40px;
}
.page-hero__title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
    line-height: 1.4;
}
.page-hero__breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
}
.page-hero__breadcrumb li { color: #9aa3b8; }
.page-hero__breadcrumb li a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
.page-hero__breadcrumb li a:hover { color: #fff; }
.page-hero__breadcrumb li::before { content: '/'; margin-left: 8px; color: #555; }
.page-hero__breadcrumb li:first-child::before { display: none; }

/* ================================================================
   ANSWER PAGE
   ================================================================ */

.answer-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 32px;
    margin-bottom: 32px;
}
.answer-card h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.5;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--primary);
}
.answer-card__body {
    font-size: 15px;
    line-height: 1.9;
    color: var(--text);
}
.answer-widget {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    list-style: none;
    padding: 16px 0 0;
    margin: 20px 0 0;
    border-top: 1px solid var(--border);
}
.answer-widget li {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}
.answer-widget li span {
    font-weight: 700;
    color: var(--primary);
}

/* Comments section */
.comments-section {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 28px;
    margin-bottom: 24px;
}
.widget__title h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

/* Sticky sidebar offset from header */
@media (min-width: 768px) {
    .sidebar-sticky-col {
        position: sticky;
        top: 80px;
        align-self: flex-start;
    }
}

/* ================================================================
   COMMENT FORM (inside .comments-section)
   ================================================================ */

.comments-section form .input-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.comments-section form .input-list input {
    height: 46px;
    flex: 1 1 calc(33.33% - 12px);
    min-width: 160px;
    background: #fafafa;
    border: 1px solid #e1e1e1;
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    padding: 0 14px;
    transition: border-color 0.2s;
}
.comments-section form .input-list input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
}
.comments-section form textarea.form-control {
    width: 100%;
    height: 150px;
    background: #fafafa;
    border: 1px solid #e1e1e1;
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    padding: 12px 14px;
    resize: vertical;
    margin-bottom: 14px;
    display: block;
    transition: border-color 0.2s;
}
.comments-section form textarea.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: none;
}
.comments-section form input[type="submit"],
.comments-section form button[type="submit"] {
    width: 100%;
    display: block;
}

@media (max-width: 576px) {
    .comments-section form .input-list input {
        flex: 1 1 100%;
    }
}

/* ================================================================
   ANSWERS LIST PAGE
   ================================================================ */

.answers-list__item {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
    transition: box-shadow 0.2s, transform 0.2s;
    display: block;
    text-decoration: none;
    color: var(--text);
}
.answers-list__item:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--text);
}
.answers-list__item h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
    line-height: 1.5;
    transition: color 0.2s;
}
.answers-list__item:hover h3 { color: var(--primary); }
.answers-list__item p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 14px;
}
.answers-list__item .answer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 12px;
}
.answers-list__item .answer-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}
.answers-list__item .answer-meta i { color: var(--primary); }

/* Pagination */
.ajabaa-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 20px 0 40px;
    flex-wrap: wrap;
}
.ajabaa-pagination .page-link {
    border-radius: 6px !important;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 14px;
    font-size: 14px;
    transition: all 0.2s;
}
.ajabaa-pagination .page-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.ajabaa-pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ================================================================
   POST CARD (قائمة المقالات)
   ================================================================ */

.post-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.post-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    transform: translateY(-3px);
}
.post-card__img-wrap {
    display: block;
    position: relative;
    overflow: hidden;
    height: 180px;
}
.post-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.post-card:hover .post-card__img-wrap img { transform: scale(1.05); }
.post-card__cat {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-decoration: none;
}
.post-card__body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.post-card__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 8px;
}
.post-card__title a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.2s;
}
.post-card__title a:hover { color: var(--primary); }
.post-card__desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
    flex: 1;
}
.post-card__meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 10px;
}
.post-card__meta span { display: flex; align-items: center; gap: 4px; }
.post-card__meta i { color: var(--primary); }

/* ================================================================
   POST HERO (صفحة المقالة)
   ================================================================ */

.post-hero {
    position: relative;
    height: 420px;
    background-size: cover;
    background-position: center;
    background-color: var(--dark);
}
.post-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px 0;
}
.post-hero__cat {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
    text-decoration: none;
}
.post-hero__title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 14px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.post-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
}
.post-hero__meta span { display: flex; align-items: center; gap: 6px; }
.post-hero__meta i { color: var(--primary); }

@media (max-width: 767px) {
    .post-hero { height: 280px; }
    .post-hero__title { font-size: 20px; }
}

/* ================================================================
   POST BODY (محتوى المقالة)
   ================================================================ */

.post-lead {
    font-size: 17px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.9;
    padding: 20px 24px;
    background: #fffbf5;
    border-right: 4px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 28px;
}
.post-body {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 28px 32px;
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.9;
    color: var(--text);
}
.post-body article h1,
.post-body article h2,
.post-body article h3 {
    color: var(--dark);
    font-weight: 700;
    margin: 24px 0 12px;
}
.post-body article h2 { font-size: 20px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.post-body article h3 { font-size: 17px; }
.post-body article p  { margin-bottom: 16px; }
.post-body article img { border-radius: var(--radius); max-width: 100%; margin: 12px 0; }
.post-body article a  { color: var(--primary); }
.post-body article blockquote {
    border-right: 4px solid var(--primary);
    padding: 12px 18px;
    background: #fffbf5;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    margin: 16px 0;
}

/* Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    margin-bottom: 24px;
}
.post-tags i { color: var(--text-muted); font-size: 14px; }
.post-tags a {
    background: #f5f5f5;
    color: var(--text);
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.post-tags a:hover { background: var(--primary); color: #fff; }

/* Prev / Next Nav */
.post-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}
.post-nav__item {
    flex: 1;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.post-nav__item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(244,149,47,0.15);
    text-decoration: none;
}
.post-nav__item--next { text-align: left; }
.post-nav__label {
    font-size: 12px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 6px;
}
.post-nav__title {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
    font-weight: 500;
}
@media (max-width: 576px) {
    .post-nav { flex-direction: column; }
}

/* ================================================================
   FEATURED POSTS GRID  (home page hero)
   ================================================================ */

.featured-section {
    padding: 10px 0 0;
    border-top: 1px solid var(--border);
}

.featured-card {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    text-decoration: none;
    width: 100%;
    height: 100%;
}

/* Large card: fixed height */
.featured-card--large { height: 380px; }

/* Side column: CSS grid so both cards fill equally with no gap waste */
.featured-side-col {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    height: 380px;
}

.featured-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.featured-card:hover .featured-card__img { transform: scale(1.05); }

.featured-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.80) 0%, rgba(0,0,0,0.25) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px;
}

.featured-card__cat {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 6px;
    align-self: flex-start;
    text-decoration: none;
}

.featured-card__title {
    color: #fff;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 6px;
    font-size: 17px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.featured-card__title--sm { font-size: 13px; }

.featured-card__meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: rgba(255,255,255,0.8);
}
.featured-card__meta i { color: var(--primary); margin-left: 3px; }

@media (max-width: 991px) {
    .featured-card--large { height: 300px; }
    .featured-side-col    { height: 300px; }
}
@media (max-width: 576px) {
    .featured-card--large { height: 200px; }
    .featured-side-col    { height: auto; grid-template-rows: 160px 160px; }
    .featured-card__title { font-size: 14px; }
}

/* ================================================================
   CATEGORIES POST ITEM — تصحيح الارتفاعات المبالغ فيها
   ================================================================ */

.categories__post__item__pic                                             { height: 260px !important; margin-bottom: 16px; }
.categories__post__item.categories__post__item--large .categories__post__item__pic { height: 200px !important; }
.categories__post__item__pic.smaller__large                              { height: 200px !important; }
.categories__post__item__pic.small__item                                 { height: 160px !important; }

.categories__post__item                                                  { margin-bottom: 24px; }
.categories__post__item.categories__post__item--large                    { margin-bottom: 28px; }
.categories__post__item__plain                                           { height: 220px !important; margin-bottom: 20px !important; }
