/*
 * Colour library page (/colour-library).
 * Styled after the Turgon product book: pale grey pages, thin wide-spaced
 * headings, small spaced labels and square swatches on a grey name strip.
 */

.tg-cl, .tg-cl-dialog {
  --cl-paper: #EEF0EE;
  --cl-strip: #DFE2DF;
  --cl-ink: #23271F;
  --cl-muted: #6A6F68;
  --cl-dark: #23271F;
}

.tg-cl-label {
  margin: 0;
  font-family: var(--tg-ui);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cl-muted);
}
.tg-cl-label span { margin: 0 0.5em; font-weight: 400; }
.tg-cl-title {
  margin: 0;
  font-family: var(--tg-display);
  font-weight: normal;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cl-ink);
}
.tg-cl-title--light { color: #FFFFFF; }

/* ---------- Intro and 3 steps ---------- */

.tg-cl-intro { padding: 56px 0 40px; }
.tg-cl-intro__row { display: flex; flex-wrap: wrap; gap: 32px 72px; align-items: center; justify-content: space-between; }
.tg-cl-intro__text { flex: 1 1 520px; max-width: 680px; display: flex; flex-direction: column; gap: 14px; }
.tg-cl-intro__text p:not(.tg-cl-label) { margin: 0; font-size: 18px; line-height: 1.65; color: var(--tg-ink-2); }

.tg-cl-steps {
  flex: 0 1 460px;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  position: relative;
}
.tg-cl-steps::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 19px;
  border-top: 1px solid var(--tg-line-2);
}
.tg-cl-steps li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  font-family: var(--tg-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cl-muted);
  padding: 0 8px;
}
.tg-cl-steps__num {
  width: 38px;
  height: 38px;
  border: 1px solid var(--cl-muted);
  border-radius: 50%;
  background: #FFFFFF;
  display: grid;
  place-items: center;
  font-family: var(--tg-display);
  font-size: 18px;
  letter-spacing: 0;
  color: var(--cl-ink);
}

/* ---------- Library ---------- */

.tg-cl-library { background: var(--cl-paper); padding: 40px 0 72px; }
.tg-cl-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
}
.tg-cl-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-cl-chip {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #C9CCC8;
  background: #FFFFFF;
  color: var(--cl-ink);
  font-family: var(--tg-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.tg-cl-chip span { margin-left: 6px; font-weight: 400; color: var(--cl-muted); }
.tg-cl-chip:hover { border-color: var(--cl-dark); }
.tg-cl-chip[aria-pressed="true"] { background: var(--cl-dark); border-color: var(--cl-dark); color: #FFFFFF; }
.tg-cl-chip[aria-pressed="true"] span { color: #C9CFC7; }

.tg-cl-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  background: #FFFFFF;
  border: 1px solid #C9CCC8;
  color: var(--cl-muted);
  flex: 0 1 280px;
}
.tg-cl-search:focus-within { border-color: var(--cl-dark); outline: 2px solid var(--tg-orange); outline-offset: 1px; }
.tg-cl-search input { border: 0; outline: 0; background: transparent; font-size: 16px; width: 100%; color: var(--cl-ink); }
.tg-cl-empty { margin: 32px 0 0; font-size: 17px; }
.tg-cl-empty a { color: var(--tg-link); text-decoration: underline; }

.tg-cl-group { padding-top: 48px; }
.tg-cl-group__head { display: grid; grid-template-columns: auto 1fr; gap: 6px 40px; align-items: end; margin-bottom: 24px; }
.tg-cl-group__title {
  grid-row: span 2;
  margin: 0;
  font-family: var(--tg-display);
  font-weight: normal;
  font-size: 44px;
  line-height: 0.95;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8E938C;
}
.tg-cl-group__intro { margin: 0; max-width: 60ch; font-size: 16px; line-height: 1.55; color: var(--tg-ink-2); }

.tg-cl-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 22px 18px;
}
.tg-cl-swatch__btn {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: center;
  cursor: pointer;
}
.tg-cl-swatch__btn img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform .25s ease, box-shadow .25s ease;
}
.tg-cl-swatch__btn:hover img, .tg-cl-swatch__btn:focus-visible img { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(35, 39, 31, .22); }
.tg-cl-swatch__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 6px 9px;
  background: var(--cl-strip);
}
.tg-cl-swatch__no { font-family: var(--tg-ui); font-size: 10px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cl-muted); }
.tg-cl-swatch__name { font-family: var(--tg-ui); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cl-ink); }
.tg-cl-swatch__tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 7px;
  background: rgba(255, 255, 255, .92);
  font-family: var(--tg-ui);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cl-ink);
}
.tg-cl-note { margin: 48px 0 0; font-size: 15px; color: var(--cl-muted); }

