/*
 * .checklist-tiles — left-aligned head, blue textured checklist card, heading and a row of photo tiles
 * (template-parts/flexible/checklist-tiles.php).
 * Figma phase 2: Strategy Session "Is this session right for you?" D 18:42753 / M 18:50388.
 * Fluid sizes: phone frame 375 px → desktop frame 1520 px; the checklist goes to two columns from 1025 px.
 * Any number of list items / tiles works: the list is balanced into columns, the last tile row is centred.
 */

.checklist-tiles {
  padding-top: var(--nv-section-y);
  padding-bottom: var(--nv-section-y);
  background-color: var(--nv-white);
}

/* .checklist-tiles__container — head, card, tiles block in a column; spacing is set per block below */
.checklist-tiles__container {
  display: flex;
  flex-direction: column;
}

/* .checklist-tiles__container > :first-child — a card or a tiles block without a head starts at the section padding */
.checklist-tiles__container > :first-child {
  margin-top: 0;
}

/* .checklist-tiles__head — eyebrow, heading, subtitle, left aligned */
.checklist-tiles__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

/* .checklist-tiles__eyebrow — green label with a rhomb, 10 px around the cap height as in Figma Frame 20 */
.checklist-tiles__eyebrow {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.3125rem;
  max-width: 100%;
  padding: calc(0.625rem - 0.14em) 0.625rem;
  color: var(--nv-green);
  font-weight: 500;
  font-size: var(--nv-fs-eyebrow);
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  overflow-wrap: anywhere;

  /* .checklist-tiles__eyebrow::before — rhomb */
  &::before {
    content: "";
    flex-shrink: 0;
    width: 0.53rem;
    height: 0.53rem;
    margin-top: calc(0.5lh - 0.265rem);
    background: url("../../img/icons/rhomb.svg") center / contain no-repeat;
  }
}

/* .checklist-tiles__title — 40 → 90 px, line box trimmed to cap / baseline; eyebrow → heading 40 → 80 px */
.checklist-tiles__title {
  max-width: 82rem;
  margin-top: calc(clamp(1.9375rem, 1.0575rem + 3.755vw, 4.625rem) - 0.14em);
  margin-bottom: -0.14em;
  color: var(--nv-navy);
  font-weight: 400;
  font-size: var(--nv-fs-h2);
  line-height: 1;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;

  /* @media (width >= 48em) .checklist-tiles__title */
  @media (width >= 48em) {
    letter-spacing: -0.02em;
  }

  & strong {
    color: var(--nv-green);
    font-weight: inherit;
  }
}

/* .checklist-tiles__subtitle — 20 → 23 px, 70 % navy, 40 → 36 px under the heading */
.checklist-tiles__subtitle {
  max-width: 50.5625rem;
  margin-top: calc(3.0625rem - 0.24em);
  margin-bottom: -0.24em;
  color: rgba(19, 33, 50, 0.7);
  font-size: var(--nv-fs-lead);
  line-height: 1.2;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;

  /* @media (width >= 64.0625em) .checklist-tiles__subtitle */
  @media (width >= 64.0625em) {
    margin-top: calc(3.5625rem - 0.24em);
  }

  & > * + * {
    margin-top: 1.25rem;
  }

  & strong {
    color: var(--nv-navy);
    font-weight: 700;
  }
}

/* .checklist-tiles__card — blue rounded card; padding 30 → 60 px */
.checklist-tiles__card {
  position: relative;
  margin-top: 3.125rem;
  border-radius: var(--nv-radius-s);
  background-color: var(--nv-blue);
  overflow: hidden;

  /* @media (width >= 48em) .checklist-tiles__card — desktop only: the Figma 299° gradient (30 %); its light end is
     covered by the texture fade in the frame, so it ends in the card colour here (render: left #215b87, right #1a4d74) */
  @media (width >= 48em) {
    margin-top: 3.5625rem;
    background-image: linear-gradient(299deg, rgba(19, 33, 50, 0.3) 1.5%, rgba(33, 91, 135, 0) 60%);
  }
}

