/* ==========================================================================
   Components shared by the content pages (rating, about).
   Breakpoints: mobile < 768 ≤ tablet < 1280 ≤ desktop (designs: 320 and 1920).
   ========================================================================== */

/* Section heading: small label above an h2
   ========================================================================== */

.heading {
  margin: 0;
}

.heading__label {
  color: var(--color-muted);
  font-size: 14px;
  line-height: 17px;
}

.heading__title {
  margin-top: 5px;
  color: var(--color-text);
  font-size: 28px;
  font-weight: 600;
  line-height: 32px;
}

.heading--light .heading__label,
.heading--light .heading__title {
  color: #ffffff;
}

/* Button: dark pill with a green arrow
   ========================================================================== */

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 10px;
  border-radius: 999px;
  background: var(--color-text);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  line-height: 16px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.button:hover {
  background: #26302a;
}

.button:focus-visible {
  outline: 2px solid var(--color-accent-text);
  outline-offset: 3px;
}

.button__text {
  flex: 1;
  text-align: center;
}

.button__icon {
  flex: none;
  width: 28px;
  height: 28px;
  transition: transform 0.2s ease;
}

.button:hover .button__icon {
  transform: translateX(2px);
}

/* Hero: first screen with a label, title, text, button and a photo.
   The photo and background colours are set per page (.hero--*).
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: 32px;
  background: var(--color-surface);
}

.hero__inner {
  position: relative;
  z-index: 1;
}

.hero__label {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f5ffe6;
  color: var(--color-text-soft);
  font-size: 12px;
  line-height: 14px;
}

.hero__title {
  max-width: 14em;
  margin-top: 10px;
  color: var(--color-text-soft);
  font-size: clamp(32px, 24px + 2.5vw, 72px);
  font-weight: 600;
  line-height: calc(1.0875em + 1.7px);
}

.hero__accent {
  color: var(--color-accent-text);
}

.hero__text {
  max-width: 42em;
  margin-top: 8px;
  color: var(--color-text-soft);
  font-size: clamp(14px, 12.8px + 0.375vw, 20px);
  line-height: 1.43;
}

.hero__button {
  margin-top: 20px;
}

/* Green section with a glow and a barely visible honeycomb
   ========================================================================== */

.section-green {
  padding-block: 32px;
  background-color: #06483a;
  color: #ffffff;
}

/* Criteria cards
   ========================================================================== */

.criteria {
  padding-block: 32px;
  background: var(--color-surface);
}

.criteria__list {
  display: grid;
  gap: 6px;
  margin-top: 22px;
}

.criterion {
  /* 2px less on the right keeps "Speed and throttling policies" on one line */
  padding: 20px 18px 20px 20px;
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  transition: transform 0.25s ease;
}

/* a slight zoom on hover: only with a mouse, not with reduced motion */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .criterion:hover {
    transform: scale(1.03);
  }
}

.criterion__icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--color-row);
}

/* The width and height attributes carry the desktop size of each icon:
   their transparent padding differs, so the design sizes them one by one. */
@media (max-width: 767px) {
  .criterion__icon img {
    width: auto;
    height: 32px;
  }
}

.criterion__title {
  margin-top: 13px;
  color: #061c3d;
  font-size: 18px;
  font-weight: 600;
  line-height: 22px;
}

.criterion__text {
  margin-top: 12px;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 20px;
}

/* Checklist with green check icons
   ========================================================================== */

.checklist {
  display: grid;
  gap: 8px;
}

.checklist__item {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14px;
  line-height: 20px;
}

.checklist__item::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  background: url("../img/icons/checked-green.svg") center / contain no-repeat;
}

/* Contact block: text and a form (about: correction policy, affiliate)
   ========================================================================== */

.contact__text {
  margin-top: 19px;
  font-size: 14px;
  line-height: 24px;
}

