/* مركز دليل الهيئة + الأسئلة + العرض */
.guides-hub,
.guide-detail {
  --gh-ink: #062436;
  --gh-muted: #5a6b7c;
  --gh-line: #d9e4ec;
  --gh-soft: #f3f7fa;
  --gh-brand: #0a4d6e;
  --gh-brand-2: #1a7a9c;
  --gh-radius: 18px;
  color: var(--gh-ink);
}

.guides-hub__hero,
.guide-detail__hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: clamp(1.1rem, 2.5vw, 1.75rem);
  border-radius: calc(var(--gh-radius) + 4px);
  background:
    radial-gradient(circle at 12% 20%, rgba(26, 122, 156, 0.32), transparent 42%),
    linear-gradient(135deg, #062436 0%, #0f4d70 55%, #1a7a9c 100%);
  color: #fff;
  margin-bottom: 1rem;
}

.guides-hub__hero > div:first-child,
.guide-detail__hero > div:first-child {
  flex: 0 1 auto;
}

.guides-hub__title,
.guide-detail__title {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  font-weight: 800;
  line-height: 1.35;
}

.guides-hub__subtitle,
.guide-detail__subtitle {
  margin: 0.35rem 0 0;
  opacity: 0.9;
  font-size: 0.95rem;
}

.guides-hub__hero-actions,
.guide-detail__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  justify-content: flex-start;
  flex: 1 1 16rem;
  min-width: min(100%, 16rem);
}

/* زر الرجوع دائماً في أقصى اليسار وآخر عنصر */
.guides-hub__btn--back,
.guide-detail__btn--back {
  order: 999 !important;
  margin-inline-start: auto !important;
  margin-inline-end: 0 !important;
  flex: 0 0 auto;
}

.guides-hub__btn,
.guide-detail__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid transparent;
  color: inherit;
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
}

.guides-hub__btn--primary,
.guide-detail__btn--primary {
  background: #fff;
  color: var(--gh-brand);
}

.guides-hub__btn--primary:hover,
.guide-detail__btn--primary:hover {
  background: #e8f3f8;
  color: var(--gh-ink);
}

.guides-hub__btn--ghost,
.guide-detail__btn--ghost {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.guides-hub__btn--ghost:hover,
.guide-detail__btn--ghost:hover {
  background: #fff;
  color: var(--gh-brand);
}

.guides-hub__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.guides-hub__stat {
  background: #fff;
  border: 1px solid var(--gh-line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  box-shadow: 0 8px 20px rgba(6, 36, 54, 0.05);
}

.guides-hub__stat-label {
  display: block;
  color: var(--gh-muted);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.guides-hub__stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gh-brand);
}

.guides-hub__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--gh-line);
  padding-bottom: 0.55rem;
}

.guides-hub__tab {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--gh-muted);
  font-weight: 700;
  background: transparent;
}

.guides-hub__tab.is-active,
.guides-hub__tab:hover {
  background: rgba(10, 77, 110, 0.1);
  color: var(--gh-brand);
}

.guides-hub__search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.guides-hub__search input {
  flex: 1 1 220px;
  min-height: 42px;
  border: 1px solid var(--gh-line);
  border-radius: 12px;
  padding: 0.45rem 0.85rem;
}

.guides-hub__search button {
  border: 0;
  border-radius: 12px;
  background: var(--gh-brand);
  color: #fff;
  font-weight: 700;
  padding: 0.45rem 1rem;
}

.guides-hub__empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--gh-muted);
  background: var(--gh-soft);
  border: 1px dashed var(--gh-line);
  border-radius: 14px;
}

.guides-hub__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.guide-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--gh-line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(6, 36, 54, 0.06);
  min-height: 100%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.guide-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(6, 36, 54, 0.1);
}

.guide-card__top {
  padding: 1rem 1.1rem 0.75rem;
  background: linear-gradient(180deg, #f7fbfd 0%, #fff 100%);
  border-bottom: 1px solid var(--gh-line);
}

.guide-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gh-brand);
  background: rgba(10, 77, 110, 0.08);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  margin-bottom: 0.55rem;
}

.guide-card__badge .bi-archive {
  color: #9a3412;
}

.guides-hub .guide-card__badge:has(.bi-archive) {
  color: #9a3412;
  background: rgba(154, 52, 18, 0.1);
}