/* .checklist-tiles__texture — decorative wave at 30 %, fading into the card colour at its edges */
.checklist-tiles__texture {
  position: absolute;
  inset: 0;
  mix-blend-mode: multiply;
  opacity: 0.8;
  pointer-events: none;
}

/* .checklist-tiles__texture-image — a texture chosen in the admin fills the card */
.checklist-tiles__texture-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* .checklist-tiles__texture--default — the whole card background rendered from the frame (card colour, gradient and
   the wave 0746dd with its fade): M 18:50400, D 18:42759 + 18:42760 (Pavlo, 2026-11-16: the CSS rebuild of the wave
   did not look like the frame); drawn as is, without the blend of the admin texture */
.checklist-tiles__texture--default {
  mix-blend-mode: normal;
  opacity: 1;
  background: url("../../img/checklist-tiles-bg-mobile.webp") 50% 50% / cover no-repeat;

  /* @media (width >= 48em) .checklist-tiles__texture--default */
  @media (width >= 48em) {
    background-image: url("../../img/checklist-tiles-bg.webp");
  }
}

/* .checklist-tiles__card-body */
.checklist-tiles__card-body {
  position: relative;
  padding: clamp(2rem, 1.4272rem + 2.445vw, 3.75rem) clamp(1.875rem, 1.0556rem + 3.494vw, 3.75rem) clamp(1.625rem, 0.9313rem + 2.969vw, 3.75rem);
}