.contact__link {
  color: var(--color-accent-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.contact__link:hover {
  text-decoration: none;
}

.contact-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.contact-form__caption {
  margin-bottom: 5px;
  font-size: 14px;
  line-height: 24px;
}

.contact-form__input {
  width: 100%;
  height: 56px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.contact-form__input::placeholder {
  color: #ffffff;
  opacity: 1;
}

.contact-form__input:focus {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.25);
  outline: none;
}

.contact-form__submit {
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--color-accent-strong);
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.contact-form__submit:hover {
  background: var(--color-accent-strong-hover);
}

.contact-form__submit:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Notice strip above the footer
   ========================================================================== */

.notice {
  padding-block: 22px 25px;
  background: #e5ffc0;
  color: #000000;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

/* Tablet
   ========================================================================== */

@media (min-width: 768px) {
  .heading__label {
    font-size: 16px;
    line-height: 19px;
  }

  .heading__label--large {
    font-size: 20px;
    line-height: 24px;
  }

  .heading__label--large + .heading__title {
    margin-top: 4px;
  }

  .heading__title {
    font-size: clamp(28px, 25px + 0.9375vw, 43px);
    line-height: 1.2;
  }

  .heading__title--large {
    font-size: clamp(28px, 23.2px + 1.5vw, 52px);
  }

  .button {
    gap: 16px;
    min-width: 183px;
    padding: 8px 8px 8px 28px;
    font-size: 18px;
    line-height: 22px;
  }

  .button__icon {
    width: 36px;
    height: 36px;
  }

  .hero {
    padding-block: 64px 80px;
  }

  .hero__label {
    padding: 7px 12px;
    font-size: 14px;
    line-height: 17px;
  }

  .hero__title {
    margin-top: 21px;
  }

  .hero__text {
    margin-top: 22px;
    line-height: 1.45;
  }

  .hero__button {
    margin-top: 40px;
  }

  /* white hero with a soft green glow in the corner (about, legal pages) */
  .hero--light {
    background: url("../img/inner-corner.svg") left top / 815px 596px no-repeat, #ffffff;
  }

  .hero--light .hero__label {
    background: #f2ffe0;
  }

  .hero--light .hero__title {
    margin-top: 21px;
  }

  .hero--light .hero__text {
    max-width: 700px;
    margin-top: 20px;
    line-height: 30px;
  }

  .hero--light .hero__button {
    margin-top: 39px;
  }

  .section-green {
    position: relative;
    overflow: hidden;
    background-image:
      linear-gradient(to left, rgba(1, 48, 61, 0.75), rgba(1, 48, 61, 0) 260px),
      radial-gradient(22% 45% at 100% 68%, rgba(1, 48, 61, 0.9), rgba(1, 48, 61, 0) 100%),
      radial-gradient(35% 110% at 72% 0%, #0b7059 0%, rgba(11, 112, 89, 0.55) 45%, rgba(11, 112, 89, 0) 100%);
  }

  /* honeycomb on the right */
  .section-green::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='173.2' viewBox='0 0 100 173.2'%3E%3Cg fill='%23fff'%3E%3Cpath fill-opacity='.018' d='M25 0 50 14.4v28.9L25 57.7 0 43.3V14.4z'/%3E%3Cpath fill-opacity='.006' d='M75 0 100 14.4v28.9L75 57.7 50 43.3V14.4z'/%3E%3Cpath fill-opacity='.012' d='M50 43.3 75 57.7v28.9L50 101 25 86.6V57.7z'/%3E%3Cpath fill-opacity='.024' d='M100 43.3 125 57.7v28.9L100 101 75 86.6V57.7zM0 43.3 25 57.7v28.9L0 101-25 86.6V57.7z'/%3E%3Cpath fill-opacity='.004' d='M25 86.6 50 101v28.9l-25 14.4L0 129.9V101z'/%3E%3Cpath fill-opacity='.02' d='M75 86.6 100 101v28.9l-25 14.4-25-14.4V101z'/%3E%3Cpath fill-opacity='.014' d='M50 129.9 75 144.3v28.9L50 187.6 25 173.2v-28.9zM50 -43.3 75 -28.9V0L50 14.4 25 0v-28.9z'/%3E%3Cpath fill-opacity='.008' d='M0 129.9 25 144.3v28.9L0 187.6-25 173.2v-28.9zM100 129.9 125 144.3v28.9l-25 14.4-25-14.4v-28.9zM0 -43.3 25 -28.9V0L0 14.4-25 0v-28.9zM100 -43.3 125 -28.9V0l-25 14.4L75 0v-28.9z'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 100px 173.2px;
    -webkit-mask-image: linear-gradient(to right, transparent 45%, #000000 85%);
    mask-image: linear-gradient(to right, transparent 45%, #000000 85%);
    pointer-events: none;
  }

  .section-green > .container {
    position: relative;
    z-index: 1;
  }

  .criteria {
    padding-block: 110px 101px;
  }

  .criteria__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
    margin-top: 29px;
  }

  .criterion {
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
  }

  .criterion__icon {
    width: 115px;
    height: 115px;
    border-radius: 16px;
  }

  .criterion__title {
    margin-top: 29px;
    font-size: 24px;
    line-height: 29px;
  }

  .criterion__text {
    margin-top: 14px;
    font-size: 18px;
    line-height: 26px;
  }

  .notice {
    padding-block: 25px 28px;
    font-size: 14px;
    line-height: 17px;
  }

  .contact {
    padding-block: 110px 100px;
  }

  .contact__text {
    max-width: 780px;
    margin-top: 39px;
    font-size: 20px;
    line-height: 30px;
  }

  .contact-form {
    gap: 16px;
    max-width: 525px;
    margin-top: 48px;
  }

  .contact-form__caption {
    margin-bottom: 1px;
    font-size: 16px;
    line-height: 19px;
    text-align: center;
  }

  .contact-form__input {
    height: 52px;
    padding: 0 15px;
    font-size: 16px;
  }

  .contact-form__submit {
    height: 52px;
    font-size: 18px;
  }

  .checklist__item {
    align-items: flex-start;
    gap: 16px;
    font-size: 18px;
    line-height: 26px;
  }

  .checklist__item::before {
    width: 22px;
    height: 22px;
    /* sits 5px down but must not make the 26px line taller */
    margin-block: 5px -1px;
  }
}

/* Hero photo and three columns of criteria
   ========================================================================== */

@media (min-width: 1024px) {
  .hero {
    min-height: 665px;
    padding-block: 102px 64px;
  }

  /* the photo is set per page and fades into the background on its left edge */
  .hero::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(896px, 50%);
    background: right center / cover no-repeat;
    pointer-events: none;
  }

  [dir="rtl"] .hero::before {
    transform: scaleX(-1);
  }

  .hero--light {
    padding-top: 101px;
  }

  .hero--light::before {
    width: min(937px, 50%);
  }

  .criteria__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contact__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 525px);
    align-items: end;
    column-gap: 40px;
  }

  .contact-form {
    margin-top: 0;
  }
}

/* Narrower screens crop the photo, so soften the cut edge */
@media (min-width: 1024px) and (max-width: 1791px) {
  .hero::before {
    -webkit-mask-image: linear-gradient(to right, transparent, #000000 30%);
    mask-image: linear-gradient(to right, transparent, #000000 30%);
  }
}
