/* Послуги: сторінка /services/ (покажчик, акордеон послуг, стек із фільтром, формати роботи, FAQ)
   і сторінка однієї послуги (перший екран із демкою, текст, картка умов, статті, інші послуги). */

/* ── Перший екран: сітка на фоні ── */
.sv-hero { position: relative; overflow: hidden; }
.sv-hero::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(#1D1D18 1px, transparent 1px), linear-gradient(90deg, #1D1D18 1px, transparent 1px); background-size: 64px 64px; -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 15%, transparent 72%); mask-image: radial-gradient(ellipse at 70% 30%, #000 15%, transparent 72%); pointer-events: none; }
.sv-hero > .wrap { position: relative; }
.sv-hero .h1 { overflow-wrap: break-word; }

/* ── Покажчик послуг ── */
.sv-idx { margin-top: clamp(40px, 5vw, 64px); }
.sv-idx ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.sv-idx__item { display: flex; flex-direction: column; gap: 18px; height: 100%; min-height: 104px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); font-weight: 700; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; transition: border-color .3s, transform .4s var(--ease); }
.sv-idx__item:hover { color: var(--text); border-color: var(--accent); transform: translateY(-4px); }
.sv-idx__item .mono { color: var(--accent); font-size: 13px; font-weight: 500; }

/* ── Акордеон послуг (<details>: без JS відкривається сам, services.js додає плавність) ── */
.sv-list { padding-top: clamp(24px, 4vw, 56px); }
.sv-acc { border-top: 1px solid var(--line); }
.sv-row { position: relative; border-bottom: 1px solid var(--line); }
.sv-row::before { content: ''; position: absolute; inset: 0; background: color-mix(in srgb, var(--accent) 6%, transparent); transform: scaleY(0); transform-origin: bottom; transition: transform .5s var(--ease); pointer-events: none; }
.sv-row:hover::before, .sv-row[open]:not(.is-closing)::before { transform: scaleY(1); }
.sv-row__btn { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 56px; align-items: center; gap: 20px; min-height: 104px; padding: 20px 8px; cursor: pointer; list-style: none; }
.sv-row__btn::-webkit-details-marker, .sv-q__btn::-webkit-details-marker { display: none; }
.sv-row__num { font-size: 14px; color: var(--dim); transition: color .3s; }
.sv-row:hover .sv-row__num, .sv-row[open]:not(.is-closing) .sv-row__num { color: var(--accent); }
.sv-row__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(20px, 2.6vw, 34px); letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: break-word; transition: transform .45s var(--ease); }
.fine .sv-row:hover .sv-row__title { transform: translateX(10px); }
.sv-row__meta { flex-wrap: nowrap; }
.sv-row__plus { grid-column: -2; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line-3); transition: transform .45s var(--ease), background-color .3s, color .3s, border-color .3s; }
.sv-row[open]:not(.is-closing) .sv-row__plus { transform: rotate(45deg); background: var(--accent); border-color: var(--accent); color: var(--bg); }
.sv-row__body { position: relative; overflow: hidden; }
.sv-row__in { display: flex; flex-wrap: wrap; gap: 40px; padding: 4px 8px 44px 92px; }
.sv-row__col { flex: 1 1 280px; min-width: 0; }
.sv-row__col .eyebrow { margin-bottom: 14px; }
.sv-row__text { font-size: 18px; color: var(--text-2); }
.sv-row__demo { display: flex; flex: 1 1 320px; max-width: 460px; min-height: 260px; }

.sv-facts { display: flex; flex-wrap: wrap; gap: 12px 36px; margin: 22px 0 28px; }
.sv-facts dt { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.sv-facts dd { margin: 4px 0 0; font-weight: 700; }

.sv-ticks { display: flex; flex-direction: column; gap: 10px; font-size: 15px; color: var(--text-2); }
.sv-ticks li { display: flex; gap: 10px; align-items: flex-start; }
.sv-ticks .ico { flex: none; margin-top: 4px; color: var(--accent); }

.sv-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 720px; padding: 40px 32px; border: 1px dashed var(--line-3); border-radius: 28px; }
.sv-empty__title { font-size: clamp(20px, 2.4vw, 28px); }
.sv-empty .btn { margin-top: 8px; }

/* Картки в сітках однакової висоти: поява — на <li>, наведення й приглушення — на вкладеному блоці */
.sv-idx li, .sv-tiles > li, .sv-plans > li, .sv-posts > li { display: flex; min-width: 0; }
.sv-idx li > *, .sv-tiles > li > *, .sv-plans > li > *, .sv-posts > li > * { flex: 1; min-width: 0; }

