*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; height: auto; }
body { overflow-x: hidden; padding-bottom: 88px; }
body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: #f5f7fa;
    color: #222;
    line-height: 1.7;
}
.wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 16px;
}
header, footer {
    background: #fff;
    border-bottom: 3px solid #0056b3;
    text-align: center;
}
footer {
    border-bottom: 0;
    border-top: 1px solid #ddd;
    margin-top: 30px;
    padding-bottom: 72px;
}
.logo img { max-width: 180px; height: auto; }
.tag { margin: 0 0 10px; color: #444; }
h1, h2, h3 { color: #0056b3; }
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}
.grid a, .card, .box {
    background: #fff;
    border: 1px solid #d7e4f2;
    padding: 10px 12px;
    text-decoration: none;
    color: #0056b3;
    font-weight: bold;
}
.card, .box { display: block; margin-bottom: 12px; font-weight: normal; color: #222; }
.card h3, .box h2, .box h3 { margin-top: 0; }
.btns a {
    display: inline-block;
    margin: 4px 6px 0 0;
    background: #0056b3;
    color: #fff;
    padding: 7px 12px;
    text-decoration: none;
}
.faq { border-top: 1px solid #eee; padding-top: 8px; }
form label { display: block; margin: 10px 0 4px; font-weight: bold; }
input, select, textarea { width: 100%; max-width: 480px; padding: 8px; box-sizing: border-box; }
button { margin-top: 12px; background: #0056b3; color: #fff; border: 0; padding: 10px 18px; cursor: pointer; }
.crumb { color: #555; font-size: 14px; }
.ok { color: #0a7a2f; }
.err { color: #b00020; }
.site-credit a, .site-contact-links a { color: #0056b3; font-weight: bold; }
.site-contact-bar {
    position: fixed; bottom: 0; right: 0; left: 0; z-index: 1000;
    display: flex; justify-content: center; gap: 8px; padding: 8px 12px;
    background: rgba(255, 255, 255, .97); border-top: 1px solid #d7e4f2;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .08);
}
.site-contact-bar a { display: inline-block; padding: 7px 12px; color: #fff; text-decoration: none; font-weight: bold; border-radius: 3px; }
.site-contact-call { background: #0056b3; }
.site-contact-wa { background: #168a45; }

/* بطاقة ملف الطبيب */
.doctor-profile-card {
    background: linear-gradient(135deg, #063b36, #0b6b5d);
    color: #fff; border: 0; border-radius: 18px; padding: 24px;
    box-shadow: 0 8px 24px rgba(0,70,60,.18);
}
.doctor-profile-card h1, .doctor-profile-card h2 { color: #fff; }
.doctor-photo {
    display: block; width: min(100%, 240px) !important; height: 260px !important;
    max-width: 240px !important; max-height: 260px !important;
    object-fit: contain; margin: 0 auto 18px; border-radius: 16px;
    border: 4px solid #ccefe7; background: #eef8f5;
}
.doctor-badge { display: inline-block; background: #f2c94c; color: #19352e; border-radius: 999px; padding: 4px 12px; font-weight: bold; }
.doctor-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.doctor-actions a { flex: 1; min-width: 180px; text-align: center; border-radius: 999px; padding: 12px 16px; color: #fff; text-decoration: none; font-weight: bold; }
.doctor-call { background: #1677d2; }
.doctor-whatsapp { background: #20a866; }
.doctor-section { background: #fff; color: #222; border-radius: 14px; padding: 16px; margin-top: 14px; }
.doctor-section h2 { color: #075c51; margin-top: 0; }
.doctor-branch { border-right: 4px solid #f2c94c; padding: 8px 14px; margin: 10px 0; background: #f5fbf9; }
.doctor-branch strong { color: #075c51; }
.doctor-stars { color: #f2ad00; font-size: 25px; letter-spacing: 2px; }
.rating-form { direction: rtl; }
.rating-form input { position: absolute; opacity: 0; width: 1px; }
.rating-form label { display: inline-block; width: auto; margin: 0; padding: 2px; color: #c9c9c9; font-size: 30px; cursor: pointer; }
.rating-form label:hover, .rating-form label:has(~ label:hover), .rating-form input:checked ~ label { color: #f2ad00; }
.doctor-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.doctor-stat { flex: 1; min-width: 120px; background: #eef8f5; color: #075c51; padding: 10px; border-radius: 10px; text-align: center; }

/* تواصل إدارة الموقع العائم */
.site-contact-float { position: fixed; right: 16px; bottom: 18px; z-index: 1100; display: flex; align-items: center; gap: 7px; animation: float-in 1s ease-out, contact-pulse 3s infinite; }
.site-contact-float-title { background: #fff; color: #075c51; padding: 7px 10px; border-radius: 999px; box-shadow: 0 3px 14px rgba(0,0,0,.18); font-weight: bold; font-size: 13px; }
.site-contact-float a { color: #fff; text-decoration: none; font-weight: bold; padding: 11px 13px; border-radius: 50px; box-shadow: 0 3px 14px rgba(0,0,0,.2); }
.site-float-call { background: #1677d2; }
.site-float-wa { background: #20a866; }
@keyframes float-in { from { transform: translateY(25px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes contact-pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.08); } }

@media (max-width: 520px) {
    .site-contact-bar { display: none; }
    .site-contact-float { right: 8px; bottom: 10px; gap: 4px; }
    .site-contact-float-title { display: none; }
    .site-contact-float a { padding: 10px 11px; font-size: 12px; }
    .doctor-profile-card { padding: 14px; }
    .doctor-photo { width: 180px !important; height: 195px !important; max-width: 180px !important; max-height: 195px !important; margin-bottom: 12px; }
    .doctor-actions a { min-width: 140px; padding: 10px 8px; font-size: 13px; }
    footer { padding-bottom: 70px; }
}

.breadcrumb { color: #555; font-size: 14px; margin: 12px 0 18px; }
.breadcrumb a { color: #075c51; }
.card-doctor-photo { display: block; width: min(100%, 180px); max-height: 190px; object-fit: contain; margin: 0 auto 12px; border-radius: 12px; }
.price-box { border-right: 4px solid #f2c94c; }
@media (max-width: 520px) { body { padding-bottom: 82px; } .card-doctor-photo { width: min(100%, 160px); max-height: 170px; } .site-contact-float { bottom: 14px; } }

.doctor-card h3 { margin-top: 0; }
.doctor-card ul { padding-right: 22px; }
.doctor-card .btns { display: flex; flex-wrap: wrap; gap: 6px; }
.doctor-card .btns a { margin: 0; flex: 1 1 120px; text-align: center; }
.site-contact-float a { min-width: 64px; text-align: center; }
@media (max-width: 360px) { .site-contact-float { right: 5px; left: 5px; justify-content: flex-end; } .site-contact-float a { padding: 9px 8px; min-width: 58px; } }

/* تثبيت صور بطاقات الأطباء حتى لا تتمدد بسبب أي CSS خارجي أو كاش قديم */
.doctor-card { overflow: hidden; min-width: 0; }
.doctor-card .card-doctor-photo { display: block !important; width: 180px !important; height: 190px !important; max-width: 180px !important; max-height: 190px !important; object-fit: contain !important; }
.crumb, .breadcrumb { background: #fff; border-right: 4px solid #075c51; padding: 9px 12px; border-radius: 8px; line-height: 1.9; }
.crumb a, .breadcrumb a { color: #075c51; font-weight: bold; text-decoration: underline; }
@media (max-width: 520px) {
  .wrap { width: 100%; max-width: 100%; padding: 10px; }
  .doctor-card .card-doctor-photo { width: 140px !important; height: 150px !important; max-width: 140px !important; max-height: 150px !important; margin: 0 auto 10px !important; }
  .doctor-profile-card .doctor-photo { width: 180px !important; height: 195px !important; max-width: 180px !important; max-height: 195px !important; }
  h1 { font-size: 23px; line-height: 1.45; }
  h2 { font-size: 19px; line-height: 1.5; }
  .card { padding: 10px; }
}

.muted { color: #5d6873; font-size: .92rem; }
.doctor-signup-box { border: 2px solid #075c51; background: #f5fbf9; }
.doctor-signup-box h2 { color: #075c51; }
.doctor-signup-box .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.doctor-signup-box .btns a { margin: 0; }
.doctor-updated { background: #fff; border-right: 3px solid #f2c94c; padding: 8px 12px; }

/* دليل SEO الطويل داخل الصفحة الرئيسية */
.seo-guide { margin-top: 24px; text-align: right; line-height: 1.9; }
.seo-guide h2 { color: #075c51; border-right: 4px solid #f2c94c; padding: 8px 12px; margin: 30px 0 12px; }
.seo-guide h3 { color: #0056b3; margin: 24px 0 8px; }
.seo-guide h4 { color: #075c51; margin: 18px 0 6px; }
.seo-guide p { max-width: 900px; margin: 0 0 12px; }
.seo-guide blockquote { background: #f5fbf9; border-right: 4px solid #075c51; margin: 16px 0; padding: 12px 16px; }
.seo-guide ul { padding-right: 28px; }
.guide-toc { background: #f5fbf9; border: 1px solid #ccefe7; border-radius: 12px; padding: 14px; margin-bottom: 20px; }
.guide-toc strong { color: #075c51; display: block; margin-bottom: 8px; }
.guide-toc div { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 12px; }
.guide-toc a { color: #0056b3; text-decoration: none; font-weight: bold; }
.guide-toc a:hover { text-decoration: underline; }
@media (max-width: 520px) {
  .seo-guide { padding: 12px; font-size: 15px; }
  .seo-guide h2 { font-size: 20px; margin-top: 24px; }
  .seo-guide h3 { font-size: 18px; }
  .guide-toc div { display: block; }
  .guide-toc a { display: block; padding: 4px 0; }
}

/* تنظيم مسار التصفح: محافظة ← اختصاص ← طبيب */
.taxonomy-section { margin: 18px 0; }
.taxonomy-section h2 { margin-bottom: 6px; }
.taxonomy-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.taxonomy-grid a { min-height: 58px; display: flex; align-items: center; justify-content: center; text-align: center; border-radius: 10px; transition: transform .15s ease, box-shadow .15s ease; }
.taxonomy-grid a:hover { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(0,86,179,.14); }
.primary-step { border: 2px solid #ccefe7; border-radius: 14px; padding: 14px; background: #fbfffe; }
.secondary-links { margin-top: 18px; padding-top: 12px; border-top: 1px solid #d7e4f2; }
.compact-grid { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.compact-grid a { font-size: .94rem; font-weight: normal; }
.doctor-photo { object-position: center; overflow: hidden; }
@media (max-width: 520px) {
  .taxonomy-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .taxonomy-grid a { min-height: 54px; padding: 8px 6px; font-size: 14px; }
  .compact-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 360px) {
  .taxonomy-grid, .compact-grid { grid-template-columns: 1fr; }
}

.seo-guide-toggle { margin: 22px 0; }
.seo-guide-toggle > summary { cursor: pointer; list-style: none; background: #075c51; color: #fff; border-radius: 12px; padding: 14px 16px; font-weight: bold; text-align: center; box-shadow: 0 4px 12px rgba(0,70,60,.14); }
.seo-guide-toggle > summary::-webkit-details-marker { display: none; }
.seo-guide-toggle[open] > summary { border-radius: 12px 12px 0 0; }
.seo-guide-toggle .seo-guide { border-radius: 0 0 12px 12px; margin-top: 0; }

/* جدول محتويات كلمات البحث المرتبطة بصفحات فعلية */
.keyword-board-section { margin: 22px 0; }
.keyword-board-section h2 { color: #075c51; margin-bottom: 6px; }
.keyword-board-intro, .keyword-board-note { color: #4f5d66; font-size: .95rem; }
.keyword-board-note { border-right: 3px solid #f2c94c; padding: 6px 10px; background: #fffdf2; }
.keyword-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.keyword-tile { min-height: 92px; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 14px 16px; border-radius: 14px; color: #fff; text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,.12); transition: transform .15s ease, box-shadow .15s ease; }
.keyword-tile:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,.2); }
.keyword-tile strong { font-size: 1.02rem; line-height: 1.45; }
.keyword-tile span { font-size: .82rem; opacity: .92; }
.tile-blue { background: linear-gradient(135deg, #1769aa, #218cbd); }
.tile-green { background: linear-gradient(135deg, #087f5b, #16a085); }
.tile-gold { background: linear-gradient(135deg, #b87809, #d99a19); }
.tile-purple { background: linear-gradient(135deg, #6841a5, #8e5ac5); }
.tile-rose { background: linear-gradient(135deg, #b33b62, #d65b7d); }
.tile-orange { background: linear-gradient(135deg, #b75216, #df7a2a); }
.tile-teal { background: linear-gradient(135deg, #087f8c, #14a6a6); }
.tile-navy { background: linear-gradient(135deg, #263c72, #3d5a9b); }
.tile-slate { background: linear-gradient(135deg, #465563, #68798a); }
.tile-coral { background: linear-gradient(135deg, #a94d3d, #cf705e); }
@media (max-width: 520px) {
  .keyword-board { grid-template-columns: 1fr 1fr; gap: 8px; }
  .keyword-tile { min-height: 88px; padding: 11px 10px; border-radius: 11px; }
  .keyword-tile strong { font-size: .88rem; }
  .keyword-tile span { font-size: .72rem; }
}
@media (max-width: 360px) { .keyword-board { grid-template-columns: 1fr; } }

/* قسم الأسئلة الشائعة الظاهر مع FAQPage Schema */
.faq-section { margin-top: 24px; border-top: 4px solid #075c51; }
.faq-section h2 { color: #075c51; }
.faq-section .faq { padding: 10px 0; border-top: 1px solid #e5edf0; }
.faq-section .faq:first-of-type { border-top: 0; }
.faq-section .faq h3 { color: #1c4f78; font-size: 1.05rem; margin: 0 0 4px; }
.faq-section .faq p { margin: 0; line-height: 1.85; }

/* المقالات المستقلة والربط الداخلي */
.article-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 18px 0; }
.article-card { border-top: 4px solid #075c51; }
.article-card h2 { font-size: 1.12rem; margin-top: 0; }
.article-card h2 a { color: #075c51; text-decoration: none; }
.article-link { color: #075c51; font-weight: bold; }
.seo-article { background: #fff; border-radius: 14px; padding: 18px; margin: 16px 0; }
.seo-article h1 { margin-top: 0; }
.article-lead { font-size: 1.08rem; background: #f5fbf9; border-right: 4px solid #075c51; padding: 13px 15px; }
.article-notice { background: #fffdf2; border-right: 4px solid #f2c94c; padding: 11px 14px; margin: 16px 0; }
.article-links { background: #f5fbf9; border: 1px solid #ccefe7; border-radius: 10px; padding: 12px 16px; }
.article-links ul { margin-bottom: 0; }
.article-home-grid a { display: flex; flex-direction: column; gap: 4px; }
.article-home-grid small { color: #5d6873; font-weight: normal; line-height: 1.5; }
@media (max-width: 520px) {
  .article-grid { grid-template-columns: 1fr; }
  .seo-article { padding: 13px; }
  .article-home-grid { grid-template-columns: 1fr; }
}

/* بطاقات القوائم: بدون صورة كبيرة، والمعلومات في ترتيب سريع */
.doctor-card { padding: 16px; border-radius: 12px; border-right: 4px solid #075c51; }
.doctor-card-head { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; margin-bottom: 8px; }
.doctor-card-head h3 { margin: 0; line-height: 1.45; }
.doctor-card-head h3 a { color: #075c51; text-decoration: none; }
.doctor-card-badge { flex: 0 0 auto; background: #f2c94c; color: #19352e; border-radius: 999px; padding: 3px 9px; font-size: .78rem; font-weight: bold; }
.doctor-card p { margin: 5px 0; }
.doctor-card .btns { margin-top: 12px; }
.doctor-card .btns a:first-child { background: #075c51; }
.journey-strip { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 20px 0; padding: 12px; background: #f5fbf9; border: 1px solid #ccefe7; border-radius: 14px; }
.journey-step { display: flex; align-items: center; gap: 8px; min-width: 0; }
.journey-step b { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: #075c51; color: #fff; }
.journey-step span { display: flex; flex-direction: column; line-height: 1.35; }
.journey-step strong { color: #075c51; font-size: .92rem; }
.journey-step small { color: #5d6873; font-size: .76rem; }
.journey-arrow { color: #d29a18; font-size: 22px; font-weight: bold; }
@media (max-width: 520px) {
  .doctor-card { padding: 13px; }
  .doctor-card-head { gap: 6px; }
  .doctor-card-head h3 { font-size: 17px; }
  .doctor-card-badge { font-size: .7rem; padding: 3px 7px; }
  .journey-strip { align-items: stretch; gap: 4px; padding: 9px 5px; }
  .journey-step { flex: 1; flex-direction: column; text-align: center; gap: 4px; }
  .journey-step span { align-items: center; }
  .journey-step strong { font-size: .75rem; }
  .journey-step small { font-size: .65rem; }
  .journey-arrow { align-self: center; font-size: 16px; }
}
