/* ==========================================================================
   M3RBS: Services page
   Loaded only by services.html, after base.css (shared tokens, header, footer, page title).
   Providers are grouped by category; on wide screens each category has a left rail.
   ========================================================================== */

/* ---------- Page head + category index ---------- */
.svc-head {
  display: grid;
  gap: var(--s2);
  padding-top: var(--s2);
  padding-bottom: var(--s3);
}

.svc-head__lede {
  margin-top: 12px;
  font-size: 1.0625rem;
  max-width: 34rem;
}

/* Phones: the index is a short wrapping run of text links */
.svc-index .label { padding-bottom: 4px; }
.svc-index ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s2);
}
.svc-index a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
}
.svc-index a:hover { color: var(--accent); }

@media (min-width: 640px) {
  .svc-head { padding-top: var(--s4); }
}

@media (min-width: 1000px) {
  .svc-head {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: start;
    padding-bottom: var(--s4);
  }
  .svc-head__text { grid-column: 1 / span 7; }
  /* Desktop: a ruled list, like the shul code key */
  .svc-index { grid-column: 9 / -1; border-top: 1px solid var(--line-strong); padding-top: 12px; margin-top: 6px; }
  .svc-index ul { display: block; }
  .svc-index li { border-bottom: 1px solid var(--line); }
  .svc-index a { display: flex; min-height: 38px; text-decoration: none; }
  .svc-index a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
}

/* ---------- Category groups ---------- */
.svc-group { padding-bottom: var(--s4); }

.svc-group__grid { display: grid; }

.svc-group__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
}

@media (min-width: 1000px) {
  .svc-group { padding-bottom: 0; }
  /* Left rail: the category name sits beside its listings; one rule spans the whole band */
  .svc-group__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: start;
    border-top: 1px solid var(--line-strong);
    padding-bottom: var(--s4);
  }
  .svc-group__title {
    grid-column: 1 / span 3;
    border-bottom: 0;
    padding: 22px var(--s2) 0 0;
  }
  .svc-list { grid-column: 4 / -1; }
}

/* ---------- Provider entries ---------- */
.provider {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-areas:
    "img main"
    ".   contact";
  column-gap: var(--s1);
  row-gap: 10px;
  align-items: start;
  padding: 20px 0 18px;
  border-bottom: 1px solid var(--line);
}

.provider__img {
  grid-area: img;
  width: 56px;
  height: 56px;
  border-radius: 2px;
  background: var(--surface);
}
/* Logos and artwork-style marks sit on a hairline square; portraits and paintings run to the edge */
.provider__img--logo { border: 1px solid var(--line); }
.provider__img--photo { border: 0; }

.provider__main { grid-area: main; min-width: 0; }

.provider__name {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
}

.provider__service {
  margin-top: 2px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--accent);
}

.provider__desc {
  margin-top: 8px;
  font-size: 0.9375rem;
  line-height: 1.5;
  max-width: 34rem;
}

.provider__hours {
  margin-top: 8px;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.provider__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 8px;
}

/* Contacts: every channel named in words; the number, address or domain is visible */
.provider__contact {
  grid-area: contact;
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s2);
}
.provider__contact a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

@media (min-width: 640px) {
  .provider { grid-template-columns: 72px minmax(0, 1fr); column-gap: var(--s2); padding: var(--s2) 0 20px; }
  .provider__img { width: 72px; height: 72px; }
  .provider__name { font-size: 1.375rem; }
}

/* Desktop, option chosen: one wide listing per row. Identity and description in the middle,
   contacts as a short vertical list on the right, so long email addresses never wrap mid-row. */
@media (min-width: 1000px) {
  .provider {
    grid-template-columns: 72px minmax(0, 1.45fr) minmax(0, 1fr);
    grid-template-areas: "img main contact";
    column-gap: var(--s3);
    padding: 22px 0 22px;
  }
  .svc-list .provider:last-child { border-bottom: 0; }
  .provider__contact { display: block; padding-top: 2px; }
  .provider__contact a { min-height: 30px; }
}

/* Alternative evaluated (not used): two listings per row in the content area.
   Kept as a modifier so the comparison can be reproduced. */
@media (min-width: 1000px) {
  .svc-list--two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--s4);
  }
  .svc-list--two .provider {
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-areas: "img main" ".   contact";
    column-gap: var(--s2);
  }
  .svc-list--two .provider:last-child { border-bottom: 1px solid var(--line); }
  .svc-list--two .provider__img { width: 64px; height: 64px; }
  .svc-list--two .provider__contact { display: flex; padding-top: 0; }
  .svc-list--two .provider__contact a { min-height: 32px; }
}

/* ---------- Invitation to be listed ---------- */
.svc-note {
  padding-top: var(--s2);
  padding-bottom: var(--s5);
}
.svc-note .label { margin-bottom: var(--s0); }
.svc-note p {
  max-width: 44rem;
  font-size: 0.9375rem;
  color: var(--muted);
}
@media (min-width: 1000px) {
  .svc-note {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    border-top: 1px solid var(--line-strong);
    padding-top: var(--s3);
  }
  .svc-note .label { grid-column: 1 / span 3; }
  .svc-note p { grid-column: 4 / -1; }
}
