/* ==========================================================================
   Кейс Sunglasses — /work/sunglasses/ (29.09.2026)
   Разметка: case_pages/sunglasses.py. Все классы с префиксом sg-.
   Семья кейсов: белые карточки с чернильной рамкой, голубая полоса инсайта,
   тёмная карточка работы, белая полоса с фото. Свои решения: стартовые цифры
   в проблеме, рисунок «категория → намерение», три пары «было → стало».
   ========================================================================== */

/* --- первый экран ------------------------------------------------------ */
.sg-hero {
  position: relative;
  isolation: isolate;
  background-image: radial-gradient(40% 55% at 85% 12%, var(--atmo-sky, rgba(127, 211, 236, 0.22)), transparent 70%);
}
.sg-hero-grid {
  margin-top: clamp(36px, 4.5vw, 64px);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 28px 6vw;
  align-items: end;
}
.sg-hero h1 { font-size: clamp(2.5rem, 5vw, 4.6rem); }
/* акцентная половина заголовка — второй строкой, как в других кейсах */
.sg-hero h1 .hl, .sg-section h2 .hl, .sg-insight h2 .hl, .sg-detail h2 .hl { display: block; }
.sg-hero-side { display: grid; gap: 18px; padding-bottom: 6px; }
.sg-sub {
  font-family: var(--display);
  font-size: clamp(1.3rem, 1.8vw, 1.6rem);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.012em;
}
.sg-hero .lead { max-width: 44ch; }

.sg-facts {
  margin: clamp(40px, 4.5vw, 60px) 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1.5px solid var(--ink);
}
.sg-facts > div { padding: 16px 20px 0 0; }
.sg-facts > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.sg-facts dt { font-size: 0.8125rem; color: var(--ink-45); }
.sg-facts dd { margin: 4px 0 0; font-weight: 600; }
.sg-facts a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.sg-facts a:hover, .sg-facts a:focus-visible { color: var(--flame); }

.sg-figure {
  margin: clamp(36px, 4vw, 52px) 0 0;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: #f3efe8;
}
.sg-figure img { width: 100%; height: auto; }

/* --- общие секции -------------------------------------------------------- */
.sg-section { padding: var(--section) 0; }
.sg-section-rule { border-top: 1.5px solid var(--ink); }
.sg-section-flush { padding-top: 0; }
.sg-section .section-head h2 { max-width: 22ch; }

/* --- проблема: откуда начинали ------------------------------------------ */
.sg-start {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}
.sg-start-copy { padding: clamp(26px, 3vw, 38px); display: grid; align-content: start; gap: 12px; }
.sg-start-title { font-family: var(--display); font-size: clamp(1.25rem, 1.6vw, 1.5rem); font-weight: 600; letter-spacing: -0.012em; }
.sg-start-copy p:not(.sg-start-title) { color: var(--ink-70); max-width: 42ch; }
.sg-start-nums {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-left: 1px solid var(--line);
  background: var(--paper);
}
.sg-start-nums > div { padding: clamp(26px, 3vw, 38px) clamp(18px, 2vw, 28px); display: flex; flex-direction: column; gap: 10px; }
.sg-start-nums > div + div { border-left: 1px solid var(--line); }
.sg-start-nums dt { font-size: 0.875rem; font-weight: 600; color: var(--ink-70); }
.sg-start-nums dd {
  margin: auto 0 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 3.6vw, 3.2rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}

/* --- инсайт: категория против намерения --------------------------------- */
.sg-insight {
  padding: var(--section) 0;
  background: var(--sky-100);
  border-block: 1.5px solid var(--ink);
}
.sg-insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 40px 6vw;
  align-items: center;
}
.sg-insight h2 { max-width: 17ch; }
.sg-insight .lead { margin-top: 22px; max-width: 46ch; }
.sg-intent {
  margin: 0;
  padding: clamp(22px, 2.6vw, 34px);
  display: grid;
  gap: 14px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 30px 60px -40px rgba(15, 26, 32, 0.45);
}
.sg-intent-row { padding: 16px; border-radius: 14px; display: grid; gap: 12px; }
.sg-intent-cat { background: #f1eee8; }
.sg-intent-buy { background: var(--sky-100); }
.sg-intent-label { font-size: 0.875rem; font-weight: 600; color: var(--ink-70); }
.sg-intent-buy .sg-intent-label { color: var(--flame); }
.sg-q-muted {
  justify-self: start;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-45);
}
.sg-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sg-chips mark {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-weight: 600;
}
.sg-plus { font-family: var(--display); font-size: 1.4rem; font-weight: 600; color: var(--ink-45); }
.sg-intent figcaption { padding: 4px 4px 0; font-size: 0.93rem; color: var(--ink-70); }