/* ── Секції нижче: без верхнього відступу, як у макеті ── */
.sv-sec { padding-top: 0; }
.sv-sec--first { padding-top: clamp(24px, 4vw, 56px); }
.sv-sec__lead { max-width: 420px; }

/* ── Стек: фільтр приглушує плитки інших категорій ── */
.sv-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.sv-filter { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-family: var(--font-mono); font-size: 13px; cursor: pointer; transition: background-color .3s, color .3s, border-color .3s; }
.sv-filter:hover { border-color: var(--accent); color: var(--text); }
.sv-filter.on { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.sv-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sv-tile { display: flex; flex-direction: column; gap: 10px; height: 100%; min-height: 150px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); transition: opacity .45s, transform .45s var(--ease), border-color .3s; }
.sv-tile:hover { border-color: #3E3E35; transform: translateY(-4px); }
.sv-tile.is-dim { opacity: .18; transform: scale(.95); }
.sv-tile__cat { font-size: 12px; }
.sv-tile__name { margin-top: auto; padding-top: 14px; font-weight: 800; font-size: 18px; overflow-wrap: anywhere; }
.sv-tile__desc { font-size: 14px; line-height: 1.45; }

/* ── Формати роботи ── */
.sv-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.sv-plan { display: flex; flex-direction: column; gap: 20px; height: 100%; padding: 32px; border: 1px solid var(--line); border-radius: 28px; background: var(--card); transition: transform .5s var(--ease), border-color .3s; }
.sv-plan:hover { transform: translateY(-8px); border-color: #3E3E35; }
.sv-plan .chip { align-self: flex-start; }
.sv-plan__title { font-size: clamp(24px, 2.4vw, 30px); overflow-wrap: break-word; }
.sv-plan__text { font-size: 15px; }
.sv-plan .btn { margin-top: auto; }

/* ── FAQ ── */
.sv-faq-wrap { display: flex; flex-wrap: wrap; gap: 48px; }
.sv-faq-head { flex: 1 1 320px; min-width: 0; }
.sv-faq-head p { max-width: 360px; margin-top: 20px; }
.sv-faq { flex: 2 1 560px; min-width: 0; border-top: 1px solid var(--line); }
.sv-q { border-bottom: 1px solid var(--line); }
.sv-q__btn { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 76px; padding: 18px 0; cursor: pointer; list-style: none; transition: color .3s; }
.sv-q__btn:hover { color: var(--accent); }
.sv-q__title { margin: 0; font-family: var(--font-text); font-weight: 700; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.35; }
.sv-q__btn .ico { flex: none; color: var(--accent); transition: transform .4s var(--ease); }
.sv-q[open]:not(.is-closing) .sv-q__btn .ico { transform: rotate(45deg); }
.sv-q__body { overflow: hidden; }
.sv-q__text { max-width: 760px; padding-bottom: 26px; color: var(--muted); }
.sv-q__text p + p { margin-top: .8em; }
.sv-q__text a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ── Одна послуга: перший екран ── */
.sv-one { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(32px, 5vw, 72px); align-items: end; }
.sv-one__text { min-width: 0; }
.page-head .sv-one__title { max-width: none; font-size: clamp(34px, 5.6vw, 80px); }
.sv-one .btn-row { margin-top: 32px; }
.sv-one__demo { display: flex; min-height: 300px; }

/* ── Одна послуга: текст і картка умов ── */
.sv-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: clamp(32px, 5vw, 72px); align-items: start; }
.sv-card { position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 28px; padding: 28px; border: 1px solid var(--line); border-radius: 28px; background: var(--card); }
.sv-card__col { min-width: 0; }
.sv-card h2.eyebrow { margin: 0 0 14px; font-weight: 400; }
.sv-card .sv-facts { margin: 0 0 16px; }
.sv-card__note { margin-bottom: 22px; font-size: 14px; }
/* Послуга без тексту: картка на всю ширину, колонки поруч */
.sv-body--solo { grid-template-columns: minmax(0, 1fr); }
.sv-body--solo .sv-card { position: static; flex-direction: row; flex-wrap: wrap; gap: 32px 56px; max-width: 960px; padding: 32px; }
.sv-body--solo .sv-card__col { flex: 1 1 300px; }

/* ── Корисні статті ── */
.sv-posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.sv-post { display: flex; flex-direction: column; gap: 14px; height: 100%; padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); transition: transform .5s var(--ease), border-color .3s; }
.sv-post:hover { color: var(--text); border-color: var(--accent); transform: translateY(-6px); }
.sv-post__meta { font-size: 12px; }
.sv-post__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(18px, 1.8vw, 22px); letter-spacing: -0.01em; line-height: 1.25; overflow-wrap: break-word; }
.sv-post__more { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; color: var(--accent); font-weight: 700; font-size: 14px; }