/* .checklist-tiles__card-title — 23 → 32 px, white, trimmed to cap / baseline; 30 → 40 px to the list */
.checklist-tiles__card-title {
  margin-top: -0.14em;
  margin-bottom: calc(clamp(1.6875rem, 1.381rem + 1.31vw, 2.625rem) - 0.14em);
  color: var(--nv-white);
  font-weight: 600;
  font-size: clamp(1.4375rem, 1.2292rem + 0.8886vw, 2rem);
  line-height: 1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

/* .checklist-tiles__list — checklist: 16 → 20 px, white; two columns (648 : 575 px in the frame) from 1025 px */
.checklist-tiles__list {
  gap: 0.53rem;
  color: var(--nv-white);
  font-size: clamp(1rem, 0.9181rem + 0.3493vw, 1.25rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;

  /* @media (width >= 64.0625em) .checklist-tiles__list — two balanced columns, items never split */
  @media (width >= 64.0625em) {
    display: block;
    columns: 2;
    column-gap: 3.75rem;
    margin-bottom: -1.25rem;
  }

  /* @media (width >= 89.375em) .checklist-tiles__list — frame widths 648 : 575 px, rows count set in the template */
  @media (width >= 89.375em) {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: minmax(0, 1.127fr) minmax(0, 1fr);
    grid-template-rows: repeat(var(--ct-rows, 4), auto);
    columns: auto;
    gap: 1.25rem 3.75rem;
    margin-bottom: 0;
  }
}

/* .checklist-tiles__list .diamond-list__item — rhomb 8 px, text 18 → 28 px from the left edge */
.checklist-tiles__list .diamond-list__item {
  padding-left: 1.125rem;
  overflow-wrap: anywhere;

  /* @media (width >= 64.0625em) .checklist-tiles__list .diamond-list__item */
  @media (width >= 64.0625em) {
    padding-left: 1.75rem;
    padding-bottom: 1.25rem;
    break-inside: avoid;
  }

  /* @media (width >= 89.375em) .checklist-tiles__list .diamond-list__item */
  @media (width >= 89.375em) {
    padding-bottom: 0;
  }

  /* .checklist-tiles__list .diamond-list__item::before */
  &::before {
    top: calc(0.6em - 0.25rem);
    left: 0;
  }
}

/* .checklist-tiles__list--rows-N — rows per column (half of the items, set in the template) */
.checklist-tiles__list--rows-1 {
  --ct-rows: 1;
}

.checklist-tiles__list--rows-2 {
  --ct-rows: 2;
}

.checklist-tiles__list--rows-3 {
  --ct-rows: 3;
}

.checklist-tiles__list--rows-4 {
  --ct-rows: 4;
}

.checklist-tiles__list--rows-5 {
  --ct-rows: 5;
}

.checklist-tiles__list--rows-6 {
  --ct-rows: 6;
}

.checklist-tiles__list--rows-7 {
  --ct-rows: 7;
}

.checklist-tiles__list--rows-8 {
  --ct-rows: 8;
}

.checklist-tiles__list--rows-9 {
  --ct-rows: 9;
}

.checklist-tiles__list--rows-10 {
  --ct-rows: 10;
}

.checklist-tiles__list--rows-11 {
  --ct-rows: 11;
}

.checklist-tiles__list--rows-12 {
  --ct-rows: 12;
}

/* .checklist-tiles__tiles-block — heading and tiles */
.checklist-tiles__tiles-block {
  margin-top: 3.125rem;

  /* @media (width >= 48em) .checklist-tiles__tiles-block */
  @media (width >= 48em) {
    margin-top: 6.25rem;
  }
}

/* .checklist-tiles__tiles-title — 32 → 50 px, medium, trimmed; 49 px to the photos */
.checklist-tiles__tiles-title {
  margin-top: -0.14em;
  margin-bottom: calc(3.0625rem - 0.14em);
  color: var(--nv-navy);
  font-weight: 500;
  font-size: clamp(2rem, 1.631rem + 1.572vw, 3.125rem);
  line-height: 1;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

/* .checklist-tiles__tiles — wrapping row: 1 → 2 → 3 → 5 per row, an incomplete last row is centred */
.checklist-tiles__tiles {
  --ct-gap: 1.375rem;

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.375rem var(--ct-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* .checklist-tiles__tile — photo with a gradient label under it */
.checklist-tiles__tile {
  display: flex;
  flex: 0 0 100%;
  flex-direction: column;
  min-width: 0;
  gap: 1.375rem;

  /* @media (width >= 30em) .checklist-tiles__tile */
  @media (width >= 30em) {
    flex-basis: calc((100% - var(--ct-gap)) / 2);
  }

  /* @media (width >= 48em) .checklist-tiles__tile */
  @media (width >= 48em) {
    flex-basis: calc((100% - 2 * var(--ct-gap)) / 3);
  }

  /* @media (width >= 64.0625em) .checklist-tiles__tile */
  @media (width >= 64.0625em) {
    flex-basis: calc((100% - 4 * var(--ct-gap)) / 5);
    gap: 1.3125rem;
  }
}

/* .checklist-tiles__photo — frame sets the proportions (335 × 220 phone, 263 × 220 desktop) */
.checklist-tiles__photo {
  aspect-ratio: 335 / 220;
  border-radius: 0.9375rem;
  overflow: hidden;

  /* @media (width >= 30em) .checklist-tiles__photo */
  @media (width >= 30em) {
    aspect-ratio: 263 / 220;
  }
}

/* .checklist-tiles__picture — optional phone source around the photo (inc/template-tags.php
   naviona_image_with_mobile()); the <img> keeps its own box */
.checklist-tiles__picture {
  display: contents;
}

/* .checklist-tiles__photo-image */
.checklist-tiles__photo-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* .checklist-tiles__label — 23 px semibold caps, label trimmed to cap / baseline */
.checklist-tiles__label {
  margin-top: -0.14em;
  margin-bottom: -0.14em;
  font-weight: 600;
  font-size: 1.4375rem;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;

  /* @media (width >= 64.0625em) .checklist-tiles__label — five tiles per row: 19 px at 1025 → 23 px at 1520 */
  @media (width >= 64.0625em) {
    font-size: clamp(1.1875rem, 0.67rem + 0.808vw, 1.4375rem);
  }
}

/* .checklist-tiles__label-text — gradient text #132132 → #215b87 across the text width */
.checklist-tiles__label-text {
  display: inline-block;
  background: linear-gradient(90deg, var(--nv-navy), var(--nv-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  overflow-wrap: anywhere;
}
