/*
 * The Service page (templates/page-service.php). Loaded after
 * deviceland.css, whose bands, type, buttons and tokens it uses; this file
 * adds only what the homepage has no counterpart for: the price tables, the
 * device drawers and the fee ledger.
 *
 * The tables are a ledger, not a grid of boxes: hairline rules, figures in
 * tabular numerals aligned right, the model name as the row heading. A price
 * list is read down one column, so nothing competes with that column.
 */

.svc-page {
  --svc-rule: var(--hair-light);
  --svc-rule-2: var(--hair-light-2);
}

/* ---- Hero ------------------------------------------------------------ */
.svc-hero {
  padding-top: calc(var(--head-h, 112px) + 56px);
  padding-bottom: 88px;
}

.svc-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: end;
}

.svc-crumbs {
  display: flex;
  gap: 10px;
  margin-bottom: 26px;
  font-size: 13px;
  color: var(--muted-fg);
}

.svc-crumbs a {
  color: inherit;
}

.svc-crumbs a:hover {
  color: var(--ink);
}

.svc-hero .display {
  margin-top: 18px;
}

.svc-hero .lede {
  margin-top: 26px;
  max-width: 34rem;
}

.svc-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.svc-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin: 48px 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--hair-dark);
}

.svc-facts dt {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted-fg);
}

.svc-facts dd {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
}

.svc-hero-shot {
  margin: 0;
}

.svc-hero-shot picture {
  display: block;
}

/* 4:5, not the file's own tall crop: at 1440 the portrait ran 540px taller
   than the copy beside it and left a band of empty paper above the headline. */
.svc-hero-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  max-height: 620px;
  object-fit: cover;
  object-position: 50% 35%;
  border-radius: var(--r-lg);
}

.svc-hero-shot figcaption {
  margin-top: 14px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--muted-fg);
}

/* ---- Section heads ------------------------------------------------------ */
.svc-head {
  max-width: 44rem;
  margin-bottom: 48px;
}

.svc-head .display {
  margin-top: 16px;
}

/* The homepage's section heads track their eyebrow at 0.32em (.sec-head). */
.svc-head .eyebrow,
.svc-split .eyebrow,
.svc-visit .eyebrow {
  letter-spacing: 0.32em;
}

.svc-head .lede {
  margin-top: 22px;
}

.svc-page h2 em,
.svc-page h1 em {
  font-style: italic;
  color: var(--ember-deep);
}

.svc-page .band-ink h2 em {
  color: inherit;
}

/* ---- What we repair ------------------------------------------------------ */
.svc-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--svc-rule-2);
}

.svc-cards li {
  padding: 30px 28px 34px 0;
  border-bottom: 1px solid var(--svc-rule);
}

.svc-cards li:not(:nth-child(3n + 1)) {
  padding-left: 28px;
  border-left: 1px solid var(--svc-rule);
}

.svc-cards h3,
.svc-panel h3,
.svc-fees h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.05;
  color: var(--ink);
}

.svc-cards p,
.svc-panel p {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted-fg);
}

/* ---- Warranty, and the two-column sections -------------------------------- */
.svc-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.svc-split .display {
  margin-top: 16px;
}

.svc-split .lede {
  margin-top: 24px;
}

.svc-split .btn {
  margin-top: 30px;
}

/* ---- Fee ledgers ------------------------------------------------------------ */
.svc-fees dl {
  margin: 18px 0 0;
  border-top: 1px solid var(--svc-rule-2);
}

.svc-fees dl > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--svc-rule);
}

.svc-fees dt {
  font-size: 15px;
  color: var(--ink);
}

.svc-fees dt small {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted-fg);
}

.svc-fees dd {
  margin: 0;
  font-size: 15px;
  white-space: nowrap;
  color: var(--ink);
}

.svc-fees-wide {
  margin-top: 64px;
}

.svc-fees-wide dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 56px;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* ---- Price drawers -------------------------------------------------------- */
.svc-prices {
  border-top: 1px solid var(--svc-rule-2);
}

.svc-device {
  border-bottom: 1px solid var(--svc-rule-2);
}

.svc-device > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
  cursor: pointer;
  list-style: none;
}

.svc-device > summary::-webkit-details-marker {
  display: none;
}

.svc-device > summary::after {
  content: '+';
  font-family: var(--display);
  font-size: 30px;
  line-height: 1;
  color: var(--ember-deep);
  transition: transform 0.35s var(--ease);
}

.svc-device[open] > summary::after {
  transform: rotate(45deg);
}