/* --- три изменения: тёмная карточка -------------------------------------- */
.sg-work {
  padding: clamp(32px, 4.5vw, 64px);
  background: var(--deep);
  color: #fff;
  border-radius: calc(var(--radius) + 6px);
  background-image: radial-gradient(60% 90% at 100% 0%, rgba(127, 211, 236, 0.16), transparent 70%);
}
.sg-work .section-head p { color: rgba(255, 255, 255, 0.72); }
.sg-work-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sg-work-list li { padding: 4px 28px 4px 0; display: grid; align-content: start; gap: 10px; }
.sg-work-list li + li { padding-left: 28px; border-left: 1px solid rgba(255, 255, 255, 0.2); }
.sg-work-list h3 { font-size: clamp(1.2rem, 1.6vw, 1.45rem); }
.sg-work-list p { color: rgba(255, 255, 255, 0.72); font-size: 0.95rem; line-height: 1.5; }
.sg-work-line {
  margin-top: clamp(32px, 3.6vw, 48px);
  padding-top: clamp(24px, 2.6vw, 32px);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.3vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

/* --- деталь: белая полоса, фото и текст ---------------------------------- */
.sg-detail {
  padding: var(--section) 0;
  background: var(--card);
  border-block: 1.5px solid var(--ink);
}
.sg-detail-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px 5vw; align-items: center; }
.sg-detail-media { margin: 0; overflow: hidden; border: 1.5px solid var(--ink); border-radius: var(--radius); background: #f3efe8; }
.sg-detail-media img { width: 100%; height: auto; }
.sg-detail-copy { display: grid; gap: 18px; }
.sg-detail-copy h2 { max-width: 14ch; }
.sg-detail-copy p { color: var(--ink-70); max-width: 46ch; }
/* белая полоса детали встык с разделом результата — без двойной линии */
.sg-detail + .sg-section-rule { border-top: 0; }

/* --- результат: три пары «было → стало» ---------------------------------- */
.sg-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.sg-result {
  padding: clamp(24px, 2.8vw, 36px);
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sg-result-label { font-size: 0.875rem; font-weight: 600; color: var(--ink-70); }
.sg-bars { display: grid; gap: 12px; }
.sg-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 5.2ch; align-items: center; gap: 14px; }
.sg-bar { display: block; height: 38px; border-radius: 10px; }
.sg-before { background: repeating-linear-gradient(135deg, var(--line) 0 6px, #efece6 6px 12px); border: 1px solid #d5d0c6; }
.sg-after { background: var(--flame); }
.sg-bar-row strong {
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  text-align: right;
  white-space: nowrap;
}
.sg-bar-row:first-child strong { color: var(--ink-45); }
.sg-bar-row:last-child strong { color: var(--flame); }
.sg-change {
  align-self: flex-start;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--flame-100);
  color: var(--ink);
}
.sg-result-text { margin-top: auto; color: var(--ink-70); }
.sg-result-dark { background: var(--deep); border-color: var(--deep); color: #fff; }
.sg-result-dark .sg-result-label, .sg-result-dark .sg-result-text { color: rgba(255, 255, 255, 0.72); }
.sg-result-dark .sg-before { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.2); }
.sg-result-dark .sg-after { background: var(--sky); }
.sg-result-dark .sg-bar-row:first-child strong { color: rgba(255, 255, 255, 0.55); }
.sg-result-dark .sg-bar-row:last-child strong { color: var(--sky); }
.sg-result-dark .sg-change { background: var(--sky); }

.sg-volume {
  margin-top: 20px;
  padding: 20px clamp(22px, 2.6vw, 32px);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.sg-volume h3 { font-size: clamp(1.15rem, 1.5vw, 1.35rem); }
.sg-volume p { color: var(--ink-70); }
.sg-narrative { margin-top: clamp(32px, 3.6vw, 48px); max-width: 70ch; font-size: 1.075rem; color: var(--ink-70); }

/* --- вывод и призыв ------------------------------------------------------- */
.sg-takeaway {
  padding: clamp(32px, 4.5vw, 64px);
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 28px 6vw;
  align-items: center;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: 0 8px 0 var(--flame);
}
.sg-takeaway h2 { max-width: 16ch; }
.sg-takeaway-side { display: grid; gap: 26px; }
.sg-takeaway-side > p { color: var(--ink-70); max-width: 44ch; }
.sg-takeaway-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }

/* --- планшет и телефон ----------------------------------------------------- */
@media (max-width: 1080px) {
  .sg-work-list { grid-template-columns: minmax(0, 1fr); }
  .sg-work-list li, .sg-work-list li + li { padding: 18px 0; border-left: 0; }
  .sg-work-list li + li { border-top: 1px solid rgba(255, 255, 255, 0.2); }
  .sg-results { grid-template-columns: minmax(0, 1fr); }
  .sg-start { grid-template-columns: minmax(0, 1fr); }
  .sg-start-nums { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .sg-hero-grid, .sg-insight-grid, .sg-detail-grid, .sg-takeaway { grid-template-columns: minmax(0, 1fr); }
  .sg-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-facts > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .sg-facts > div:nth-child(n + 3) { margin-top: 14px; }
}
@media (max-width: 560px) {
  .sg-start-nums { grid-template-columns: minmax(0, 1fr); }
  .sg-start-nums > div { flex-direction: row; align-items: baseline; justify-content: space-between; }
  .sg-start-nums > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .sg-start-nums dd { margin: 0; }
  .sg-bar { height: 30px; }
}
