/* ============================================================
   COLOR PAGE — swatches, accessibility cells, dont cards
   ============================================================ */

/* ----------------------------------------------------------
   COLOR SWATCH GRID
   ---------------------------------------------------------- */

.color-swatch-grid {
  display: flex;
  flex-direction: column;
  gap: var(--col-gap);
}

.color-swatch-row {
  display: flex;
  gap: var(--col-gap);
  align-items: stretch;
}

.color-swatch {
  position: relative;
  height: 437px;
  overflow: hidden;
  flex-shrink: 0;
  flex: 1;
}

.color-swatch--half {
  flex: 0 0 calc(50% - 8px);
}

.color-swatch--bordered {
  border: 1px solid rgba(0, 0, 0, 0.25);
}

.color-swatch__label {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 148px;
  display: flex;
  flex-direction: column;
  font-family: var(--font-beausite);
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -0.54px;
  color: var(--color-black);
}

.color-swatch--dark .color-swatch__label {
  color: #ffffff;
}

.color-swatch__name {
  font-weight: 500;
}

.color-swatch__hex {
  font-weight: 400;
}

/* ----------------------------------------------------------
   ACCESSIBILITY CELLS
   ---------------------------------------------------------- */

.color-acc-grid {
  display: flex;
  gap: var(--col-gap);
  align-items: stretch;
}

.color-acc-cell {
  flex: 1;
  height: 168px;
  position: relative;
  overflow: hidden;
}

.color-acc-cell__text {
  position: absolute;
  top: calc(50% - 32px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-beausite);
  font-weight: 500;
  font-size: 50px;
  line-height: 1;
  letter-spacing: -2px;
  white-space: nowrap;
  color: var(--color-black);
}

.color-acc-cell--white-text .color-acc-cell__text {
  color: #ffffff;
}

.color-acc-cell__label {
  position: absolute;
  top: 146px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-beausite);
  font-weight: 500;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: -0.36px;
  white-space: nowrap;
  color: var(--color-black);
}

.color-acc-cell__fail-line {
  position: absolute;
  left: -6.8px;
  top: 0;
  width: 311.4px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.color-acc-cell__fail-line::after {
  content: '';
  display: block;
  width: 355.6px;
  height: 1px;
  background: rgba(0, 0, 0, 0.25);
  transform: rotate(-28.86deg);
  transform-origin: center;
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   DONT CARDS
   ---------------------------------------------------------- */

.color-dont-grid {
  display: flex;
  flex-direction: column;
  gap: var(--col-gap);
}

.color-dont-row {
  display: flex;
  gap: var(--col-gap);
  align-items: flex-start;
}

.color-dont-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--col-gap);
}

.color-dont-card__visual {
  width: 100%;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.03);
}

.color-dont-card__visual img {
  width: 100%;
  height: auto;
  display: block;
}

.color-dont-card__visual picture {
  display: block;
}

.color-dont-card__caption {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: -0.42px;
}

.color-dont-card__title {
  font-family: var(--font-beausite);
  font-weight: 500;
  color: var(--color-black);
}

.color-dont-card__desc {
  font-family: var(--font-beausite);
  font-weight: 400;
  color: #737373;
}

/* ----------------------------------------------------------
   MOBILE (≤ 440px)
   ---------------------------------------------------------- */

@media (max-width: 440px) {

  /* Section spacing: 40px between header and content */
  .view--color .section-block {
    gap: 40px;
  }

  /* Palette image: 361×464px portrait at mobile */
  #palette .logo-img-block {
    height: 464px;
  }

  #palette .logo-img-block img {
    height: 100%;
    object-fit: cover;
  }

  /* Swatch grid: 16px inset */
  .color-swatch-grid {
    padding: 0 16px;
  }

  /* All swatches: 370px tall at mobile */
  .color-swatch {
    height: 370px;
  }

  /* First two rows (Orange/Lilac, Black/White): stack to single column */
  .color-swatch-row:not(:last-child) {
    flex-direction: column;
  }

  /* Remove half-width constraint so they fill full row */
  .color-swatch--half {
    flex: none;
    width: 100%;
  }

  /* Last row (Muted Teal, Fog Green, Light Blue, Active Blue): wrap to 2×2 */
  .color-swatch-row:last-child {
    flex-wrap: wrap;
  }

  .color-swatch-row:last-child .color-swatch {
    flex: 0 0 calc(50% - 8px);
  }

  /* Accessibility grid: 16px inset, stack to 1-col, 168px tall */
  .color-acc-grid {
    flex-direction: column;
    padding: 0 16px;
  }

  .color-acc-cell {
    height: 168px;
  }

  /* Fail-line: resize for 361px-wide mobile cell */
  .color-acc-cell__fail-line {
    left: -16px;
    width: 393px;
  }

  .color-acc-cell__fail-line::after {
    width: 430px;
    transform: rotate(-24.88deg);
  }

  /* Don't cards: 16px inset, stack to 1-col, text before image */
  .color-dont-grid {
    padding: 0 16px;
  }

  .color-dont-row {
    flex-direction: column;
  }

  .color-dont-card {
    flex-direction: column-reverse;
  }
}
