/*
 * Tignes Maison: The Gallery Hang.
 * Stories hang on a pigment wall and are labeled like objects in a collection.
 * Every colour comes from the theme.json presets; nothing here is a literal.
 */

:root {
  --tm-wall: var(--wp--preset--color--accent);
  --tm-gesso: var(--wp--preset--color--paper);
  --tm-ink: var(--wp--preset--color--ink);
  --tm-stone: var(--wp--preset--color--stone);
  --tm-line: var(--wp--preset--color--line);
  --tm-brass: var(--wp--preset--color--brass);
  --tm-display: var(--wp--preset--font-family--display);
  --tm-label: var(--wp--preset--font-family--label);
  --tm-gutter: clamp(1.25rem, 4vw, 3rem);
  --tm-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Browser surfaces that would otherwise ship unthemed. */
html {
  font-synthesis: none;
  scrollbar-color: var(--tm-wall) var(--tm-gesso);
  accent-color: var(--tm-wall);
}

::selection {
  background: var(--tm-brass);
  color: var(--tm-ink);
}

h1,
h2,
h3 {
  text-wrap: balance;
}

a {
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

/* The wall meets the bottom edge on short pages. */
.wp-site-blocks {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.wp-site-blocks > footer {
  margin-block-start: auto;
}

/* One continuous surface: no gaps between header, wall, rooms and footer. */
.wp-site-blocks > * {
  margin-block-start: 0;
}

.tm-main > * {
  margin-block-start: 0;
}

/* Walls and rooms ------------------------------------------------------- */

.tm-wall {
  background-color: var(--tm-wall);
  color: var(--tm-gesso);
}

.tm-wall a {
  color: inherit;
}

.tm-wall :focus-visible {
  outline-color: var(--tm-brass);
}

.tm-wall ::selection {
  background: var(--tm-brass);
  color: var(--tm-ink);
}

.tm-exhibit {
  padding: clamp(2.5rem, 6vw, 5rem) var(--tm-gutter) clamp(3rem, 8vw, 6rem);
}

.tm-exhibit > .wp-block-heading,
.tm-exhibit > .wp-block-query-title,
.tm-exhibit > .wp-block-site-title {
  margin-block: 0 clamp(1rem, 3vw, 2rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.tm-room {
  padding: clamp(3rem, 7vw, 5.5rem) var(--tm-gutter);
}

.tm-room > .wp-block-heading {
  margin-block: 0 clamp(1.5rem, 4vw, 3rem);
}

.tm-article {
  padding-block-end: clamp(3rem, 7vw, 5rem);
}

.tm-related {
  margin-block-start: clamp(3rem, 7vw, 5rem);
}

.tm-related > .wp-block-heading {
  margin-block: 0 clamp(1.5rem, 4vw, 2.5rem);
}

/* Signs: the header and footer ------------------------------------------- */

.tm-signs {
  padding: 1rem var(--tm-gutter);
}

.tm-signs__inner {
  gap: 0.25rem 2rem;
}

.tm-wordmark,
.tm-wordmark a {
  font-family: var(--tm-display);
  font-size: var(--wp--preset--font-size--large);
  line-height: 1;
  text-decoration: none;
  margin: 0;
}

.home .tm-signs .wp-block-site-title {
  display: none;
}

.tm-nav {
  font-family: var(--tm-label);
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.tm-nav .wp-block-navigation__container {
  gap: 0 1.75rem;
}

.tm-nav .wp-block-navigation-item__content {
  display: inline-block;
  padding-block: 0.8rem;
  text-decoration: none;
}

.tm-nav .wp-block-navigation-item__content:hover,
.tm-nav .wp-block-navigation-item__content[aria-current="page"],
.category-rooms .tm-signs a[href*="/category/rooms/"],
.category-furnishings .tm-signs a[href*="/category/furnishings/"],
.category-materials .tm-signs a[href*="/category/materials/"],
.category-lifestyle .tm-signs a[href*="/category/lifestyle/"],
.tag-guide .tm-signs a[href*="/tag/guide/"] {
  text-decoration: underline;
  text-underline-offset: 0.45em;
  color: var(--tm-brass);
}

.tm-footer {
  padding: clamp(2.5rem, 6vw, 4rem) var(--tm-gutter) clamp(3rem, 7vw, 5rem);
}

.tm-footer__inner {
  gap: 1.5rem 3rem;
}

.tm-nav--footer .wp-block-navigation__container {
  gap: 0 1.5rem;
}

@media (max-width: 40rem) {
  .tm-signs__inner .tm-nav {
    flex: 1 1 100%;
  }

  .tm-signs__inner .wp-block-navigation__container {
    justify-content: flex-start;
  }
}

/* Labels: the wall text that goes with every hung work ------------------- */

.tm-label {
  margin: 0;
}

.tm-label .wp-block-post-title {
  margin-block: 0 0.6rem;
}

.tm-label .wp-block-post-title a {
  text-decoration: none;
  color: inherit;
}

.tm-label .wp-block-post-title a:hover {
  text-decoration: underline;
}

.tm-caption {
  gap: 0.15rem 0;
  margin-block: 0 0.75rem;
  font-family: var(--tm-label);
  font-size: var(--wp--preset--font-size--small);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--tm-stone);
}

.tm-wall .tm-caption {
  color: var(--tm-brass);
}

.tm-caption a {
  color: inherit;
  text-decoration: none;
}

.tm-caption a:hover {
  text-decoration: underline;
}

.tm-caption > * {
  margin: 0;
}

.tm-caption > *:not(:last-child)::after {
  content: "\00b7";
  margin-inline: 0.6em;
}

.tm-label .wp-block-post-excerpt {
  margin: 0;
}

.tm-label .wp-block-post-excerpt__excerpt {
  margin: 0;
}

/* The hero: one large photograph, its label beside it -------------------- */

.tm-hero .wp-block-post-template {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tm-hero .wp-block-post-template > li {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--tm-gutter);
  row-gap: 1.5rem;
  align-items: end;
  margin: 0;
}

.tm-hero .wp-block-post-featured-image {
  grid-column: 1 / span 8;
  margin: 0;
}

.tm-hero .wp-block-post-featured-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.tm-hero .tm-label {
  grid-column: 9 / -1;
}

.tm-hero .tm-label .wp-block-post-excerpt__excerpt {
  font-size: var(--wp--preset--font-size--base);
}

@media (max-width: 52rem) {
  .tm-hero .wp-block-post-template > li {
    display: block;
  }

  .tm-hero .tm-label {
    margin-block-start: 1.5rem;
  }
}

/* Wall label plate: a hairline over every label, brass on the wall. */
.tm-hang .tm-label {
  padding-block-start: 0.75rem;
  border-block-start: 1px solid var(--tm-line);
}

.tm-wall .tm-label {
  padding-block-start: 0.75rem;
  border-block-start: 1px solid var(--tm-brass);
}

/* A work with no photograph gets a plate of pigment so the hang keeps its rhythm. */
.tm-hang > li:not(:has(.wp-block-post-featured-image))::before,
.tm-hero .wp-block-post-template > li:not(:has(.wp-block-post-featured-image))::before {
  content: "";
  display: block;
  margin-block-end: 1rem;
  background-color: var(--tm-wall);
  aspect-ratio: var(--tm-ratio, 4 / 3);
}

.tm-hero .wp-block-post-template > li:not(:has(.wp-block-post-featured-image))::before {
  grid-column: 1 / span 8;
}

/* The hang: works placed at different scales on the wall ----------------- */

.tm-hang {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(2.5rem, 5vw, 4.5rem) var(--tm-gutter);
  align-items: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tm-hang > li {
  grid-column: span 4;
  margin: 0;
  min-width: 0;
}

.tm-hang > li:nth-child(5n + 1) {
  grid-column: span 7;
  --tm-ratio: 4 / 3;
}

.tm-hang > li:nth-child(5n + 2) {
  grid-column: span 5;
  align-self: end;
  --tm-ratio: 4 / 5;
}

.tm-hang > li:nth-child(5n + 3) {
  --tm-ratio: 1 / 1;
}

.tm-hang > li:nth-child(5n + 4) {
  margin-block-start: clamp(0rem, 4vw, 3rem);
  --tm-ratio: 4 / 5;
}

.tm-hang > li:nth-child(5n + 5) {
  --tm-ratio: 3 / 2;
}

.tm-hang--three > li:nth-child(n) {
  grid-column: span 4;
  align-self: start;
  margin-block-start: 0;
  --tm-ratio: 4 / 3;
}

.tm-hang .wp-block-post-featured-image {
  margin: 0 0 1rem;
}

.tm-hang .wp-block-post-featured-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--tm-ratio, 4 / 3);
  object-fit: cover;
}

@media (max-width: 52rem) {
  .tm-hang {
    grid-template-columns: minmax(0, 1fr);
  }

  .tm-hang > li:nth-child(n),
  .tm-hang--three > li:nth-child(n) {
    grid-column: 1 / -1;
    align-self: start;
    margin-block-start: 0;
    --tm-ratio: 4 / 3;
  }
}

/* One authored moment: the spotlight moves to the work you point at. */
@media (prefers-reduced-motion: no-preference) {
  .tm-hang > li {
    transition: opacity 450ms var(--tm-ease);
  }
}

@media (hover: hover) {
  .tm-hang:has(> li:hover) > li:not(:hover),
  .tm-hang:has(> li:focus-within) > li:not(:focus-within) {
    opacity: 0.6;
  }
}

/* Directory: the categories as a list of large names --------------------- */

.tm-directory {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tm-directory li {
  margin: 0;
  border-block-start: 1px solid var(--tm-line);
}

.tm-directory li:last-child {
  border-block-end: 1px solid var(--tm-line);
}

.tm-directory a {
  display: block;
  padding-block: 1rem;
  font-family: var(--tm-display);
  font-size: var(--wp--preset--font-size--xx-large);
  line-height: 1.05;
  text-decoration: none;
  color: var(--tm-ink);
}

.tm-directory a:hover {
  color: var(--tm-wall);
  text-decoration: underline;
}

.tm-directory--small a {
  padding-block: 0.5rem;
  font-size: var(--wp--preset--font-size--large);
}

.tm-empty p {
  font-size: var(--wp--preset--font-size--large);
  margin-block: 0 1rem;
}

/* Articles: the lights come up ------------------------------------------- */

.tm-article-head {
  margin-block-end: clamp(2rem, 5vw, 3.5rem);
}

.tm-article-head .wp-block-post-title {
  margin-block: 0 1rem;
}

.tm-standfirst {
  margin-block: 1rem 2rem;
  font-size: var(--wp--preset--font-size--large);
  line-height: 1.4;
}

.tm-standfirst .wp-block-post-excerpt__excerpt {
  margin: 0;
}

.tm-feature-title {
  margin-block: 0 1.25rem;
  font-size: clamp(2.5rem, 7vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.tm-exhibit .wp-block-post-featured-image {
  margin: clamp(1.5rem, 4vw, 2.5rem) 0 0;
}

.tm-exhibit .wp-block-post-featured-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.tm-wall .tm-standfirst {
  margin-block: 1rem 0;
}

.tm-article .wp-block-post-featured-image {
  margin: 0;
}

.tm-article .wp-block-post-featured-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.wp-block-post-content > h2 {
  margin-block: 3rem 1rem;
}

.wp-block-post-content > h3 {
  margin-block: 2.25rem 0.75rem;
}

.wp-block-post-content > .alignwide,
.wp-block-post-content > .alignfull {
  margin-block: 2.5rem;
}

.wp-block-pullquote {
  text-align: left;
  padding-block: 2rem;
  border-width: 1px 0;
  border-style: solid;
  border-color: var(--tm-ink);
}

.wp-block-pullquote p {
  font-family: var(--tm-display);
  font-size: var(--wp--preset--font-size--xx-large);
  line-height: 1.05;
  text-align: left;
  color: var(--tm-wall);
}

.wp-block-pullquote cite {
  font-family: var(--tm-label);
  font-size: var(--wp--preset--font-size--small);
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tm-stone);
}

/* Guide verdict: what is certain in solid type, what is caveated in hairline. */

.tm-verdict {
  margin-block: 2rem 3rem;
  padding-block: 1.5rem;
  border-width: 1px 0;
  border-style: solid;
  border-color: var(--tm-ink);
}

.tm-verdict__pick {
  margin-block: 0 1rem;
  font-family: var(--tm-display);
  font-size: var(--wp--preset--font-size--x-large);
  line-height: 1.15;
}

.tm-verdict__best {
  margin-block: 0 0.5rem;
  font-weight: 600;
}

.tm-verdict__skip {
  margin: 0;
  font-weight: 400;
  color: var(--tm-stone);
}

.tm-verdict strong {
  margin-inline-end: 0.6em;
  font-family: var(--tm-label);
  font-size: var(--wp--preset--font-size--small);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Search ------------------------------------------------------------------ */

.tm-search {
  margin-block: 1.5rem 0;
}

.tm-search .wp-block-search__inside-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 40rem;
  border-block-end: 1px solid currentColor;
}

.tm-search .wp-block-search__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.75rem 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--tm-label);
  font-size: var(--wp--preset--font-size--large);
}

.tm-search .wp-block-search__input::placeholder {
  color: color-mix(in srgb, currentColor 75%, transparent);
  opacity: 1;
}

.tm-search .wp-block-search__button {
  margin: 0;
  padding: 0.75rem 0;
  border: 0;
  background: transparent;
  color: var(--tm-brass);
  font-family: var(--tm-label);
  font-size: var(--wp--preset--font-size--small);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
}

.tm-search .wp-block-search__button:hover {
  text-decoration: underline;
}

/* Pagination and small furniture ------------------------------------------ */

.tm-pagination {
  margin-block-start: clamp(3rem, 6vw, 4.5rem);
  font-family: var(--tm-label);
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.tm-pagination a,
.tm-pagination .page-numbers {
  padding: 0.5rem 0.25rem;
  text-decoration: none;
}

.tm-pagination a:hover {
  text-decoration: underline;
}

.tm-newsletter {
  padding: clamp(1.5rem, 4vw, 3rem);
}

.tm-newsletter > h2 {
  margin-block: 0 0.5rem;
}