.guide-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.45;
}

.guide-card__title a {
  color: var(--gh-ink);
  text-decoration: none;
}

.guide-card__title a:hover {
  color: var(--gh-brand);
}

.guide-card__body {
  padding: 0.9rem 1.1rem;
  flex: 1 1 auto;
}

.guide-card__text {
  margin: 0;
  color: var(--gh-muted);
  line-height: 1.7;
  font-size: 0.92rem;
}

.guide-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  margin-top: 0.85rem;
  color: var(--gh-muted);
  font-size: 0.82rem;
}

.guide-card__meta strong {
  color: var(--gh-brand);
}

.guide-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.85rem 1.1rem 1.05rem;
  border-top: 1px solid var(--gh-line);
  background: #fbfcfd;
}

.guide-card__actions a,
.guide-card__actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--gh-line);
  background: #fff;
  color: var(--gh-ink);
  cursor: pointer;
}

.guide-card__actions a:hover,
.guide-card__actions button:hover {
  border-color: var(--gh-brand);
  color: var(--gh-brand);
}

.guide-card__actions .is-primary {
  background: var(--gh-brand);
  border-color: var(--gh-brand);
  color: #fff;
}

.guide-card__actions .is-primary:hover {
  background: #083d58;
  color: #fff;
}

.guide-card__actions .is-danger {
  color: #b42318;
  border-color: #f3d0cd;
  background: #fff5f4;
}

.guide-card__actions form {
  margin: 0;
  display: inline-flex;
}

.guides-hub__pager {
  margin-top: 1.1rem;
}

/* صفحة العرض */
.guide-detail__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.guide-detail__block {
  background: #fff;
  border: 1px solid var(--gh-line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: 0 8px 22px rgba(6, 36, 54, 0.05);
}

.guide-detail__block--full {
  grid-column: 1 / -1;
}

.guide-detail__label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--gh-brand);
  font-weight: 800;
  font-size: 0.9rem;
}

.guide-detail__value {
  margin: 0;
  color: var(--gh-ink);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.guide-detail__file {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.guide-detail__section-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.9rem;
}

.guide-detail__section-title h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gh-brand);
}

