/* =========================================================
   Внутренние страницы услуг (letters-frontlight.html и т.п.)
   Опирается на css/style.css
   ========================================================= */

.subpage .header { background: rgba(8,8,10,.8); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }

.crumbs { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: clamp(28px, 4vw, 48px); font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--fg); transition: color .2s; }
.crumbs a:hover { color: var(--y); }

/* главный блок */
.p-hero {
  padding: 120px 0 clamp(60px, 8vw, 110px);
  background:
    radial-gradient(700px 480px at 85% 20%, rgba(255,26,158,.16), transparent 60%),
    radial-gradient(600px 400px at 0% 100%, rgba(0,183,245,.12), transparent 60%);
}
.p-hero__grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.p-title { font-size: clamp(36px, 5.4vw, 76px); font-weight: 900; line-height: .98; letter-spacing: -.04em; margin-bottom: 26px; }
.p-lead { font-size: clamp(17px, 1.4vw, 19px); color: rgba(244,242,238,.8); max-width: 540px; margin-bottom: 32px; }
.p-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.p-badges li { padding: 8px 14px; border-radius: 100px; border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; }
.p-badges li::before { content: "✓ "; color: #2bd96b; }

.p-hero__img {
  margin: 0; position: relative;
  border-radius: calc(var(--radius) * 1.4); overflow: hidden;
  border: 1px solid var(--line-2);
  box-shadow: 0 50px 100px -40px rgba(255,26,158,.45);
}
.p-hero__img img { width: 100%; height: auto; display: block; }
.p-hero__img figcaption {
  position: absolute; left: 16px; bottom: 16px;
  padding: 8px 14px; border-radius: 100px;
  background: rgba(8,8,10,.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line-2); font-size: 13px; font-weight: 600;
}

/* преимущества и характеристики */
.p-info { background: var(--bg-2); }
.p-info__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); }
.p-info .h2 { font-size: clamp(28px, 3.4vw, 44px); margin-bottom: 28px; }
.p-pros { display: grid; gap: 12px; }
.p-pros li {
  display: flex; gap: 18px; align-items: center;
  padding: 20px 22px; border-radius: 16px;
  background: var(--bg-3); border: 1px solid var(--line);
  font-weight: 600; font-size: 17px;
}
.p-pros__n { font: 700 13px/1 var(--font-display); color: var(--m); flex: none; }
.p-pros li:nth-child(2) .p-pros__n { color: var(--c); }
.p-pros li:nth-child(3) .p-pros__n { color: var(--y); }
.p-pros li:nth-child(4) .p-pros__n { color: #fff; }

.p-specs { margin: 0; border-top: 1px solid var(--line); }
.p-specs > div { display: grid; grid-template-columns: 170px 1fr; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.p-specs dt { color: var(--muted); font-size: 15px; }
.p-specs dd { margin: 0; font: 700 clamp(17px, 1.6vw, 20px)/1.3 var(--font-display); letter-spacing: -.01em; }

/* галерея */
.p-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 260px; gap: 14px; }
.p-grid__item {
  position: relative; padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #111; cursor: zoom-in; color: #fff; font: inherit;
}
.p-grid__item--big { grid-column: span 2; grid-row: span 2; }
.p-grid__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease), filter .5s; filter: brightness(.92); }
.p-grid__item:hover img { transform: scale(1.05); filter: brightness(1.05); }
.p-grid__item span {
  position: absolute; left: 14px; bottom: 14px;
  padding: 8px 14px; border-radius: 100px;
  background: rgba(8,8,10,.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line-2); font-size: 13px; font-weight: 600;
}

/* призыв */
.p-cta { padding-top: 0; }
.p-cta__box {
  display: grid; grid-template-columns: 1.3fr auto; gap: 32px; align-items: center;
  padding: clamp(28px, 4.5vw, 56px);
  border-radius: calc(var(--radius) * 1.5);
  border: 1px solid var(--line-2);
  background:
    radial-gradient(600px 300px at 0% 0%, rgba(255,26,158,.2), transparent 60%),
    radial-gradient(500px 300px at 100% 100%, rgba(0,183,245,.18), transparent 60%),
    var(--bg-2);
}
.p-cta .h2 { font-size: clamp(28px, 3.6vw, 48px); margin-bottom: 16px; }
.p-cta__text { color: var(--muted); margin: 0; max-width: 560px; }
.p-cta__actions { display: grid; gap: 12px; }
.p-more { margin-top: 40px; }

