/* Public page openings, buying frames and navigation share the Maison palette. */
:root {
  --artstria-paper: #f3eee5;
  --artstria-frame: #dcd0be;
  --artstria-ease: cubic-bezier(.22, 1, .36, 1);
  --artstria-page-width: min(1500px, calc(100% - 2 * clamp(16px, 4.4vw, 72px)));
  --artstria-frame-radius: clamp(14px, 1.55vw, 24px);
}

html[data-storefront-motion] { scroll-padding-block-start: 4.5rem; }

@media (prefers-reduced-motion: no-preference) {
  html[data-storefront-motion]:not(.a63-reduced,.r62-solid,:has(main[data-page-motion="editorial"])) {
    scroll-behavior: smooth;
  }
}

.storefront-legal-note {
  width: var(--artstria-page-width);
  margin: 1rem auto;
  padding: .85rem 1rem;
  border: 1px solid var(--artstria-frame);
  border-radius: .75rem;
  background: var(--artstria-paper);
}

main :is(.r73-buying,.r68-buying,.apod-product-summary) h1 {
  font-size: clamp(2.125rem, 4.5vw, 4.375rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

main :is(.r73-buying,.r68-buying,.apod-product-summary) :is(a,button) {
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

html[dir="rtl"] main :is(.r73-buying,.r68-buying,.apod-product-summary,.r90-copy) {
  text-align: start;
}

html[lang="ar"] main :is(h1,h2) {
  letter-spacing: normal;
  line-height: 1.25;
}

.apod-editor [data-dimensions] {
  direction: ltr;
  unicode-bidi: isolate;
}

main > .r77-crumb {
  width: var(--artstria-page-width);
  max-width: none;
  margin-inline: auto;
  padding-inline: 0;
}

main .r90-hero:not(.r107-dark) {
  background: linear-gradient(145deg, #fbf8f0, var(--artstria-paper));
  border-color: var(--artstria-frame);
}

main .r90-hero {
  border-radius: var(--artstria-frame-radius);
}

main .r90-copy {
  text-align: start;
}

main .r90-copy h1 {
  hyphens: auto;
  text-wrap: balance;
}

main .r90-copy > :is(.hero-cta, .r90-actions, .r81-actions, .pg-cta, .hb-cta) > a {
  min-block-size: 44px;
  white-space: normal;
}

body.r73-product-page main > .r73-product,
body.r73-product-page.r67-site main > .pdp:has(.r68-product) > .wrap {
  width: var(--artstria-page-width);
  max-width: none;
  margin: clamp(14px, 2.2vw, 34px) auto;
}

body.r73-product-page.r67-site main > .pdp:has(.r68-product) { background: transparent; }

body.r73-product-page main :is(.r73-product, .pdp-grid.r68-product) {
  border: 1px solid var(--artstria-frame);
  border-radius: var(--artstria-frame-radius);
  overflow: clip;
  background: var(--artstria-paper);
}

body.r73-product-page main:has(> .r77-crumb) :is(.r73-buying > .r73-crumb, .r68-buying > .crumb) {
  display: none;
}

body.r73-product-page main :is(.r73-buying, .r68-buying) {
  padding: clamp(20px, 3.1vw, 48px);
}

body.r73-product-page.r67-site .r68-buying .pdp-t { text-wrap: balance; }

body.r73-product-page main :is(.r73-gallery-grid, .r68-gallery) {
  min-height: clamp(300px, 39vw, 640px);
}

@media (max-width: 960px) {
  body.r73-product-page main :is(.r73-gallery-grid, .r68-gallery) { min-height: 0; }
}

@media (max-width: 660px) {
  body .art-chat-launch {
    inline-size: 46px;
    min-block-size: 46px;
    justify-content: center;
    padding: 0;
  }

  body .art-chat-launch > span {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  body:has(.r67-buybar:not([hidden])) .art-chat-launch {
    --ac-bottom: calc(max(16px, env(safe-area-inset-bottom)) + 107px);
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .as-showcase-copy > div > a,
  main .r90-copy :is(.r90-primary, .r90-secondary, .hero-cta a) {
    transition: background-color .22s ease, border-color .22s ease, color .22s ease;
  }

  .as-digital-card img,
  .r91-lineup a img {
    transition: transform .4s var(--artstria-ease);
  }

  .as-digital-card {
    overflow: clip;
    transition: border-color .2s ease;
  }

  .as-digital-card:hover { border-color: #b09059; }
  .as-digital-card a:hover img { transform: scale(1.025); }
  .r91-lineup a:hover img { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

::view-transition-old(root) {
  animation: 170ms ease-in both artstria-page-out;
}

::view-transition-new(root) {
  animation: 330ms var(--artstria-ease) both artstria-page-in;
}

::view-transition { background: var(--artstria-paper); }

@keyframes artstria-page-out { to { opacity: 0; } }
@keyframes artstria-page-in { from { opacity: 0; transform: translateY(7px); } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(root), ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