.guide-qa {
  background: #fff;
  border: 1px solid var(--gh-line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
}

.guide-qa__q {
  margin: 0 0 0.55rem;
  font-weight: 700;
  line-height: 1.6;
}

.guide-qa__a {
  margin: 0.55rem 0 0;
  padding: 0.75rem 0.85rem;
  background: var(--gh-soft);
  border-radius: 10px;
  line-height: 1.7;
  color: var(--gh-ink);
}

.guide-qa__actions {
  margin-top: 0.75rem;
}

/* نماذج الإضافة/التعديل */
.guide-form {
  background: #fff;
  border: 1px solid var(--gh-line);
  border-radius: 16px;
  padding: 1.15rem;
  box-shadow: 0 10px 28px rgba(6, 36, 54, 0.06);
}

.guide-form .form-group {
  margin-bottom: 0.85rem;
}

.guide-form label {
  font-weight: 700;
  color: var(--gh-brand);
  margin-bottom: 0.35rem;
}

.guide-form .form-control,
.guide-form textarea,
.guide-form select {
  border-radius: 12px;
  border-color: var(--gh-line);
  min-height: 44px;
}

.guide-form textarea.form-control {
  min-height: 96px;
}

.guide-form__submit {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.guide-form__submit .btn {
  min-width: 220px;
  min-height: 46px;
  border-radius: 12px;
  font-weight: 800;
}

@media (max-width: 1199.98px) {
  .guides-hub__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.guides-hub--public {
  max-width: var(--jia-pub-container, 1180px);
  margin: 0 auto;
  padding: clamp(0.75rem, 2.5vw, 1.5rem) clamp(0.65rem, 2vw, 1rem) clamp(1.5rem, 3vw, 2.5rem);
}

.guides-hub--public .guide-card__actions .is-primary {
  margin-inline-start: auto;
}

/* الصفحة العامة — بطاقات فقط */
.guides-hub--cards-only {
  padding-top: clamp(1rem, 2.5vw, 1.75rem);
}

.guides-hub__page-head {
  text-align: center;
  margin-bottom: clamp(1rem, 2.5vw, 1.5rem);
}

.guides-hub__page-title {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--gh-brand, #0a4d6e);
  line-height: 1.35;
}

.guides-hub__page-title::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 3px;
  margin: 0.55rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gh-brand-2, #1a7a9c), var(--gh-brand, #0a4d6e));
}

.guides-hub__page-lead {
  margin: 0.65rem auto 0;
  max-width: 40rem;
  color: var(--gh-muted, #5a6b7c);
  font-size: 0.95rem;
  line-height: 1.6;
}

.guides-hub__grid--auto {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
  gap: clamp(0.85rem, 2.2vw, 1.15rem);
  align-items: stretch;
}

.guide-card--public {
  border-radius: 18px;
  border-color: rgba(10, 77, 110, 0.14);
  box-shadow: 0 10px 26px rgba(6, 36, 54, 0.07);
  min-height: 100%;
}

.guide-card--public .guide-card__top {
  padding: 1.05rem 1.1rem 0.65rem;
  background: #fff;
  border-bottom: none;
}

.guide-card--public .guide-card__title {
  font-size: clamp(1rem, 1.6vw, 1.08rem);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.guide-card--public .guide-card__body {
  padding: 0 1.1rem 0.75rem;
  flex: 1 1 auto;
}

.guide-card--public .guide-card__text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 4.5em;
  font-size: 0.9rem;
  line-height: 1.65;
}

.guide-card--public .guide-card__actions {
  padding: 0.75rem 1.1rem 1rem;
  border-top: 1px solid var(--gh-line);
  margin-top: auto;
}

.guide-card__cta {
  width: 100%;
  justify-content: center;
  min-height: 44px;
  border-radius: 12px !important;
  font-size: 0.88rem;
  gap: 0.4rem;
}

.guide-card--public:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(6, 36, 54, 0.11);
}

@media (min-width: 1400px) {
  .guides-hub__grid--auto {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* صفحة تفاصيل الخدمة — عامة */
.guide-detail--public {
  padding-top: clamp(0.85rem, 2vw, 1.35rem);
  padding-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.guide-detail__page-head {
  position: relative;
  margin-bottom: clamp(1rem, 2.5vw, 1.5rem);
}

.guide-detail__page-head .guide-detail__page-title {
  max-width: 54rem;
  margin-inline: auto;
}

.guide-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  color: var(--gh-brand);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
}

.guide-detail__back:hover {
  text-decoration: underline;
}

.guide-detail__layout {
  display: block;
}

.guide-detail__layout--with-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

@media (min-width: 992px) {
  .guide-detail__layout--with-aside {
    grid-template-columns: minmax(0, 1fr) minmax(15.5rem, 17.5rem);
    gap: 1.15rem;
  }
}

.guide-detail__main {
  min-width: 0;
}

.guide-detail__grid--organized {
  margin-bottom: 0;
  gap: 0.85rem;
}

.guide-detail__pair {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: stretch;
}

@media (max-width: 575.98px) {
  .guide-detail__pair {
    grid-template-columns: 1fr;
  }
}

.guide-detail__file-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--gh-line);
}

.guide-detail__file-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.4rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--gh-line);
  background: #fff;
  color: var(--gh-brand);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
}

.guide-detail__file-link:hover {
  border-color: var(--gh-brand);
  background: var(--gh-soft);
}

.guide-detail__file-link--muted {
  color: var(--gh-ink);
}

.guide-detail__block--card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-radius: 16px;
  border-color: rgba(10, 77, 110, 0.12);
  box-shadow: 0 8px 22px rgba(6, 36, 54, 0.05);
}

.guide-detail__block-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.65rem;
}

.guide-detail__block-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(10, 77, 110, 0.14), rgba(26, 122, 156, 0.1));
  color: var(--gh-brand);
  font-size: 0.82rem;
  font-weight: 800;
}

.guide-detail__block-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gh-brand);
  line-height: 1.35;
}

.guide-detail__block-label .fas {
  font-size: 0.86rem;
  opacity: 0.9;
}

.guide-detail__block-body {
  color: var(--gh-ink);
  font-size: 0.93rem;
  line-height: 1.8;
}

.guide-detail__para {
  margin: 0;
  word-break: break-word;
}

.guide-detail__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.guide-detail__list-item {
  position: relative;
  padding-inline-start: 1.1rem;
  line-height: 1.75;
}

