/* TotalDesign Design Explorer — compact, opt-in article navigation.
   Mobile-first: subjects are a row of chips; a wide container with 3-4
   subjects turns them into a small map around the guide. Container
   queries follow the real width of the Micro Hub panel, not the viewport. */

.td-design-constellation {
  --tdc-bg: #fbfaf6;
  --tdc-card: #ffffff;
  --tdc-line: #e1e5dd;
  --tdc-ink: #173b3d;
  --tdc-muted: #4f625f;
  --tdc-active: #23695f;
  container: tdc / inline-size;
  display: block;
  min-width: 0;
  margin: 1.5rem 0;
  padding: clamp(1rem, 3vw, 1.4rem);
  border: 1px solid var(--tdc-line);
  border-radius: 1rem;
  background: var(--tdc-bg);
  color: var(--tdc-ink);
  overflow-wrap: anywhere;
}
.td-design-constellation[data-active-axis="room"] { --tdc-active: #23695f; }
.td-design-constellation[data-active-axis="style"] { --tdc-active: #66458f; }
.td-design-constellation[data-active-axis="material"] { --tdc-active: #8c572f; }
.td-design-constellation[data-active-axis="color"] { --tdc-active: #285c93; }
.td-design-constellation *,
.td-design-constellation *::before,
.td-design-constellation *::after { box-sizing: border-box; }
.td-design-constellation [hidden] { display: none !important; }
.td-design-constellation :is(a, button):focus-visible {
  outline: 3px solid #c88827;
  outline-offset: 2px;
}

/* One visual language for the Micro Hub tabs around the Explorer. */
.td-article-microhub--levels:has(.td-mh-article--explorer) {
  --td-mh-accent: #256a60;
  --td-mh-accent-dark: #164840;
  --td-mh-border: #d4e1d8;
}
.td-article-microhub--levels:has(.td-mh-article--explorer) .td-mh-tab:hover:not([aria-selected="true"]) {
  border-color: #9abdaf;
  background: #ebf4ed;
}
/* The Explorer owns the article panel: no second card frame around it. */
.td-article-microhub--levels .td-mh-panel:has(> .td-mh-article--explorer) {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.td-mh-article--explorer > .td-design-constellation { margin: 0; }

/* Heading: one eyebrow, one title. */
.td-design-constellation__eyebrow {
  display: block;
  color: var(--tdc-muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
}
.td-design-constellation__head h3 {
  margin: .2rem 0 0;
  color: var(--tdc-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.15;
}

/* Reading trail, visible only after the reader followed a guide. */
.td-design-constellation__trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .6rem;
  margin-top: .8rem;
  padding: .5rem .7rem;
  border-radius: .6rem;
  background: #eef3ee;
  color: var(--tdc-muted);
  font-size: .78rem;
}
.td-design-constellation__trail > span { font-weight: 700; }
.td-design-constellation__trail ol {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: .25rem .5rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.td-design-constellation__trail li { display: inline-flex; gap: .5rem; min-width: 0; }
.td-design-constellation__trail li + li::before { content: "›"; }
.td-design-constellation__trail a,
.td-design-constellation__trail a:visited { color: var(--tdc-ink); }
.td-design-constellation__trail [aria-current="page"] {
  max-width: 30ch;
  overflow: hidden;
  color: var(--tdc-ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.td-design-constellation__trail button {
  padding: .2rem .5rem;
  border: 1px solid #b9c9bd;
  border-radius: .4rem;
  background: var(--tdc-card);
  color: var(--tdc-ink);
  font: inherit;
  cursor: pointer;
}

.td-design-constellation__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem 1.5rem;
  margin-top: 1rem;
}

/* Subjects: a wrapped row of chips by default. */
.td-design-constellation__map { position: relative; min-width: 0; }
.td-design-constellation__lines,
.td-design-constellation__core { display: none; }
.td-design-constellation__topics {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.td-design-constellation__topic { --tdc-tone: #23695f; min-width: 0; position: relative; }
.td-design-constellation__topic[data-axis-tone="style"] { --tdc-tone: #66458f; }
.td-design-constellation__topic[data-axis-tone="material"] { --tdc-tone: #8c572f; }
.td-design-constellation__topic[data-axis-tone="color"] { --tdc-tone: #285c93; }
.td-design-constellation__topic-button,
.td-design-constellation__topic-link {
  display: inline-flex;
  max-width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: .05rem;
  padding: .4rem .8rem .45rem;
  border: 1px solid #cfd8d0;
  border-radius: .75rem;
  background: var(--tdc-card);
  color: var(--tdc-ink);
  font: inherit;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  overflow-wrap: normal;
  cursor: pointer;
  appearance: none;
}
.td-design-constellation__topic-axis {
  color: var(--tdc-tone);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.td-design-constellation__topic strong { font-size: .92rem; font-weight: 700; }
/* WordPress theme button states can otherwise turn the selected label white. */
.td-article-microhub--levels .td-design-constellation__topic strong {
  color: var(--tdc-ink);
}
.td-design-constellation__topic-button:hover,
.td-design-constellation__topic-link:hover { border-color: var(--tdc-tone); }
.td-design-constellation__topic-button[aria-pressed="true"] {
  border-color: var(--tdc-tone);
  background: color-mix(in srgb, var(--tdc-tone) 10%, #ffffff);
  box-shadow: inset 0 0 0 1px var(--tdc-tone);
}

/* JS enhancement: retain a real, visible canonical Hub link beside each
   selectable topic. Without JS the full-text link stays as the fallback. */
.td-design-constellation[data-constellation-ready="true"] .td-design-constellation__topic-button {
  padding-right: 2.3rem;
}
.td-design-constellation[data-constellation-ready="true"] .td-design-constellation__topic-link {
  position: absolute;
  z-index: 3;
  top: .3rem;
  right: .3rem;
  display: inline-flex;
  width: 1.65rem;
  height: 1.65rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: .45rem;
  background: transparent;
  color: var(--tdc-tone);
  font-size: 0;
}
.td-design-constellation[data-constellation-ready="true"] .td-design-constellation__topic-link:hover {
  background: color-mix(in srgb, var(--tdc-tone) 10%, #ffffff);
}
.td-design-constellation[data-constellation-ready="true"] .td-design-constellation__topic-link > * {
  display: none;
}
.td-design-constellation[data-constellation-ready="true"] .td-design-constellation__topic-link::after {
  content: "↗";
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

/* Guides of the selected subject. */
.td-design-constellation__discover { min-width: 0; }
.td-design-constellation__panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .25rem 1rem;
  margin-bottom: .55rem;
}
.td-design-constellation__panel-head h4 {
  margin: 0;
  color: var(--tdc-ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}
.td-design-constellation__panel-head a,
.td-design-constellation__panel-head a:visited {
  color: var(--tdc-active);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
}
.td-design-constellation__panel-head a:hover { text-decoration: underline; }
.td-design-constellation__cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .5rem;
}
.td-design-constellation__card,
.td-design-constellation__card:visited {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  align-items: center;
  gap: .75rem;
  padding: .4rem;
  border: 1px solid var(--tdc-line);
  border-radius: .7rem;
  background: var(--tdc-card);
  color: var(--tdc-ink);
  text-decoration: none;
}
.td-design-constellation__card:hover { border-color: var(--tdc-active); }
.td-design-constellation__card-image {
  display: flex;
  height: 4rem;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  border-radius: .45rem;
  background: #e4ebe5;
}
.td-design-constellation__card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.td-design-constellation__card-fallback,
.td-design-constellation__image-fallback {
  color: #6b827c;
  font: italic 1.4rem Georgia, serif;
}
.td-design-constellation__card strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.35;
}
/* Elementor link colors must not override editorial card legibility. */
.td-article-microhub--levels .td-design-constellation__card strong {
  color: var(--tdc-ink);
}
.td-article-microhub--levels .td-design-constellation__card:is(:hover, :focus-visible) strong {
  color: #205d58;
}
.td-design-constellation__discover[aria-busy="true"] .td-design-constellation__empty {
  display: none;
}
.td-design-constellation__loading {
  margin: .45rem 0;
  color: var(--tdc-muted);
  font-size: .85rem;
}
.td-design-constellation__empty {
  margin: 0;
  color: var(--tdc-muted);
  font-size: .88rem;
}

/* "Combina con": a single line, only partners with shared guides. */
.td-design-constellation__combine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-top: .75rem;
}
.td-design-constellation__combine > span { color: var(--tdc-muted); font-size: .78rem; }
.td-design-constellation__combine button {
  padding: .25rem .65rem;
  border: 1px dashed #aebcb2;
  border-radius: 999px;
  background: transparent;
  color: var(--tdc-ink);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}
.td-design-constellation__combine button[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--tdc-active);
  background: var(--tdc-card);
  color: var(--tdc-active);
  font-weight: 700;
}

/* Two subjects on a wide panel: the guide list uses two columns. */
@container tdc (min-width: 640px) {
  .td-design-constellation--row .td-design-constellation__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Three or four subjects on a wide panel: the guide at the centre of a small map.
   Each line means only "treated in this guide", never a link between subjects. */
@container tdc (min-width: 640px) {
  .td-design-constellation--map .td-design-constellation__body {
    grid-template-columns: minmax(0, 19rem) minmax(0, 1fr);
    align-items: start;
  }
  .td-design-constellation--map .td-design-constellation__map { height: 15.5rem; }
  .td-design-constellation--map .td-design-constellation__lines {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    stroke: #c3cdc4;
    stroke-width: 1;
  }
  .td-design-constellation--map .td-design-constellation__core {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    display: block;
    width: 7.5rem;
    transform: translate(-50%, -50%);
    text-align: center;
  }
  .td-design-constellation__core-image {
    display: flex;
    height: 5rem;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--tdc-card);
    border-radius: .7rem;
    background: #e4ebe5;
    box-shadow: 0 0 0 1px var(--tdc-line);
  }
  .td-design-constellation__core-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .td-design-constellation__core strong {
    display: -webkit-box;
    overflow: hidden;
    margin-top: .3rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.3;
  }
  .td-design-constellation--map .td-design-constellation__topics {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 0 .5rem;
    pointer-events: none;
  }
  .td-design-constellation--map .td-design-constellation__topic { pointer-events: auto; }
  .td-design-constellation--map .td-design-constellation__topic--1 { justify-self: start; align-self: start; }
  .td-design-constellation--map .td-design-constellation__topic--2 { justify-self: end; align-self: start; }
  .td-design-constellation--map .td-design-constellation__topic--3 { justify-self: start; align-self: end; }
  .td-design-constellation--map .td-design-constellation__topic--4 { justify-self: end; align-self: end; }
  .td-design-constellation--count-3 .td-design-constellation__topic--3 {
    grid-column: 1 / 3;
    justify-self: center;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .td-design-constellation__topic-button,
  .td-design-constellation__topic-link,
  .td-design-constellation__card,
  .td-design-constellation__combine button {
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
  }
}

/* The OR fallback is explicitly distinct from articles about both colors. */
.td-design-constellation__or-note {
  margin: 0 0 .65rem;
  color: var(--tdc-muted);
  font-size: .84rem;
  line-height: 1.45;
}
.td-design-constellation__or-option {
  display: grid;
  min-width: 0;
  gap: .25rem;
}
.td-design-constellation__or-label {
  color: var(--tdc-active);
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .02em;
}