.svc-device-name {
  font-family: var(--display);
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1;
  color: var(--ink);
}

.svc-device-count {
  margin-left: auto;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

.svc-device > summary:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 4px;
}

.svc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 28px;
}

.svc-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14.5px;
}

.svc-table th,
.svc-table td {
  padding: 11px 16px 11px 0;
  border-bottom: 1px solid var(--svc-rule);
  text-align: left;
  font-weight: 400;
  color: var(--ink);
}

.svc-table thead th {
  padding-top: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-fg);
  border-bottom-color: var(--svc-rule-2);
}

.svc-table td,
.svc-table thead th:not(:first-child) {
  text-align: right;
}

.svc-table td:last-child,
.svc-table th:last-child {
  padding-right: 0;
}

.svc-table tbody th {
  white-space: nowrap;
}

.svc-table .svc-family th {
  padding-top: 26px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember-deep);
  border-bottom-color: var(--svc-rule-2);
}

.svc-table td span {
  color: var(--muted-fg);
}

.svc-mac {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}

.svc-table-2 {
  min-width: 0;
}

.svc-table-2 caption {
  padding-bottom: 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember-deep);
  border-bottom: 1px solid var(--svc-rule-2);
}

.svc-table-2 tbody th {
  white-space: normal;
}

.svc-aside {
  margin: 0 0 28px;
  font-size: 13px;
  color: var(--muted-fg);
}

/* ---- Trade-in and financing ------------------------------------------------ */
.svc-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.svc-panel {
  padding: 36px 36px 30px;
  background: var(--paper-2);
  border: 1px solid var(--svc-rule);
  border-radius: var(--r-lg);
}

.svc-panel .svc-aside {
  margin: 18px 0 0;
}

.svc-steps {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  border-top: 1px solid var(--svc-rule);
}

.svc-steps li {
  position: relative;
  padding: 14px 0 14px 44px;
  border-bottom: 1px solid var(--svc-rule);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted-fg);
  counter-increment: step;
}

.svc-steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 14px;
  font-family: var(--display);
  font-size: 18px;
  color: var(--ember-deep);
}

.svc-steps strong {
  font-weight: 500;
  color: var(--ink);
}

/* ---- Visit ------------------------------------------------------------------ */
.svc-visit {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: end;
  padding-block: 88px 40px;
}

.svc-visit .display {
  margin-top: 16px;
}

.svc-visit .visit-facts {
  margin-top: 0;
}

.svc-fine {
  margin: 0;
  padding: 26px 0 56px;
  max-width: 62rem;
  font-size: 12.5px;
  line-height: 1.6;
}

/* ---- Small screens -------------------------------------------------------- */
@media (max-width: 1024px) {
  .svc-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .svc-cards li:not(:nth-child(3n + 1)) {
    padding-left: 0;
    border-left: 0;
  }

  .svc-cards li:nth-child(2n) {
    padding-left: 28px;
    border-left: 1px solid var(--svc-rule);
  }

  .svc-mac {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 820px) {
  .svc-hero {
    padding-top: calc(var(--head-h, 96px) + 32px);
    padding-bottom: 56px;
  }

  .svc-hero-grid,
  .svc-split,
  .svc-pair,
  .svc-visit {
    grid-template-columns: 1fr;
  }

  .svc-hero-shot img {
    aspect-ratio: 4 / 3;
  }

  .svc-facts {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .svc-facts > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
  }

  .svc-facts dd {
    margin: 0;
    font-size: 22px;
  }

  .svc-fees-wide dl {
    grid-template-columns: 1fr;
  }

  .svc-panel {
    padding: 28px 24px 24px;
  }

  .svc-visit {
    padding-block: 64px 28px;
  }
}

/* Phones: a price table becomes a stack of models, each service a quiet
   label-and-figure line, instead of a table that scrolls sideways (all four
   did at 390px). */
@media (max-width: 640px) {
  .svc-table-wrap {
    overflow: visible;
  }

  .svc-table:not(.svc-table-2) {
    min-width: 0;
  }

  .svc-table:not(.svc-table-2) thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .svc-table:not(.svc-table-2),
  .svc-table:not(.svc-table-2) tbody,
  .svc-table:not(.svc-table-2) tr,
  .svc-table:not(.svc-table-2) th,
  .svc-table:not(.svc-table-2) td {
    display: block;
  }

  .svc-table:not(.svc-table-2) tbody tr:not(.svc-family) {
    padding: 14px 0 10px;
    border-bottom: 1px solid var(--svc-rule);
  }

  .svc-table:not(.svc-table-2) tbody tr:not(.svc-family) th {
    padding: 0 0 6px;
    border: 0;
    font-size: 15px;
    white-space: normal;
  }

  .svc-table:not(.svc-table-2) td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 3px 0;
    border: 0;
    font-size: 14px;
  }

  .svc-table:not(.svc-table-2) td::before {
    content: attr(data-label);
    color: var(--muted-fg);
  }

  /* A service Apple publishes no price for is simply not listed. */
  .svc-table:not(.svc-table-2) td:has(> span) {
    display: none;
  }

  .svc-table .svc-family th {
    padding: 26px 0 10px;
  }
}

