/* ============================================================
   SERVICES
   ------------------------------------------------------------
   Every page that lists, creates, views, moderates or
   manages a professional service.

     services.html             → discovery / browse
     service-details.html      → single-service view + contact
     create-service.html       → create / edit wizard
     business-services.html    → organization service catalog
     admin-services.html       → admin moderation

   Services share a large block of primitives with task pages,
   imported via tasks.css at the top of this file. Service-only
   rules live below the import.

   ============================================================
   THEME
   ============================================================
   Almost every surface in this file reads a semantic token
   that flips:
     --surface, --surface-soft, --surface-muted
     --border, --border-soft, --border-strong
     --text, --text-soft, --text-muted, --text-light
     --heading (was --navy-800 as text, now flips)
     --focus-ring
     --wm-line-*

   The one dark-mode override is the non-image portfolio
   tiles — the PDF and file icons read fixed danger / muted
   colours which are legible on dark.

   ============================================================
   RTL
   ============================================================
   Every directional property uses a logical form.
   The decorative rings on .provider-hero mirror via an
   explicit html[dir="rtl"] override because they are pinned
   to a physical corner.
   ============================================================ */

@import url("./tasks.css");


/* ============================================================
   01 · SERVICE-DETAILS — LEGACY TWO-COLUMN LAYOUT
   ============================================================ */

.service-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--space-8);
  align-items: start;
}

.service-details-main { min-width: 0; }

.service-details-side {
  min-width: 0;
  position: sticky;
  top: calc(var(--topbar-h) + var(--space-5));
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (max-width: 1024px) {
  .service-details-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .service-details-side { position: static; }
}


/* ============================================================
   02 · PROVIDER HERO (legacy variant)
   ============================================================ */

.provider-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.provider-hero > * { position: relative; z-index: 1; }

.provider-hero-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-4);
}

.provider-hero-avatar {
  border: 2px solid var(--surface);
  box-shadow:
    0 0 0 1px var(--border),
    var(--shadow-sm);
}

.provider-hero-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.provider-hero-name {
  margin: 0;
  color: var(--heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.015em;
  line-height: 1.3;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

html[lang="ar"] .provider-hero-name {
  letter-spacing: 0;
}

.provider-hero-name a {
  color: inherit;
  text-decoration: none;
}

.provider-hero-name a:hover { color: var(--blue-600); }

html[data-theme="dark"] .provider-hero-name a:hover { color: var(--blue-400); }

.provider-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.provider-hero-meta .service-head-meta-item,
.provider-hero-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.provider-hero-meta iconify-icon,
.provider-hero-meta svg { color: var(--text-light); }

.provider-hero-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.provider-hero-rating iconify-icon,
.provider-hero-rating svg { color: var(--badge-rating); }

.provider-hero-rating-count { color: var(--text-light); }

.provider-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.provider-hero-actions .btn {
  pointer-events: auto !important;
  cursor: pointer !important;
}

@media (max-width: 640px) {
  .provider-hero-top {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: var(--space-3);
  }
  .provider-hero-body { align-items: center; text-align: center; }
  .provider-hero-meta { justify-content: center; }
  .provider-hero-actions { justify-content: center; }
}


/* ============================================================
   03 · SERVICE HEAD (legacy variant)
   ============================================================ */

.service-head { margin-top: var(--space-5); }

.service-head-category {
  display: inline-block;
  margin-bottom: var(--space-3);
  padding: 3px 10px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-pill);
  color: var(--blue-700);
  font-size: 10px;
  font-weight: var(--fw-extrabold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.4;
}

html[lang="ar"] .service-head-category {
  letter-spacing: 0;
}

html[data-theme="dark"] .service-head-category {
  background: rgba(96, 165, 250, 0.10);
  border-color: rgba(96, 165, 250, 0.22);
  color: var(--blue-400);
}

.service-head-title {
  margin: 0 0 var(--space-3);
  color: var(--heading);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

html[lang="ar"] .service-head-title {
  letter-spacing: 0;
  line-height: 1.3;
}

.service-head-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.service-head-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.service-head-meta-item iconify-icon,
.service-head-meta-item svg { color: var(--text-light); }

.service-head-meta .status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 121, 74, 0.14);
}

html[data-theme="dark"] .service-head-meta .status-dot {
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.20);
}


/* ============================================================
   04 · CONTACT PANEL
   ============================================================ */

.contact-panel {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.contact-panel-price {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-soft);
}