/* ── Інші послуги ── */
.sv-more { border-top: 1px solid var(--line); }
.sv-more li { border-bottom: 1px solid var(--line); }
.sv-more__link { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 24px; align-items: center; gap: 20px; min-height: 84px; padding: 16px 8px; }
.sv-more__link:hover { color: var(--text); }
.sv-more__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(18px, 2.2vw, 28px); letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: break-word; transition: transform .45s var(--ease); }
.sv-more__link:hover .sv-more__title { transform: translateX(10px); }
.sv-more__link:hover .sv-row__num, .sv-more__link .ico { color: var(--accent); }
.sv-more__link .ico { transition: transform .45s var(--ease); }
.sv-more__link:hover .ico { transform: translateX(4px); }

/* ── Вкладені послуги: посилання в рядку розділу та картки на сторінці розділу ── */
.sv-kids { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 20px; }
.sv-kid { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; color: var(--text-2); transition: border-color .3s, color .3s; }
.sv-kid:hover { border-color: var(--accent); color: var(--accent); }
.sv-subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; margin-top: clamp(28px, 4vw, 44px); }
.sv-subs > li { display: flex; }
.sv-sub { display: flex; flex-direction: column; gap: 12px; width: 100%; padding: 28px; border-radius: 24px; border: 1px solid var(--line); background: var(--card); color: var(--text); transition: border-color .3s, translate .45s var(--ease); }
.sv-sub:hover { border-color: var(--accent); color: var(--text); }
.fine .sv-sub:hover { translate: 0 -6px; }
.sv-sub__n { font-size: 12px; color: var(--accent); }
.sv-sub__title { font-size: clamp(19px, 1.9vw, 23px); overflow-wrap: anywhere; }
.sv-sub__text { font-size: 15px; }
.sv-sub__more { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; font-size: 14px; font-weight: 700; color: var(--accent); }

/* ── Кейси на сторінці послуги ── */
.sv-cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.sv-cases > li { display: flex; }
.sv-case { display: flex; flex-direction: column; width: 100%; padding: 12px; border-radius: 24px; border: 1px solid var(--line); background: var(--card); color: var(--text); transition: border-color .3s, translate .45s var(--ease); }
.sv-case:hover { border-color: var(--c); color: var(--text); }
.fine .sv-case:hover { translate: 0 -6px; }
.sv-case .shot { --shot-h: 230px; border-radius: 14px; }
.sv-case__body { display: flex; flex-direction: column; gap: 8px; padding: 18px 10px 10px; }
.sv-case__label { font-size: 12px; }
.sv-case__title { font-size: 21px; transition: color .3s; }
.sv-case:hover .sv-case__title { color: var(--c); }
.sv-case__text { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 900px) {
    .sv-one { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
    .sv-one__demo { min-height: 260px; }
    .sv-body { grid-template-columns: minmax(0, 1fr); }
    .sv-card { position: static; }
    .sv-row__in { padding-left: 8px; }
    .sv-row__demo { max-width: none; }
}

@media (max-width: 720px) {
    .sv-row__btn { grid-template-columns: 32px minmax(0, 1fr) 48px; gap: 12px; min-height: 84px; padding: 16px 0; }
    .sv-row__meta { display: none; }
    .sv-row__plus { width: 48px; height: 48px; }
    .sv-row__in { gap: 28px; padding: 4px 0 36px; }
    .sv-row__col { flex-basis: 100%; }
    .sv-row__text { font-size: 16px; }
    .sv-row .btn-row .btn { flex: 1 1 auto; }
    .sv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sv-tile { min-height: 0; padding: 14px; }
    .sv-tile__desc { font-size: 13px; }
    .sv-plan, .sv-post, .sv-card, .sv-body--solo .sv-card { padding: 24px; }
    .sv-empty { padding: 28px 20px; }
    .sv-faq-wrap { gap: 32px; }
    .sv-more__link { grid-template-columns: 32px minmax(0, 1fr) 24px; gap: 12px; min-height: 68px; padding: 14px 0; }
    .sv-more__link .chip { display: none; }
}
