/* The cliché checker sheet: a notebook page with the научрук's notes in the margin.
   Used on the landing hero and on the tool pages (landing-check.js). */

/* Caveat (OFL) is the научрук's red pen in the margin. */
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../vendor/fonts/caveat-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

.l-check {
  grid-area: check;
  display: grid;
  gap: 14px;
}

.l-check__sheet {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--paper);
  box-shadow: var(--shadow-l);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.l-check__sheet:focus-within {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-l), var(--ring);
}

.l-check__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 12px 10px 20px;
  border-bottom: 1px solid var(--line);
}

.l-check__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.l-check__tools {
  display: flex;
  gap: 6px;
}

.l-check__tool {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--paper);
  color: var(--ink);
  font: 500 14px/1 var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
}

.l-check__tool:hover {
  border-color: var(--ink);
}

.l-check__tool:active {
  transform: scale(0.97);
}

.l-check__tool:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* The page: squared paper, two cells per line of text, and поля with a red line on the right. */
.l-check__page {
  --margin-w: 118px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--margin-w);
  background-image:
    linear-gradient(#e6edf5 1px, transparent 1px),
    linear-gradient(90deg, #e6edf5 1px, transparent 1px);
  background-position: -1px -1px;
  background-size: 14px 14px;
}

.l-check__input {
  display: block;
  width: 100%;
  min-height: 196px;
  padding: 14px 18px 14px 22px;
  border: 0;
  resize: none;
  color: var(--ink);
  font: 400 17px/28px "Times New Roman", Times, serif;
  outline: none;
}

.l-check__input:focus-visible {
  outline: none;
}

.l-check__input::placeholder {
  color: #8f8b82;
  font-family: var(--font-body);
  font-size: 15px;
}

.l-check__margin {
  position: relative;
  overflow: hidden;
  border-left: 2px solid #f0a39c;
}

.l-check__pen {
  position: absolute;
  left: 10px;
  color: var(--red);
  font: 600 21px/1 "Caveat", "Comic Sans MS", cursive;
  white-space: nowrap;
  transform: rotate(-4deg);
  transform-origin: left center;
}

.l-check__pen--long {
  color: #6f6b62;
}

@media (prefers-reduced-motion: no-preference) {
  .l-check__margin.is-fresh .l-check__pen {
    animation: pen-note 300ms ease-out both;
    animation-delay: calc(var(--i, 0) * 70ms + 300ms);
  }
}

@keyframes pen-note {
  from {
    opacity: 0;
    transform: rotate(-4deg) translateX(-6px);
  }
}

.l-check__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 14px 12px 20px;
  border-top: 1px dashed var(--line-strong);
}

.l-check__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 14px;
}

.l-check__legend li {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.l-check__legend b {
  min-width: 1.1em;
  color: var(--red);
  font-size: 18px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.l-check__legend li[data-kind="long"] b {
  color: var(--ink);
}

.l-check__legend li.is-zero b {
  color: var(--green);
}

.l-check__legend li.is-empty b {
  color: var(--text-3);
}

.l-check__cta {
  white-space: nowrap;
}

.l-check__cta[hidden] {
  display: none;
}

.l-check__tips {
  display: grid;
  gap: 10px;
  padding: 0 4px;
}

.l-check__tips.is-empty .l-check__verdict,
.l-check__tips.is-empty .l-check__list {
  display: none;
}

.l-check__verdict {
  margin: 0;
  font-size: 16px;
  font-weight: 620;
}

.l-check__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 1.35;
}

.l-check__list li {
  padding-left: 10px;
  border-left: 2px solid var(--red);
}

.l-check__list li[data-kind="long"] {
  border-left: 2px dashed #8f8b82;
}

.l-check__list b {
  font-weight: 600;
}

.l-check__list span {
  display: block;
  color: var(--text-3);
}

.l-check__note {
  margin: 0;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .l-check__bar {
    flex-wrap: nowrap;
    padding-left: 14px;
  }

  /* The sample is already on the page; on a phone one tool is enough. */
  .l-check__tool[data-check-sample] {
    display: none;
  }

  .l-check__page {
    --margin-w: 60px;
  }

  .l-check__input {
    padding: 14px 10px 14px 14px;
    font-size: 16px;
  }

  .l-check__pen {
    left: 6px;
    font-size: 18px;
  }

  .l-check__foot {
    padding-inline: 14px;
  }

  .l-check__legend {
    flex-wrap: nowrap;
    gap: 12px;
    font-size: 13.5px;
  }

  .l-check__cta {
    width: 100%;
  }

  .l-check__list li:nth-child(n + 2) {
    display: none;
  }
}
