/* MacBook-Repair.ru — рейтинг сервисов. Палитра и раскладка по мотивам applerating.ru */
:root {
  --ink: #1a252d;
  --ink-2: #32393d;
  --muted: #717c82;
  --bg: #ffffff;
  --bg-soft: #f7f9f9;
  --line: #e6eaec;
  --blue: #2196ff;
  --blue-soft: #eaf5ff;
  --gold: #f5a623;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 1200px;
  --r-lg: 24px;  /* карточки, панели, крупные фото */
  --r-md: 16px;  /* вложенные блоки, логотипы */
  --r-sm: 8px;   /* бейджи, метки, чипы */
  --gutter: 24px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 20px; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { left: 16px; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }

/* Шапка: тёмная полоса как на apple.com */
.top { background: rgba(22, 22, 23, .88); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; font-size: 12px; line-height: 16px; }
.top .wrap { display: flex; align-items: center; justify-content: center; gap: 32px; height: 48px; }
.brand { white-space: nowrap; display: flex; align-items: center; gap: 8px; color: #f5f5f7; font-size: 14px; line-height: 20px; font-weight: 600; }
.brand:hover { text-decoration: none; color: #fff; }
.brand svg { width: 20px; height: 20px; color: #f5f5f7; }
.top nav { display: flex; gap: 32px; }
@media (max-width: 960px) { .top nav { gap: 20px; } .top .wrap { gap: 20px; } }
@media (max-width: 760px) { .top nav a.hide-md { display: none; } }
.top nav a { color: rgba(255, 255, 255, .72); font-size: 12px; line-height: 16px; font-weight: 500; padding-block: 16px; transition: color .3s var(--ease); }
.top nav a:hover { color: #fff; text-decoration: none; }
.top nav a[aria-current="page"] { color: #fff; }
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: 9999px; border: 1px solid transparent; cursor: pointer; font-family: inherit; font-size: 16px; line-height: 24px; font-weight: 600; background: var(--blue); color: #fff; transition: background-color .3s var(--ease), transform .3s var(--ease), color .3s var(--ease); }
.btn:hover { background: #0d86f2; text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-line { background: #fff; color: var(--blue); border-color: var(--blue); }
.btn-line:hover { background: var(--blue-soft); }
.btn-soft { background: var(--blue-soft); color: var(--blue); }
.btn-soft:hover { background: #dcefff; }
.btn svg { width: 16px; height: 16px; }
.btn-sm { padding: 6px 16px; font-size: 14px; line-height: 20px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
@media (max-width: 760px) {
  .top .wrap { height: 48px; gap: 20px; }
  .top nav { gap: 20px; }
  .top nav { gap: 16px; }
}

/* Раскладка с правой колонкой */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; padding-block: 48px 96px; align-items: start; }
.aside { display: grid; gap: 12px; position: sticky; top: 96px; }
@media (max-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr); } .aside { position: static; } }

h1 { font-size: 36px; line-height: 40px; font-weight: 600; max-width: 640px; }
.updated { color: var(--muted); margin-top: 12px; }

/* Шапка таблицы */
.thead { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 24px; align-items: end; margin: 40px 0 16px; padding-inline: 24px; color: var(--muted); font-size: 12px; line-height: 16px; }
.sort { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; color: var(--ink); font-size: 14px; line-height: 20px; font-weight: 500; }
.sort button { border: 0; background: none; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.sort button[aria-pressed="true"] { color: var(--ink); text-decoration: none; font-weight: 600; }
.thead .h-rate { font-size: 16px; line-height: 24px; color: var(--ink); font-weight: 500; }
@media (max-width: 760px) { .thead { grid-template-columns: 1fr; padding-inline: 0; } .thead .h-col { display: none; } .sort { justify-content: flex-start; } }

/* Карточка сервиса */
.list { list-style: none; padding: 0; display: grid; gap: 16px; }
.card { display: grid; grid-template-columns: 150px minmax(0, 1fr) 200px; gap: 24px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; transition: box-shadow .3s var(--ease); }
.card:hover { box-shadow: 0 8px 24px rgba(26, 37, 45, .06); }
.card.prem { border-color: #f3c46b; box-shadow: 0 0 0 1px #f3c46b inset; }
.logo-col { position: relative; }
.rank { position: absolute; top: -8px; left: -8px; width: 40px; height: 40px; border-radius: 9999px; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 18px; line-height: 28px; font-weight: 600; box-shadow: 0 0 0 4px #fff; z-index: 1; }
.tile { width: 150px; height: 120px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 30px; line-height: 36px; font-weight: 600; color: #fff; letter-spacing: -0.02em; }
.info { display: grid; gap: 8px; align-content: start; min-width: 0; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: var(--r-sm); background: var(--bg-soft); font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-2); }
.badge svg { width: 14px; height: 14px; color: var(--gold); }
.card h2, .card h3 { font-size: 20px; line-height: 28px; font-weight: 600; }
.desc { color: var(--ink-2); font-weight: 500; }
.fields { display: grid; gap: 4px; font-size: 12px; line-height: 16px; }
.fields dt { font-weight: 600; color: var(--ink); }
.fields dd { color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.fields dd a { color: var(--muted); }
.rate-col { display: flex; flex-direction: column; gap: 8px; }
.rate { display: flex; align-items: center; gap: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--bg-soft); font-size: 16px; line-height: 24px; font-weight: 600; white-space: nowrap; }
.chip svg { width: 14px; height: 14px; color: var(--blue); }
.votes { font-size: 12px; line-height: 16px; font-weight: 600; }
.votes a { display: block; font-weight: 500; }
.rate-col .btn { width: 100%; margin-top: 0; }
.rate-col .spacer { flex: 1; min-height: 12px; }
@media (max-width: 760px) {
  .card { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px; }
  .tile { width: 96px; height: 72px; font-size: 24px; line-height: 32px; border-radius: var(--r-md); }
  .rank { width: 32px; height: 32px; font-size: 14px; }
}

/* Правая колонка: блоки с градиентом, как на референсе */
.box { border-radius: var(--r-lg); padding: 16px; color: #fff; }
.box h2 { font-size: 18px; line-height: 28px; font-weight: 600; padding: 4px 4px 12px; }
.box .inner { background: #fff; border-radius: var(--r-md); padding: 16px; color: var(--ink); }
.box-trust { background: linear-gradient(157.4deg, #f6d27a 15.96%, #c9973a 100%); color: #2a1d00; }
.box-reviews { background: linear-gradient(157.4deg, #2196ff 15.96%, #2b9afe 49.5%, #68b8ff 100%); }
.box-rating { background: linear-gradient(157.4deg, #5d6aea 14.04%, #929dff 77.3%); }
.top10 { list-style: none; padding: 0; display: grid; gap: 8px; counter-reset: t; }
.top10 li { counter-increment: t; display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: center; font-weight: 500; }
.top10 li::before { content: counter(t); width: 20px; height: 20px; border-radius: 9999px; background: var(--bg-soft); display: grid; place-items: center; font-size: 12px; line-height: 16px; color: var(--muted); }
.top10 a { color: var(--ink); }
.top10 .p { display: inline-flex; align-items: center; gap: 4px; }
.top10 .p svg { width: 12px; height: 12px; color: var(--gold); }

/* Плашка премиум сервиса */
.prem-card { display: grid; gap: 12px; }
.prem-head { display: flex; align-items: center; gap: 12px; }
.prem-head .tile { width: 48px; height: 48px; border-radius: var(--r-md); font-size: 16px; line-height: 24px; }
.prem-head b { display: block; font-size: 16px; line-height: 24px; }
.prem-head span { color: var(--muted); font-size: 12px; line-height: 16px; }
.prem-card p { color: var(--ink-2); font-size: 12px; line-height: 16px; font-weight: 500; }
.prem-card .btn { width: 100%; }
.prem-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; line-height: 16px; }
.prem-meta .chip { padding: 4px 8px; font-size: 12px; line-height: 16px; border-radius: var(--r-sm); }

/* Текстовые страницы */
.text { display: grid; gap: 16px; max-width: 760px; font-size: 16px; line-height: 24px; color: var(--ink-2); }
.text h2 { font-size: 24px; line-height: 32px; color: var(--ink); margin-top: 16px; }
.text ol, .text ul { padding-left: 24px; display: grid; gap: 8px; }
.text b { color: var(--ink); }
.panel { background: var(--bg-soft); border-radius: var(--r-lg); padding: 32px; display: grid; gap: 16px; }
.price-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.price { background: var(--bg-soft); border-radius: var(--r-md); padding: 24px; display: grid; gap: 4px; }
.price span { color: var(--muted); font-size: 14px; line-height: 20px; }
.price b { font-size: 30px; line-height: 36px; font-weight: 600; color: var(--ink); }
@media (max-width: 760px) { .price-row { grid-template-columns: 1fr; } .panel { padding: 24px 16px; } }
.about-seo { margin-top: 48px; }
.crumbs { color: var(--muted); margin-bottom: 16px; }

/* Блог */
.posts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 32px; }
.post-card { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; color: var(--ink); display: flex; flex-direction: column; transition: box-shadow .3s var(--ease), transform .5s var(--ease); }
.post-card:hover { text-decoration: none; box-shadow: 0 8px 24px rgba(26, 37, 45, .08); transform: translateY(-2px); }
.post-card img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.post-card .b { padding: 24px; display: grid; gap: 8px; }
.post-card h2 { font-size: 20px; line-height: 28px; font-weight: 600; }
.post-card p { color: var(--muted); }
.post-card time { color: var(--muted); font-size: 12px; line-height: 16px; }
@media (max-width: 760px) { .posts { grid-template-columns: 1fr; } }
.article-img { border-radius: var(--r-lg); aspect-ratio: 3 / 2; object-fit: cover; width: 100%; margin: 24px 0 8px; }

/* Подвал */
.foot { background: var(--bg-soft); padding-block: 32px; color: var(--muted); font-size: 12px; line-height: 16px; }
.foot .wrap { display: grid; gap: 12px; }
.foot .row { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.foot a { color: var(--ink); font-weight: 500; }

/* Логотипы сервисов */
.tile.has-logo { background: #fff; border: 1px solid var(--line); padding: 16px; }
.tile.has-logo { display: block; }
.tile.has-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.aside { min-width: 0; }
.prem-head .tile.has-logo { padding: 6px; }

/* Цена и отзывы в карточке */
.fields .pr { color: var(--ink); font-weight: 600; }
.votes span { display: block; color: var(--muted); font-weight: 500; }

/* Первое место: золотая рамка, тёплый фон, крупный номер */
.card.prem {
  border: 2px solid #e8b04b; background: #fffaf0;
  box-shadow: 0 12px 32px rgba(232, 176, 75, .22);
  position: relative; padding-top: 40px;
}
.card.prem::before {
  content: "1 место в рейтинге"; position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  background: #e8b04b; color: #2a1d00; font-size: 12px; line-height: 16px; font-weight: 600;
  padding: 4px 16px; border-radius: 0 0 var(--r-sm) var(--r-sm); white-space: nowrap;
}
.card.prem .rank { background: linear-gradient(157.4deg, #f6d27a, #c9973a); color: #2a1d00; width: 48px; height: 48px; font-size: 24px; line-height: 32px; box-shadow: 0 0 0 4px #fffaf0; }
.card.prem h2 { font-size: 24px; line-height: 32px; }
.card.prem .chip { background: #fff; }
.badge.gold { background: #fff3d6; color: #6b4a00; }

/* Цифры в топах справа */
.top10 li { grid-template-columns: 20px 1fr auto; }
.top10 small { color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; }
