/* Оформление страницы кейса. */
.case-page { padding-bottom: 40px; }
.draft-note { display: flex; flex-direction: column; gap: 3px; border-left: 3px solid #c8b681; padding: 2px 0 2px 16px; margin-bottom: 42px; color: #626262; font-size: 14px; line-height: 1.5; }
.draft-note strong { color: #51452a; font-weight: 600; }
.case-page h1 { font-size: 46px; line-height: 1.13; letter-spacing: -1.4px; margin: 0; }
.case-page article { margin: 0; }
.case-page section { margin-top: 44px; }
.case-page h2 { margin-bottom: 17px; }
.gallery-block { width: min(1060px, calc(75vw - 48px)); margin-top: 30px; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid #17658b; outline-offset: 4px; }
.gallery-heading { font-size: 20px; font-weight: 700; line-height: 1.4; margin-bottom: 7px; }
.gallery-intro { max-width: 700px; font-size: 15px; line-height: 1.55; color: #626262; margin-bottom: 20px; }
figure { margin: 0; min-width: 0; }
.screen-link { position: relative; display: block; border: 1px solid #d4d4d4; line-height: 0; border-radius: 3px; overflow: hidden; }
.screen-link img { display: block; width: 100%; height: auto; }
.zoom-label { position: absolute; bottom: 9px; right: 9px; background: #fff; border: 1px solid #ddd; border-radius: 3px; color: #333; padding: 5px 8px; line-height: 1.3; font-size: 12px; opacity: 0; transition: opacity .15s; }
.screen-link:hover .zoom-label, .screen-link:focus-visible .zoom-label { opacity: 1; }
figcaption { margin-top: 9px; font-size: 14px; line-height: 1.5; color: #626262; }
figcaption strong { display: block; color: #252525; font-size: 15px; font-weight: 600; }
figcaption span { display: block; margin-top: 2px; }
.editor-note { background: #faf8f0; border-left: 2px solid #c8b681; padding: 12px 15px; color: #6b6043; font-size: 14px; line-height: 1.6; margin-bottom: 22px; }
.new-screens { display: grid; gap: 25px; }
.placeholder { aspect-ratio: 16 / 7; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fafafa; border: 1px dashed #ccc; border-radius: 3px; color: #777; padding: 20px; text-align: center; gap: 4px; }
.placeholder span { font-size: 17px; }
.placeholder small { font-size: 13px; }
.placeholder-figure figcaption { font-size: 13px; }
.image-dialog { width: min(1600px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); box-sizing: border-box; border: 0; border-radius: 5px; padding: 16px; overflow: auto; }
.image-dialog::backdrop { background: #000b; }
.dialog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.dialog-toolbar p { margin: 0; font-size: 16px; line-height: 1.4; font-weight: 600; }
.dialog-close { flex-shrink: 0; font-size: 14px; background: #f4f4f4; border: 1px solid #ccc; border-radius: 4px; padding: 6px 10px; }
.dialog-image { width: 100%; height: auto; display: block; }
@media (max-width: 760px) {
  .case-page h1 { font-size: 38px; letter-spacing: -1px; }
}
@media (max-width: 600px) {
  .gallery-block { width: 100%; }
  .case-page h1 { font-size: 35px; }
  .draft-note { margin-bottom: 32px; }
  .placeholder { aspect-ratio: 16 / 9; }
  .dialog-toolbar { align-items: flex-start; gap: 12px; }
  .dialog-toolbar p { font-size: 14px; }
  .image-dialog { padding: 12px; }
  .zoom-label { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .zoom-label { transition: none; } }
@media print {
  .draft-note, .screen-tabs, .zoom-label, footer { display: none; }
  .page { width: auto; margin: 0; }
  .gallery-block { width: 100%; }
  figure { break-inside: avoid; }
}

.screen-tabs { display: grid; grid-template-columns: repeat(var(--screen-count, 4), minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.screen-tabs button { min-height: 118px; padding: 14px 12px; font-size: 15px; line-height: 1.4; text-align: left; overflow-wrap: anywhere; background: #fff; border: 1px solid #b9b9b9; border-radius: 3px; }
.screen-tabs button:hover { border-color: #252525; background: #f3f3f3; }
.screen-tabs button[aria-pressed="true"] { background: #252525; border-color: #252525; color: #fff; font-weight: 400; }
.screen-tabs button strong { display: block; margin-bottom: 7px; font-size: 15px; font-weight: 700; }
.screen-tabs button span { display: block; font-size: 13px; line-height: 1.5; color: #626262; }
.screen-tabs button[aria-pressed="true"] span { color: #ededed; }
@media (max-width: 600px) {
  .screen-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .screen-tabs button { min-height: 112px; padding: 12px; }
}

@media (min-width: 601px) and (max-width: 1000px) { .screen-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.exercise-block { margin-top: 34px; }
.exercise-block h3 { margin: 0 0 12px; font-size: 21px; line-height: 1.4; }
.exercise-block .gallery-block { margin-top: 20px; }

.case-back { margin: 0 0 38px; font-size: 16px; }
.exercise-block + p { margin-top: 28px; }