/* ---------- Colour matching band ---------- */

.tg-cl-match { background: var(--cl-dark); color: #DADDD8; padding: 64px 0; }
.tg-cl-match__row { display: flex; flex-wrap: wrap; gap: 28px 64px; align-items: center; justify-content: space-between; }
.tg-cl-match__row > div:first-child { flex: 1 1 480px; max-width: 640px; display: flex; flex-direction: column; gap: 14px; }
.tg-cl-match p { margin: 0; font-size: 17px; line-height: 1.6; }
.tg-cl-match__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Colour dialog ---------- */

.tg-cl-dialog {
  width: min(1000px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  background: #FFFFFF;
  color: var(--tg-ink);
  overflow: auto;
}
.tg-cl-dialog::backdrop { background: rgba(20, 22, 20, .72); }
.tg-cl-dialog__body { display: grid; grid-template-columns: minmax(0, 584px) minmax(320px, 1fr); }
.tg-cl-dialog__media { background: var(--cl-paper); padding: 32px 32px 76px; display: flex; align-items: flex-start; justify-content: center; }
.tg-cl-dialog__img {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 160px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  box-shadow: 0 10px 24px rgba(35, 39, 31, .18);
}
.tg-cl-dialog__text { padding: 44px 40px 32px; display: flex; flex-direction: column; gap: 14px; }
.tg-cl-dialog__text > p:not([class]) { margin: 0; font-size: 16px; line-height: 1.6; color: var(--tg-ink-2); }
.tg-cl-dialog__no { margin: 8px 0 0; font-family: var(--tg-ui); font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--tg-muted); }
.tg-cl-dialog__name {
  margin: 0;
  font-family: var(--tg-display);
  font-weight: normal;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tg-cl-dialog__ranges { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tg-cl-dialog__ranges a { color: var(--tg-link); text-decoration: underline; font-size: 15px; }
.tg-cl-dialog__actions { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 10px; }
.tg-cl-dialog__actions [hidden] { display: none; }
.tg-cl-dialog__hint { margin: 0; font-size: 13px; color: var(--tg-muted); }
.tg-cl-dialog__close, .tg-cl-dialog__step {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: #FFFFFF;
  color: var(--tg-ink);
  cursor: pointer;
}
.tg-cl-dialog__close { position: absolute; top: 0; right: 0; }
.tg-cl-dialog__nav { position: absolute; left: 0; bottom: 0; display: flex; gap: 1px; background: var(--tg-line); }
.tg-cl-dialog__close:hover, .tg-cl-dialog__step:hover { background: var(--tg-stone); }

/* ---------- Swatch book version (Nov 2026): formats, sample buttons, extras ---------- */

.tg-cl-formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 48px; }
.tg-cl-format { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; color: #FFFFFF; text-decoration: none; background: var(--cl-dark); }
.tg-cl-format img { width: 100%; height: 100%; object-fit: cover; opacity: .82; transition: transform .6s ease, opacity .3s ease; }
.tg-cl-format:hover img { transform: scale(1.04); opacity: .7; }
.tg-cl-format > span { position: absolute; left: 22px; bottom: 18px; font-family: var(--tg-display); font-weight: 300; font-size: 30px; letter-spacing: 0.1em; text-transform: uppercase; text-shadow: 0 2px 14px rgba(0, 0, 0, .5); }
.tg-cl-format .tg-eyebrow { display: block; margin: 0 0 4px; color: #E3E6E1; text-shadow: none; }

.tg-cl-swatch { display: flex; flex-direction: column; }
a.tg-cl-swatch__btn { text-decoration: none; color: inherit; }
.tg-cl-sample {
  align-self: stretch;
  min-height: 36px;
  margin-top: 6px;
  border: 1px solid #C9CCC8;
  background: #FFFFFF;
  color: var(--cl-ink);
  font-family: var(--tg-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}
.tg-cl-sample:hover { border-color: var(--cl-dark); }
.tg-cl-sample .tg-when-added, .tg-cl-sample[aria-pressed="true"] .tg-when-not { display: none; }
.tg-cl-sample[aria-pressed="true"] { background: var(--cl-dark); border-color: var(--cl-dark); color: #FFFFFF; }
.tg-cl-sample[aria-pressed="true"] .tg-when-added { display: inline; }

.tg-cl-grid--extras { margin-top: 48px; }
.tg-cl-dialog__img--tall { aspect-ratio: auto !important; max-height: min(78vh, 760px); width: auto !important; max-width: 100% !important; object-fit: contain; }
.tg-cl-dialog__extra { margin: 0 !important; font-size: 14px !important; color: var(--tg-muted) !important; }


/* ---------- Phones and tablets ---------- */

@media (max-width: 991.98px) {
  .tg-cl-steps { flex-basis: 100%; }
}
@media (max-width: 767.98px) {
  .tg-cl-intro { padding: 28px 0 28px; }
  .tg-cl-title { font-size: 28px; letter-spacing: 0.08em; }
  .tg-cl-intro__text p:not(.tg-cl-label) { font-size: 16px; }
  .tg-cl-library { padding: 24px 0 48px; }
  .tg-cl-filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .tg-cl-chip { flex: none; }
  .tg-cl-search { flex: 1 1 100%; }
  .tg-cl-group { padding-top: 32px; }
  .tg-cl-group__head { grid-template-columns: 1fr; }
  .tg-cl-group__title { grid-row: auto; font-size: 32px; }
  .tg-cl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
  .tg-cl-swatch__name { font-size: 10.5px; letter-spacing: 0.04em; }
  .tg-cl-swatch__no { font-size: 9px; letter-spacing: 0.14em; }
  .tg-cl-swatch__tag { top: 4px; left: 4px; font-size: 8px; padding: 2px 4px; letter-spacing: 0.06em; }
  .tg-cl-match { padding: 44px 0; }
  .tg-cl-dialog__body { grid-template-columns: 1fr; }
  .tg-cl-dialog__media { padding: 0; }
  .tg-cl-dialog__img { max-width: none; max-height: 52vh; box-shadow: none; }
  .tg-cl-dialog__text { padding: 22px 20px 20px; }
  .tg-cl-dialog__nav { position: sticky; bottom: 0; justify-content: space-between; border-top: 1px solid var(--tg-line); background: #FFFFFF; }
  .tg-cl-dialog__name { font-size: 34px; }
}
@media (max-width: 420px) {
  .tg-cl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .tg-cl-formats { grid-template-columns: 1fr; gap: 10px; margin-top: 32px; }
  .tg-cl-format { aspect-ratio: 21 / 9; }
  .tg-cl-format > span { font-size: 24px; left: 16px; bottom: 12px; }
  .tg-cl-dialog__img--tall { max-height: 46vh; }
}

/* The old theme sets every <p> to 18px !important on phones; keep this page's own text sizes. */
.tg-cl-label { font-size: 11px !important; }
.tg-cl-dialog__no { font-size: 12px !important; }
.tg-cl-dialog__hint { font-size: 13px !important; }
.tg-cl-note { font-size: 15px !important; }
.tg-cl-group__intro, .tg-cl-dialog__text > p:not([class]) { font-size: 16px !important; }
.tg-cl-intro__text p:not(.tg-cl-label), .tg-cl-empty { font-size: 18px !important; }
.tg-cl-match p { font-size: 17px !important; }
@media (max-width: 767.98px) {
  .tg-cl-label { font-size: 10px !important; letter-spacing: 0.18em; }
  .tg-cl-group__intro, .tg-cl-dialog__text > p:not([class]) { font-size: 15px !important; }
  .tg-cl-intro__text p:not(.tg-cl-label), .tg-cl-empty, .tg-cl-match p { font-size: 16px !important; }
}
