/* Layout fixes on top of the Silk theme (loaded after the theme stylesheet). */

/* Custom sections (.cex-*) size their wrapper as min(90vw, 1600px). Inside the
   theme's padded content column that is wider than the column, so margin:auto
   went negative and boxes overshot the shared right edge (e.g. contact form
   ended at 1382px while the map ends at 1353px). Cap them to the column. */
.window--wide .cex-wrap {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

@media (min-width: 768px) {
  /* Footer columns: flex + justify-between gave uneven gaps (428/275/332px).
     Four equal columns instead, all starting on the same row. */
  .sa-footer-cols {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 48px;
  }
  .sa-footer-cols > .max-w-\[250px\] { max-width: 280px; }
  /* Link columns have no heading: push the first link down to the first text
     row of the "Space Arch" / "Showroom" columns. */
  .sa-footer-cols > nav { padding-top: var(--sa-footer-heading-offset, 42px); }

  /* Bottom bar: Instagram and copyright were on two staggered rows. One row. */
  .sa-footer-bar {
    display: grid !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    row-gap: 0 !important;
  }
  .sa-footer-bar > .window--wide:first-child { padding-right: 0; width: auto; }
  .sa-footer-bar > .window--wide:last-child { padding-left: 0; }
}

/* Instagram icon under the footer brand text. */
.sa-footer-ig {
  display: inline-flex;
  margin-top: 16px;
  color: inherit;
  opacity: .7;
  transition: opacity .2s;
}
.sa-footer-ig:hover { opacity: 1; }
.sa-footer-ig svg { width: 22px; height: 22px; }

/* Language switcher (header, before "Quote"). Inherits the header's type and colors. */
.sa-lang { position: relative; display: inline-flex; align-items: center; margin-inline-start: 24px; }
.sa-lang__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
}
.sa-lang__btn svg { opacity: .7; transition: transform .2s; }
.sa-lang__btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.sa-lang__menu {
  position: absolute; top: calc(100% + 12px); inset-inline-end: 0; z-index: 60;
  min-width: 152px; padding: 6px;
  background: var(--color__background-body, #fff);
  border: 1px solid var(--color__border-divider-1, rgba(0,0,0,.15));
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  text-align: start;
}
.sa-lang__item {
  display: block; padding: 10px 12px; color: inherit; text-decoration: none; white-space: nowrap;
  font-family: var(--type__font-body-family); font-size: 15px;
}
.sa-lang__item:hover { background: var(--color__background-shade-1, rgba(0,0,0,.04)); text-decoration: none; }
.sa-lang__item.is-active { font-weight: 700; }
@media (max-width: 767px) {
  .sa-lang { margin-inline-start: 0; }
  .sa-lang__menu { top: calc(100% + 16px); }
}

/* Translated pages: Russian/Italian/Arabic words can be much longer than the English
   ones the theme was laid out for (e.g. "Исключительные" in a third-width card at
   768px). Let them hyphenate/wrap instead of overflowing. English is untouched. */
html:not([lang="en"]) :is(h1, h2, h3, h4, h5, p, li, a, button, label) {
  overflow-wrap: break-word;
  hyphens: auto;
}
html:not([lang="en"]) .flex-1 { min-width: 0; }

/* Catalogues page (/pages/catalogues). Matches the collection grid: 5px gaps,
   square corners, product-card label colour under each cover. */
.sa-cats__inner { padding-top: 20px; padding-bottom: 64px; }
.sa-cats__lead { margin-bottom: 24px; opacity: .75; }
.sa-cats__grid { display: grid; grid-template-columns: 1fr; gap: 5px; }
@media (min-width: 768px) { .sa-cats__grid { grid-template-columns: 1fr 1fr; } }
.sa-cats__item { display: flex; flex-direction: column; min-width: 0; }
.sa-cats__cover { display: block; overflow: hidden; aspect-ratio: 4 / 3; }
.sa-cats__cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s ease;
}
.sa-cats__cover:hover img { transform: scale(1.02); }
.sa-cats__body { display: flex; flex-direction: column; gap: 6px; padding: 20px 16px 24px; flex: 1; }
.sa-cats__title { font-size: var(--type__font-heading-5); margin: 0; }
.sa-cats__summary, .sa-cats__meta { margin: 0; }
.sa-cats__meta { opacity: .7; font-size: var(--type__font-small); }
.sa-cats__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 16px; }
.sa-cats__actions .btn { min-width: 132px; }

/* "View catalogue" link beside a collection title. */
.sa-cat-link {
  display: inline-flex; align-items: center; gap: 8px; margin-inline-start: auto;
  order: 2; padding: 8px 0; text-decoration: none; white-space: nowrap;
}
.sa-cat-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.sa-cat-link svg { flex: none; }

/* Featured project video on the home page. Square 16:9 frame like the
   collection grid; poster + play button until clicked (see /video.js). */
.sa-video__inner {
  padding-top: 50px; padding-bottom: 50px;
  display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center;
}
@media (min-width: 1024px) { .sa-video__inner { grid-template-columns: 1fr minmax(0, 560px); gap: 48px; } }
.sa-video__text { max-width: 65ch; }
.sa-yt {
  position: relative; display: block; width: 100%; max-width: 640px; aspect-ratio: 16 / 9;
  overflow: hidden; border: 0; background: #000;
}
.sa-yt img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.sa-yt:hover img { transform: scale(1.02); }
.sa-yt__play {
  position: absolute; inset: 0; margin: auto; width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(0, 0, 0, .6);
  border: 1px solid rgba(255, 255, 255, .5); transition: background .2s ease;
}
.sa-yt:hover .sa-yt__play, .sa-yt:focus-visible .sa-yt__play { background: rgba(0, 0, 0, .85); }
.sa-yt:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.sa-yt__play svg { margin-inline-start: 4px; }
