/* ==========================================================================
   Arkan Academy — Coaches Directory (Version 2).
   Loaded after css/home.css and css/pages.css. Logical properties keep the
   Arabic (rtl) and English (ltr) pages in step.
   ========================================================================== */

/* ---------- Page head ---------- */
.cd-head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px 48px; align-items: end; }
.cd-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cd-fact { padding: 16px 12px; border-radius: var(--radius); background: #fff; border: 1px solid var(--border); text-align: center; }
.cd-fact strong { display: block; font-size: 1.75rem; line-height: 1.15; color: var(--blue); }
.cd-fact span { display: block; margin-block-start: 4px; font-size: .875rem; font-weight: 700; color: var(--text-2); line-height: 1.4; }

/* ---------- Toolbar: search + category chips ---------- */
.cd-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-block-end: 18px; }
.cd-search {
  display: flex; align-items: center; gap: 10px; flex: 1 1 280px; max-width: 400px; min-height: 50px;
  padding-inline: 18px; border: 1px solid #cfd8e3; border-radius: var(--pill); background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.cd-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 98, 164, .14); }
.cd-search .icon { width: 20px; height: 20px; color: var(--blue); }
.cd-search input { flex: 1; min-width: 0; min-height: 48px; border: 0; outline: 0; background: none; font: inherit; color: var(--text); }
.cd-search input::placeholder { color: #7b8794; }
.cd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cd-chip {
  min-height: 40px; padding: 6px 16px; border-radius: var(--pill); border: 1px solid var(--border); background: #fff;
  font: inherit; font-size: .9375rem; font-weight: 700; color: var(--navy); cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.cd-chip:hover { border-color: var(--blue); color: var(--blue); }
.cd-chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.cd-count { margin-block-end: 22px; font-size: .9375rem; font-weight: 700; color: var(--text-2); }

/* ---------- Coach cards ---------- */
.cd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.coach__media { position: relative; aspect-ratio: 6 / 5; background: var(--blue-soft); overflow: hidden; }
.coach__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.coach:hover .coach__media img { transform: scale(1.03); }
.coach__format, .coach__badge {
  position: absolute; inset-block-end: 12px; padding: 4px 12px; border-radius: var(--pill);
  font-size: .8125rem; font-weight: 700; line-height: 1.6;
}
.coach__format { inset-inline-start: 12px; background: rgba(255, 255, 255, .94); color: var(--navy); }
.coach__badge { inset-inline-end: 12px; background: var(--accent); color: #fff; }
.coach__body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 20px 22px 22px; }
.coach__role { margin-block-start: -4px; font-size: .9375rem; font-weight: 700; color: var(--blue); }
.coach__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.coach__tags li {
  padding: 2px 10px; border-radius: var(--pill); background: var(--bg-soft); border: 1px solid var(--border);
  font-size: .8125rem; font-weight: 700; color: var(--text-2);
}
.coach__actions { display: flex; gap: 10px; margin-block-start: auto; padding-block-start: 8px; }
.coach__actions .btn { flex: 1 1 0; padding-inline: 12px; }

.cd-empty { padding: 40px 24px; border-radius: var(--radius-lg); border: 1px dashed #cfd8e3; background: var(--bg-soft); text-align: center; }
.cd-empty p { margin-block-end: 14px; color: var(--text-2); font-weight: 700; }

/* ---------- How it works ---------- */
.cd-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: cds; }
.cd-step { position: relative; padding: 28px 24px 24px; border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--border); }
.cd-step__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); margin-block-end: 16px; }
.cd-step__icon .icon { width: 26px; height: 26px; }
.cd-step::after {
  counter-increment: cds; content: counter(cds, decimal-leading-zero);
  position: absolute; top: 20px; inset-inline-end: 22px; font-size: 2rem; font-weight: 800; color: var(--blue-tint); line-height: 1;
}
.cd-step h3 { font-size: var(--fs-h3); color: var(--navy); margin-block-end: 6px; }
.cd-step p { color: var(--text-2); font-size: .9375rem; }

/* ---------- CTA ---------- */
.cd-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-self: end; }
.cd-cta__actions .btn { margin-block-start: 0; }

/* ---------- Profile dialog ---------- */
.cd-modal {
  width: min(900px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-hover); color: var(--text); overflow: auto;
}
.cd-modal::backdrop { background: rgba(14, 42, 71, .6); }
.cd-modal__close {
  position: absolute; top: 14px; inset-inline-end: 14px; z-index: 1; display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--navy);
  box-shadow: var(--shadow); cursor: pointer;
}
.cd-modal__close:hover { color: var(--accent); }
.cd-modal__close svg { width: 22px; height: 22px; }
.cd-modal__body { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.cd-modal__media { background: var(--blue-soft); }
.cd-modal__media img { width: 100%; height: 100%; object-fit: cover; }
.cd-modal__content { display: grid; gap: 12px; align-content: start; padding: clamp(24px, 4vw, 40px); }
.cd-modal__content .eyebrow { margin: 0; }
.cd-modal__name { font-size: clamp(1.5rem, 2.6vw, 2rem); color: var(--navy); }
.cd-modal__bio { color: var(--text-2); font-size: 1.0625rem; }
.cd-modal__facts { display: grid; gap: 12px; margin: 6px 0 10px; padding-block-start: 16px; border-block-start: 1px solid var(--border); }
.cd-modal__facts div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: start; }
.cd-modal__facts dt { font-size: .875rem; font-weight: 700; color: var(--text-2); }
.cd-modal__facts dd { margin: 0; font-weight: 700; color: var(--navy); }
.cd-modal__content .btn { justify-self: start; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .cd-head { grid-template-columns: 1fr; }
  .cd-steps { grid-template-columns: 1fr; }
  .cd-cta__actions { justify-self: start; }
}
@media (max-width: 760px) {
  .cd-modal__body { grid-template-columns: 1fr; }
  .cd-modal__media { aspect-ratio: 6 / 5; }
  .cd-modal__facts div { grid-template-columns: 1fr; gap: 4px; }
  .cd-modal__content .btn { justify-self: stretch; }
}
@media (max-width: 640px) {
  .cd-grid { grid-template-columns: 1fr; }
  .cd-search { max-width: none; }
  .cd-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); padding-block-end: 4px; scrollbar-width: none; }
  .cd-chips::-webkit-scrollbar { display: none; }
  .cd-chip { flex: none; }
  .cd-fact strong { font-size: 1.5rem; }
}