/* просмотр фото */
.lightbox {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%;
  margin: 0; padding: 0; border: 0;
  background: rgba(4,4,6,.94); color: #fff;
}
.lightbox::backdrop { background: rgba(0,0,0,.6); }
.lightbox[open] { display: grid; place-items: center; animation: fade-in .3s ease; }
.lightbox__fig { margin: 0; display: grid; gap: 14px; justify-items: center; padding: 70px 16px 90px; max-height: 100%; }
.lightbox__fig img { max-width: min(92vw, 1400px); max-height: calc(100dvh - 180px); width: auto; height: auto; border-radius: 12px; box-shadow: 0 40px 80px -20px rgba(0,0,0,.8); }
.lightbox__fig figcaption { font-weight: 600; color: rgba(255,255,255,.85); }
.lightbox .sheet__close { position: fixed; }
.lightbox .sheet__nav { position: fixed; left: 50%; right: auto; bottom: 24px; transform: translateX(-50%); }

@media (max-width: 900px) {
  .p-hero__grid, .p-info__grid, .p-cta__box { grid-template-columns: 1fr; }
  .p-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 200px; }
}
@media (max-width: 600px) {
  .p-hero { padding-top: 96px; }
  .p-hero .hero__cta .btn { width: 100%; }
  .p-grid { grid-auto-rows: 150px; gap: 10px; }
  .p-grid__item span { display: none; }
  .p-specs > div { grid-template-columns: 1fr; gap: 6px; }
  .p-cta__actions .btn { width: 100%; }
}

/* ===== общий шаблон страниц услуг (tools/build-pages.js) ===== */
.accent-c { --accent: var(--c); } .accent-m { --accent: var(--m); } .accent-y { --accent: var(--y); }
.subpage .p-hero .section-tag { color: var(--accent, var(--muted)); }
.p-title { overflow-wrap: break-word; hyphens: manual; }
@media (max-width: 600px) { .p-title { font-size: clamp(30px, 9.4vw, 44px); } }

/* мелкое фото: не растягиваем, фон — размытая копия */
.p-hero__img--fit { display: grid; place-items: center; min-height: 380px; padding: 28px; background: #000; }
.p-hero__img--fit .p-hero__bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(36px) saturate(1.3) brightness(.5); }
.p-hero__img--fit .p-hero__main { position: relative; width: auto; max-width: min(100%, 520px); border-radius: 14px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.8); }
.p-hero__img figcaption { z-index: 2; }

.p-fit { margin: 24px 0 0; color: var(--muted); }
.p-fit b { color: var(--fg); }

/* галерея, когда фото мало */
.p-grid--few { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 300px; }
.p-grid--few .p-grid__item { grid-column: span 2; }
.p-grid--few .p-grid__item img { object-fit: contain; background: #000; }
.p-grid__insta {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  padding: 26px; border-radius: var(--radius);
  border: 1px dashed var(--line-2);
  background: radial-gradient(400px 260px at 100% 0%, rgba(255,26,158,.2), transparent 60%), var(--bg-2);
  transition: border-color .3s, transform .3s var(--ease);
}
.p-grid__insta:hover { border-color: var(--m); transform: translateY(-4px); }
.p-grid__insta-ico { font-size: 40px; line-height: 1; color: var(--m); margin-bottom: auto; }
.p-grid__insta b { font: 700 20px/1.2 var(--font-display); }
.p-grid__insta span:last-child { color: var(--muted); font-size: 14px; }

/* шаги */
.p-steps .h2 { margin-bottom: 36px; font-size: clamp(28px, 3.4vw, 44px); }
.p-steps__list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: st; }
.p-steps__list li {
  counter-increment: st; position: relative;
  padding: 26px 22px 24px; border-radius: 16px;
  background: var(--bg-2); border: 1px solid var(--line);
  display: grid; gap: 8px;
}
.p-steps__list li::before {
  content: "0" counter(st);
  font: 900 44px/1 var(--font-display); letter-spacing: -.05em;
  color: transparent; -webkit-text-stroke: 1.2px var(--accent, var(--c));
  margin-bottom: 10px;
}
.p-steps__list b { font: 700 18px/1.2 var(--font-display); }
.p-steps__list span { color: var(--muted); font-size: 15px; }

/* другие конструкции */
.p-others .h2 { margin-bottom: 32px; font-size: clamp(28px, 3.4vw, 44px); }
.p-others__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.p-other {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  padding: 10px 16px 10px 10px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--line);
  transition: border-color .3s, transform .3s var(--ease);
}
.p-other:hover { border-color: var(--accent, var(--c)); transform: translateY(-3px); }
.p-other__img { width: 64px; height: 48px; border-radius: 9px; overflow: hidden; background: #000; }
.p-other__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-other__t { font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.p-other__a { color: var(--muted); }

@media (max-width: 1100px) {
  .p-others__grid { grid-template-columns: repeat(2, 1fr); }
  .p-steps__list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .p-grid--few { grid-template-columns: 1fr; grid-auto-rows: 240px; }
  .p-grid--few .p-grid__item { grid-column: auto; }
  .p-hero__img--fit { min-height: 260px; }
}
@media (max-width: 600px) {
  .p-others__grid, .p-steps__list { grid-template-columns: 1fr; }
  .p-grid__insta { min-height: 180px; }
}
