/*
 * Service detail panel for the Services grid.
 * Each card's details live in the page (.svc-detail, hidden) so search engines can read them;
 * assets/js/service-details.js shows them in a side panel (full screen on phones).
 */

/* Cards: the title button covers the whole card, so anywhere on it opens the details */
.svc { position: relative; }
.svc-open { all: unset; cursor: pointer; }
.svc-open::after { content: ""; position: absolute; inset: 0; }
.svc-open:focus-visible { outline: none; }
.svc:has(.svc-open:focus-visible) { outline: 2px solid var(--orange); outline-offset: -2px; }
.svc:hover h3 { color: var(--orange-ink); }
.svc h3 { transition: color .15s; }
.svc-more { margin-top: auto; padding-top: 8px; font: 600 13px var(--f-body); color: var(--navy); display: inline-flex; align-items: center; gap: 6px; }
.svc-more::after { content: "→"; transition: transform .15s; }
.svc:hover .svc-more::after { transform: translateX(3px); }

/* Panel */
.svc-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(14, 30, 51, .45); }
.svc-panel {
  position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  display: flex; flex-direction: column; background: var(--surface);
  box-shadow: -20px 0 50px -20px rgba(14, 30, 51, .35);
  animation: svc-in .26s cubic-bezier(.2, .8, .2, 1);
}
@keyframes svc-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
body.svc-locked { overflow: hidden; }

.svc-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) 14px 28px;
  border-bottom: 1px solid var(--line);
}
.svc-panel-code { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; color: var(--orange-ink); }
.svc-panel-nav { display: flex; gap: 6px; }
.svc-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--navy); cursor: pointer; }
.svc-icon:hover { border-color: var(--navy); }
.svc-icon svg { width: 16px; height: 16px; }

.svc-panel-body { flex: 1; overflow-y: auto; padding: 28px 28px 32px; padding-right: max(28px, env(safe-area-inset-right, 0px)); }
.svc-panel-body h2 { font-size: 30px; font-weight: 800; color: var(--navy); }
.svc-summary { font-size: 17px; margin-top: 10px; max-width: 46ch; }
.svc-panel-body h4 { margin: 26px 0 10px; font: 600 12px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.svc-panel-body ul, .svc-panel-body ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.svc-panel-body li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; font-size: 15px; line-height: 1.5; }
.svc-included li::before {
  content: ""; width: 14px; height: 14px; margin-top: 4px; border-radius: 3px;
  background: var(--orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 7.2l2.2 2.2 4.8-4.8' fill='none' stroke='%23fff' stroke-width='1.8'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.svc-when li::before { content: ""; width: 6px; height: 6px; margin: 9px 0 0 4px; background: var(--navy); }
.svc-need { margin-top: 26px; background: var(--navy-soft); border-radius: 6px; padding: 2px 20px 18px; }
.svc-need h4 { margin-top: 16px; }
.svc-need ol { counter-reset: need; }
.svc-need li::before {
  counter-increment: need; content: counter(need);
  width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; text-align: center;
  font: 500 11px/18px var(--f-mono); background: var(--navy); color: #fff;
}
.svc-panel-body .svc-pairs { display: flex; flex-wrap: wrap; gap: 8px; }
.svc-pairs li { display: block; }
.svc-pairs a {
  display: inline-flex; gap: 8px; align-items: center; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--navy); text-decoration: none; font: 500 13.5px var(--f-body);
}
.svc-pairs a span { font-family: var(--f-mono); font-size: 11px; color: var(--orange-ink); }
.svc-pairs a:hover { border-color: var(--navy); }

.svc-panel-foot {
  display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center;
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 16px 28px calc(16px + env(safe-area-inset-bottom, 0px));
  padding-right: max(28px, env(safe-area-inset-right, 0px));
}
.svc-panel-foot .btn { flex: 1; min-width: 200px; justify-content: center; }
.svc-panel-foot small { width: 100%; color: var(--muted); font-size: 12.5px; }

.chip.is-flash { animation: svc-flash 1.2s ease-out; }
@keyframes svc-flash { from { box-shadow: 0 0 0 0 rgba(242, 107, 29, .7); } to { box-shadow: 0 0 0 10px rgba(242, 107, 29, 0); } }

@media (max-width: 560px) {
  .svc-panel-head { padding-left: max(20px, env(safe-area-inset-left, 0px)); }
  .svc-panel-body { padding: 22px 20px 28px; }
  .svc-panel-body h2 { font-size: 26px; }
  .svc-panel-foot { padding-left: 20px; padding-right: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .svc-panel, .chip.is-flash { animation: none; }
}