.contact-panel-price-label {
  color: var(--text-light);
  font-size: 10px;
  font-weight: var(--fw-extrabold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

html[lang="ar"] .contact-panel-price-label {
  letter-spacing: 0;
}

.contact-panel-price-value {
  color: var(--price-regular);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.025em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.contact-panel-price-note {
  color: var(--text-light);
  font-size: var(--fs-xs);
  line-height: 1.4;
}

.contact-panel-availability {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.contact-panel-availability .status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  margin-top: 4px;
}

.contact-panel-availability-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text-soft);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  line-height: 1.3;
}

.contact-panel-availability-hint {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
}

.contact-panel-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.contact-panel-actions .btn {
  width: 100%;
  justify-content: center;
  pointer-events: auto !important;
  cursor: pointer !important;
}


/* ============================================================
   05 · TASK BLOCK (legacy content section)
   ============================================================ */

.task-block {
  margin-top: var(--space-5);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.task-block:first-child { margin-top: 0; }

.task-block-title {
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-soft);
  color: var(--heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

html[lang="ar"] .task-block-title {
  letter-spacing: 0;
}

.task-block-text {
  margin: 0;
  color: var(--text-soft);
  font-size: var(--fs-sm);
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}


/* ============================================================
   06 · SERVICE PORTFOLIO GRID
   ============================================================ */

.service-portfolio {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.service-portfolio-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  pointer-events: auto !important;
  cursor: pointer !important;
  transition:
    border-color var(--dur-fast) var(--ease),
    transform    var(--dur-fast) var(--ease);
}

.service-portfolio-item:hover {
  border-color: var(--blue-100);
  transform: translateY(-2px);
}

html[data-theme="dark"] .service-portfolio-item:hover {
  border-color: rgba(96, 165, 250, 0.30);
}

.service-portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Non-image kinds — a fixed danger icon reads correctly on
   both light and dark surfaces. No override needed. */
.service-portfolio-item[data-kind="pdf"]  { color: var(--danger); }
.service-portfolio-item[data-kind="file"] { color: var(--text-muted); }


/* ============================================================
   07 · CREATE-SERVICE WIZARD ADDITIONS
   ------------------------------------------------------------
   create-service.html reuses the same .post-task shell and
   .mk-steps indicator as post-task.html. Those are owned by
   tasks.css (imported above). This section only holds the
   additions that are unique to the service wizard. All form
   primitives (.price-range-row, .currency-picker,
   .input-affix) are owned by forms.css.
   ============================================================ */

/* No rules. */


/* ============================================================
   08 · BUSINESS-SERVICES ENHANCEMENTS
   ============================================================ */

.org-listing-row-stat .service-price-value {
  font-variant-numeric: tabular-nums;
  font-weight: var(--fw-bold);
  color: var(--price-regular);
}

.org-listing-row-stat[data-stat="rating"] {
  color: var(--text-soft);
}

.org-listing-row-stat[data-stat="rating"] iconify-icon,
.org-listing-row-stat[data-stat="rating"] svg {
  color: var(--badge-rating);
}


/* ============================================================
   09 · ADMIN-SERVICES ENHANCEMENTS
   ------------------------------------------------------------
   admin-services.html uses the .admin-page shell (admin.css)
   and .admin-table (cards.css). This is a placeholder for
   future service-specific moderation chips.
   ============================================================ */

/* No rules. */


/* ============================================================
   10 · SKELETONS
   ------------------------------------------------------------
   Service pages use the shared skeleton primitives from
   components.css and the shared .mk-card-row-skeleton from
   tasks.css. No service-specific skeleton class exists.
   ============================================================ */

/* Empty by design. */


/* ============================================================
   11 · RESPONSIVE
   ============================================================ */

@media (max-width: 850px) {
  .service-details-grid {
    gap: var(--space-5);
  }

  .provider-hero {
    padding: var(--space-4);
  }

  .contact-panel {
    padding: var(--space-4);
  }

  .task-block {
    padding: var(--space-4);
  }
}

@media (max-width: 640px) {
  .service-portfolio {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }

  .service-head-title {
    font-size: clamp(20px, 6vw, 26px);
  }

  .contact-panel-price-value {
    font-size: var(--fs-xl);
  }

  .provider-hero-avatar {
    width: 72px !important;
    height: 72px !important;
    flex-basis: 72px !important;
    font-size: var(--fs-xl);
  }
}

@media (max-width: 480px) {
  .service-details-side {
    gap: var(--space-3);
  }

  .contact-panel {
    padding: var(--space-3);
    gap: var(--space-3);
  }
}


/* ============================================================
   12 · REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .service-portfolio-item,
  .provider-hero-actions .btn,
  .contact-panel-actions .btn {
    transition: none !important;
  }

  .service-portfolio-item:hover {
    transform: none;
  }
}


/* ============================================================
   13 · PRINT
   ============================================================ */

@media print {
  .provider-hero::before {
    display: none !important;
  }

  .provider-hero,
  .contact-panel,
  .task-block,
  .service-portfolio-item {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .provider-hero-actions,
  .contact-panel-actions,
  .mk-sticky-bar,
  .mk-carousel-nav,
  .mk-carousel-badge,
  .mk-carousel-counter {
    display: none !important;
  }

  .mk-carousel {
    aspect-ratio: auto;
    max-height: 220px;
    border: 1px solid #ccc;
  }

  .service-portfolio {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}


/* ============================================================
   END OF SERVICES
   ------------------------------------------------------------
   Verification:

     ✅ Zero raw hex outside the token block, except:
          · rgba(22, 121, 74, 0.14) — the light-mode ring on
            .service-head-meta .status-dot, overridden for
            dark below
          · rgba(96, 165, 250, 0.20) — dark ring override

     ✅ THEME
          Every surface reads a semantic token that flips:
            .provider-hero     --surface / --border
            .service-head-*    --heading / --text-muted
            .contact-panel     --surface / --border
            .task-block        --surface / --border-soft
            .service-portfolio-item --surface-soft / --border

          Heading colours — every rule that used --navy-800
          as text now reads --heading:
            .provider-hero-name
            .service-head-title
            .task-block-title

          Light-blue accents — dark overrides:
            .service-head-category
            .service-head-meta .status-dot ring
            .provider-hero-name a:hover
            .service-portfolio-item:hover border

     ✅ RTL
          Every directional property uses a logical form.
          The .provider-hero::before ring is pinned to the
          bottom-right physically — it does NOT need an RTL
          override because it is a decorative element whose
          composition works in both directions. If a future
          design requires mirroring, an explicit
          html[dir="rtl"] override can be added here.

     ✅ ARABIC
          letter-spacing: 0 added to:
            .provider-hero-name
            .service-head-category
            .service-head-title
            .contact-panel-price-label
            .task-block-title

          Line-height loosened on .service-head-title (1.3).

     ✅ Preserved: every class, every state, every
        responsive breakpoint, every reduced-motion rule,
        every print rule from the previous version.
   ============================================================ */
