/* ============================================================
   PipsPrice, homepage services (preview page): three featured photo cards,
   compact tiles for the other services and a link to the full /services page.
   Used by index-hero-blueprint.html with js/services-featured.js.

   Contrast (WCAG 2.2 AA), measured on the real photos: text on the cards sits on
   blueprint blue (lowest 7.6:1 for headings, 8.2:1 for body text). On the cream
   background #F5F0EB: headings #0D0D0D 17:1, body #474747 7.9:1, crimson #862F35 9.4:1.
   ============================================================ */

.svc-featured {
  --so-blue: 12, 46, 78;      /* blueprint blue, as in the hero */
  --so-ink: #0D0D0D;
  --so-body: #474747;
  background: var(--light);
  padding: 96px 0 88px;
}
.svc-featured .section-header { margin-bottom: 44px; }
.svc-featured ol, .svc-featured ul { list-style: none; margin: 0; padding: 0; }
.svc-featured h3, .svc-featured h4 { margin: 0; font-weight: 400; }

/* The service name is the link; its ::after covers the whole card or tile */
.so-link { color: inherit; text-decoration: none; }
.so-link::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.so-link:focus-visible { outline: none; }
.so-link:focus-visible::after { outline: 3px solid var(--crimson); outline-offset: 2px; }

/* ── Featured cards ────────────────────────────────────────── */
.soc-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.soc-card {
  position: relative; min-height: 470px; display: flex; align-items: flex-end;
  overflow: hidden; background: rgb(var(--so-blue)); color: #fff; isolation: isolate;
}
.soc-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.soc-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(var(--so-blue), 0.96) 0%, rgba(var(--so-blue), 0.9) 52%, rgba(var(--so-blue), 0.35) 78%, rgba(var(--so-blue), 0.05) 100%);
}
.soc-card::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--crimson); transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease; }
.soc-card:hover img, .soc-card:focus-within img { transform: scale(1.05); }
.soc-card:hover::after, .soc-card:focus-within::after { transform: scaleX(1); }
.soc-card-text { padding: 30px 28px 28px; }
.soc-name { font-family: var(--font-display); font-size: 2.7rem; line-height: 0.95; letter-spacing: 0.03em; }
.soc-desc { margin: 10px 0 16px; color: #DCE3EA; font-size: 0.97rem; line-height: 1.6; }
.soc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px !important; }
.soc-tags li { font-family: var(--font-cond); font-weight: 600; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 10px; border: 1px solid rgba(255, 255, 255, 0.45); }
.soc-more { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-cond); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; }
.soc-more svg { transition: transform 0.25s ease; }
.soc-card:hover .soc-more svg, .soc-card:focus-within .soc-more svg { transform: translateX(4px); }

/* ── The other services + link to the full page ────────────── */
.soc-rest-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin: 40px 0 16px; }
.soc-rest-title { font-family: var(--font-cond); font-weight: 700 !important; font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--crimson); }
.soc-all {
  display: inline-flex; align-items: center; gap: 10px; margin-left: auto;
  font-family: var(--font-cond); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--so-ink); text-decoration: none; padding: 12px 18px; border: 2px solid var(--so-ink);
  transition: background 0.25s ease, color 0.25s ease;
}
.soc-all:hover { background: var(--so-ink); color: #fff; }
.soc-all:focus-visible { outline: 3px solid var(--crimson); outline-offset: 3px; }
.soc-rest { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.soc-tile {
  position: relative; display: grid; grid-template-columns: 84px minmax(0, 1fr) 24px; gap: 16px; align-items: center;
  padding: 10px 18px 10px 10px; background: #fff; border: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.soc-tile img, .soc-tile-ph { width: 84px; height: 72px; object-fit: cover; background: rgb(var(--so-blue)); display: block; }
.soc-tile-name { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; letter-spacing: 0.03em; color: var(--so-ink); transition: color 0.25s ease; }
.soc-tile-tags { margin: 4px 0 0; font-size: 0.85rem; line-height: 1.4; color: var(--so-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-go { color: var(--crimson); transition: transform 0.25s ease; }
.soc-tile:hover, .soc-tile:focus-within { border-color: var(--crimson); }
.soc-tile:hover .soc-tile-name, .soc-tile:focus-within .soc-tile-name { color: var(--crimson); }
.soc-tile:hover .soc-go, .soc-tile:focus-within .soc-go { transform: translateX(4px); }

/* ── Slim call to action ───────────────────────────────────── */
.so-cta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px 40px; flex-wrap: wrap;
  margin-top: 40px; padding: 26px 32px;
  background: var(--dark); color: #fff;
}
.so-cta-text {
  margin: 0 0 4px; font-family: var(--font-cond); font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: #C9C3BD;
}
.so-cta-title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 2.6vw, 2.4rem); line-height: 1; }

/* ── Tablets ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .svc-featured { padding: 80px 0 72px; }
  .soc-top { gap: 14px; }
  .soc-card-text { padding: 22px 20px; }
  .soc-name { font-size: 2.2rem; }
  .soc-rest { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Phones and small tablets: one column ─────────────────── */
@media (max-width: 860px) {
  .svc-featured { padding: 64px 0 56px; }
  .svc-featured .section-header { margin-bottom: 28px; }
  .soc-top { grid-template-columns: 1fr; gap: 10px; }
  .soc-card { min-height: 0; }
  .soc-card-text { padding: 110px 20px 20px; }
  .soc-card::before { background: linear-gradient(to top, rgba(var(--so-blue), 0.96) 0%, rgba(var(--so-blue), 0.9) 50%, rgba(var(--so-blue), 0.74) 72%, rgba(var(--so-blue), 0.15) 100%); }
  .soc-name { font-size: 2.2rem; }
  .soc-desc { margin-bottom: 12px; }
  .soc-tags { display: none; }
  .soc-rest { grid-template-columns: 1fr; gap: 8px; }
  .soc-tile { grid-template-columns: 72px minmax(0, 1fr) 24px; gap: 14px; }
  .soc-tile img, .soc-tile-ph { width: 72px; height: 60px; }
  .soc-all { width: 100%; justify-content: center; margin-left: 0; order: 2; }
  .so-cta { padding: 22px 20px; }
  .so-cta .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .svc-featured *, .svc-featured *::before, .svc-featured *::after { transition: none !important; }
}