.guide-detail__list-item::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.62em;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--gh-brand-2);
}

.guide-detail__list--sub {
  margin: 0.4rem 0 0.1rem;
  padding-inline-start: 1.35rem;
  gap: 0.35rem;
}

.guide-detail__list-item--sub {
  color: var(--gh-muted);
  font-size: 0.92em;
}

.guide-detail__list-item--sub::before {
  width: 0.28rem;
  height: 0.28rem;
  top: 0.68em;
  background: rgba(26, 122, 156, 0.55);
}

/* بنود مرقّمة (1-، 2-…) — الترقيم في النص فقط بدون نقطة زرقاء */
.guide-detail__list-item--numbered {
  padding-inline-start: 0;
}

.guide-detail__list-item--numbered::before {
  display: none;
}

.guide-detail__aside {
  min-width: 0;
}

.guide-detail__aside-card {
  position: sticky;
  top: 5.5rem;
  background: #fff;
  border: 1px solid var(--gh-line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 10px 26px rgba(6, 36, 54, 0.07);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.guide-detail__aside-title {
  margin: 0 0 0.25rem;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--gh-muted);
  text-align: center;
}

.guide-detail__aside-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 46px;
  padding: 0.5rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--gh-line);
  background: #fff;
  color: var(--gh-ink);
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
  text-align: center;
}

.guide-detail__aside-btn:hover {
  border-color: var(--gh-brand);
  color: var(--gh-brand);
  background: var(--gh-soft);
}

.guide-detail__aside-btn--primary {
  background: var(--gh-brand);
  border-color: var(--gh-brand);
  color: #fff;
}

.guide-detail__aside-btn--primary:hover {
  background: #083d58;
  color: #fff;
}

.guide-detail__aside-btn--muted {
  color: var(--gh-brand);
  background: rgba(10, 77, 110, 0.06);
  border-color: rgba(10, 77, 110, 0.18);
}

.guide-detail__panel {
  margin-top: clamp(1rem, 2.5vw, 1.35rem);
  background: #fff;
  border: 1px solid var(--gh-line);
  border-radius: 18px;
  padding: clamp(0.9rem, 2vw, 1.15rem);
  box-shadow: 0 10px 28px rgba(6, 36, 54, 0.06);
}

.guide-detail__panel-title {
  margin: 0 0 0.75rem;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--gh-brand);
  text-align: center;
}

.guide-detail__panel-title::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 3px;
  margin: 0.45rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gh-brand-2), var(--gh-brand));
}

.guide-detail__faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.guide-detail__panel .guide-faq {
  background: var(--gh-soft);
  border-color: rgba(10, 77, 110, 0.12);
  box-shadow: none;
}

.guide-detail__panel .guide-faq__a {
  background: #fff;
}

.guide-faq {
  background: #fff;
  border: 1px solid var(--gh-line);
  border-radius: 14px;
  padding: 0.65rem 0.9rem;
  box-shadow: 0 6px 16px rgba(6, 36, 54, 0.04);
}

.guide-faq__q {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.55;
  color: var(--gh-ink);
  list-style: none;
}

.guide-faq__q::-webkit-details-marker {
  display: none;
}

.guide-faq__num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: rgba(10, 77, 110, 0.1);
  color: var(--gh-brand);
  font-size: 0.78rem;
  font-weight: 800;
}

.guide-faq__num--a {
  background: var(--gh-soft);
}

.guide-faq__a {
  margin: 0.65rem 0 0.15rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: var(--gh-soft);
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  line-height: 1.75;
  font-size: 0.92rem;
  color: var(--gh-ink);
}

@media (max-width: 991.98px) {
  .guide-detail__layout--with-aside {
    display: flex;
    flex-direction: column;
  }

  .guide-detail__aside {
    order: -1;
  }

  .guide-detail__aside-card {
    position: static;
  }
}

@media (max-width: 767.98px) {
  .guides-hub__hero,
  .guide-detail__hero {
    flex-direction: column;
    align-items: stretch;
  }

  .guides-hub__hero-actions,
  .guide-detail__actions {
    justify-content: flex-start;
  }

  .guides-hub__grid {
    grid-template-columns: 1fr;
  }

  .guide-detail__grid {
    grid-template-columns: 1fr;
  }
}
