/* Batch 211: Doctor credentials — independent of existing Hero / botanical styles. */
.doctor-credentials{position:relative;background:#f8f6f0;color:#113d34;padding:clamp(3.5rem,7vw,6.5rem) max(1.25rem,calc((100vw - 1220px)/2));}
.doctor-credentials__heading{max-width:820px;margin:0 auto 2.5rem;text-align:center;}
.doctor-credentials__eyebrow{color:#aa853b;text-transform:uppercase;letter-spacing:.16em;font-size:.75rem;font-weight:700;}
.doctor-credentials__heading h2{font-family:var(--font-heading, Georgia, serif);font-size:clamp(1.9rem,3vw,2.8rem);line-height:1.27;margin:.65rem 0 1rem;}
.doctor-credentials__group{margin-top:2.8rem;}
.doctor-credentials__group-title{font-size:1.05rem;color:#173d35;letter-spacing:.01em;border-bottom:1px solid #d9c8a9;padding-bottom:.8rem;margin:0 0 1.25rem;}
.doctor-credentials__grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.15rem;}
.doctor-credentials__card{min-width:0;border:1px solid #e2dbd0;border-radius:16px;background:#fffdf9;box-shadow:0 10px 28px rgba(23,56,44,.035);overflow:hidden;display:flex;flex-direction:column;}
.doctor-credentials__image{display:grid;place-items:center;background:#eee9df;aspect-ratio:3/2;overflow:hidden;}
.doctor-credentials__image img{width:100%;height:100%;object-fit:contain;padding:.75rem;box-sizing:border-box;}
.doctor-credentials__body{padding:1.3rem;display:flex;flex-direction:column;gap:.75rem;flex:1;}
.doctor-credentials__year{align-self:flex-start;font-size:.78rem;color:#a58145;font-weight:700;}
.doctor-credentials__card h4{margin:0;font-size:clamp(1rem,1.4vw,1.18rem);line-height:1.5;overflow-wrap:anywhere;}
.doctor-credentials__issuer{font-size:.86rem;color:#52665d;margin:0;line-height:1.65;}
.doctor-credentials__summary{font-size:.88rem;color:#637169;margin:0;line-height:1.8;}
.doctor-credentials__links{display:flex;flex-wrap:wrap;gap:.65rem;margin-top:auto;padding-top:.45rem;}
.doctor-credentials__links a{color:#0c5947;text-decoration:underline;text-underline-offset:4px;font-size:.82rem;font-weight:700;}
html[dir='rtl'] .doctor-credentials__card{text-align:right;}
html[dir='rtl'] .doctor-credentials__year{align-self:flex-end;}
@media(max-width:940px){.doctor-credentials__grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:610px){.doctor-credentials{padding:3rem 1rem;}.doctor-credentials__grid{grid-template-columns:1fr;}.doctor-credentials__group{margin-top:2.2rem;}.doctor-credentials__image{aspect-ratio:16/9;}}
@media(prefers-reduced-motion:reduce){.doctor-credentials *{scroll-behavior:auto!important;transition:none!important;}}

/* Batch 213: four readable cards per desktop row; adaptive on smaller screens. */
.doctor-credentials__grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:.9rem;}
.doctor-credentials__body{padding:1rem;gap:.65rem;}
.doctor-credentials__card h4{font-size:clamp(.93rem,1.08vw,1.09rem);line-height:1.52;}
.doctor-credentials__issuer{font-size:.82rem;}
.doctor-credentials__summary{font-size:.83rem;line-height:1.75;}
@media(max-width:1100px){.doctor-credentials__grid{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:800px){.doctor-credentials__grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:640px){.doctor-credentials__grid{grid-template-columns:1fr;}}

/* Single native dialog with keyboard Escape, click-to-dismiss backdrop and focus. */
html.doctor-credential-dialog-open{overflow:hidden;}
.doctor-credentials-modal:not([open]){display:none;}
.doctor-credentials-modal[open]{position:fixed;inset:0;box-sizing:border-box;width:min(980px,calc(100vw - 2rem));max-width:none;max-height:calc(100dvh - 2rem);margin:auto;padding:0;background:#fffdf9;border:1px solid rgba(193,160,96,.55);border-radius:18px;box-shadow:0 28px 85px rgba(0,20,14,.45);overflow:auto;color:#133c32;}
.doctor-credentials-modal::backdrop{background:rgba(8,27,22,.73);-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);}
.doctor-credentials-modal__shell{padding:clamp(.85rem,2vw,1.4rem);}
.doctor-credentials-modal__header{display:flex;gap:.75rem;align-items:center;justify-content:space-between;padding:0 0 .8rem;border-bottom:1px solid #e5d9c5;}
.doctor-credentials-modal__title{font-family:inherit;font-size:clamp(.95rem,1.6vw,1.18rem);font-weight:700;line-height:1.6;margin:0;overflow-wrap:anywhere;}
.doctor-credentials-modal__close{appearance:none;border:1px solid #d7c4a4;border-radius:999px;background:#faf5ea;color:#163e34;display:grid;place-items:center;width:2.5rem;height:2.5rem;flex:none;font-size:1.65rem;line-height:1;cursor:pointer;}
.doctor-credentials-modal__close:hover,.doctor-credentials-modal__close:focus-visible{background:#e9dbbd;outline-offset:3px;}
.doctor-credentials-modal__image-wrap{display:flex;align-items:center;justify-content:center;padding:.85rem 0 0;}
.doctor-credentials-modal__image{display:block;max-width:100%;max-height:calc(100dvh - 8.5rem);width:auto;height:auto;object-fit:contain;border-radius:6px;}
.doctor-credentials__image:focus-visible,.doctor-credentials__links a:focus-visible{outline:2px solid #b99451;outline-offset:3px;}
@media(max-width:640px){.doctor-credentials-modal[open]{width:calc(100vw - 1rem);max-height:calc(100dvh - 1rem);border-radius:12px;}.doctor-credentials-modal__image{max-height:calc(100dvh - 7rem);}}
@media(prefers-reduced-motion:reduce){.doctor-credentials-modal,.doctor-credentials-modal *{transition:none!important;animation:none!important;}}

/* Batch 214: credential actions, Arabic spacing and animated lightbox. */
.doctor-credentials__heading{margin-bottom:1.95rem;}
.doctor-credentials__links{padding-top:1rem;gap:.6rem;align-items:center;}
.doctor-credentials__links a{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:2.25rem;box-sizing:border-box;padding:.43rem .9rem;
  border:1px solid rgba(168,129,62,.42);border-radius:999px;
  color:#185244;background:rgba(194,157,88,.08);
  text-decoration:none;line-height:1.5;white-space:normal;
  transition:background-color .22s ease,color .22s ease,border-color .22s ease,
    transform .22s ease,box-shadow .22s ease;
}
.doctor-credentials__links a:hover{
  color:#143b30;background:#e8d6ab;border-color:#b18a49;
  box-shadow:0 5px 16px rgba(80,62,30,.14);transform:translateY(-2px);
}
.doctor-credentials__links a:focus-visible{
  outline:2px solid #99733b;outline-offset:3px;background:#f1e4c8;
}
.doctor-credentials__links a:active{transform:translateY(0);box-shadow:none;}
/* Arabic needs a more generous break between its final paragraph and the action. */
html[lang^="ar"] .doctor-credentials__summary{line-height:1.95;}
html[lang^="ar"] .doctor-credentials__links{padding-top:1.4rem;}
html[lang^="ar"] .doctor-credentials__links a{line-height:1.7;padding-inline:1rem;}

/* Native dialog: visually present during exit so closing animates as well. */
.doctor-credentials-modal[open]:not(.is-closing){
  animation:doctorCredentialEnter .32s cubic-bezier(.18,.78,.2,1) both;
}
.doctor-credentials-modal[open]:not(.is-closing)::backdrop{
  animation:doctorCredentialBackdropIn .32s ease-out both;
}
.doctor-credentials-modal[open].is-closing{
  animation:doctorCredentialExit .22s ease-in both;
}
.doctor-credentials-modal[open].is-closing::backdrop{
  animation:doctorCredentialBackdropOut .22s ease-in both;
}
@keyframes doctorCredentialEnter{
  from{opacity:0;transform:translateY(18px) scale(.978);}
  to{opacity:1;transform:translateY(0) scale(1);}
}
@keyframes doctorCredentialExit{
  from{opacity:1;transform:translateY(0) scale(1);}
  to{opacity:0;transform:translateY(12px) scale(.985);}
}
@keyframes doctorCredentialBackdropIn{
  from{background:rgba(8,27,22,0);-webkit-backdrop-filter:blur(0);backdrop-filter:blur(0);}
  to{background:rgba(8,27,22,.73);-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);}
}
@keyframes doctorCredentialBackdropOut{
  from{background:rgba(8,27,22,.73);-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);}
  to{background:rgba(8,27,22,0);-webkit-backdrop-filter:blur(0);backdrop-filter:blur(0);}
}
@media(prefers-reduced-motion:reduce){
  .doctor-credentials-modal[open],.doctor-credentials-modal[open]::backdrop,
  .doctor-credentials__links a{animation:none!important;transition:none!important;}
  .doctor-credentials__links a:hover{transform:none;}
}

/* Batch 215: category headings stay visible; each category swipes horizontally on mobile. */
.doctor-credentials__slider-controls{display:none;}
.doctor-credentials__slider-controls[hidden]{display:none!important;}
@media(max-width:700px){
  .doctor-credentials{padding-inline:1rem;}
  .doctor-credentials__heading{margin-bottom:1.5rem;}
  .doctor-credentials__group{margin-top:1.9rem;min-width:0;}
  .doctor-credentials__group-top{
    display:flex;align-items:center;justify-content:space-between;gap:.65rem;
    border-bottom:1px solid #d9c8a9;margin-bottom:.95rem;padding-bottom:.7rem;
  }
  .doctor-credentials__group-title{
    flex:1;min-width:0;margin:0;padding:0;border:none;
    font-size:1rem;line-height:1.55;
  }
  .doctor-credentials__slider-controls:not([hidden]){
    display:inline-flex;flex:none;align-items:center;gap:.3rem;
    margin-inline-start:auto;direction:inherit;
  }
  .doctor-credentials__slider-controls button{
    display:grid;place-items:center;flex:none;box-sizing:border-box;
    width:2.15rem;height:2.15rem;border:1px solid #d6c39f;border-radius:50%;
    color:#174b3d;background:#fffdf9;font-size:1.45rem;line-height:1;
    cursor:pointer;transition:background-color .18s ease,border-color .18s ease;
  }
  .doctor-credentials__slider-controls button:hover:not(:disabled){
    background:#f0e5ce;border-color:#ac884d;
  }
  .doctor-credentials__slider-controls button:focus-visible{
    outline:2px solid #a17f42;outline-offset:2px;
  }
  .doctor-credentials__slider-controls button:disabled{opacity:.36;cursor:default;}
  .doctor-credentials__slide-counter{
    min-width:3.1rem;text-align:center;font-size:.78rem;white-space:nowrap;
    color:#9c7a41;font-variant-numeric:tabular-nums;
  }
  .doctor-credentials__grid{
    display:flex;overflow-x:auto;overflow-y:hidden;gap:.82rem;
    padding:.15rem .2rem .85rem;scroll-padding-inline:.2rem;
    scroll-snap-type:x mandatory;overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;scrollbar-width:none;
    direction:inherit;
  }
  .doctor-credentials__grid::-webkit-scrollbar{display:none;}
  .doctor-credentials__card{
    flex:0 0 min(82vw,340px);width:min(82vw,340px);
    scroll-snap-align:start;scroll-snap-stop:always;
  }
  .doctor-credentials__body{padding:1rem;}
  .doctor-credentials__image{aspect-ratio:16/9;}
}
@media(prefers-reduced-motion:reduce){
  .doctor-credentials__grid{scroll-behavior:auto!important;}
  .doctor-credentials__slider-controls button{transition:none!important;}
}

/* Batch 216: one physical LTR swipe direction for every language on mobile. */
@media (max-width: 700px) {
  /* Keep every carousel's first card at the LEFT; swipe LEFT to reveal next. */
  .doctor-credentials__grid { direction: ltr; }
  /* Arrow positions and keyboard direction must match English in FA/AR too. */
  .doctor-credentials__slider-controls:not([hidden]) { direction: ltr; }
  /* Card content still reads RTL on Persian and Arabic pages. */
  html[dir='rtl'] .doctor-credentials__grid > .doctor-credentials__card { direction: rtl; text-align: right; }
}