@media (max-width: 560px) {
  .svc-cards {
    grid-template-columns: 1fr;
  }

  .svc-cards li:nth-child(2n) {
    padding-left: 0;
    border-left: 0;
  }
}

/* ---- Document pages (templates/page-document.php: Terms) ------------------ */
.doc-hero {
  padding-top: calc(var(--head-h, 112px) + 56px);
  padding-bottom: 36px;
  border-bottom: 1px solid var(--hair-light);
}

.doc-hero .display {
  margin-top: 4px;
}

.doc-updated {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--muted-fg);
}

.doc-band {
  padding-block: 56px 96px;
}

.doc-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 44rem);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.doc-toc {
  position: sticky;
  top: calc(var(--head-h-stuck, 66px) + 28px);
}

.doc-toc-title {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

.doc-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--hair-light-2);
}

.doc-toc a {
  display: block;
  padding: 6px 0 6px 16px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--muted-fg);
}

.doc-toc a:hover {
  color: var(--ink);
}

.doc-body {
  font-size: 15.5px;
  line-height: 1.75;
  color: rgba(22, 19, 15, 0.82);
}

.doc-body h2 {
  margin: 52px 0 14px;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink);
  scroll-margin-top: calc(var(--head-h-stuck, 66px) + 24px);
}

.doc-body h2:first-child {
  margin-top: 0;
}

.doc-body p,
.doc-body ul {
  margin: 0 0 16px;
}

.doc-body ul {
  padding-left: 20px;
}

.doc-body li {
  margin-bottom: 8px;
}

.doc-body a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc-body .doc-lede {
  font-size: 17px;
  color: var(--ink);
}

/* The disclaimers stay in capitals (that is part of their legal form), set
   smaller and tracked so they read as fine print, not shouting. */
.doc-body .doc-conspicuous {
  font-size: 12.5px;
  line-height: 1.7;
  letter-spacing: 0.02em;
}

@media (max-width: 900px) {
  .doc-grid {
    grid-template-columns: 1fr;
  }

  .doc-toc {
    position: static;
  }

  .doc-toc ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    border-left: 0;
  }

  .doc-toc a {
    padding: 4px 0;
  }
}

/* ---- Contact and Financing ---------------------------------------------- */
.contact-cards a,
.contact-careers a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-cards p + p {
  margin-top: 14px;
}

.contact-careers {
  margin: 32px 0 0;
  font-size: 14px;
  color: var(--muted-fg);
}

.finance-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 26px;
}

.finance-steps {
  counter-reset: step;
}

.finance-steps li {
  counter-increment: step;
}

.finance-steps h3::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
  color: var(--ember-deep);
}

.ti-panel-link {
  display: inline-block;
  margin-top: 18px;
}

.finance-page .ti-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(28px, 6vw, 96px);
  align-items: end;
}

.finance-page .ti-hero-grid .display {
  margin-top: 18px;
}

.finance-page .ti-hero-grid .lede {
  margin: 0;
  max-width: 30rem;
}

@media (max-width: 820px) {
  .finance-page .ti-hero-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

/* ---- Order change (templates/page-order-change.php) ------------------- */
/* The column sits on the heading's left edge: the limit is on the content,
   not the shell, which would centre it. */
.oc-body > * {
  max-width: 40rem;
}

.oc-body .lede {
  margin: 0 0 28px;
  max-width: none;
}

.oc-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.oc-form fieldset {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--hair-light-2);
}

.oc-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hair-light);
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}

.oc-choice input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--ink);
}

.oc-note {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  font-size: 13px;
  color: var(--muted-fg);
}

.oc-note textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--hair-light-2);
  border-radius: var(--r-md, 10px);
  background: #fffdf9;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}

.oc-form .oc-keep {
  margin-top: 4px;
}

.oc-fine {
  margin: 28px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted-fg);
}
