/* Tool pages (/proverka-teksta-na-shtampy and friends): the checker sheet on top,
   then a reading column — a dictionary of phrases, steps and answers. */

.t-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  grid-template-areas: "copy check";
  align-items: start;
  gap: 28px clamp(32px, 5vw, 64px);
  padding-block: clamp(20px, 3vw, 40px) clamp(48px, 6vw, 88px);
}

.t-hero__copy {
  grid-area: copy;
  display: grid;
  gap: 18px;
  padding-top: clamp(4px, 1.4vw, 20px);
}

.t-hero__title {
  margin: 0;
  text-wrap: balance;
}

.t-hero__copy .b-lead {
  margin: 0;
  max-width: 46ch;
}

/* ---------- reading column ---------- */

.t-body {
  display: grid;
  gap: clamp(48px, 6vw, 80px);
  padding-bottom: var(--section);
}

.t-section {
  max-width: 760px;
}

.t-section > .b-h2 {
  margin: 0 0 20px;
}

.t-text {
  margin: 0 0 14px;
  max-width: 66ch;
  color: var(--text-2);
  font-size: 17.5px;
  line-height: 1.65;
}

/* A dictionary entry: the phrase on the left like a headword, the fix on the right. */
.t-dict {
  margin: 0;
  border-top: 1px solid var(--line);
}

.t-dict__row {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 8px 32px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.t-dict__phrase {
  align-self: start;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.t-dict__body {
  display: grid;
  gap: 8px;
  margin: 0;
}

.t-dict__why {
  margin: 0;
  color: var(--text-2);
  line-height: 1.55;
}

/* "было" / "стало" as a margin label; the example itself flows as a line of text,
   so a two-line "стало" reads like a marker stroke, not a yellow block. */
.t-dict__ex {
  position: relative;
  margin: 0;
  padding-left: 3.4rem;
  font-size: 15.5px;
  line-height: 1.6;
}

.t-dict__label {
  position: absolute;
  left: 0;
  top: 0.15em;
  color: var(--text-3);
  font-size: 13px;
}

.t-dict__ex s {
  color: var(--text-2);
  text-decoration-color: rgba(194, 54, 47, 0.6);
  text-decoration-thickness: 1.5px;
}

.t-dict__ex mark {
  padding: 1px 2px;
  border-radius: 2px;
  background: var(--lemon);
  color: var(--ink);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* A blank in an example: put your own number here. */
.t-slot {
  font-style: normal;
  border-bottom: 1px dashed currentColor;
  color: var(--text-2);
}

.t-fix {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

/* ---------- intro and the before/after sheet ---------- */

.t-intro {
  max-width: 60ch;
  margin: 0;
  color: var(--text-2);
  font-size: var(--t-lead);
  line-height: 1.55;
}

.t-demo {
  margin: 0 0 18px;
}

.t-demo__sheet {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 12px 8px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow);
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
  line-height: 1.6;
}

.t-demo__label {
  margin: 0;
  padding-top: 0.2em;
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: 13px;
}

.t-demo__text {
  margin: 0;
}

.t-demo del {
  color: var(--text-2);
  text-decoration-color: rgba(194, 54, 47, 0.7);
  text-decoration-thickness: 1.5px;
}

.t-demo ins {
  padding: 1px 2px;
  background: var(--lemon);
  text-decoration: none;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.t-demo figcaption {
  margin-top: 10px;
  color: var(--text-3);
  font-size: 14px;
}

/* Steps and signs: a real sequence, so numbers carry meaning. */
.t-steps {
  display: grid;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.t-steps li {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  column-gap: 14px;
  counter-increment: step;
}

.t-steps li > * {
  grid-column: 2;
}

.t-steps li::before {
  content: counter(step);
  grid-column: 1;
  grid-row: 1 / span 3;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.t-steps .b-h3 {
  margin: 4px 0 6px;
}

.t-steps p {
  margin: 0;
  max-width: 62ch;
  color: var(--text-2);
  line-height: 1.6;
}

.t-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 1.2em;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.55;
}

.t-list li::marker {
  color: var(--green);
}

/* ---------- call to action between the article and the answers ---------- */

.t-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  max-width: 760px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--lemon-soft);
}

.t-cta__text {
  flex: 1 1 26rem;
  margin: 0;
  color: var(--text-2);
  line-height: 1.55;
}

.t-cta__text b {
  color: var(--ink);
}

/* ---------- related pages ---------- */

.t-related ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.t-related li {
  border-bottom: 1px solid var(--line);
}

.t-related a {
  display: grid;
  gap: 4px;
  padding: 16px 0;
  color: inherit;
  text-decoration: none;
}

.t-related a b {
  font-size: 18px;
}

.t-related a span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--text-3);
  font-size: 15px;
  line-height: 1.5;
}

.t-related a:hover b {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.t-related a:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ---------- small screens ---------- */

@media (max-width: 980px) {
  .t-hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "copy"
      "check";
  }
}

@media (max-width: 640px) {
  .t-hero {
    row-gap: 18px;
    padding-top: 12px;
  }

  .t-dict__row {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 0;
  }

  .t-text {
    font-size: 16.5px;
  }

  .t-demo__sheet {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 18px 16px;
    font-size: 17px;
  }

  .t-demo__label + .t-demo__text {
    margin-bottom: 10px;
  }

  .t-cta {
    padding: 20px;
  }

  .t-cta .b-btn {
    width: 100%;
  }
}
